From f15f7a230b1c96c4e1b3fe76cd3dc9a994b9c352 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Mar 2020 17:58:46 +0800 Subject: [PATCH 0001/1809] TSL PART 1 --- ...ware projects working to solve COVID-19.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) rename {sources => translated}/tech/20200319 7 open hardware projects working to solve COVID-19.md (68%) diff --git a/sources/tech/20200319 7 open hardware projects working to solve COVID-19.md b/translated/tech/20200319 7 open hardware projects working to solve COVID-19.md similarity index 68% rename from sources/tech/20200319 7 open hardware projects working to solve COVID-19.md rename to translated/tech/20200319 7 open hardware projects working to solve COVID-19.md index 3d89271d1c..b330a7127d 100644 --- a/sources/tech/20200319 7 open hardware projects working to solve COVID-19.md +++ b/translated/tech/20200319 7 open hardware projects working to solve COVID-19.md @@ -7,47 +7,47 @@ [#]: via: (https://opensource.com/article/20/3/open-hardware-covid19) [#]: author: (Harris Kenny https://opensource.com/users/harriskenny) -7 open hardware projects working to solve COVID-19 +应对新冠病毒事件的 7 个开放硬件项目 ====== -Open hardware solutions can prevent the spread and suffering of the -novel coronavirus. +> 开放硬件解决方案可以为抵御新型冠状病毒的传播和痛苦做出贡献。 + ![open on blue background with heartbeat symbol][1] -The open source [hardware][2] movement has long championed the importance of the right to repair, fully own the technology you buy, and be able to remix and reproduce gadgets, just like you can with music. And so, during this challenging time, open hardware is providing some answers to some of the problems created by the coronavirus pandemic. +开源[硬件][2]运动长期以来一直主张维修权的重要性,完全拥有所购买的技术,并能够像音乐一样重新组合和复制组件。因此,在这个充满挑战的时期内,开放硬件为由冠状病毒大流行引起的一些问题提供了一些答案。 -### An overview of what's happening +### 背景概述 -For one, hardware developers around the world are working to resolve supply chain weaknesses using open source, the same philosophy that has driven a proliferation of new software technologies over the last 30 years. The hardware movement's past successes include the [RepRap Project][3], [Open Source Ecology][4], and [Open Source Beehives][5], proving this can be done. +首先,全球的硬件开发人员正在努力使用开源解决供应链中的弱点,在过去 30 年中,这种理念推动了新软件技术的大量涌现。过去在硬件运动方面的成功,如 [RepRap Project][3],[Open Source Ecology][4] 和 [Open Source Beehives][5],证明了这一点是可以做到的。 -There has been increasing interest in creators using 3D printing and other technologies to create replacement parts for and manufacturing of safety equipment on demand. For example, the Polytechnic University lab in Hong Kong [3D printed face shields][6] for hospital workers. And Italian startup Isinnova partnered with the FabLab in Milan to [3D-print replacement valves][7] for reanimation devices in hard-hit Northern Italy. Companies are also releasing designs to adapt our physical interactions, like this [3D printed hands-free door opener][8] from Materialise. These examples of replacing parts and solving problems are an excellent start and appear to be saving lives. +对使用 3D 打印和其他技术按需制造安全设备的替换零件和按需生产的创作者的兴趣日益增加。例如,香港理工大学实验室为医院工作人员提供 [3D 打印面罩][6]。意大利初创公司 Isinnova 与米兰 FabLab 合作,为受重灾的意大利北部提供用于呼吸机的 [3D 打印替换阀][7]。公司们还发布了设计以适应我们的物理接触,例如 Materialise 的 [3D 打印免提开门器] [8]。这些更换零件和解决问题的示例是一个很好的起点,为挽救生命做出了努力。 -Another traditional hardware technique is picking up steam: sewing. The AFP reports that there is an acute need for face masks around the world and guidance from the World Health Organization about their importance. With single-use, disposable masks being prioritized for healthcare workers, in the Czech Republic people are [taking to sewing to make their own masks][9]. (Repeat-use masks do introduce sterility concerns.) The Facebook group "Czechia sews face masks" started to address this problem in their country, with tens of thousands of members using their at-home sewing machines. +另一种传统的硬件技术正在加速发展:缝纫。法新社报道说,全球急需口罩,来自世界卫生组织的指导也指明了其重要性。随着一次性口罩要优先供给于医护人员,捷克共和国的人们[开始缝制自己的口罩][9]。(重复使用的口罩确实会带来细菌问题。)Facebook 小组“捷克缝制口罩”开始在他们的国家解决这个问题,成千上万的成员开始用起了他们的家用缝纫机。 -Open source hardware equipment and machinery projects are also gaining traction. First, there is testing equipment that is sophisticated and highly capable. Next, there is medical equipment that can be categorized as field-grade (at best) for scenarios with no other option. These projects are outlined in detail below. +开源硬件设备和机械项目也越来越受欢迎。首先,有一些测试性设备具备高精度且功能强大。其次,在没有其他选择方案的情况下,有一些医疗设备可以归类为现场级(最好)。这些项目将在下面详细概述。 -To learn more, I spoke with Jason Huggins, founder and CEO of Chicago-based [Tapster Robotics][10]. Tapster Robotics designs and manufactures desktop robots using 3D printing, computer numerical control (CNC) machining, and open electronics like [Arduino][11]. He has both the technical know-how and the industrial capacity to make an impact. And he wants to commit his company's resources to help in this fight. +为了解更多信息,我与总部位于芝加哥的 [Tapster Robotics][10] 的创始人兼首席执行官 Jason Huggins 进行了交谈。Tapster Robotics 使用 3 D打印、计算机数控(CNC)加工和 [Arduino][11] 等开放式电子产品设计和制造台式机器人。他兼具技术知识和工业能力,具有很高的影响力。他想投入自己公司的资源来帮助这场斗争。 -"Basically, we're in a World War II mobilization moment right now. Even though I'm not a doctor, we should still all follow the Hippocratic Oath. Whatever I do, I don't want to make the problem worse," Huggins explains. "As a counterpoint, there is WHO executive director Dr. Michael Ryan's comment: 'Speed trumps perfection,'" Huggins argues. +“基本上,我们现在正处于第二次世界大战的动员时刻。即使我不是医生,我们仍然应该遵循希波克拉底誓言。无论我做什么,我都不想让问题变得更糟,” Huggins 解释。他认为:“作为对策,世卫组织执行主任 Michael Ryan 博士发表了这样的评论:‘速度胜过完美’。” -> Wow. +> 哇 > -> This man is the global authority on the spread of disease. If you are a leader (in any capacity) watch this. If you are not, watch it too. [pic.twitter.com/bFogaekehM][12] +> 这个人是疾病传播的全球权威。如果您是领导者(无论以何种身份),请注意。如果不是,也请注意。 [pic.twitter.com/bFogaekehM][12] > -> — Jim Richards Sh🎙wgram (@JIMrichards1010) [March 15, 2020][13] +> — Jim RichardsSh🎙wgram(@JIMrichards1010)[2020 年 3 月 15 日][13] -Huggins has extensive experience with delivering during times of need. His efforts were instrumental in helping [Healthcare.gov][14] scale after its challenging initial launch. He also created the software industry-standard testing frameworks Selenium and Appium. With this experience, his advice is well worth considering. +Huggins 在应需提供方面具有丰富的经验。他的努力有助于 [Healthcare.gov][14] 在挑战性的最初启动后得以扩展。他还创建了软件行业标准的测试框架 Selenium 和 Appium。有了这一经验,他的建议非常值得考虑。 -I also spoke with Seattle-based attorney Mark Tyson of [Tyson Law][15], who works with startups and small businesses. He has direct experience working with nimble companies in rapidly evolving industries. In framing the overall question, Tyson begins: +我还与 [Tyson Law][15] 的西雅图律师 Mark Tyson 进行了交谈,他与初创公司和小型企业合作。他在快速发展的行业中与敏捷公司合作有着直接的经验。在阐述整个问题时,Tyson 说到: -> Good Samaritan laws protect volunteers—i.e., “Good Samaritans”—from being held liable as a result of their decision to give aid during an emergency. While the specifics of these laws vary by state, they share a common public policy rationale: namely, encouraging bystanders to help others facing an emergency. Conceivably, this rationale could justify application of these types of laws in less traditional settings than, say, pulling the victim of a car accident out of harm’s way. +> 《善良的撒玛利亚人法Good Samaritan law》保护志愿者(即“好撒玛利亚人”)免于因其决定在紧急情况下提供援助而承担责任。尽管这些法律的具体内容因州而异,但它们具有共同的公共政策依据:即鼓励旁观者帮助遇到紧急情况的其他人。可以想象,除了传统的把车祸的受害者从伤害中拉出来之外,这种理论依据可以证明在不太传统的环境中应用这类法律的合理性。 -Applying this specific situation, Tyson notes: +对于这种特定情况,Tyson 指出: -> "Before taking action, creators would be wise to speak with an attorney to conduct a state-specific risk assessment. It would also be prudent to ask larger institutions, like hospitals or insurers, to accept potential liability exposure via contract—for instance, through the use of indemnification agreements, whereby the hospital or its insurer agrees to indemnify the creator for liability." +> “在采取行动之前,创客们明智的做法是与律师沟通一下,以针对特定的州进行风险评估。还应谨慎地要求大型机构(例如医院或保险公司)通过合同接受潜在的责任风险,例如,通过使用赔偿协议,使医院或其保险人同意赔偿创客们的责任。” -Tyson understands the urgency and gravity of the situation. This option to use contracts is not meant to be a roadblock; instead, it may be a way to help adoption happen at scale to make a bigger difference faster. It is up to you or your organization to make this determination. +Tyson 明白情况的紧迫性和严重性。使用合同的这种选择并不意味着障碍。相反,这可能是一种帮助其大规模采用的方法,以更快地产生更大的变化。这取决于你或你的机构。 -With all that said, let's explore the projects that are in use or in development (and may be available for deployment soon). +综上所述,让我们探索正在使用或正在开发中的项目(可能很快就可以部署)。 ### 7 open hardware projects fighting COVID-19 From 9b0e6093888e160ceefef1ff15e0d6d8d6cf53f3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Mar 2020 22:13:16 +0800 Subject: [PATCH 0002/1809] TSL --- ...ware projects working to solve COVID-19.md | 76 +++++++++---------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/translated/tech/20200319 7 open hardware projects working to solve COVID-19.md b/translated/tech/20200319 7 open hardware projects working to solve COVID-19.md index b330a7127d..2655544108 100644 --- a/translated/tech/20200319 7 open hardware projects working to solve COVID-19.md +++ b/translated/tech/20200319 7 open hardware projects working to solve COVID-19.md @@ -49,92 +49,90 @@ Tyson 明白情况的紧迫性和严重性。使用合同的这种选择并不 综上所述,让我们探索正在使用或正在开发中的项目(可能很快就可以部署)。 -### 7 open hardware projects fighting COVID-19 +### 7 个与新冠病毒对抗的开放硬件项目 #### Opentrons -[Opentrons][16]' open source lab automation platform is comprised of a suite of open source hardware, verified labware, consumables, reagents, and workstations. Opentrons says its products can help dramatically [scale-up COVID-19 testing][17] with systems that can "automate up to 2,400 tests per day within days of an order being placed." It plans to ramp up to 1 million tested samples by July 1. +[Opentrons][16] 的开源实验室自动化平台由一套开源硬件、经过验证的实验室器具、消耗品、试剂和工作站组成。Opentrons 表示,其产品可以“在下订单后几天内每天自动进行多达 2400 个测试”的系统,可以极大地帮助提高[新冠病毒测试规模][17]。它计划在 7 月 1 日之前提升多达 100 万个测试样本。 ![Opentrons roadmap graphic][18] -From the Opentrons [website][17], Copyright +*来自 Opentrons [网站][17],版权所有* -The company is already working with federal and local government agencies to determine if its systems can be used for clinical diagnosis under an [emergency use authorization][19]. Opentrons is shared under an [Apache 2.0 license][20]. I first learned of it from biologist Kristin Ellis, who is affiliated with the project. +该公司已经在与联邦和地方政府机构合作,以确定其系统是否可以在[紧急使用授权][19]下用于临床诊断。 Opentrons 在 [Apache 2.0 许可证][20]下共享。我最初是从与该项目有联系的生物学家 Kristin Ellis 斯那里得知它的。 -#### Chai Open qPCR +#### Chai 的 Open qPCR -Chai's [Open qPCR][21] device uses [polymerase chain reaction][22] (PCR) to rapidly test swabs from surfaces (e.g., door handles and elevator buttons) to see if the novel coronavirus is present. This open source hardware shared under an [Apache 2.0 license][23] uses a [BeagleBone][24] low-power Linux computer. Data from the Chai Open qPCR can enable public health, civic, and business leaders to make more informed decisions about cleaning, mitigation, facility closures, contract tracing, and testing. +Chai 的 [Open qPCR][21] 设备使用[聚合酶链反应][22](PCR)快速检测物品表面(例如,门把手和电梯按钮)上的拭子,以查看是否存在新型冠状病毒。这种在 [Apache 2.0 许可证][23]下共享的开源硬件使用 [BeagleBone][24] 低功耗 Linux 计算机。Chai 的 Open qPCR 提供的数据可以使公共卫生、公民和企业领导者做出有关清洁、缓解、关闭设施、接触追踪和测试的更明智的决策。 #### OpenPCR -[OpenPCR][25] is a PCR testing device kit from Josh Perfetto and Jessie Ho, the creators behind the Chai Open qPCR. This is more of a DIY open source device than their previous project, but it has the same use case: using environmental testing to identify the coronavirus in the field. As the project page states, "traditional real-time PCR machines capable of detecting these pathogens typically cost upwards of $30,000 US dollars and are not suitable for field usage." Because OpenPCR is a kit users build and is shared under a [GPLv3.0 license][26], the device aims to democratize access to molecular diagnostics. +[OpenPCR][25] 是 Chai Open qPCR 的创建者 Josh Perfetto 和 Jessie Ho 的 PCR 测试设备套件。与以前的项目相比,这更像是一种 DIY 开源设备,但它具有相同的使用场景:使用环境测试来识别野外冠状病毒。正如该项目页面所指出的那样,“能够检测这些病原体的传统实时 PCR 机通常花费超过 30,000 美元,而且不适合在现场使用。”由于 OpenPCR 是用户构建的工具包,并且在 [GPLv3.0 许可证][26]下共享,因此该设备旨在使分子诊断的访问大众化。 ![OpenPCR][27] -From the OpenPCR [website][25], Copyright +*来自 OpenPCR [网站][25],版权所有* -And, like any good open source project, there is a derivative! [WildOpenPCR][28] by [GaudiLabs][29] in Switzerland is also shared under a [GPLv3.0 license][30]. +而且,就像任何优秀的开源项目一样,它也有一个衍生产品!瑞士的 [GaudiLabs][29] 推出的 [WildOpenPCR][28] 也以 [GPLv3.0 许可证][30]共享。 #### PocketPCR -Gaudi Labs' [PocketPCR][31] thermocycler is used to activate biological reactions by raising and lowering the temperature of a liquid in small test tubes. It can be powered with a simple USB power adapter, either tethered to a device or on its own, with preset parameters that don't require a computer or smartphone. +Gaudi Labs 的 [PocketPCR][31] 热循环仪可通过升高和降低小试管中液体的温度来激活生物反应。它可以通过简单的 USB 电源适配器供电,该适配器可以绑定到设备上,也可以单独使用,不需要计算机或智能手机时可使用预设参数。 ![PocketPCR][32] -From the PocketPCR [website][31], Copyright +*来自 PocketPCR [网站][31],版权所有* -Like the other PCR options described in this article, this device may facilitate environmental testing for coronavirus, although its project page does not explicitly state so. PocketPCR is shared under a [GPLv3.0 license][33]. +与本文所述的其他 PCR 产品一样,此设备可能有助于对冠状病毒进行环境测试,尽管其项目页面并未明确说明。PocketPCR 在 [GPLv3.0 许可证][33]下共享。 -#### Open Lung Low Resource Ventilator +#### Open Lung 低资源呼吸机 -The [Open Lung Low Resource Ventilator][34] is a quick-deployment ventilator that utilizes a [bag valve mask][35] (BVM), also known as an Ambu-bag, as a core component. Ambu-bags are mass-produced, certified, small, mechanically simple, and adaptable to both invasive tubing and masks. The OPEN LUNG ventilator will use micro-electronics to sense and control air pressure and flow, with the goal to enable semi-autonomous operation. +[Open Lung 低资源呼吸机][34]是一种快速部署的呼吸机,它以[气囊阀罩][35](BVM)(也称为 Ambu 气囊)为核心组件。Ambu 气囊已批量生产,经过认证,体积小,机械简单,并且适用于侵入性导管和口罩。 OPEN LUNG 呼吸机使用微电子技术来感测和控制气压和流量,以实现半自主运行。 ![Open Lung ventilator][36] -Open Lung [on GitLab][37] +*Open Lung,[GitLab][37]* -This early-stage project boasts a large team with hundreds of contributors, led by: Colin Keogh, David Pollard, Connall Laverty, and Gui Calavanti. It is shared under a [GPLv3.0 license][38]. +这个早期项目拥有一支由数百名贡献者组成的大型团队,领导者包括:Colin Keogh、David Pollard、Connall Laverty 和 Gui Calavanti。它是以 [GPLv3.0 许可证][38]共享的。 -#### Pandemic Ventilator +#### Pandemic 呼吸机 -The [Pandemic Ventilator][39] is a DIY ventilator prototype. Like the RepRap project, it uses commonly available hardware components in its design. The project was uploaded by user Panvent to Instructables more than 10 years ago, and there are six major steps to producing it. The project is shared under a [CC BY-NC-SA license][39]. This video shows the system in action: +[Pandemic 呼吸机][39]是 DIY 呼吸机的原型。像 RepRap 项目一样,它在设计中使用了常用的硬件组件。该项目已由用户 Panvent 于 10 多年前上传到 Instructables,并且有六个主要的生产步骤。该项目是以 [CC BY-NC-SA 许可证][39]共享的。 #### Folding at Home -[Folding at Home][40] is a distributed computing project for simulating protein dynamics, including the process of protein folding and the movements of proteins implicated in a variety of diseases. It is a call-to-action for citizen scientists, researchers, and volunteers to use their computers at home to help run simulations, similar to the decommissioned [SETI@Home project][41]. If you're a technologist with capable computer hardware, Folding at Home is for you. +[Folding at Home][40] 是一个分布式计算项目,用于模拟蛋白质动力学,包括蛋白质折叠的过程以及与多种疾病有关的蛋白质运动。这是一个面向公民科学家、研究人员和志愿者的行动呼吁,类似于退役的 [SETI@Home 项目][41]中在家中使用计算机来运行解码计算。如果你是具备强大计算机硬件功能的技术人员,那么这个项目适合你。 ![Markov state model][42] -Vincent Voelz, CC BY-SA 3.0 +*Vincent Voelz,CC BY-SA 3.0* -Folding at Home uses Markov state models (shown above) to model the possible shapes and folding pathways a protein can take in order to look for new therapeutic opportunities. You can find out more about the project in Washington University biophysicist Greg Bowman's post on [how it works and how you can help][43]. +Folding at Home 项目使用马尔可夫状态模型(如上所示)来建模蛋白质可能采取的形状和折叠途径,以寻找新的治疗机会。你可以在华盛顿大学生物物理学家 Greg Bowman 的帖子“[它是如何运作的以及如何提供帮助][43]”中找到有关该项目的更多信息。 -The project involves a consortium of academic laboratories, contributors, and corporate sponsors from many countries, including Hong Kong, Croatia, Sweden, and the United States. Folding at Home is shared under a [mix of GPL and proprietary licenses][44] on [GitHub][45] and is multi-platform for Windows, macOS, and GNU/Linux (e.g., Debian, Ubuntu, Mint, RHEL, CentOS, Fedora). +该项目涉及来自许多国家(包括香港、克罗地亚、瑞典和美国)的财团的学术实验室、贡献者和公司赞助者。 在 [GitHub][45] 上,[在混合了 GPL 和专有许可证][44]下可以共享,并且可以在 Windows、macOS 和 GNU/Linux(例如 Debian、Ubuntu、Mint、RHEL、CentOS、Fedora)。 -### Many other interesting projects +### 许多其他有趣的项目 -These projects are just a fraction of the activity happening in the open hardware space to solve or treat COVID-19. In researching this article, I discovered other projects worth exploring, such as: +这些项目只是在开放硬件领域中解决或治疗新冠病毒活动中的一小部分。在研究本文时,我发现了其他值得探索的项目,例如: - * [Open source ventilators, oxygen concentrators, etc.][46] by Coronavirus Tech Handbook - * [Helpful engineering][47] by ProjectOpenAir - * [Open source ventilator hackathon][48] on Hackaday - * [Specifications for simple open source mechanical ventilator][49] by Johns Hopkins emergency medicine resident Julian Botta - * [Coronavirus-related phishing, malware, and randomware on the rise][50] by Shannon Morse - * [Converting a low-cost CPAP blower into a rudimentary ventilator][51] by jcl5m1 - * [Forum A.I.R.E. discussion on open respirators and fans][52] (Spanish/español) - * [Special Issue on Open-Source COVID19 Medical Hardware][53] by Elsevier HardwareX +* Coronavirus Tech Handbook 提供的[开源呼吸机、氧气浓缩器等][46] +* 来自 ProjectOpenAir 的 [有用的工程][47] +* Hackaday 上的[开源呼吸机黑客马拉松][48] +* 约翰·霍普金斯急诊医学住院医师 Julian Botta 的[简单开源机械呼吸机规范][49] +* [与冠状病毒有关的网络钓鱼、恶意软件和随机软件正在增加][50],作者:Shannon Morse +* [将低成本的 CPAP 鼓风机转换为基本通风机][51],作者: jcl5m1 +* [A.I.R.E. 论坛上关于开放呼吸器和风扇的讨论][52](西班牙语) +* [关于新冠病毒的开源医疗硬件的特殊问题][53],作者:Elsevier HardwareX +这些项目遍布全球,而这种全球合作正是我们所需要的,因为病毒无视国界。新冠病毒大流行在不同时期以不同方式影响国家,因此我们需要一种分布式方法。 - -These projects are based all over the world, and this type of global cooperation is exactly what we need, as the virus ignores borders. The novel coronavirus pandemic affects countries at different times and in different ways, so we need a distributed approach. - -As my colleague Steven Abadie and I write in the [OSHdata 2020 Report][54], the open source hardware movement is a global movement. Participating individuals and organizations with certified projects are located in over 35 countries around the world and in every hemisphere. +正如我和同事 Steven Abadie 在 [OSHdata 2020 报告][54]中所写的那样,开源硬件运动是全球性运动。参与该认证项目的个人和组织遍布全球 35 个国家和每个半球。 ![Open source hardware map][55] -OSHdata, CC BY-SA 4.0 International +*OSHdata,CC BY-SA 4.0 国际版* -If you are interested in joining this conversation with open source hardware developers around the world, join the [Open Hardware Summit Discord][56] server with a dedicated channel for conversations about COVID-19. You can find roboticists, designers, artists, firmware and mechanical engineers, students, researchers, and others who are fighting this war together. We hope to see you there. +如果你有兴趣加入这场与全球开源硬件开发人员的对话,请加入[Open Hardware Summit Discord][56]服 务器,并通过专用渠道进行有关新冠病毒的讨论。你在这里可以找到机器人专家、设计师、艺术家、固件和机械工程师、学生、研究人员以及其他共同为这场战争而战的人。希望可以看到你。 -------------------------------------------------------------------------------- @@ -142,7 +140,7 @@ via: https://opensource.com/article/20/3/open-hardware-covid19 作者:[Harris Kenny][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b0e5a59d73df81f69478ce174cd6edb47f3b83be Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:00:22 +0800 Subject: [PATCH 0003/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200329=20The?= =?UTF-8?q?=20Keyring=20Concept=20in=20Ubuntu:=20What=20is=20It=20and=20Ho?= =?UTF-8?q?w=20to=20Use=20it=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md --- ...in Ubuntu- What is It and How to Use it.md | 183 ++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md diff --git a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md new file mode 100644 index 0000000000..e5eec51802 --- /dev/null +++ b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md @@ -0,0 +1,183 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Keyring Concept in Ubuntu: What is It and How to Use it?) +[#]: via: (https://itsfoss.com/ubuntu-keyring/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +The Keyring Concept in Ubuntu: What is It and How to Use it? +====== + +If you use [automatic login in Ubuntu][1] or other Linux distributions, you might have come across a pop-up message of this sort: + +**Enter password to unlock your login keyring +The login keyring did not get unlocked when you logged into your computer.** + +![Enter Password To Unlock Your Login Keyring Ubuntu][2] + +It keeps on popping up several times before disappearing if you keep on clicking cancel. You may wonder why do you keep seeing this keyring message all the time? + +Let me tell you something. It’s not an error. It’s a security feature. + +Surprised? Let me explain the keyring concept in Linux. + +### What is keyring in Linux and why is it used? + +![][3] + +Why do you use a keyring (also called [keychain][4]) in the real life? You use it to keep one or more keys grouped together so that they are easy to find and carry. + +It’s the same concept in Linux. The keyring feature allows your system to group various passwords together and keep it one place. + +Most desktop environments like GNOME, KDE, Xfce etc use an implementation of [gnome-keyring][5] to provide this keyring feature in Linux. + +This keyring keeps your ssh keys, GPG keys and keys from applications that use this feature, like Chromium browser. By default, the **keyring is locked with a master password** which is often the login password of the account. + +Every user on your system has its own keyring with (usually) the same password as that of the user account itself. When you login to your system with your password, your keyring is unlocked automatically with your account’s password. + +The problem comes when you [switch to auto-login in Ubuntu][1]. This means that you login to the system without entering the password. In such case, your keyring is not unlocked automatically. + +#### Keyring is a security feature + +Remember I told you that the keyring was a security feature? Now imagine that on your Linux desktop, you are using auto-login. Anyone with access to your desktop can enter the system without password but you have no issues with that perhaps because you use it to browse internet only. + +But if you use a browser like Chromium or [Google Chrome in Ubuntu][6], and use it to save your login-password for various websites, you have an issue on your hand. Anyone can use the browser and login to the websites for which you have saved password in your browser. That’s risky, isn’t it? + +This is why when you try to use Chrome, it will ask you to unlock the keyring repeatedly. This ensures that only the person who knows the keyring’s password (i.e. the account password) can use the saved password in browser for logging in to their respective websites. + +If you keep on cancelling the prompt for keyring unlock, it will eventually go away and let you use the browser. However, the saved password won’t be unlocked and you’ll see ‘sync paused’ in Chromium/Chrome browsers. + +![Sync paused in Google Chrome][7] + +#### If this keyring always exited, why you never saw it? + +That’s a valid question if you have never seen this keyring thing in your Linux system. + +If you never used automatic login (or changed your account’s password), you might not even have realized that this feature exists. + +This is because when you login to your system with your password, your keyring is unlocked automatically with your account’s password. + +Ubuntu (and other distributions) asks for password for common admin tasks like modifying users, installing new software etc irrespective of whether you auto login or not. But for regular tasks like using a browser, it doesn’t ask for password because keyring is already unlocked. + +When you switch to automatic login, you don’t enter the password for login anymore. This means that the keyring is not unlocked and hence when you try to use a browser which uses the keyring feature, it will ask to unlock the keyring. + +#### You can easily manage the keyring and passwords + +Where is this keyring located? At the core, it’s a daemon (a program that runs automatically in the background). + +Don’t worry. You don’t have to ‘fight the daemon’ in the terminal. Most desktop environments come with a graphical application that interacts with this daemon. On KDE, there is KDE Wallet, on GNOME and others, it’s called Password and Keys (originally known as [Seahorse][8]). + +![Password And Keys App in Ubuntu][9] + +You can use this GUI application to see what application use the keyring to manage/lock passwords. + +As you can see, my system has the login keyring which is automatically created. There is also a keyrings for storing GPG and SSH keys. The [Certificates][10] is for keeping the certificates (like HTTPS certificates) issued by a certificate authority. + +![Password and Keys application in Ubuntu][11] + +You can also use this application to manually store passwords for website. For example, I created a new password-protected keyring called ‘Test’ and stored a password in this keyring manually. + +This is slightly better than keeping a list of passwords in a text file. At least in this case your passwords can be viewed only when you unlock the keyring with password. + +![Saving New Password Seahorse][12] + +One potential problem here is that if you format your system, the manually saved passwords are definitely lost. Normally, you make backup of personal files, not of all the user specific data such as keyring files. + +There is way to handle that. The keyring data is usually stored in ~/.local/share/keyrings directory. You can see all the keyrings here but you cannot see its content directly. If you remove the password of the keyring (I’ll show the steps in later section of this article), you can read the content of the keyring like a regular text file. You can copy this unlocked keyring file entirely and import it in the Password and Keys application on some other Linux computer (running this application). + +So, let me summarize what you have learned so far: + + * Most Linux has this ‘keyring feature’ installed and activated by default + * Each user on a system has its own keyring + * The keyring is normally locked with the account’s password + * Keyring is unlocked automatically when you login with your password + * For auto-login, the keyring is not unlocked and hence you are asked to unlock it when you try to use an application that uses keyring + * Not all browsers or application use the keyring feature + * There is a GUI application installed to interact with keyring + * You can use the keyring to manually store passwords in encrypted format + * You can change the keyring password on your own + * You can export (by unlocking the keyring first) and import it on some other computer to get your manually saved passwords + + + +### Change keyring password + +Suppose you changed your account password. Now when you login, your system tries to unlock the keyring automatically using the new login password. But the keyring still uses the old login password. + +In such a case, you can change the keyring password to the new login password so that the keyring gets unlocked automatically as soon as you login to your system. + +Open the Password and Keys application from the menu: + +![Look for Password and Keys app in the menu][9] + +Now, right click on the Login keyring and click on Change Password: + +![Change Keyring Password][13] + +What if you don’t remember the old login password? + +You probably know that it is [easy to reset forgotten password in Ubuntu][14]. The problem comes with the keyring in such cases. You changed the account password but you don’t remember the old account password that is still used by the keyring. + +Now you cannot change it because you don’t know the old password. What to do now? + +In such a case, you’ll have to remove the entire keyring itself. You can do that from the Passwords and Keys application: + +![Delete Keyring Ubuntu][15] + +It will ask for your confirmation: + +![Delete Keyring][16] + +Alternatively, you may also manually delete the keyring files in ~/.local/share/keyrings directory. + +When the old keyring is removed and you try to use Chrome/Chromium, it will ask you to create new keyring. + +![New Keyring Password][17] + +You can use the new login password so that the keyring gets unlocked automatically. + +### Disable keyring password + +In cases where you want to use automatic login but don’t want to unlockk keyring manually, you may choose to disable the keyring with a workaround. Keep in mind that you are disabling a security feature so think twice before doing so. + +The process is similar to changing keyring password. Open Password and Keys application and go on to change the keyring password. + +The trick is that when it asks to change the password, don’t enter a new password and hit Continue instead. This will remove any password from the keyring. + +![Disable Keyring password by not setting any password at all][18] + +This way, the keyring will have no password and it remains unlocked all the time. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-keyring/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-automatic-logon/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/enter-password-to-unlock-your-login-keyring-ubuntu.jpg?ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/keyring-concept-ubuntu-1.png?ssl=1 +[4]: https://en.wikipedia.org/wiki/Keychain +[5]: https://wiki.archlinux.org/index.php/GNOME/Keyring +[6]: https://itsfoss.com/install-chrome-ubuntu/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/sync-paused-keyring-ubuntu.jpg?ssl=1 +[8]: https://wiki.debian.org/Seahorse +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/password-and-keys-app-ubuntu.jpg?ssl=1 +[10]: https://help.ubuntu.com/lts/serverguide/certificates-and-security.html +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/keyring-pasword-ubuntu.png?ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/saving-new-password-seahorse.png?ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/change-keyring-password.png?ssl=1 +[14]: https://itsfoss.com/how-to-hack-ubuntu-password/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/delete-keyring-ubuntu.jpg?ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/delete-keyring.jpg?ssl=1 +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/new-keyring-password.jpg?ssl=1 +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/disable-keyring-password-ubuntu.png?ssl=1 From e6a2e2e031fd2d2186eddfbf2cc2da36a21dfccc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:05:22 +0800 Subject: [PATCH 0004/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200329=20How?= =?UTF-8?q?=20to=20install=20Microsoft=20TrueType=20Fonts=20on=20Ubuntu-ba?= =?UTF-8?q?sed=20Distributions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md --- ...ype Fonts on Ubuntu-based Distributions.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md diff --git a/sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md b/sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md new file mode 100644 index 0000000000..e502219448 --- /dev/null +++ b/sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md @@ -0,0 +1,114 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to install Microsoft TrueType Fonts on Ubuntu-based Distributions) +[#]: via: (https://itsfoss.com/install-microsoft-fonts-ubuntu/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +How to install Microsoft TrueType Fonts on Ubuntu-based Distributions +====== + +If you open some Microsoft documents in LibreOffice on Linux, you’ll notice that the fonts look a bit different. You’ll also notice that you cannot find common fonts like [Times New Roman][1], Arial etc. + +Don’t worry. I’ll show you how to install these fonts in Ubuntu and other Ubuntu-based Linux distributions. But before that, let me tell you why these fonts are not available by default. + +### Why Microsoft fonts are not installed by default in Linux? + +![][2] + +Times New Roman, Arial and other such fonts are owned by Microsoft and they are not open source. Many Linux distributions don’t provide proprietary software by default to avoid licensing issue. + +This is why Ubuntu and other Linux distributions use an open source fonts “Liberation fonts” to substitute Microsoft fonts by default. The [Liberation Fonts][3] were created by [Red Hat][4] to substitute Arial, Arial Narrow, Times New Roman and Courier New as their width is the same. When you open a document written in Times New Roman, the equivalent Liberation Font will be used to keep the document uninterrupted. + +However Liberation fonts are not identical to Microsoft’s fonts and in some cases you may need to use Arial or Times New Roman. A very common scenario is that Microsoft’s fonts are the only option is in schools, universities and other public and private organizations. They require you to submit the documents in one of those fonts. + +Good thing is that you can install the Microsoft fonts on Ubuntu and other distributions easily. This way, you will be able to increase compatibility of LibreOffice and have the freedom to choose an open source office software. + +### Installing Microsoft fonts on Ubuntu-based Linux distributions + +You can [install new fonts in Ubuntu][5] by downloading them on your own. But since Microsoft fonts are very popular (and is provided free of cost), Ubuntu provides an easy way of installing it. + +Be aware that despite Microsoft has released its core fonts for free of charge, the usage of the fonts is restricted in other operating systems. You’ll have to read and accept EULA (End User License Agreement) before installing Microsoft fonts in Ubuntu. + +These fonts are [available in the multiverse repositories so make sure to enable it][6] first: + +``` +sudo add-apt-repository multiverse +``` + +After that, you can update your Ubuntu repository cache and install the Microsoft fonts like this: + +``` +sudo apt update && sudo apt install ttf-mscorefonts-installer +``` + +Press tab to select **OK** and the press enter when the Microsoft’s End user agreement appears. + +![Press tab to highlight the selection][7] + +Click **Yes** to accept the Microsoft’s agreement: + +![Use tab key to make a selection and then press enter][8] + +When the installation is done, you should update the font cache using the command below: + +``` +sudo fc-cache -f -v +``` + +![][9] + +If you open the LibreOffice now, you’ll see the Microsoft [TrueType fonts][10]. + +![][11] + +In case that you accidentally reject the license agreement, you can reinstall the installer with this command: + +``` +sudo apt install –reinstall ttf-mscorefonts-installer +``` + +Microsoft TrueType fonts are also available via the [Ubuntu Restricted Extras package][12] that contains other proprietary media codecs to play files like MP3 etc. + +Don’t underestimate proprietary fonts + +You may think what’s the big deal with fonts? After all, it’s just a font, not a crucial piece of software, right? +But did you know that for years, [Netflix paid millions of dollars for the proprietary font][13] it used? At the end, they created their own custom fonts and that saved them a considerable amount of money. + +I hope you find this quick tutorial useful. More productivity tutorials are down the line, leave your comments below and subscribe to our social media for more! + +![][14] + +### Dimitrios Savvopoulos + +Dimitrios is an MSc Mechanical Engineer but a Linux enthusiast in heart. He is well settled in Solus OS but curiosity drives him to constantly test other distros. Challenge is part of his personality and his hobby is to compete from 5k to the marathon distance. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-microsoft-fonts-ubuntu/ + +作者:[Community][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Times_New_Roman +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/microsoft-fonts-ubuntu.png?ssl=1 +[3]: https://en.wikipedia.org/wiki/Liberation_fonts +[4]: https://en.wikipedia.org/wiki/Red_Hat +[5]: https://itsfoss.com/install-fonts-ubuntu/ +[6]: https://itsfoss.com/ubuntu-repositories/ +[7]: https://i1.wp.com/i.imgur.com/JoEJp5w.png?ssl=1 +[8]: https://i0.wp.com/i.imgur.com/M8zTc7f.png?ssl=1 +[9]: https://i0.wp.com/i.imgur.com/Cshle6S.png?ssl=1 +[10]: https://en.wikipedia.org/wiki/TrueType +[11]: https://i1.wp.com/i.imgur.com/9oIu3oj.png?ssl=1 +[12]: https://itsfoss.com/install-media-codecs-ubuntu/ +[13]: https://thehustle.co/nextflix-sans-custom-font/ +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Dimitrios.jpg?ssl=1 From f672f2556e4021d71e6eb90b773a408cfd650146 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:06:06 +0800 Subject: [PATCH 0005/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200329=20Turn?= =?UTF-8?q?=20Your=20Regular=20TV=20into=20a=20Smart=20TV=20With=20KDE=20P?= =?UTF-8?q?lasma=20Bigscreen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md --- ...to a Smart TV With KDE Plasma Bigscreen.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md diff --git a/sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md b/sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md new file mode 100644 index 0000000000..3db70ec4e1 --- /dev/null +++ b/sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen) +[#]: via: (https://itsfoss.com/kde-plasma-bigscreen/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen +====== + +_**Brief: KDE’s upcoming Plasma Bigscreen project lets you use open source technologies to turn your regular TV into a smart one.**_ + +Smart TVs are the new normal these days. Mostly based on Android, these smart TVs let you play YouTube, Netflix, Spotify and other streaming services. You can even use voice commands to control your smart TV. + +One major problem with these so-called [smart TVs are that they probably are spying on you][1]. Your data is being collected with or without your knowledge. + +This is the problem KDE’s [Plasma Bigscreen project][2] is aiming to solve. + +### Plasma Bigscreen: Make your TV smart with open source technologies + +![][3] + +You probably already know about the [KDE][4] project. It started as a Linux desktop environment project more than 20 years ago. The KDE project grew bigger and this is why they created Plasma desktop environment to make it clear that KDE is no more just “K Desktop Environment”. + +The Plasma project itself is quite versatile. You can of course use it on your desktop Linux computer. [Plasma also has a mobile version][5] that you can run on Linux-based smartphones like [Librem5][6] and [PinePhone][7]. + +The Plasma Bigscreen is a new project from KDE that aims to provide interface and features similar to what Smart TVs provide. + +All you need is a [single board computer like Raspberry Pi][8] and a TV with HDMI port. Install Plasma Bigscreen on your device and connect it to your TV. + +### Plasma Bigscreen features: More than just a media server + +![YouTube In Plasma Bigscreen][9] + +Though it may look like one at the first glance, but Plasma Bigscreen is not like Kodi and other [media servers for Linux][10]. It’s more than that. + +#### Control with your regular remote + +You don’t need a new specialized remote control. Thanks to [CEC][11], you can use your regular TV remote control. + +#### Voice control with open source Mycroft AI + +Plasma Bigscreen takes advantage of the open source Mycroft AI project. With Mycroft built in to Bigscreen, you can use voice command to play content, check weather and control other aspects of your smart TV. You can further train this AI by teaching it new skills. + +#### Traditional desktop applications + +Plasma Bigscreen delivers not only media-rich applications, but also traditional desktop applications redesigned to fit the Bigscreen experience. + +#### Free and open source software + +The most important feature is that it is an open source project and it uses other open source technologies to give you the complete control over your data and your smart TV. + +Since it is open source, I believe once it is released, there will be a few vendors providing it as a plug and play device. + +### How to get Plasma Bigscreen? + +Plasma Bigscreen is still in beta phase and there is no definite timeline for the stable release. + +However, the beta version is also working good on devices like Raspberry Pi 4. Here’s a video by one of the developers working on this project. + +[Subscribe to our YouTube channel for more Linux videos][12] + +If you have a Raspberry Pi 4, you can [download Plasma Bigscreen][13] beta version from its official download page and follow the steps [here][14] to install it. + +Personally, I am really excited about it. I am going to take out some time and try it on my [Raspberry Pi 4][15]. What about you? Do you think the project has potential? Will you give it a try? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/kde-plasma-bigscreen/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.zdnet.com/article/fbi-warns-about-snoopy-smart-tvs-spying-on-you/ +[2]: https://plasma-bigscreen.org/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/plasma-bigscreen-menu.jpg?ssl=1 +[4]: https://kde.org/ +[5]: https://itsfoss.com/kde-announces-plasma-mobile/ +[6]: https://itsfoss.com/librem-linux-phone/ +[7]: https://itsfoss.com/pinephone/ +[8]: https://itsfoss.com/raspberry-pi-alternatives/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/youtube-in-plasma-bigscreen.jpg?ssl=1 +[10]: https://itsfoss.com/best-linux-media-server/ +[11]: http://libcec.pulse-eight.com/ +[12]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[13]: https://plasma-bigscreen.org/#download-jumpto +[14]: https://plasma-bigscreen.org/manual/ +[15]: https://itsfoss.com/raspberry-pi-4/ From 31b4c1b3c9d34f0acfd416b2e88e61a0365b7163 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:07:39 +0800 Subject: [PATCH 0006/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200329=20Orac?= =?UTF-8?q?le=20Announces=20Java=2014!=20How=20to=20Install=20it=20on=20Ub?= =?UTF-8?q?untu=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md --- ...a 14- How to Install it on Ubuntu Linux.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md diff --git a/sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md b/sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md new file mode 100644 index 0000000000..17a04e4f91 --- /dev/null +++ b/sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Oracle Announces Java 14! How to Install it on Ubuntu Linux) +[#]: via: (https://itsfoss.com/java-14-ubuntu/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Oracle Announces Java 14! How to Install it on Ubuntu Linux +====== + +Recently, Oracle announced the general availability of Java 14 (or the Oracle JDK 14). If you are someone who wants to have the latest and greatest to experiment and develop stuff – you can try installing Java 14 on your Linux system. + +Oracle JDK 14 (or simply Java 14) [release][1] includes a couple of new features if you’re interested to preview them. I’ve linked them below: + + * [Pattern matching for instanceof][2] + * [Records][3] + * [Text Blocks][4] + + + +In addition to the preview features, it packs in several improvements and additions. Quoting the press release, they mentioned the additional improvements as well: + +> Additionally, the latest Java release adds Java language support for switch expressions, exposes new APIs for continuous monitoring of JDK Flight Recorder data, extends the availability of the low-latency Z Garbage Collector to macOS and Windows, and adds, in incubator modules, the packaging of self-contained Java applications and a new Foreign memory access API for safe, efficient access to memory outside of the Java heap. + +Of course, if you want to dive into the exact details, you should check the [official announcement][1]. + +In this tutorial, I’ll show you the easy way to get Java 14 installed on your Ubuntu system. Read on. + +**Note:** If you opt for Oracle Java 11 or above, you should learn about the new [Oracle Technology Network License Agreement][5] to know how it affects personal users, developers, and commercial organizations. Usually, these are free to use for development and testing – but not for production. + +### How To Install Java 14 on Ubuntu Linux? + +![][6] + +For reference, I’ve successfully tried it on **Pop!_OS 19.10** where I had the **OpenJDK 11** installed as the default. + +Here, we are going to use the Java 14 installer (originally based on WebUpd8 Java Package) by [Linux Uprising][7]. + +Simply enter the commands below in the terminal to get it installed: + +``` +sudo add-apt-repository ppa:linuxuprising/java +sudo apt update +sudo apt install oracle-java14-installer +``` + +This should do the job. And, when it’s done, if you want to make it the default, you can type in the following command to do it: + +``` +sudo apt install oracle-java14-set-default +``` + +It is worth noting that this is only for Ubuntu-based distributions. If you want to install it on Debian and other Linux distributions, you can follow [Linux Uprising’s detailed guide][7] on installing Java 14 as well. + +### Wrapping Up + +Of course, while this is about the bleeding edge features – if you do not want to break things, you might want to hold on to Java 11. If you want to experiment while knowing the risks, go ahead and give it a try! + +Feel free to let me know your thoughts on Java 14 in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/java-14-ubuntu/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.oracle.com/corporate/pressrelease/oracle-announces-java14-031720.html +[2]: https://openjdk.java.net/jeps/305 +[3]: https://openjdk.java.net/jeps/359 +[4]: https://openjdk.java.net/jeps/368 +[5]: https://www.oracle.com/technetwork/java/javase/overview/oracle-jdk-faqs.html +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/install-java-14-ubuntu.png?ssl=1 +[7]: https://www.linuxuprising.com/2020/03/how-to-install-oracle-java-14-jdk14-on.html From 866df81cc9f788816826db7338f08af28c180067 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:08:34 +0800 Subject: [PATCH 0007/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200329=20Next?= =?UTF-8?q?cloud:=20The=20Swiss=20Army=20Knife=20of=20Remote=20Working=20T?= =?UTF-8?q?ools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200329 Nextcloud- The Swiss Army Knife of Remote Working Tools.md --- ...wiss Army Knife of Remote Working Tools.md | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 sources/tech/20200329 Nextcloud- The Swiss Army Knife of Remote Working Tools.md diff --git a/sources/tech/20200329 Nextcloud- The Swiss Army Knife of Remote Working Tools.md b/sources/tech/20200329 Nextcloud- The Swiss Army Knife of Remote Working Tools.md new file mode 100644 index 0000000000..82d84f984b --- /dev/null +++ b/sources/tech/20200329 Nextcloud- The Swiss Army Knife of Remote Working Tools.md @@ -0,0 +1,154 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Nextcloud: The Swiss Army Knife of Remote Working Tools) +[#]: via: (https://itsfoss.com/nextcloud/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Nextcloud: The Swiss Army Knife of Remote Working Tools +====== + +Remote working culture has been booming for past few years in coding, graphics and other IT related fields. But the recent [Coronavirus pandemic][1] has made it mandatory for the companies to work from home if it’s possible for them. + +While there are tons of tools to help you and your organization in working from home, let me share one open source software that has the features of several such tools combined into one. + +### Nextcloud Hub: A Suite of Essential Tools for Remote Collaboration + +[Nextcloud][2] is an open source software that can be used to store files, photos and videos for personal usage like Dropbox. But it’s more than just a private [cloud service][3]. + +You can add more than one users in Nextcloud and turn it into a collaboration platform for editing files in real time, chat with users, manage calendars, assign and manage tasks and more. + +This video gives a good overview of its main features: + +[Subscribe to our YouTube channel for more Linux videos][4] + +### Main Features of Nextcloud + +Let me highlight the main features of Nextcloud: + +#### Sync files and share + +![Nextcloud Files][5] + +You can create workspaces based on user groups and share files in those folders. Users can create private files and folders and share them with selected users internally or externally (if they are allowed to). You can lock files in read only mode as well. + +It also has a very powerful search feature that lets you search files from their name or tags. You can comment on files to provide feedback. + +Text files can be edited in real time thanks to its builtin markdown editor. You can use OnlyOffice or Collabora to allow editing of docs, spreadsheet and presentations in real time. + +It also has version control for the files so that you can revert changes easily. + +#### Text Chat, Audio Chat, Video Chat and Web Meetings + +![Nextcloud Video Call][6] + +With NextCloud Talk, you can interact with other users by text messaging, audio calls, video calls and group calls for web meetings. You can also take meeting minutes during the video calls and share your screen for presentations. There is also a mobile app to stay connected all the time. + +You can also create Slack like channels (known as circles) to communicate between members concerned with a specific topic. + +#### Calendar, Contacts & Mail + +![Calendar Nextcloud][7] + +You can manage all of your organization’s contact, divide them into groups based on departments. + +With the calendar, you can see when someone is free or what meetings are taking place, like you do on Outlook. + +You can also use the Mail feature and import the emails from other providers to use them inside Nextcloud interface. + +#### Kanban project management with Deck + +![][8] + +Like Trello and Jira, you can create boards for various projects. You can create cards for each tasks, assign them to users and they can move it between the list based on the status of the task. It’s really up to you how you create boards to manage your projects in Kanban style. + +#### Plenty of add-ons to get more out of Nextcloud + +![Password Manager][9] + +Nextcloud also has several add-ons (called apps). Some are developed by Nextcloud teams while some are from third-party developers. You may use them to extend the capability of Nextcloud. + +For example, you can add a [Feedly style feed reader][10] and read news from various sources. Similarly, the [Paswords addon][11] lets you use Netxcloud as a password manager. You can even share common passwords with other Nextcloud users. + +You can explore [all the apps on its website][12]. You’ll also notice the ratings of apps that will help you decide if you should use an app or not. + +#### Many more features + +Let me summarize all the features here: + + * Open source software that lets you own your data on your own servers + * Seamlessly edit office documents together with others + * Communicate with other members of your organization and do audio and video calls and held web meetings + * Calendar lets you book meetings, brings busy view for meetings and resource booking and more + * Manage users locally or authenticate through LDAP / Active Directory, Kerberos and Shibboleth / SAML 2.0 and more + * Secure data with powerful file access control, multi-layer encryption, machine-learning based authentication protection and advanced ransomware recovery capabilities + * Access existing storage silos like FTP, Windows Network Drives, SharePoint, Object Storage and Samba shares seamlessly through Nextcloud. + * Automation: Automatically turn documents in PDFs, send messages to chat rooms and more! + * Built in ONLYOFFICE makes collaborative editing of Microsoft Office documents accessible to everyone + * Users can install desktop and mobile apps or simply use it in web browser + + + +### How to get Nextcloud + +![][13] + +NextCloud is free and open source software. You can download it and install it on your own server. + +You can use cloud server providers like [Linode][14] or [DigitalOcean][15] that allow you to deploy a brand new Linux server within minutes. And then you can use Docker to install NextCloud. At It’s FOSS, we use [Linode][14] for our NextCloud instance. + +If you don’t want to do that, you can [signup with one of the Nextcloud partners][16] that provide you with configured Nextcloud instance. Some providers also provide a few GB of free data to try it. + +Nextcloud also has an [enterprise plan][17] where Nextcloud team itself handles everything for the users and provide premium support. You can check their pricing [here][18]. + +If you decide to use Nextcloud, you should refer to its documentation or community forum to explore all its features. + +### Conclusion + +At It’s FOSS, our entire team works remote. We have no centralized office anywhere and all of us work from our home. Initially we relied on non-open source tools like Slack, Google Drive etc but lately we are migrating to their open source alternatives. + +Nextcloud is one of the first software we tried internally. It has features of Dropbox, Google Docs, [Slack][19], [Trello][20], Google Hangout all combined in one software. + +NextCloud works for most part but we found it struggling with the video calls. I think that has to do with the fact that we have it installed on a server with 1 GB of RAM that also runs some other web services like [Ghost CMS][21]. We plan to move it to a server with better specs. We’ll see if that should address these issues. + +Since the entire world is struggling with the Coronavirus pandemic, using a solution like Nextcloud could be helpful for you and your organization in working from home. + +How are you coping during the Coronavirus lockdown? Like [Linus Torvalds’ advice on remote working][22], do you also have some suggestion to share with the rest of us? Please feel free to use the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nextcloud/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/2019%E2%80%9320_coronavirus_pandemic +[2]: https://nextcloud.com/ +[3]: https://itsfoss.com/cloud-services-linux/ +[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/nextcloud_files.png?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/nextcloud_video_call.jpg?ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/calendar_nextcloud.jpeg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/nextcloud_kanban_project_management_app.jpeg?ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/passman.png?fit=800%2C389&ssl=1 +[10]: https://apps.nextcloud.com/apps/news +[11]: https://apps.nextcloud.com/apps/passwords +[12]: https://apps.nextcloud.com/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/nextcloud-feature.jpg?ssl=1 +[14]: https://www.linode.com/?r=19db9d1ce8c1c91023c7afef87a28ce8c8c067bd +[15]: https://m.do.co/c/d58840562553 +[16]: https://nextcloud.com/signup/ +[17]: https://nextcloud.com/enterprise/ +[18]: https://nextcloud.com/pricing/ +[19]: https://slack.com/ +[20]: https://trello.com/ +[21]: https://itsfoss.com/ghost-3-release/ +[22]: https://itsfoss.com/torvalds-remote-work-advice/ From 30aaa8da722cba0a05c63b4f3eb1507bd783c1f1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:11:13 +0800 Subject: [PATCH 0008/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200328=20Open?= =?UTF-8?q?=20source=20fights=20against=20COVID-19,=20Google's=20new=20sec?= =?UTF-8?q?urity=20tool=20written=20in=20Python,=20and=20more=20open=20sou?= =?UTF-8?q?rce=20news?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200328 Open source fights against COVID-19, Google-s new security tool written in Python, and more open source news.md --- ...en in Python, and more open source news.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/tech/20200328 Open source fights against COVID-19, Google-s new security tool written in Python, and more open source news.md diff --git a/sources/tech/20200328 Open source fights against COVID-19, Google-s new security tool written in Python, and more open source news.md b/sources/tech/20200328 Open source fights against COVID-19, Google-s new security tool written in Python, and more open source news.md new file mode 100644 index 0000000000..dce9c83a0e --- /dev/null +++ b/sources/tech/20200328 Open source fights against COVID-19, Google-s new security tool written in Python, and more open source news.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open source fights against COVID-19, Google's new security tool written in Python, and more open source news) +[#]: via: (https://opensource.com/article/20/3/news-march-28) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +Open source fights against COVID-19, Google's new security tool written in Python, and more open source news +====== +Catch up on the biggest open source headlines from the past two weeks. +![][1] + +In this edition of our open source news roundup, we take a look open source solutions for COVID-19, Google's new security tool, code cleanup software from Uber, and more! + +### Using open source in the fight against COVID-19 + +When COVID-19 started its march around the world, open source [stepped up][2] to try to help stop it. That includes using open data to [create tracking dashboards and apps][3], designing ventilators, and developing protective gear. + +Scientists at the University of Waterloo in Canada have teamed with artificial intelligence firm DarwinAI to create an open source tool "[to identify signs of Covid-19 in chest x-rays][4]." Called COVID-Net, it's neural network "that is particularly good at recognizing images." The dataset the researchers are using is [available on GitHub][5], which includes a link the software. + +Additionally, many [open source hardware projects][6] are underway to expedite the search for a cure.  + +### Google releases tool to fight USB keystroke injection attacks + +One of the sneakiest and potentially most malicious ways to hack a computer is a USB keystroke injection attack. Using a compromised USB device connected to a computer, a hacker can run commands without you even noticing. Google's making it easier for Linux users to fight back against these kinds of attacks by releasing [an open source detection tool][7]. + +Called USB Keystroke Injection Protection, the tool detects "if the keystrokes have been made without human involvement". It does that by measuring "the timing of keystrokes coming from connected USB devices." Sebastian Neuner of Google's Information Security Engineering Team said that while the USB Keystroke Injection Protection tool isn't the last word in defense against these kinds of attacks, but offers "another layer of protection and to defend a user sitting in front of their unlocked machine by them seeing the attack happening." + +You can find the Python source code for the tool [on GitHub][8]. + +### Uber makes code deletion tool open source + +As applications get bigger, they often contain code that's either no longer used or which is obsolete. That added code make software more difficult to maintain. To help solve the problem of quickly finding that redundant code, Uber recently [open sourced a tool called Pirhana][9]. + +Pirhana scans code for [feature flags][10], looking for ones that are no longer used. The software then deletes the unused flags from the code. At the moment, Pirhana works with software written in the Objective-C, Swift, and Java languages. Uber's developers hope the number of supported languages will increase "now that outside developers have an opportunity to contribute to the project." + +You can grab [Pirhana's source code][11] from its repository on GitHub + +#### In other news + + * [Singapore government to open source contact-tracing protocol][12] + * [European Commission to use open source messaging service Signal][13] + * [Spanish software to computerize healthcare in Cameroon and India][14] + * [ING Open-Sources Lion, Its White-Label Web Component Library][15] + * [Open Source Goes Mainstream – How Sharing Is Shaping The Future Of Music][16] + + + +Thanks, as always, to Opensource.com staff members and [Correspondents][17] for their help this week. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/news-march-28 + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/weekly_news_roundup_tv.png?itok=tibLvjBd +[2]: https://jaxenter.com/covid-19-open-source-170237.html +[3]: https://opensource.com/article/20/3/open-source-software-covid19 +[4]: https://www.technologyreview.com/s/615399/coronavirus-neural-network-can-help-spot-covid-19-in-chest-x-ray-pneumonia/ +[5]: https://github.com/lindawangg/COVID-Net +[6]: https://opensource.com/article/20/3/open-hardware-covid19 +[7]: https://www.zdnet.com/article/google-linux-systems-can-use-this-new-tool-against-usb-keystroke-injection-attacks/ +[8]: https://github.com/google/ukip +[9]: https://siliconangle.com/2020/03/17/ubers-open-source-piranha-tool-hunts-redundant-application-code/ +[10]: https://en.wikipedia.org/wiki/Feature_toggle +[11]: https://github.com/uber/piranha +[12]: https://www.computerweekly.com/news/252480501/Singapore-government-to-open-source-contact-tracing-protocol +[13]: https://joinup.ec.europa.eu/collection/open-source-observatory-osor/news/signal-messaging-service +[14]: https://intallaght.ie/spanish-software-to-computerize-healthcare-in-cameroon-and-india/ +[15]: https://www.infoq.com/articles/ing-open-sources-lion-web-component/ +[16]: https://www.forbes.com/sites/andreazarczynski/2020/03/19/open-source-goes-mainstream--how-sharing-is-shaping-the-future-of-music/#9e1ca1290013 +[17]: https://opensource.com/correspondent-program From c4c558753279ec9339df1bfae85f48890ac70942 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:12:33 +0800 Subject: [PATCH 0009/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200327=20Buil?= =?UTF-8?q?d=20a=20private=20chat=20server=20with=20a=20Raspberry=20Pi=20a?= =?UTF-8?q?nd=20Rocket.Chat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md --- ...ver with a Raspberry Pi and Rocket.Chat.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md diff --git a/sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md b/sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md new file mode 100644 index 0000000000..26e823de79 --- /dev/null +++ b/sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Build a private chat server with a Raspberry Pi and Rocket.Chat) +[#]: via: (https://opensource.com/article/20/3/raspberry-pi-rocketchat) +[#]: author: (Giuseppe Cassibba https://opensource.com/users/peppe8o) + +Build a private chat server with a Raspberry Pi and Rocket.Chat +====== +Create your own truly private chat and messaging solution with these +simple, cost-effective open source tools. +![Chat via email][1] + +The internet offers plenty of free messaging services. Applications like WhatsApp and Viber are part of our daily life and are the most common way we communicate with relatives and friends. But security awareness is increasing the demand for a truly private chat solution. Furthermore, messaging apps take up a lot of space in our devices, so an alternative chat channel could be useful to share media, info, and contacts with our friends. + +Today we are going to see how to install a private chat and messaging server with a [Raspberry Pi][2] and Rocket.Chat. + +### What is Rocket.Chat? + +[Rocket.Chat][3] is an open source solution that provides an enhanced chat service. It includes collaboration tools like media sharing, screen sharing, and video/audio calling support. + +It can be used both via browser or from apps available in all the main app stores (Google Play, App Store, etc.). + +In addition to the community version, Rocket.Chat also offers Enterprise and Professional versions, including support and additional features. + +### What we need + +For this project, I’m going to use a cheaper Raspberry Pi 3 model A+. RPI 3 models B and B+, and RPI 4 model B should also work in the same way. + +I also suggest a performing SD card, because Rocket.Chat can put a heavy workload on our Raspberry Pi. As discussed in other articles, a performing SD card strongly improves Raspbian OS performance. + +We’ll use a lite version of Raspbian with pre-configured WiFi access and SSH service, so ![][4] there will no need for keyboards or HDMI cables. + +### Step-by-step procedure + +Start by [installing the last version of Raspbian Buster Lite][5]. + +We’ll simplify Rocket.Chat installation by using [Snap][6]. Login via SSH and type from the terminal: + + +``` +sudo apt-get update +sudo apt-get upgrade +``` + +Install Snap: + + +``` +`sudo apt-get install snapd` +``` + +For Snap installation, we need a system reboot to make it work: + + +``` +`sudo reboot` +``` + +Login again via SSH and install the Rocket.Chat server with the simple command: + + +``` +`sudo snap install rocketchat-server` +``` + +After installing from the terminal, please wait a while for Rocket.Chat to initialize its database and services. Have a cup of tea, and after a few minutes you should be able to reach with your browser the address http://<<YOUR_RPI_IP_ADDRESS>>:3000 and you should see the following: + +![Rocket Chat setup wizard][7] + +Complete the required forms, and everything should go fine. After four simple setup windows, you should reach the Rocket.Chat home page: + +![Rocket Chat home page][8] + +Enjoy! + +_This article originally posted on [peppe8o.com][9], reposted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/raspberry-pi-rocketchat + +作者:[Giuseppe Cassibba][a] +选题:[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/peppe8o +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_chat_communication_message.png?itok=LKjiLnQu (Chat via email) +[2]: https://opensource.com/resources/raspberry-pi +[3]: https://rocket.chat/ +[4]: https://ir-na.amazon-adsystem.com/e/ir?t=peppe8o0b-20&l=am2&o=1&a=B07KKBCXLY +[5]: https://peppe8o.com/2019/07/install-raspbian-buster-lite-in-your-raspberry-pi/ +[6]: https://snapcraft.io/ +[7]: https://opensource.com/sites/default/files/uploads/rocket-chat-setup-wizard.jpg (Rocket Chat setup wizard) +[8]: https://opensource.com/sites/default/files/uploads/rocket-chat-home.jpg (Rocket Chat home page) +[9]: https://peppe8o.com/private-chat-and-messaging-server-with-raspberry-pi-and-rocket-chat/ From d6e2692244d0026c47435073d41d18010e6ee7ec Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:13:33 +0800 Subject: [PATCH 0010/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200327=20How?= =?UTF-8?q?=20open=20source=20software=20is=20fighting=20COVID-19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200327 How open source software is fighting COVID-19.md --- ...en source software is fighting COVID-19.md | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 sources/tech/20200327 How open source software is fighting COVID-19.md diff --git a/sources/tech/20200327 How open source software is fighting COVID-19.md b/sources/tech/20200327 How open source software is fighting COVID-19.md new file mode 100644 index 0000000000..c5b95fa4e5 --- /dev/null +++ b/sources/tech/20200327 How open source software is fighting COVID-19.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How open source software is fighting COVID-19) +[#]: via: (https://opensource.com/article/20/3/open-source-software-covid19) +[#]: author: (Jeff Stern https://opensource.com/users/jeffstern) + +How open source software is fighting COVID-19 +====== +Learn about four of the thousands of open source projects combating the +spread of coronavirus. +![symbols showing healthcare][1] + +Work is hard right now. COVID-19 makes it a challenge to stay focused and motivated. But it was cathartic for me to do some research into how the open source community is responding to the global pandemic. + +Since the end of January, the community has contributed to [thousands of open source repositories][2] that mention coronavirus or COVID-19. These repositories consist of datasets, models, visualizations, web and mobile applications, and more, and the majority are written in JavaScript and Python. + +Previously, we shared information about several [open hardware makers helping][3] to stop the spread and suffering caused by the coronavirus. Here, we're sharing four (of many) examples of how the open source software community is responding to coronavirus and COVID-19, with the goal of celebrating the creators and the overall impact the open source community is making on the world right now. + +### 1\. CHIME by PennSignals + +![CHIME by PennSignals][4] + +COVID-19 Hospital Impact Model for Epidemics ([CHIME][5]) is an open source application built by data scientists at Penn Medicine at the University of Pennsylvania. The online tool allows hospitals to better understand the impact the virus will have on hospital demand. + +Hospital leaders can use CHIME to "get more informed estimates of how many patients will need hospitalization, ICU beds, and mechanical ventilation over the coming days and weeks." A user can input how many patients are currently hospitalized and see, based on other variables, how demand might increase over the coming days. + +CHIME is primarily built with Python and uses the [pandas][6] open source dependency for much of the underlying data-transformation number-crunching to generate the estimates. Pandas has a relatively robust team and is one of the most commonly used Python libraries for data analysis and, like all open source projects, is highly dependent on [users' support][7] for income. + +### 2\. Real-time COVID-19 visualization by Locale.ai + +![Locale.ai COVID-19 visualization][8] + +Maps that track the number of cases help us visualize the relative scale and spread of COVID-19. [Locale.ai created an open source, interactive visualization][9] of all known cases of COVID-19. The map provides live updates with new data as it becomes available. + +I find this project especially interesting because the data is retrieved via [an open source API][9] created by GitHub user ExpDev07 that queries [an open source dataset][10] from John Hopkins University. The John Hopkins dataset (an aggregate of more than a dozen other sources) is currently the most popular COVID19-related project on GitHub. This is the branching nature of open source at its finest! + +Locale.ai built the visualization website using [Vue.js][11], a popular framework that allows web developers to create modern web apps. Vue.js was created and continues to be maintained by [Evan You][12], one of the few people who have made a full-time career as an open source maintainer. + +### 3\. DXY-COVID-19-Crawler by BlankerL + +![BlankerL DXY-COVID-19-Crawler][13] + +[DXY-COVID-19-Crawler][14] was created in January and is one of the earliest responses from the open source community to COVID-19. When the virus was spreading primarily in China, the Chinese medical community was using a site called [DXY.cn][15] to report and track cases. To make the information more readily available and usable by others, GitHub user BlankerL wrote a web crawler to systematically collect data from the DXY.cn site and make it available via an API and data warehouse. That data has been used by academic researchers and others to examine trends and visualize the spread of the virus. So far, DXY-COVID-19-Crawler has been starred more than 1,300 times and forked nearly 300 times. + +BlankerL wrote the web crawler using Python and a package called [Beautiful Soup][16]. Beautiful Soup is an application that allows Python developers to easily scrape information from websites. Beautiful Soup is maintained by Leonard Richardson, who also works full-time as a software architect. + +### 4\. City of Tokyo's COVID-19 task force website + +![City of Tokyo's COVID-19 Task Force site][17] + +Many cities around the world have updated their websites with information for their residents about COVID-19. The Tokyo Metropolitan Government created a [comprehensive website][18] that "aims to allow Tokyo residents, companies with offices in Tokyo, and visitors to Tokyo to grasp the current situation and take measures and precautions accordingly." + +Unlike many other cities, Tokyo decided to [open source its site][19]. The project boasts contributions by more than 180 different users, and [at least three other cities][20] in Japan (Nagano, Chiba, and Fukuoka City) remixed the site. The project is an example of how cities can better serve their citizens by building openly. + +There's an incredible amount of open source technology powering Tokyo's open source website. Using the [Tidelift][21] application, I identified 1,365 dependencies used in the project. All of this complexity happens because 38 direct dependencies (i.e., dependencies the developers explicitly decided to use) have dependencies of their own. That said, maintainers of more than a thousand different open source dependencies (including [Nuxt.js][22], [Prettier][23], [Babel][24], [Ajv][25], and more) are in a small way responsible for helping Tokyo share information with their citizens. + +![Dependencies in Tokyo's COVID-19 Task Force site][26] + +### Other projects + +There are [many other important projects][27] being built in the open in response to COVID-19. I am inspired by how the open source community is responding to this pandemic and leveraging other open source technologies to work quickly. The weeks ahead will be difficult, but I know we can continue to find motivation in the open source community. + +If you are working on an open source project related to COVID-19, please share it in the comments so we can help spread the word. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/open-source-software-covid19 + +作者:[Jeff Stern][a] +选题:[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/jeffstern +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Medical%20costs.jpg?itok=ke57j6cs (symbols showing healthcare) +[2]: https://github.com/search?q=coronavirus+OR+covid19 +[3]: https://opensource.com/article/20/3/open-hardware-covid19 +[4]: https://opensource.com/sites/default/files/uploads/chime_pennsignals.png (CHIME by PennSignals) +[5]: http://penn-chime.phl.io/ +[6]: https://tidelift.com/subscription/pkg/pypi-pandas +[7]: https://pandas.pydata.org/about/sponsors.html +[8]: https://opensource.com/sites/default/files/uploads/locale-ai-visualization.png (Locale.ai COVID-19 visualization) +[9]: https://github.com/localeai/covid19-live-visualization +[10]: https://github.com/CSSEGISandData/COVID-19 +[11]: https://tidelift.com/subscription/pkg/npm-vue +[12]: https://blog.tidelift.com/vuejs-evan-you-javascript-framework +[13]: https://opensource.com/sites/default/files/uploads/dxy-covid-19-crawler.png (BlankerL DXY-COVID-19-Crawler) +[14]: https://github.com/BlankerL/DXY-COVID-19-Crawler +[15]: https://dxy.cn +[16]: https://blog.tidelift.com/beautiful-soup-is-now-part-of-the-tidelift-subscription +[17]: https://opensource.com/sites/default/files/uploads/tokyo-covid19-task-force.png (City of Tokyo's COVID-19 Task Force site) +[18]: https://stopcovid19.metro.tokyo.lg.jp/en/ +[19]: https://github.com/tokyo-metropolitan-gov/covid19 +[20]: https://github.com/tokyo-metropolitan-gov/covid19/issues/1802 +[21]: https://tidelift.com/ +[22]: https://tidelift.com/subscription/pkg/npm-nuxt +[23]: https://blog.tidelift.com/prettier-is-now-part-of-the-tidelift-subscriptions +[24]: https://tidelift.com/subscription/pkg/npm-babel +[25]: https://blog.tidelift.com/ajv-is-now-part-of-the-tidelift-subscription +[26]: https://opensource.com/sites/default/files/uploads/tokyo-dependencies.png (Dependencies in Tokyo's COVID-19 Task Force site) +[27]: https://github.com/soroushchehresa/awesome-coronavirus From 5cf49220abef80b44d883b78f5ed91aaf643a9d1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:14:40 +0800 Subject: [PATCH 0011/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200327=206=20?= =?UTF-8?q?tricks=20for=20developing=20a=20work=20from=20home=20schedule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200327 6 tricks for developing a work from home schedule.md --- ...or developing a work from home schedule.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/tech/20200327 6 tricks for developing a work from home schedule.md diff --git a/sources/tech/20200327 6 tricks for developing a work from home schedule.md b/sources/tech/20200327 6 tricks for developing a work from home schedule.md new file mode 100644 index 0000000000..9253f824fd --- /dev/null +++ b/sources/tech/20200327 6 tricks for developing a work from home schedule.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 tricks for developing a work from home schedule) +[#]: via: (https://opensource.com/article/20/3/work-from-home) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +6 tricks for developing a work from home schedule +====== +Stay flexible, embrace change, and think of the transition to your home +office as an opportunity to create a healthier WFH experience. +![Working from home at a laptop][1] + +When you start working from home, one of the first things you might have noticed is that there almost no outside influences on your schedule. + +You probably have meetings—some over [team chat][2] and others over [video][3]— that you have to attend, but otherwise, there's nothing requiring you to do anything at any specific time. What you find out pretty quickly, though, is that there's an invisible influence that sneaks up on you: deadlines. + +This lack of structure fosters procrastination, sometimes willful and other times aimless, followed by frantic sprints to get something done. Learning to mitigate that, along with all the distractions working from home might offer, is often the hardest part of your home-based work. + +Here are a few ways to build in that structure for yourself do you don't end up feeling like you are falling behind. + +### You have always had your own schedule + +Everybody reacts to schedules differently. For some people, schedules offer guidance and comfort. For others, schedules are rigid and oppressive. + +An office space generally provides focus. There might be plenty of distractions at the office, but you usually find a good stretch of time at some point during your day when you can get a big chunk of work done. Even in an office, though, each person actually keeps their own schedule. Your colleague might arrive early in the day, happily completing a day's work in an empty office before anyone else arrives and then spending the rest of the day doing menial tasks and socializing. Another colleague might arrive late and leave early, maximizing time spent in the office for actual work. Still others follow a steady pace throughout the day. + +As you're settling into a WFH routine, take notes, either mentally or physically, on what seems to work well for you. If you like formalized systems, then build a schedule for yourself after a week or two, based on what you've been doing naturally. If there's something that isn't working for you, then drop it from your schedule. + +Once you've found a good rhythm for yourself, you can manage your day with a [to-do list][4] like [todo.txt][5], or if you prefer sledgehammers (or you actually manage a department), you can try a [project management][6] application. + +### Treat yourself as a new hire + +For the first week or two at home, you may find it helpful to treat yourself (and your remote team) as a new hire. Instead of trying to mimic or impose the same schedule you kept at the office or at school, take time to monitor your own activity. It takes time for your body and mind to establish new and comfortable habits, and if you're the kind of person who wanders into a routine, then you need to give yourself time to discover what those habits are. + +For instance, if you're consistently finding that you do your best work right after breakfast, then relegate menial tasks, like responding to email, reviewing tasks, or triaging bug reports, to the early morning, and make sure you have a big task set up for after breakfast. If you're having a hard time maintaining focus, then make time for morning tea so you can relax, reassess your workload, and plan your next step. Be curious about yourself like a manager would be for a brand new employee. Adjust accordingly. + +### There is no guilt to being interrupted at home + +Not everything on your schedule is under your control. If you have children too young for school, or if children are home from school, then their schedules take precedence. + +It's a perceived benefit of working from home that your schedule is more flexible than at an office, but with that assumption, there can sometimes come a little to a lot of guilt. You might feel you're not working "enough" because you have to stop to wake up and feed children, or because you want to take a few play breaks every now and again. + +That's mostly illusory, though, and here is how to think about it. If you swap out "children" for "manager," you might remember some times at the office where your "real" work was interrupted because you had to entertain upper management with sparkly presentations, or complete piles of paperwork for HR, or decompress by chatting with colleagues by the water cooler. + +Your work from home is really no different. There are plenty of distractions, and they're only a problem if you fail to acknowledge and work around them. + +### Making the choice to move beyond the 9-to-5 + +Unlike at the office, you're not forced into a rigid and dated 9-to-5 structure. If your day has to start at 7am, contains a lot of breaks, and doesn't end until 7pm, then that's alright. The essential part is to define that as your schedule for yourself (once you've established it as a schedule that works for you; remember to give yourself a few weeks to get a feel for what your schedule actually "wants" to be). Pick your start and end times, establish break times with your housemates, whether they're children, spouses, pets, or roommates/friends. Work when you're supposed to be working, and don't work when you're not scheduled to work. For most of us, colleagues don't need to know exactly when you are online as long as you're available when you're needed. In that case, your hours are your own. If the team is the kind that needs to know, run it by them. + +### Don't forget time for yourself + +It's important to at least establish times you stop thinking about work, no matter what. If you've got a very young child who's not given to staying on any schedule, then you might have to stay more flexible than most. Still, give yourself permission to actively be inactive. Do something you enjoy, even if it feels unproductive. It's normal to spend some idle time at the office to think or intentionally not think. Working from home deserves the same space. If anything, it's even more important as you establish working hours. The goal is to recognize when you're at home and when you're at work. + +Finding stuff to do at work is relatively easy, but sometimes finding things to do to relax can be hard. If you have children, you can collaborate with them using Scratch for [drawing beautiful art][7], [programming video games][8], or even [robotics][9]. For the times you're not necessarily looking to collaborate and need your little one to do some exploration of their own, there are some [great open source alternatives to Minecraft][10], too. If you're interested in getting away from the screen, though, you might try some [Arduino][11] or [Seeeduino][12] gardening projects. Start with some programming, and end up outside in the garden! + +### Choose to see change as exciting + +Some say humans don't generally love change and that we're primarily creatures of habit, so moving from an office into a home office can be upsetting. And yet, invariably, we've shown that change can be exciting and even good.  + +Use this thought experiment to remember how much you love change. Would you willingly revert to technology from even two years ago? How about five, or ten? + +If we can embrace change in technology and be uninterested in reverting back, why not embrace change elsewhere? + +When you work from home, you have the opportunity to be willing to explore change. If you find that a meeting time doesn't work for your schedule, mention it to your team. It may not work for them, either, and moving it to a different day could mean making room for a work sprint that knocks out a good chunk of your work for the week. If you find that a tool isn't working out for you, find a different one. + +In fact, some of the most productive people are constantly evaluating new applications and new methods of working. They're constantly learning new things, developing new skills. They don't do this because they need the new skill, at least not by the letter of their work contract, but learning new things often reveals a surprising applicability to something they do need. + +Need some examples? Tinkering with a Raspberry Pi for fun could result in a home server running [useful apps][13] to help you stay informed. [Learning][14] how to [write in Markdown][15] could introduce you to a new and more efficient workflow than you ever knew possible. Setting up a [computer with Linux][16] could reveal a new world of open source software that changes the way you approach problems, and improves the methods you use to solve them. The possibilities are limitless, but if you don't know where to start, you can browse through some of our articles or [cheat sheets][17] for ideas and tips. + +### Working from home is a new opportunity + +The habits we've built up around work aren't always healthy or efficient or fun. If you're starting to work from home, though, it's a chance to reinvent what work means for you. Keep the lines of [communication open][18] with your colleagues, embrace new ideas and the potential of change, and discover how you can be more productive by enjoying yourself and the place you call home (and **$HOME**). + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/work-from-home + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) +[2]: https://opensource.com/alternatives/slack +[3]: https://opensource.com/alternatives/skype +[4]: https://opensource.com/article/19/9/to-do-list-managers-linux +[5]: https://opensource.com/article/20/1/open-source-to-do-list +[6]: https://opensource.com/article/18/2/agile-project-management-tools +[7]: https://opensource.com/article/19/9/drawing-vectors-scratch-3 +[8]: https://opensource.com/article/18/4/designing-game-scratch-open-jam +[9]: https://opensource.com/education/13/8/student-programming-scratch-and-finch +[10]: https://opensource.com/alternatives/minecraft +[11]: https://opensource.com/article/17/3/arduino-garden-projects +[12]: https://opensource.com/article/19/12/seeeduino-nano-review +[13]: https://opensource.com/article/20/2/newsboat +[14]: https://opensource.com/article/19/9/introduction-markdown +[15]: https://opensource.com/article/18/11/markdown-editors +[16]: https://opensource.com/article/19/9/found-linux-video-gaming +[17]: https://opensource.com/article/20/1/cheat-sheets-guides +[18]: https://opensource.com/article/20/3/open-source-working-home From cad4e895e4a23ab28f5001be734c2197c31e7bbb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:16:47 +0800 Subject: [PATCH 0012/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200326=20How?= =?UTF-8?q?=20to=20detect=20outdated=20Kubernetes=20APIs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200326 How to detect outdated Kubernetes APIs.md --- ... How to detect outdated Kubernetes APIs.md | 234 ++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 sources/tech/20200326 How to detect outdated Kubernetes APIs.md diff --git a/sources/tech/20200326 How to detect outdated Kubernetes APIs.md b/sources/tech/20200326 How to detect outdated Kubernetes APIs.md new file mode 100644 index 0000000000..a45a9b2add --- /dev/null +++ b/sources/tech/20200326 How to detect outdated Kubernetes APIs.md @@ -0,0 +1,234 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to detect outdated Kubernetes APIs) +[#]: via: (https://opensource.com/article/20/3/deprek8) +[#]: author: (Tyler Auerbeck https://opensource.com/users/tylerauerbeck) + +How to detect outdated Kubernetes APIs +====== +Deprek8 and Conftest alert you about deprecated APIs that threaten to +slip into your codebase. +![Ship captain sailing the Kubernetes seas][1] + +Recently, deprecated APIs have been wreaking havoc on everyone's [Kubernetes][2] manifests. Why is this happening?!? It's because the objects that we've come to know and love are moving on to their new homes. And it's not like this happened overnight. Deprecation warnings have been in place for quite a few releases now. We've all just been lazy and thought the day would never come. Well, _it's here_! + +So, maybe it caught up to us this time. But we'll be prepared next time, right?!? Yeah, that's what we said last time. But what if we could put something in place that makes sure that this doesn't happen? + +### What is Deprek8? + +[Deprek8][3] is a set of [Open Policy Agent][4] (OPA) policies that allow you to check your repository for deprecated API versions. These policies offer a way to provide warnings and errors when something is in the process of being or has already been deprecated. But **Deprek8** is just a set of policies that define what to watch for. How do you actually actively use these policies in order to monitor for deprecations? + +There are a number of ways and tools that can do this; one way is to use the OPA Deprek8 policy. + +### What is the OPA Deprek8 policy? + +OPA is "an open source, general-purpose policy engine that enables unified, context-aware policy enforcement." In other words, OPA provides a means of establishing and enforcing a set of policies based upon a policy file. The policies are defined in a file (or set of files) using the [Rego query language][5]. This use case won't necessarily rely on the OPA application, but more specifically, it uses this query language to do the heavy lifting. By using Rego, you can check whether various manifests match certain criteria and then either warn or error them out based on your definition. For example, in Kubernetes 1.16, the Deployment object can no longer be served from the **extensions/v1beta1 apiVersion**. So in your .rego file, you could have something like: + + +``` +_deny = msg { +  resources := ["Deployment"] +  input.apiVersion == "extensions/v1beta1" +  input.kind == resources[_] +  msg := sprintf("%s/%s: API extensions/v1beta1 for %s is no longer served by default, use apps/v1 instead.", [input.kind, input.metadata.name, input.kind]) +} +``` + +This would alert that you have a deprecated manifest and print a message like: + +> Deployment/myDeployment: API extensions/v1beta1 for Deployment is no longer served by default, use apps/v1 instead. + +That's great! This is exactly what you need in order to avoid having old manifests lying around. But these are just the policies; you need something that will check these policies and put them into action. + +### Conftest + +This is where [Conftest][6] comes in. Conftest is a utility that allows you to put Rego policies into action against any number of configuration files. According to the repo, Conftest currently supports: + + +``` + - YAML + - JSON + - INI + - TOML + - HOCON + - HCL + - CUE + - Dockerfile + - HCL2 (Experimental) + - EDN + - VCL + - XML +``` + +It has some fairly strict defaults (i.e., expecting policy files to be in certain locations), but they can be overridden with the appropriate flags if you have a layout that you prefer. If you want to know more about those specifics, please consult the [documentation][7] in the repository. + +For example, you can run any policy file on Conftest with a command like: + + +``` +`helm template --set podSecurityPolicy.enabled=true --set server.ingress.enabled=true . | conftest -p mypolicy.rego -` +``` + +This would generate the appropriate output from a Helm template and pipe it directly to the Conftest utility. Conftest inspects that output against any policies defined in the **mypolicy.rego** file and then gives any appropriate warnings or errors for objects that match against those policies. You can, of course, swap out any templating tooling of your choice, or you can feed specific files directly to the Conftest tool. + +So now you have the tools to set your policies and enforce them against your configuration files. But how do you tie these two things together? Better yet: How do you automate this process to continuously monitor the codebase to make sure you never fall behind the deprecation line again? + +### Using Git to run checks + +There are many methods and tools to run checks against code. By adding similar steps to your continuous integration (CI) tooling (e.g., Jenkins, Tekton, etc.), you can accomplish the same goal. In this very basic use case, I used [GitHub Actions][8], a new feature of GitHub repositories. + +GitHub Actions allows you to automate your entire workflow, so you don't have to sit in front of your keyboard and hack all of this together. With Actions, you can string together any number of steps into a workflow (or multiple workflows) by either rolling your own Actions if you're doing something custom or, in most cases, using something that already exists in the [Marketplace][9]. Luckily, others have provided Actions to do the things you need to do for this example, so you can lean on the community's expertise to pull your workflow together. + +As described in the steps above, the workflow looks something like: + + 1. Retrieve the Deprek8 policy you need and store it somewhere for later use. + 2. Run Conftest against the appropriate files/charts with the policy file you grabbed in step 1. + + + +What does this boil down to? Well, all you really need to do is to use curl to pull your policy file and then run it through Conftest after pointing to your code, using the [curl][10] and [Conftest][11] Actions. Since these Actions already exist, you don't need to write any custom code! And as I'm sure you can tell by the names, they allow you to run the associated commands without having to do any custom work to pre-process anything or pull down any binaries. + +Now that you have the Actions you need to use, how do you pull them together? This is where your workflow comes into play. While Actions are the pieces of code that get things done, they're useless without a way to string them together so that they can be triggered by some event. A GitHub Action workflow will look something like this: + + +``` +name: Some Awesome Workflow Name +on: An Event That Triggers Our Workflow +jobs: +  awesome-job-name: +    runs-on: ubuntu-latest +    steps: +      - uses: actions/checkout@master +      - name: awesome-step-name +        uses: someorg/someaction@version +        with: +          args: some args that I might pass to someaction +``` + +Now you have a workflow that has multiple steps, can be triggered by a specific GitHub event, and can be passed a set of parameters (if that is applicable to that specific Action). This example is _extremely basic_. But luckily, the workflow you're trying to put together is equally simple. This shouldn't be taken as a comprehensive example of a GitHub Action, as there are many more complicated (and elegant) things you can do. If you're interested in learning more, take a look at the [GitHub Actions documentation][12]. + +Now that you have an idea of what a workflow looks like and know what Actions you're interested in using, take a run at plugging the two together. For this example, you want to make sure that whenever your code is updated, it's checked to make sure it's not using any deprecated APIs. + +First, rig up your workflow with some names and the events that you want to trigger off of. Give your workflow and job a useful name that will help you identify it (and what it does). + + +``` +name: API Deprecation Check +on: pull_request, push +jobs: + deprecation-check: +``` + +Next, you need to tell your workflow that you want to trigger these Actions based on any **pull_request** or **push** that happens to this repository because these are the two main events that get new code into a repository. You can do this by utilizing the **on** keyword. + + +``` +name: API Deprecation Check +on: pull_request, push +jobs: +  deprecation-check: +    runs-on: ubuntu-latest +    steps: +      - uses: actions/checkout@master +``` + +Then, add where you want these Actions to run and how the Action can get the code. You can tell the Action where to run by using the **runs-on** keyword. You have a few options here: Windows, Mac, or Ubuntu. In most cases, using Ubuntu is fine, as you'll frequently rely on Actions that run inside their own container (versus running on the base OS that you define here). It's also very important to understand that an Action does not check out code by default. When you need to do something that interacts with your code, make sure to use the Action **actions/checkout**. When this is included, your code will be available within your Action, and you can pass that through to the next step in your workflow. + + +``` +name: API Deprecation Check +on: pull_request, push +name: API Deprecation Check +jobs: +  deprecation-check: +    runs-on: ubuntu-latest +    steps: +      - uses: actions/checkout@master +      - name: curl +        uses: wei/curl@master +        with: +          args: > /github/home/deprek8.rego +``` + +Now that your code is checked out, you can start preparing to do something with it. As mentioned, before you can check code for deprecations, you first need the file that contains the policies that you want to check for, so just retrieve the file using the **curl** Action. This is a fairly straightforward Action, in that it accepts whatever parameters you would normally pass into the curl command. If you were doing something more complicated, this is where you could pass in things like specific HTTP Actions, headers, etc. However, in this case, you're just trying to retrieve a file, so the only thing you need to pass to your Action is the URL you want to retrieve (in this case, the one that contains your raw policy file) and then tell it where you want to write that file. In this case, you're going to have it write to **/github/home**. Why? It's because this filesystem persists between steps and will allow you to use the policy file within this next step. + + +``` +name: API Deprecation Check +on: pull_request, push +jobs: +  deprecation-check: +    runs-on: ubuntu-latest +    steps: +      - uses: actions/checkout@master +      - name: curl +        uses: wei/curl@master +        with: +          args: > /github/home/deprek8.rego +      - name: Check helm chart for deprecation +        uses: instrumenta/conftest-action/helm@master +        with: +          chart: nginx-test +          policy: /github/home/deprek8.rego +``` + +Now that you have your policy file, it's just a matter of running it against the code via **conftest**. Similar to the **curl** Action, the **conftest** Action just expects a series of parameters to understand how it should run against the code. In the example above, it runs against a Helm chart, but it can run against a specific file (or set of files) by changing the **uses** value to **instrumenta/[conftest-action@master][13]**. Just point to the path where your chart sits in the repository and then provide the path to your policy file (specified in the previous step). Once you have all of this together, you have a complete workflow. But what does this look like (assuming there's some bad code in your Helm chart)? To find out, take a look at the [example repository][14]. + +In the Nginx Helm chart, you'll notice that one of the templates is a [statefulset][15]. You may also notice that the apiVersion the StatefulSet is using is **apps/v1beta1**. This API was deprecated in Kubernetes 1.16 and is now hosted in **apps/v1**. So when your GitHub Actions workflow runs, it should detect this issue and serve an error like: + + +``` +FAIL - StatefulSetf/web: API apps/v1beta1 is no longer served by default, use apps/v1 instead. +Error: plugin "conftest" exited with error +##[error]Docker run failed with exit code 1 +``` + +The Action indicates there is something wrong and then fails the rest of the Action. You can see the [full workflow][16] if you are interested. + +### Wrapping up + +This workflow will save some future heartache by alerting you to any deprecated APIs that slip into your codebase. To be clear, this is an _alerting_ mechanism. This won't prevent you from merging bad code into your codebase. But, as long as you pay attention, you should be completely aware prior to (or just after) merging problematic code. + +Where do you go from here? Well, there are a few things to keep in mind. Currently, Deprek8 is up to date as of Kubernetes 1.16. If you're interested in more recent versions, I'm sure Deprek8 would be happy to accept your [pull request][3]. + +The other shortcoming of this method is that the **conftest** and GitHub Actions are a bit limited in that they only allow you to point at specific files or a single chart at a time. What if you want to point at multiple directories of manifests or have multiple charts inside your repository? Currently, the only way to get around that is to either list out every single file you're interested in (in the case of having multiple charts) or have multiple steps inside your workflow. Other scenarios could become problematic, like other templating engines that require some custom logic to pair the parameters and template files together. But a simple workaround for that could be to have a step in your workflow that pulls down Conftest along with a tiny inline script to loop through some of this. I'm sure there are more elegant solutions (and if you come up with one, I'm sure these projects would be more than happy to take a look at your PR). + +Regardless, you now have a mechanism that should allow you to sleep a bit easier when checking in your code! And hopefully, this method will help you build even more robust workflows to protect your code. + +* * * + +_This was originally published in [Tyler Auerbeck's GitHub repository][17] and is reposted, with edits, with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/deprek8 + +作者:[Tyler Auerbeck][a] +选题:[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/tylerauerbeck +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) +[2]: https://opensource.com/resources/what-is-kubernetes +[3]: https://github.com/naquada/deprek8 +[4]: https://github.com/open-policy-agent/opa +[5]: https://blog.openpolicyagent.org/opas-full-stack-policy-language-caeaadb1e077 +[6]: https://github.com/instrumenta/conftest +[7]: https://github.com/instrumenta/conftest/tree/master/docs +[8]: https://github.com/features/actions +[9]: https://github.com/marketplace?type=actions +[10]: https://github.com/marketplace/actions/github-action-for-curl +[11]: https://github.com/instrumenta/conftest-action +[12]: https://help.github.com/en/actions +[13]: mailto:conftest-action@master +[14]: https://github.com/tylerauerbeck/deprek8-example +[15]: https://raw.githubusercontent.com/tylerauerbeck/deprek8-example/master/nginx-test/templates/statefulset.yaml +[16]: https://github.com/tylerauerbeck/deprek8-example/runs/426774566?check_suite_focus=true +[17]: https://github.com/tylerauerbeck/writing/blob/master/opa/deprek8.md From 6cdf6b10c3ad35bf213807677995be12326ac7cc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:17:45 +0800 Subject: [PATCH 0013/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200326=203=20?= =?UTF-8?q?open=20source=20tools=20for=20sticking=20to=20a=20budget?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200326 3 open source tools for sticking to a budget.md --- ...n source tools for sticking to a budget.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sources/tech/20200326 3 open source tools for sticking to a budget.md diff --git a/sources/tech/20200326 3 open source tools for sticking to a budget.md b/sources/tech/20200326 3 open source tools for sticking to a budget.md new file mode 100644 index 0000000000..2c3ca5bc2e --- /dev/null +++ b/sources/tech/20200326 3 open source tools for sticking to a budget.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 open source tools for sticking to a budget) +[#]: via: (https://opensource.com/article/20/3/open-source-budget) +[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) + +3 open source tools for sticking to a budget +====== +Find the right solution for you in this roundup of open source budgeting +tools. Plus, learn about an open source tax preparation software. +![A dollar sign in a network][1] + +In light of changing economical times in many countries around the world right now, you may find yourself wanting to revamp or improve your financial situation and your understanding of it. Or, perhaps one of your New Year's resolutions was to start budgeting? You are not alone. + +The best way to stick to that resolution is to keep track of the money you are spending and making on a regular basis. The problem is, many popular personal finance apps out there are proprietary. Are you looking for an open source alternative to Quicken, Mint, or You Need a Budget? Whether you are new to open source software or new to budgeting in general, one of these tools will suit your needs and comfort level.  + +### LibreOffice Calc + +I recommend using LibreOffice Calc to any open source newcomer who wants to start budgeting. If you've used proprietary spreadsheets like Google Sheets or Microsoft Excel, the LibreOffice Calc template will be very familiar. In this [budgeting tutorial][2], author Jess Weichler has done a lot of the work for you by including a handy, downloadable template. The template already has expense categories like utility bills, groceries, dining out, and more, but you have the freedom to customize it to your lifestyle. In a second article, she shows you how to [create your own templates][3].  + +### HomeBank + +HomeBank is another great option for open source users of all levels. HomeBank is free, yet it has plenty of analysis and transaction features like its proprietary counterparts. In fact, you can export and import Quicken files to HomeBank, which makes transitioning to this open source app a breeze. Finally, you can use a tool to help you make wise decisions about your money without spending more money. Learn how to get started in Jessica Cherry's [tutorial][4].  + +### GnuCash + +Like the other budgeting tools mentioned here, GnuCash can be used on Windows, macOS, and Linux. There is a slew of documentation available, but our very own Don Watkins guides you through the steps of setting up GnuCash on Linux in [this tutorial][5]. Not only is GnuCash a great option for taking control of your personal finances, but it also has features like invoicing to help you manage your small business.  + +### Bonus: OpenTaxSolver + +The dreaded tax season can be a stressful time for many Americans. Many folks purchase TurboTax or use an accountant or tax service to do their taxes. Contrary to popular belief, open source tax preparation software exists! Author Jessica Cherry did the belaboring research and introduces our readers to OpenTaxSolver in [this article][6]. To use OpenTaxSolver successfully, you'll need keen attention to detail, but you won't have to worry about doing the complicated math.  + +Which open source budgeting app will you try? Do you have a favorite tool that I didn't mention in this list? Share your thoughts in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/open-source-budget + +作者:[Lauren Pritchett][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lauren-pritchett +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_whitehurst_money.png?itok=ls-SOzM0 (A dollar sign in a network) +[2]: https://opensource.com/article/20/3/libreoffice-open-source-budget +[3]: https://opensource.com/article/20/3/libreoffice-templates +[4]: https://opensource.com/article/20/2/open-source-homebank +[5]: https://opensource.com/article/20/2/gnucash +[6]: https://opensource.com/article/20/2/open-source-taxes From 5edb8f25145ee2cc7701321e5eef8a34354a4b37 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:18:29 +0800 Subject: [PATCH 0014/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200325=20npm?= =?UTF-8?q?=20joins=20GitHub,=20building=20operators=20in=20Kubernetes,=20?= =?UTF-8?q?and=20more=20industry=20trends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md --- ...in Kubernetes, and more industry trends.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md diff --git a/sources/tech/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md b/sources/tech/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md new file mode 100644 index 0000000000..3a7671da2c --- /dev/null +++ b/sources/tech/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (npm joins GitHub, building operators in Kubernetes, and more industry trends) +[#]: via: (https://opensource.com/article/20/3/npm-github-operators-kubernetes-industry-trends) +[#]: author: (Tim Hildred https://opensource.com/users/thildred) + +npm joins GitHub, building operators in Kubernetes, and more industry trends +====== +A weekly look at open source community and industry trends. +![Person standing in front of a giant computer screen with numbers, data][1] + +As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. + +## [npm is joining GitHub][2] + +> Looking further ahead, we’ll integrate GitHub and npm to improve the security of the open source software supply chain, and enable you to trace a change from a GitHub pull request to the npm package version that fixed it. Open source security is an important global issue, and with the recent launch of the [GitHub Security Lab][3] and GitHub’s built-in [security advisories][4], we are well-positioned to make a difference. In addition, [GitHub Sponsors][5] has already paid out millions of dollars to open source contributors, and we’re excited to explore tasteful ways to extend it to the npm ecosystem. + +**The impact**: Open source supply chain security is a big problem that probably needs a lot more resources thrown at it. + +## [Why and how to build operators in Kubernetes][6] + +> For cluster administrators managing large clusters, this proliferation of development methodologies and management interfaces can be problematic. The class of applications that Operators were developed to manage are almost always part of a larger application stack, with dependencies between them. If we have a lot of Operators written in different ways running on our clusters, how can we ensure they will interoperate with each other, and how do we validate and test them? + +**The impact**: This illustrates two cool things about open source. First, the alternating waves of innovation and consolidation. Second, the empowering of affected parties to address their own challenges. + +## [Automation for improved security frameworks][7] + +> In recent years we’ve seen the posts of CIO and CTO elevated to boardroom level, with senior figures in IT now influencing corporate strategy. Due to a heightened awareness of cybersecurity, it won’t be long before the board looks to CSO and CISO executives for strategic direction. + +**The impact**: This statement has gotten truer over the last several weeks. More activity is being pushed online than ever before; keeping that activity secure is integral to making it all profitable. Security people need to be able to say "no" at the highest possible level. + +## [Interoperability of open source tools: The emergence of interfaces][8] + +> Being non-opinionated about the adoption of specific technologies and the methodologies of distributing its primitive resources, were the main axes of Kubernetes evolution. Additionally, the proliferation of solutions from multiple vendors played an instrumental role in the emergence of interfaces and it served as the engine for further development and innovation. + +**The impact**: Kubernetes may be the only large-scale open source project where competition is hot. Even still, competitors need to be able to work together and interfaces are the points that separate collaboration and competition. + +## [Do you operate OpenStack? Take this survey.][9] + +> Direct feedback from the individuals and organizations operating OpenStack helps the upstream development community know what features to prioritize and which bugs to fix first, among other important learnings on how the software is being used. Each of the official project teams has the opportunity to add a question to the survey as well as review anonymized data and trends to further influence their roadmaps. + +**The impact**: Not every community participant can or will provide feedback on bug reports or feature requests. In that case, it is important to provide multiple ways to get feedback and meet users where they are. + +_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/npm-github-operators-kubernetes-industry-trends + +作者:[Tim Hildred][a] +选题:[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/thildred +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) +[2]: https://github.blog/2020-03-16-npm-is-joining-github/ +[3]: https://securitylab.github.com +[4]: https://help.github.com/en/github/managing-security-vulnerabilities/creating-a-security-advisory +[5]: https://github.com/sponsors +[6]: https://devops.com/day-2-for-the-operator-ecosystem/ +[7]: https://www.infosecurity-magazine.com/opinions/automation-governance-culture/ +[8]: https://medium.com/@kgamanji/interoperability-of-open-source-tools-the-emergence-of-interfaces-f3b7a90891e4 +[9]: https://superuser.openstack.org/articles/operate-openstack-take-the-survey-heres-why-it-matters/ From 49261580daf21befe851eeb8c329ed65c75b0dc6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:21:48 +0800 Subject: [PATCH 0015/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200326=20Tric?= =?UTF-8?q?ks=20for=20getting=20around=20your=20Linux=20file=20system?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200326 Tricks for getting around your Linux file system.md --- ...r getting around your Linux file system.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 sources/tech/20200326 Tricks for getting around your Linux file system.md diff --git a/sources/tech/20200326 Tricks for getting around your Linux file system.md b/sources/tech/20200326 Tricks for getting around your Linux file system.md new file mode 100644 index 0000000000..e8ed2b3869 --- /dev/null +++ b/sources/tech/20200326 Tricks for getting around your Linux file system.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tricks for getting around your Linux file system) +[#]: via: (https://www.networkworld.com/article/3533421/tricks-for-getting-around-your-linux-file-system.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Tricks for getting around your Linux file system +====== +The cd command is probably one of the first 10 that any Linux user learns, but it's not the only way to navigate the Linux file system.Here are some other ways. +Thinkstock + +Whether you're moving around the file system, looking for files or trying to move into important directories, Linux can provide a lot of help. In this post, we'll look at a number of tricks to make moving around the file system and both finding and using commands that you need a little easier. + +### Adding to your $PATH + +One of the easiest and most useful ways to ensure that you don't have to invest a lot of time into finding commands on a Linux system is to add the proper directories to your $PATH variable. The order of directories that you add to your $PATH variable is, however, very important. They determine the order in which the system will look through the directories to find the command to run -- stopping when it finds the first match. + +You might, for example, want to put your home directory first so that, if you create a script that has the same name as some other executable, it will be the one that you end up running whenever you type its name. + +[RELATED: Linux hardening: a 15-step checklist for a secure Linux server][1] + +To add your home directory to your $PATH variable, you could do this: + +``` +$ export PATH=~:$PATH +``` + +The **~** character represents your home directory. + +If you keep your scripts in your bin directory, this would work for you: + +``` +$ export PATH=~/bin:$PATH +``` + +You can then run a script located in your home directory like this: + +[][2] + +``` +$ myscript +Good morning, you just ran /home/myacct/bin/myscript +``` + +**IMPORTANT:** The commands shown above _add_ to your search path because $PATH (the current path) is included. They don't override it. Your search path should be configured in your **.bashrc** file, and any changes you intend to be permanent should be added there as well. + +### Using symbolic links + +Symbolic links provide an easy and obvious way to record the location of directories that you might need to use often. If you manage content for a web site, for example, you might want to get your account to "remember" where the web files are located by creating a link like this: + +``` +ln -s /var/www/html www +``` + +The order of the arguments is critical. The first (/var/www/html) is the target and the second is the name of the link that you will be creating. If you're not currently located in your home directory, the following command would do the same thing: + +``` +ln -s /var/www/html ~/www +``` + +After setting this up, you can use "cd www" to get to **/var/www/html**. + +### Using shopt + +The **shopt** command also provides a way to make moving to a different directory a bit easier. When you employ **shopt'**s **autocd** option, you can go to a directory simply by typing its name. For example: + +``` +$ shopt -s autocd +$ www +cd -- www +/home/myacct/www +$ pwd -P +/var/www/html + +$ ~/bin +cd -- /home/myacct/bin +$ pwd +/home/myacct/bin +``` + +In the first set of commands above, the **shopt** command's **autocd** option is enabled. Typing **www** then invokes a "cd www" command. Because this symbolic link was created in one of the **ln** command examples above, this moves us to **/var/www/html**. The **pwd -P** command displays the actual location. + +In the second set, typing **~/bin** invokes a **cd** into the **bin** directory in the user's home. + +Note that the **autocd** behavior will _not_ kick in when what you type is a command –  even if it's also the name of a directory. + +The **shopt** command is a bash builtin and has a lot of options. This one just means that you don't have to type "cd" before the name of each directory you want to move into. + +To see **shopt**'s other options, just type "shopt". + +### Using $CDPATH + +Probably one of the most useful tricks for moving into particular directories is adding the paths that you want to be able to move into easily to your **$CDPATH**. This creates a list of directories that will be moved into by typing only a portion of the full path names. + +There is one aspect of this that may be just a little tricky. Your **$CDPATH** needs to include the directories that _contain_ the directories that you want to move into, not the directories themselves. + +For example, say that you want to be able to move into the **/var/www/html** directory simply by typing "cd html" and into subdirectories in /var/log using only "cd" and the simple directory names. In this case, this **$CDPATH** would work: + +``` +$ CDPATH=.:/var/log:/var/www +``` + +Here's what you would see: + +``` +$ cd journal +/var/log/journal +$ cd html +/var/www/html +``` + +Your **$CDPATH** kicks in when what you type is _not_ a full path. Then it looks down its list of directories in order to see if the directory you identified exists in one of them. Once it finds a match, it takes you there. + +Keeping the "." at the beginning of your **$CDPATH** means that you can move into local directories without having to have them defined in the **$CDPATH**. + +``` +$ export CDPATH=".:$CDPATH" +$ Videos +cd -- Videos +/home/myacct/Videos +``` + +It's not hard to move around the Linux file system, but you can save a few brain cells if you use some handy tricks for getting to various locations easily. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3533421/tricks-for-getting-around-your-linux-file-system.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3143050/linux/linux-hardening-a-15-step-checklist-for-a-secure-linux-server.html#tk.nww-fsb +[2]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From 5ed587c39edbf3a9f805784d2b5bed59b662f526 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:22:46 +0800 Subject: [PATCH 0016/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200326=20ROLL?= =?UTF-8?q?ING=20UPDATE:=20The=20impact=20of=20COVID-19=20on=20public=20ne?= =?UTF-8?q?tworks=20and=20security?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200326 ROLLING UPDATE- The impact of COVID-19 on public networks and security.md --- ...OVID-19 on public networks and security.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/talk/20200326 ROLLING UPDATE- The impact of COVID-19 on public networks and security.md diff --git a/sources/talk/20200326 ROLLING UPDATE- The impact of COVID-19 on public networks and security.md b/sources/talk/20200326 ROLLING UPDATE- The impact of COVID-19 on public networks and security.md new file mode 100644 index 0000000000..7f8c0a2cd8 --- /dev/null +++ b/sources/talk/20200326 ROLLING UPDATE- The impact of COVID-19 on public networks and security.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (ROLLING UPDATE: The impact of COVID-19 on public networks and security) +[#]: via: (https://www.networkworld.com/article/3534037/rolling-update-the-impact-of-covid-19-on-public-networks-and-security.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +ROLLING UPDATE: The impact of COVID-19 on public networks and security +====== +Network World updates the latest coronavirus-related networking news +Ig0rZh / Getty Images + +_As the coronavirus spreads, public and private companies as well as government entities are requiring employees to work from home, putting unforeseen strain on all manner of networking technologies and causing bandwidth and security concerns.  What follows is a round-up of news and traffic updates that Network World will update as needed to help keep up with the ever-changing situation.  Check back frequently!_ + +**UPDATE 3.27** + +Broadband watchers at [BroadbandNow][1] say users in most of the cities it analyzed are experiencing normal network conditions, suggesting that ISP’s (and their networks) are holding up to the shifting demand. In a March 25 [post][2] the firm wrote: “Encouragingly, many of the areas hit hardest by the spread of the coronavirus are holding up to increased network demand. Cities like Los Angeles, Chicago, Brooklyn, and San Francisco have all experienced little or no disruption. New York City,  now the epicenter of the virus in the U.S., has seen a 24% dip out of its previous ten-week range. However, with a new median speed of nearly 52 Mbps, home connections still appear to be holding up overall.” + +**[ Also see [What to consider when deploying a next generation firewall][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** + +Other BroadbandNow findings included: + + * Eighty eight (44%) of the 200 cities it analyzed experienced some degree of network degradation over the past week compared to the 10 weeks prior. However, only 27 (13.5%) cities experienced dips of 20% below range or greater. + * Seattle download speeds have continued to hold up over the past week, while New York City’s speeds have fallen out of range by 24%. Both cities are currently heavily affected by the coronavirus pandemic. + * Three cities – Austin, Texas, Winston Salem, N.C., and Oxnard, Calif. – have experienced significant degradations, falling out of their 10-week range by more than 40%. + + + +Cisco’s Talos threat-intelligence arm [wrote][5] on March 26 about the COVID security threat noting what it called three broad categories of attacks leveraging COVID with known advanced persistent threat participation in: [Malware and phishing campaigns][6] using COVID-themed lures; attacks against organizations that carry out research and other work related to COVID; and fraud and disinformation. From an enterprise security perspective, Talos recommended: + + * Remote access: Do not expose Remote Desktop Protocol (RDP) to the internet. Use secure VPN connections with multi-factor authentication schemes. Network access control packages can be used to ensure that systems attempting to remotely connect to the corporate environment meet a minimum set of security standards such as anti-malware protection, patch levels, etc,. prior to granting them access to corporate resources. Continually identify and remediate access-policy violations. + * Identity Management: Protect critical and public-facing applications with multi-factor authentication and supporting corporate policies. Verify that remote-account and access-termination capabilities work as intended in a remote environment. + * Endpoint Control: Because many people may be working from home networks, endpoint visibility, protection, and mitigation is now more important than ever. Consider whether remediation and reimaging capabilities will work as intended in a remote environment. Encrypt devices where possible, and add this check to your NAC solution as a gate for connectivity. Another simple method of protecting endpoints is via DNS, such as with [Cisco’s] Umbrella, by blocking the resolution of malicious domains before the host has a chance to make a connection. + + + +In an [FAQ][7] about the impact of COVID-19 on fulfilling customer hardware orders, VMware stated: “Some VMware SD-WAN hardware appliances are on backorder as a result of supply chain issues. As a result, we are extending the option to update existing orders with different appliances where inventory is more readily available. Customers may contact a special email hotline with questions related to backordered appliances. Please send an email to [sd-wan-hotline@vmware.com][8] with your questions and include the order number, urgent quantities, and contact information. We will do our best to respond within 48 hours.” + +Cisco said it has been analyzing traffic statistics with major carriers across Asia, Europe, and the Americas, and its data shows that typically, the most congested point in the network occurs at inter-provider peering points, Jonathan Davidson, senior vice president and general manager of Cisco's Mass-Scale Infrastructure Group wrote in a [blog][9] on March 26. “However, the traffic exchanged at these bottlenecks is only a part of the total internet traffic, meaning reports on traffic may be higher overall as private peering and local destinations also contribute to more traffic growth.” + +[][10] + +“Our analysis at these locations shows an increase in traffic of 10% to 33% over normal levels. In every country, traffic spiked with the decision to shut down non-essential businesses and keep people at home. Since then, traffic has remained stable or has experienced a slight uptick over the days that followed,” Davidson stated. + +He said that traffic during peak hours from 6 p.m. and 10 p.m. has increased slightly, but is not the primary driver for the overall inrease. Busy hours have extended to 9 a.m. 10 p.m., although the new busy-hour (9 a.m. to 6 p.m.) traffic is still below the traditional peak hours. "Service providers are certainly paying attention to these changes, but they are not yet a dire concern, as most networks are designed for growth. Current capacities are utilized more over the course of the entire day,” he wrote. + +Spanish multinational telecommunications company [Telefonica][11]’ said IP networks are experiencing traffic increases of close to 40% while mobile voice use is up about 50% and data is up 25%. In general, traffic through IP networks has experienced increases of nearly 40% while mobile use has increased by about 50% for voice and 25% for data. Likewise, traffic from instant-messaging tools such as Whatsapp has increased fivefold in recent days. + +**UPDATE: 3.26** + + * Week over week (ending March 23) [Ookla][12] says it has started to see a degradation of mobile and fixed-broadband performance worldwide. More detail on specific locations is available below. Comparing the week of March 16 to the week of March 9, mean download speed over mobile and fixed broadband decreased in Canada and the U.S. while both remained relatively flat in Mexico. + * What is the impact of the coronavirus on corporate network planning? Depends on how long the work-from-home mandate goes on really. Tom Nolle, president of CIMI Corp. [takes an interesting look at the situation][13] saying the shutdown “could eventually produce a major uptick for SD-WAN services, particularly in [managed service provider]    Businesses would be much more likely to embark on an SD-WAN VPN adventure that didn’t involve purchase/licensing, favoring a service approach in general, and in particular one with a fairly short contract period.” + * Statistics from VPN provider [NordVPN][14] show the growth of VPN usage across the globe.  For example, the company said the US has experienced a 65.93% growth in the use of business VPNs since March 11. It reported that mass remote working has contributed towards a rise in desktop (94.09%) and mobile app (0.39%) usage among Americans. Globally, NordVPN teams has seen a 165% spike in the use of business VPNs and business VPN usage in Netherlands (240.49%), Canada (206.29%) and Austria (207.86%) has skyrocketed beyond 200%. Italy has had the most modest growth in business VPN usage at just 10.57%. + + + +**UPDATE: 3. 25**: + + * According to [Atlas VPN][15] user data, VPN usage in the US increased by 124% during the last two weeks. VPN usage in the country increased by 71% between March 16 and 22 alone. Atlas said it measured how much traffic traveled through its servers during that period compared to March 9 to 15. The data came from the company's 53,000 weekly users. + * Verizon [reports][16] that voice usage, long declining in the age of texting, chat and social media, is up 25% in the last week. The network report shows the primary driver is accessing conference calls. In addition, people are talking longer on mobile devices with wireless voice usage notching a 10% increase and calls lasting 15% longer.  + * AT&T also [reported][17] increased calling, especially Wi-Fi calling, up 88% on March 22 versus a normal Sunday. It says that consumer home voice calls were up 74% more than an average Sunday; traffic from Netflix dipped after all-time highs on Friday and Saturday; and data traffic due to heavy video streaming between its network and peered networks tied record highs. AT&T said it has deployed portable cell nodes to bolster coverage supporting FirstNet customers in Indiana, Connecticut, New Jersey, California and New York. + * Microsoft this week advised users of Office 365 it was throttling back some services: + * **OneNote: ** OneNote in Teams will be read-only for commercial tenants, excluding EDU. Users can go to OneNote for the web for editing. Download size and sync frequency of file attachments has been changed. You can find details on these and other OneNote related updates as . + * **SharePoint:** We are rescheduling specific backend operations to regional evening and weekend business hours. Impacted capabilities include migration, DLP and delays in file management after uploading a new file, video or image. Reduced video resolution for playback videos. + * **Stream:** People timeline has been disabled for newly uploaded videos. Pre-existing videos will not be impacted. Meeting recording video resolution adjusted to 720p. + + + +**RELATED COVID-19 NEWS:** + + * Security vendor [Check Point’s Threat Intelligence][18] says that Since January 2020, there have been over 4,000 coronavirus-related domains registered globally. Out of these websites, 3% were found to be malicious and an additional 5% are suspicious. Coronavirus- related domains are 50% more likely to be malicious than other domains registered at the same period, and also higher than recent seasonal themes such as Valentine’s day. + * [Orange][19] an IT and communications **services** company aid that has increased its network capacity and upgraded its service platforms. These measures allow it to support the ongoing exponential increase in needs and uses. The number of users connecting to their company's network remotely has already increased by 700% among its customers. It has also doubled the capacity for simultaneous connections on its platforms. The use of remote collaboration solutions such as video conferencing has also risen massively with usage increasing by between 20% to 100%. + * Verizon said it has seen a 34% increase in VPN traffic from March 10 to 17. It has also seen a 75% increase in gaming traffic and web traffic increased by just under 20% in that time period according to Verizon. + * One week after the CDC declaration of the virus as a pandemic, data analytics and broadband vendor OpenVault wrote on March 19 that: + * Subscribers’ average usage during the 9 am-to-5 pm daypart has risen to 6.3 GB, 41.4% higher than the January figure of 4.4 GB.  + * During the same period, peak hours (6 pm–11 pm) usage has risen 17.2% from 5.0 GB per subscriber in January to 5.87 GB in March.  + * Overall daily usage has grown from 12.19 GB to 15.46 GB, an increase of 26.8%. + * Based on the current rate of growth, OpenVault projected that consumption for March will reach nearly 400 GB per subscriber, an increase of almost 11% over the previous monthly record of 361 GB, established in January of this year. In addition, OpenVault projects a new coronavirus-influenced run rate of 460 GB per subscriber per month going forward. + + + +Join the Network World communities on [Facebook][20] and [LinkedIn][21] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3534037/rolling-update-the-impact-of-covid-19-on-public-networks-and-security.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://broadbandnow.com/ +[2]: https://broadbandnow.com/report/internet-speed-analysis-march-15th-21st/ +[3]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://blog.talosintelligence.com/2020/03/covid-19-pandemic-threats.html +[6]: https://blog.talosintelligence.com/2020/02/coronavirus-themed-malware.html +[7]: https://www.vmware.com/company/news/updates/vmware-response-covid-19.html?mid=31381&eid=CVMW2000048242496 +[8]: mailto:sd-wan-hotline@vmware.com +[9]: https://blogs.cisco.com/news/global-traffic-spikes-no-panic-at-the-cisco +[10]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[11]: https://www.telefonica.com/en/web/press-office/-/telefonica-announces-measures-related-to-covid-19 +[12]: https://downdetector.com/?utm_campaign=Ookla%20Insights%20Blog%20Subscription&utm_source=hs_email&utm_medium=email&utm_content=85202785&_hsenc=p2ANqtz--Nj93d_eQyJpsqxrPJyNPtTiMBWBQU984psLyalw51K61e4d1WODareMF5NWFriHY2Uzw3WF7rF-2vSfH5cR53Jg3K5Q&_hsmi=85202785 +[13]: https://blog.cimicorp.com/?p=4068 +[14]: https://nordvpnteams.com/ +[15]: https://atlasvpn.com/blog/lockdowns-and-panic-leads-to-a-124-surge-in-vpn-usage-in-the-us/ +[16]: https://www.verizon.com/about/news/update-verizon-serve-customers-covid-19 +[17]: https://about.att.com/pages/COVID-19.html +[18]: https://blog.checkpoint.com/2020/03/05/update-coronavirus-themed-domains-50-more-likely-to-be-malicious-than-other-domains/ +[19]: https://www.orange.com/en/Press-Room/press-releases/press-releases-2020/Orange-is-mobilised-to-ensure-continuity-of-service-for-all-customers-in-France-and-around-the-world +[20]: https://www.facebook.com/NetworkWorld/ +[21]: https://www.linkedin.com/company/network-world From 355dd1dd012e6a1ef8f44922a0f3f940fb3696e2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:27:34 +0800 Subject: [PATCH 0017/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200325=20The?= =?UTF-8?q?=20coming=20together=20of=20SD-WAN=20and=20AIOps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200325 The coming together of SD-WAN and AIOps.md --- ...The coming together of SD-WAN and AIOps.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/talk/20200325 The coming together of SD-WAN and AIOps.md diff --git a/sources/talk/20200325 The coming together of SD-WAN and AIOps.md b/sources/talk/20200325 The coming together of SD-WAN and AIOps.md new file mode 100644 index 0000000000..690a27686d --- /dev/null +++ b/sources/talk/20200325 The coming together of SD-WAN and AIOps.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The coming together of SD-WAN and AIOps) +[#]: via: (https://www.networkworld.com/article/3533437/the-coming-together-of-aiops-and-sd-wan.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +The coming together of SD-WAN and AIOps +====== +SD-WAN delivers cost and resiliency benefits. Infusing AI into SD-WAN takes things further, enabling automated operations and business agility. +kohb / Getty Images + +Software-defined wide-area networking ([SD-WAN][1]) and AIOps are both red-hot technologies. SD-WANs increase application availability, reduce costs and in some cases improve performance. AIOps infuses machine learning into IT operations to increase the level of automation. This reduces errors and enables businesses to make changes at digital speeds. Most think of these as separate technologies, but the two are on a collision course and will give rise to what I'm calling the AI-WAN.  + +### SD-WAN not a panacea for all network woes + +SD-WAN is the biggest leap forward in networking since… well, the actual WAN. But many solutions still rely on manual configurations. SD-WANs certainly increase application resiliency, lower telecommunications costs, and often increase application performance, but they are more complicated than traditional WANs. Initial setup can be a challenge, but the bigger issue is ongoing operations. Manually tweaking and tuning the network to adapt to business changes can be time consuming and error-prone. A solution is needed to bring better automation to SD-WANs. + +**READ MORE:** [How AI can improve network capacity planning][2] + +Enter AI-WAN. Much like a self-driving car, an AI-WAN can make decisions based on different rules and adapt to changes faster than people can. Self-driving cars continually monitor road conditions, speed limits and other factors to determine what changes to make. Similarly, a self-driving network can monitor, correct, defend, and analyze with minimal to no human involvement. This is done through automation capabilities powered by AI, obviating the need for people to get involved. + +Make no mistake, manual operations will hold businesses back from reaching their full potential. An interesting data point from my research is that it takes enterprises an average of four months to make changes across a network. That's because maintaining legacy networks and fixing glitches takes too much time. One ZK Research study found 30% of engineers spend at least one day a week doing nothing but troubleshooting problems. SD-WANs can improve these metrics, but there's still a heavy people burden. + +With growing data challenges businesses face as they migrate to the cloud, they simply can't afford to wait that long. Instead of being afraid of AI taking over jobs, businesses should embrace it. AI can remove human error—which is the largest cause of unplanned network downtime—and help businesses focus on higher-level tasks instead. + +### AI-WAN will transform network operations + +So how will the evolution of SD-WAN into AI-WAN transform network management and operations? Administrators can use their time to focus on strategic initiatives instead of fixing problems. Another data point from ZK Research is that 90% of the time taken to fix a problem is spent identifying the source. Now that applications reside in the cloud and run on mobile devices, identifying the source of a problem has gotten harder. AI-WANs have the ability to spot even the smallest anomaly, even if it hasn't yet begun to impact business. + +SD-WANs are fundamentally designed so that all routing rules are managed centrally by administrators and can be transmitted across a network. AI-WAN takes it a step further and enables administrators to anticipate problems before they happen through fault prediction. It may even adjust network glitches on its own before users are affected, thus improving network performance. + +[][3] + +A self-driving car knows the rules of the road—where the blind spots are, how to synch with traffic signals, and which safety measures to take—using AI software, real-time data from IoT sensors, cameras, and much more. Similarly, a self-driving network knows the higher-level rules and can prevent administrators from making mistakes, such as allowing applications in countries where certain actions are banned.  + +Security is another concern. Everything from mobile devices to Internet of Things (IoT) to cloud computing is creating multiple new entry points and shifting resources to the network edge. This puts businesses at a security risk, as they struggle to respond to changes quickly. + +Businesses can miss security gaps created by users, with hundreds of software-as-a-service (SaaS) apps being used at the same time without IT's knowledge. Older networking technologies cannot support SaaS and cloud services, while SD-WANs can. But simply deploying an SD-WAN is not enough to protect a network. Security shouldn't be an afterthought in an SD-WAN deployment, but part of it from the get-go. + +Increasingly, vendors are bundling AI-based analytics with SD-WAN solutions to boost network security. Such solutions use AI to analyze how certain events impact the network, application performance, and security. Then, they create intelligent recommendations for any network changes, such as unauthorized use of SaaS apps. + +Going back to the autonomous car analogy, AI-WANs are designed to keep roads clear and accident-free. They enable smarter networks that can adapt quickly to changing conditions and self-heal if necessary. With the growing demands of cloud computing and SaaS apps, intelligent networks are the future and forward-thinking businesses are already in the driver’s seat. + +### AI-WAN exists today and will explode in the future + +AI-WAN may seem futuristic, but there are a number of vendors that are delivering it or in the process of bringing solutions to market. Managed service provider Masergy, for example, recently introduced [AIOps for SD-WAN][4] to deliver autonomous networking and has the most complete offering. + +Open System, another managed service provider, [snapped up cloud-based Sqooba][5] to add AIOps to its strong network and security services. Keeping with the M&A theme, VMware recently [acquired AIOps vendor Nyansa][6] and rolled it into its VeloCloud SD-WAN group. That move gives VMware similar capabilities to [Aruba Networks][7], which initially applied AI to WiFi troubleshooting but is now bringing it to its SD-Branch offering. [Cisco][8] is another networking vendor with an AIOps story, although it's trying to apply it network-wide, not just with the WAN.  + +Over time, I expect every SD-WAN or SASE vendor to bring AIOps into the fold, shifting the focus away from connectivity to automated operations. + +**Learn more about SD-WAN** + + * [Top 10 underused SD-WAN features][9] + * [SD-WAN: The inside scoop from real-world deployments][10] + * [5 reasons to choose a managed SD-WAN and 5 reasons to think twice][11] + * [10 essential SD-WAN considerations][12] + * [SD-WAN: What is it and why you’ll use it one day][13] + * [SD-WAN deployment options: DIY vs. cloud managed][14] + * [How SD-WAN can improve your security strategy][15] + * [10 hot SD-WAN startups to watch][16] + * [How SD-WAN saves $1.2M over 5 years for a radiology firm][17] + * [SD-WAN creates new security challenges][18] + + + +Join the Network World communities on [Facebook][19] and [LinkedIn][20] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3533437/the-coming-together-of-aiops-and-sd-wan.html + +作者:[Zeus Kerravala][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Zeus-Kerravala/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[2]: https://www.networkworld.com/article/3338100/using-ai-to-improve-network-capacity-planning-what-you-need-to-know.html +[3]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[4]: https://techcrunch.com/2020/03/19/nvidia-makes-its-gpu-powered-genome-sequencing-tool-available-free-to-those-studying-covid-19/?guccounter=1&guce_referrer=aHR0cHM6Ly93d3cuZ29vZ2xlLmNvbS8&guce_referrer_sig=AQAAAMI6we4H-fTz2mf5g-l6IP27C1O-V-u6EiQuJ5QzVnlrrPU04iS0fhyrZo5U8q5rAk5I9uVW5PQYKHX8ziMdWrFBxhBP7f__JshmAGevyu4Z5zm98nDnC6nEdIekjVX4RPPmF9Q_PImcQ0opZy6JukS-DZA62tHI9R7D1Q2JAog7 +[5]: https://open-systems.com/press-release/open-systems-acquires-sqooba +[6]: https://www.vmware.com/company/acquisitions/nyansa.html +[7]: https://blogs.arubanetworks.com/solutions/ai-doing-more-with-less-in-2020-and-beyond/ +[8]: https://www.cisco.com/c/en/us/products/cloud-systems-management/crosswork-network-automation/service-centric-approach-to-aiops.html#~overview +[9]: https://www.networkworld.com/article/3518992/top-10-underused-sd-wan-features.html +[10]: https://www.networkworld.com/article/3316568/sd-wan/sd-wan-the-inside-scoop-from-real-world-deployments.html +[11]: https://www.networkworld.com/article/3431080/5-reasons-to-choose-a-managed-sd-wan-and-5-reasons-to-think-twice.html +[12]: https://www.networkworld.com/article/3355138/sd-wan-10-essential-considerations.html +[13]: https://www.networkworld.com/article/3031279/sd-wan/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[14]: https://www.networkworld.com/article/3243701/wide-area-networking/sd-wan-deployment-options-diy-vs-cloud-managed.html +[15]: https://www.networkworld.com/article/3336483/how-sd-wan-can-improve-your-security-strategy.html +[16]: https://www.networkworld.com/article/3284367/sd-wan/10-hot-sd-wan-startups-to-watch.html +[17]: https://www.networkworld.com/article/3255291/lan-wan/sd-wan-helps-radiology-firm-cut-costs-scale-bandwidth.html +[18]: https://www.networkworld.com/article/3336155/sd-wan-creates-new-security-challenges.html +[19]: https://www.facebook.com/NetworkWorld/ +[20]: https://www.linkedin.com/company/network-world From 3049b5801559d9e9cc869664a5480505a8884351 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:36:29 +0800 Subject: [PATCH 0018/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200325=20COVI?= =?UTF-8?q?D-19=20vs.=20Raspberry=20Pi:=20Researchers=20bring=20IoT=20tech?= =?UTF-8?q?nology=20to=20disease=20detection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200325 COVID-19 vs. Raspberry Pi- Researchers bring IoT technology to disease detection.md --- ...ing IoT technology to disease detection.md | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 sources/talk/20200325 COVID-19 vs. Raspberry Pi- Researchers bring IoT technology to disease detection.md diff --git a/sources/talk/20200325 COVID-19 vs. Raspberry Pi- Researchers bring IoT technology to disease detection.md b/sources/talk/20200325 COVID-19 vs. Raspberry Pi- Researchers bring IoT technology to disease detection.md new file mode 100644 index 0000000000..cdcf720c0b --- /dev/null +++ b/sources/talk/20200325 COVID-19 vs. Raspberry Pi- Researchers bring IoT technology to disease detection.md @@ -0,0 +1,55 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (COVID-19 vs. Raspberry Pi: Researchers bring IoT technology to disease detection) +[#]: via: (https://www.networkworld.com/article/3534101/covid-19-vs-raspberry-pi-researchers-bring-iot-technology-to-disease-detection.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +COVID-19 vs. Raspberry Pi: Researchers bring IoT technology to disease detection +====== +Researchers from UMass say that a Raspberry Pi edge device can help identify flu-like symptoms in crowds, broadening the range of tools that can be used to track the spread of disease. +[Bill Oxford / Raspberry Pi / Modified by IDG Comm.][1] [(CC0)][2] + +An [IoT][3] device that tracks coughing and crowd size in real time could become a useful tool for identifying the presence of flu-like symptoms among large groups of people, according to a team of researchers at UMass Amherst. + +FluSense, as the researchers call it, is about the size of a dictionary. It contains a cheap microphone array, a thermal sensor, a Raspberry Pi and an Intel Movidius 2 neural computing engine. The idea is to use AI at the edge to classify audio samples and identify the number of people in a room at any given time. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][4] + +Since the system can distinguish coughing from other types of non-speech audio, correlating coughing with the size of a given crowd could give a useful index of how many people are likely to be experiencing flu-like symptoms. + +A test run between December 2018 and July 2019 saw FluSense installed in four waiting rooms at UMass’ University Health Services clinic, and the researchers said that they were able to “strongly” correlate the system’s results with clinical testing for influenza and other illnesses with similar symptoms. + +And bigger plans for FluSense are afoot, according to the paper’s lead author, Ph.D student Forsad Al Hossain and his co-author and adviser, assistant professor Tauhidur Rahman. + +“[C]urrently we are planning to deploy the FluSense system in several large public spaces (e.g., large cafeteria, classroom, dormitories, gymnasium, auditorium) to capture syndromic signals from a broad range of people who live in a certain town or city,” they said. “We are also looking for funding to run a large-scale multi-city trial. In the meantime, we are also diversifying our sensing capability by extending FluSense’s capability to capture more syndromic signals (e.g., recently we added sneeze sensing capability to FluSense). We definitely see a significant level of commercialization potential in this line of research.” + +FluSense is particularly interesting from a technical perspective because all of the meaningful processing work is done locally, via the Intel neural computing engine and Raspberry Pi. Symptom information is sent wirelessly to the lab for collation, of course, but the heavy lifting is accomplished at the edge. Al Hossain and Rahman were quick to emphasize that the device doesn’t collect personally identifiable information – the emphasis is on aggregating data in a given setting, rather than identifying sickness in any single patient – and everything it does collect is heavily encrypted, making it a minimal privacy concern. + +The key point of FluSense, according to the researchers, is to think of it as a health surveillance tool, rather than a piece of diagnostic equipment. Al Hossain and Rahman said that it has several important advantages over other health surveillance techniques, particularly those based on Internet tracking, like Google Flu Trend and Twitter. + +“FluSense is not easily influenced by public health campaigns or advertisements. Also, the contactless nature of this sensor is ideal to capture syndromic signals passively from different geographical locations and different socioeconomic groups (including underprivileged who may not have access to healthcare and may not go to a doctor/clinic,” they said. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3534101/covid-19-vs-raspberry-pi-researchers-bring-iot-technology-to-disease-detection.html + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://unsplash.com/photos/tR0PPLuN6Pw +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From f2a46f252c2131f9ac9147ea6115a5ffc4f3b723 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:37:33 +0800 Subject: [PATCH 0019/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200325=20Linu?= =?UTF-8?q?x=20firewall=20basics=20with=20ufw?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200325 Linux firewall basics with ufw.md --- ...20200325 Linux firewall basics with ufw.md | 215 ++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 sources/tech/20200325 Linux firewall basics with ufw.md diff --git a/sources/tech/20200325 Linux firewall basics with ufw.md b/sources/tech/20200325 Linux firewall basics with ufw.md new file mode 100644 index 0000000000..104d3527ac --- /dev/null +++ b/sources/tech/20200325 Linux firewall basics with ufw.md @@ -0,0 +1,215 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux firewall basics with ufw) +[#]: via: (https://www.networkworld.com/article/3533551/linux-firewall-basics-with-ufw.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Linux firewall basics with ufw +====== +We take a look at ufw - the uncomplicated firewall - on Linux, providing some insights and commands for making changes. +Vertigo3D / Getty Images + +The **ufw** (uncomplicated firewall) represents a serious simplification to [iptables][1] and, in the years that it’s been available, has become the default firewall on systems such as Ubuntu and Debian. And, yes, **ufw** is surprisingly uncomplicated – a boon for newer admins who might otherwise have to invest a lot of time to get up to speed on firewall management. + +GUIs are available for **ufw** (like **gufw**), but **ufw** commands are generally issued on the command line. This post examines some commands for using **ufw** and looks into how it works. + +First, one quick way to see how **ufw** is configured is to look at its configuration file – **/etc/default/ufw**. In the command below, we display the settings, using **grep** to suppress the display of both blank lines and comments (line starting with #). + +[RELATED: Linux hardening: a 15-step checklist for a secure Linux server][2] + +``` +$ grep -v '^#\|^$' /etc/default/ufw +IPV6=yes +DEFAULT_INPUT_POLICY="DROP" +DEFAULT_OUTPUT_POLICY="ACCEPT" +DEFAULT_FORWARD_POLICY="DROP" +DEFAULT_APPLICATION_POLICY="SKIP" +MANAGE_BUILTINS=no +IPT_SYSCTL=/etc/ufw/sysctl.conf +IPT_MODULES="nf_conntrack_ftp nf_nat_ftp nf_conntrack_netbios_ns" +``` + +As you can see, the default policy is to drop input and allow output. Additional rules that allow the connections that you specifically want to be accept are configured separately. + +The basic syntax for ufw commands might look like thee below, though this synopsis is not meant to imply that typing only “ufw” will get you further than a quick error telling you that arguments are required. + +``` +ufw [--dry-run] [options] [rule syntax] +``` + +The **\--dry-run** option means that **ufw** won’t run the command you specify, but will show you the results that you would see if it did. It will, however, display the entire set of rules as they would exist if the change were made, so be prepared for more than a few lines of output. + +To check the status of **ufw**, run a command like the following. Note that even this command requires use of **sudo** or use of the root account. + +[][3] + +``` +$ sudo ufw status +Status: active + +To Action From +-- ------ ---- +22 ALLOW 192.168.0.0/24 +9090 ALLOW Anywhere +9090 (v6) ALLOW Anywhere (v6) +``` + +Otherwise, you will see something like this: + +``` +$ ufw status +ERROR: You need to be root to run this script +``` + +Adding "verbose" provides a few additional details: + +``` +$ sudo ufw status verbose +Status: active +Logging: on (low) +Default: deny (incoming), allow (outgoing), disabled (routed) +New profiles: skip + +To Action From +-- ------ ---- +22 ALLOW IN 192.168.0.0/24 +9090 ALLOW IN Anywhere +9090 (v6) ALLOW IN Anywhere (v6) +``` + +You can easily allow and deny connections by port number with commands like these: + +``` +$ sudo ufw allow 80 <== allow http access +$ sudo ufw deny 25 <== deny smtp access +``` + +You can check out the **/etc/services** file to find the connections between port numbers and service names. + +``` +$ grep 80/ /etc/services +http 80/tcp www # WorldWideWeb HTTP +socks 1080/tcp # socks proxy server +socks 1080/udp +http-alt 8080/tcp webcache # WWW caching service +http-alt 8080/udp +amanda 10080/tcp # amanda backup services +amanda 10080/udp +canna 5680/tcp # cannaserver +``` + +Alternately, you can use service names like in these commands. + +``` +$ sudo ufw allow http +Rule added +Rule added (v6) +$ sudo ufw allow https +Rule added +Rule added (v6) +``` + +After making changes, you should check the status again to see that those changes have been made: + +``` +$ sudo ufw status +Status: active + +To Action From +-- ------ ---- +22 ALLOW 192.168.0.0/24 +9090 ALLOW Anywhere +80/tcp ALLOW Anywhere <== +443/tcp ALLOW Anywhere <== +9090 (v6) ALLOW Anywhere (v6) +80/tcp (v6) ALLOW Anywhere (v6) <== +443/tcp (v6) ALLOW Anywhere (v6) <== +``` + +The rules that **ufw** follows are stored in the **/etc/ufw** directory. Note that you need root access to view these files and that each contains a large number of rules. + +``` +$ ls -ltr /etc/ufw +total 48 +-rw-r--r-- 1 root root 1391 Aug 15 2017 sysctl.conf +-rw-r----- 1 root root 1004 Aug 17 2017 after.rules +-rw-r----- 1 root root 915 Aug 17 2017 after6.rules +-rw-r----- 1 root root 1130 Jan 5 2018 before.init +-rw-r----- 1 root root 1126 Jan 5 2018 after.init +-rw-r----- 1 root root 2537 Mar 25 2019 before.rules +-rw-r----- 1 root root 6700 Mar 25 2019 before6.rules +drwxr-xr-x 3 root root 4096 Nov 12 08:21 applications.d +-rw-r--r-- 1 root root 313 Mar 18 17:30 ufw.conf +-rw-r----- 1 root root 1711 Mar 19 10:42 user.rules +-rw-r----- 1 root root 1530 Mar 19 10:42 user6.rules +``` + +The changes made earlier in this post (the addition of port **80** for **http** access and **443** for **https** (encrypted http) access will look like this in the **user.rules** and **user6.rules** files: + +``` +# grep " 80 " user*.rules +user6.rules:### tuple ### allow tcp 80 ::/0 any ::/0 in +user6.rules:-A ufw6-user-input -p tcp --dport 80 -j ACCEPT +user.rules:### tuple ### allow tcp 80 0.0.0.0/0 any 0.0.0.0/0 in +user.rules:-A ufw-user-input -p tcp --dport 80 -j ACCEPT +You have new mail in /var/mail/root +# grep 443 user*.rules +user6.rules:### tuple ### allow tcp 443 ::/0 any ::/0 in +user6.rules:-A ufw6-user-input -p tcp --dport 443 -j ACCEPT +user.rules:### tuple ### allow tcp 443 0.0.0.0/0 any 0.0.0.0/0 in +user.rules:-A ufw-user-input -p tcp --dport 443 -j ACCEPT +``` + +With **ufw**, you can also easily block connections from a system using a command like this: + +``` +$ sudo ufw deny from 208.176.0.50 +Rule added +``` + +The status command will show the change: + +``` +$ sudo ufw status verbose +Status: active +Logging: on (low) +Default: deny (incoming), allow (outgoing), disabled (routed) +New profiles: skip + +To Action From +-- ------ ---- +22 ALLOW IN 192.168.0.0/24 +9090 ALLOW IN Anywhere +80/tcp ALLOW IN Anywhere +443/tcp ALLOW IN Anywhere +Anywhere DENY IN 208.176.0.50 <== new +9090 (v6) ALLOW IN Anywhere (v6) +80/tcp (v6) ALLOW IN Anywhere (v6) +443/tcp (v6) ALLOW IN Anywhere (v6) +``` + +All in all, **ufw** is both easy to configure and easy to understand. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3533551/linux-firewall-basics-with-ufw.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/2716098/working-with-iptables.html +[2]: https://www.networkworld.com/article/3143050/linux/linux-hardening-a-15-step-checklist-for-a-secure-linux-server.html#tk.nww-fsb +[3]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 1c60f6aa818f44e58a1b32ada5628c5a0ca53c3e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Mar 2020 01:39:19 +0800 Subject: [PATCH 0020/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200324=20COVI?= =?UTF-8?q?D-19:=20Weekly=20health=20check=20of=20ISPs,=20cloud=20provider?= =?UTF-8?q?s=20and=20conferencing=20services?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200324 COVID-19- Weekly health check of ISPs, cloud providers and conferencing services.md --- ...oud providers and conferencing services.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/talk/20200324 COVID-19- Weekly health check of ISPs, cloud providers and conferencing services.md diff --git a/sources/talk/20200324 COVID-19- Weekly health check of ISPs, cloud providers and conferencing services.md b/sources/talk/20200324 COVID-19- Weekly health check of ISPs, cloud providers and conferencing services.md new file mode 100644 index 0000000000..a5540c4ce2 --- /dev/null +++ b/sources/talk/20200324 COVID-19- Weekly health check of ISPs, cloud providers and conferencing services.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (COVID-19: Weekly health check of ISPs, cloud providers and conferencing services) +[#]: via: (https://www.networkworld.com/article/3534130/covid-19-weekly-health-check-of-isps-cloud-providers-and-conferencing-services.html) +[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) + +COVID-19: Weekly health check of ISPs, cloud providers and conferencing services +====== +ThousandEyes, which tracks internet and cloud traffic, is providing Network World with weekly updates on the performance of three categories of service provider: ISP, cloud provider, UCaaS +[ThousandEyes][1] + +_As COVID-19 continues to spread, forcing employees to work from home, the services of ISPs, cloud providers and conferencing services a.k.a. unified communications as a service (UCaaS) providers are experiencing increased traffic._ + +_Thousand Eyes is monitoring how these increases affect outages and the performance these providers undergo. It will provide Network World a roundup of interesting events of  the week in the delivery of these services, and Network World will provide a summary here. Stop back next week for another update._ + +With the increased use of remote-access VPNs, major carriers are reporting dramatic increases in their network traffic – with Verizon reporting a 20% week-over-week increase, and Vodafone reporting an increase of 50%. + +[Read about IPv6 and cloud-access security brokers][2] + +While there has been no corresponding spike in outages in service provider networks, over the past six weeks there has been a steady increase in outages across multiple provider types both worldwide and in the U.S., all according to ThousandEyes, which keeps track of internet and cloud traffic. + +### IDG Special Report: + +Navigating the Pandemic + + * [Business continuity: Coronavirus crisis puts CIOs’ plans to the test][3] + * [Coronavirus challenges remote networking][4] + * [A security guide for pandemic planning: 7 key steps][5] + * [10 tips to set up your home office for videoconferencing][6] + * [How to survive and thrive while working from home][7] + * [WTH? OSS knows how to WFH IRL][8] + + + +This includes “a concerning upward trajectory” since the beginning of March of ISP outages worldwide that coincides with the spread of COVID-19, [according to a ThousandEyes blog][9] by Angelique Medina, the company’s director of product marketing. ISP outages worldwide hovered around 150 per week between Feb. 10 and March 19, but then increased to between just under 200 and about 225 during the following three weeks. + +In the U.S. those numbers were a little over 50 in the first time range and reaching about 100 during the first week of March. “That early March level has been mostly sustained over the last couple of weeks,” Medina writes. + +Cogent Communications was one ISP with nearly identical large scale outages on March 11 and March 18, with “disruptions for the fairly lengthy period (by Internet standards) of 30 minutes,” she wrote. + +[][10] + +Hurricane Electric suffered an outage March 20 that was less extensive and shorter than Cogent’s but included smaller disruptions that altogether affected hundreds of sites and services, she wrote. + +Public-cloud provider networks have withstood the effects of COVID-19 well, with slight increases in the number of outages in the U.S., but otherwise relatively level around the world. The possible reason: “Major public cloud providers, such as AWS, Microsoft Azure, and Google Cloud, have built massive global networks that are incredibly well-equipped to handle traffic surges,” Medina wrote. And when these networks do have major outages it’s due to routing or infrastructure state changes, not traffic congestion. + +Some providers of collaboration applications – the likes of Zoom, Webex, MSFT Teams, RingCentral – also experienced performance problems between March 9 and March 20. ThousandEyes doesn’t name them, but does list performance numbers for what it describes “the top three” UCaaS providers. One actually showed improvements in availability, latency, packet loss and jitter. The other two “showed minimal (in the grand scheme of things) degradations on all fronts — not surprising given the unprecedented strain they’ve been under,” according to the blog. + +Each provider showed spikes in traffic loss over the time period that ranged from less than 1% to more than 4% in one case. In the case of one provider, “outages within its own network spiked last week, meaning that the network issues impacting users were taking place on infrastructure managed by the provider versus an external ISP.” + +“Outage incidents within large UCaaS provider networks are fairly infrequent; however, the recent massive surge in usage is clearly stressing current design limits. Capacity is reportedly being added across the board to meet new service demands,” according to the blog. + +Meanwhile, ThousandEyes has introduced a new feature on its site a [Global Internet Outages Map][1] that is updated every few minutes. It shows recent and ongoing outages + +## Google outage unrelated to COVID-19 + +On March 26 Google suffered a 20 minute outage on the East Coast of the U.S., apparently from a router failure in Atlanta, ThousandEyes said, agreeing with a statement put out by Googe to that effect. + +That problem affected other regions of the U.S. as evidenced by Google sites such as google.com intermittently returning server errors."These 500 server errors are consistent with an inability to reach the backend systems necessary to correctly load various services," ThousandEyes said in a statement. "Any traffic traversing the affected region — connecting from Google’s front-end servers to backend services — may have been impacted and seen the resulting server errors." + +ThousandEyes posted interactive results of tests it ran about the outage [here][11] and [here][12]. + +. + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3534130/covid-19-weekly-health-check-of-isps-cloud-providers-and-conferencing-services.html + +作者:[Tim Greene][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Tim-Greene/ +[b]: https://github.com/lujun9972 +[1]: https://www.thousandeyes.com/outages +[2]: https://www.networkworld.com/article/3391380/does-your-cloud-access-security-broker-support-ipv6-it-should.html +[3]: https://www.cio.com/article/3532899/business-continuity-coronavirus-crisis-puts-cios-plans-to-the-test.html +[4]: https://www.networkworld.com/article/3532440/coronavirus-challenges-remote-networking.html +[5]: https://www.csoonline.com/article/3528878/a-security-guide-for-pandemic-planning-7-key-steps.html +[6]: https://www.computerworld.com/article/3250684/10-tips-to-set-up-your-home-office-for-videoconferencing.html +[7]: https://www.computerworld.com/article/3532283/how-to-survive-and-thrive-while-working-from-home.html +[8]: https://www.infoworld.com/article/3533050/wth-oss-knows-how-to-wfh-irl.html +[9]: https://blog.thousandeyes.com/internet-health-during-covid-19/ +[10]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[11]: https://agisi.share.thousandeyes.com/view/endpoint-agent/?roundId=1585237800&metric=loss&scenarioId=eyebrowNetwork&filters=%7B%22filters%22:%7B%22domain%22:%5B%22google.com%22%5D,%22geonameId%22:%5B4148757,4180439,4459467,4460243,4509177,4671240,4744709,4744870,4887398,4890864,4930956,5099836,5110266,5110302,5128581,5145476,5150529,5282804,5786882%5D%7D%7D&page=0,0&grouping=BY_NETWORK,BY_DOMAIN +[12]: https://ythkurgdz.share.thousandeyes.com/view/tests/?roundId=1585236900&metric=availability&scenarioId=httpServer&testId=1283781 +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world From 0ee178b5842e74099b7c1d5d21811c599cb4a0f4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Mar 2020 10:40:01 +0800 Subject: [PATCH 0021/1809] PRF @wxy --- ...ware projects working to solve COVID-19.md | 61 ++++++++++--------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/translated/tech/20200319 7 open hardware projects working to solve COVID-19.md b/translated/tech/20200319 7 open hardware projects working to solve COVID-19.md index 2655544108..423ad5f6e8 100644 --- a/translated/tech/20200319 7 open hardware projects working to solve COVID-19.md +++ b/translated/tech/20200319 7 open hardware projects working to solve COVID-19.md @@ -1,45 +1,48 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (7 open hardware projects working to solve COVID-19) [#]: via: (https://opensource.com/article/20/3/open-hardware-covid19) [#]: author: (Harris Kenny https://opensource.com/users/harriskenny) -应对新冠病毒事件的 7 个开放硬件项目 +应对新冠病毒的 7 个开源硬件项目 ====== -> 开放硬件解决方案可以为抵御新型冠状病毒的传播和痛苦做出贡献。 -![open on blue background with heartbeat symbol][1] +> 开源硬件解决方案可以为抵御新型冠状病毒的传播和痛苦做出贡献。 -开源[硬件][2]运动长期以来一直主张维修权的重要性,完全拥有所购买的技术,并能够像音乐一样重新组合和复制组件。因此,在这个充满挑战的时期内,开放硬件为由冠状病毒大流行引起的一些问题提供了一些答案。 +![](https://img.linux.net.cn/data/attachment/album/202003/29/103909f50gm91z22twuv23.jpg) + +开源[硬件][2]运动长期以来一直主张维修权的重要性,完全拥有所购买的技术,并能够像音乐一样重新组合和复制部件。因此,在这个充满挑战的时期内,开源硬件为由冠状病毒大流行引起的一些问题提供了一些答案。 ### 背景概述 -首先,全球的硬件开发人员正在努力使用开源解决供应链中的弱点,在过去 30 年中,这种理念推动了新软件技术的大量涌现。过去在硬件运动方面的成功,如 [RepRap Project][3],[Open Source Ecology][4] 和 [Open Source Beehives][5],证明了这一点是可以做到的。 +首先,全球的硬件开发人员正在努力使用开源解决供应链中的弱点,在过去 30 年中,这种理念推动了新软件技术的大量涌现。过去在硬件运动方面的成功,如 [RepRap Project][3]、[Open Source Ecology][4] 和 [Open Source Beehives][5],证明了这一点是可以做到的。 -对使用 3D 打印和其他技术按需制造安全设备的替换零件和按需生产的创作者的兴趣日益增加。例如,香港理工大学实验室为医院工作人员提供 [3D 打印面罩][6]。意大利初创公司 Isinnova 与米兰 FabLab 合作,为受重灾的意大利北部提供用于呼吸机的 [3D 打印替换阀][7]。公司们还发布了设计以适应我们的物理接触,例如 Materialise 的 [3D 打印免提开门器] [8]。这些更换零件和解决问题的示例是一个很好的起点,为挽救生命做出了努力。 +对于使用 3D 打印和其他技术按需生产安全设备和按需制造它的替换零件,创客们的兴趣日益增加。例如,香港理工大学实验室为医院工作人员提供 [3D 打印面罩][6]。意大利初创公司 Isinnova 与米兰 FabLab 合作,为受重灾的意大利北部提供用于呼吸机的 [3D 打印替换阀][7]。公司们还发布了设计以适应我们的物理接触需求,例如 Materialise 的 [3D 打印免提开门器][8]。这些更换零件和解决问题的示例是一个很好的起点,为挽救生命做出了努力。 另一种传统的硬件技术正在加速发展:缝纫。法新社报道说,全球急需口罩,来自世界卫生组织的指导也指明了其重要性。随着一次性口罩要优先供给于医护人员,捷克共和国的人们[开始缝制自己的口罩][9]。(重复使用的口罩确实会带来细菌问题。)Facebook 小组“捷克缝制口罩”开始在他们的国家解决这个问题,成千上万的成员开始用起了他们的家用缝纫机。 -开源硬件设备和机械项目也越来越受欢迎。首先,有一些测试性设备具备高精度且功能强大。其次,在没有其他选择方案的情况下,有一些医疗设备可以归类为现场级(最好)。这些项目将在下面详细概述。 +开源硬件设备和机械项目也越来越受欢迎。首先,有一些测试性设备具备高精度且功能强大。其次,在没有其他选择方案的情况下,有一些医疗设备(顶多)可以归类为现场级。这些项目将在下面详细概述。 -为了解更多信息,我与总部位于芝加哥的 [Tapster Robotics][10] 的创始人兼首席执行官 Jason Huggins 进行了交谈。Tapster Robotics 使用 3 D打印、计算机数控(CNC)加工和 [Arduino][11] 等开放式电子产品设计和制造台式机器人。他兼具技术知识和工业能力,具有很高的影响力。他想投入自己公司的资源来帮助这场斗争。 +为了解更多信息,我与总部位于芝加哥的 [Tapster Robotics][10] 的创始人兼首席执行官 Jason Huggins 进行了交谈。Tapster Robotics 使用 3D 打印、计算机数控(CNC)加工和 [Arduino][11] 等开源电子产品设计和制造台式机器人。他兼具技术知识和工业能力,具有很高的影响力。他想投入自己公司的资源来帮助这场斗争。 -“基本上,我们现在正处于第二次世界大战的动员时刻。即使我不是医生,我们仍然应该遵循希波克拉底誓言。无论我做什么,我都不想让问题变得更糟,” Huggins 解释。他认为:“作为对策,世卫组织执行主任 Michael Ryan 博士发表了这样的评论:‘速度胜过完美’。” +“基本上,我们现在正处于第二次世界大战的动员时刻。即使我不是医生,我们仍然应该遵循希波克拉底誓言。无论我做什么,我都不想让问题变得更糟”,Huggins 解释,他认为:“作为对策,世卫组织执行主任 Michael Ryan 博士发表了这样的评论:‘速度胜过完美’。” -> 哇 +> 哇! > -> 这个人是疾病传播的全球权威。如果您是领导者(无论以何种身份),请注意。如果不是,也请注意。 [pic.twitter.com/bFogaekehM][12] +> 这个人是疾病传播的全球权威。如果您是领导者(无论以何种身份),请注意。如果不是,也请注意。 +> +> [pic.twitter.com/bFogaekehM][12] > > — Jim RichardsSh🎙wgram(@JIMrichards1010)[2020 年 3 月 15 日][13] Huggins 在应需提供方面具有丰富的经验。他的努力有助于 [Healthcare.gov][14] 在挑战性的最初启动后得以扩展。他还创建了软件行业标准的测试框架 Selenium 和 Appium。有了这一经验,他的建议非常值得考虑。 -我还与 [Tyson Law][15] 的西雅图律师 Mark Tyson 进行了交谈,他与初创公司和小型企业合作。他在快速发展的行业中与敏捷公司合作有着直接的经验。在阐述整个问题时,Tyson 说到: +我还与 [Tyson Law][15] 的西雅图律师 Mark Tyson 进行了交谈,他的合作对象是初创公司和小型企业。他在快速发展的行业中与敏捷公司合作有着直接的经验。在阐述整个问题时,Tyson 说到: -> 《善良的撒玛利亚人法Good Samaritan law》保护志愿者(即“好撒玛利亚人”)免于因其决定在紧急情况下提供援助而承担责任。尽管这些法律的具体内容因州而异,但它们具有共同的公共政策依据:即鼓励旁观者帮助遇到紧急情况的其他人。可以想象,除了传统的把车祸的受害者从伤害中拉出来之外,这种理论依据可以证明在不太传统的环境中应用这类法律的合理性。 +> 《善良的撒玛利亚人法Good Samaritan law》保护志愿者(即“好撒玛利亚人”)免于因其在紧急情况下提供援助的决定而承担责任。尽管这些法律的具体内容因州而异,但它们具有共同的公共政策依据:即鼓励旁观者帮助遇到紧急情况的其他人。可以想象,除了传统的把车祸的受害者从伤害中拉出来之外,这种理论依据可以证明在不太传统的环境中应用这类法律的合理性。 对于这种特定情况,Tyson 指出: @@ -49,17 +52,17 @@ Tyson 明白情况的紧迫性和严重性。使用合同的这种选择并不 综上所述,让我们探索正在使用或正在开发中的项目(可能很快就可以部署)。 -### 7 个与新冠病毒对抗的开放硬件项目 +### 7 个与新冠病毒对抗的开源硬件项目 #### Opentrons -[Opentrons][16] 的开源实验室自动化平台由一套开源硬件、经过验证的实验室器具、消耗品、试剂和工作站组成。Opentrons 表示,其产品可以“在下订单后几天内每天自动进行多达 2400 个测试”的系统,可以极大地帮助提高[新冠病毒测试规模][17]。它计划在 7 月 1 日之前提升多达 100 万个测试样本。 +[Opentrons][16] 的开源实验室自动化平台由一套开源硬件、经过验证的实验室器具、消耗品、试剂和工作站组成。Opentrons 表示,其产品可以“在下订单后几天内每天自动进行多达 2400 个测试”的系统,可以极大地帮助提高[新冠病毒测试规模][17]。它计划在 7 月 1 日之前提升到多达 100 万个测试样本。 ![Opentrons roadmap graphic][18] *来自 Opentrons [网站][17],版权所有* -该公司已经在与联邦和地方政府机构合作,以确定其系统是否可以在[紧急使用授权][19]下用于临床诊断。 Opentrons 在 [Apache 2.0 许可证][20]下共享。我最初是从与该项目有联系的生物学家 Kristin Ellis 斯那里得知它的。 +该公司已经在与联邦和地方政府机构合作,以确定其系统是否可以在[紧急使用授权][19]下用于临床诊断。 Opentrons 在 [Apache 2.0 许可证][20]下共享。我最初是从与该项目有联系的生物学家 Kristin Ellis 那里得知它的。 #### Chai 的 Open qPCR @@ -67,17 +70,17 @@ Chai 的 [Open qPCR][21] 设备使用[聚合酶链反应][22](PCR)快速检 #### OpenPCR -[OpenPCR][25] 是 Chai Open qPCR 的创建者 Josh Perfetto 和 Jessie Ho 的 PCR 测试设备套件。与以前的项目相比,这更像是一种 DIY 开源设备,但它具有相同的使用场景:使用环境测试来识别野外冠状病毒。正如该项目页面所指出的那样,“能够检测这些病原体的传统实时 PCR 机通常花费超过 30,000 美元,而且不适合在现场使用。”由于 OpenPCR 是用户构建的工具包,并且在 [GPLv3.0 许可证][26]下共享,因此该设备旨在使分子诊断的访问大众化。 +[OpenPCR][25] 是 Chai Open qPCR 的创建者 Josh Perfetto 和 Jessie Ho 的 PCR 测试设备套件。与他们的前一个项目相比,这更像是一种 DIY 开源设备,但它具有相同的使用场景:使用环境测试来识别野外冠状病毒。正如该项目页面所指出的那样,“能够检测这些病原体的传统实时 PCR 设备通常花费超过 30,000 美元,而且不适合在现场使用。”由于 OpenPCR 是用户构建的工具包,并且在 [GPLv3.0 许可证][26]下共享,因此该设备旨在使分子诊断的访问大众化。 ![OpenPCR][27] *来自 OpenPCR [网站][25],版权所有* -而且,就像任何优秀的开源项目一样,它也有一个衍生产品!瑞士的 [GaudiLabs][29] 推出的 [WildOpenPCR][28] 也以 [GPLv3.0 许可证][30]共享。 +而且,就像任何优秀的开源项目一样,它也有一个衍生产品!瑞士的 [Gaudi Labs][29] 推出的 [WildOpenPCR][28] 也以 [GPLv3.0 许可证][30]共享。 #### PocketPCR -Gaudi Labs 的 [PocketPCR][31] 热循环仪可通过升高和降低小试管中液体的温度来激活生物反应。它可以通过简单的 USB 电源适配器供电,该适配器可以绑定到设备上,也可以单独使用,不需要计算机或智能手机时可使用预设参数。 +Gaudi Labs 的 [PocketPCR][31] 热循环仪可通过升高和降低小试管中液体的温度来激活生物反应。它可以通过简单的 USB 电源适配器供电,该适配器可以绑定到设备上,也可以单独使用,不使用计算机或智能手机时可使用预设参数。 ![PocketPCR][32] @@ -87,7 +90,7 @@ Gaudi Labs 的 [PocketPCR][31] 热循环仪可通过升高和降低小试管中 #### Open Lung 低资源呼吸机 -[Open Lung 低资源呼吸机][34]是一种快速部署的呼吸机,它以[气囊阀罩][35](BVM)(也称为 Ambu 气囊)为核心组件。Ambu 气囊已批量生产,经过认证,体积小,机械简单,并且适用于侵入性导管和口罩。 OPEN LUNG 呼吸机使用微电子技术来感测和控制气压和流量,以实现半自主运行。 +[Open Lung 低资源呼吸机][34]是一种快速部署的呼吸机,它以[气囊阀罩][35](BVM)(也称为 Ambu 气囊)为核心组件。Ambu 气囊已批量生产,经过认证,体积小,机械简单,并且适用于侵入性导管和口罩。 Open Lung 呼吸机使用微电子技术来感测和控制气压和流量,以实现半自主运行。 ![Open Lung ventilator][36] @@ -101,27 +104,27 @@ Gaudi Labs 的 [PocketPCR][31] 热循环仪可通过升高和降低小试管中 #### Folding at Home -[Folding at Home][40] 是一个分布式计算项目,用于模拟蛋白质动力学,包括蛋白质折叠的过程以及与多种疾病有关的蛋白质运动。这是一个面向公民科学家、研究人员和志愿者的行动呼吁,类似于退役的 [SETI@Home 项目][41]中在家中使用计算机来运行解码计算。如果你是具备强大计算机硬件功能的技术人员,那么这个项目适合你。 +[Folding at Home][40] 是一个分布式计算项目,用于模拟蛋白质动力学,包括蛋白质折叠的过程以及与多种疾病有关的蛋白质运动。这是一个面向公民科学家、研究人员和志愿者的行动呼吁,类似于退役的 [SETI@Home 项目][41]使用家中的计算机来运行解码计算。如果你是具备强大计算机硬件功能的技术人员,那么这个项目适合你。 ![Markov state model][42] *Vincent Voelz,CC BY-SA 3.0* -Folding at Home 项目使用马尔可夫状态模型(如上所示)来建模蛋白质可能采取的形状和折叠途径,以寻找新的治疗机会。你可以在华盛顿大学生物物理学家 Greg Bowman 的帖子“[它是如何运作的以及如何提供帮助][43]”中找到有关该项目的更多信息。 +Folding at Home 项目使用马尔可夫状态模型(如上所示)来建模蛋白质可能采取的形状和折叠途径,以寻找新的治疗机会。你可以在华盛顿大学生物物理学家 Greg Bowman 的帖子《[它是如何运作的以及如何提供帮助][43]》中找到有关该项目的更多信息。 -该项目涉及来自许多国家(包括香港、克罗地亚、瑞典和美国)的财团的学术实验室、贡献者和公司赞助者。 在 [GitHub][45] 上,[在混合了 GPL 和专有许可证][44]下可以共享,并且可以在 Windows、macOS 和 GNU/Linux(例如 Debian、Ubuntu、Mint、RHEL、CentOS、Fedora)。 +该项目涉及来自许多国家(包括香港、克罗地亚、瑞典和美国)的财团的学术实验室、贡献者和公司赞助者。 在 [GitHub][45] 上,[在混合了 GPL 和专有许可证][44]下共享,并且可以在 Windows、macOS 和 GNU/Linux(例如 Debian、Ubuntu、Mint、RHEL、CentOS、Fedora)。 ### 许多其他有趣的项目 -这些项目只是在开放硬件领域中解决或治疗新冠病毒活动中的一小部分。在研究本文时,我发现了其他值得探索的项目,例如: +这些项目只是在开源硬件领域中解决或治疗新冠病毒活动中的一小部分。在研究本文时,我发现了其他值得探索的项目,例如: * Coronavirus Tech Handbook 提供的[开源呼吸机、氧气浓缩器等][46] * 来自 ProjectOpenAir 的 [有用的工程][47] * Hackaday 上的[开源呼吸机黑客马拉松][48] * 约翰·霍普金斯急诊医学住院医师 Julian Botta 的[简单开源机械呼吸机规范][49] * [与冠状病毒有关的网络钓鱼、恶意软件和随机软件正在增加][50],作者:Shannon Morse -* [将低成本的 CPAP 鼓风机转换为基本通风机][51],作者: jcl5m1 -* [A.I.R.E. 论坛上关于开放呼吸器和风扇的讨论][52](西班牙语) +* [将低成本的 CPAP 鼓风机转换为基本呼吸机][51],作者: jcl5m1 +* [A.I.R.E. 论坛上关于开源呼吸器和风扇的讨论][52](西班牙语) * [关于新冠病毒的开源医疗硬件的特殊问题][53],作者:Elsevier HardwareX 这些项目遍布全球,而这种全球合作正是我们所需要的,因为病毒无视国界。新冠病毒大流行在不同时期以不同方式影响国家,因此我们需要一种分布式方法。 @@ -132,7 +135,7 @@ Folding at Home 项目使用马尔可夫状态模型(如上所示)来建模 *OSHdata,CC BY-SA 4.0 国际版* -如果你有兴趣加入这场与全球开源硬件开发人员的对话,请加入[Open Hardware Summit Discord][56]服 务器,并通过专用渠道进行有关新冠病毒的讨论。你在这里可以找到机器人专家、设计师、艺术家、固件和机械工程师、学生、研究人员以及其他共同为这场战争而战的人。希望可以看到你。 +如果你有兴趣加入这场与全球开源硬件开发人员的对话,请加入[开源硬件峰会的 Discord][56] 服务器,并通过专用渠道进行有关新冠病毒的讨论。你在这里可以找到机器人专家、设计师、艺术家、固件和机械工程师、学生、研究人员以及其他共同为这场战争而战的人。希望可以看到你。 -------------------------------------------------------------------------------- @@ -141,7 +144,7 @@ via: https://opensource.com/article/20/3/open-hardware-covid19 作者:[Harris Kenny][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 03202111aa42b092d0c1e293484e6b16719b5a1c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Mar 2020 10:43:52 +0800 Subject: [PATCH 0022/1809] PUB @wxy https://linux.cn/article-12047-1.html --- ...0319 7 open hardware projects working to solve COVID-19.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200319 7 open hardware projects working to solve COVID-19.md (99%) diff --git a/translated/tech/20200319 7 open hardware projects working to solve COVID-19.md b/published/20200319 7 open hardware projects working to solve COVID-19.md similarity index 99% rename from translated/tech/20200319 7 open hardware projects working to solve COVID-19.md rename to published/20200319 7 open hardware projects working to solve COVID-19.md index 423ad5f6e8..98ab25270f 100644 --- a/translated/tech/20200319 7 open hardware projects working to solve COVID-19.md +++ b/published/20200319 7 open hardware projects working to solve COVID-19.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12047-1.html) [#]: subject: (7 open hardware projects working to solve COVID-19) [#]: via: (https://opensource.com/article/20/3/open-hardware-covid19) [#]: author: (Harris Kenny https://opensource.com/users/harriskenny) From 9c5a49eb911cb873fd839a5fb56eefad02ef459c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Mar 2020 11:21:39 +0800 Subject: [PATCH 0023/1809] PRF @geekpi --- ...rkdown tools for the Linux command line.md | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/translated/tech/20200319 4 Markdown tools for the Linux command line.md b/translated/tech/20200319 4 Markdown tools for the Linux command line.md index bb6a4944fe..cb95fc02bb 100644 --- a/translated/tech/20200319 4 Markdown tools for the Linux command line.md +++ b/translated/tech/20200319 4 Markdown tools for the Linux command line.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (4 Markdown tools for the Linux command line) @@ -9,28 +9,30 @@ 4 个 Linux 命令行下的 Markdown 工具 ====== -命令行 Markdown 工具快速、强大、灵活。以下是 4 个值得试一下的工具。 -![A person working.][1] -在处理 [Markdown][2] 格式的文件时,命令行工具会占据主导地位。它们轻巧、快速、强大、灵活,它们大多数都遵循 Unix 哲学只做好一件事。 +> 命令行 Markdown 工具快速、强大、灵活。以下是 4 个值得试一下的工具。 + +![](https://img.linux.net.cn/data/attachment/album/202003/29/112110pbd22dku6b2g6ku6.jpg) + +(在 Linux 上)在处理 [Markdown][2] 格式的文件时,命令行工具会占据主导地位。它们轻巧、快速、强大、灵活,它们大多数都遵循 Unix 哲学只做好一件事。 看一下这四个程序,它们可以帮助你在命令行中更有效地处理 Markdown 文件。 ### mdless -如果你使用过一段时间的 Linux 命令行,那么你可能对名为 [less][3] 的文本查看器很熟悉。当然,你可以使用 less 查看 Markdown 文件,但结果有点枯燥。如何在终端中查看 Markdown 文件效果更好一点?来使用 [mdless][4]。 +如果你使用过一段时间的 Linux 命令行,那么你可能对名为 [less][3] 的文本查看器很熟悉。当然,你可以使用 `less` 查看 Markdown 文件,但结果有点枯燥。如何在终端中查看 Markdown 文件效果更好一点?来使用 [mdless][4]。 ![mdless][5] -你可以使用键盘上的箭头键四处移动,并且 mdless 提供了很好的搜索功能。 +你可以使用键盘上的箭头键四处移动,并且 `mdless` 提供了很好的搜索功能。 -mdless 不仅会显示文本,而且还会渲染标题、粗体和斜体等格式。它还可以显示表格并语法高亮代码块。你还可以创建一个或多个主题文件来[定制][6] mdless 的外观。 +`mdless` 不仅会显示文本,而且还会渲染标题、粗体和斜体等格式。它还可以显示表格并语法高亮代码块。你还可以创建一个或多个主题文件来[定制][6] `mdless` 的外观。 ### Markdown lint 工具 你在快速输入时会犯错误。如果你在使用 Markdown(或其他任何标记语言)时丢失了一些格式,那么在将文件转换为另一种格式时可能会有问题。 -程序员通常使用名为 _linter_ 的工具来检查语法是否正确。你可以使用 [Markdown lint 工具][7]对 Markdown 执行相同的操作。 +程序员通常使用名为 linter 的工具来检查语法是否正确。你可以使用 [Markdown lint 工具][7]对 Markdown 执行相同的操作。 在你对 Markdown 文件运行该工具时,它会根据[规则集][8]检查格式。这些规则控制着文档的结构,包括标题级别的顺序、不正确的缩进和间距、代码块问题、文件中存在 HTML 等等。 @@ -40,25 +42,25 @@ mdless 不仅会显示文本,而且还会渲染标题、粗体和斜体等格 ### mdmerge -合并任何类型的文件可能会很痛苦。例如,我在整理一本电子书。它是一篇文章集,最初发布在我的[每周邮件][10]中。这些文章都放在单独的文件中,作为受虐狂,我以凌乱,手动的方式将它们组合在一起。 +合并任何类型的文件可能会很痛苦。例如,我在整理一本电子书。它是一篇文章集,最初发布在我的[每周邮件][10]中。这些文章都放在单独的文件中,作为受虐狂,我以凌乱、手动的方式将它们组合在一起。 -我希望在开始项目之前就了解了 [mdmerge][11]。这样我可以节省很多时间和精力。 +我希望在开始这个项目之前就知道 [mdmerge][11]。这样我可以节省很多时间和精力。 -mdmerge,你可能已经从名称中猜到了它的作用,它将两个或多个 Markdown 文件合并为一个文件。你无需在命令行中输入文件名。相反,你可以将它们添加到名为 book.txt 的文件中,并将其用作 mdmerge 的输入文件。 +`mdmerge`,你可能已经从名称中猜到了它的作用,它将两个或多个 Markdown 文件合并为一个文件。你无需在命令行中输入文件名。相反,你可以将它们添加到名为 `book.txt` 的文件中,并将其用作 `mdmerge` 的输入文件。 -这并不是 mdmerge 能做的一切。你可以添加对另一个文档的引用(使用 Markdown 格式引用或一段源代码),然后将其放入主文档中。这样一来,你就可以创建针对特定受众定制的[主文档] [12]。 +这并不是 `mdmerge` 能做的一切。你可以添加对另一个文档的引用(使用 Markdown 格式引用或一段源代码),然后将其放入主文档中。这样一来,你就可以创建针对特定受众定制的[主文档][12]。 -mdmerge 不会是你一直使用的程序之一。当你需要时,你会很高兴硬盘上有它。 +`mdmerge` 不会是你经常使用的程序。但当你需要时,你会很高兴硬盘上有它。 ### bashblog -[bashblog][13] 并不是严格上的 Markdown 工具。它获取 Markdown 文件,并使用它们来构建简单的博客或网站。你可以将 bashblog 视为[静态站点生成器][14],但是它没有很多脆弱的依赖关系。一切几乎都在一个不到 50KB 的 shell 脚本中。 +严格说 [bashblog][13] 并不是 Markdown 工具。它获取 Markdown 文件,并使用它们来构建简单的博客或网站。你可以将 bashblog 视为[静态站点生成器][14],但是它没有很多脆弱的依赖关系。一切几乎都在一个不到 50KB 的 shell 脚本中。 -要使用 bashblog,只需在计算机上安装 Markdown 处理器即可。在此,你可以编辑 Shell 脚本添加有关博客的信息,例如标题、名字、社交媒体链接等。然后运行脚本。之后会在默认文本编辑器中新建一篇文章。开始输入。 +要使用 bashblog,只需在计算机上安装 Markdown 处理器即可。在此,你可以编辑 Shell 脚本添加有关博客的信息,例如标题、名字、社交媒体链接等。然后运行该脚本。之后会在默认文本编辑器中新建一篇文章。开始输入。 保存文章后,你可以发布它或将其另存为草稿。如果你选择发布文章,那么 bashblog 会将你的博客、文章和所有内容生成为一组 HTML 文件,你可以将它们上传到 Web 服务器。 -它开箱即用,你的博客会平淡无奇,但可以使用。你可以根据自己喜好编辑站点的 CSS 文件来改变外观。 +它开箱即用,你的博客或许会平淡无奇,但可以使用。你可以根据自己喜好编辑站点的 CSS 文件来改变外观。 ![bashblog][15] @@ -66,12 +68,12 @@ mdmerge 不会是你一直使用的程序之一。当你需要时,你会很高 当然,Panddoc 是一个非常强大的工具,可以将 Markdown 文件转换为其他标记语言。但是,在命令行上使用 Markdown 要比 Pandoc 多。 -如果你需要 Pandoc 修复,请查看我们在 Opensource.com 上发布的文章: +如果你需要 Pandoc,请查看我们发布的文章: - * [使用 Pandoc 在命令行中转换文件][16] -  * [使用 Pandoc 将你的书变成网站和 ePub] [17] -  * [如何使用 Pandoc 生成论文] [18] -  * [使用 Pandoc 将 Markdown 文件转换为 word 文档] [19] +* [在命令行使用 Pandoc 进行文件转换][16] +* [使用 Pandoc 将你的书转换成网页和电子书][17] +* [用 Pandoc 生成一篇调研论文][18] +* [使用 pandoc 将 Markdown 转换为格式化文档][19] @@ -82,7 +84,7 @@ via: https://opensource.com/article/20/3/markdown-apps-linux-command-line 作者:[Scott Nesbitt][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -103,7 +105,7 @@ via: https://opensource.com/article/20/3/markdown-apps-linux-command-line [13]: https://github.com/cfenollosa/bashblog [14]: https://en.wikipedia.org/wiki/Web_template_system#Static_site_generators [15]: https://opensource.com/sites/default/files/uploads/bashblog.png (bashblog) -[16]: https://opensource.com/article/18/9/intro-pandoc -[17]: https://opensource.com/article/18/10/book-to-website-epub-using-pandoc -[18]: https://opensource.com/article/18/9/pandoc-research-paper -[19]: https://opensource.com/article/19/5/convert-markdown-to-word-pandoc +[16]: https://linux.cn/article-10228-1.html +[17]: https://linux.cn/article-10287-1.html +[18]: https://linux.cn/article-10179-1.html +[19]: https://linux.cn/article-11160-1.html From 8980fb6df72fb68b605ca0dd239e2e301070a8b7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Mar 2020 11:22:31 +0800 Subject: [PATCH 0024/1809] PUB @geekpi https://linux.cn/article-12048-1.html --- .../20200319 4 Markdown tools for the Linux command line.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200319 4 Markdown tools for the Linux command line.md (98%) diff --git a/translated/tech/20200319 4 Markdown tools for the Linux command line.md b/published/20200319 4 Markdown tools for the Linux command line.md similarity index 98% rename from translated/tech/20200319 4 Markdown tools for the Linux command line.md rename to published/20200319 4 Markdown tools for the Linux command line.md index cb95fc02bb..0aa052696b 100644 --- a/translated/tech/20200319 4 Markdown tools for the Linux command line.md +++ b/published/20200319 4 Markdown tools for the Linux command line.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12048-1.html) [#]: subject: (4 Markdown tools for the Linux command line) [#]: via: (https://opensource.com/article/20/3/markdown-apps-linux-command-line) [#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) From 6af5ad42ed3bc258c7c4c7aab000cdb4af666574 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 29 Mar 2020 11:30:03 +0800 Subject: [PATCH 0025/1809] Rename sources/tech/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md to sources/news/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md --- ... building operators in Kubernetes, and more industry trends.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md (100%) diff --git a/sources/tech/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md b/sources/news/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md similarity index 100% rename from sources/tech/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md rename to sources/news/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md From 622346acfd50f1edcdb090d728faf1fe27ba4387 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Mar 2020 12:18:53 +0800 Subject: [PATCH 0026/1809] PUB @HankChow https://linux.cn/article-12049-1.html --- ...n Kubernetes on a Raspberry Pi with k3s.md | 61 +++++++------------ 1 file changed, 23 insertions(+), 38 deletions(-) rename {translated/tech => published}/20200310 Run Kubernetes on a Raspberry Pi with k3s.md (81%) diff --git a/translated/tech/20200310 Run Kubernetes on a Raspberry Pi with k3s.md b/published/20200310 Run Kubernetes on a Raspberry Pi with k3s.md similarity index 81% rename from translated/tech/20200310 Run Kubernetes on a Raspberry Pi with k3s.md rename to published/20200310 Run Kubernetes on a Raspberry Pi with k3s.md index e0b3ad324c..79b42ade4d 100644 --- a/translated/tech/20200310 Run Kubernetes on a Raspberry Pi with k3s.md +++ b/published/20200310 Run Kubernetes on a Raspberry Pi with k3s.md @@ -1,29 +1,32 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12049-1.html) [#]: subject: (Run Kubernetes on a Raspberry Pi with k3s) [#]: via: (https://opensource.com/article/20/3/kubernetes-raspberry-pi-k3s) [#]: author: (Lee Carpenter https://opensource.com/users/carpie) 使用 K3s 在树莓派上运行 Kubernetes 集群 ====== -> 跟随接下来的介绍,自己搭建一个三节点的 Kubernetes 集群。 -![A ship wheel with someone steering][1] +> 跟随接下来的介绍,自己搭建一个三节点的 Kubernetes 集群。 + +![](https://img.linux.net.cn/data/attachment/album/202003/29/121559p44e3dfrerf3zver.jpg) 我对在树莓派上搭建 [Kubernetes][2] 集群已经感兴趣很长时间了,只要照着网上的教程,我可以在由三个树莓派组成的集群中搭建一套 Kubernetes 并正常运行。但在这种情况下,主节点上的内存和 CPU 资源捉襟见肘,执行 Kubernetes 任务的时候往往性能不佳,想要升级 Kubernetes 就更不可能了。 -这个时候,我发现了 [K3s][3] 这个项目。K3s 誉为可用于资源受限环境下的轻量级 Kubernetes,它还针对 ARM 处理器做出了优化,这让 Kubernetes 集群可以在树莓派上运行得更好。在下文中,我们将会使用 K3s 来创建一个 Kubernetes 集群。 +这个时候,我非常激动地发现了 [K3s][3] 这个项目。K3s 被誉为在可用于资源受限环境下的轻量级 Kubernetes,它还针对 ARM 处理器做出了优化,这让 Kubernetes 集群可以在树莓派上运行得更好。在下文中,我们将会使用 K3s 来创建一个 Kubernetes 集群。 + +- [video](https://youtu.be/6PqxJhV-t1s) ### 准备 要按照本文介绍的方式创建 Kubernetes 集群,首先需要准备: - * 至少一个树莓派(包括 SD 卡和电源) - * 网线 - * 将所有树莓派连接到一起的交换机或路由器 +* 至少一个树莓派(包括 SD 卡和电源) +* 网线 +* 将所有树莓派连接到一起的交换机或路由器 我们会通过在线安装的方式安装 K3s,因此还需要可以连接到互联网。 @@ -35,7 +38,6 @@ 为了不需要通过 IP 来引用某一个节点,我们将每个节点的主机名记录到 PC 的 `/etc/hosts` 文件当中: - ``` echo -e "192.168.0.50\tkmaster" | sudo tee -a /etc/hosts echo -e "192.168.0.51\tknode1" | sudo tee -a /etc/hosts @@ -48,20 +50,17 @@ echo -e "192.168.0.52\tknode2" | sudo tee -a /etc/hosts 在主节点上安装 Raspbian 完成后,启动树莓派并通过 `ssh` 连接上去: - ``` ssh pi@kmaster ``` -执行以下命令安装 K3s: - +在主节点上执行以下命令安装 K3s: ``` curl -sfL https://get.k3s.io | sh - ``` -等到命令跑完以后,一个单节点集群就已经运行起来了。还在这个树莓派上执行: - +等到命令跑完以后,一个单节点集群就已经运行起来了。让我们检查一下,还在这个树莓派上执行: ``` sudo kubectl get nodes @@ -69,7 +68,6 @@ sudo kubectl get nodes 就会看到这样的输出: - ``` NAME STATUS ROLES AGE VERSION kmaster Ready master 2m13s v1.14.3-k3s.1 @@ -77,8 +75,7 @@ kmaster Ready master 2m13s v1.14.3-k3s.1 ### 获取连接令牌join token -之后我们需要部署工作节点。在工作节点上安装 K3s 的时候,会需要用到连接令牌,它放置在主节点的文件系统上。首先把连接令牌打印出来保存以便后续使用: - +之后我们需要部署工作节点。在工作节点上安装 K3s 的时候,会需要用到连接令牌,它放置在主节点的文件系统上。首先把连接令牌保存出来以便后续使用: ``` sudo cat /var/lib/rancher/k3s/server/node-token @@ -90,17 +87,15 @@ sudo cat /var/lib/rancher/k3s/server/node-token 启动主机名为 `knode1` 的树莓派,通过 `ssh` 连接上去: - ``` ssh pi@knode1 ``` 在这个树莓派上,安装 K3s 的过程和之前差不多,但需要另外加上一些参数,表示它是一个工作节点,需要连接到一个已有的集群上: - ``` -curl -sfL | K3S_URL= \ -K3S_TOKEN=<刚才保存下来的连接令牌> sh - +curl -sfL http://get.k3s.io | K3S_URL=https://192.168.0.50:6443 \ +K3S_TOKEN=刚才保存下来的连接令牌 sh - ``` `K3S_TOKEN` 的值需要替换成刚才保存下来的实际的连接令牌。完成之后,在主机名为 `knode2` 的树莓派上重复这个安装过程。 @@ -109,20 +104,17 @@ K3S_TOKEN=<刚才保存下来的连接令牌> sh - 现在如果我们想要查看或者更改集群,都必须 `ssh` 到集群的主节点才能使用 `kubectl`,这是比较麻烦的。因此我们会将 `kubectl` 放到 PC 上使用。首先,在主节点上获取一些必要的配置信息,`ssh` 到 `kmaster` 上执行: - ``` sudo cat /etc/rancher/k3s/k3s.yaml ``` -复制上面命令的输出,创建一个目录用来放置配置文件: - +复制上面命令的输出,然后在你的 PC 上创建一个目录用来放置配置文件: ``` mkdir ~/.kube ``` -将复制好的内容写入到 `~/.kube/config` 文件中,然后将 - +将复制好的内容写入到 `~/.kube/config` 文件中,然后编辑该文件,将 ``` server: https://localhost:6443 @@ -130,26 +122,22 @@ server: https://localhost:6443 改为 - ``` server: https://kmaster:6443 ``` 出于安全考虑,只对自己保留这个配置文件的读写权限: - ``` chmod 600 ~/.kube/config ``` 如果 PC 上还没有安装 `kubectl` 的话,就可以开始安装了。Kubernetes 官方网站上有各种平台安装 `kubectl` 的[方法说明][5],我使用的是 Ubuntu 的衍生版 Linux Mint,所以我的安装方法是这样的: - ``` sudo apt update && sudo apt install -y apt-transport-https -curl -s | sudo apt-key add - -echo "deb kubernetes-xenial main" | \ -sudo tee -a /etc/apt/sources.list.d/kubernetes.list +curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - +echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list sudo apt update && sudo apt install kubectl ``` @@ -157,14 +145,12 @@ sudo apt update && sudo apt install kubectl 现在在 PC 上就可以查看 Kubernetes 集群了: - ``` kubectl get nodes ``` 输出大概会是这样: - ``` NAME STATUS ROLES AGE VERSION kmaster Ready master 12m v1.14.3-k3s.1 @@ -176,11 +162,10 @@ knode1 Ready worker 103s v1.14.3-k3s.1 ### K3s 的彩蛋 -如果执行 `kubectl get pods --all-namespaces`,就会看到其它服务的一些 pod,比如 [Traefik][6]。Traefik 在这里起到是反向代理和负载均衡器的作用,它可以让流量从单个入口进入集群后引导到集群中的各个服务。Kubernetes 支持这种机制,但 Kubernetes 本身不提供这个功能,因此 Traefik 是一个不错的选择,K3s 安装后立即可用的优点也得益于此。 +如果执行 `kubectl get pods --all-namespaces`,就会看到其它服务的一些 Pod,比如 [Traefik][6]。Traefik 在这里起到是反向代理和负载均衡器的作用,它可以让流量从单个入口进入集群后引导到集群中的各个服务。Kubernetes 支持这种机制,但 Kubernetes 本身不提供这个功能,因此 Traefik 是一个不错的选择,K3s 安装后立即可用的优点也得益于此。 在后续的文章中,我们会继续探讨 Traefik 在 Kubernetes ingress 中的应用,以及在集群中部署其它组件。敬请关注。 - -------------------------------------------------------------------------------- via: https://opensource.com/article/20/3/kubernetes-raspberry-pi-k3s @@ -188,7 +173,7 @@ via: https://opensource.com/article/20/3/kubernetes-raspberry-pi-k3s 作者:[Lee Carpenter][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2525ef63dbb5e540223a311fdd45eaacfebc499d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 29 Mar 2020 12:35:12 +0800 Subject: [PATCH 0027/1809] Rename sources/tech/20200327 6 tricks for developing a work from home schedule.md to sources/talk/20200327 6 tricks for developing a work from home schedule.md --- .../20200327 6 tricks for developing a work from home schedule.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200327 6 tricks for developing a work from home schedule.md (100%) diff --git a/sources/tech/20200327 6 tricks for developing a work from home schedule.md b/sources/talk/20200327 6 tricks for developing a work from home schedule.md similarity index 100% rename from sources/tech/20200327 6 tricks for developing a work from home schedule.md rename to sources/talk/20200327 6 tricks for developing a work from home schedule.md From b6dc3031b08b13979a17c28c6fcd40d49895fe44 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Sun, 29 Mar 2020 12:47:24 +0800 Subject: [PATCH 0028/1809] hankchow translating --- .../20200327 How open source software is fighting COVID-19.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200327 How open source software is fighting COVID-19.md b/sources/tech/20200327 How open source software is fighting COVID-19.md index c5b95fa4e5..92e80e183a 100644 --- a/sources/tech/20200327 How open source software is fighting COVID-19.md +++ b/sources/tech/20200327 How open source software is fighting COVID-19.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2eda7939738f736345d2e84e8b08562f63b250c5 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 29 Mar 2020 16:03:51 +0800 Subject: [PATCH 0029/1809] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n your blog on GitHub Pages with Python.md | 235 ------------------ ...n your blog on GitHub Pages with Python.md | 232 +++++++++++++++++ 2 files changed, 232 insertions(+), 235 deletions(-) delete mode 100644 sources/tech/20190523 Run your blog on GitHub Pages with Python.md create mode 100644 translated/tech/20190523 Run your blog on GitHub Pages with Python.md diff --git a/sources/tech/20190523 Run your blog on GitHub Pages with Python.md b/sources/tech/20190523 Run your blog on GitHub Pages with Python.md deleted file mode 100644 index da6c13a20e..0000000000 --- a/sources/tech/20190523 Run your blog on GitHub Pages with Python.md +++ /dev/null @@ -1,235 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Run your blog on GitHub Pages with Python) -[#]: via: (https://opensource.com/article/19/5/run-your-blog-github-pages-python) -[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani) - -Run your blog on GitHub Pages with Python -====== -Create a blog with Pelican, a Python-based blogging platform that works -well with GitHub. -![Raspberry Pi and Python][1] - -[GitHub][2] is a hugely popular web service for source code control that uses [Git][3] to synchronize local files with copies kept on GitHub's servers so you can easily share and back up your work. - -In addition to providing a user interface for code repositories, GitHub also enables users to [publish web pages][4] directly from a repository. The website generation package GitHub recommends is [Jekyll][5], written in Ruby. Since I'm a bigger fan of [Python][6], I prefer [Pelican][7], a Python-based blogging platform that works well with GitHub. - -Pelican and Jekyll both transform content written in [Markdown][8] or [reStructuredText][9] into HTML to generate static websites, and both generators support themes that allow unlimited customization. - -In this article, I'll describe how to install Pelican, set up your GitHub repository, run a quickstart helper, write some Markdown files, and publish your first page. I'll assume that you have a [GitHub account][10], are comfortable with [basic Git commands][11], and want to publish a blog using Pelican. - -### Install Pelican and create the repo - -First things first, Pelican (and **ghp-import** ) must be installed on your local machine. This is super easy with [pip][12], the Python package installation tool (you have pip right?): - - -``` -`$ pip install pelican ghp-import` -``` - -Next, open a browser and create a new repository on GitHub for your sweet new blog. Name it as follows (substituting your GitHub username for here and throughout this tutorial): - - -``` -`https://GitHub.com/username/username.github.io` -``` - -Leave it empty; we will fill it with compelling blog content in a moment. - -Using a command line (you command line right?), clone your empty Git repository to your local machine: - - -``` -$ git clone blog -$ cd blog -``` - -### That one weird trick… - -Here's a not-super-obvious trick about publishing web content on GitHub. For user pages (pages hosted in repos named _username.github.io_ ), the content is served from the **master** branch. - -I strongly prefer not to keep all the Pelican configuration files and raw Markdown files in **master** , rather just the web content. So I keep the Pelican configuration and the raw content in a separate branch I like to call **content**. (You can call it whatever you want, but the following instructions will call it **content**.) I like this structure since I can throw away all the files in **master** and re-populate it with the **content** branch. - - -``` -$ git checkout -b content -Switched to a new branch 'content' -``` - -### Configure Pelican - -Now it's time for content configuration. Pelican provides a great initialization tool called **pelican-quickstart** that will ask you a series of questions about your blog. - - -``` -$ pelican-quickstart -Welcome to pelican-quickstart v3.7.1. - -This script will help you create a new Pelican-based website. - -Please answer the following questions so this script can generate the files -needed by Pelican. - -> Where do you want to create your new web site? [.] -> What will be the title of this web site? Super blog -> Who will be the author of this web site? username -> What will be the default language of this web site? [en] -> Do you want to specify a URL prefix? e.g., (Y/n) n -> Do you want to enable article pagination? (Y/n) -> How many articles per page do you want? [10] -> What is your time zone? [Europe/Paris] US/Central -> Do you want to generate a Fabfile/Makefile to automate generation and publishing? (Y/n) y -> Do you want an auto-reload & simpleHTTP script to assist with theme and site development? (Y/n) y -> Do you want to upload your website using FTP? (y/N) n -> Do you want to upload your website using SSH? (y/N) n -> Do you want to upload your website using Dropbox? (y/N) n -> Do you want to upload your website using S3? (y/N) n -> Do you want to upload your website using Rackspace Cloud Files? (y/N) n -> Do you want to upload your website using GitHub Pages? (y/N) y -> Is this your personal page (username.github.io)? (y/N) y -Done. Your new project is available at /Users/username/blog -``` - -You can take the defaults on every question except: - - * Website title, which should be unique and special - * Website author, which can be a personal username or your full name - * Time zone, which may not be in Paris - * Upload to GitHub Pages, which is a "y" in our case - - - -After answering all the questions, Pelican leaves the following in the current directory: - - -``` -$ ls -Makefile content/ develop_server.sh* -fabfile.py output/ pelicanconf.py -publishconf.py -``` - -You can check out the [Pelican docs][13] to find out how to use those files, but we're all about getting things done _right now_. No, I haven't read the docs yet either. - -### Forge on - -Add all the Pelican-generated files to the **content** branch of the local Git repo, commit the changes, and push the local changes to the remote repo hosted on GitHub by entering: - - -``` -$ git add . -$ git commit -m 'initial pelican commit to content' -$ git push origin content -``` - -This isn't super exciting, but it will be handy if we need to revert edits to one of these files. - -### Finally getting somewhere - -OK, now you can get bloggy! All of your blog posts, photos, images, PDFs, etc., will live in the **content** directory, which is initially empty. To begin creating a first post and an About page with a photo, enter: - - -``` -$ cd content -$ mkdir pages images -$ cp /Users/username/SecretStash/HotPhotoOfMe.jpg images -$ touch first-post.md -$ touch pages/about.md -``` - -Next, open the empty file **first-post.md** in your favorite text editor and add the following: - - -``` -title: First Post on My Sweet New Blog -date: -author: Your Name Here - -# I am On My Way To Internet Fame and Fortune! - -This is my first post on my new blog. While not super informative it -should convey my sense of excitement and eagerness to engage with you, -the reader! -``` - -The first three lines contain metadata that Pelican uses to organize things. There are lots of different metadata you can put there; again, the docs are your best bet for learning more about the options. - -Now, open the empty file **pages/about.md** and add this text: - - -``` -title: About -date: - -![So Schmexy][my_sweet_photo] - -Hi, I am and I wrote this epic collection of Interweb -wisdom. In days of yore, much of this would have been deemed sorcery -and I would probably have been burned at the stake. - -😆 - -[my_sweet_photo]: {filename}/images/HotPhotoOfMe.jpg -``` - -You now have three new pieces of web content in your content directory. Of the content branch. That's a lot of content. - -### Publish - -Don't worry; the payoff is coming! - -All that's left to do is: - - * Run Pelican to generate the static HTML files in **output** : [code]`$ pelican content -o output -s publishconf.py` -``` -* Use **ghp-import** to add the contents of the **output** directory to the **master** branch: [code]`$ ghp-import -m "Generate Pelican site" --no-jekyll -b master output` -``` - * Push the local master branch to the remote repo: [code]`$ git push origin master` -``` - * Commit and push the new content to the **content** branch: [code] $ git add content -$ git commit -m 'added a first post, a photo and an about page' -$ git push origin content -``` - - - -### OMG, I did it! - -Now the exciting part is here, when you get to view what you've published for everyone to see! Open your browser and enter: - - -``` -`https://username.github.io` -``` - -Congratulations on your new blog, self-published on GitHub! You can follow this pattern whenever you want to add more pages or articles. Happy blogging. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/run-your-blog-github-pages-python - -作者:[Erik O'Shaughnessy][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Raspberry Pi and Python) -[2]: https://github.com/ -[3]: https://git-scm.com -[4]: https://help.github.com/en/categories/github-pages-basics -[5]: https://jekyllrb.com -[6]: https://python.org -[7]: https://blog.getpelican.com -[8]: https://guides.github.com/features/mastering-markdown -[9]: http://docutils.sourceforge.net/docs/user/rst/quickref.html -[10]: https://github.com/join?source=header-home -[11]: https://git-scm.com/docs -[12]: https://pip.pypa.io/en/stable/ -[13]: https://docs.getpelican.com diff --git a/translated/tech/20190523 Run your blog on GitHub Pages with Python.md b/translated/tech/20190523 Run your blog on GitHub Pages with Python.md new file mode 100644 index 0000000000..fc37810381 --- /dev/null +++ b/translated/tech/20190523 Run your blog on GitHub Pages with Python.md @@ -0,0 +1,232 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Run your blog on GitHub Pages with Python) +[#]: via: (https://opensource.com/article/19/5/run-your-blog-github-pages-python) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani) + +在 GitHub 上使用 Python 运行你的博客 +====== +使用 Pelican(一个基于 Python 的平台)在 GitHub 上创建博客,看起来很不错。 + +![Raspberry Pi and Python][1] + +[GitHub][2] 是一个非常流行的用于源代码控制的 Web 服务,它使用 [Git][3] 同步本地文件和 GitHub 服务器上保留的副本,这样你就可以轻松地共享和备份你的工作。 + +除了为代码仓库提供用户界面之外,GitHub 还运允许用户直接从仓库[发布网页][4]。GitHub 推荐的网站生成软件包是 [Jekll][5],使用 Ruby 编写。因为我是 [Python][6] 的忠实粉丝,所以我更喜欢 [Pelican][7],这是一个基于 Python 的博客平台,可与 GitHub 很好地协同工作。 + +Pelican 和 Jekll 都可以将 [Markdown][8] 或 [reStructuredText][9] 中编写的内容转换为 HTML 以生成静态网站,并且两个生成器都支持定制的主题。 + +在本文中,我将介绍如何安装 Pelican、设置 GitHub 仓库、运行快速入门帮助、编写一些 Markdown 文件以及发布第一篇博客。我假设你有一个 [GitHub 账户][10],熟悉[基础的 Git 命令][11],并且想使用 Pelican 发布博客。 + +### 安装 Pelican 并创建仓库 + +首先,你必须在本地计算机上安装 Pelican 和 **ghp-import**。使用 Python 软件包安装工具 [pip][12](你有,对吧?),这非常容易: + +``` +$ pip install pelican ghp-import Markdown +``` + +然后,打开浏览器并在 GitHub 上为你的新博客创建一个新的仓库,命名如下(在此处以及整个教程中,用 GitHub 用户名替换 ): + +``` +https://GitHub.com/username/username.github.io +``` + +让它保持空白,稍后我们用引人注目的博客内容来填充它。 + +使用命令行(确保正确),将空的 Git 仓库克隆到本地计算机: + +``` +$ git clone blog +$ cd blog +``` + +### 奇怪的把戏... + +在 GitHub 上发布 Web 内容有一个不太明显的技巧,对于用户页面(托管在名为 _username.github.io_ 的仓库的页面上),其内容来自 **master** 分支。 + +我强烈建议不要将所有 Pelican 配置文件和原始 Markdown 文件都保留在 **master** 中,**master** 中只保留 Web 内容中。因此,我将 Pelican 配置和原始内容保留在一个我喜欢称为 **content** 的单独分支中。(你可以随意创建一个分支,但以下内容沿用 **content**。)我喜欢这种结构,因为我可以放弃掉 **master** 中的所有文件,然后用 **content** 分支重新填充它。 + +``` +$ git checkout -b content +Switched to a new branch 'content' +``` + +### 配置 Pelican + +现在该进行内容配置了。Pelican 提供了一个很棒的初始化工具 **pelican-quickstart**,它会询问你有关博客的一系列问题。 + +``` +$ pelican-quickstart +Welcome to pelican-quickstart v3.7.1. + +This script will help you create a new Pelican-based website. + +Please answer the following questions so this script can generate the files +needed by Pelican. + +> Where do you want to create your new web site? [.] +> What will be the title of this web site? Super blog +> Who will be the author of this web site? username +> What will be the default language of this web site? [en] +> Do you want to specify a URL prefix? e.g., (Y/n) n +> Do you want to enable article pagination? (Y/n) +> How many articles per page do you want? [10] +> What is your time zone? [Europe/Paris] US/Central +> Do you want to generate a Fabfile/Makefile to automate generation and publishing? (Y/n) y +> Do you want an auto-reload & simpleHTTP script to assist with theme and site development? (Y/n) y +> Do you want to upload your website using FTP? (y/N) n +> Do you want to upload your website using SSH? (y/N) n +> Do you want to upload your website using Dropbox? (y/N) n +> Do you want to upload your website using S3? (y/N) n +> Do you want to upload your website using Rackspace Cloud Files? (y/N) n +> Do you want to upload your website using GitHub Pages? (y/N) y +> Is this your personal page (username.github.io)? (y/N) y +Done. Your new project is available at /Users/username/blog +``` + +你可以对每个问题都采用默认值,但除了以下这些问题: + + * 网站标题,应该唯一且特殊 + * 网站作者,可以是个人用户名或你的全名 + * 时区,可能你不在巴黎 + * 上传到 GitHub 页面,我们选择 "y" + + +回答完所有问题后,Pelican 会在当前目录中保留以下内容: + +``` +$ ls +Makefile content/ develop_server.sh* +fabfile.py output/ pelicanconf.py +publishconf.py +``` + +你可以查看 [Pelican 文档][13]来了解如何使用这些文件,但 _现在_ 我们要做的是完成手头的工作。说实话,我也没有阅读文档。 + +### 继续 + +将所有 Pelican 生成的文件添加到本地 Git 仓库的 **content** 分支,提交更改,然后将本地更改推送到 Github 上托管的远程仓库: + +``` +$ git add . +$ git commit -m 'initial pelican commit to content' +$ git push origin content +``` + +这件事情并不是特别令人兴奋,但是如果我们需要将内容恢复到这些文件的时候,这将非常方便。 + +### 终于 + +终于,现在你得到一个博客了!你所有的博客文章、照片、图像、PDF 等都将位于 **content** 目录中,它最初是空的。要开始创建第一篇博客和关于页面,输入: + +``` +$ cd content +$ mkdir pages images +$ cp /Users/username/SecretStash/HotPhotoOfMe.jpg images +$ touch first-post.md +$ touch pages/about.md +``` + +接下来,在你喜欢的文本编辑器中打开 **first-post.md**,并添加以下内容: + +``` +title: First Post on My Sweet New Blog +date: +author: Your Name Here + +# I am On My Way To Internet Fame and Fortune! + +This is my first post on my new blog. While not super informative it +should convey my sense of excitement and eagerness to engage with you, +the reader! +``` + +前三行是 Pelican 用于组织内容的元数据。有很多不同的元数据可供你选择。再说一次,文档是你了解更多选项的最佳选择。 + +现在,打开空白文件 **pages/about.md** 并添加以下文本: + +``` +title: About +date: + +![So Schmexy][my_sweet_photo] + +Hi, I am and I wrote this epic collection of Interweb +wisdom. In days of yore, much of this would have been deemed sorcery +and I would probably have been burned at the stake. + +😆 + +[my_sweet_photo]: {filename}/images/HotPhotoOfMe.jpg +``` + +现在,content 目录中将包含三个新的 Web 内容,在 content 分支中还有很多内容。 + +### 发布 + +不要急,马上要见到成果了! + +剩下要做的就是: + + * 运行 Pelican 以在 **output** 中生成静态 HTML 文件: + ``` + `$ pelican content -o output -s publishconf.py` + ``` + + * 使用 **ghp-import** 将 **output** 目录的内容添加到 **master** 分支中: + ``` + $ ghp-import -m "Generate Pelican site" --no-jekyll -b master output` + ``` + + * 将本地 master 分支推送到远程仓库: + ``` + $ git push origin master + ``` + + * 提交新内容并将其推送到 **content** 分支 + ``` + $ git add content + $ git commit -m 'added a first post, a photo and an about page' + $ git push origin content + ``` + +### OMG,我成功了 + +现在最激动的时候到了,当你想要看到你发布给大家的博客内容时,打开浏览器输入: + +``` +https://username.github.io +``` + +恭喜你可以在 GitHub 上发布自己的博客了!当你想添加更多页面或文章时,都可以按照上面的步骤来。希望你可以愉快地发布博客。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/run-your-blog-github-pages-python + +作者:[Erik O'Shaughnessy][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Raspberry Pi and Python) +[2]: https://github.com/ +[3]: https://git-scm.com +[4]: https://help.github.com/en/categories/github-pages-basics +[5]: https://jekyllrb.com +[6]: https://python.org +[7]: https://blog.getpelican.com +[8]: https://guides.github.com/features/mastering-markdown +[9]: http://docutils.sourceforge.net/docs/user/rst/quickref.html +[10]: https://github.com/join?source=header-home +[11]: https://git-scm.com/docs +[12]: https://pip.pypa.io/en/stable/ +[13]: https://docs.getpelican.com From 5cff045e97e5537dcfcf4e4f4203c7dc99b0baed Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 29 Mar 2020 16:10:53 +0800 Subject: [PATCH 0030/1809] fix --- .../tech/20190523 Run your blog on GitHub Pages with Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20190523 Run your blog on GitHub Pages with Python.md b/translated/tech/20190523 Run your blog on GitHub Pages with Python.md index fc37810381..47134718ee 100644 --- a/translated/tech/20190523 Run your blog on GitHub Pages with Python.md +++ b/translated/tech/20190523 Run your blog on GitHub Pages with Python.md @@ -161,7 +161,7 @@ and I would probably have been burned at the stake. 😆 -[my_sweet_photo]: {filename}/images/HotPhotoOfMe.jpg +[my_sweet_photo]: {static}/images/HotPhotoOfMe.jpg ``` 现在,content 目录中将包含三个新的 Web 内容,在 content 分支中还有很多内容。 From f06c9b8a4f52c8d125c17122384f2361567873be Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 29 Mar 2020 17:07:38 +0800 Subject: [PATCH 0031/1809] Translating --- sources/tech/20200325 Linux firewall basics with ufw.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200325 Linux firewall basics with ufw.md b/sources/tech/20200325 Linux firewall basics with ufw.md index 104d3527ac..78bb763b3b 100644 --- a/sources/tech/20200325 Linux firewall basics with ufw.md +++ b/sources/tech/20200325 Linux firewall basics with ufw.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d8c9aebabbeaa76cad66a728f4e95dec3574e4f5 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Sun, 29 Mar 2020 17:28:19 +0800 Subject: [PATCH 0032/1809] hankchow translated --- ...en source software is fighting COVID-19.md | 107 ------------------ ...en source software is fighting COVID-19.md | 107 ++++++++++++++++++ 2 files changed, 107 insertions(+), 107 deletions(-) delete mode 100644 sources/tech/20200327 How open source software is fighting COVID-19.md create mode 100644 translated/tech/20200327 How open source software is fighting COVID-19.md diff --git a/sources/tech/20200327 How open source software is fighting COVID-19.md b/sources/tech/20200327 How open source software is fighting COVID-19.md deleted file mode 100644 index 92e80e183a..0000000000 --- a/sources/tech/20200327 How open source software is fighting COVID-19.md +++ /dev/null @@ -1,107 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How open source software is fighting COVID-19) -[#]: via: (https://opensource.com/article/20/3/open-source-software-covid19) -[#]: author: (Jeff Stern https://opensource.com/users/jeffstern) - -How open source software is fighting COVID-19 -====== -Learn about four of the thousands of open source projects combating the -spread of coronavirus. -![symbols showing healthcare][1] - -Work is hard right now. COVID-19 makes it a challenge to stay focused and motivated. But it was cathartic for me to do some research into how the open source community is responding to the global pandemic. - -Since the end of January, the community has contributed to [thousands of open source repositories][2] that mention coronavirus or COVID-19. These repositories consist of datasets, models, visualizations, web and mobile applications, and more, and the majority are written in JavaScript and Python. - -Previously, we shared information about several [open hardware makers helping][3] to stop the spread and suffering caused by the coronavirus. Here, we're sharing four (of many) examples of how the open source software community is responding to coronavirus and COVID-19, with the goal of celebrating the creators and the overall impact the open source community is making on the world right now. - -### 1\. CHIME by PennSignals - -![CHIME by PennSignals][4] - -COVID-19 Hospital Impact Model for Epidemics ([CHIME][5]) is an open source application built by data scientists at Penn Medicine at the University of Pennsylvania. The online tool allows hospitals to better understand the impact the virus will have on hospital demand. - -Hospital leaders can use CHIME to "get more informed estimates of how many patients will need hospitalization, ICU beds, and mechanical ventilation over the coming days and weeks." A user can input how many patients are currently hospitalized and see, based on other variables, how demand might increase over the coming days. - -CHIME is primarily built with Python and uses the [pandas][6] open source dependency for much of the underlying data-transformation number-crunching to generate the estimates. Pandas has a relatively robust team and is one of the most commonly used Python libraries for data analysis and, like all open source projects, is highly dependent on [users' support][7] for income. - -### 2\. Real-time COVID-19 visualization by Locale.ai - -![Locale.ai COVID-19 visualization][8] - -Maps that track the number of cases help us visualize the relative scale and spread of COVID-19. [Locale.ai created an open source, interactive visualization][9] of all known cases of COVID-19. The map provides live updates with new data as it becomes available. - -I find this project especially interesting because the data is retrieved via [an open source API][9] created by GitHub user ExpDev07 that queries [an open source dataset][10] from John Hopkins University. The John Hopkins dataset (an aggregate of more than a dozen other sources) is currently the most popular COVID19-related project on GitHub. This is the branching nature of open source at its finest! - -Locale.ai built the visualization website using [Vue.js][11], a popular framework that allows web developers to create modern web apps. Vue.js was created and continues to be maintained by [Evan You][12], one of the few people who have made a full-time career as an open source maintainer. - -### 3\. DXY-COVID-19-Crawler by BlankerL - -![BlankerL DXY-COVID-19-Crawler][13] - -[DXY-COVID-19-Crawler][14] was created in January and is one of the earliest responses from the open source community to COVID-19. When the virus was spreading primarily in China, the Chinese medical community was using a site called [DXY.cn][15] to report and track cases. To make the information more readily available and usable by others, GitHub user BlankerL wrote a web crawler to systematically collect data from the DXY.cn site and make it available via an API and data warehouse. That data has been used by academic researchers and others to examine trends and visualize the spread of the virus. So far, DXY-COVID-19-Crawler has been starred more than 1,300 times and forked nearly 300 times. - -BlankerL wrote the web crawler using Python and a package called [Beautiful Soup][16]. Beautiful Soup is an application that allows Python developers to easily scrape information from websites. Beautiful Soup is maintained by Leonard Richardson, who also works full-time as a software architect. - -### 4\. City of Tokyo's COVID-19 task force website - -![City of Tokyo's COVID-19 Task Force site][17] - -Many cities around the world have updated their websites with information for their residents about COVID-19. The Tokyo Metropolitan Government created a [comprehensive website][18] that "aims to allow Tokyo residents, companies with offices in Tokyo, and visitors to Tokyo to grasp the current situation and take measures and precautions accordingly." - -Unlike many other cities, Tokyo decided to [open source its site][19]. The project boasts contributions by more than 180 different users, and [at least three other cities][20] in Japan (Nagano, Chiba, and Fukuoka City) remixed the site. The project is an example of how cities can better serve their citizens by building openly. - -There's an incredible amount of open source technology powering Tokyo's open source website. Using the [Tidelift][21] application, I identified 1,365 dependencies used in the project. All of this complexity happens because 38 direct dependencies (i.e., dependencies the developers explicitly decided to use) have dependencies of their own. That said, maintainers of more than a thousand different open source dependencies (including [Nuxt.js][22], [Prettier][23], [Babel][24], [Ajv][25], and more) are in a small way responsible for helping Tokyo share information with their citizens. - -![Dependencies in Tokyo's COVID-19 Task Force site][26] - -### Other projects - -There are [many other important projects][27] being built in the open in response to COVID-19. I am inspired by how the open source community is responding to this pandemic and leveraging other open source technologies to work quickly. The weeks ahead will be difficult, but I know we can continue to find motivation in the open source community. - -If you are working on an open source project related to COVID-19, please share it in the comments so we can help spread the word. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/open-source-software-covid19 - -作者:[Jeff Stern][a] -选题:[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/jeffstern -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Medical%20costs.jpg?itok=ke57j6cs (symbols showing healthcare) -[2]: https://github.com/search?q=coronavirus+OR+covid19 -[3]: https://opensource.com/article/20/3/open-hardware-covid19 -[4]: https://opensource.com/sites/default/files/uploads/chime_pennsignals.png (CHIME by PennSignals) -[5]: http://penn-chime.phl.io/ -[6]: https://tidelift.com/subscription/pkg/pypi-pandas -[7]: https://pandas.pydata.org/about/sponsors.html -[8]: https://opensource.com/sites/default/files/uploads/locale-ai-visualization.png (Locale.ai COVID-19 visualization) -[9]: https://github.com/localeai/covid19-live-visualization -[10]: https://github.com/CSSEGISandData/COVID-19 -[11]: https://tidelift.com/subscription/pkg/npm-vue -[12]: https://blog.tidelift.com/vuejs-evan-you-javascript-framework -[13]: https://opensource.com/sites/default/files/uploads/dxy-covid-19-crawler.png (BlankerL DXY-COVID-19-Crawler) -[14]: https://github.com/BlankerL/DXY-COVID-19-Crawler -[15]: https://dxy.cn -[16]: https://blog.tidelift.com/beautiful-soup-is-now-part-of-the-tidelift-subscription -[17]: https://opensource.com/sites/default/files/uploads/tokyo-covid19-task-force.png (City of Tokyo's COVID-19 Task Force site) -[18]: https://stopcovid19.metro.tokyo.lg.jp/en/ -[19]: https://github.com/tokyo-metropolitan-gov/covid19 -[20]: https://github.com/tokyo-metropolitan-gov/covid19/issues/1802 -[21]: https://tidelift.com/ -[22]: https://tidelift.com/subscription/pkg/npm-nuxt -[23]: https://blog.tidelift.com/prettier-is-now-part-of-the-tidelift-subscriptions -[24]: https://tidelift.com/subscription/pkg/npm-babel -[25]: https://blog.tidelift.com/ajv-is-now-part-of-the-tidelift-subscription -[26]: https://opensource.com/sites/default/files/uploads/tokyo-dependencies.png (Dependencies in Tokyo's COVID-19 Task Force site) -[27]: https://github.com/soroushchehresa/awesome-coronavirus diff --git a/translated/tech/20200327 How open source software is fighting COVID-19.md b/translated/tech/20200327 How open source software is fighting COVID-19.md new file mode 100644 index 0000000000..dae4f55de7 --- /dev/null +++ b/translated/tech/20200327 How open source software is fighting COVID-19.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How open source software is fighting COVID-19) +[#]: via: (https://opensource.com/article/20/3/open-source-software-covid19) +[#]: author: (Jeff Stern https://opensource.com/users/jeffstern) + +开源软件在应对 COVID-19 中的贡献 +====== +> 在新冠疫情爆发之际,涌现了数以千计的开源项目,今天我们来了解其中四个。 + +![symbols showing healthcare][1] + +在当前紧张的疫情环境下,保持专注和积极性是一个很大的挑战。而研究开源社区如何应对这一次疫情爆发,对于我来说却成为了一种宣泄。 + +从今年一月底开始,整个开源社区已经贡献了数以千计关于冠状病毒或 COVID-19 的[开源软件库][2],其中涉及的内容包括但不限于数据集、模型、可视化、Web 应用、移动应用,且大多数都使用了 JavaScript 和 Python 编写。 + +之前我们分享过一些关于开源硬件厂商在帮助遏制冠状病毒传播方面做的[贡献][3],现在将继续分享四个由开源社区作出的应对冠状病毒和 COVID-19 的项目,这体现了开发者们和整个开源社区在当下对整个世界的影响力。 + +### 1. PennSignals:CHIME + +![CHIME by PennSignals][4] + +COVID-19 流行病医院影响模型COVID-19 Hospital Impact Model for Epidemics([CHIME][5])是由宾夕法尼亚大学 Penn Medicine 机构的数据科学家们建立的开源在线应用,它可以让医院更好地了解本次新型冠状病毒对医院需求的影响。 + +医院的管理人员可以通过 CHIME 来大致预测未来几天和几周内将会有多少患者需要住院治疗,并推算 ICU 和呼吸机的需求量。只需要输入当前住院患者数以及一些相关的变量,就可以看到未来几天内需求的变化情况。 + +CHIME 主要使用 Python 开发,并通过 [pandas][6] 这个开源库实现了大部分的数据转换和数值计算,最终得出相关的估计值。pandas 的背后有一个强大的团队进行支持,因此它是在数据分析方面被广泛使用的 Python 库之一。和很多其它的开源项目一样,pandas 团队的收入大部分来源于[用户的资金支持][7]。 + +### 2. Locale.ai:Real-time COVID-19 visualization + +![Locale.ai COVID-19 visualization][8] + +实时显示世界各地病例数量分布的地图可以让我们直观了解 COVID-19 的规模和扩散程度。Locale.ai 就开发了这样一个开源、可交互的 [COVID-19 已知病例可视化分布图][9],这个图会根据最新的可靠数据实时进行更新。 + +这个项目有趣的地方在于,它的数据是是通过 GitHub 用户 ExpDev07 创建的[开源 API][10] 进行检索的,这个 API 的数据来源是[约翰·霍普金斯大学的开源数据集][11],而约翰·霍普金斯大学这份聚合了多个来源的数据集则是 GitHub 上 COVID-19 相关的最受欢迎的项目。这就是开源项领域中分支带来的一大好处。 + +Locale.ai 的这个图表通过 [Vue.js][11] 开发。Vue.js 是一个在 Web 应用开发方面非常流行的框架,它是由[尤雨溪][12]创造并维护的。值得一提的是,尤雨溪是全职参与开源项目维护的少数人之一。 + +### 3. BlankerL:DXY-COVID-19-Crawler + +![BlankerL DXY-COVID-19-Crawler][13] + +[DXY-COVID-19-Crawler][14] 建立于今年 1 月份,是开源社区对 COVID-19 最早发起响应的项目之一。当时 COVID-19 主要在中国范围内传播,中国医学界通过[丁香园][15]网站来进行病例的报告和跟踪。为了使这些疫情信息具有更高的可读性和易用性,GitHub 用户 BlankerL 开发了一个爬虫,系统地从丁香园网站获取数据,并通过 API 和数据仓库的方式对外公开。这些数据也被学术研究人员用于研究病毒传播趋势和制作相关的可视化图表。到目前为止,DXY-COVID-19-Crawler 这个项目已经获得了超过 1300 个星标和近 300 次的复刻。 + +BlankerL 使用 Python 和 [Beautiful Soup][16] 库开发了这个爬虫。Beautiful Soup 是 Python 开发者用于从页面 HTML DOM 中提取信息的库,它由 Leonard Richardson 维护,这位作者i你另外还全职担任软件架构师。 + +### 4. 东京 COVID-19 工作组网站 + +![City of Tokyo's COVID-19 Task Force site][17] + +世界各地很多城市都在网络上持续更新当地的 COVID-19 信息。东京都政府则为此创建了一个[综合性的网站][18],让东京当地居民、在东京设有办事处的公司以及到东京的游客了解最新情况,并采取相应的预防措施。 + +这个网站的不同之处在于它是由东京都政府[开源][19]的。这个项目受到了来自 180 多名用户的贡献,日本的[长野市、千叶市、福冈市][20]还对这个网站进行了改造。这个项目是城市公共建设更好地服务大众的有力示范。 + +这个开源网站也使用了很多开源技术。通过 [Tidelift][21],我留意到项目中存在了 1365 个依赖项,其中 38 个是由开发者直接使用的依赖项。也就是说,超过一千多个开源项目(包括 [Nuxt.js][22]、[Prettier][23]、[Babel][24]、[Ajv][25] 等等)都为东京向市民共享信息提供了帮助。 + +![Dependencies in Tokyo's COVID-19 Task Force site][26] + +### 其它项目 + +除此以外,还有很多[响应 COVID-19 的重要项目][27]正在公开进行当中。在这次研究中,开源社区应对流行病以及利用开源技术开展工作的方式让我深受启发。接下来的一段时间都是应对疫情的关键时期,我们也可以继续在开源社区中寻找到更大的动力。 + +如果你也参与到了 COVID-19 相关的开源项目当中,欢迎在评论区分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/open-source-software-covid19 + +作者:[Jeff Stern][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jeffstern +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Medical%20costs.jpg?itok=ke57j6cs (symbols showing healthcare) +[2]: https://github.com/search?q=coronavirus+OR+covid19 +[3]: https://opensource.com/article/20/3/open-hardware-covid19 +[4]: https://opensource.com/sites/default/files/uploads/chime_pennsignals.png (CHIME by PennSignals) +[5]: http://penn-chime.phl.io/ +[6]: https://tidelift.com/subscription/pkg/pypi-pandas +[7]: https://pandas.pydata.org/about/sponsors.html +[8]: https://opensource.com/sites/default/files/uploads/locale-ai-visualization.png (Locale.ai COVID-19 visualization) +[9]: https://github.com/localeai/covid19-live-visualization +[10]: https://github.com/CSSEGISandData/COVID-19 +[11]: https://tidelift.com/subscription/pkg/npm-vue +[12]: https://blog.tidelift.com/vuejs-evan-you-javascript-framework +[13]: https://opensource.com/sites/default/files/uploads/dxy-covid-19-crawler.png (BlankerL DXY-COVID-19-Crawler) +[14]: https://github.com/BlankerL/DXY-COVID-19-Crawler +[15]: https://dxy.cn +[16]: https://blog.tidelift.com/beautiful-soup-is-now-part-of-the-tidelift-subscription +[17]: https://opensource.com/sites/default/files/uploads/tokyo-covid19-task-force.png (City of Tokyo's COVID-19 Task Force site) +[18]: https://stopcovid19.metro.tokyo.lg.jp/en/ +[19]: https://github.com/tokyo-metropolitan-gov/covid19 +[20]: https://github.com/tokyo-metropolitan-gov/covid19/issues/1802 +[21]: https://tidelift.com/ +[22]: https://tidelift.com/subscription/pkg/npm-nuxt +[23]: https://blog.tidelift.com/prettier-is-now-part-of-the-tidelift-subscriptions +[24]: https://tidelift.com/subscription/pkg/npm-babel +[25]: https://blog.tidelift.com/ajv-is-now-part-of-the-tidelift-subscription +[26]: https://opensource.com/sites/default/files/uploads/tokyo-dependencies.png (Dependencies in Tokyo's COVID-19 Task Force site) +[27]: https://github.com/soroushchehresa/awesome-coronavirus From 5f41b35048faf635fc1d89bfe9835c054b17e8d8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Mar 2020 20:23:37 +0800 Subject: [PATCH 0033/1809] PRF @FSSlc --- ... Command Line Using Firefox Send Client.md | 60 ++++++++++--------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/translated/tech/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md b/translated/tech/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md index 6e9b6ba2a1..b04263776d 100644 --- a/translated/tech/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md +++ b/translated/tech/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md @@ -1,18 +1,20 @@ [#]: collector: "lujun9972" [#]: translator: "FSSlc" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "ffsend – Easily And Securely Share Files From Linux Command Line Using Firefox Send Client" [#]: via: "https://www.2daygeek.com/ffsend-securely-share-files-folders-from-linux-command-line-using-firefox-send-client/" [#]: author: "Vinoth Kumar https://www.2daygeek.com/author/vinoth/" -ffsend - 在 Linux 命令行中通过 FireFox Send 服务来简单安全地分享文件 +ffsend:在命令行中通过 FireFox Send 分享文件 ====== -Linux 用户更偏爱使用 `scp` 或 `rsync` 来进行文件或目录的复制拷贝。很多新的可选方式正发生在 Linux 上,因为 Linux 是开源的,所以任何人都可以为 Linux 开发一个安全软件。 +![](https://img.linux.net.cn/data/attachment/album/202003/29/202308w7ormrouomij2dzq.jpg) -在过去我们已经写了多篇有关安全分享这个话题的文章,它们分别是 **[OnionShare][1]** , **[Magic Wormhole][2]** , **[Transfer.sh][3]** 和 **[Dcp – Dat Copy][4]**. +Linux 用户偏爱使用 `scp` 或 `rsync` 来进行文件或目录的复制拷贝。不过在 Linux 上正出现了许多新的可选方式,因为 Linux 是开源的,所以任何人都可以为 Linux 开发一个安全软件。 + +在过去我们已经写了多篇有关安全分享这个话题的文章,它们分别是 [OnionShare][1]、[Magic Wormhole][2]、[Transfer.sh][3] 和 [Dcp – Dat Copy][4]。 今天我们甚至还将继续讨论这个话题,我们将介绍名为 `ffsend` 的工具。 @@ -22,33 +24,33 @@ Linux 用户更偏爱使用 `scp` 或 `rsync` 来进行文件或目录的复制 它允许我们通过一个安全、私密、加密的链接,使用一个简单的命令来轻易安全地分享文件和目录。 -使用 Firefox 的 Send 服务,文件可以被共享,最大允许的文件大小为 2GB(译者注:现在官网上写的是最大 1GB,登录后最大 2.5GB)。其他人可以通过这个工具或者网页浏览器来下载这些被分享的文件。 +通过 Firefox 的 Send 服务共享的文件最大大小为 2GB(LCTT 译注:现在官网上写的是最大 1GB,登录后最大 2.5GB)。其他人可以通过这个工具或者网页浏览器来下载这些分享的文件。 -所有的文件总是在客户端被加密,并且秘钥将不会被远程主机所分享。另外,你还可以为上传的文件设置密码。 +所有的文件都是在客户端加密的,并且秘钥将不会被共享到远程主机。另外,你还可以为上传的文件额外设置一个密码。 -被上传的文件在被下载(默认被下载 1 次,最多可被下载 10 次)后或者 24 小时后,它们将被自动删除。这将确保你的文件不会永远的保留在网络上。 +上传的文件在下载(默认被下载 1 次,最多可被下载 10 次)后或者 24 小时后,就会自动删除。这将确保你的文件不会一直保留在网络上。 -该工具当前处于 alpha 阶段,使用时请自担风险。而且,当前只有有限个安装选项可用。 +该工具当前处于 alpha 阶段,使用时请自担风险。而且,当前只有有限的安装方式可用。 ### ffsend 的特点: - * 全功能且友好的命令行工具 - * 安全地上传和下载文件与目录 - * 在客户端总是被加密 - * 额外的密码保护,密码生成和可配置下载次数限制 - * 内置文件或目录的打包和解压 - * 可以简单地管理你的历史分享记录 - * 能够使用你自己的发送主机 - * 查看或者删除共享文件 + * 全功能且使用友好的命令行工具 + * 可以安全地上传和下载文件与目录 + * 总是在客户端加密 + * 可用额外的密码进行保护、密码生成和可配置下载次数限制 + * 内置的文件或目录的打包和解压 + * 可以轻松地管理你的历史分享记录 + * 能够使用你自己的 Send 主机 + * 审查或者删除共享文件 * 精准的错误报告 - * 由加密或上传下载导致的低内存消耗 - * 无需集成就可被用在脚本中 + * 低内存消耗,用于加密或上传下载 + * 无需交互,可以集成在脚本中 ### 如何在 LInux 中安装 ffsend 呢? -当前除了 Debian 和 Arch Linux 系统,其他发行版还没有相应的安装包(译者注:这个信息已过时,最新内容请看[这里](https://github.com/timvisee/ffsend#install))。然而,我们可以轻易地根据我们自己的操作系统和架构下载到相应的预编译二进制文件。 +当前除了 Debian 和 Arch Linux 系统,其他发行版还没有相应的安装包(LCTT 译注:这个信息已过时,最新内容请看[这里](https://github.com/timvisee/ffsend#install))。然而,我们可以轻易地根据我们自己的操作系统和架构下载到相应的预编译二进制文件。 -运行下面的命令来为你的操作系统下载 `ffsend` 最新可用的版本(译者注:当前最新版本为 v0.2.58): +运行下面的命令来为你的操作系统下载 `ffsend` 最新可用的版本(LCTT 译注:当前最新版本为 v0.2.58): ``` $ wget https://github.com/timvisee/ffsend/releases/download/v0.1.2/ffsend-v0.1.2-linux-x64.tar.gz @@ -91,20 +93,20 @@ To show all subcommands, features and other help: ffsend help [SUBCOMMAND] ``` -对于使用基于 Arch Linux 系统的用户可以简单地借助 **[AUR Helper][6]** 来安装它,因为这个包已经在 AUR 软件仓库中了。 +对于使用基于 Arch Linux 系统的用户可以简单地借助 [AUR 助手][6]来安装它,因为这个包已经在 AUR 软件仓库中了。 ``` $ yay -S ffsend ``` -对于使用 **`Debian/Ubuntu`** 系统的用户,使用 **[DPKG 命令][7]** 来安装 `ffsend`。 +对于使用 Debian/Ubuntu 系统的用户,使用 [DPKG 命令][7]来安装 `ffsend`。 ``` $ wget https://github.com/timvisee/ffsend/releases/download/v0.1.2/ffsend_0.1.2_amd64.deb $ sudo dpkg -i ffsend_0.1.2_amd64.deb ``` -### 如何使用 ffsend 来发送文件? +### 如何使用 ffsend 这并不复杂,我们可以简单地通过下面的语法来发送文件。 @@ -240,12 +242,16 @@ $ ffsend delete https://send.firefox.com/download/69afaab1f9/#5z51_94jtxcUCJNNvf File deleted ``` -另外,你还可以通过使用 firefox 浏览其打开 https://send.firefox.com/ 来完成相应的分享。 +### 如何在浏览器中使用 Send + +另外,你还可以通过使用 firefox 浏览器打开 https://send.firefox.com/ 来完成相应的分享。 只需要拖拽该文件就可以上传它: + ![][11] 一旦该文件被下载,它将展示 100% 的下载状态。 + ![][12] 想查看其他的可能选项,请浏览它对应的 man 信息或者帮助页: @@ -298,16 +304,16 @@ via: https://www.2daygeek.com/ffsend-securely-share-files-folders-from-linux-com 作者:[Vinoth Kumar][a] 选题:[lujun9972][b] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/vinoth/ [b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/onionshare-secure-way-to-share-files-sharing-tool-linux/ +[1]: https://linux.cn/article-9177-1.html [2]: https://www.2daygeek.com/wormhole-securely-share-files-from-linux-command-line/ [3]: https://www.2daygeek.com/transfer-sh-easy-fast-way-share-files-over-internet-from-command-line/ -[4]: https://www.2daygeek.com/dcp-dat-copy-secure-way-to-transfer-files-between-linux-systems/ +[4]: https://linux.cn/article-10516-1.html [5]: https://github.com/timvisee/ffsend [6]: https://www.2daygeek.com/category/aur-helper/ [7]: https://www.2daygeek.com/dpkg-command-to-manage-packages-on-debian-ubuntu-linux-mint-systems/ From 12e50a9201574fca0f9934451d9ed8c19fa9237a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Mar 2020 20:29:08 +0800 Subject: [PATCH 0034/1809] PUB @FSSlc https://linux.cn/article-12051-1.html --- ... Command Line Using Firefox Send Client.md | 47 ++----------------- 1 file changed, 3 insertions(+), 44 deletions(-) rename {translated/tech => published}/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md (87%) diff --git a/translated/tech/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md b/published/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md similarity index 87% rename from translated/tech/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md rename to published/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md index b04263776d..0663005ce5 100644 --- a/translated/tech/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md +++ b/published/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "FSSlc" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-12051-1.html" [#]: subject: "ffsend – Easily And Securely Share Files From Linux Command Line Using Firefox Send Client" [#]: via: "https://www.2daygeek.com/ffsend-securely-share-files-folders-from-linux-command-line-using-firefox-send-client/" [#]: author: "Vinoth Kumar https://www.2daygeek.com/author/vinoth/" @@ -254,48 +254,7 @@ File deleted ![][12] -想查看其他的可能选项,请浏览它对应的 man 信息或者帮助页: - -``` -$ ffsend --help -ffsend 0.1.2 -Tim Visee -Easily and securely share files from the command line. -A fully featured Firefox Send client. - -USAGE: - ffsend [FLAGS] [OPTIONS] [SUBCOMMAND] - -FLAGS: - -f, --force Force the action, ignore warnings - -h, --help Prints help information - -i, --incognito Don't update local history for actions - -I, --no-interact Not interactive, do not prompt - -q, --quiet Produce output suitable for logging and automation - -V, --version Prints version information - -v, --verbose Enable verbose information and logging - -y, --yes Assume yes for prompts - -OPTIONS: - -H, --history Use the specified history file [env: FFSEND_HISTORY] - -t, --timeout Request timeout (0 to disable) [env: FFSEND_TIMEOUT] - -T, --transfer-timeout Transfer timeout (0 to disable) [env: FFSEND_TRANSFER_TIMEOUT] - -SUBCOMMANDS: - upload Upload files [aliases: u, up] - download Download files [aliases: d, down] - debug View debug information [aliases: dbg] - delete Delete a shared file [aliases: del] - exists Check whether a remote file exists [aliases: e] - help Prints this message or the help of the given subcommand(s) - history View file history [aliases: h] - info Fetch info about a shared file [aliases: i] - parameters Change parameters of a shared file [aliases: params] - password Change the password of a shared file [aliases: pass, p] - -The public Send service that is used as default host is provided by Mozilla. -This application is not affiliated with Mozilla, Firefox or Firefox Send. -``` +想查看其他的可能选项,请浏览它对应的 man 信息或者帮助页。 -------------------------------------------------------------------------------- From 160f4b67ed8ae0e0dee74e70d04f6fb7ba8defe6 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 29 Mar 2020 20:30:31 +0800 Subject: [PATCH 0035/1809] translating --- sources/tech/20200325 Linux firewall basics with ufw.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sources/tech/20200325 Linux firewall basics with ufw.md b/sources/tech/20200325 Linux firewall basics with ufw.md index 78bb763b3b..c81af35c1e 100644 --- a/sources/tech/20200325 Linux firewall basics with ufw.md +++ b/sources/tech/20200325 Linux firewall basics with ufw.md @@ -8,15 +8,20 @@ [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) Linux firewall basics with ufw +Linux 防火墙 ufw 简介 ====== We take a look at ufw - the uncomplicated firewall - on Linux, providing some insights and commands for making changes. Vertigo3D / Getty Images +我们来看看 ufw - linux 上一个简单的防火墙,它提供了一些见解和进行更改的命令。 The **ufw** (uncomplicated firewall) represents a serious simplification to [iptables][1] and, in the years that it’s been available, has become the default firewall on systems such as Ubuntu and Debian. And, yes, **ufw** is surprisingly uncomplicated – a boon for newer admins who might otherwise have to invest a lot of time to get up to speed on firewall management. +**ufw** 可以说是 [iptables][1] 的简化版,在未来几年,它已经成为 Ubuntu 和 Debian 等系统上的默认防火墙。而且它并不复杂,这对新管理员来说是一个福音,否则他们可能不得不投入大量时间来加快防火墙管理的速度。 GUIs are available for **ufw** (like **gufw**), but **ufw** commands are generally issued on the command line. This post examines some commands for using **ufw** and looks into how it works. +**ufw** 也有 GUI(例如 **gufw**),但是 **ufw** 命令通常在命令行上发布。这篇文章检查了一些使用 **ufw** 的命令,并研究了它的工作方式。 First, one quick way to see how **ufw** is configured is to look at its configuration file – **/etc/default/ufw**. In the command below, we display the settings, using **grep** to suppress the display of both blank lines and comments (line starting with #). +首先,查看 **ufw** 配置方式的一种快速方法是查看其配置文件 **/etc/default/ufw**。在下面的命令中,我们显示设置,使用 **grep** 禁止显示空白行和注释(以 # 开头的行), [RELATED: Linux hardening: a 15-step checklist for a secure Linux server][2] @@ -33,8 +38,10 @@ IPT_MODULES="nf_conntrack_ftp nf_nat_ftp nf_conntrack_netbios_ns" ``` As you can see, the default policy is to drop input and allow output. Additional rules that allow the connections that you specifically want to be accept are configured separately. +正如你所看到的,默认策略是删除输入并允许输入。允许你专门接受的连接的其它规则是单独配置的。 The basic syntax for ufw commands might look like thee below, though this synopsis is not meant to imply that typing only “ufw” will get you further than a quick error telling you that arguments are required. +ufw 命令的基本语法如下所示,尽管该提要并不意味着仅输入 ufw 将使你走的更远,而不是一个快速的错误提示你需要参数。 ``` ufw [--dry-run] [options] [rule syntax] From dfb75b47111f4230a3bdbfa58030950b3c622cfb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Mar 2020 20:45:07 +0800 Subject: [PATCH 0036/1809] PRF --- ...0319 7 open hardware projects working to solve COVID-19.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20200319 7 open hardware projects working to solve COVID-19.md b/published/20200319 7 open hardware projects working to solve COVID-19.md index 98ab25270f..3b3f5cf23e 100644 --- a/published/20200319 7 open hardware projects working to solve COVID-19.md +++ b/published/20200319 7 open hardware projects working to solve COVID-19.md @@ -112,7 +112,7 @@ Gaudi Labs 的 [PocketPCR][31] 热循环仪可通过升高和降低小试管中 Folding at Home 项目使用马尔可夫状态模型(如上所示)来建模蛋白质可能采取的形状和折叠途径,以寻找新的治疗机会。你可以在华盛顿大学生物物理学家 Greg Bowman 的帖子《[它是如何运作的以及如何提供帮助][43]》中找到有关该项目的更多信息。 -该项目涉及来自许多国家(包括香港、克罗地亚、瑞典和美国)的财团的学术实验室、贡献者和公司赞助者。 在 [GitHub][45] 上,[在混合了 GPL 和专有许可证][44]下共享,并且可以在 Windows、macOS 和 GNU/Linux(例如 Debian、Ubuntu、Mint、RHEL、CentOS、Fedora)。 +该项目涉及来自许多国家和地区(包括香港、克罗地亚、瑞典和美国)的财团的学术实验室、贡献者和公司赞助者。 在 [GitHub][45] 上,[在混合了 GPL 和专有许可证][44]下共享,并且可以在 Windows、macOS 和 GNU/Linux(例如 Debian、Ubuntu、Mint、RHEL、CentOS、Fedora)。 ### 许多其他有趣的项目 @@ -129,7 +129,7 @@ Folding at Home 项目使用马尔可夫状态模型(如上所示)来建模 这些项目遍布全球,而这种全球合作正是我们所需要的,因为病毒无视国界。新冠病毒大流行在不同时期以不同方式影响国家,因此我们需要一种分布式方法。 -正如我和同事 Steven Abadie 在 [OSHdata 2020 报告][54]中所写的那样,开源硬件运动是全球性运动。参与该认证项目的个人和组织遍布全球 35 个国家和每个半球。 +正如我和同事 Steven Abadie 在 [OSHdata 2020 报告][54]中所写的那样,开源硬件运动是全球性运动。参与该认证项目的个人和组织遍布全球 35 个国家地区和每个半球。 ![Open source hardware map][55] From 5b67b02956440e7ac7b4acc60668fc037781a65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=96=B0=E9=98=BF=E5=B2=A9?= <31788564+mengxinayan@users.noreply.github.com> Date: Sun, 29 Mar 2020 05:56:35 -0700 Subject: [PATCH 0037/1809] Translated (mengxinayan) File name: 20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md Translator: mengxinayan --- ... You Need to Know to Work in Vim Editor.md | 168 ------------------ ... You Need to Know to Work in Vim Editor.md | 161 +++++++++++++++++ 2 files changed, 161 insertions(+), 168 deletions(-) delete mode 100644 sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md create mode 100644 translated/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md diff --git a/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md b/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md deleted file mode 100644 index 6b959364b7..0000000000 --- a/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md +++ /dev/null @@ -1,168 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (mengxinayan) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Basic Vim Commands You Need to Know to Work in Vim Editor) -[#]: via: (https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -Basic Vim Commands You Need to Know to Work in Vim Editor -====== - -If you are a system administrator or developer, you may need to edit a file while working on the Linux terminal. - -There are several file editors on Linux, and how to choose the right one for your needs. - -I would like to recommend Vim editor. - -### You may ask, why? - -You may spend more time in the editor to modify an existing file than writing new text. - -In this case, Vim Keyboard shortcuts allow you to efficiently meet your needs. - -The following articles may help you learn about file and directory manipulation. - - * [**L**][1]**[inux Basic – Linux and Unix Commands for File and Directory Manipulation][1]** - * **[10 Methods to View Different File Formats in Linux][2]** - - - -### What’s vim? - -Vim is one of the most popular and powerful text editor that widely used by Linux administrators and developers. - -It’s highly configurable text editor which enables efficient text editing. This is an updated version of the vi editor, which is already installed on most Unix systems. - -Vim is often called a “programmer’s editor,” but it is not limited to it, and is suitable for all types of text editing. - -It comes with many features like multi level undo, multi windows and buffers, syntax highlighting, command line editing, file name completion, visual selection. - -You can easily obtain online help with the “:help” command. - -### Understanding Vim Modes - -Vim has two modes, the details are below: - -**Command Mode:** When you launch Vim Editor, you will default to Command Mode. You can move around the file, and modify some parts of the text, cut, copy, and paste parts of the text and issue commands to do more (press ESC for Command Mode). - -**Insert Mode:** The nsert mode is used to type text in a given given document (Press i for insert mode). - -### How do I know which Vim mode I am on? - -If you are in insert mode, you will see **“INSERT”** at the bottom of the editor. If nothing is shown, or if it shows the file name at the bottom of the editor, you are in “Command Mode”. - -### Cursor Movement in Normal Mode - -These Vim keyboard shortcuts allow you to move your cursor around a file in different ways. - - * `G` – Go to the last line of the file - * `gg` – Go to the first line of the file - * `$` – Go to the end of line. - * `0` (zero) – Go to the beginning of line. - - - * `w` – Jump by start of words - * `W` – Jump by words (spaces separate words) - * `b` – Jump backward by words - * `B` – Jump backward by words (spaces separate words) - - - * `PgDn` Key – Move down page-wise - * `PgUp` Key – Move up page-wise - * `Ctrl+d` – Move half-page down - * `Ctrl+u` – Move half-page up - - - -### Insert mode – insert a text - -These vim keyboard shortcuts allows you to insert a cursor in varies position based on your needs. - - * `i` – Insert before the cursor - * `a` – Insert after the cursor - * `I` – Insert at the beginning of the line, this is useful when you are in the middle of the line. - * `A` – Insert at the end of the line - * `o` – Open a new line below the current line - * `O` – Append a new line above the current line - * `ea` – Insert at the end of the word - - - -### Copy, Paste and Delete a Line - - * `yy` – yank (copy) a line - * `p/P` – Paste after cursor/ put before cursor - * `dd` – delete a line - * `dw` – delete the word - - - -### Search and Replace Pattern in Vim - - * `/pattern` – To search a given pattern - * `?pattern` – To search backward a given pattern - * `n` – To repeat search - * `N` – To repeat backward search - - - * `:%s/old-pattern/new-pattern/g` – Replace all old formats with the new format across the file. - * `:s/old-pattern/new-pattern/g` – Replace all old formats with the new format in the current line. - * `:%s/old-pattern/new-pattern/gc` – Replace all old formats with the new format across the file with confirmations. - - - -### How do I go to a particular line in Vim Editor - -You can do this in two ways, depending on your need. If you don’t know the line number I suggest you go with the first method. - -Add line number by opening a file and running the command below. - -``` -:set number -``` - -Once you have set the line number, press **“: n”** to go to the corresponding line number. For example, if you want to go to **line 15**, enter. - -``` -:15 -``` - -If you already know the line number, use the following method to go directly to the corresponding line. For example, if you want to move to line 20, enter the command below. - -``` -$ vim +20 [File_Name] -``` - -### Undo/Redo/Repeat Operation - - * `u` – Undo the changes - * `Ctrl+r` – Redo the changes - * `.` – Repeat last command - - - -### Saving and Exiting Vim - - * `:w` – Save the changes but don’t exit - * `:wq` – Write and quit - * `:q!` – Force quit - - - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/ - -作者:[Magesh Maruthamuthu][a] -选题:[lujun9972][b] -译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.2daygeek.com/author/magesh/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/linux-basic-commands-file-directory-manipulation/ -[2]: https://www.2daygeek.com/unix-linux-command-to-view-file/ diff --git a/translated/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md b/translated/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md new file mode 100644 index 0000000000..3920687144 --- /dev/null +++ b/translated/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md @@ -0,0 +1,161 @@ +[#]: collector: (lujun9972) +[#]: translator: (mengxinayan) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Basic Vim Commands You Need to Know to Work in Vim Editor) +[#]: via: (https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +你需要知道的 Vim 编辑器中的基础命令 +====== + +如果你是一名系统管理员或者开发者,当你在终端工作时有时会需要编辑一个文件。 + +在 Linux 系统中有几种文件编辑器,你可以根据需求选择合适的文件编辑器 + +在这里,我想推荐 Vim 编辑器 + + +### 为什么推荐 Vim 编辑器 + +和创建编写新文件相比,你会在编辑器中花费更多的时间用来修改已经存在的文件。 + +在这种情况下,Vim 快捷键可以有效地满足你的需求。 + +文章下面的内容可以帮助你了解对文件和目录的操作。 + + [Linux 基础:对文件和目录进行操作的 Linux 和 Unix 命令][1] + [在 Linux 中查看不同文件格式的10种方法][2] + + +### 什么是 Vim + +Vim 是被 Linux 管理员和开发者广泛使用的最流行和功能强大的编辑器之一。 + +它可以通过高度的自定义配置来提高文本编辑效率。它是在众多 Unix 默认安装的 Vi 编辑器的升级版。 + +Vim 通常被称为“程序员的编辑器”,但并不限于此,它也可用于编辑任何类型的文件。 + +它具有许多功能,例如:多次撤销,多窗口和缓冲区,语法高亮,命令行编辑,文件名补全,可视选择。 + +你可以使用 `:help` 命令来获取在线帮助 + + +### 理解 Vim 的模式 + +Vim 有两种模式,详细介绍如下: + +**命令模式:** 当启动 Vim 编辑器后,默认处在命令模式下。你可以在文件中移动并且修改内容,剪切,复制和粘贴文件的一部分,同时发出命令执行更多操作(按 ESC 键进入命令模式) + +**插入模式:** 插入模式用于在给定的文档位置插入文本(按 i 键进入插入模式) + +### 我如何知道我正使用哪种 Vim 模式呢? + +如果你正在使用插入模式,你会在编辑器的底部看到 `INSERT` 。如果编辑器底部没有显示任何内容,或者在编辑器底部显示了文件名,则处于 “命令模式”。 + +### 正常模式下的光标移动 +### Cursor Movement in Normal Mode + +Vim 快捷键允许你使用不同的方式来移动光标: + + * `G` – 跳转到文件最后一行 + * `gg` – 跳转到文件首行 + * `$` – 跳转到行末尾 + * `0` (零) – 跳转到行开头 + + * `w` – 跳转到下一个单词的开始(单词的分隔符可以是空格或其他符号) + * `W` – 跳转到下一个单词的开始(单词的分隔符只能是空格) + * `b` – 跳转到下一个单词的末尾(单词的分隔符可以是空格或其他符号) + * `B` – 跳转到下一个单词的末尾(单词的分隔符只能是空格) + + * `PgDn` 键 – 向下移动一页 + * `PgUp` 键 – 向上移动一页 + * `Ctrl+d` – 向下移动半页 + * `Ctrl+u` – 向上移动半页 + + +### 插入模式:插入文字 + +下面的 vim 快捷键允许你根据需要在光标的不同位置插入内容。 + + * `i` – 在光标之前插入 + * `a` – 在光标之后插入 + * `I` – 在光标所在行的开头插入。当光标位于行中间时,这个键很有用 + * `A` – 在光标所在行的末尾插入。 + * `o` – 在光标所在行的下面插入新行 + * `O` – 在光标所在行的上面插入新行 + * `ea` – 在单词的末尾插入 + + +### 拷贝,粘贴和删除一行 + + * `yy` – 复制一行 + * `p/P` – 将内容粘贴到光标之后 / 将内容粘贴到光标之前 + * `dd` – 删除一行 + * `dw` – 删除一个单词 + + +### 在 Vim 中搜索和替换模式 + + * `/pattern` – 向后搜索给定的模式 + * `?pattern` – 向前搜索给定的模式 + * `n` – 向后重复搜索之前给定的模式 + * `N` – 向前重复搜索之前给定的模式 + + * `:%s/old-pattern/new-pattern/g` – 将文件中所有的旧模式替换为新模式 + * `:s/old-pattern/new-pattern/g` – 将当前行中所有的旧模式替换为新模式 + * `:%s/old-pattern/new-pattern/gc` – 逐个询问是否文件中的旧模式替换为新模式 + + +### 如何在 Vim 编辑器中跳转到特定行 + +你可以根据需求以两种方式达到该目的,如果你不知道行号,建议采用第一种方法。 + +通过打开文件并运行下面的命令来显示行号 + +``` +:set number +``` + +当你设置好显示行号后,按 `:n` 跳转到相应的行号。例如,如果你想跳转到第 15 行,请输入: + +``` +:15 +``` + +如果你已经知道行号,请使用以下方法在打开文件时直接跳转到相应行。例如,如果在打开文件时直接跳转到 20 行,请输入下面的命令: + +``` +$ vim +20 [File_Name] +``` + +### 撤销操作/恢复上一次操作/重复上一次操作 + + * `u` – 撤销更改 + * `Ctrl+r` – 恢复更改 + * `.` – 重复上一条命令 + + +### 保存和退出 Vim + + * `:w` – 保存更改但不退出 vim + * `:wq` – 写并退出 + * `:q!` – 强制退出 + + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[萌新阿岩](https://github.com/mengxinayan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/linux-basic-commands-file-directory-manipulation/ +[2]: https://www.2daygeek.com/unix-linux-command-to-view-file/ From bb4fb5fed003b52ec961af64f4308b0beb17bae5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Mar 2020 21:54:37 +0800 Subject: [PATCH 0038/1809] PRF @HankChow --- ...umentation for your open source project.md | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/translated/tech/20200312 How to write effective documentation for your open source project.md b/translated/tech/20200312 How to write effective documentation for your open source project.md index 51cd81bacd..e99d3e0c4d 100644 --- a/translated/tech/20200312 How to write effective documentation for your open source project.md +++ b/translated/tech/20200312 How to write effective documentation for your open source project.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to write effective documentation for your open source project) @@ -9,15 +9,16 @@ 如何为你的开源项目编写实用的文档 ====== -一份优质的文档可以让很多用户对你的项目路人转粉。 -![A pink typewriter][1] +> 一份优质的文档可以让很多用户对你的项目路人转粉。 + +![](https://img.linux.net.cn/data/attachment/album/202003/29/215343srdknc1o8kplbu8z.jpg) 好的代码很多时候并不代表一切。或许你能用最精巧的代码解决了世界上最迫切需要解决的问题,但如果你作为一个开源开发者,没能用准确的语言将你的作品公之于世,你的代码也只能成为沧海遗珠。因此,技术写作和文档编写是很重要的技能。 -一般来说,项目中的文档是最受人关注的部分,很多用户会通过文档来决定自己是否应该对某个项目开始学习或研究。所以,我们不能忽视技术写作和文档编写的工作,尤其要重点关注其中的“入门”部分,这会对你项目的发展起到关键性的作用。 +一般来说,项目中的文档是最受人关注的部分,很多用户会通过文档来决定自己是否应该对某个项目开始学习或研究。所以,我们不能忽视技术写作和文档编写的工作,尤其要重点关注其中的“入门Getting Started”部分,这会对你项目的发展起到关键性的作用。 -对于很多人来说,写作是一件令人厌烦甚至恐惧的事情。我们这些工程师出身的人,学习“写代码”比学习“为代码写文档”明显更多。不少人会把英语作为自己的第二语言或者第三语言,他们可能会对英语写作感到不安全甚至害怕(我的母语是汉语,英语是作为我的第二语言学习的,所以我也能感受到这种痛苦)。 +对于很多人来说,写作是一件令人厌烦甚至恐惧的事情。我们这些工程师出身的人,更多学习的是“写代码”而不是学习“为代码写文档”。不少人会把英语作为自己的第二语言或者第三语言,他们可能会对英语写作感到不自信甚至害怕(我的母语是汉语,英语是作为我的第二语言学习的,所以我也能感受到这种痛苦)。 但如果你希望自己的项目能在全球范围内产生一定的影响力,英语就是你必须使用的语言,这是一个无法避免的现实。但不必害怕,我在写这篇文章的时候就考虑到了这些可能带来的挑战,并给出了我的一些建议。 @@ -25,30 +26,30 @@ 这五条建议你马上就可以用起来,尽管看起来似乎有些浅显,但在技术写作时却经常被忽视。 - 1. 使用[主动语态][2]:感受一下主动语态下的“你可以这样更改配置(You can change these configurations by…)”和被动语态下的“配置可以这样更改(These configurations can be changed by…)”有什么不同之处。 - 2. 使用简洁明了的句子:可以借助 [Hemingway App][3] 或者 [Grammarly][4] 这样的工具,尽管它们并不开源。 - 3. 保持条理性:你可以在文档中通过写标题、划重点、引链接等方式,把各类信息划分为不同的部分,避免将所有内容都杂糅在一大段冗长的文字当中。 - 4. 提高可读性:除了单纯的文字之外,运用图表也是从多种角度表达的手段之一。 - 5. 注意拼写和语法:必须记得检查文档中是否有拼写错误或者语法错误。 +1. **使用主动语态**:感受一下[主动语态][2]下的“你可以这样更改配置(You can change these configurations by...)”和被动语态下的“配置可以这样更改(These configurations can be changed by…)”有什么不同之处。 +2. **使用简洁明了的句子**:可以借助 [Hemingway App][3] 或者 [Grammarly][4] 这样的工具,尽管它们并不开源。 +3. **保持条理性**:你可以在文档中通过写标题、划重点、引链接等方式,把各类信息划分为不同的部分,避免将所有内容都杂糅在一大段冗长的文字当中。 +4. **提高可读性**:除了单纯的文字之外,运用图表也是从多种角度表达的手段之一。 +5. **注意拼写和语法**:必须记得检查文档中是否有拼写错误或者语法错误。 只要在文档的写作和编辑过程中应用到这些技巧,你就能够和读者建立起沟通和信任。 - * 高效沟通:对于工程师们来说,阅读长篇大论的冗长文字,还不如去看小说。在阅读技术文档时,他们总是希望能够从中快速准确地获取到有用的信息。因此,技术文档的最佳风格应该是精简而有效的,不过这并不代表文档中不能出现类似幽默、emoji 甚至段子这些东西,这些元素可以当你的文档更有个性、更使人印象深刻。当然,具体的实现方式就因人而异了 - * 建立信任:你需要取得文档读者们的信任,这在一个项目的前期尤为重要。读者对你的信任除了来源于你代码的质量,还跟你文档编写的质量有关。所以你不仅要打磨代码,还要润色好相关的文档,这也是上面第 5 点建议拼写和语法检查的原因。 +* **高效沟通**:对于工程师们来说,阅读长篇大论的冗长文字,还不如去看小说。在阅读技术文档时,他们总是希望能够从中快速准确地获取到有用的信息。因此,技术文档的最佳风格应该是精简而有效的,不过这并不代表文档中不能出现类似幽默、emoji 甚至段子这些东西,这些元素可以当你的文档更有个性、更使人印象深刻。当然,具体的实现方式就因人而异了 +* **建立信任**:你需要取得文档读者们的信任,这在一个项目的前期尤为重要。读者对你的信任除了来源于你代码的质量,还跟你文档编写的质量有关。所以你不仅要打磨代码,还要润色好相关的文档,这也是上面第 5 点建议拼写和语法检查的原因。 -### 如何开始编写文档 +### 从编写“入门”文档开始 现在,最需要花费功夫的应该就是“入门”部分了,这是一篇技术文档最重要的部分,[二八定律][5]在这里得到了充分体现:访问一个项目的大部分流量都会落在项目文档上,而访问项目文档的大部分流量则会落在文档的“入门”部分中。因此,如果文档的“入门”部分写得足够好,项目就会吸引到很多用户,反之,用户会对你的项目敬而远之。 那么如何写好“入门”部分呢?我建议按照以下三步走: - 1. 任务化:入门指南应该以任务为导向。这里的任务指的是对于开发者来说可以完成的离散的小项目,而不应该包含太多涉及到体系结构、核心概念等的抽象信息,因此在“入门”部分只需要提供一个简单明了的概述就可以了。也不要在“入门”部分大谈这个项目如何优秀地解决了问题,这个话题可以放在文档中别的部分进行说明。总而言之,“入门”部分最好是给出一些主要的操作步骤,这样显得开门见山。 - 2. 30 分钟内能够完成:这一点的核心是耗时尽可能短,不宜超过 30 分钟,这个时间上限是考虑到用户可能对你的项目并不了解。这一点很重要,大部分愿意浏览文档的人都是有技术基础的,但对你的项目也仅仅是一知半解。首先让这些读者尝试进行一些相关操作,在收到一定效果后,他们才会愿意花更多时间深入研究整个项目。因此,你可以从耗时这个角度来评估你的文档“入门”部分有没有需要改进之处。 - 3. 有意义的任务:这里“有意义”的含义取决于你的开源项目。最重要的是认真思考并将“入门”部分严格定义为一项任务,然后交给你的读者去完成。这个项目的价值应该在这项有意义的任务中有所体现,不然读者可能会感觉这是一个浪费时间的行为。 +1. **任务化**:入门指南应该以任务为导向。这里的任务指的是对于开发者来说可以完成的离散的小项目,而不应该包含太多涉及到体系结构、核心概念等的抽象信息,因此在“入门”部分只需要提供一个简单明了的概述就可以了。也不要在“入门”部分大谈这个项目如何优秀地解决了问题,这个话题可以放在文档中别的部分进行说明。总而言之,“入门”部分最好是给出一些主要的操作步骤,这样显得开门见山。 +2. **30 分钟内能够完成**:这一点的核心是耗时尽可能短,不宜超过 30 分钟,这个时间上限是考虑到用户可能对你的项目并不了解。这一点很重要,大部分愿意浏览文档的人都是有技术基础的,但对你的项目也仅仅是一知半解。首先让这些读者尝试进行一些相关操作,在收到一定效果后,他们才会愿意花更多时间深入研究整个项目。因此,你可以从耗时这个角度来评估你的文档“入门”部分有没有需要改进之处。 +3. **有意义的任务**:这里“有意义”的含义取决于你的开源项目。最重要的是认真思考并将“入门”部分严格定义为一项任务,然后交给你的读者去完成。这个项目的价值应该在这项有意义的任务中有所体现,不然读者可能会感觉这是一个浪费时间的行为。 -提示:假如你的项目是一个分布式数据库,那么达到“整个集群在某些节点故障的情况下可以不中断地保持可用”的目标就可以认为是“有意义”的;加入你的项目是一个数据分析工具或者是商业智能工具,“有意义”的目标也可以是“加载数据后能快速生成多种可视化效果的仪表板”。总之,无论你的项目需要达到什么“有意义”的目标,都应该能在笔记本电脑上本地快速实现。 +提示:假如你的项目是一个分布式数据库,那么达到“整个集群在某些节点故障的情况下可以不中断地保持可用”的目标就可以认为是“有意义”的;假如你的项目是一个数据分析工具或者是商业智能工具,“有意义”的目标也可以是“加载数据后能快速生成多种可视化效果的仪表板”。总之,无论你的项目需要达到什么“有意义”的目标,都应该能在笔记本电脑上本地快速实现。 -[Linkerd 入门][6]就是一个很好的例子。Linkerd 是 Kubernetes 的开源服务网格Service Mesh,当时我对 Kubernetes 了解并不多,也不熟悉服务网格。但我在自己的笔记本电脑上很轻松地就完成了其中的任务,同时也加深了对服务网格的理解。 +[Linkerd 入门][6]就是一个很好的例子。Linkerd 是一个开源的 Kubernetes 服务网格Service Mesh,当时我对 Kubernetes 了解并不多,也不熟悉服务网格。但我在自己的笔记本电脑上很轻松地就完成了其中的任务,同时也加深了对服务网格的理解。 上面提到的三步过程是一个很有用的框架,对一篇文档“入门”部分的设计和量化评估很有帮助。今后你如果想将你的[开源项目产品化][7],这个框架还可能对实现价值的时间time-to-value产生影响。 @@ -56,15 +57,15 @@ 认真写好“入门”部分之后,你的文档中还需要有这五个部分:架构设计、生产环境使用指导、使用案例、参考资料以及未来展望,这五个部分在一份完整的文档中是必不可少的。 - * 架构设计:这一部分需要深入探讨整个项目架构设计的依据,“入门”部分中一笔带过的那些关键细节就应该在这里体现。在产品化过程中,这个部分将会是[产品推广计划][8]的核心,因此通常会包含一些可视化呈现的内容,期望的效果是让更多用户长期参与到项目中来。 - * 生产环境使用指导:对于同一个项目,在生产环境中部署比在笔记本电脑上部署要复杂得多。因此,指导用户认真使用就尤为重要。同时,有些用户可能对项目很感兴趣,但对生产环境下的使用有所顾虑,而指导和展示的过程则正好能够吸引到这类潜在的用户。 - * 使用案例:社会认同social proof的力量是有目共睹的,所以很有必要列出正在生产环境使用这个项目的其他用户,并把这些信息摆放在显眼的位置。这个部分的浏览量甚至仅次于“入门”部分。 - * 参考资料:这个部分是对项目的一些详细说明,让用户得以进行详细的研究以及查阅相关信息。一些开源作者会在这个部分事无巨细地列出项目中的每一个细节和边缘情况edge case,这种做法可以理解,但不推荐在项目初期就在这个部分花费过多的时间。你可以采取更折中的方式,在质量和效率之间取得平衡,例如提供一些相关社区的链接、Stack Overflow 上的标签或单独的 FAQ 页面。 - * 未来展望:你需要制定一个简略的时间表,规划这个项目的未来发展方向,这会让用户长期保持兴趣。尽管项目在当下可能并不完美,但要让用户知道你仍然有完善这个项目的计划。这个部分也能让整个社区构建一个强大的生态,因此还要向用户提供表达他们对未来展望的看法的交流区。 +* **架构设计**:这一部分需要深入探讨整个项目架构设计的依据,“入门”部分中那些一笔带过的关键细节就应该在这里体现。在产品化过程中,这个部分将会是[产品推广计划][8]的核心,因此通常会包含一些可视化呈现的内容,期望的效果是让更多用户长期参与到项目中来。 +* **生产环境使用指导**:对于同一个项目,在生产环境中部署比在笔记本电脑上部署要复杂得多。因此,指导用户认真使用就尤为重要。同时,有些用户可能对项目很感兴趣,但对生产环境下的使用有所顾虑,而指导和展示的过程则正好能够吸引到这类潜在的用户。 +* **使用案例**:社会认同social proof的力量是有目共睹的,所以很有必要列出正在生产环境使用这个项目的其他用户,并把这些信息摆放在显眼的位置。这个部分的浏览量甚至仅次于“入门”部分。 +* **参考资料**:这个部分是对项目的一些详细说明,让用户得以进行详细的研究以及查阅相关信息。一些开源作者会在这个部分事无巨细地列出项目中的每一个细节和边缘情况edge case,这种做法可以理解,但不推荐在项目初期就在这个部分花费过多的时间。你可以采取更折中的方式,在质量和效率之间取得平衡,例如提供一些相关社区的链接、Stack Overflow 上的标签或单独的 FAQ 页面。 +* **未来展望**:你需要制定一个简略的时间表,规划这个项目的未来发展方向,这会让用户长期保持兴趣。尽管项目在当下可能并不完美,但要让用户知道你仍然有完善这个项目的计划。这个部分也能让整个社区构建一个强大的生态,因此还要向用户提供表达他们对未来展望的看法的交流区。 以上这几个部分或许还没有在你的文档中出现,甚至可能会在后期才能出现,尤其是“使用案例”部分。尽管如此,还是应该在文档中逐渐加入这些部分。如果用户对“入门”部分已经感觉良好,那以上这几个部分将会提起用户更大的兴趣。 -最后,请在“入门”部分、README 文件或其它显眼的位置注明整个项目所使用的许可证。这个细节会让你的项目更容易通过终端用户的审核。 +最后,请在“入门”部分、README 文件或其它显眼的位置注明整个项目所使用的许可证。这个细节会让你的项目更容易通过最终用户的审核。 ### 花 20% 的时间写作 @@ -74,12 +75,9 @@ * * * -_特别鸣谢云原生计算基金会的布道师 [Luc Perkins][9] 给出的宝贵意见。_ - -_本文首发于_ _[COSS Media][10]_ _并经许可发布。_ - -Nigel Babu 提供了 10 条帮助编写项目文档的有用技巧。 +*特别鸣谢云原生计算基金会的布道师 [Luc Perkins][9] 给出的宝贵意见。* +*本文首发于 [COSS Media][10] 并经许可发布。* -------------------------------------------------------------------------------- @@ -88,7 +86,7 @@ via: https://opensource.com/article/20/3/documentation 作者:[Kevin Xu][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fd5e35c9b92a155854d1ca0391c936304c29f081 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Mar 2020 21:55:18 +0800 Subject: [PATCH 0039/1809] PUB @HankChow https://linux.cn/article-12052-1.html --- ...te effective documentation for your open source project.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200312 How to write effective documentation for your open source project.md (99%) diff --git a/translated/tech/20200312 How to write effective documentation for your open source project.md b/published/20200312 How to write effective documentation for your open source project.md similarity index 99% rename from translated/tech/20200312 How to write effective documentation for your open source project.md rename to published/20200312 How to write effective documentation for your open source project.md index e99d3e0c4d..1635591917 100644 --- a/translated/tech/20200312 How to write effective documentation for your open source project.md +++ b/published/20200312 How to write effective documentation for your open source project.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12052-1.html) [#]: subject: (How to write effective documentation for your open source project) [#]: via: (https://opensource.com/article/20/3/documentation) [#]: author: (Kevin Xu https://opensource.com/users/kevin-xu) From be4a29722dc110ec5b5cc833cb44902831ddeb55 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 30 Mar 2020 08:35:17 +0800 Subject: [PATCH 0040/1809] translated --- ...00323 Don-t love diff- Use Meld instead.md | 131 ------------------ ...00323 Don-t love diff- Use Meld instead.md | 129 +++++++++++++++++ 2 files changed, 129 insertions(+), 131 deletions(-) delete mode 100644 sources/tech/20200323 Don-t love diff- Use Meld instead.md create mode 100644 translated/tech/20200323 Don-t love diff- Use Meld instead.md diff --git a/sources/tech/20200323 Don-t love diff- Use Meld instead.md b/sources/tech/20200323 Don-t love diff- Use Meld instead.md deleted file mode 100644 index e5049454e2..0000000000 --- a/sources/tech/20200323 Don-t love diff- Use Meld instead.md +++ /dev/null @@ -1,131 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Don't love diff? Use Meld instead) -[#]: via: (https://opensource.com/article/20/3/meld) -[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) - -Don't love diff? Use Meld instead -====== -Meld is a visual diff tool that makes it easier to compare and merge -changes in files, directories, Git repos, and more. -![Person drinking a hat drink at the computer][1] - -Meld is one of my essential tools for working with code and data files. It's a graphical diff tool, so if you've ever used the **diff** command and struggled to make sense of the output, [Meld][2] is here to help. - -Here is a brilliant description from the project's website: - -> "Meld is a visual diff and merge tool targeted at developers. Meld helps you compare files, directories, and version controlled projects. It provides two- and three-way comparison of both files and directories, and has support for many popular version control systems. -> -> "Meld helps you review code changes and understand patches. It might even help you to figure out what is going on in that merge you keep avoiding." - -You can install Meld on Debian/Ubuntu systems (including Raspbian) with: - - -``` -`$ sudo apt install meld` -``` - -On Fedora or similar, it's: - - -``` -`$ sudo dnf install meld` -``` - -Meld is cross-platform—there's a [Windows install][3] using the [Chocolately][4] package manager. While it's not officially supported on macOS, there are [builds available for Mac][5], and you can install it on Homebrew with: - - -``` -`$ brew cask install meld` -``` - -See Meld's homepage for [additional options][2]. - -### Meld vs. the diff command - -If you have two similar files (perhaps one is a modified version of the other) and want to see the changes between them, you could run the **diff** command to see their differences in the terminal: - -![diff output][6] - -This example shows the differences between **conway1.py** and **conway2.py**. It's showing that I: - - * Removed the [shebang][7] and second line - * Removed **(object)** from the class declaration - * Added a docstring to the class - * Swapped the order of **alive** and **neighbours == 2** in a method - - - -Here's the same example using the **meld** command. You can run the same comparison from the command line with: - - -``` -`$ meld conway1.py conway2.py` -``` - -![Meld output][8] - -Much clearer! - -You can easily see changes and merge changes between files by clicking the arrows (they work both ways). You can even edit the files live (Meld doubles up as a simple text editor with live comparisons as you type)—just be sure to save before you close the window. - -You can even compare and edit three different files: - -![Comparing three files in Meld][9] - -### Meld's Git-awareness - -Hopefully, you're using a version control system like [Git][10]. If so, your comparison isn't between two different files but to find differences between the current working file and the one Git knows. Meld understands this, so if you run **meld conway.py**, where **conway.py** is known by Git, it'll show you any changes made since the last Git commit: - -![Comparing Git files in Meld][11] - -You can see changes made in the current version (on the right) and the repository version (on the left). You can see I deleted a method and added a parameter and a loop since the last commit. - -If you run **meld .**, you'll see all the changes in the current directory (or the whole repository, if you're in its root): - -![Meld . output][12] - -You can see a single file is modified, another file is unversioned (meaning it's new to Git, so I need to **git add** the file before comparing it), and lots of other unmodified files. Various display options are provided by icons along the top. - -You can also compare two directories, which is sometimes handy: - -![Comparing directories in Meld][13] - -### Conclusion - -Even regular users can find comparisons with diff difficult to decipher. I find the visualizations Meld provides make a big difference in troubleshooting what's changed between files. On top of that, Meld comes with some helpful awareness of version control and helps you compare across Git commits without thinking much about it. Give Meld a go, and make troubleshooting a little easier on the eyes. - -* * * - -_This was originally published on Ben Nuttall's [Tooling blog][14] and is reused with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/meld - -作者:[Ben Nuttall][a] -选题:[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/bennuttall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) -[2]: https://meldmerge.org/ -[3]: https://chocolatey.org/packages/meld -[4]: https://opensource.com/article/20/3/chocolatey -[5]: https://yousseb.github.io/meld/ -[6]: https://opensource.com/sites/default/files/uploads/diff-output.png (diff output) -[7]: https://en.wikipedia.org/wiki/Shebang_(Unix) -[8]: https://opensource.com/sites/default/files/uploads/meld-output.png (Meld output) -[9]: https://opensource.com/sites/default/files/uploads/meld-3-files.png (Comparing three files in Meld) -[10]: https://opensource.com/resources/what-is-git -[11]: https://opensource.com/sites/default/files/uploads/meld-git.png (Comparing Git files in Meld) -[12]: https://opensource.com/sites/default/files/uploads/meld-directory-changes.png (Meld . output) -[13]: https://opensource.com/sites/default/files/uploads/meld-directory-compare.png (Comparing directories in Meld) -[14]: https://tooling.bennuttall.com/meld/ diff --git a/translated/tech/20200323 Don-t love diff- Use Meld instead.md b/translated/tech/20200323 Don-t love diff- Use Meld instead.md new file mode 100644 index 0000000000..7f3c980685 --- /dev/null +++ b/translated/tech/20200323 Don-t love diff- Use Meld instead.md @@ -0,0 +1,129 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Don't love diff? Use Meld instead) +[#]: via: (https://opensource.com/article/20/3/meld) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +不喜欢 diff 么?试试 Meld 吧 +====== +Meld 是一个可视化 diff 工具,它可让你轻松比较和合并文件、目录、Git 仓库等的更改。 +![Person drinking a hat drink at the computer][1] + +Meld 是我处理代码和数据文件的基本工具之一。它是一个图形化的 diff 工具,因此,如果你曾经使用过 **diff** 命令并难以理解输出,那么 [Meld][2] 可以为你提供帮助。 + +这是该项目网站的精彩描述: + +>“ Meld 是面向开发人员的可视化 diff 和合并工具。Meld 帮助你比较文件、目录和版本控制的项目。它提供文件和目录的双向和三向比较,并支持许多流行的版本控制系统。“ +> +>“ Meld 帮助你检查代码更改并了解补丁。它甚至可以帮助你弄清你一直在避免的合并中发生了什么。” + +你可以使用以下命令在 Debian/Ubuntu 系统(包括 Raspbian)上安装 Meld: + + +``` +`$ sudo apt install meld` +``` + +在 Fedora 或类似产品上,是: + + +``` +`$ sudo dnf install meld` +``` + +Meld 是跨平台的,它有一个使用 [Chocolately][4] 包管理器的 [Windows 安装包][3]。尽管它在 macOS 上不受官方支持,但有[可用于 Mac 的版本][5],你可以使用 Homebrew 安装: + + +``` +`$ brew cask install meld` +``` + +有关[其他系统][2],请参见 Meld 的主页。 + +### Meld 对比 diff 命令 + +如果你有两个相似的文件(也许一个是另一个的修改版本),并想要查看它们之间的更改,那么可以在终端中运行 **diff** 命令查看它们的区别: + +![diff output][6] + +此例显示了 **conway1.py** 和 **conway2.py** 之间的区别。表明我: + + * 删除了 [shebang][7] 和第二行 +  * 从类声明中删除了 **(object)** +  * 为类添加了 docstring +  * 在方法中交换了 **alive** 和 **neighbours == 2** 的顺序 + + +这是使用 **meld** 命令的相同例子。你可以在命令行中运行以下命令进行相同的比较: + + +``` +`$ meld conway1.py conway2.py` +``` + +![Meld output][8] + +Meld 更清晰! + +你可以单击箭头(上下都行)轻松查看并合并文件之间的更改。你甚至可以实时编辑文件(在输入时,Meld 可以用作具有实时比较功能的简单文本编辑器)—仅在关闭窗口之前一定要保存。 + +你甚至可以比较和编辑三个不同的文件: + +![Comparing three files in Meld][9] + +### Meld 的 Git 认知 + +希望你正在使用 [Git][10] 之类的版本控制系统。如果是这样,那么你的比较不是在两个不同文件之间进行,而是要查找当前文件与 Git 历史文件之间的差异。Meld 理解这一点,因此,如果你运行 **meld conway.py**(Git 中有 **conway.py**),它将显示自上次 Git 提交以来所做的更改: + +![Comparing Git files in Meld][11] + +你可以看到当前版本(右侧)和仓库版本(左侧)之间的更改。你可以看到,自上次提交以来,我删除了一个方法,并添加了一个参数和一个循环。 + +如果你运行 **meld .**,你将看到当前目录(如果位于根目录,就是整个仓库)中的所有更改: + +![Meld . output][12] + +你会看到一个文件被修改,另一个文件未加入版本控制(这意味着它对 Git 是新的,因此在比较之前,我需要 **git add** 该文件),以及许多其他未修改的文件。顶部的图标提供了各种显示选项。 + +你还可以比较两个目录,这有时很方便: + +![Comparing directories in Meld][13] + +### 结论 + +即使是普通用户也会觉得 diff 的比较难以理解。我发现 Meld 提供的可视化在找出文件之间的更改方面有很大的不同。最重要的是,Meld 有一些有用的版本控制认知,可以帮助你在不考虑太多内容的情况下对 Git 提交进行比较。快来试试 Meld,并轻松解决问题。 + +* * * + +_本文最初发表在 Ben Nuttall 的 [Tooling blog][14] 上,并经允许重新使用。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/meld + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://meldmerge.org/ +[3]: https://chocolatey.org/packages/meld +[4]: https://opensource.com/article/20/3/chocolatey +[5]: https://yousseb.github.io/meld/ +[6]: https://opensource.com/sites/default/files/uploads/diff-output.png (diff output) +[7]: https://en.wikipedia.org/wiki/Shebang_(Unix) +[8]: https://opensource.com/sites/default/files/uploads/meld-output.png (Meld output) +[9]: https://opensource.com/sites/default/files/uploads/meld-3-files.png (Comparing three files in Meld) +[10]: https://opensource.com/resources/what-is-git +[11]: https://opensource.com/sites/default/files/uploads/meld-git.png (Comparing Git files in Meld) +[12]: https://opensource.com/sites/default/files/uploads/meld-directory-changes.png (Meld . output) +[13]: https://opensource.com/sites/default/files/uploads/meld-directory-compare.png (Comparing directories in Meld) +[14]: https://tooling.bennuttall.com/meld/ From 9efd11699ae4d0e3040f78d476392741e2752f86 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 30 Mar 2020 08:41:28 +0800 Subject: [PATCH 0041/1809] translating --- .../20200326 3 open source tools for sticking to a budget.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200326 3 open source tools for sticking to a budget.md b/sources/tech/20200326 3 open source tools for sticking to a budget.md index 2c3ca5bc2e..66b440be97 100644 --- a/sources/tech/20200326 3 open source tools for sticking to a budget.md +++ b/sources/tech/20200326 3 open source tools for sticking to a budget.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 285520384e34194fdce42aa1588726dd1a185d11 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Mar 2020 12:07:37 +0800 Subject: [PATCH 0042/1809] PRF @mengxinayan --- ... You Need to Know to Work in Vim Editor.md | 74 +++++++------------ 1 file changed, 25 insertions(+), 49 deletions(-) diff --git a/translated/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md b/translated/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md index 3920687144..ba60e91fd2 100644 --- a/translated/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md +++ b/translated/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md @@ -1,69 +1,52 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Basic Vim Commands You Need to Know to Work in Vim Editor) [#]: via: (https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -你需要知道的 Vim 编辑器中的基础命令 +必知必会的 Vim 编辑器基础命令 ====== -如果你是一名系统管理员或者开发者,当你在终端工作时有时会需要编辑一个文件。 - -在 Linux 系统中有几种文件编辑器,你可以根据需求选择合适的文件编辑器 - -在这里,我想推荐 Vim 编辑器 - +如果你是一名系统管理员或者开发者,当你在终端工作时有时会需要编辑一个文件。在 Linux 系统中有几种文件编辑器,你可以根据需求选择合适的文件编辑器。在这里,我想推荐 Vim 编辑器。 ### 为什么推荐 Vim 编辑器 -和创建编写新文件相比,你会在编辑器中花费更多的时间用来修改已经存在的文件。 +相对于创建新文件,你更多是修改已经存在的文件。在这种情况下,Vim 快捷键可以有效地满足你的需求。 -在这种情况下,Vim 快捷键可以有效地满足你的需求。 - -文章下面的内容可以帮助你了解对文件和目录的操作。 - - [Linux 基础:对文件和目录进行操作的 Linux 和 Unix 命令][1] - [在 Linux 中查看不同文件格式的10种方法][2] +下列文章可以帮助你了解对文件和目录的操作。 +- [Linux 基础:对文件和目录进行操作的 Linux 和 Unix 命令][1] +- [在 Linux 中查看不同文件格式的 10 种方法][2] ### 什么是 Vim -Vim 是被 Linux 管理员和开发者广泛使用的最流行和功能强大的编辑器之一。 - -它可以通过高度的自定义配置来提高文本编辑效率。它是在众多 Unix 默认安装的 Vi 编辑器的升级版。 - -Vim 通常被称为“程序员的编辑器”,但并不限于此,它也可用于编辑任何类型的文件。 - -它具有许多功能,例如:多次撤销,多窗口和缓冲区,语法高亮,命令行编辑,文件名补全,可视选择。 - -你可以使用 `:help` 命令来获取在线帮助 +Vim 是被 Linux 管理员和开发者广泛使用的最流行和功能强大的编辑器之一。它可以通过高度的自定义配置来提高文本编辑效率。它是在众多 Unix 默认安装的 Vi 编辑器的升级版。 +Vim 通常被称为“程序员的编辑器”,但并不限于此,它也可用于编辑任何类型的文件。它具有许多功能,例如:多次撤销、多窗口和缓冲区、语法高亮、命令行编辑、文件名补全、可视选择等等。你可以使用 `:help` 命令来获取在线帮助。 ### 理解 Vim 的模式 Vim 有两种模式,详细介绍如下: -**命令模式:** 当启动 Vim 编辑器后,默认处在命令模式下。你可以在文件中移动并且修改内容,剪切,复制和粘贴文件的一部分,同时发出命令执行更多操作(按 ESC 键进入命令模式) +**命令模式:** 当启动 Vim 编辑器后,默认处在命令模式下。你可以在文件中移动并且修改内容,剪切、复制和粘贴文件的一部分,同时发出命令执行更多操作(按 `ESC` 键进入命令模式) -**插入模式:** 插入模式用于在给定的文档位置插入文本(按 i 键进入插入模式) +**插入模式:** 插入模式用于在给定的文档位置插入文本(按 `i` 键进入插入模式) ### 我如何知道我正使用哪种 Vim 模式呢? -如果你正在使用插入模式,你会在编辑器的底部看到 `INSERT` 。如果编辑器底部没有显示任何内容,或者在编辑器底部显示了文件名,则处于 “命令模式”。 +如果你正在使用插入模式,你会在编辑器的底部看到 `INSERT`。如果编辑器底部没有显示任何内容,或者在编辑器底部显示了文件名,则处于 “命令模式”。 -### 正常模式下的光标移动 -### Cursor Movement in Normal Mode +### 命令模式下的光标移动 Vim 快捷键允许你使用不同的方式来移动光标: * `G` – 跳转到文件最后一行 * `gg` – 跳转到文件首行 * `$` – 跳转到行末尾 - * `0` (零) – 跳转到行开头 - + * `0`(数字 0) – 跳转到行开头 * `w` – 跳转到下一个单词的开始(单词的分隔符可以是空格或其他符号) * `W` – 跳转到下一个单词的开始(单词的分隔符只能是空格) * `b` – 跳转到下一个单词的末尾(单词的分隔符可以是空格或其他符号) @@ -74,10 +57,9 @@ Vim 快捷键允许你使用不同的方式来移动光标: * `Ctrl+d` – 向下移动半页 * `Ctrl+u` – 向上移动半页 - ### 插入模式:插入文字 -下面的 vim 快捷键允许你根据需要在光标的不同位置插入内容。 +下面的 Vim 快捷键允许你根据需要在光标的不同位置插入内容。 * `i` – 在光标之前插入 * `a` – 在光标之后插入 @@ -87,26 +69,22 @@ Vim 快捷键允许你使用不同的方式来移动光标: * `O` – 在光标所在行的上面插入新行 * `ea` – 在单词的末尾插入 - -### 拷贝,粘贴和删除一行 +### 拷贝、粘贴和删除一行 * `yy` – 复制一行 - * `p/P` – 将内容粘贴到光标之后 / 将内容粘贴到光标之前 + * `p` / `P` – 将内容粘贴到光标之后 / 之前 * `dd` – 删除一行 * `dw` – 删除一个单词 +### 在 Vim 中搜索和替换匹配的模式 -### 在 Vim 中搜索和替换模式 - - * `/pattern` – 向后搜索给定的模式 - * `?pattern` – 向前搜索给定的模式 + * `/模式` – 向后搜索给定的模式 + * `?模式` – 向前搜索给定的模式 * `n` – 向后重复搜索之前给定的模式 * `N` – 向前重复搜索之前给定的模式 - - * `:%s/old-pattern/new-pattern/g` – 将文件中所有的旧模式替换为新模式 - * `:s/old-pattern/new-pattern/g` – 将当前行中所有的旧模式替换为新模式 - * `:%s/old-pattern/new-pattern/gc` – 逐个询问是否文件中的旧模式替换为新模式 - + * `:%s/旧模式/新模式/g` – 将文件中所有的旧模式替换为新模式 + * `:s/旧模式/新模式/g` – 将当前行中所有的旧模式替换为新模式 + * `:%s/旧模式/新模式/gc` – 逐个询问是否文件中的旧模式替换为新模式 ### 如何在 Vim 编辑器中跳转到特定行 @@ -127,7 +105,7 @@ Vim 快捷键允许你使用不同的方式来移动光标: 如果你已经知道行号,请使用以下方法在打开文件时直接跳转到相应行。例如,如果在打开文件时直接跳转到 20 行,请输入下面的命令: ``` -$ vim +20 [File_Name] +$ vim +20 [文件名] ``` ### 撤销操作/恢复上一次操作/重复上一次操作 @@ -136,14 +114,12 @@ $ vim +20 [File_Name] * `Ctrl+r` – 恢复更改 * `.` – 重复上一条命令 - ### 保存和退出 Vim * `:w` – 保存更改但不退出 vim * `:wq` – 写并退出 * `:q!` – 强制退出 - -------------------------------------------------------------------------------- via: https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/ @@ -151,7 +127,7 @@ via: https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f5c26b2fd196f034f836eb8e5928e4b816d005d9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Mar 2020 12:08:12 +0800 Subject: [PATCH 0043/1809] PUB @mengxinayan https://linux.cn/article-12053-1.html --- ...sic Vim Commands You Need to Know to Work in Vim Editor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md (98%) diff --git a/translated/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md b/published/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md similarity index 98% rename from translated/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md rename to published/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md index ba60e91fd2..2a6b8e91d7 100644 --- a/translated/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md +++ b/published/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12053-1.html) [#]: subject: (Basic Vim Commands You Need to Know to Work in Vim Editor) [#]: via: (https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From b80b72912f5d71ba82c7073dc6645d5ca3635ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Mon, 30 Mar 2020 15:16:20 +0800 Subject: [PATCH 0044/1809] Translated --- ...et DebianDog - Puppy sized Debian Linux.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/sources/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md b/sources/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md index ea2b2d1f7c..ac429383ba 100644 --- a/sources/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md +++ b/sources/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md @@ -7,72 +7,72 @@ [#]: via: (https://itsfoss.com/debiandog/) [#]: author: (John Paul https://itsfoss.com/author/john/) -Meet DebianDog – Puppy sized Debian Linux +体验 DebianDog– Puppy 大小的 Debian Linux ====== -Recently I stumbled upon an intriguing Linux project. This project aims to create small live CDs for Debian and Debian-based systems, similar to the [Puppy Linux project][1]. Let’s take a look at DebianDog. +不久前,我偶然发现了一个有趣的 Linux 项目。这个项目旨在为 Debian 和基于 Debian 的系统创建一个小型的 live cd,类似于 [Puppy Linux 项目][1] 。让我们看看 DebianDog 。 -### What is DebianDog? +### DebianDog 是什么? -As it says on the tin, [DebianDog][2] “is a small Debian Live CD shaped to look like Puppy and act like Puppy. Debian structure and Debian behaviour are untouched and Debian documentation is 100% valid for DebianDog. You have access to all Debian repositories using apt-get or synaptic.” +正如字面所述,[DebianDog][2] “是一个被塑造成一个外观和动作都像 Puppy 的小型 Debian Live CD ,Debian 结构和 Debian 活动方式是不受影响的, Debian 文档对 DebianDog 来说是100%有效的。你可以使用 apt-get 或 synaptic 来访问所有的 Debian 存储库。” ![DebianDog Jessie][3] -For those of you who are not familiar with [Puppy Linux][1], the project is “a collection of multiple Linux distributions, built on the same shared principles”. Those principles are to be fast, small (300 MB or less), and easy to use. There are versions of Puppy Linux built to support Ubuntu, Slackware, and Raspbian packages. +对于那些不熟悉 [Puppy Linux][1] 的人来说,该项目是 “多个 Linux 发行版的一个集合,建立在相同的共享法则之上”。这些法则能够实现快速、小型(300 MB 或更少),和易于使用。这里有为支持 Ubuntu, Slackware 和 Raspbian 软件包构建的 Puppy linux 变种。 -The major difference between DebianDog and Puppy Linux is that Puppy Linux has its own package manager [the [Puppy Package Manager][4]]. As stated above, DebianDog using the Debian package manager and packages. Even the DebianDog website tries to make that clear: “It is not Puppy Linux and it has nothing to do with Puppy based on Debian.” +DebianDog 和 Puppy Linux 之间最大的不同是,Puppy Linux 有其自己的软件包管理器 [Puppy 软件包管理器][4] 。如上所述,DebianDog 使用 Debian 软件包管理器及其软件包。甚至 DebianDog 网站也试图澄清这一点:“它不是 Puppy Linux ,并且也与基于 Debian 的 Puppy 无关。” -### Why should anyone use DebianDog? +### 为什么一些人使用 DebianDog ? -The main reason to install DebianDog (or any of its derivatives) would be to restore an older system to operability. Every entry on DebianDog has a 32-bit option. They also have lighter desktop environments/window managers, such as [Openbox][5] or the [Trinity Desktop][6] environment. Most of those also have an alternative to systemd. They also come with lighter applications installed, such as [PCManFM][7]. +安装 DebianDog (或其任何衍生产品) 的主要原因是恢复一台较旧电脑的可操作性。在 DebianDog 上的每个条目都有一个32位选项。它们还有更轻量级的桌面环境/窗口管理器,例如 [Openbox][5] 或 [Trinity Desktop][6] 环境。它们中大多数也都有一个 systemd 的可替代版本。它们也安装更轻的应用程序,例如 [PCManFM][7] 。 -### What versions of DebianDog are available? +### DebianDog 有哪些可用的变体版本? -Though DebianDog was the first in the series, the project is called ‘Dog Linux’ and provides various ‘Dog variants’ on popular distributions based on Debian and Ubuntu. +尽管 DebianDog 在本系列中是第一个,但是该项目被称为 ‘Dog Linux’ ,提供各种基于Debian 和 Ubuntu的流行发行版的 ‘Dog 变体’。 #### DebianDog Jessie -The first (and original) version of DebianDog is DebianDog Jessie. There are two [32-bit versions][8] of it. One uses [Joe’s Window Manager (JWM)][9] as default and the other uses XFCE. Both systemd and sysvinit are available. There is also a [64-bit version][10]. DebianDog Jessie is based on Debian 8.0 (codename Jessie). Support for Debian 8.0 ends on June 30th, 2020, so install with caution. +DebianDog 的第一个(也是最初的) 版本是 DebianDog Jessie。它有两个 [32位版本][8] ,一个使用 [Joe’s Window Manager (JWM)][9] 作为默认桌面环境,另一个使用 XFCE 作为默认桌面环境。systemd 和 sysvinit 都是可用的。它还有一个 [64位版本][10]。DebianDog Jessie 基于 Debian 8.0 (代号 Jessie)。Debian 8.0 的支持将于2020年6月30日结束,因此安装需谨慎。 ![TrinityDog][11] #### StretchDog -[Stret][12][c][12][hDog][12] is based on Debian 9.0 (codename Stretch). It is available in 32 and 64-bit. Openbox is the default window manager, but we can also switch to JWM. Support for Debian 9.0 ends on June 30th, 2022. +[StretchDog][12] 基于 Debian 9.0 (代号 Stretch) 。它有32位和64位两种可用。Openbox是默认的窗口管理器,但是我们可以切换到 JWM 。Debian 9.0 的支持将于2022年6月30日结束。 #### BusterDog -[BusterDog][13] is interesting. It is based on [Debian 10][14] (codename Buster). It does not use systemd, instead, it uses [elogind][15] just like [AntiX][16]. Support for Debian 10.0 ends on June 2024. +[BusterDog][13] 是很有趣的。它基于 [Debian 10][14] (代号 Buster) 。它不使用 systemd ,反而像 [AntiX][16] 一样使用 [elogind][15] 。Debian 10.0 的支持将于2024年6月结束。 #### MintPup -[MintPup][17] is based on [Linux Mint][18] 17.1. This LiveCD is 32-bit only. You can also access all of the “Ubuntu/Mint repositories using apt-get or synaptic”. Considering that Mint 17 has reached end of life, this version must be avoided. +[MintPup][17] 基于 [Linux Mint][18] 17.1 。LiveCD 仅有32位版本。你也可以使用 “apt-get 或 synaptic 访问 Ubuntu/Mint 的存储库”。考虑到 Mint 17 已经到了生命的尽头,这一版本必须避免使用。 #### XenialDog -There are both [32-bit][19] and [64-bit versions][20] of this spin based on the Ubuntu 16.04 LTS. Both versions come with Openbox as default with JWM as an option. Support for Ubuntu 16.04 LTS ends in April of 2021, so install with caution. +XenialDog 有[32位][19]和[64位][20] 两种变种,基于 Ubuntu 16.04 LTS 。两个变种都使用 Openbox 作为默认版本,JWM 是一种选项。Ubuntu 16.04 LTS 的支持将于2021年4月结束, 因此安装需谨慎。 #### TrinityDog -There are two versions of the [TrintyDog][21] spin. One is based on Debian 8 and the other is based on Debian 9. Both are 32-bit and both use the [Trinity Desktop Environment][6], thus the name. +[TrintyDog][21] 有两种变体。一个基于 Debian 8 ,另一个基于 Debian 9 。两种变体都有32位版本,并且都使用 [Trinity Desktop Environment][6] ,依以此得名。 ![BionicDog][22] #### BionicDog -As you should be able to guess by the name. [BionicDog][23] is based on [Ubuntu 18.04 LTS][24]. The main version of this spin has both 32 and 64-bit with Openbox as the default window manager. There is also a version that uses the [Cinnamon desktop][25] and is only 64-bit. +你应该能够从名称猜到。[BionicDog][23] 基于 [Ubuntu 18.04 LTS][24] 。主要版本有32位和64位两个版本,Openbox 是默认的窗口管理器。这里也有一个使用 [Cinnamon desktop][25] 的版本,并且只有64位。 -### Final Thoughts +### 结束语 -I like any [Linux project that wants to make older systems usable][26]. However, most of the operating systems available through DebianDog are no longer supported or nearing the end of their life span. This makes it less than useful for the long run. +我喜欢任何 [想让较旧电脑系统有用的 Linux 项目][26]。但是,通过 DebianDog 项目提供的大多数操作系统不再受支持,或者接近它们的生命尽头。从长远来看,这就不那么有用了。 -**I wouldn’t really advise to use it on your main computer.** Try it in live USB or on a spare system. Also, [you can create][27] your own LiveCD spin if you want to take advantage of a newer base system. +**我不建议在你的主计算机上使用它。** 在 live USB 中或一台闲置的系统上尝试它。此外,如果你想使用较新的基础系统,[你可以创建][27]你自己的 LiveCD 。 -Somehow I keep on stumbling across obscure Linux distributions like [FatDog64][28], [4M Linux][29] and [Vipper Linux][30]. Even though I may not always recommend them to use, it’s still good to know about the existence of such projects. +似乎冥冥中自有天意,我总是在探索鲜为人知的 Linux 发行版的路上艰难地前行,像 [FatDog64][28] ,[4M Linux][29] 以及 [Vipper Linux][30] 。虽然我不建议使用它们,但是知晓这些项目的存在的意义总是好的。 -What are your thoughts on the DebianDog? What is your favorite Puppy-syle OS? Please let us know in the comments below. +你对 DebianDog 有什么看法?你最最喜欢的 Puppy 样式的操作系统是什么?请在下面的评论区中告诉我们。 -If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][31]. +如果你觉得这篇文章很有趣,请花点时间在社交媒体、黑客新闻或 [Reddit][31] 上分享。 -------------------------------------------------------------------------------- @@ -80,7 +80,7 @@ via: https://itsfoss.com/debiandog/ 作者:[John Paul][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[robsean](https://github.com/robsean) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6620f1d2fc833ddff74520173504ed863500d78f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Mon, 30 Mar 2020 15:20:54 +0800 Subject: [PATCH 0045/1809] Translating --- ...ll Microsoft TrueType Fonts on Ubuntu-based Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md b/sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md index e502219448..82deeed260 100644 --- a/sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md +++ b/sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 111abdeb35b75139b3f3d6d5d791169f1b6b57aa Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 30 Mar 2020 19:17:10 +0800 Subject: [PATCH 0046/1809] Rename sources/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md to translated/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md --- .../tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md (100%) diff --git a/sources/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md b/translated/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md similarity index 100% rename from sources/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md rename to translated/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md From 911ebea63d23fbf6270efaaad5d423bbcaf11a5c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Mar 2020 19:41:39 +0800 Subject: [PATCH 0047/1809] PRF @PsiACE --- ...Building a Messenger App- Conversations.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/translated/tech/20180708 Building a Messenger App- Conversations.md b/translated/tech/20180708 Building a Messenger App- Conversations.md index 8ab0e2c083..dbecb13624 100644 --- a/translated/tech/20180708 Building a Messenger App- Conversations.md +++ b/translated/tech/20180708 Building a Messenger App- Conversations.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (PsiACE) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Building a Messenger App: Conversations) @@ -10,16 +10,18 @@ 构建一个即时消息应用(三):对话 ====== +![](https://img.linux.net.cn/data/attachment/album/202003/30/193824w7xsj2ixs8frsal8.jpg) + 本文是该系列的第三篇。 * [第一篇:模式][1] * [第二篇:OAuth][2] -在我们的即时消息应用中,消息表现为两个参与者对话的堆叠。如果你想要开始异常对话,就应该向应用提供你想要交谈的用户,而当对话创建后(如果该对话此前并不存在),就可以向该对话发送消息。 +在我们的即时消息应用中,消息表现为两个参与者对话的堆叠。如果你想要开始一场对话,就应该向应用提供你想要交谈的用户,而当对话创建后(如果该对话此前并不存在),就可以向该对话发送消息。 就前端而言,我们可能想要显示一份近期对话列表。并在此处显示对话的最后一条消息以及另一个参与者的姓名和头像。 -在这篇帖子中,我们将会编写一些端点(endpoints)来完成像「创建对话」、「获取对话列表」以及「找到单个对话」这样的任务。 +在这篇帖子中,我们将会编写一些端点endpoint来完成像“创建对话”、“获取对话列表”以及“找到单个对话”这样的任务。 首先,要在主函数 `main()` 中添加下面的路由。 @@ -45,7 +47,7 @@ func requireJSON(handler http.HandlerFunc) http.HandlerFunc { } ``` -如果请求(request)不是 JSON 格式,那么它会返回 `415 Unsupported Media Type`(不支持的媒体类型)错误。 +如果请求request不是 JSON 格式,那么它会返回 `415 Unsupported Media Type`(不支持的媒体类型)错误。 ### 创建对话 @@ -58,7 +60,7 @@ type Conversation struct { } ``` -就像上面的代码那样,对话中保持对另一个参与者和最后一条消息的引用,还有一个 bool 类型的字段,用来告知是否有未读消息。 +就像上面的代码那样,对话中保持对另一个参与者和最后一条消息的引用,还有一个 `bool` 类型的字段,用来告知是否有未读消息。 ```go type Message struct { @@ -188,7 +190,7 @@ type Errors struct { } ``` -然后,我们开始执行 SQL 事务。收到的仅仅是用户名,但事实上,我们需要知道实际的用户 ID 。因此,事务的第一项内容是查询另一个参与者的 ID 和头像。如果找不到该用户,我们将会返回 `404 Not Found`(未找到) 错误。另外,如果找到的用户恰好和「当前已验证用户」相同,我们应该返回 `403 Forbidden`(拒绝处理)错误。这是由于对话只应当在两个不同的用户之间发起,而不能是同一个。 +然后,我们开始执行 SQL 事务。收到的仅仅是用户名,但事实上,我们需要知道实际的用户 ID 。因此,事务的第一项内容是查询另一个参与者的 ID 和头像。如果找不到该用户,我们将会返回 `404 Not Found`(未找到) 错误。另外,如果找到的用户恰好和“当前已验证用户”相同,我们应该返回 `403 Forbidden`(拒绝处理)错误。这是由于对话只应当在两个不同的用户之间发起,而不能是同一个。 然后,我们试图找到这两个用户所共有的对话,所以需要使用 `INTERSECT` 语句。如果存在,只需要通过 `/api/conversations/{conversationID}` 重定向到该对话并将其返回。 @@ -265,11 +267,11 @@ func getConversations(w http.ResponseWriter, r *http.Request) { } ``` -该处理程序仅对数据库进行查询。它通过一些联接来查询对话表……首先,从消息表中获取最后一条消息。然后依据「ID 与当前已验证用户不同」的条件,从参与者表找到对话的另一个参与者。然后联接到用户表以获取该用户的用户名和头像。最后,再次联接参与者表,并以相反的条件从该表中找出参与对话的另一个用户,其实就是当前已验证用户。我们会对比消息中的 `messages_read_at` 和 `created_at` 两个字段,以确定对话中是否存在未读消息。然后,我们通过 `user_id` 字段来判定该消息是否属于「我」(指当前已验证用户)。 +该处理程序仅对数据库进行查询。它通过一些联接来查询对话表……首先,从消息表中获取最后一条消息。然后依据“ID 与当前已验证用户不同”的条件,从参与者表找到对话的另一个参与者。然后联接到用户表以获取该用户的用户名和头像。最后,再次联接参与者表,并以相反的条件从该表中找出参与对话的另一个用户,其实就是当前已验证用户。我们会对比消息中的 `messages_read_at` 和 `created_at` 两个字段,以确定对话中是否存在未读消息。然后,我们通过 `user_id` 字段来判定该消息是否属于“我”(指当前已验证用户)。 注意,此查询过程假定对话中只有两个用户参与,它也仅仅适用于这种情况。另外,该设计也不很适用于需要显示未读消息数量的情况。如果需要显示未读消息的数量,我认为可以在 `participants` 表上添加一个`unread_messages_count` `INT` 字段,并在每次创建新消息的时候递增它,如果用户已读则重置该字段。 -接下来需要遍历每一条记录,通过扫描每一个存在的对话来建立一个对话切片(an slice of conversations)并在最后进行响应。 +接下来需要遍历每一条记录,通过扫描每一个存在的对话来建立一个对话切片slice of conversations并在最后进行响应。 ### 找到单个对话 @@ -329,7 +331,7 @@ func getConversation(w http.ResponseWriter, r *http.Request) { 在下一篇帖子中,我们将会看到如何创建并列出消息。 -[Souce Code][3] +- [源代码][3] -------------------------------------------------------------------------------- @@ -338,7 +340,7 @@ via: https://nicolasparada.netlify.com/posts/go-messenger-conversations/ 作者:[Nicolás Parada][a] 选题:[lujun9972][b] 译者:[PsiACE](https://github.com/PsiACE) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1396664621a894cb880746eed6010603d0d79307 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Mar 2020 19:42:12 +0800 Subject: [PATCH 0048/1809] PUB @PsiACE https://linux.cn/article-12056-1.html --- .../20180708 Building a Messenger App- Conversations.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20180708 Building a Messenger App- Conversations.md (99%) diff --git a/translated/tech/20180708 Building a Messenger App- Conversations.md b/published/20180708 Building a Messenger App- Conversations.md similarity index 99% rename from translated/tech/20180708 Building a Messenger App- Conversations.md rename to published/20180708 Building a Messenger App- Conversations.md index dbecb13624..722383745d 100644 --- a/translated/tech/20180708 Building a Messenger App- Conversations.md +++ b/published/20180708 Building a Messenger App- Conversations.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (PsiACE) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12056-1.html) [#]: subject: (Building a Messenger App: Conversations) [#]: via: (https://nicolasparada.netlify.com/posts/go-messenger-conversations/) [#]: author: (Nicolás Parada https://nicolasparada.netlify.com/) From 759355eaa1a1dcd1e40d73a4826beab4895f4260 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Mar 2020 21:07:07 +0800 Subject: [PATCH 0049/1809] PRF @HankChow --- ...en source software is fighting COVID-19.md | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/translated/tech/20200327 How open source software is fighting COVID-19.md b/translated/tech/20200327 How open source software is fighting COVID-19.md index dae4f55de7..d2553f765f 100644 --- a/translated/tech/20200327 How open source software is fighting COVID-19.md +++ b/translated/tech/20200327 How open source software is fighting COVID-19.md @@ -1,69 +1,70 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How open source software is fighting COVID-19) [#]: via: (https://opensource.com/article/20/3/open-source-software-covid19) [#]: author: (Jeff Stern https://opensource.com/users/jeffstern) -开源软件在应对 COVID-19 中的贡献 +开源软件在应对新冠病毒中的贡献 ====== + > 在新冠疫情爆发之际,涌现了数以千计的开源项目,今天我们来了解其中四个。 -![symbols showing healthcare][1] +![](https://img.linux.net.cn/data/attachment/album/202003/30/210613wchojyc5rrwh8y5k.jpg) 在当前紧张的疫情环境下,保持专注和积极性是一个很大的挑战。而研究开源社区如何应对这一次疫情爆发,对于我来说却成为了一种宣泄。 -从今年一月底开始,整个开源社区已经贡献了数以千计关于冠状病毒或 COVID-19 的[开源软件库][2],其中涉及的内容包括但不限于数据集、模型、可视化、Web 应用、移动应用,且大多数都使用了 JavaScript 和 Python 编写。 +从今年一月底开始,整个开源社区已经贡献了数以千计关于冠状病毒或新冠病毒的[开源软件仓库][2],其中涉及的内容包括但不限于数据集、模型、可视化、Web 应用、移动应用,且大多数都使用了 JavaScript 和 Python 编写。 -之前我们分享过一些关于开源硬件厂商在帮助遏制冠状病毒传播方面做的[贡献][3],现在将继续分享四个由开源社区作出的应对冠状病毒和 COVID-19 的项目,这体现了开发者们和整个开源社区在当下对整个世界的影响力。 +之前我们分享过一些关于[开源硬件创客们在帮助][3]遏制冠状病毒传播方面做的贡献,现在将继续分享四个由开源社区作出的应对冠状病毒和新冠病毒的项目,这体现了开发者们和整个开源社区在当下对整个世界的影响力。 ### 1. PennSignals:CHIME ![CHIME by PennSignals][4] -COVID-19 流行病医院影响模型COVID-19 Hospital Impact Model for Epidemics([CHIME][5])是由宾夕法尼亚大学 Penn Medicine 机构的数据科学家们建立的开源在线应用,它可以让医院更好地了解本次新型冠状病毒对医院需求的影响。 +新冠病毒流行病医院影响模型COVID-19 Hospital Impact Model for Epidemics([CHIME][5])是由宾夕法尼亚大学 Penn Medicine 机构的数据科学家们建立的开源在线应用,它可以让医院更好地了解本次新型冠状病毒对医院需求的影响。 医院的管理人员可以通过 CHIME 来大致预测未来几天和几周内将会有多少患者需要住院治疗,并推算 ICU 和呼吸机的需求量。只需要输入当前住院患者数以及一些相关的变量,就可以看到未来几天内需求的变化情况。 -CHIME 主要使用 Python 开发,并通过 [pandas][6] 这个开源库实现了大部分的数据转换和数值计算,最终得出相关的估计值。pandas 的背后有一个强大的团队进行支持,因此它是在数据分析方面被广泛使用的 Python 库之一。和很多其它的开源项目一样,pandas 团队的收入大部分来源于[用户的资金支持][7]。 +CHIME 主要使用 Python 开发,并通过 [Pandas][6] 这个开源库实现了大部分的数据转换和数值计算,最终得出相关的估计值。Pandas 的背后有一个强大的团队进行支持,它是在数据分析方面被广泛使用的 Python 库之一。和很多其它的开源项目一样,Pandas 团队的收入大部分来源于[用户的资金支持][7]。 -### 2. Locale.ai:Real-time COVID-19 visualization +### 2. Locale.ai:实时新冠病毒可视化 ![Locale.ai COVID-19 visualization][8] -实时显示世界各地病例数量分布的地图可以让我们直观了解 COVID-19 的规模和扩散程度。Locale.ai 就开发了这样一个开源、可交互的 [COVID-19 已知病例可视化分布图][9],这个图会根据最新的可靠数据实时进行更新。 +实时显示世界各地病例数量分布的地图可以让我们直观了解新冠病毒的规模和扩散程度。Locale.ai 就开发了这样一个开源、可交互的[新冠病毒已知病例可视化分布图][9],这个图会根据最新的可靠数据实时进行更新。 -这个项目有趣的地方在于,它的数据是是通过 GitHub 用户 ExpDev07 创建的[开源 API][10] 进行检索的,这个 API 的数据来源是[约翰·霍普金斯大学的开源数据集][11],而约翰·霍普金斯大学这份聚合了多个来源的数据集则是 GitHub 上 COVID-19 相关的最受欢迎的项目。这就是开源项领域中分支带来的一大好处。 +这个项目有趣的地方在于,它的数据是是通过 GitHub 用户 ExpDev07 创建的[开源 API][10] 进行检索的,这个 API 的数据来源是[约翰·霍普金斯大学的开源数据集][11],而约翰·霍普金斯大学这份聚合了多个来源的数据集则是 GitHub 上新冠病毒相关的最受欢迎的项目。这就是开源项领域中分支带来的一大好处。 -Locale.ai 的这个图表通过 [Vue.js][11] 开发。Vue.js 是一个在 Web 应用开发方面非常流行的框架,它是由[尤雨溪][12]创造并维护的。值得一提的是,尤雨溪是全职参与开源项目维护的少数人之一。 +Locale.ai 的这个图表通过 [Vue.js][11] 开发。Vue.js 是一个在 Web 应用开发方面非常流行的框架,它是由[尤雨溪][12]创造并维护的。值得一提的是,尤雨溪是少数以全职参与开源项目维护的人之一。 ### 3. BlankerL:DXY-COVID-19-Crawler ![BlankerL DXY-COVID-19-Crawler][13] -[DXY-COVID-19-Crawler][14] 建立于今年 1 月份,是开源社区对 COVID-19 最早发起响应的项目之一。当时 COVID-19 主要在中国范围内传播,中国医学界通过[丁香园][15]网站来进行病例的报告和跟踪。为了使这些疫情信息具有更高的可读性和易用性,GitHub 用户 BlankerL 开发了一个爬虫,系统地从丁香园网站获取数据,并通过 API 和数据仓库的方式对外公开。这些数据也被学术研究人员用于研究病毒传播趋势和制作相关的可视化图表。到目前为止,DXY-COVID-19-Crawler 这个项目已经获得了超过 1300 个星标和近 300 次的复刻。 +[DXY-COVID-19-Crawler][14] 建立于今年 1 月份,是开源社区对新冠病毒最早发起响应的项目之一。当时该病毒主要在中国范围内传播,中国医学界通过[丁香园][15]网站来进行病例的报告和跟踪。为了使这些疫情信息具有更高的可读性和易用性,GitHub 用户 BlankerL 开发了一个爬虫,系统地从丁香园网站获取数据,并通过 API 和数据仓库的方式对外公开。这些数据也被学术研究人员用于研究病毒传播趋势和制作相关的可视化图表。到目前为止,DXY-COVID-19-Crawler 这个项目已经获得了超过 1300 个星标和近 300 次的复刻。 -BlankerL 使用 Python 和 [Beautiful Soup][16] 库开发了这个爬虫。Beautiful Soup 是 Python 开发者用于从页面 HTML DOM 中提取信息的库,它由 Leonard Richardson 维护,这位作者i你另外还全职担任软件架构师。 +BlankerL 使用 Python 和 [Beautiful Soup][16] 库开发了这个爬虫。Beautiful Soup 是 Python 开发者用于从页面 HTML DOM 中提取信息的库,它由 Leonard Richardson 维护,这位作者另外还全职担任软件架构师。 -### 4. 东京 COVID-19 工作组网站 +### 4. 东京新冠病毒工作组网站 ![City of Tokyo's COVID-19 Task Force site][17] -世界各地很多城市都在网络上持续更新当地的 COVID-19 信息。东京都政府则为此创建了一个[综合性的网站][18],让东京当地居民、在东京设有办事处的公司以及到东京的游客了解最新情况,并采取相应的预防措施。 +世界各地很多城市都在网络上持续更新当地的新冠病毒信息。东京都政府则为此创建了一个[综合性的网站][18],让东京当地居民、在东京设有办事处的公司以及到东京的游客了解最新情况,并采取相应的预防措施。 这个网站的不同之处在于它是由东京都政府[开源][19]的。这个项目受到了来自 180 多名用户的贡献,日本的[长野市、千叶市、福冈市][20]还对这个网站进行了改造。这个项目是城市公共建设更好地服务大众的有力示范。 -这个开源网站也使用了很多开源技术。通过 [Tidelift][21],我留意到项目中存在了 1365 个依赖项,其中 38 个是由开发者直接使用的依赖项。也就是说,超过一千多个开源项目(包括 [Nuxt.js][22]、[Prettier][23]、[Babel][24]、[Ajv][25] 等等)都为东京向市民共享信息提供了帮助。 +这个开源网站也使用了很多开源技术。通过 [Tidelift][21],我留意到项目中存在了 1365 个依赖项,而这都是由 38 个由开发者明确使用的直接依赖项所依赖的。也就是说,超过一千多个开源项目(包括 [Nuxt.js][22]、[Prettier][23]、[Babel][24]、[Ajv][25] 等等)都为东京向市民共享信息提供了帮助。 ![Dependencies in Tokyo's COVID-19 Task Force site][26] ### 其它项目 -除此以外,还有很多[响应 COVID-19 的重要项目][27]正在公开进行当中。在这次研究中,开源社区应对流行病以及利用开源技术开展工作的方式让我深受启发。接下来的一段时间都是应对疫情的关键时期,我们也可以继续在开源社区中寻找到更大的动力。 +除此以外,还有很多[应对新冠病毒的重要项目][27]正在公开进行当中。在这次研究中,开源社区应对流行病以及利用开源技术开展工作的方式让我深受启发。接下来的一段时间都是应对疫情的关键时期,我们也可以继续在开源社区中寻找到更大的动力。 -如果你也参与到了 COVID-19 相关的开源项目当中,欢迎在评论区分享。 +如果你也参与到了新冠病毒相关的开源项目当中,欢迎在评论区分享。 -------------------------------------------------------------------------------- @@ -72,7 +73,7 @@ via: https://opensource.com/article/20/3/open-source-software-covid19 作者:[Jeff Stern][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -80,7 +81,7 @@ via: https://opensource.com/article/20/3/open-source-software-covid19 [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Medical%20costs.jpg?itok=ke57j6cs (symbols showing healthcare) [2]: https://github.com/search?q=coronavirus+OR+covid19 -[3]: https://opensource.com/article/20/3/open-hardware-covid19 +[3]: https://linux.cn/article-12047-1.html [4]: https://opensource.com/sites/default/files/uploads/chime_pennsignals.png (CHIME by PennSignals) [5]: http://penn-chime.phl.io/ [6]: https://tidelift.com/subscription/pkg/pypi-pandas From b9ca70d2fa91a9eec359da497e85009c8fd3a93e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Mar 2020 21:08:41 +0800 Subject: [PATCH 0050/1809] PUB @HankChow https://linux.cn/article-12057-1.html --- .../20200327 How open source software is fighting COVID-19.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200327 How open source software is fighting COVID-19.md (99%) diff --git a/translated/tech/20200327 How open source software is fighting COVID-19.md b/published/20200327 How open source software is fighting COVID-19.md similarity index 99% rename from translated/tech/20200327 How open source software is fighting COVID-19.md rename to published/20200327 How open source software is fighting COVID-19.md index d2553f765f..03f0b0d822 100644 --- a/translated/tech/20200327 How open source software is fighting COVID-19.md +++ b/published/20200327 How open source software is fighting COVID-19.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12057-1.html) [#]: subject: (How open source software is fighting COVID-19) [#]: via: (https://opensource.com/article/20/3/open-source-software-covid19) [#]: author: (Jeff Stern https://opensource.com/users/jeffstern) From 0bc27de72e41d0b273a962e8019ed5eb40f18de7 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Mon, 30 Mar 2020 21:38:47 +0800 Subject: [PATCH 0051/1809] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E6=9C=89=E7=96=8F?= =?UTF-8?q?=E6=BC=8F=E9=9C=80=E8=A6=81=E6=9B=B4=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20200327 How open source software is fighting COVID-19.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20200327 How open source software is fighting COVID-19.md b/published/20200327 How open source software is fighting COVID-19.md index 03f0b0d822..28429de34e 100644 --- a/published/20200327 How open source software is fighting COVID-19.md +++ b/published/20200327 How open source software is fighting COVID-19.md @@ -36,7 +36,7 @@ CHIME 主要使用 Python 开发,并通过 [Pandas][6] 这个开源库实现 实时显示世界各地病例数量分布的地图可以让我们直观了解新冠病毒的规模和扩散程度。Locale.ai 就开发了这样一个开源、可交互的[新冠病毒已知病例可视化分布图][9],这个图会根据最新的可靠数据实时进行更新。 -这个项目有趣的地方在于,它的数据是是通过 GitHub 用户 ExpDev07 创建的[开源 API][10] 进行检索的,这个 API 的数据来源是[约翰·霍普金斯大学的开源数据集][11],而约翰·霍普金斯大学这份聚合了多个来源的数据集则是 GitHub 上新冠病毒相关的最受欢迎的项目。这就是开源项领域中分支带来的一大好处。 +这个项目有趣的地方在于,它的数据是是通过 GitHub 用户 ExpDev07 创建的[开源 API][10] 进行检索的,这个 API 的数据来源是[约翰·霍普金斯大学的开源数据集][11],而约翰·霍普金斯大学这份聚合了多个来源的数据集则是 GitHub 上新冠病毒相关的最受欢迎的项目。这就是开源领域中分支带来的一大好处。 Locale.ai 的这个图表通过 [Vue.js][11] 开发。Vue.js 是一个在 Web 应用开发方面非常流行的框架,它是由[尤雨溪][12]创造并维护的。值得一提的是,尤雨溪是少数以全职参与开源项目维护的人之一。 From 7e91ded93d65eb3c42d07130ee4e3f05e70afedb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Mar 2020 00:53:10 +0800 Subject: [PATCH 0052/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200330=20Usin?= =?UTF-8?q?g=20data=20from=20spreadsheets=20in=20Fedora=20with=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200330 Using data from spreadsheets in Fedora with Python.md --- ...from spreadsheets in Fedora with Python.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20200330 Using data from spreadsheets in Fedora with Python.md diff --git a/sources/tech/20200330 Using data from spreadsheets in Fedora with Python.md b/sources/tech/20200330 Using data from spreadsheets in Fedora with Python.md new file mode 100644 index 0000000000..a32cf4165d --- /dev/null +++ b/sources/tech/20200330 Using data from spreadsheets in Fedora with Python.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using data from spreadsheets in Fedora with Python) +[#]: via: (https://fedoramagazine.org/using-data-from-spreadsheets-in-fedora-with-python/) +[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) + +Using data from spreadsheets in Fedora with Python +====== + +![][1] + +[Python][2] is one of the most popular and powerful programming languages available. Because it’s free and open source, it’s available to everyone — and most Fedora systems come with the language already installed. Python is useful for a wide variety of tasks, but among them is processing comma-separated value (**CSV**) data. CSV files often start off life as tables or spreadsheets. This article shows how to get started working with CSV data in Python 3. + +CSV data is precisely what it sounds like. A CSV file includes one row of data at a time, with data values separated by commas. Each row is defined by the same _fields_. Short CSV files are often easily read and understood. But longer data files, or those with more fields, may be harder to parse with the naked eye, so computers work better in those cases. + +Here’s a simple example where the fields are _Name_, _Email_, and _Country_. In this example, the CSV data includes a field definition as the first row, although that is not always the case. + +``` +Name,Email,Country +John Q. Smith,jqsmith@example.com,USA +Petr Novak,pnovak@example.com,CZ +Bernard Jones,bjones@example.com,UK +``` + +### Reading CSV from spreadsheets + +Python helpfully includes a _csv_ module that has functions for reading and writing CSV data. Most spreadsheet applications, both native like Excel or Numbers, and web-based such as Google Sheets, can export CSV data. In fact, many other services that can publish tabular reports will also export as CSV (PayPal for instance). + +The Python _csv_ module has a built in reader method called _DictReader_ that can deal with each data row as an ordered dictionary (OrderedDict). It expects a file object to access the CSV data. So if our file above is called _example.csv_ in the current directory, this code snippet is one way to get at this data: + +``` +f = open('example.csv', 'r') +from csv import DictReader +d = DictReader(f) +data = [] +for row in d: + data.append(row) +``` + +Now the _data_ object in memory is a list of OrderedDict objects : + +``` +[OrderedDict([('Name', 'John Q. Smith'), + ('Email', 'jqsmith@example.com'), + ('Country', 'USA')]), + OrderedDict([('Name', 'Petr Novak'), + ('Email', 'pnovak@example.com'), + ('Country', 'CZ')]), + OrderedDict([('Name', 'Bernard Jones'), + ('Email', 'bjones@example.com'), + ('Country', 'UK')])] +``` + +Referencing each of these objects is easy: + +``` +>>> print(data[0]['Country']) +USA +>>> print(data[2]['Email']) +bjones@example.com +``` + +By the way, if you have to deal with a CSV file with no header row of field names, the _DictReader_ class lets you define them. In the example above, add the _fieldnames_ argument and pass a sequence of the names: + +``` +d = DictReader(f, fieldnames=['Name', 'Email', 'Country']) +``` + +### A real world example + +I recently wanted to pick a random winner from a long list of individuals. The CSV data I pulled from spreadsheets was a simple list of names and email addresses. + +Fortunately, Python also has a helpful _random_ module good for generating random values. The _randrange_ function in the _Random_ class from that module was just what I needed. You can give it a regular range of numbers — like integers — and a step value between them. The function then generates a random result, meaning I could get a random integer (or row number!) back within the total number of rows in my data. + +So this small program worked well: + +``` +from csv import DictReader +from random import Random + +d = DictReader(open('mydata.csv')) +data = [] +for row in d: + data.append(row) + +r = Random() +winner = data[r.randrange(0, len(data), 1)] +print('The winner is:', winner['Name']) +print('Email address:', winner['Email']) +``` + +Obviously this example is extremely simple. Spreadsheets themselves include sophisticated ways to analyze data. However, if you want to do something outside the realm of your spreadsheet app, Python may be just the trick! + +* * * + +_Photo by [Isaac Smith][3] on [Unsplash][4]._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/using-data-from-spreadsheets-in-fedora-with-python/ + +作者:[Paul W. Frields][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/pfrields/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/03/spreadsheets-python-816x345.jpg +[2]: https://python.org +[3]: https://unsplash.com/@isaacmsmith?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://unsplash.com/s/photos/spreadsheets?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From b665d2a5cee413d16903244debd2c82d78867a42 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Mar 2020 00:54:06 +0800 Subject: [PATCH 0053/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200331=20Ramb?= =?UTF-8?q?ox=20is=20an=20All-in-one=20Messenger=20for=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200331 Rambox is an All-in-one Messenger for Linux.md --- ...ox is an All-in-one Messenger for Linux.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20200331 Rambox is an All-in-one Messenger for Linux.md diff --git a/sources/tech/20200331 Rambox is an All-in-one Messenger for Linux.md b/sources/tech/20200331 Rambox is an All-in-one Messenger for Linux.md new file mode 100644 index 0000000000..f70829e98f --- /dev/null +++ b/sources/tech/20200331 Rambox is an All-in-one Messenger for Linux.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Rambox is an All-in-one Messenger for Linux) +[#]: via: (https://itsfoss.com/rambox/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Rambox is an All-in-one Messenger for Linux +====== + +_**Brief: Rambox is an all-in-one messenger that lets you combine multiple services like Discord, Slack, Facebook Messenger and hundreds of more such services in one place.**_ + +### Rambox: Add multiple messaging Services in a single app + +![][1] + +Rambox is one of the best ways to manage multiple services for communication through a single app installed. You can use [multiple messaging services][2] like Facebook Messenger, Gmail chats, AOL, Discord, Google Duo, [Viber][3] and a lot more from the same interface. + +This way, you don’t need to install individual apps or keep them opened in browser all the time. You can use a master password to lock the Rambox application. You can also use do not disturb feature. + +Rambox offers an [open source community edition][4] which is free to use. The paid pro version gives you access to 600+ apps while the community addition has 99+ apps. Pro version has additional features like themes, hibernation, ad-block, spell check and premium support. + +Don’t worry. The open source community edition itself is quite useful and you may not even need those pro features. + +### Features of Rambox + +![][5] + +While you should find most of the essential features in the open-source edition, you might notice some of them limited to the pro version. + +Here, I’ve mentioned all the essential features available: + + * You get about 100 apps/services to choose from in the open-source edition + * Ability to protect the app with a single Master password lock + * Ability to lock each session that you load up + * Do Not Disturb mode + * Ability to sync apps and configuration across multiple devices. + * You can create and add custom apps + * Support for keyboard shortcuts + * Ability to enable/disable apps without needing to delete them + * JS & CSS injection support to tweak the styling of apps + * Ad-block (**pro version**) + * Hibernation support (**pro version**) + * Theme support (**pro version**) + * Mobile view **(pro version)** + * Spell check **(pro version)** + * Work hours – to schedule a time for incoming notifications **(pro version)** + * Proxies support **(pro version)** + + + +In addition to what I’ve listed here, you might find some more features in the Rambox Pro edition. To know more about it, you can refer to the [official list of features][6]. + +It is also worth noting that you cannot have more than 3 active simultaneous device connections. + +### Installing Rambox on Linux + +You can easily get started using Rambox using the **.AppImage** file available on the [official download page][4]. If you’re curious, you can refer our guide on how to [use the AppImage file on Linux][7]. + +In either case, you can also get it from the [Snap store][8]. Also, feel free to check their [GitHub releases section][9] for **.deb / .rpm** or other packages. + +[Download Rambox Community Edition][4] + +### Wrapping Up + +It can be a little overwhelming to have a lot of apps installed using Rambox. So, I’d suggest you monitor the RAM usage when adding more apps and using them for work. + +There is also a similar app called [Franz][10] which is also part open source and part premium like Rambox. + +Even though solutions like Rambox or Franz are quite useful, they aren’t always resource-friendly, specially if you start using tens of services at the same time. So, keep an eye on your system resources (if you notice a performance impact). + +Otherwise, it’s an impressive app that does the work that you’d expect. Have you tried it out? Feel free to let me know your thoughts! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/rambox/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rambox-ce.jpg?ssl=1 +[2]: https://itsfoss.com/best-messaging-apps-linux/ +[3]: https://itsfoss.com/viber-linux-client-beta-install/ +[4]: https://rambox.pro/#ce +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rambox-preferences.png?ssl=1 +[6]: https://rambox.pro/#features +[7]: https://itsfoss.com/use-appimage-linux/ +[8]: https://snapcraft.io/rambox +[9]: https://github.com/ramboxapp/community-edition/releases +[10]: https://itsfoss.com/franz-messaging-app/ From 363bd5093f2fcbe9e40bfad42ce9ebec9b32a19e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Mar 2020 00:56:02 +0800 Subject: [PATCH 0054/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200330=20Acce?= =?UTF-8?q?ss=20control=20lists=20and=20external=20drives=20on=20Linux:=20?= =?UTF-8?q?What=20you=20need=20to=20know?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200330 Access control lists and external drives on Linux- What you need to know.md --- ... drives on Linux- What you need to know.md | 233 ++++++++++++++++++ 1 file changed, 233 insertions(+) create mode 100644 sources/tech/20200330 Access control lists and external drives on Linux- What you need to know.md diff --git a/sources/tech/20200330 Access control lists and external drives on Linux- What you need to know.md b/sources/tech/20200330 Access control lists and external drives on Linux- What you need to know.md new file mode 100644 index 0000000000..079e775ce1 --- /dev/null +++ b/sources/tech/20200330 Access control lists and external drives on Linux- What you need to know.md @@ -0,0 +1,233 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Access control lists and external drives on Linux: What you need to know) +[#]: via: (https://opensource.com/article/20/3/external-drives-linux) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Access control lists and external drives on Linux: What you need to know +====== +Learn how to use external drives correctly on Linux. +![Penguin driving a car with a yellow background][1] + +While cloud storage offers many advantages, there's nothing quite like having your data on a physical hard drive. When you save data to a drive, you know exactly where your data is, and it's always available when you need it. When you save data to an external portable drive like a USB thumb drive, it's even better—not only do you know where your data is, but you can take your data with you everywhere you go. If you're new to [Linux][2], or you're trying to use a Linux file system on an external drive, you might find external drives confusing, being prone to permission errors or conflicts, or even losing metadata. + +There are two "right" answers to this: + +### ExFAT + +Formerly, ExFAT was a file system fraught with legal threats from Microsoft because they own the code. They've sued companies and organizations before to defend their ownership of FAT, so it was commonly feared that they could do the same over ExFAT. However, recently. Microsoft made the specifications for ExFAT open source. They didn't provide a driver, unfortunately, but there's an existing drive to make it function on Linux, and, now that developers have access to the full specs, improvements are inevitable. + +The advantage of ExFAT is that it's cross-platform (Windows, Mac, and many portable devices use it), and it's designed without the overhead of file permissions. You can attach a drive formatted as ExFAT to any computer, and all files are available to anyone. Whether that's good or bad depends on your use case, but for portable media, that's often exactly the intent. + +### Access control lists (ACL) + +If you prefer to use a Linux file system on your portable drive, then you can do that, but to make sharing files seamless, you should use access control lists (ACL). + +When you create a file or directory on a drive, there are defaults on your system determining what file permissions it gets. For most cases, those defaults make sense—when you create a file in your home directory, you probably don't want other users to have access to that file. However, when you're creating a file on an external drive, there's a high likelihood that it's because you need to share that file with someone else (even if that someone is you on another computer). + +You can override default permissions for file viewing with an ACL, and you can control default file creation mode by setting a sticky bit. An ACL is a layer of security policies in the extended attributes of directories and files. It allows you to specify exceptions to what the file system permissions indicate. Most notably, this allows you to transcend the single-owner and single-group model of traditional UNIX permissions. + +For instance, while the **seth** (ID 1000) account might own a directory created on my desktop, **seth** (ID 500) on my laptop does not, because the user IDs are different. + +The same could be true for a group. If a directory with group ID 1000 is assigned to a directory on one computer, then a group with an ID 500 or 10922 doesn't have access to it on another computer. But an ACL can add secondary owners and groups to directories and files. + +#### View the current ACL + +Any directory and file on any common Linux filesystem has ACL rules by default. They're stored in extended attributes, a kind of metadata that you don't normally see. + +You can view them in the terminal: + + +``` +$ getfacl ./example +# file: /run/media/drive/example +# owner: seth +# group: users +user::rwx +group::rwx +other::r-- +``` + +The commented lines are just for your reference; they tell you the path, and the owner and group, of the file or directory you're viewing information about. The next lines display the rules applied to the file or directory. In this example, the user permissions are set to **rwx**, the group to **r-x**, and other to **r-x**. These permissions are reflected by a normal filesystem list: + + +``` +$ ls -lA /run/media/drive +drwxrwxr-- 26 seth users 4096 Jan 16 21:04 example +$ id +uid=1000(seth) gid=100(users) groups=100(users)... +``` + +As long as user **seth** (UID 1000) or a member of **group** (GID 100) interacts with the **example** directory, full access is granted. Any other account, however, has only read (**r**) permission. + +#### Setting an ACL + +To modify an ACL, you use the **setfacl** command or use a file manager with ACL support. You can be very specific or very generic when setting your ACL. + +To just modify the filesystem permission settings, you can use either **chmod** or **setfacl**. This is a very generic ACL setting because you're not adding anything to the permissions already available to UNIX from the filesystem specification. + + +``` +$ setfacl --modify g::r example +$ getfacl ./example | grep "group::" +group::r-- +$ ls -l . | grep example +drwxr--r-- 26 seth users 4096 Jan 16 21:04 example +``` + +The same effect is available through **chmod**: + + +``` +$ chmod g+x example +$ getfacl ./example | grep "group::" +group::r-x +$ ls -l . | grep example +drwxr-xr-- 26 seth users 4096 Jan 16 21:04 example +``` + +#### Adding users and groups + +To really benefit from an ACL is to use it for permissions outside the scope of native UNIX permissions. If I'm logged into my desktop as **seth** with user ID 1000, and I know that a directory on my portable drive needs to be usable by **seth** with ID 500 on my laptop, then just declaring **seth** as owner isn't enough because the user IDs aren't the same. + +You can add a user or user ID to an access control list: + + +``` +$ setfacl --modify u:500:rwx example +$ getfacl example +# file: /run/media/drive/example +# owner: seth +# group: users +user::rwx +user:500:rwx +[...] +``` + +A new entry, specific to user ID 500, has been added to the list. Attaching the drive to another Linux or UNIX computer now allows the user with ID 500 to access the **example** folder. + +You can also add users by account name, or groups by either group name or group ID. The IDs are what really count with permissions, though, so if you're in a mixed environment (RHEL servers and Elementary clients, for example), you should verify the user IDs and group IDs lurking behind accounts that seem, on the surface, identical. + +#### Setting default ACL rules + +If you treat access control as a one-time setting, you'll quickly run into problems once your different user accounts start creating files and directories. Any new file or directory created by each user inherits the system's default permissions (and ACL). This means that once laptop user **seth** with ID 500 creates a file in a directory, it could be off-limits to desktop user **seth** with ID 1000 because the owner of the file is set to UID 500. + +A default ACL can be applied to directories so that files and subdirectories created within them inherit the parent ACL. You can set the default ACL of a directory with the **–default** option: + + +``` +$ setfacl --default --modify u:500:rwx example +$ setfacl --default --modify u:1000:rwx example +$ getfacl --omit-header example +user::rwx +user:500:rwx +group::rw- +mask::rwx +other::r-x +default:user::rwx +default:group::rw- +default:group:500:rwx +default:group:1000:rwx +default😷:rwx +default:other::r-x +``` + +When a user creates a new directory within the **example** directory, the inherited ACL is the same as its parent: + + +``` +$ cd example +$ mkdir penguins +$ getfacl --omit-header penguins +user::rwx +group::rw- +group:500:rwx +group:1000:rwx +mask::rwx +other::r-x +default:user::rwx +default:group::rw- +default:group:500:rwx +default:group:1000:rwx +default😷:rwx +default:other::r-x +``` + +This means that any directory or file created inherits the same ACL, so neither user 500 or 1000 are ever excluded from access. + +#### Pragmatic ACL for external drives + +When using a Linux filesystem for external drives, the easy method of ensuring it works with all the users who expect to use the portable drive is to set an ACL on a single top-level directory. + +For instance, assume you have formatted a USB drive called **mydrive** as an ext4 filesystem. You want your account on your laptop and your desktop, as well as your colleague Alice, to be able to access the files. + +First, create a directory at the top level of the drive: + + +``` +$ mkdir /mnt/mydrive/umbrella +``` + +Then apply an ACL to the top-level directory to grant all-important users access: + + +``` +$ setfacl --modify \ +  u:500:rwx,u:1000:rwx,u:alice:rwx \ +  /mnt/mydrive/umbrella +``` + +Finally, apply a default ACL so that all directories and files created within the top-level directory **umbrella** inherit the same default ACL (note that this command uses the short version of **–modify**): + + +``` +$ setfacl --default -m u:500:rwx,u:1000:rwx,u:alice:rwx \ +  /mnt/mydrive/umbrella +``` + +#### Applying defaults to an existing system + +If you need to apply ACL settings to many files that already exist, you can accomplish that with the **find** command. + +First, find all directories and apply ACL rules: + + +``` +$ find /mnt/mydrive/umbrella -type d | \ +  parallel --max-args=6 setfacl \ +  --default -m u:500:rwx,u:1000:rwx,u:alice:rwx +``` + +It's not wise to indiscriminately set all file permissions to executable, so next, find all files and set permissions to **re**. Files that require an executable bit can be set manually or by file extension: + + +``` +$ find /mnt/mydrive/umbrella -type f | \ +  parallel --max-args=6 setfacl \ +  --default -m u:500:rw,u:1000:rw,u:alice:rw +``` + +Adjust the logic of these commands to suit your individual need (don't run a command that removes the executable bit on **/usr**, for instance, or on a directory containing nothing but executable programs). + +### External drives + +Don't let confusion around external drives on Linux get the best of you, and don't limit yourself to traditional UNIX permissions. Put access control lists to work for you, and feel free to use native journaled Linux filesystems on your portable drives. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/external-drives-linux + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) +[2]: https://opensource.com/resources/linux From cd5c51b6f9995484634f3a2f87704adda863a0c7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Mar 2020 00:56:32 +0800 Subject: [PATCH 0055/1809] add done: 20200330 Access control lists and external drives on Linux- What you need to know.md --- ...200330 Why I switched from Mac to Linux.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20200330 Why I switched from Mac to Linux.md diff --git a/sources/tech/20200330 Why I switched from Mac to Linux.md b/sources/tech/20200330 Why I switched from Mac to Linux.md new file mode 100644 index 0000000000..95561b6b45 --- /dev/null +++ b/sources/tech/20200330 Why I switched from Mac to Linux.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why I switched from Mac to Linux) +[#]: via: (https://opensource.com/article/20/3/mac-linux) +[#]: author: (Lee Tusman https://opensource.com/users/leeto) + +Why I switched from Mac to Linux +====== +After 25 years, Lee made the switch to Linux and couldn't be happier. +Here's what he uses. +![Code going into a computer.][1] + +In 1994, my family bought a Macintosh Performa 475 as a home computer. I had used Macintosh SE computers in school and learned to type with [Mavis Beacon Teaches Typing][2], so I've been a Mac user for well over 25 years. Back in the mid-1990s, I was attracted to its ease of use. It didn't start with a DOS command prompt; it opened to a friendly desktop. It was playful. And even though there was a lot less software for Macintosh than PCs, I thought the Mac ecosystem was better, just on the strength of KidPix and Hypercard, which I still think of as the unsurpassed, most intuitive _creative stack_. + +Even so, I still had the feeling that Mac was an underdog compared to Windows. I remember thinking the company could disappear one day. Flash-forward decades later, and Apple is a behemoth, a trillion-dollar company. But as it evolved, it changed significantly. Some changes have been for the better, such as better stabilization, simpler hardware choices, increased security, and more accessibility options. Other changes annoyed me—not all at once, but slowly. Most significantly, I am annoyed by Apple's closed ecosystem—the difficulty of accessing photos without iPhoto; the necessity of using iTunes; and the enforced bundling of the Apple store ecosystem even when I don't want to use it. + +Over time, I found myself working largely in the terminal. I used iTerm2 and the [Homebrew][3] package manager. I couldn't get all my Linux software to work, but much of it did. I thought I had the best of both worlds: the macOS graphical operating system and user interface alongside the ability to jump into a quick terminal session. + +Later, I began using Raspberry Pi computers booting Raspbian. I also collected a number of very old laptops rescued from the trash at universities, so, by necessity, I decided to try out various Linux distros. While none of them became my main machine, I started to really enjoy using Linux. I began to consider what it would be like to try running a Linux distro as my daily driver, but I thought the Macbook's comfort and ease, especially the hardware's size and weight, would be hard to find in a non-Mac laptop. + +## Time to make the switch? + +About two years ago, I began using a Dell for work. It was a larger laptop with an integrated GPU, and dual-booted Linux and Windows. I used it for game development, 3D modeling, some machine learning, and basic programming in C# and Java. I considered making it my primary machine, but I loved the portability of my Macbook Air, and continued to use that as well. + +Last fall, I started to notice my Air was running hot, and the fan was coming on more often. My primary machine was starting to show its age. For years, I used the Mac's terminal to access Darwin's Unix-like operating system, and I was spending more and more time bouncing between the terminal and my web browser. Was it time to make the switch? + +I began exploring the possibilities for a Macbook-like Linux laptop. After doing some research, reading reviews and message boards, I went with the long-celebrated Dell XPS 13 Developer Edition 7390, opting for the 10th Generation i7. I chose it because I love the feel of the Macbook (and especially the slim Macbook Air), and reviews of the XPS 13 suggested it seemed it was similar, with really positive reviews of the trackpad and keyboard. + +Most importantly, it came loaded with Ubuntu. While it's easy enough to get a PC, wipe it, and install a new Linux distro, I was attracted to the cohesive operating system and hardware, but one that allowed a lot of the customization we know and love in Linux. So when there was a sale, I took the plunge and purchased it. + +## What it's like to run Linux daily + +I've been using the XPS 13 for three months and my dual-booted Linux work laptop for two years. At first, I thought I'd want to spend more time finding an alternate desktop environment or window manager that was more Mac-like, such as [Enlightenment][4]. I tried several, but I have to say, I like the simplicity of running [GNOME][5] out of the box. For one thing, it's minimal; there's not much GUI to get caught up in. In fact, it's intuitive and the [overview][6] takes only a couple minutes to read.  + +I can access my applications through the application dash bar or a grid button to get to the application view. To access my file system, I click on the **Files** icon in the dash. To open the GNOME terminal, I type **Ctrl+Alt+T** or just **Alt+Tab** to switch between an open application and an open terminal. It's also easy to define your own [custom hotkey shortcuts][7]. + +Beyond this, there's not much else to say. Unlike the Mac's desktop, there's not a lot to get lost in, which means there's less to distract me from my work or the applications I want to run. I didn't realize all the options or how much time I spent navigating windows on my Mac. In Linux, there are just files, applications, and the terminal. + +I installed the [i3 tiling window manager][8] to do a test run. I had a few issues configuring it because I type in [Dvorak][9], and i3 doesn't adapt to the alternate keyboard configuration. I think with more effort, I could figure out a new keyboard mapping in i3, but the main thing I was looking for was simple tiling. + +I looked up GNOME's tiling capabilities and was pleasantly surprised. You press the **Super** key (for me, it's the key with the Windows logo—which I should cover with a sticker!) and then a modifier key. For example, pressing **Super+Left** moves your current window to a tile on the left side of the screen. **Super+Right** moves to the right half. **Super+Up** maximizes the current window. **Super+Down** reverts to the previous size. You can move between app windows with **Alt+Tab**. This is all default behavior and can be customized in the Keyboard settings. + +Plugging in headphones or connecting to HDMI works the way you expect. Sometimes, I open the Sound settings to switch between the HDMI sound output or my external audio cable, just as I would on a Mac or PC. The trackpad is responsive, and I haven't noticed any difference from the Macbook's. When I plug in a three-button mouse, it works instantly, even with my Bluetooth mouse and keyboard. + +### Software + +I installed Atom, VLC, Keybase, Brave Browser, Krita, Blender, and Thunderbird in a matter of minutes. I installed other software with the Apt package manager in the terminal (as normal), which offers many more packages than the Homebrew package manager for macOS. + +### Music + +I have a variety of options for listening to music. I use Spotify and [PyRadio][10] to stream music. [Rhythmbox][11] is installed by default on Ubuntu; the simple music player launches instantly and without any bloat. Simply click on the menu, choose **Add Music**, and navigate to a directory of audio tracks (it searches recursively). You can also stream podcasts or online radio easily. + +### Text and PDFs + +I tend to write in Markdown in [Neovim][12] with some plugins, then convert my document using Pandoc to whatever final format is needed. For a nice Markdown editor with preview, I downloaded [Ghostwriter][13], a minimal-focus writing application. + +If someone sends me a Microsoft Word document, I can open it using the default LibreOffice Writer application. + +Occasionally, I have to sign a document. This is easy with macOS's Preview application and my signature in PNG format, and I needed a Linux equivalent. I found that the default PDF viewer app didn't have the annotation tools I needed. The LibreOffice Draw program was acceptable but not particularly easy to use, and it occasionally crashed. Based on some research, I installed [Xournal][14], which has the simple annotation tools I need to add dates, text, and my signature and is fairly comparable to Mac's Preview app. It works exactly as needed. + +### Importing images from my phone + +I have an iPhone. To get my images off the phone, there are a number of methods to sync and access your files. If you have a different phone, your process may be different. Here's my method: + + 1. Install gvfs-backends with **sudo apt install gvfs-backends**, which is part of the GNO \ No newline at end of file From 7159a7d62cb510c9fd1fb6be2486dc974a9f2577 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Mar 2020 01:01:44 +0800 Subject: [PATCH 0056/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200330=20SASE?= =?UTF-8?q?=20might=20be=20better=20than=20VPNs=20for=20quickly=20ramping?= =?UTF-8?q?=20up=20remote=20access?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200330 SASE might be better than VPNs for quickly ramping up remote access.md --- ...Ns for quickly ramping up remote access.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/talk/20200330 SASE might be better than VPNs for quickly ramping up remote access.md diff --git a/sources/talk/20200330 SASE might be better than VPNs for quickly ramping up remote access.md b/sources/talk/20200330 SASE might be better than VPNs for quickly ramping up remote access.md new file mode 100644 index 0000000000..10f3abab83 --- /dev/null +++ b/sources/talk/20200330 SASE might be better than VPNs for quickly ramping up remote access.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (SASE might be better than VPNs for quickly ramping up remote access) +[#]: via: (https://www.networkworld.com/article/3534501/sase-might-be-better-than-vpns-for-quickly-ramping-up-remote-access.html) +[#]: author: (Linda Musthaler https://www.networkworld.com/author/Linda-Musthaler/) + +SASE might be better than VPNs for quickly ramping up remote access +====== +A secure access service edge model can quickly grow remote-worker capacity without requiring enterprises to deploy their own new VPN gear. +Getty Images + +The global pandemic now hitting almost every corner of the world is forcing countless millions of people to work from home. In one sense, we’re fortunate to now have the technology that allows us to do that. Between broadband Internet access in the home, corporate VPNs, team workspaces and videoconferencing services, many people can continue to do their jobs as effectively as if they were in their regular office environment. + +That doesn’t mean it’s all smooth sailing for the IT departments that have to enable and support those critical work-from-home services. Depending on the type of network architecture a company has, it can be relatively easy or significantly challenging to support tens of thousands of employees now suddenly working from home. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] + +I recently talked with Mark Casey, CEO of the network infrastructure services provider [Apcela][2], who conveyed the challenges that many large enterprises have. It’s these companies that typically still have a traditional hub-and-spoke kind of WAN anchored in a physical data center. Corporate traffic is backhauled from branch and remote locations (like workers’ homes) to a centralized [data center][3] to pass through a security stack before it is sent to the internet or to cloud services. Unfortunately, this legacy network architecture doesn’t adapt well to the dramatically different traffic patterns resulting from a massive surge in telework. + +When you look at the [VPN][4] architecture in this environment, it’s largely dominated by Cisco with its AnyConnect solution that pairs with the vendor’s ASA [firewall][5] products. Countless large enterprises have these hardware appliances in their on-premises data centers. Whether it’s Cisco equipment or some other vendor’s, the VPN/firewall combination is a real workhorse under normal conditions, but the vast increase in remote workers is causing a strain. + +**VPN capacity is strained** + +A home-based worker brings up a VPN connection that creates a secure tunnel to take him straight into the data center. This might be fine when the company expects 10% to 20% of its employees to work remotely at any given time, but now the numbers might approach 50% or 70%. This creates contention for resources and a poor VPN experience for all. What’s more, workers are routing a bunch of internet traffic to the data center along with traffic destined for on-premise applications like [Microsoft Office 365][6]. This is the landscape that Casey sees every day as he engages with large enterprise organizations. + +“We’ve talked to a number of companies recently that say they need to expand their VPN capacity but the legacy network architecture is holding them back. [Cisco][7], Palo Alto and others are offering free VPN client licenses but the enterprises still need to expand the VPN terminating appliances. It’s hard to quickly scale capacity in this environment,” says Casey. “Whether it’s coronavirus or some other catalyst that puts stress on the legacy network environment, we advocate that enterprises should diversify and shift portions of their network architecture to the cloud. This will give them much more flexibility to provide security and remote access services to their workforce in the long run.” + +[][8] + +**SASE for flexibility and capacity on demand** + +Casey points to the [Secure Access Service Edge][9] (SASE, pronounced “sassy”) framework as a model for re-architecting the enterprise network. SASE is Gartner’s name for a combination of [SD-WAN][10] capabilities with a number of security services that are primarily delivered through a cloud-based delivery model. + +Gartner defines the service edge as an offering that supports the access needs of digital enterprises by combining SD-WAN functions with network security services such as secure web gateway (SWG), cloud access security broker (CASB), and cloud-based firewall. In short, a SASE offering helps simplify network management by offering highly customizable policy-based control that can be tailored by user identity, session context, and application needs for performance and security – and it’s delivered from the cloud.  + +Casey explains the concept of a service edge with a geographical example. “Suppose an employee is VPNing into his corporate network from his New York area home, and the data center happens to be in Chicago. Ordinarily the traffic would all be directed to Chicago, but if he’s accessing internet content, it would be optimal to egress that traffic via secure web gateway much more locally to where the user is. It’s better to go to a site in New York where the VPN terminates on a local firewall, and there’s a secure web gateway there so the Internet traffic can be offloaded there instead of backhauling it to Chicago. This site in New York is called the service edge.” + +Casey continues his explanation: “A virtualized version of a company’s firewall sits in the hub. The VPN terminates on the VPN concentrator in the local hub and then the traffic is routed appropriately. That traffic going to the internet goes out through secure web gateway and that traffic that's destined for an application in the data center goes over a private network inside the security parameters. This is essentially another tunnel back to the data center. And that's a great use case for this whole concept of SASE, which is to lift some of your core security components and move them out to the cloud.” + +With the word cloud, people tend to think of AWS or Azure or Google Cloud Platform, but Casey gives cloud a broader definition. “Cloud is Software as a Service, like Salesforce and ServiceNow,” says Casey. “If you’re an enterprise, cloud is an Equinix data center. Cloud is anything that’s not you, and it’s delivered as a service.” + +**The service edge is a powerful hub** + +In Apcela’s parlance, a service edge is called an application hub, or AppHub. Other companies call them communication hubs, cloud hubs, or simply Points of Presence (PoPs). Regardless of the name, the concept is the same. + +These hubs consist of racks of switching and routing equipment that are typically deployed in carrier-neutral co-location centers. Then these data centers are interconnected with high-capacity, low-latency circuits that create a high-performance core network. SD-WAN, VPN and security stacks are typically deployed in the hubs. At the edge of this network, an enterprise can directly connect its own data centers, branch offices, remote and mobile users, and even third-party partners. The leading SASE providers have built hubs, or PoPs, around the world so that organizations and their workers can connect to the closest hub to obtain the communication and security services they need. Each enterprise chooses what services it wants to utilize. + +When considering how to deploy security as a virtual service, Casey says, “You don't necessarily want to put all the security in AWS because then it will work great with AWS, but it won't work for GCP or Azure, and it certainly won't help you for your SaaS applications. So having this hub environment that sits between the application clouds – Salesforce, Office 365, Workday, etc. – and the users and enterprise locations is the perfect location to put these security services. And because the hubs are essentially an Infrastructure as a Service, you're not stuck with having to move to some proprietary cloud-based platform.” + +SASE infrastructure is essentially on demand, so it’s fairly easy for new customers to adopt it. “It’s not complicated,” says Casey. “We have to find a place, somewhere in the world, and cross connect back into an enterprise’s infrastructure to deliver private connectivity. But it's all very cloud-like. It takes the agility of cloud and the speed of cloud and enables you to act quickly.” + +**SASE has VPN capacity pre-built** + +The SASE model allows companies to expand their VPN platforms easily because the capability is all pre-built. Once the service is turned on, the company is well positioned to support thousands of new home-based workers. + +I asked Casey about a realistic timeframe for companies that are new to the SASE approach before they can expect to be up and running with expanded VPN capacity. “I can only speak to the solution Apcela offers, of course, but I’d say it’s a matter of days to weeks, but certainly not months,” he says. “In our case, it depends on their security platform because we leverage virtualized network functions on the security side, so the whole concept of procuring and shipping equipment goes away.” Other vendors might do the deployment in different ways. + +Contrast this approach to the legacy model of installing new hardware in a data center to provide more capacity. By the time the company orders the hardware, gets it shipped to the data center, and then installed and configured, two or three months might pass. + +Another benefit of the SASE framework is that traffic travels over a private core network rather than the public Internet. “The Internet shouldn’t become your new [WAN][11] – certainly not for business and mission-critical platforms. You need a specialized sort of [MPLS][12]-like network for your cloud apps, which is what a SASE platform does,” says Casey. “Traffic is taken off the Internet at the secure edge, put onto a private secure network and routed directly to the appropriate SaaS or IaaS platform data center.” + +Having a private core network is especially important at this time because the public Internet is under great strain due to the traffic and content pattern shifts now that so many people are staying home or working from home. The [strain is so bad][13] that companies like Facebook and Netflix have been asked by the European Commissioner for internal market and services to throttle their services to consume less bandwidth. As Casey says, “You don’t want your corporate traffic to compete for bandwidth against Netflix and all these different videoconferencing services.” + +If your organization is struggling with ramping up work-from-home capacity in a hurry, consider how a SASE service might help you. + +Join the Network World communities on [Facebook][14] and [LinkedIn][15] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3534501/sase-might-be-better-than-vpns-for-quickly-ramping-up-remote-access.html + +作者:[Linda Musthaler][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Linda-Musthaler/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: https://www.apcela.com/ +[3]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[4]: https://www.networkworld.com/article/3268744/understanding-virtual-private-networks-and-why-vpns-are-important-to-sd-wan.html +[5]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html +[6]: https://techcommunity.microsoft.com/t5/office-365-blog/how-to-quickly-optimize-office-365-traffic-for-remote-staff-amp/ba-p/1214571; +[7]: https://blogs.cisco.com/security/cisco-expands-free-security-offerings-to-help-with-rise-in-remote-workers +[8]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[9]: https://www.networkworld.com/article/3516503/it-pros-need-to-weigh-in-on-that-sassy-security-model.html +[10]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[11]: https://www.networkworld.com/article/3248989/what-is-a-wan-wide-area-network-definition-and-examples.html +[12]: https://www.networkworld.com/article/2297171/network-security-mpls-explained.html +[13]: https://mashable.com/article/eu-netflix-standard-definition-coronavirus/ +[14]: https://www.facebook.com/NetworkWorld/ +[15]: https://www.linkedin.com/company/network-world From 2e820584744ef71c158d3a0e7fb6dc1313f6d01b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Mar 2020 01:02:28 +0800 Subject: [PATCH 0057/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200330=20Know?= =?UTF-8?q?=20the=20benefits=20of=20cloud-native=20networking=20for=20SASE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200330 Know the benefits of cloud-native networking for SASE.md --- ...its of cloud-native networking for SASE.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/talk/20200330 Know the benefits of cloud-native networking for SASE.md diff --git a/sources/talk/20200330 Know the benefits of cloud-native networking for SASE.md b/sources/talk/20200330 Know the benefits of cloud-native networking for SASE.md new file mode 100644 index 0000000000..e4c38f352e --- /dev/null +++ b/sources/talk/20200330 Know the benefits of cloud-native networking for SASE.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Know the benefits of cloud-native networking for SASE) +[#]: via: (https://www.networkworld.com/article/3534720/know-the-benefits-of-cloud-native-networking-for-sase.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +Know the benefits of cloud-native networking for SASE +====== +Shlomo Kramer, CEO of Cato Networks discusses the benefits cloud-native networking brings to SASE +Metamorworks / Getty Images + +Gartner has positioned secure access service edge (SASE) as the next wave of SD-WANs. While most industry people I talk to agree on the concept of security and networking being brought together, there is some debate surrounding cloud-native versus cloud-managed. + +To get a better understanding of why cloud native matters, I sat down with Shlomo Kramer, CEO of Cato Networks, which designed its SASE service from the ground up for cloud delivery. + +**Last year Gartner coined the term SASE, do you agree or disagree with their premise?** + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] + +Well I definitely agree.  The manifesto that Cato was founded on was the vision of converging network transport and network security and delivering it as a cloud service. The argument as to why you need SASE is topological in nature because traffic patterns have changed. Network traffic used to be inward bound because people sat at their desks, using corporate workstations and connecting to enterprise applications that resided in the company data centers. + +That meant security was effectively a hard shell placed around a soft core.  Security was applied at the edge and protected all the physical locations behind it. Today, the traffic patterns have changed, and the security needs to be applied everywhere.  Applications are built in AWS as well as on-premises, workers are in the office, at home and in the hotel or anywhere.  So now corporate assets are everywhere so the hard shell no longer works.  Security needs to be different and be integrated everywhere so I absolutely agree with the concept of SASE. + +**What are some other challenges with legacy technologies like MPLS and security appliances?** + +**T**he problems with MPLS are well documented, so I won’t spend too much time on this topic other than say every company we talk to wants to move off of MPLS because of high costs, long deployment times and a lack of agility.  MPLS does nothing for mobile users or cloud connectivity so organizations need to deploy VPN servers, cloud interconnects and other technologies to connect all of their company resources. + +[][2] + +On the security side, branch appliances have been an enormous problem that we as an industry accepted as the only possible solution.  Appliances need to be procured, deployed, maintained, upgraded and retired. All of which takes time and effort. They need to be integrated with one another, which requires more time and skills. Most appliances are managed from separate management consoles making operations complex and challenging.  Over time, more appliances are added, which raises the complexity level.  Also, when traffic jumps or too many features are turned on, upgrades are often required outside budget cycles.  Security professionals often lag behind when applying software patches because updating appliances is risky and needs to be carefully planned, leaving the company at risk. + +I can go on, but _appliances_ as an architecture involve too many headaches and too much cost for companies looking to become leaner and more agile. And by appliances, I also mean VNFs and virtual appliances. It's the same story again. You still need to deploy, manage and scale them. Appliances are a poor choice not because of anyone's solution's limitations but because of the architecture itself. + +**What benefit do cloud-native platforms provide?** + +For Gur (Co-Founder of Cato, Gur Shatz) and myself, who came from the security and networking worlds, we were well acquainted with these problems. As we thought about what the right architecture would be moving forward, the cloud seemed like the obvious choice. We had already seen how cloud computing changed markets for data centers, servers, storage, and applications. We thought the cloud could do the same for security and networking.  + +Like AWS for data centers and servers, we wanted to create a utility that would secure and network the complete enterprise, not just sites, but also remote users, cloud data centers, cloud applications, and third-party devices. We wanted enterprises to "tap" into this utility and instantly receive all the advanced security and networking services for the entire organization. It's why we called our SD-WAN device the "Cato Socket," like an electrical socket you plug into. This vision is in line with the SASE definition. + +Instead of appliances, we move the “heavy lifting” involved in security and networking into a global, distributed, cloud-native software platform. By cloud-native software, we mean several things.  We actually wrote a [blog on this topic][3] that talks about the value of cloud-native.  There are many benefits but in particular, multi-tenancy is game-changing. This allows cloud providers to amortize costs across their customer base, allowing them to deliver offerings at a price point unmatched by one based on purchasing appliances for customers.  + +This platform runs our single-pass, security and networking stack that performs all security inspections in parallel. A packet comes in, depacketized and decrypted by our software that then performs all the necessary security inspections in parallel before sending the packet on.  This is an incredible change from the way appliances work today. Today, each appliance must depacketize and decrypt packets, run a deep packet inspection (DPI) engine to understand the packet, apply the specific security inspections, and repacketize and re-encrypt for the next appliance to do the same.   + +**You’ve also stated that a global private network is necessary, why is that?** + +As for the network, enterprises require predictable, low latency performance everywhere all the time. That's simply not possible with Internet routing today when broadband is used. While the problems of unpredictable latency across global routes or in under-developed Internet regions is well known even within Internet regions, we've seen specific routes have problems.   + +How do you overcome latency AND the global connectivity costs of MPLS? Our answer was to leverage the massive build-out in global IP connectivity. By buying massive wholesale SLA-backed capacity across multiple IP backbones, and then dynamically selecting the best backbone at each hop across our network, we could deliver global, low-latency connections at a fraction of the cost of MPLS.    + +**The SASE industry is currently filled with start-ups and smaller vendors.  Why are the big incumbents struggling to make this shift?** + +** ** + +I think it should be evident by now, but existing appliance-based solutions simply can't be converted to become cloud-native. Re-engineering a platform for the cloud requires massive investments in R&D, which will come at the expense of existing and very successful product lines, so beyond engineering, there is also an internal conflict to overcome.    + +And that's why the "big incumbents," as you put it, are so threatened by SASE. We all recognize that SASE is the future, but to get that to that future, many of the established solution providers will need to disrupt their existing businesses. That's not easy to do, but what they can do is market.  + +We, as an industry, are seeing vendors trying to capitalize on SASE by rebranding their solutions as SASE offerings. Some are appliances without cloud capabilities; others are security services without networking capabilities. For IT to tell the difference between a true SASE platform and a "fake" one, the litmus test is simple: If the center of gravity is in the appliances. If the offer lacks SD-WAN and if there is more than one management console. It's not SASE, and it's not the future. It's a repackaging of the past.   + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3534720/know-the-benefits-of-cloud-native-networking-for-sase.html + +作者:[Zeus Kerravala][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Zeus-Kerravala/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[3]: https://www.catonetworks.com/blog/the-cloud-native-network-what-it-means-and-why-it-matters/ +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From c121b397c0a6f4bf088594c5aa4247541d45a8e2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Mar 2020 03:50:19 +0800 Subject: [PATCH 0058/1809] Revert "translating" This reverts commit 627e8617369fe7b7eafc72c2bb964f9603451574. --- .../20190702 One CI-CD pipeline per product to rule them all.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190702 One CI-CD pipeline per product to rule them all.md b/sources/tech/20190702 One CI-CD pipeline per product to rule them all.md index 0fd04ee54a..2a7fcb31de 100644 --- a/sources/tech/20190702 One CI-CD pipeline per product to rule them all.md +++ b/sources/tech/20190702 One CI-CD pipeline per product to rule them all.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (hj24) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 73f97bac4f1fe511917e02b8622727c08fc620c4 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 31 Mar 2020 08:23:39 +0800 Subject: [PATCH 0059/1809] translated --- ...309 Fish - A Friendly Interactive Shell.md | 194 ------------------ ...309 Fish - A Friendly Interactive Shell.md | 194 ++++++++++++++++++ 2 files changed, 194 insertions(+), 194 deletions(-) delete mode 100644 sources/tech/20200309 Fish - A Friendly Interactive Shell.md create mode 100644 translated/tech/20200309 Fish - A Friendly Interactive Shell.md diff --git a/sources/tech/20200309 Fish - A Friendly Interactive Shell.md b/sources/tech/20200309 Fish - A Friendly Interactive Shell.md deleted file mode 100644 index b091fea171..0000000000 --- a/sources/tech/20200309 Fish - A Friendly Interactive Shell.md +++ /dev/null @@ -1,194 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Fish – A Friendly Interactive Shell) -[#]: via: (https://fedoramagazine.org/fish-a-friendly-interactive-shell/) -[#]: author: (Michal Konečný https://fedoramagazine.org/author/zlopez/) - -Fish – A Friendly Interactive Shell -====== - -![Fish — A Friendly Interactive Shell][1] - -Are you looking for an alternative to bash? Are you looking for something more user-friendly? Then look no further because you just found the golden fish! - -Fish (friendly interactive shell) is a smart and user-friendly command line shell that works on Linux, MacOS, and other operating systems. Use it for everyday work in your terminal and for scripting. Scripts written in fish are less cryptic than their equivalent bash versions. - -### Fish’s user-friendly features - - * **Suggestions** -Fish will suggest commands that you have written before. This boosts productivity when typing same commands often. - * **Sane scripting** -Fish avoids using cryptic characters. This provides a clearer and friendlier syntax. - * **Completion based on man pages** -Fish will autocomplete parameters based on the the command’s man page. - * **Syntax highlighting** -Fish will highlight command syntax to make it visually friendly. - - - -### Installation - -#### Fedora Workstation - -Use the _dnf_ command to install fish: - -``` -$ sudo dnf install fish -``` - -Make fish your default shell by installing the _util-linux-user_ package and then running the _chsh_ (change shell) command with the appropriate parameters: - -``` -$ sudo dnf install util-linux-user -$ chsh -s /usr/bin/fish -``` - -You will need to log out and back in for this change to take effect. - -#### Fedora Silverblue - -Because this is not GUI application, you will need to layer it using _rpm-ostree_. Use the following command to install fish on Fedora Silverblue: - -``` -$ rpm-ostree install fish -``` - -On Fedora Silverblue you will need to reboot your PC to switch to the new ostree image. - -If you want to make fish your main shell on Fedora Silverblue, the easiest way is to update the _/etc/passwd_ file. Find your user and change _/bin/bash_ to _/usr/bin/fish_. - -You will need [root privileges][2] to edit the _/etc/passwd_ file. Also you will need to log out and back in for this change to take effect. - -### Configuration - -The per-user configuration file for fish is _~/.config/fish/config.fish_. To make configuration changes for all users, edit _/etc/fish/config.fish_ instead. - -The per-user configuration file must be created manually. The installation scripts will not create _~/.config/fish/config.fish_. - -Here are a couple configuration examples shown alongside their bash equivalents to get you started: - -#### Creating aliases - - * _~/.bashrc_: alias ll='ls -lh' - * _~/.config/fish/config.fish_: alias ll='ls -lh' - - - -#### Setting environment variables - - * _~/.bashrc_: export PATH=$PATH:~/bin - * _~/.config/fish/config.fish_: set -gx PATH $PATH ~/bin - - - -### Working with fish - -When fish is configured as your default shell, the command prompt will look similar to what is shown in the below image. If you haven’t configured fish to be your default shell, just run the _fish_ command to start it in your current terminal session. - -![][3] - -As you start typing commands, you will notice the syntax highlighting: - -![][4] - -Cool, isn’t it? 🙂 - -You will also see commands being suggested as you type. For example, start typing the previous command a second time: - -![][5] - -Notice the gray text that appears as you type. The gray text is fish suggesting the command you wrote before. To autocomplete it, just press **CTRL+F**. - -Get argument suggestions based on the preceding command’s man page by typing a dash (**–**) and then the **TAB** key: - -![][6] - -If you press **TAB** once, it will show you the first few suggestions (or every suggestion, if there are only a few arguments available). If you press **TAB** a second time, it will show you all suggestions. If you press **TAB** three times consecutively, it will switch to interactive mode and you can select an argument using the arrow keys. - -Otherwise, fish works similar to most other shells. The remaining differences are well documented. So it shouldn’t be difficult to find other features that you may be interested in. - -### Make fish even more powerful - -Make the fish even more powerful with [powerline][7]. Powerline adds command execution time, colored git status, current git branch and much more to fish’s interface. - -Before installing powerline for fish, you must install [Oh My Fish][8]. Oh My Fish extends fish’s core infrastructure to enable the installation of additional plugins. The easiest way to install Oh My Fish is to use the _curl_ command: - -``` -> curl -L https://get.oh-my.fish | fish -``` - -If you don’t want to pipe the installation commands directly to _curl_, see the installation section of Oh My Fish’s [README][9] for alternative installation methods. - -Fish’s powerline plugin is [bobthefish][7]. Bobthefish requires the _powerline-fonts_ package. - -**On Fedora Workstation**: - -``` -> sudo dnf install powerline-fonts -``` - -**On Fedora Silverblue**: - -``` -> rpm-ostree install powerline-fonts -``` - -On Fedora Silverblue you will have to reboot to complete the installation of the fonts. - -After you have installed the _powerline-fonts_ package, install _bobthefish_: - -``` -> omf install bobthefish -``` - -Now you can experience the full awesomeness of fish with powerline: - -![][10] - -### Additional resources - -Check out these web pages to learn even more about fish: - - * [Official page][11] - * [Documentation][12] - * [Tutorial][13] - * [FAQ][14] - * [Web playground][15] - * [Mailing lists][16] - * [GitHub][17] - - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/fish-a-friendly-interactive-shell/ - -作者:[Michal Konečný][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/zlopez/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/03/fish-816x345.jpg -[2]: https://fedoramagazine.org/howto-use-sudo/ -[3]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-00-35.png -[4]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-19-24.png -[5]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-25-31.png -[6]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-58-07.png -[7]: https://github.com/oh-my-fish/theme-bobthefish -[8]: https://github.com/oh-my-fish/oh-my-fish -[9]: https://github.com/oh-my-fish/oh-my-fish/blob/master/README.md#installation -[10]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-15-38-07.png -[11]: https://fishshell.com/ -[12]: https://fishshell.com/docs/current/index.html -[13]: https://fishshell.com/docs/current/tutorial.html -[14]: https://fishshell.com/docs/current/faq.html -[15]: https://rootnroll.com/d/fish-shell/ -[16]: https://sourceforge.net/projects/fish/lists/fish-users -[17]: https://github.com/fish-shell/fish-shell/ diff --git a/translated/tech/20200309 Fish - A Friendly Interactive Shell.md b/translated/tech/20200309 Fish - A Friendly Interactive Shell.md new file mode 100644 index 0000000000..8f786287ad --- /dev/null +++ b/translated/tech/20200309 Fish - A Friendly Interactive Shell.md @@ -0,0 +1,194 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fish – A Friendly Interactive Shell) +[#]: via: (https://fedoramagazine.org/fish-a-friendly-interactive-shell/) +[#]: author: (Michal Konečný https://fedoramagazine.org/author/zlopez/) + +Fish – 一个友好的交互式 Shell +====== + +![Fish — A Friendly Interactive Shell][1] + +你是否正在寻找 bash 的替代品?你是否在寻找更人性化的东西?再往前看看,因为你刚发现了 fish! + +Fish(友好的交互式 shell)是一个智能且用户友好的命令行 shell,可在 Linux、MacOS 和其他操作系统上运行。将其用于终端的日常工作和脚本编写。用 fish 编写的脚本比相同的 bash 版本具有更少的神秘性。 + +### Fish 的用户友好功能 + + * **建议** +Fish 会建议你之前写过的命令。当经常输入相同命令时,这可以提高生产率。 + * **健全的脚本** +Fish 避免使用隐秘字符。这提供了更清晰和更友好的语法。 + * **基于手册页的补全** +Fish 会根据命令的手册页自动补全参数。 + * **语法高亮** +Fish 会高亮显示命令语法以使其在视觉上友好。 + + + +### 安装 + +#### Fedora 工作站 + +使用 _dnf_ 命令安装 fish: + +``` +$ sudo dnf install fish +``` + +安装 _util-linux-user_ 包,然后使用适当的参数运行 _chsh_(更改 shell 程序)命令,将 fish 设置为默认 shell 程序: + +``` +$ sudo dnf install util-linux-user +$ chsh -s /usr/bin/fish +``` + +你需要注销然后重新登录,更改才能生效。 + +#### Fedora Silverblue + +由于它不是 GUI 应用,因此你需要使用 _rpm-ostree_ 安装。使用以下命令在 Fedora Silverblue 上安装 fish: + +``` +$ rpm-ostree install fish +``` + +在 Fedora Silverblue 上,你需要重启 PC 才能切换到新的 ostree 镜像。 + +如果你想在 Fedora Silverblue 用 fish 作为主要 shell,最简单的方法是更新 _/etc/passwd_ 文件。找到你的用户,并将 _/bin/bash_ 更改为 _/usr/bin/fish_。 + +、你需要 [root 权限][2]来编辑 _/etc/passwd_ 文件。另外,你需要注销并重新登录才能使更改生效。 + +### 配置 + +fish 的用户配置文件在 _~/.config/fish/config.fish_。要更改所有用户的配置,请编辑 _/etc/fish/config.fish_。 + +每个用户的配置文件必须手动创建。安装脚本不会创建 _〜/ .config / fish / config.fish_。 + +以下是几个配置示例以及它们的 bash 等效项,以帮助你入门: + +#### 创建别名 + + * _~/.bashrc_: alias ll='ls -lh' + * _~/.config/fish/config.fish_: alias ll='ls -lh' + + + +#### 设置环境变量 + + * _~/.bashrc_: export PATH=$PATH:~/bin + * _~/.config/fish/config.fish_: set -gx PATH $PATH ~/bin + + + +### 使用 fish 工作 + +将 fish 配置为默认 shell 程序后,命令提示符将类似于下图所示。如果尚未将 fish 配置为默认 shell,只需运行 _fish_ 命令以在当前终端会话中启动。 + +![][3] + +在你开始输入命令时,你会注意到语法高亮显示: + +![][4] + +很酷,不是吗?🙂 + +你还将在输入时看到建议的命令。例如,再次开始输入上一个命令: + +![][5] + +注意输入时出现的灰色文本。灰色文本显示建议之前编写的命令。要自动补全,只需按 **CTRL+F**。 + +通过输入连接号(**–**)然后使用 **TAB** 键,它会根据前面命令的手册页获取参数建议: + +![][6] + +如果你按一次 **TAB**,它将显示前几个建议(或所有建议,如果只有少量参数可用)。如果再次按 **TAB**,它将显示所有建议。如果连续三次按 **TAB**,它将切换到交互模式,你可以使用箭头键选择一个参数。 + +除此之外,fish 的工作与大多数其他 shell 相似。其他差异已经写在文档中。因此,找到你可能感兴趣的其他功能应该不难。 + +### 让 fish 变得更强大 + +使用 [powerline][7] 使 fish 变得更强大。Powerline 将命令执行时间、彩色化 git 状态、当前 git 分支等添加到了 fish 的界面中。 + +在安装 powerline 之前,你必须先安装 [Oh My Fish][8]。Oh My Fish 扩展了 fish 的核心基础架构,以支持安装其他插件。安装 Oh My Fish 的最简单方法是使用 _curl_ 命令: + +``` +> curl -L https://get.oh-my.fish | fish +``` + +如果你不想直接将安装命令管道传给 _fish_,请参见 Oh My Fish 的 [README][9] 的安装部分,以了解其他安装方法。 + +Fish 的 powerline 插件是 [bobthefish][7]。Bobthefish 需要 _powerline-fonts_ 包。 + +**在Fedora工作站上**: + +``` +> sudo dnf install powerline-fonts +``` + +**在 Fedora Silverblue 上**: + +``` +> rpm-ostree install powerline-fonts +``` + +在 Fedora Silverblue 上,你必须重启以完成字体的安装。 + +安装 _powerline-fonts_ 之后,安装 _bobthefish_: + +``` +> omf install bobthefish +``` + +现在你可以通过 powerline 体验 fish 的全部奇妙之处: + +![][10] + +### 额外的资源 + +查看这些网页,了解更多 fish 内容: + + * [官网][11] + * [文档][12] + * [教程][13] + * [常见问题][14] + * [在线体验][15] + * [邮件列表][16] + * [GitHub][17] + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fish-a-friendly-interactive-shell/ + +作者:[Michal Konečný][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/zlopez/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/03/fish-816x345.jpg +[2]: https://fedoramagazine.org/howto-use-sudo/ +[3]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-00-35.png +[4]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-19-24.png +[5]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-25-31.png +[6]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-58-07.png +[7]: https://github.com/oh-my-fish/theme-bobthefish +[8]: https://github.com/oh-my-fish/oh-my-fish +[9]: https://github.com/oh-my-fish/oh-my-fish/blob/master/README.md#installation +[10]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-15-38-07.png +[11]: https://fishshell.com/ +[12]: https://fishshell.com/docs/current/index.html +[13]: https://fishshell.com/docs/current/tutorial.html +[14]: https://fishshell.com/docs/current/faq.html +[15]: https://rootnroll.com/d/fish-shell/ +[16]: https://sourceforge.net/projects/fish/lists/fish-users +[17]: https://github.com/fish-shell/fish-shell/ From dae5405a9831b2b31cd068268d58f7b3e6db2a06 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 31 Mar 2020 08:28:17 +0800 Subject: [PATCH 0060/1809] translating --- ...acle Announces Java 14- How to Install it on Ubuntu Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md b/sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md index 17a04e4f91..3e2c6d9acc 100644 --- a/sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md +++ b/sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 49f555b7afb79280360bd624c93fb74519813008 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Mar 2020 10:47:22 +0800 Subject: [PATCH 0061/1809] PRF @robsean --- ...et DebianDog - Puppy sized Debian Linux.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/translated/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md b/translated/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md index ac429383ba..be8b07327f 100644 --- a/translated/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md +++ b/translated/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md @@ -1,30 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Meet DebianDog – Puppy sized Debian Linux) [#]: via: (https://itsfoss.com/debiandog/) [#]: author: (John Paul https://itsfoss.com/author/john/) -体验 DebianDog– Puppy 大小的 Debian Linux +体验 DebianDog:Puppy 式的 Debian Linux ====== -不久前,我偶然发现了一个有趣的 Linux 项目。这个项目旨在为 Debian 和基于 Debian 的系统创建一个小型的 live cd,类似于 [Puppy Linux 项目][1] 。让我们看看 DebianDog 。 +不久前,我偶然发现了一个有趣的 Linux 项目。这个项目旨在为 Debian 和基于 Debian 的系统创建一个小型的现场版 CD,类似于 [Puppy Linux 项目][1] 。让我们看看 DebianDog 。 ### DebianDog 是什么? -正如字面所述,[DebianDog][2] “是一个被塑造成一个外观和动作都像 Puppy 的小型 Debian Live CD ,Debian 结构和 Debian 活动方式是不受影响的, Debian 文档对 DebianDog 来说是100%有效的。你可以使用 apt-get 或 synaptic 来访问所有的 Debian 存储库。” +正如字面所述,[DebianDog][2] “是一个被塑造成一个外观和动作都像 Puppy Linux 的小型 Debian 现场版 CD。没有改动 Debian 结构和方式,Debian 的文档对 DebianDog 来说是完全有效的。你可以使用 `apt-get` 或 synaptic 来访问所有的 Debian 存储库。” ![DebianDog Jessie][3] -对于那些不熟悉 [Puppy Linux][1] 的人来说,该项目是 “多个 Linux 发行版的一个集合,建立在相同的共享法则之上”。这些法则能够实现快速、小型(300 MB 或更少),和易于使用。这里有为支持 Ubuntu, Slackware 和 Raspbian 软件包构建的 Puppy linux 变种。 +对于那些不熟悉 [Puppy Linux][1] 的人来说,该项目是 “多个 Linux 发行版的一个集合,建立在相同的共享准则之上”。这些准则能够实现快速、小型(300 MB 或更少)、易于使用。这里有为支持 Ubuntu, Slackware 和 Raspbian 软件包构建的 Puppy Linux 变种。 -DebianDog 和 Puppy Linux 之间最大的不同是,Puppy Linux 有其自己的软件包管理器 [Puppy 软件包管理器][4] 。如上所述,DebianDog 使用 Debian 软件包管理器及其软件包。甚至 DebianDog 网站也试图澄清这一点:“它不是 Puppy Linux ,并且也与基于 Debian 的 Puppy 无关。” +DebianDog 和 Puppy Linux 之间最大的不同是,Puppy Linux 有其自己的软件包管理器 [Puppy 软件包管理器][4] 。如上所述,DebianDog 使用 Debian 软件包管理器及其软件包。甚至 DebianDog 网站也试图澄清这一点:“它不是 Puppy Linux,并且也与基于 Debian 的 Puppy 无关。” ### 为什么一些人使用 DebianDog ? -安装 DebianDog (或其任何衍生产品) 的主要原因是恢复一台较旧电脑的可操作性。在 DebianDog 上的每个条目都有一个32位选项。它们还有更轻量级的桌面环境/窗口管理器,例如 [Openbox][5] 或 [Trinity Desktop][6] 环境。它们中大多数也都有一个 systemd 的可替代版本。它们也安装更轻的应用程序,例如 [PCManFM][7] 。 +安装 DebianDog(或其任何衍生产品)的主要原因是让一台较旧电脑重焕新生。在 DebianDog 上的每个版本都有一个 32 位版本。它们还有更轻量级的桌面环境/窗口管理器,例如 [Openbox][5] 或 [Trinity Desktop][6] 环境。它们中大多数也都有一个 systemd 的可替代版本。它们也安装更轻的应用程序,例如 [PCManFM][7] 。 ### DebianDog 有哪些可用的变体版本? @@ -32,47 +32,47 @@ DebianDog 和 Puppy Linux 之间最大的不同是,Puppy Linux 有其自己的 #### DebianDog Jessie -DebianDog 的第一个(也是最初的) 版本是 DebianDog Jessie。它有两个 [32位版本][8] ,一个使用 [Joe’s Window Manager (JWM)][9] 作为默认桌面环境,另一个使用 XFCE 作为默认桌面环境。systemd 和 sysvinit 都是可用的。它还有一个 [64位版本][10]。DebianDog Jessie 基于 Debian 8.0 (代号 Jessie)。Debian 8.0 的支持将于2020年6月30日结束,因此安装需谨慎。 +DebianDog 的第一个(也是最初的)版本是 DebianDog Jessie。它有两个 [32 位版本][8] ,一个使用 [Joe’s Window Manager (JWM)][9] 作为默认桌面环境,另一个使用 XFCE 作为默认桌面环境。systemd 和 sysvinit 都是可用的。它还有一个 [64 位版本][10]。DebianDog Jessie 基于 Debian 8.0(Jessie)。Debian 8.0 的支持将于 2020 年 6 月 30 日结束,因此安装需谨慎。 ![TrinityDog][11] #### StretchDog -[StretchDog][12] 基于 Debian 9.0 (代号 Stretch) 。它有32位和64位两种可用。Openbox是默认的窗口管理器,但是我们可以切换到 JWM 。Debian 9.0 的支持将于2022年6月30日结束。 +[StretchDog][12] 基于 Debian 9.0(Stretch)。它有 32 位和 64 位两种版本可用。Openbox 是默认的窗口管理器,但是我们可以切换到 JWM 。Debian 9.0 的支持将于 2022 年 6 月 30 日结束。 #### BusterDog -[BusterDog][13] 是很有趣的。它基于 [Debian 10][14] (代号 Buster) 。它不使用 systemd ,反而像 [AntiX][16] 一样使用 [elogind][15] 。Debian 10.0 的支持将于2024年6月结束。 +[BusterDog][13] 是很有趣的。它基于 [Debian 10][14](Buster)。它不使用 systemd,反而像 [AntiX][16] 一样使用 [elogind][15] 。Debian 10.0 的支持将于 2024 年 6 月结束。 #### MintPup -[MintPup][17] 基于 [Linux Mint][18] 17.1 。LiveCD 仅有32位版本。你也可以使用 “apt-get 或 synaptic 访问 Ubuntu/Mint 的存储库”。考虑到 Mint 17 已经到了生命的尽头,这一版本必须避免使用。 +[MintPup][17] 基于 [Linux Mint][18] 17.1。现场版 CD 仅有 32 位版本。你也可以使用 “apt-get 或 synaptic 访问 Ubuntu/Mint 的存储库”。考虑到 Mint 17 已经到了生命的尽头,这一版本必须避免使用。 #### XenialDog -XenialDog 有[32位][19]和[64位][20] 两种变种,基于 Ubuntu 16.04 LTS 。两个变种都使用 Openbox 作为默认版本,JWM 是一种选项。Ubuntu 16.04 LTS 的支持将于2021年4月结束, 因此安装需谨慎。 +XenialDog 有 [32 位][19]和 [64 位][20] 两种变种,基于 Ubuntu 16.04 LTS 。两个变种都使用 Openbox 作为默认版本,JWM 可选。Ubuntu 16.04 LTS 的支持将于 2021 年 4 月结束, 因此安装需谨慎。 #### TrinityDog -[TrintyDog][21] 有两种变体。一个基于 Debian 8 ,另一个基于 Debian 9 。两种变体都有32位版本,并且都使用 [Trinity Desktop Environment][6] ,依以此得名。 +[TrintyDog][21] 有两种变体。一个基于 Debian 8 ,另一个基于 Debian 9 。两种变体都有 32 位版本,并且都使用 [Trinity Desktop Environment][6] ,以此得名。 ![BionicDog][22] #### BionicDog -你应该能够从名称猜到。[BionicDog][23] 基于 [Ubuntu 18.04 LTS][24] 。主要版本有32位和64位两个版本,Openbox 是默认的窗口管理器。这里也有一个使用 [Cinnamon desktop][25] 的版本,并且只有64位。 +你应该能够从名称猜到。[BionicDog][23] 基于 [Ubuntu 18.04 LTS][24]。主要版本有 32 位和 64 位两个版本,Openbox 是默认的窗口管理器。这里也有一个使用 [Cinnamon desktop][25] 的版本,并且只有 64 位版本。 ### 结束语 我喜欢任何 [想让较旧电脑系统有用的 Linux 项目][26]。但是,通过 DebianDog 项目提供的大多数操作系统不再受支持,或者接近它们的生命尽头。从长远来看,这就不那么有用了。 -**我不建议在你的主计算机上使用它。** 在 live USB 中或一台闲置的系统上尝试它。此外,如果你想使用较新的基础系统,[你可以创建][27]你自己的 LiveCD 。 +**我不建议在你的主计算机上使用它。**在现场版 USB 中或一台闲置的系统上尝试它。此外,如果你想使用较新的基础系统,[你可以创建][27]你自己的现场版 CD 。 -似乎冥冥中自有天意,我总是在探索鲜为人知的 Linux 发行版的路上艰难地前行,像 [FatDog64][28] ,[4M Linux][29] 以及 [Vipper Linux][30] 。虽然我不建议使用它们,但是知晓这些项目的存在的意义总是好的。 +似乎冥冥中自有天意,我总是在探索鲜为人知的 Linux 发行版的路上艰难地前行,像 [FatDog64][28]、[4M Linux][29] 以及 [Vipper Linux][30] 。虽然我不建议使用它们,但是知晓这些项目的存在的意义总是好的。 -你对 DebianDog 有什么看法?你最最喜欢的 Puppy 样式的操作系统是什么?请在下面的评论区中告诉我们。 +你对 DebianDog 有什么看法?你最最喜欢的 Puppy 式的操作系统是什么?请在下面的评论区中告诉我们。 -如果你觉得这篇文章很有趣,请花点时间在社交媒体、黑客新闻或 [Reddit][31] 上分享。 +如果你觉得这篇文章很有趣,请花点时间在社交媒体、黑客新闻或 Reddit 上分享。 -------------------------------------------------------------------------------- @@ -81,7 +81,7 @@ via: https://itsfoss.com/debiandog/ 作者:[John Paul][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -89,7 +89,7 @@ via: https://itsfoss.com/debiandog/ [b]: https://github.com/lujun9972 [1]: http://puppylinux.com/ [2]: https://debiandog.github.io/doglinux/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/DebianDog-Jessie.jpg?fit=800%2C600&ssl=1 +[3]: https://www.linuxinsider.com/article_images/2017/84328_990x556.jpg [4]: http://wikka.puppylinux.com/PPM?redirect=no [5]: http://openbox.org/wiki/Main_Page [6]: https://www.trinitydesktop.org/ From 5b15cd2a3493743741441917dac3e2280eb900b9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Mar 2020 10:50:19 +0800 Subject: [PATCH 0062/1809] PUB @robsean https://linux.cn/article-12059-1.html --- .../20200322 Meet DebianDog - Puppy sized Debian Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200322 Meet DebianDog - Puppy sized Debian Linux.md (99%) diff --git a/translated/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md b/published/20200322 Meet DebianDog - Puppy sized Debian Linux.md similarity index 99% rename from translated/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md rename to published/20200322 Meet DebianDog - Puppy sized Debian Linux.md index be8b07327f..edf769a886 100644 --- a/translated/tech/20200322 Meet DebianDog - Puppy sized Debian Linux.md +++ b/published/20200322 Meet DebianDog - Puppy sized Debian Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12059-1.html) [#]: subject: (Meet DebianDog – Puppy sized Debian Linux) [#]: via: (https://itsfoss.com/debiandog/) [#]: author: (John Paul https://itsfoss.com/author/john/) From f5ea9cfe4fdf751d2bf0ab1c4d60470fdea8c258 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Mar 2020 10:54:59 +0800 Subject: [PATCH 0063/1809] PRF --- .../20200322 Meet DebianDog - Puppy sized Debian Linux.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/published/20200322 Meet DebianDog - Puppy sized Debian Linux.md b/published/20200322 Meet DebianDog - Puppy sized Debian Linux.md index edf769a886..c5b50c7670 100644 --- a/published/20200322 Meet DebianDog - Puppy sized Debian Linux.md +++ b/published/20200322 Meet DebianDog - Puppy sized Debian Linux.md @@ -16,7 +16,7 @@ 正如字面所述,[DebianDog][2] “是一个被塑造成一个外观和动作都像 Puppy Linux 的小型 Debian 现场版 CD。没有改动 Debian 结构和方式,Debian 的文档对 DebianDog 来说是完全有效的。你可以使用 `apt-get` 或 synaptic 来访问所有的 Debian 存储库。” -![DebianDog Jessie][3] +![DebianDog][3] 对于那些不熟悉 [Puppy Linux][1] 的人来说,该项目是 “多个 Linux 发行版的一个集合,建立在相同的共享准则之上”。这些准则能够实现快速、小型(300 MB 或更少)、易于使用。这里有为支持 Ubuntu, Slackware 和 Raspbian 软件包构建的 Puppy Linux 变种。 @@ -34,8 +34,6 @@ DebianDog 和 Puppy Linux 之间最大的不同是,Puppy Linux 有其自己的 DebianDog 的第一个(也是最初的)版本是 DebianDog Jessie。它有两个 [32 位版本][8] ,一个使用 [Joe’s Window Manager (JWM)][9] 作为默认桌面环境,另一个使用 XFCE 作为默认桌面环境。systemd 和 sysvinit 都是可用的。它还有一个 [64 位版本][10]。DebianDog Jessie 基于 Debian 8.0(Jessie)。Debian 8.0 的支持将于 2020 年 6 月 30 日结束,因此安装需谨慎。 -![TrinityDog][11] - #### StretchDog [StretchDog][12] 基于 Debian 9.0(Stretch)。它有 32 位和 64 位两种版本可用。Openbox 是默认的窗口管理器,但是我们可以切换到 JWM 。Debian 9.0 的支持将于 2022 年 6 月 30 日结束。 @@ -56,12 +54,14 @@ XenialDog 有 [32 位][19]和 [64 位][20] 两种变种,基于 Ubuntu 16.04 LT [TrintyDog][21] 有两种变体。一个基于 Debian 8 ,另一个基于 Debian 9 。两种变体都有 32 位版本,并且都使用 [Trinity Desktop Environment][6] ,以此得名。 -![BionicDog][22] +![TrinityDog][11] #### BionicDog 你应该能够从名称猜到。[BionicDog][23] 基于 [Ubuntu 18.04 LTS][24]。主要版本有 32 位和 64 位两个版本,Openbox 是默认的窗口管理器。这里也有一个使用 [Cinnamon desktop][25] 的版本,并且只有 64 位版本。 +![BionicDog][22] + ### 结束语 我喜欢任何 [想让较旧电脑系统有用的 Linux 项目][26]。但是,通过 DebianDog 项目提供的大多数操作系统不再受支持,或者接近它们的生命尽头。从长远来看,这就不那么有用了。 From ac7209334fee8e6d7bd29dab239e66ac56fe8402 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Mar 2020 14:10:35 +0800 Subject: [PATCH 0064/1809] APL --- sources/tech/20190612 Why use GraphQL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190612 Why use GraphQL.md b/sources/tech/20190612 Why use GraphQL.md index ad0d3a0056..924253f8e9 100644 --- a/sources/tech/20190612 Why use GraphQL.md +++ b/sources/tech/20190612 Why use GraphQL.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2d6e02dac970881eb8f8c815e642943fe88e333e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Mar 2020 14:37:45 +0800 Subject: [PATCH 0065/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190429=2010?= =?UTF-8?q?=20moments=20that=20shaped=20Linux=20history?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20190429 10 moments that shaped Linux history.md --- ...29 10 moments that shaped Linux history.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/talk/20190429 10 moments that shaped Linux history.md diff --git a/sources/talk/20190429 10 moments that shaped Linux history.md b/sources/talk/20190429 10 moments that shaped Linux history.md new file mode 100644 index 0000000000..06bbeedacf --- /dev/null +++ b/sources/talk/20190429 10 moments that shaped Linux history.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 moments that shaped Linux history) +[#]: via: (https://opensource.com/article/19/4/top-moments-linux-history) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +10 moments that shaped Linux history +====== +Linux has come a long way since 1991. These events mark its evolution. +![Penguin with green background][1] + +In August 2018, Opensource.com posted a poll with seven options asking readers: _[What was the most important moment in the history of Linux?][2]_ I thought I would expand on the list and present 10 moments that I think have played an important part in shaping the history of Linux. + +### 1\. Linus releases Linux + +Linus Torvalds initially released Linux to the world in 1991 as a hobby. It didn't remain a hobby for long! + +### 2\. Linux distributions + +In 1993, several Linux distributions were founded, notably [Debian][3], [Red Hat][4], and [Slackware][5]. These were important because they demonstrated Linux's gains in market acceptance and development that enabled it to survive the tumultuous OS wars, browser wars, and protocol wars of the 1990s. In contrast, many established, commercial, and proprietary products did not make it past the turn of the millennium! + +### 3\. IBM's big investment in Linux + +In 2000, IBM announced it would invest US$1 billion dollars in Linux. In his CNN Money [article about the investment][6], Richard Richtmyer wrote: "The announcement underscores Big Blue's commitment to Linux and marks significant progress in moving the alternative operating system into the mainstream commercial market." + +### 4\. Hollywood adopts Linux + +In 2002, it seemed the entire Hollywood movie industry adopted Linux. [Disney][7], [Dreamworks][8], and [Industrial Light & Magic][9] all began making movies with Linux that year. + +### 5\. Linux for national security + +In 2003, another big moment came with the US government's acceptance of Linux. Red Hat Linux was [awarded][10] the Department of Defense Common Operating Environment (COE) certification. This is significant because the government—intelligence and military agencies in particular—have very strict requirements for computing systems to prevent attacks and support national security. This opened the door for other agencies to use Linux. Later that year, the [National Weather Service announced][11] it would replace outdated systems with new computers running Linux. + +### 6\. The systems I managed + +This "moment" is really a collection of my personal experiences. As my career progressed in the 2000s, I discovered several types of systems and devices that I managed were all running Linux. Some of the places I found Linux were VMware ESX, F5 Big-IP, Check Point UTM Edge, Cisco ASA, and PIX. This made me realize that Linux was truly viable and here to stay. + +### 7\. Ubuntu + +In 2004, Canonical was founded by Mark Shuttleworth to provide an easy-to-use Linux desktop—[Ubuntu Linux][12]—based on the Debian distribution. I think Ubuntu Linux helped to expand the desktop Linux install base. It put Linux in front of many more people, from casual home users to professional software developers. + +### 8\. Google Linux + +Google released two operating systems based on the Linux kernel: the Android mobile operating system in mid-2008 and Chrome OS, running on a Chromebook, in 2011. Since then, millions of Android mobile phones and Chromebooks have been sold. + +### 9\. The cloud is Linux + +In the past 10 years or so, cloud computing has gone from a grandiose vision of computing on the internet to a reinvention of how we use computers personally and professionally. The big players in the cloud space are built on Linux, including [Amazon Web Services][13], [Google Cloud Services][14], and [Linode][15]. Even in cases where we aren't certain, such as Microsoft Azure, running Linux workloads is well supported. + +### 10\. My car runs Linux + +And so will yours! Many automakers began introducing Linux a few years ago. This led to the formation of the collaborative open source project called [Automotive Grade Linux][16]. Major car makers, such as Toyota and Subaru, have joined together to develop Linux-based automotive entertainment, navigation, and engine-management systems. + +#### Share your favorite + +This is my subjective list pulled from archives of Linux articles and events throughout my career, so there may be other more notable moments that I am overlooking. Share in the comments. Also, the [Linux history poll][2] is still open for voting if you're interested. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/top-moments-linux-history + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_penguin_green.png?itok=ENdVzW22 (Penguin with green background) +[2]: https://opensource.com/article/18/8/linux-history +[3]: https://www.debian.org/doc/manuals/project-history/ch-intro.en.html +[4]: https://brand.redhat.com/foundations/history +[5]: https://opensource.com/article/18/7/stackware-turns-25 +[6]: https://money.cnn.com/2000/12/12/technology/ibm_linux +[7]: https://www.nytimes.com/2002/06/18/business/technology-disney-shifting-to-linux-for-film-animation.html +[8]: https://www.linux.com/news/stallion-and-penguin-dreamworks-uses-linux-create-new-animated-film +[9]: https://www.linuxjournal.com/article/6011 +[10]: https://www.cnet.com/news/government-tips-hat-to-red-hat +[11]: https://www.computerworld.com/article/2574142/national-weather-service-migrates-to-linux-based-ibm-workstations.html +[12]: https://www.ubuntu.com/about +[13]: https://aws.amazon.com/amazon-linux-2 +[14]: https://cloud.google.com +[15]: https://www.linode.com/docs/getting-started +[16]: https://www.automotivelinux.org From 95a664d720b20caa5a910d4b2af837925bdbc858 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Mar 2020 14:43:11 +0800 Subject: [PATCH 0066/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190605=20What?= =?UTF-8?q?=20is=20GraphQL=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190605 What is GraphQL.md --- sources/tech/20190605 What is GraphQL.md | 129 +++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20190605 What is GraphQL.md diff --git a/sources/tech/20190605 What is GraphQL.md b/sources/tech/20190605 What is GraphQL.md new file mode 100644 index 0000000000..56d0690cca --- /dev/null +++ b/sources/tech/20190605 What is GraphQL.md @@ -0,0 +1,129 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is GraphQL?) +[#]: via: (https://opensource.com/article/19/6/what-is-graphql) +[#]: author: (Zach Lendon https://opensource.com/users/zachlendon) + +What is GraphQL? +====== +GraphQL is a query language, an execution engine, and a specification, +and it's leading developers to rethink how they build client and API +applications. +![Analytics: Charts and Graphs][1] + +GraphQL is one of the biggest buzzwords in software tech today. But _what is it_ _actually_? Is it a query language like [SQL][2]? An execution engine like the [JVM][3]? A specification like [XML][4]? + +If you answered all of the above, you are correct! [GraphQL][5] is a query language syntax, a programming language-agnostic execution engine, and a continuously evolving specification. + +Let's dive into how GraphQL can be all of these things and get a glimpse of why people are excited about it. + +### Query language + +GraphQL as a query language seems reasonable—"QL" seemed important enough to be in the name, after all. But what are we querying? It probably helps to look at a sample query request and the corresponding response. + +The following user query: + + +``` +{ + user(id: 4) { +   name +   email +   phoneNumber + } +} +``` + +might return the following JSON response: + + +``` +{ + "user": { +   "name": "Zach Lendon" +   “email”: “[zach@hydrate.io][6]” +   “phoneNumber”: “867-5309” + } +} +``` + +Imagine a client application querying for user details, taking the result, and using it to populate a profile screen. As a query language, one of GraphQL's core benefits is that a client application can request _only the data it needs_ and expect it to be returned in a consistent manner. + +_What_ is returning the GraphQL response, though? This is where the execution engine, typically in the form of a GraphQL server, comes into play. + +### Execution engine + +![GraphQL execution engine][7] + +The GraphQL execution engine is what is responsible for processing a GraphQL query and returning a JSON response. All GraphQL servers are made up of two core components that define the structure and behavior of the execution engine: a schema and resolvers, respectively. + +A GraphQL schema is a custom typed language that exposes which queries are both permitted (valid) and handled by a GraphQL server implementation. The schema for our user example query above might look like: + + +``` +type User { +        name: String +        email: String +        phoneNumber: String +} + +type Query { +        user: User +} +``` + +This schema defines a user query that returns a user. Clients can request any of the fields on a user via the user query, and the GraphQL server will return only those fields in its response. By using the strongly typed schema, a GraphQL server can validate incoming queries to ensure they are valid based on the defined schema. + +Once a query is determined to be valid, it is processed by a GraphQL server by resolvers. A resolver function backs each field of each GraphQL type. An example resolver for our user query might look like: + + +``` +Query: { +  user(obj, args, context, info) { +    return context.db.loadUserById(args.id).then( +      userData => new User(userData) +    ) +  } +} +``` + +While the above example is in JavaScript, GraphQL servers can be written in any number of languages. This is due to the fact that GraphQL is _also_ a specification! + +### Specification + +The GraphQL specification defines the capabilities and characteristics that GraphQL implementations must follow. As an open specification available under the Open Web Foundation Final Specification Agreement ([OWFa 1.0][8]), the technology community has the opportunity to both review what a GraphQL implementation must do to be spec-compliant and help craft the future of the language. + +While the specification is very specific about GraphQL's syntax, what is a valid query, and how a schema works, it provides no direction on how to store data or what implementation programming languages GraphQL servers should use. This is incredibly powerful and relatively unique in the software space—it allows GraphQL servers to be created in any number of programming languages, and clients will know exactly how they function since they are spec-compliant. And GraphQL server implementations have been created across many programming languages, not just ones folks might expect like JavaScript, Java, and C#, but languages like Go, Elixir, and Haskell. The language a server is implemented in will not be a barrier to adoption—not only are there implementations in many languages, but they are all open source. If there isn't an implementation in your language of choice, you are free to create your own. + +### Conclusion + +GraphQL is an exciting, relatively new entrant into the open source API space. It couples a query language and execution engine with an open source specification that defines how GraphQL implementations should look and function. + +GraphQL has already started to change how companies think about building both client and API applications. With GraphQL as part of a technology stack, front-end developers are freed to query for the data they want, and back-end developers can decouple client application needs from their back-end system architectures. Often companies journey into GraphQL by first building a GraphQL API "layer" that sits on top of their existing back-end services. This allows the client applications to begin to gain the performance and operational efficiencies they seek, while allowing the back-end teams an opportunity to determine what, if any, changes they might want to make "under the hood," behind their GraphQL layer. Often, those changes will be geared towards optimizations that will help ensure that applications using GraphQL can operate as performantly as possible. Because of the abstraction GraphQL provides, systems teams can make those changes while continuing to honor the GraphQL "contract" at their GraphQL API level. + +Because GraphQL is relatively new, developers are still finding new and exciting ways to leverage it to build better software solutions. How will GraphQL change how you build applications, and does it live up to the hype? There's only one way to find out—go out there and build something with GraphQL! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/what-is-graphql + +作者:[Zach Lendon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/zachlendon +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/analytics-graphs-charts.png?itok=sersoqbV (Analytics: Charts and Graphs) +[2]: https://opensource.com/article/18/2/getting-started-sql +[3]: https://www.cubrid.org/blog/understanding-jvm-internals/ +[4]: https://www.w3.org/TR/xml/ +[5]: http://graphql.org/ +[6]: mailto:zach@hydrate.io +[7]: https://opensource.com/sites/default/files/pictures/graphql-execution-engine.png (GraphQL execution engine) +[8]: http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0---patent-only From 8b806519278f3baa6b62397515d2078adfff1bbb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Mar 2020 15:56:16 +0800 Subject: [PATCH 0067/1809] TSL --- sources/tech/20190612 Why use GraphQL.md | 97 --------------------- translated/tech/20190612 Why use GraphQL.md | 91 +++++++++++++++++++ 2 files changed, 91 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20190612 Why use GraphQL.md create mode 100644 translated/tech/20190612 Why use GraphQL.md diff --git a/sources/tech/20190612 Why use GraphQL.md b/sources/tech/20190612 Why use GraphQL.md deleted file mode 100644 index 924253f8e9..0000000000 --- a/sources/tech/20190612 Why use GraphQL.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why use GraphQL?) -[#]: via: (https://opensource.com/article/19/6/why-use-graphql) -[#]: author: (Zach Lendon https://opensource.com/users/zachlendon/users/goncasousa/users/patrickhousley) - -Why use GraphQL? -====== -Here's why GraphQL is gaining ground on standard REST API technology. -![][1] - -[GraphQL][2], as I wrote [previously][3], is a next-generation API technology that is transforming both how client applications communicate with backend systems and how backend systems are designed. - -As a result of the support that began with the organization that founded it, Facebook, and continues with the backing of other technology giants such as Github, Twitter, and AirBnB, GraphQL's place as a linchpin technology for application systems seems secure; both now and long into the future. - -### GraphQL's ascent - -The rise in importance of mobile application performance and organizational agility has provided booster rockets for GraphQL's ascent to the top of modern enterprise architectures. - -Given that [REST][4] is a wildly popular architectural style that already allows mechanisms for data interaction, what advantages does this new technology provide over [REST][4]? The ‘QL’ in GraphQL stands for query language, and that is a great place to start. - -The ease at which different client applications within an organization can query only the data they need with GraphQL usurps alternative REST approaches and delivers real-world application performance boosts. With traditional [REST][4] API endpoints, client applications interrogate a server resource, and receive a response containing all the data that matches the request. If a successful response from a [REST][4] API endpoint returns 35 fields, the client application receives 35 fields - -### Fetching problems - -[REST][4] APIs traditionally provide no clean way for client applications to retrieve or update only the data they care about. This is often described as the “over-fetching” problem. With the prevalence of mobile applications in people’s day to day lives, the over-fetching problem has real world consequences. Every request a mobile application needs to make, every byte it has to send and receive, has an increasingly negative performance impact for end users. Users with slower data connections are particularly affected by suboptimal API design choices. Customers who experience poor performance using mobile applications are more likely to not purchase products and use services. Inefficient API designs cost companies money. - -“Over-fetching” isn’t alone - it has a partner in crime - “under-fetching”. Endpoints that, by default, return only a portion of the data a client actually needs require clients to make additional calls to satisfy their data needs - which requires additional HTTP requests. Because of the over and under fetching problems and their impact on client application performance, an API technology that facilitates efficient fetching has a chance to catch fire in the marketplace - and GraphQL has boldly jumped in and filled that void. - -### REST's response - -[REST][4] API designers, not willing to go down without a fight, have attempted to counter the mobile application performance problem through a mix of: - - * “include” and “exclude” query parameters, allowing client applications to specify which fields they want through a potentially long query format. - * “Composite” services, which combine multiple endpoints in a way that allow client applications to be more efficient in the number of requests they make and the data they receive. - - - -While these patterns are a valiant attempt by the [REST][4] API community to address challenges mobile clients face, they fall short in a few key regards, namely: - - * Include and exclude query key/value pairs quickly get messy, in particular for deeper object graphs that require a nested dot notation syntax (or similar) to target data to include and exclude. Additionally, debugging issues with the query string in this model often requires manually breaking up a URL. - * Server implementations for include and exclude queries are often custom, as there is no standard way for server-based applications to handle the use of include and exclude queries, just as there is no standard way for include and exclude queries to be defined. - * The rise of composite services creates more tightly coupled back-end and front-end systems, requiring increasing coordination to deliver projects and turning once agile projects back to waterfall. This coordination and coupling has the painful side effect of slowing organizational agility. Additionally, composite services are by definition, not RESTful. - - - -### GraphQL's genesis - -For Facebook, GraphQL’s genesis was a response to pain felt and experiences learned from an HTML5-based version of their flagship mobile application back in 2011-2012. Understanding that improved performance was paramount, Facebook engineers realized that they needed a new API design to ensure peak performance. Likely taking the above [REST][4] limitations into consideration, and with needing to support different needs of a number of API clients, one can begin to understand the early seeds of what led co-creators Lee Byron and Dan Schaeffer, Facebook employees at the time, to create what has become known as GraphQL. - -With what is often a single GraphQL endpoint, through the GraphQL query language, client applications are able to reduce, often significantly, the number of network calls they need to make, and ensure that they only are retrieving the data they need. In many ways, this harkens back to earlier models of web programming, where client application code would directly query back-end systems - some might remember writing SQL queries with JSTL on JSPs 10-15 years ago for example! - -The biggest difference now is with GraphQL, we have a specification that is implemented across a variety of client and server languages and libraries. And with GraphQL being an API technology, we have decoupled the back-end and front-end application systems by introducing an intermediary GraphQL application layer that provides a mechanism to access organizational data in a manner that aligns with an organization’s business domain(s). - -Beyond solving technical challenges experienced by software engineering teams, GraphQL has also been a boost to organizational agility, in particular in the enterprise. GraphQL-enabled organizational agility increases are commonly attributable to the following: - - * Rather than creating new endpoints when 1 or more new fields are needed by clients, GraphQL API designers and developers are able to include those fields in existing graph implementations, exposing new capabilities in a fashion that requires less development effort and less change across application systems. - * By encouraging API design teams to focus more on defining their object graph and be less focused on what client applications are delivering, the speed at which front-end and back-end software teams deliver solutions for customers has increasingly decoupled. - - - -### Considerations before adoption - -Despite GraphQL’s compelling benefits, GraphQL is not without its implementation challenges. A few examples include: - - * Caching mechanisms around [REST][4] APIs are much more mature. - * The patterns used to build APIs using [REST][4] are much more well established. - * While engineers may be more attracted to newer technologies like GraphQL, the talent pool in the marketplace is much broader for building [REST][4]-based solutions vs. GraphQL. - - - -### Conclusion - -By providing both a boost to performance and organizational agility, GraphQL's adoption by companies has skyrocketed in the past few years. It does, however, have some maturing to do in comparison to the RESTful ecosystem of API design. - -One of the great benefits of GraphQL is that it’s not designed as a wholesale replacement for alternative API solutions. Instead, GraphQL can be implemented to complement or enhance existing APIs. As a result, companies are encouraged to explore incrementally adopting GraphQL where it makes the most sense for them - where they find it has the greatest positive impact on application performance and organizational agility. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/6/why-use-graphql - -作者:[Zach Lendon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/zachlendon/users/goncasousa/users/patrickhousley -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_graph_stats_blue.png?itok=OKCc_60D -[2]: https://graphql.org/ -[3]: https://opensource.com/article/19/6/what-is-graphql -[4]: https://en.wikipedia.org/wiki/Representational_state_transfer diff --git a/translated/tech/20190612 Why use GraphQL.md b/translated/tech/20190612 Why use GraphQL.md new file mode 100644 index 0000000000..e63f55622d --- /dev/null +++ b/translated/tech/20190612 Why use GraphQL.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why use GraphQL?) +[#]: via: (https://opensource.com/article/19/6/why-use-graphql) +[#]: author: (Zach Lendon https://opensource.com/users/zachlendon/users/goncasousa/users/patrickhousley) + +为什么使用 GraphQL? +====== + +> 这就是 GraphQL 在标准 REST API 技术上获得发展的原因。 + +[][1] + +正如我[以前][3]所写,[GraphQL][2] 是下一代 API 技术,它正在改变客户端应用程序与后端系统的通信方式以及后端系统的设计方式。 + +由于一开始就从创建它的组织 Facebook 获得了支持,并得到了其他技术巨头(如 Github、Twitter 和 AirBnB)的支持,因此 GraphQL 作为应用程序系统的关键技术的地位似乎是可靠的 —— 无论现在还是将来。 + +### GraphQL 在崛起 + +移动应用程序性能和组织敏捷性重要性的提高为 GraphQL 登上现代企业体系结构的顶端提供了助推器。 + +鉴于 [REST][4] 是一种非常流行的体系结构风格,早已提供了数据交互机制,与 [REST][4] 相比,GraphQL 这项新技术具有哪些优势?GraphQL 中的 “QL” 代表查询语言,而这是一个很好的起点。 + +借助 GraphQL,组织内的不同客户端应用程序可以轻松地仅查询所需数据,从而取代了其他 REST 方法,并提高了实际应用程序的性能。 使用传统的 [REST][4] API 端点,客户端应用程序将详询服务器资源,并接收包含了与请求匹配的所有数据的响应。如果来自 [REST][4] API 端点的成功响应返回 35 个字段,那么客户端应用程序就会接收 35 个字段。 + +### 提取的问题 + +传统上,[REST][4] API 无法为客户端应用程序提供简便的方法来仅检索或更新它们关心的数据。这通常被描述为“过度获取over-fetching”的问题。随着移动应用程序在人们的日常生活中的普遍使用,过度获取问题会给现实世界带来不良后果。移动应用程序需要发出的每个请求都必须发送和接收的每个字节,对最终用户的性能造成的负面影响越来越大。数据连接速度较慢的用户尤其会受到不太好的 API 设计方案的影响。在性能体验不佳时,使用移动应用程序的客户更有可能不购买产品或不使用服务。低效的 API 设计只会浪费公司的钱。 + +并非只有“过度获取”是问题,“欠缺获取”同样也是问题。默认情况下,仅返回客户端实际需要的部分数据的端点或许会要求客户端进行其他调用以满足其数据需求,这就需要其他的 HTTP 请求。由于过度和欠缺的获取问题及其对客户端应用程序性能的影响,促进有效获取的 API 技术才有机会在市场上引起轰动 —— GraphQL 大胆地介入并填补了这一空白。 + +### REST 的应对 + +[REST][4] API 设计师不战而退,他们尝试通过以下几种方式来应对移动应用程序性能问题: + +* “include” 和 “exclude” 查询参数,允许客户端应用程序通过可能较长的查询格式来指定所需的字段。 +* “复合”服务,组合了多个端点,以使客户端应用程序在其发出的请求数量和接收到的数据方面更高效。 +   +尽管这些模式是 [REST][4] API 社区为解决移动客户端所面临的挑战而做出的英勇尝试,但它们在以下几个关键方面仍存在不足: + +* 包含和排除查询的键/值对很快变得混乱,特别是对于需要嵌套“点表示法”语法(或类似方法)以包含和排除更深的目标数据的对象图而言。此外,在此模型中调试查询字符串的问题通常需要手动分解 URL。 +* 包含和排除查询的服务器实现通常是自定义的,因为基于服务器的应用程序没有标准的方式来处理包含和排除查询的使用,就像没有定义包含和排除查询的标准方式一样。 +* 复合服务的兴起创建了更加紧密耦合的后端和前端系统,需要加强协调以交付项目,并且一旦将敏捷项目转回瀑布式。这种协调和耦合顺便还能稍减组织敏捷性的痛苦。此外,根据定义,组合服务不是 RESTful。 +   +### GraphQL 的起源 + +对于 Facebook 来说,从其 2011-2012 年基于 HTML5 版本的旗舰移动应用程序中感受到的痛点和体验,才造就了 GraphQL。Facebook 工程师意识到提高性能至关重要,因此意识到他们需要一种新的 API 设计来确保最佳性能。可能考虑到以上 [REST][4] 的局限性,并且需要支持许多 API 客户端的不同需求,因此人们开始去了解其共同创建者 Lee Byron 和 Dan Schaeffer(那时尚是 Facebook 员工)撒播下的早期种子,创建了后来被称之为 GraphQL 的技术。 + +通过 GraphQL 查询语言,客户端(通常是单个 GraphQL 端点)应用程序通常可以显著减少所需的网络调用数量,并确保仅检索所需的数据。在许多方面,这可以追溯到早期的 Web 编程模型,在该模型中,客户端应用程序代码将直接查询后端系统,有些人可能还记得 10 到 15 年前在 JSP 上用 JSTL 编写 SQL 查询吧! + +现在最大的区别是使用 GraphQL,我们有了一个跨多种客户端和服务器语言和库实现的规范。借助 GraphQL 这样一种 API 技术,我们通过引入 GraphQL 应用程序中间层来分离后端和前端应用程序系统,该层提供了一种以与组织的业务领域相一致的方式来访问组织数据的机制。 + +除了解决软件工程团队遇到的技术挑战之外,GraphQL 还促进了组织敏捷性的提高,特别是在企业中。启用 GraphQL 的组织敏捷性通常归因于以下因素: + + * GraphQL API 设计人员和开发人员无需在客户端需要一个或多个新字段时创建新的端点,而是能够将这些字段包含在现有的图形实现中,从而以较少的开发工作量和跨应用程序系统的较少更改的方式公开新功能。 + * 通过鼓励 API 设计团队将更多的精力放在定义对象图上,而不是在专注于客户端应用程序交付上,前端和后端软件团队为客户交付解决方案的速度日益解耦。 +   +### 采纳之前的注意事项 + +尽管 GraphQL 具有引人注目的优势,但 GraphQL 并非没有实施挑战。一些例子包括: + +* 为 [REST][4] API 建立的缓存机制更加成熟。 +* 用于使用 [REST][4] 来构建 API 的模式已经非常完善。 +* 尽管工程师可能更喜欢 GraphQL 等新技术,但与 GraphQL 相比,市场上的人才库更多是从事于构建基于 [REST][4] 的解决方案。 + +### 结论 + +通过同时提高性能和组织敏捷性,GraphQL 在公司中的采纳在过去几年中猛增。但是,与 RESTful API 设计生态系统相比,它确实还需要更成熟一些。 + +GraphQL 的一大优点是,它并不是作为替代 API 解决方案的批发替代品而设计的。相反,可以实现 GraphQL 来补充或增强现有的 API。因此,鼓励公司探索逐步采用 GraphQL 的方法,这对他们来说最有意义,他们发现它对应用程序性能和组织敏捷性具有最大的积极影响。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/why-use-graphql + +作者:[Zach Lendon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/zachlendon/users/goncasousa/users/patrickhousley +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_graph_stats_blue.png?itok=OKCc_60D +[2]: https://graphql.org/ +[3]: https://opensource.com/article/19/6/what-is-graphql +[4]: https://en.wikipedia.org/wiki/Representational_state_transfer From 64adba476006a7b2c8ff5cc33ce2f8c4a294ed1e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Mar 2020 22:10:00 +0800 Subject: [PATCH 0068/1809] APL --- sources/talk/20190429 10 moments that shaped Linux history.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190429 10 moments that shaped Linux history.md b/sources/talk/20190429 10 moments that shaped Linux history.md index 06bbeedacf..26f2c30b81 100644 --- a/sources/talk/20190429 10 moments that shaped Linux history.md +++ b/sources/talk/20190429 10 moments that shaped Linux history.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 73e262127cab895ab60cda805f4985898ec18014 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Mar 2020 23:12:38 +0800 Subject: [PATCH 0069/1809] TSL&PRF --- ...29 10 moments that shaped Linux history.md | 89 ------------------ ...29 10 moments that shaped Linux history.md | 91 +++++++++++++++++++ 2 files changed, 91 insertions(+), 89 deletions(-) delete mode 100644 sources/talk/20190429 10 moments that shaped Linux history.md create mode 100644 translated/talk/20190429 10 moments that shaped Linux history.md diff --git a/sources/talk/20190429 10 moments that shaped Linux history.md b/sources/talk/20190429 10 moments that shaped Linux history.md deleted file mode 100644 index 26f2c30b81..0000000000 --- a/sources/talk/20190429 10 moments that shaped Linux history.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (10 moments that shaped Linux history) -[#]: via: (https://opensource.com/article/19/4/top-moments-linux-history) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) - -10 moments that shaped Linux history -====== -Linux has come a long way since 1991. These events mark its evolution. -![Penguin with green background][1] - -In August 2018, Opensource.com posted a poll with seven options asking readers: _[What was the most important moment in the history of Linux?][2]_ I thought I would expand on the list and present 10 moments that I think have played an important part in shaping the history of Linux. - -### 1\. Linus releases Linux - -Linus Torvalds initially released Linux to the world in 1991 as a hobby. It didn't remain a hobby for long! - -### 2\. Linux distributions - -In 1993, several Linux distributions were founded, notably [Debian][3], [Red Hat][4], and [Slackware][5]. These were important because they demonstrated Linux's gains in market acceptance and development that enabled it to survive the tumultuous OS wars, browser wars, and protocol wars of the 1990s. In contrast, many established, commercial, and proprietary products did not make it past the turn of the millennium! - -### 3\. IBM's big investment in Linux - -In 2000, IBM announced it would invest US$1 billion dollars in Linux. In his CNN Money [article about the investment][6], Richard Richtmyer wrote: "The announcement underscores Big Blue's commitment to Linux and marks significant progress in moving the alternative operating system into the mainstream commercial market." - -### 4\. Hollywood adopts Linux - -In 2002, it seemed the entire Hollywood movie industry adopted Linux. [Disney][7], [Dreamworks][8], and [Industrial Light & Magic][9] all began making movies with Linux that year. - -### 5\. Linux for national security - -In 2003, another big moment came with the US government's acceptance of Linux. Red Hat Linux was [awarded][10] the Department of Defense Common Operating Environment (COE) certification. This is significant because the government—intelligence and military agencies in particular—have very strict requirements for computing systems to prevent attacks and support national security. This opened the door for other agencies to use Linux. Later that year, the [National Weather Service announced][11] it would replace outdated systems with new computers running Linux. - -### 6\. The systems I managed - -This "moment" is really a collection of my personal experiences. As my career progressed in the 2000s, I discovered several types of systems and devices that I managed were all running Linux. Some of the places I found Linux were VMware ESX, F5 Big-IP, Check Point UTM Edge, Cisco ASA, and PIX. This made me realize that Linux was truly viable and here to stay. - -### 7\. Ubuntu - -In 2004, Canonical was founded by Mark Shuttleworth to provide an easy-to-use Linux desktop—[Ubuntu Linux][12]—based on the Debian distribution. I think Ubuntu Linux helped to expand the desktop Linux install base. It put Linux in front of many more people, from casual home users to professional software developers. - -### 8\. Google Linux - -Google released two operating systems based on the Linux kernel: the Android mobile operating system in mid-2008 and Chrome OS, running on a Chromebook, in 2011. Since then, millions of Android mobile phones and Chromebooks have been sold. - -### 9\. The cloud is Linux - -In the past 10 years or so, cloud computing has gone from a grandiose vision of computing on the internet to a reinvention of how we use computers personally and professionally. The big players in the cloud space are built on Linux, including [Amazon Web Services][13], [Google Cloud Services][14], and [Linode][15]. Even in cases where we aren't certain, such as Microsoft Azure, running Linux workloads is well supported. - -### 10\. My car runs Linux - -And so will yours! Many automakers began introducing Linux a few years ago. This led to the formation of the collaborative open source project called [Automotive Grade Linux][16]. Major car makers, such as Toyota and Subaru, have joined together to develop Linux-based automotive entertainment, navigation, and engine-management systems. - -#### Share your favorite - -This is my subjective list pulled from archives of Linux articles and events throughout my career, so there may be other more notable moments that I am overlooking. Share in the comments. Also, the [Linux history poll][2] is still open for voting if you're interested. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/top-moments-linux-history - -作者:[Alan Formy-Duval][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alanfdoss -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_penguin_green.png?itok=ENdVzW22 (Penguin with green background) -[2]: https://opensource.com/article/18/8/linux-history -[3]: https://www.debian.org/doc/manuals/project-history/ch-intro.en.html -[4]: https://brand.redhat.com/foundations/history -[5]: https://opensource.com/article/18/7/stackware-turns-25 -[6]: https://money.cnn.com/2000/12/12/technology/ibm_linux -[7]: https://www.nytimes.com/2002/06/18/business/technology-disney-shifting-to-linux-for-film-animation.html -[8]: https://www.linux.com/news/stallion-and-penguin-dreamworks-uses-linux-create-new-animated-film -[9]: https://www.linuxjournal.com/article/6011 -[10]: https://www.cnet.com/news/government-tips-hat-to-red-hat -[11]: https://www.computerworld.com/article/2574142/national-weather-service-migrates-to-linux-based-ibm-workstations.html -[12]: https://www.ubuntu.com/about -[13]: https://aws.amazon.com/amazon-linux-2 -[14]: https://cloud.google.com -[15]: https://www.linode.com/docs/getting-started -[16]: https://www.automotivelinux.org diff --git a/translated/talk/20190429 10 moments that shaped Linux history.md b/translated/talk/20190429 10 moments that shaped Linux history.md new file mode 100644 index 0000000000..c9f1328ed2 --- /dev/null +++ b/translated/talk/20190429 10 moments that shaped Linux history.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 moments that shaped Linux history) +[#]: via: (https://opensource.com/article/19/4/top-moments-linux-history) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +塑造 Linux 历史的 10 个时刻 +====== + +> 自 1991 年诞生以来,Linux 已经走了漫长的一段路,而这些事件标志着它的发展。 + +![Penguin with green background][1] + +在 2018 年 8 月,Opensource.com 发布了一项包含七个选项的民意测验,询问读者:[Linux 历史上最重要的时刻是什么?][2]我觉得我需要扩大这个清单,并提出我认为的 10 个在塑造 Linux 历史上发挥了重要作用的时刻。 + +### 1、Linus 发布 Linux + +Linus Torvalds 最初是在 1991 年将 Linux 当成一个业余爱好发布到世上的。结果这个业余爱好成了他的职业! + +### 2、出现 Linux 发行版 + +1993 年,出现了几个 Linux 发行版,需要特别指出的有 [Debian][3]、[Red Hat][4] 和 [Slackware][5]。这个时刻之所以重要是因为它们证明了 Linux 在市场认可度和开发水平方面的成就,使其能够在 1990 年代动荡的操作系统战争、浏览器战争和协议战争中生存下来。相反,那时许多成熟的、商业的和专有的产品并没有活过千禧年之交! + +### 3、IBM 斥巨资投注 Linux + +2000 年,IBM 宣布将在 Linux 上投资 10 亿美元。Richard Richtmyer 在他的 CNN Money [有关投资的文章][6] 中写道:“这一声明强调了蓝色巨人对 Linux 的承诺,标志着将这个替代操作系统推向主流商业市场的重大进展。” + +### 4、好莱坞接纳 Linux + +在 2002 年,整个好莱坞电影业似乎都采用了 Linux。[迪尼斯][7]、[梦工厂][8] 和 [工业光魔][9] 都在那一年开始用 Linux 制作电影。 + +### 5、Linux 得到政府认可 + +2003 年,美国政府对 Linux 的接受是它的又一个重要时刻。红帽 Linux 被[授予][10]美国防部通用操作环境(COE)认证。这很重要,因为政府(特别是情报和军事机构)对计算机系统有非常严格的要求,以防止攻击和支持国家安全。这为其他机构使用 Linux 打开了大门。在那年晚些时候,[美国国家气象局宣布][11],它将用运行 Linux 的新计算机代替过时的系统。 + +### 6、我管理的系统 + +这个“时刻”确实是我个人经历的集合。随着在 2000 年代我的职业发展,我发现自己管理的几种类型的系统和设备都运行着 Linux。我在 VMware ESX、F5 Big-IP、Check Point UTM Edge、Cisco ASA 和 PIX 这些地方发现了 Linux。这使我意识到 Linux 确实可行并且可以继续存在下去。 + +### 7、Ubuntu + +2004 年,Mark Shuttleworth 创立了 Canonical,该公司基于 Debian 发行版提供了易于使用的 Linux 桌面:[Ubuntu Linux][12]。我认为 Ubuntu Linux 帮助扩展了桌面 Linux 安装基数。从休闲的家庭用户到专业软件开发人员,它使 Linux 出现在更多人面前。 + +### 8、Google 的 Linux + +Google 发行了两种基于 Linux 内核的操作系统:2008 年中期的 Android 移动操作系统和 2011 年在 Chromebook 上运行的 Chrome OS。在那之后,已经售出了数百万部 Android 手机和 Chromebook。 + +### 9、云计算即 Linux + +在过去这十年左右的时间里,云计算已经从互联网计算的宏伟愿景变成了我们如何个人和专业地使用计算机的全新方式。云计算领域中的主要参与者都是构建于 Linux 之上的,包括 [Amazon Web Services(AWS)][13]、[Google Cloud Services(GCS)][14] 和 [Linode][15]。即使在一些我们不能确信的地方(例如 Microsoft Azure),也很好地支持运行 Linux 工作负载。 + +### 10、我的汽车运行着 Linux + +你的也一样!许多汽车制造商几年前开始引入 Linux。这导致了名为 [汽车级 Linux(AGL)][16] 的协作开源项目的形成。丰田和斯巴鲁等主要汽车制造商已经联合开发基于 Linux 的汽车娱乐、导航和引擎管理系统。 + +### 分享你的最爱 + +这是我从贯穿我的职业生涯的 Linux 文章和事件的档案库中提取出来的主观清单,因此可能还有其他更值得注意的时刻。请分享你的评论吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/top-moments-linux-history + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_penguin_green.png?itok=ENdVzW22 (Penguin with green background) +[2]: https://opensource.com/article/18/8/linux-history +[3]: https://www.debian.org/doc/manuals/project-history/ch-intro.en.html +[4]: https://brand.redhat.com/foundations/history +[5]: https://opensource.com/article/18/7/stackware-turns-25 +[6]: https://money.cnn.com/2000/12/12/technology/ibm_linux +[7]: https://www.nytimes.com/2002/06/18/business/technology-disney-shifting-to-linux-for-film-animation.html +[8]: https://www.linux.com/news/stallion-and-penguin-dreamworks-uses-linux-create-new-animated-film +[9]: https://www.linuxjournal.com/article/6011 +[10]: https://www.cnet.com/news/government-tips-hat-to-red-hat +[11]: https://www.computerworld.com/article/2574142/national-weather-service-migrates-to-linux-based-ibm-workstations.html +[12]: https://www.ubuntu.com/about +[13]: https://aws.amazon.com/amazon-linux-2 +[14]: https://cloud.google.com +[15]: https://www.linode.com/docs/getting-started +[16]: https://www.automotivelinux.org From f9b4558ec0f5c6a70b7bbc529ad78419fdc47659 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Apr 2020 00:54:45 +0800 Subject: [PATCH 0070/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200401=20How?= =?UTF-8?q?=20to=20Find=20Which=20Graphics=20Card=20do=20You=20Have=20in?= =?UTF-8?q?=20Linux=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md --- ...hich Graphics Card do You Have in Linux.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md diff --git a/sources/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md b/sources/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md new file mode 100644 index 0000000000..18db3d8c8d --- /dev/null +++ b/sources/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Find Which Graphics Card do You Have in Linux?) +[#]: via: (https://itsfoss.com/check-graphics-card-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Find Which Graphics Card do You Have in Linux? +====== + +Be it [Nvidia][1] or [Radeon][2] or Intel, they all may have some issues with Linux. When you are on your way to troubleshoot the graphics problem, the first thing you want to know is which graphics card do you have in your system. + +Linux has several commands to check hardware information. You can use them to check what graphics card (also refer to as video card) do you have. Let me show you a couple of commands to get GPU information in Linux. + +### Check graphics card details in Linux command line + +![][3] + +#### Use lspci command to find graphics card + +The lspci command displays the information about devices connected through [PCI][4] (peripheral Component Interconnect) buses. Basically, this command gives you the detail about all the peripheral devices to your system from keyboard and mouse to sound, network and graphics cards. + +By default, you’ll have a huge list of such peripheral devices. This is why you need to filter the output for graphics card with grep command in this manner: + +``` +lspci | grep VGA +``` + +This should show a one line information about your graphics card: + +``` +[email protected]:~$ lspci | grep VGA +00:02.0 VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02) +``` + +As you can see, my system has Intel HD 620 video card. + +#### Get detailed graphics card information with lshw command in Linux + +The lspci command is good enough to see what graphics card you have but it doesn’t tell you a lot. You can use lshw command to get more information on it. + +This command requires you to have root access. You need to specify that you are looking for video card (graphics card) information in this fashion: + +``` +sudo lshw -C video +``` + +And as you can see in the output below, this command gives more information on the graphics card such as clock rate, width, driver etc. + +``` +[email protected]:~$ sudo lshw -C video +[sudo] password for abhishek: + *-display + description: VGA compatible controller + product: HD Graphics 620 + vendor: Intel Corporation + physical id: 2 + bus info: [email protected]:00:02.0 + version: 02 + width: 64 bits + clock: 33MHz + capabilities: pciexpress msi pm vga_controller bus_master cap_list rom + configuration: driver=i915 latency=0 + resources: irq:139 memory:db000000-dbffffff memory:90000000-9fffffff ioport:f000(size=64) memory:c0000-dffff +``` + +#### Bonus Tip: Check graphics card details graphically + +It’s not that you must use the command line to find graphics card details in Linux. Most Linux distributions (or should I say desktop environments) provide essential details in the settings application. + +For example, if you are using [GNOME desktop environment][5], you can check the details by going to About section of Settings. Here’s what it looks like in [Ubuntu 20.04][6]: + +![Graphics card information check graphically][7] + +I hope you find this quick tip helpful. You can also use the same commands to [find your network adapter][8] and [CPU information in Linux][9]. + +If you have questions or suggestions, don’t hesitate to write a comment. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/check-graphics-card-linux/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.nvidia.com/en-us/ +[2]: https://www.amd.com/en/graphics/radeon-rx-graphics +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/check-gpu-info-linux.jpg?ssl=1 +[4]: https://en.wikipedia.org/wiki/Conventional_PCI +[5]: https://www.gnome.org/ +[6]: https://itsfoss.com/ubuntu-20-04-release-features/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/ubuntu-gpu-check.jpg?ssl=1 +[8]: https://itsfoss.com/find-network-adapter-ubuntu-linux/ +[9]: https://linuxhandbook.com/check-cpu-info-linux/ From 1db93cd1903bfe8d3d8ef3556f2937ce5de8f2a8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Apr 2020 00:56:32 +0800 Subject: [PATCH 0071/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200401=20IEEE?= =?UTF-8?q?=20Standards=20Association=20Launches=20an=20Open=20Source=20Co?= =?UTF-8?q?llaboration=20Platform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md --- ...s an Open Source Collaboration Platform.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md diff --git a/sources/tech/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md b/sources/tech/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md new file mode 100644 index 0000000000..9a6eadffad --- /dev/null +++ b/sources/tech/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IEEE Standards Association Launches an Open Source Collaboration Platform) +[#]: via: (https://itsfoss.com/ieee-open-source-collaboration-platform/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +IEEE Standards Association Launches an Open Source Collaboration Platform +====== + +_**Brief: IEEE Standards Association has announced a GitLab-based open source collaboration platform. Read how is it different and what advantages it has.**_ + +[IEEE][1] is the world’s largest technical professional organization dedicated to advancing technology. The IEEE Standards Association (IEEE SA) is an organization within IEEE that develops global standards in a broad range of industries. + +The IEEE Standards Association (SA) has come up with an open-source collaboration platform i.e [IEEE SA Open][2]. + +It is technically a self-hosted GitLab instance combined with [Mattermost][3] (a [slack alternative][4]) and [GitLab Pages][5]. To describe it further, the [official blog post][6] mentioned: + +> The platform enables independent software developers, startups, industry, academic institutions, and others to create, test, manage, and deploy innovative projects in a collaborative, safe, and responsible environment. + +### How is it different or useful? + +The main key attraction for this platform would be IEEE’s members’ network, technical expertise, and resources. + +IEEE President, [Robert Fish][7], also mentions in brief (during an interview with Radio Kan) how it’s different and why IEEE wanted to go with it: + +> Today, much of the world’s infrastructure is run by software, and that software needs to comply with standards in communications networking, electrical grids, agriculture, and the like. + +It makes sense – if we want to improve standardizing technologies, it highly depends on the software. So, this definitely sounds like something to standardize innovative open-source projects to gear them up for potential capital opportunities as well. + +IEEE also clarified that: + +> As software becomes increasingly prevalent in the world today, ethical alignment, reliability, transparency, and democratic governance become must-haves. IEEE is uniquely positioned to endow open-source projects with these attributes. + +While this sounds good, what exactly the open-source platform by the IEEE offer? Let’s take a look at that: + +### IEEE SA Open: Quick overview + +![][8] + +To start with, it is open to all and completely free to use. You just need to create an [IEEE account][9] and then [sign in to the open-source platform][10] to get started. + +Along with the benefits associated with IEEE’s extensive network of Members, you can also expect guidance support from their open-source community managers or community members. + +![Ieee Gitlab][11] + +The platform presents use cases for both standard and non-standard projects, so you can give it a try. + +For its choice to go with GitLab combined with Mattermost and Pages, you get a couple of useful features, they are: + + * Project planning and management features + * Source code management + * Testing, code quality, and continuous integration features + * Docker container registry and Kubernetes integration + * Application release and delivery features + * Integrated Mattermost chat forum w/slash commands; (Android and iPhone apps are fully supported) + * Capable of bridging the gap between Standards development and open source communities to allow for the advancement of nimble and creative technical solutions at a faster pace + * A safe open space with an enforced code of conduct + + + +### Wrapping Up + +It’s obviously a good thing to have more platforms to potentially amplify the exposure of open-source projects – hence, IEEE’s initiative sounds promising to start with. + +What do you think about it? Let me know your thoughts! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ieee-open-source-collaboration-platform/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.ieee.org/about/index.html +[2]: https://standards.ieee.org/content/ieee-standards/en/initiatives/opensource/ +[3]: https://mattermost.com/ +[4]: https://itsfoss.com/open-source-slack-alternative/ +[5]: https://docs.gitlab.com/ee/user/project/pages/ +[6]: https://spectrum.ieee.org/the-institute/ieee-products-services/ieee-standards-association-launches-a-platform-for-open-source-collaboration +[7]: https://www.linkedin.com/in/robertsfish/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/ieee-opensource.jpg?ssl=1 +[9]: https://www.ieee.org/profile/public/createwebaccount/showRegister.html +[10]: https://opensource.ieee.org/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/ieee-gitlab.jpg?ssl=1 From 22c1de6e7e374b5df3eb8d879d56f2aa35fcdd77 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Apr 2020 00:57:47 +0800 Subject: [PATCH 0072/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200331=20How?= =?UTF-8?q?=20failure-driven=20development=20makes=20you=20successful?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200331 How failure-driven development makes you successful.md --- ...driven development makes you successful.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/tech/20200331 How failure-driven development makes you successful.md diff --git a/sources/tech/20200331 How failure-driven development makes you successful.md b/sources/tech/20200331 How failure-driven development makes you successful.md new file mode 100644 index 0000000000..a9961daabb --- /dev/null +++ b/sources/tech/20200331 How failure-driven development makes you successful.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How failure-driven development makes you successful) +[#]: via: (https://opensource.com/article/20/3/failure-driven-development) +[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) + +How failure-driven development makes you successful +====== +I'm the picture in the dictionary next to the word "failure"—and that's +why I'm good at my job. +![failure sign at a party, celebrating failure][1] + +My job title is senior software engineer, but that's not what my closest co-workers call me. They call me "Cherrybomb" because of all the things I blow up. My regularly scheduled failures have been tracked down to our quarterly earnings and outage times. Literally, I am the production disaster you read about that says, "what not to do ever, in any case, at any time." + +I started my career at a helpdesk where I wrote loops that wrecked servers in high-end companies. I have taken production applications down for up to eight hours without warning, and I have destroyed endless numbers of clusters in an attempt to make things better—and a couple just because I mistyped something. + +I am the reason we have disaster recovery (DR) clusters in [Kubernetes][2]. I am the chaos engineer that, without warning, teaches people how to act and troubleshoot quickly when we have an application that has never been tested for an outage recovery plan. I exist as the best example of failure possible, and it's actually the coolest thing ever. + +### Jess and the disappearing K8s clusters + +One of my official responsibilities involves our application architecture. For any sort of architectural change, I get to make and test the code and see what is possible. Recently, this has been an epic pain in my bosses' side, to put it gently. + +We run most of our infrastructure on Kubernetes, which is known for its resiliency. Despite that reputation, I managed to make two clusters just, well, disappear. You may be wondering how I could do that; it's pretty easy: **terraform destroy**. We manage our infrastructure as code through [Terraform][3], and it won't take any knowledge of the software to know that **destroy** can do something bad. Before you panic, it was the dev clusters, so life went on. + +In light of this, it's reasonable to ask why I am still employed—and why am I writing about this. Those are easy to answer: I'm still employed because my infrastructure code updates work better and faster than the code we started with. And am I writing about this because everyone fails regularly; it is so very, very normal. If you're not failing regularly, I don't think you're trying hard enough to learn. + +### Break things and train people + +You'd also think no one would let me train anyone ever; that it's the worst idea ever because (as my team jokes) you should never, ever do the things I do. However, my boss has me train anyone walking in the door pretty regularly. I even provide training for entire teams using our infrastructure or code to teach people how to build their own infrastructure. + +Here's why: Failure is your first step to success. Failure's lesson isn't just "backups are a fantastic idea." No, from failure, you learn to recover faster, troubleshoot quicker, and get amazingly better at your job. When you get amazing at your job, you can train others about what not to do and help them understand how everything works. Because of your experience, they will be a step ahead of you were when you started—and they, too, will most likely fail in new, amazing, epic ways that everyone can learn from. + +### You are only as good as your failures + +Nobody is born with talent in software engineering and cloud infrastructure, just like no one is born walking. We all start by rolling and bumping into things. From there, we learn to crawl and then stand for a moment or two. When we start walking, we fall and scratch our knees, bump our elbows, and—at least in my brother's case—walk right into a table's sharp corner and get stitches in the center of your eyebrow. + +Things take time to learn. Read everything you can get your hands on to help you along your way—but that is always the beginning. Perfection is some fantasy that's impossible to achieve; you must fail to reach success. + +Every step of the way, my failures teach me how to do things better. + +Ultimately, you are only as good as the sum of your failures, because that's what shows you how successful you are. + +Open source is about more than the code, it’s about the culture. The open culture that many open... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/failure-driven-development + +作者:[Jessica Cherry][a] +选题:[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/jrepka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fail_failure_celebrate.png?itok=LbvDAEZF (failure sign at a party, celebrating failure) +[2]: https://www.redhat.com/en/topics/containers/what-is-kubernetes +[3]: https://github.com/hashicorp/terraform From 2c002a3d893225a4c5308080ee609ec246a6cf18 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Apr 2020 00:58:42 +0800 Subject: [PATCH 0073/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200331=205=20?= =?UTF-8?q?ways=20to=20level=20up=20your=20Vim=20skills?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200331 5 ways to level up your Vim skills.md --- ...0331 5 ways to level up your Vim skills.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20200331 5 ways to level up your Vim skills.md diff --git a/sources/tech/20200331 5 ways to level up your Vim skills.md b/sources/tech/20200331 5 ways to level up your Vim skills.md new file mode 100644 index 0000000000..f5c315b1e7 --- /dev/null +++ b/sources/tech/20200331 5 ways to level up your Vim skills.md @@ -0,0 +1,161 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 ways to level up your Vim skills) +[#]: via: (https://opensource.com/article/20/3/vim-skills) +[#]: author: (Detlef Johnson https://opensource.com/users/deckart) + +5 ways to level up your Vim skills +====== +Kick your text editor up a notch with a few fun tricks. +![Computer keyboard typing][1] + +Vim is one of the most popular text editors out there, so it is definitely worth taking time to learn how to use it. If the only things you learn how to do with the ubiquitous [Vi(m)][2] command-line text editor are to open a file, enter and edit some text, save the edited files, and exit the program, you will be much better off for it. + +Circumstances where you will find it extremely convenient to know Vim nearly always involve tasks running remote shell operations. If you regularly use secure shell:  + + +``` +`$ ssh user@hostname.provider.com` +``` + +and work with virtual private servers (VPS) or local virtualization containers, for that matter, you could benefit greatly from strong Vim skills. + +### Set Vim as your default text editor + +Vim is readily available in nearly all modern Linux (or BSD) distributions at the terminal emulator shell-command prompt. Once you've defined Vim as your default editor in your user shell, then you can navigate built-in utilities like **$ man** using familiar Vim key bindings. I'll explain how to do that with both Bash and Z shell (zsh), which is now the default shell for macOS users (since Catalina). + +#### Set Vim as default in Bash + +Bash manages settings through a combination of dotfiles. It's most common to add your preferred editor to your **.bashrc** file in your home directory, but it can be added to **.bash_profile** as well. (Read the [GNU Bash documentation][3] to understand the difference). + +Set Vim as your default editor by adding the following to **~/.bashrc**: + + +``` +# set default editor to Vim +export EDITOR=vim +``` + +A line starting with a **#** is an optional comment, which is a good way to remind yourself what a command does. + +#### Set Vim as default in Zsh + +Zsh is an increasingly popular terminal emulator, especially since Apple's FreeBSD-based Darwin system recently switched from Bash to zsh. + +The zsh dotfile parallels Bash's, so you can choose between **~/.zshrc** or **~/.zprofile**. See [the zsh documentation][4] for details on when to use which one. + +Set it as default with: + + +``` +# set default editor to Vim +export EDITOR=vim +``` + +### Optimize your Vim configuration + +Vim, much like a terminal emulator shell, uses dotfiles to set personal preferences. If you spotted the pattern, you might have guessed it's **~/.vimrc**. + +The first setting you may want to change is switching legacy Vi compatibility mode to Off. Since Vim is a superset of Vi, everything in Vi is available and vastly improved in Vim, and you get many advanced features. The latest version (8.2) allows you to open a terminal as a subprocess shell running in a split window. + +As an aside, setting legacy compatibility off might not seem like it's doing anything ([and in fact, it might not be][5]). Vim automatically switches the mode to Off by implication when it encounters a **.vimrc** file. It can still be important at times to explicitly turn it off. The shorthand "nocp" is synonymous with "nocompatible," which also works. There are many "[TIMTOWTDI][6]" conveniences for switching preferences as you work. + +Lines that begin with **"** are comments in **.vimrc** syntax (just like **#** in **.bashrc** files). They can help you remember things like why you chose a cryptic setting name. + +To turn off Vi compatibility, add the following to your **~/.vimrc** file: + + +``` +" ensure that legacy compatibility mode is off +" documentation: ' +set nocp +``` + +### Understand modes + +The notion of Vim's "modes" is very important to learn about, especially the difference between the very distinct **Normal** and **Insert** modes. Confusion about modes is what trips up most new users. Modes aren't unique to Vim, nor were they introduced by Vi. Command mode is so old that it predates the invention of [copy and paste][7] functionality in the 1970s. + +#### Important modes + +Vim depends on different modes to define keyboard-stroke behavior. The important modes to know are: + + * **Normal mode**: Default mode used primarily for navigation and opening files + * **Insert mode** (includes Replace): Where Vim allows for text input to an open file + * **Visual mode**: Where Vim acts similar to mouse-based input, such as copying, editing, replacing, and more + * **Command mode** (including Line, Ex command, and Last-line mode): A powerful way to do more in Vim + + + +Each mode has a great deal to explore. Use [Vimtutor][8] (**$ vimtutor**) to interactively learn about movement, modes, and running Ex commands in "Last Line" mode. Some indispensable productivity operators include: + +**:E** | Opens explorer for locating files and directories +---|--- +**.** | Repeats the last edit action +**;** | Repeats the last motion or movement forward +**,** | Repeats the last motion or movement backward +**/** | Searches document forward +**?** | Searches document backward +***** | Finds next occurrence of the word under the cursor +**#** | Finds the previous occurrence of the word under the cursor +**~** | Toggles case +**%** | Toggles between opening and closing **()**, **[]**, and **{}**; highly useful for coding +**z=** | Makes spelling suggestions + +### Play Vim like a piano + +While it's important to commit Vim's operator "language" to memory, the challenge to gaining mastery is to learn to think like a musician and combine operators and movements into "key chords in harmony" so that you can play Vim like a piano. That's where the power of text manipulation with Vim rivals that of the other notable command-line editor, Emacs. (While one of these editors will wear down your **Esc** key, using the other will wear down your **Ctrl** key.) + +When describing key chords, it's conventional in Vim to designate the **Ctrl** key using the capital letter C, followed by a hyphen (**C-**). It's not universal, but I will follow that convention from here onward and clarify when there is any potential for confusion. + +If you type long lines in Vim, you'll want to set it to wrap your text. To start personalizing Vim for the way you work, think about that setting: How would you like Vim to handle text wrapping by default when it starts? On or off? I like it turned off and leave it out of the runtime commands file. When I want text to wrap, I simply set it in command-line mode with **:set wrap**. + +There's nothing wrong with having Vim set to wrap text by default. It's simply a matter of preference—which can change over time. The same goes for handling paste, code language indent syntax, and the **Tab** key (tabs or spaces? and how many spaces then? Dive into these options [here][9]). All these options for default behavior are entirely configurable and changeable in real time as you work with command-line mode operations. + +You will find many suggestions for setting Vim defaults in community forums, on Vim wikis, and in articles (like this one). Setting preferences for your personal computing environment should be fairly familiar to you, and Vim is no different. I highly recommend that you start by making very small changes to your settings, and make additional changes slowly so that you can easily revert settings. This way, you might avoid the use of plugins for years—or entirely. + +### Splits, tabs, and terminals in Vim 8.2 + +There are two ways to split your working files into different views: they can appear side-by-side, or you can switch between them with full (window) screens using application tabs. These changes to your application window are initiated from command-line mode, which requires a colon (**:**) to call up the prompt. + +Each window split can host a file for editing, and you can arrange tabs to switch between additional files as much as you like. There is limited screen space for splits, so tabs are handy when you want to split more screens. How you decide to work is purely a matter of preference. To split a window horizontally, use **:sp**, and use **:vs** for vertical splits. + +As of [Vim 8.2][10], you can open a terminal shell sub-process in a vertical split with **:vert term** to run operations on the command line right alongside your code. You need to type **exit** to close your terminal process, just like you would end a shell session, but you close splits and tabs the same way you would close any ordinary Vim window, with **:q**. + +To initialize a tab, use a special edit command: **:tabedit**, which automatically switches you to the new open tab. If you give the command a file name as an argument, that file will open for editing. If you neglect to give it a file name as an argument, the command-line mode edit **:e filename.txt** works just like it would in any ordinary Vim window. Navigate tabs with the next (**:tabn**) and previous (**:tabp**) commands. + +To use splits, you need to know how to navigate among them using the key-chord combination **C-w** plus a movement key in the direction you want to move, such as left (**h**), down (**j**), up (**k**), or right (**l**). When you want to learn more key chords specific to splits and tabs, read the **:help split** and **:help tabpage** for the Vim manual entries. + +### Get help + +While the Vim manual is referenced in Vimtutor, opening Vim help with **:help** will let you spend time with the editor on your own and get more productive without wholly relying on articles like this one. Experience is key to Vim mastery. The experience contributes to your overall computing intuition since so much of what has gone into Vim is drawn from the Unix universe. + +Have fun exploring the beauty of Vim, and share any questions you have in the comments. + +Want to become a master of text editing in the terminal, and beyond? These tips for getting started... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/vim-skills + +作者:[Detlef Johnson][a] +选题:[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/deckart +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboaord_enter_writing_documentation.jpg?itok=kKrnXc5h (Computer keyboard typing) +[2]: https://www.vim.org/ +[3]: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html +[4]: http://zsh.sourceforge.net/Intro/intro_3.html +[5]: http://vimdoc.sourceforge.net/htmldoc/starting.html#compatible-default +[6]: https://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_do_it +[7]: https://www.npr.org/2020/02/22/808404858/remembering-the-pioneer-behind-your-computers-cut-copy-and-paste-functions +[8]: http://www2.geog.ucl.ac.uk/~plewis/teaching/unix/vimtutor +[9]: https://opensource.com/article/18/9/vi-editor-productivity-powerhouse +[10]: https://www.vim.org/vim-8.2-released.php From 827e7108cd4c58e41b5aeea69ef49f59bb36bbca Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 1 Apr 2020 08:19:35 +0800 Subject: [PATCH 0074/1809] translated --- ...n source tools for sticking to a budget.md | 56 ------------------- ...n source tools for sticking to a budget.md | 55 ++++++++++++++++++ 2 files changed, 55 insertions(+), 56 deletions(-) delete mode 100644 sources/tech/20200326 3 open source tools for sticking to a budget.md create mode 100644 translated/tech/20200326 3 open source tools for sticking to a budget.md diff --git a/sources/tech/20200326 3 open source tools for sticking to a budget.md b/sources/tech/20200326 3 open source tools for sticking to a budget.md deleted file mode 100644 index 66b440be97..0000000000 --- a/sources/tech/20200326 3 open source tools for sticking to a budget.md +++ /dev/null @@ -1,56 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 open source tools for sticking to a budget) -[#]: via: (https://opensource.com/article/20/3/open-source-budget) -[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) - -3 open source tools for sticking to a budget -====== -Find the right solution for you in this roundup of open source budgeting -tools. Plus, learn about an open source tax preparation software. -![A dollar sign in a network][1] - -In light of changing economical times in many countries around the world right now, you may find yourself wanting to revamp or improve your financial situation and your understanding of it. Or, perhaps one of your New Year's resolutions was to start budgeting? You are not alone. - -The best way to stick to that resolution is to keep track of the money you are spending and making on a regular basis. The problem is, many popular personal finance apps out there are proprietary. Are you looking for an open source alternative to Quicken, Mint, or You Need a Budget? Whether you are new to open source software or new to budgeting in general, one of these tools will suit your needs and comfort level.  - -### LibreOffice Calc - -I recommend using LibreOffice Calc to any open source newcomer who wants to start budgeting. If you've used proprietary spreadsheets like Google Sheets or Microsoft Excel, the LibreOffice Calc template will be very familiar. In this [budgeting tutorial][2], author Jess Weichler has done a lot of the work for you by including a handy, downloadable template. The template already has expense categories like utility bills, groceries, dining out, and more, but you have the freedom to customize it to your lifestyle. In a second article, she shows you how to [create your own templates][3].  - -### HomeBank - -HomeBank is another great option for open source users of all levels. HomeBank is free, yet it has plenty of analysis and transaction features like its proprietary counterparts. In fact, you can export and import Quicken files to HomeBank, which makes transitioning to this open source app a breeze. Finally, you can use a tool to help you make wise decisions about your money without spending more money. Learn how to get started in Jessica Cherry's [tutorial][4].  - -### GnuCash - -Like the other budgeting tools mentioned here, GnuCash can be used on Windows, macOS, and Linux. There is a slew of documentation available, but our very own Don Watkins guides you through the steps of setting up GnuCash on Linux in [this tutorial][5]. Not only is GnuCash a great option for taking control of your personal finances, but it also has features like invoicing to help you manage your small business.  - -### Bonus: OpenTaxSolver - -The dreaded tax season can be a stressful time for many Americans. Many folks purchase TurboTax or use an accountant or tax service to do their taxes. Contrary to popular belief, open source tax preparation software exists! Author Jessica Cherry did the belaboring research and introduces our readers to OpenTaxSolver in [this article][6]. To use OpenTaxSolver successfully, you'll need keen attention to detail, but you won't have to worry about doing the complicated math.  - -Which open source budgeting app will you try? Do you have a favorite tool that I didn't mention in this list? Share your thoughts in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/open-source-budget - -作者:[Lauren Pritchett][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/lauren-pritchett -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_whitehurst_money.png?itok=ls-SOzM0 (A dollar sign in a network) -[2]: https://opensource.com/article/20/3/libreoffice-open-source-budget -[3]: https://opensource.com/article/20/3/libreoffice-templates -[4]: https://opensource.com/article/20/2/open-source-homebank -[5]: https://opensource.com/article/20/2/gnucash -[6]: https://opensource.com/article/20/2/open-source-taxes diff --git a/translated/tech/20200326 3 open source tools for sticking to a budget.md b/translated/tech/20200326 3 open source tools for sticking to a budget.md new file mode 100644 index 0000000000..99786659e5 --- /dev/null +++ b/translated/tech/20200326 3 open source tools for sticking to a budget.md @@ -0,0 +1,55 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 open source tools for sticking to a budget) +[#]: via: (https://opensource.com/article/20/3/open-source-budget) +[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) + +3 个控制预算的开源工具 +====== +在这篇开源预算工具汇总中找到适合你的解决方案。另外学习有关开源税收准备软件。 +![A dollar sign in a network][1] + +鉴于目前世界上许多国家/地区的经济形势都在变化,你可能会想修改或改善财务状况和你对它的了解。或者,也许你的新年决心之一是开始预算?你不是一个人。 + +坚持该决心的最佳方法是定期跟踪你的支出和收入。问题是,许多流行的个人理财应用都是专有的。你是否正在寻找 Quicken、Mint 或 You Need a Budget 的开源替代方案?无论你是开源软件新手,还是预算新手,这些工具之一都将满足你的需求和舒适度。 + +### LibreOffice Calc + +我建议希望做预算的任何开源新手使用 LibreOffice Calc。如果你使用过 Google Sheets 或 Microsoft Excel 等专有电子表格,那么 LibreOffice Calc 模板将非常熟悉。在此[预算教程][2]中,作者 Jess Weichler 已经为你提供了方便、可下载的模板。该模板已经有费用类别,例如水电费、杂货、外出就餐等,但是你可以自由地根据自己的生活方式对其进行自定义。在第二篇文章中,她向你展示了如何[创建自己的模板][3]。 + +### HomeBank + +对于所有的开源用户来说,HomeBank 都是另一个不错的选择。HomeBank 是免费的,但它拥有许多它同类专有软件的分析和交易功能。实际上,你可以将 Quicken 文件导入到 HomeBank 中,这使得转换到它变得轻而易举。最后,你可以使用一种工具来帮助你明智地做出有关资金的决定,而无需花费更多的钱。在 Jessica Cherry 的[教程][4]中学习如何入门。 + +### GnuCash + +就像这里提到的其他预算工具一样,GnuCash 可以在 Windows、macOS 和 Linux 上使用。它提供了大量文档,但 Don Watkins 会在[此教程][5]中指导你在 Linux 上设置 GnuCash。GnuCash 不仅是控制个人财务的绝佳选择,而且还有开发票等功能来帮助你管理小型企业。 + +### 额外一个:OpenTaxSolver + +对许多美国人来说,可怕的税收季可能是一个压力大的时期。许多人购买 TurboTax 或请会计师或税务服务来缴税。与普遍的看法相反,存在开源的税务准备软件!作者 Jessica Cherry 在[本文][6]中做了研究,并向读者介绍 OpenTaxSolver。要正确使用 OpenTaxSolver,你需要特别注意细节,但是你不必担心进行复杂的数学运算。 + +你会尝试使用哪个开源预算应用?你是否有我在此列表中未提及的最喜欢的工具?请在评论区分享你的观点。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/open-source-budget + +作者:[Lauren Pritchett][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lauren-pritchett +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_whitehurst_money.png?itok=ls-SOzM0 (A dollar sign in a network) +[2]: https://opensource.com/article/20/3/libreoffice-open-source-budget +[3]: https://opensource.com/article/20/3/libreoffice-templates +[4]: https://opensource.com/article/20/2/open-source-homebank +[5]: https://opensource.com/article/20/2/gnucash +[6]: https://opensource.com/article/20/2/open-source-taxes From 7b761a7d01541496dfc02b041bdf2c7db5106c44 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 1 Apr 2020 08:23:35 +0800 Subject: [PATCH 0075/1809] translating --- sources/tech/20190605 What is GraphQL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190605 What is GraphQL.md b/sources/tech/20190605 What is GraphQL.md index 56d0690cca..11b36946f4 100644 --- a/sources/tech/20190605 What is GraphQL.md +++ b/sources/tech/20190605 What is GraphQL.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 772875dbc05dc7a70c652e33ebdcf932269cf985 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Apr 2020 09:33:57 +0800 Subject: [PATCH 0076/1809] PUB @wxy https://linux.cn/article-12060-1.html --- .../20190429 10 moments that shaped Linux history.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/talk => published}/20190429 10 moments that shaped Linux history.md (97%) diff --git a/translated/talk/20190429 10 moments that shaped Linux history.md b/published/20190429 10 moments that shaped Linux history.md similarity index 97% rename from translated/talk/20190429 10 moments that shaped Linux history.md rename to published/20190429 10 moments that shaped Linux history.md index c9f1328ed2..8dc04ce5de 100644 --- a/translated/talk/20190429 10 moments that shaped Linux history.md +++ b/published/20190429 10 moments that shaped Linux history.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12060-1.html) [#]: subject: (10 moments that shaped Linux history) [#]: via: (https://opensource.com/article/19/4/top-moments-linux-history) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) @@ -12,7 +12,7 @@ > 自 1991 年诞生以来,Linux 已经走了漫长的一段路,而这些事件标志着它的发展。 -![Penguin with green background][1] +![](https://img.linux.net.cn/data/attachment/album/202004/01/093243wukmsiwdkkwfrg00.jpg) 在 2018 年 8 月,Opensource.com 发布了一项包含七个选项的民意测验,询问读者:[Linux 历史上最重要的时刻是什么?][2]我觉得我需要扩大这个清单,并提出我认为的 10 个在塑造 Linux 历史上发挥了重要作用的时刻。 From 5825fac64bf34a347dbddd7f431dd4ecd92cce79 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Apr 2020 09:38:11 +0800 Subject: [PATCH 0077/1809] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20202003?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- published/{ => 202003}/20170918 Fun and Games in Emacs.md | 0 .../{ => 202003}/20180306 Exploring free and open web fonts.md | 0 ...20180522 Advanced use of the less text file viewer in Linux.md | 0 .../20180708 Building a Messenger App- Conversations.md | 0 .../20181231 Troubleshooting hardware problems in Linux.md | 0 published/{ => 202003}/20190113 Editing Subtitles in Linux.md | 0 ...are Files From Linux Command Line Using Firefox Send Client.md | 0 published/{ => 202003}/20190422 9 ways to save the planet.md | 0 ... Disable SSH Access For A Particular User Or Group In Linux.md | 0 .../20190731 How to structure a multi-file C program- Part 2.md | 0 ...813 Building a non-breaking breakpoint for Python debugging.md | 0 .../20190925 Debugging in Emacs- The Grand Unified Debugger.md | 0 ...is an open source scientific calculator for your smartphone.md | 0 .../{ => 202003}/20191223 10 articles to learn Linux your way.md | 0 .../20191223 Prioritizing simplicity in your Python code.md | 0 ...191226 10 Linux command tutorials for beginners and experts.md | 0 .../{ => 202003}/20200113 How to setup a DNS server with bind.md | 0 .../20200121 Syncthing- Open Source P2P File Syncing Tool.md | 0 .../20200123 6 things you should be doing with Emacs.md | 0 ...27 Build your own cloud with Fedora 31 and Nextcloud Server.md | 0 .../20200129 Use Emacs to get social and track your todo list.md | 0 .../20200130 4 open source productivity tools on my wishlist.md | 0 .../20200204 DevOps vs Agile- What-s the difference.md | 0 .../20200211 Basic kubectl and Helm commands for beginners.md | 0 .../20200212 Extend the life of your SSD drive with fstrim.md | 0 ...w to set up your own fast, private open source mesh network.md | 0 published/{ => 202003}/20200214 Linux is our love language.md | 0 .../20200214 PHP Development on Fedora with Eclipse.md | 0 ...9 Basic Vim Commands You Need to Know to Work in Vim Editor.md | 0 ...219 Here Are The Most Beautiful Linux Distributions in 2020.md | 0 ...0219 How to find what you-re looking for on Linux with find.md | 0 .../20200219 Try this Bash script for-large filesystems.md | 0 ...20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md | 0 published/{ => 202003}/20200220 Tools for SSH key management.md | 0 .../{ => 202003}/20200224 Using C and C-- for data science.md | 0 ...hat developers need to know about domain-specific languages.md | 0 .../20200225 3 eBook readers for the Linux desktop.md | 0 .../20200225 7 tips for writing an effective technical resume.md | 0 .../20200226 Use logzero for simple logging in Python.md | 0 ...g between uppercase and lowercase on the Linux command line.md | 0 .../20200302 How to Add New Brushes in GIMP -Quick Tip.md | 0 published/{ => 202003}/20200302 Install GNU Emacs on Windows.md | 0 ...200303 Getting started with the Rust package manager, Cargo.md | 0 ...ource Private Messenger That Doesn-t Need Your Phone Number.md | 0 ...inux Aims to Bring Console Gaming Experience on the Desktop.md | 0 .../20200305 Install and Use Wireshark on Ubuntu Linux.md | 0 ...06 Communicating with other users on the Linux command line.md | 0 ...Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md | 0 .../{ => 202003}/20200309 6 Raspberry Pi tutorials to try out.md | 0 .../20200310 2020 Will Be a Year of Hindsight for SD-WAN.md | 0 ...A Firefox Fork For The Classic Looks and Classic Extensions.md | 0 ...ainers vs. VMs, Istio in production, and more industry news.md | 0 .../20200310 Run Kubernetes on a Raspberry Pi with k3s.md | 0 .../20200311 How to install pip to manage PyPI packages easily.md | 0 ...unched Its Own Linux Distribution But It-s Not for Everyone.md | 0 ... write effective documentation for your open source project.md | 0 ...13 6 Best AUR (Arch User Repository) Helpers for Arch Linux.md | 0 ... GNOME 3.36 Released With Visual - Performance Improvements.md | 0 .../{ => 202003}/20200313 How to Change MAC Address in Linux.md | 0 .../20200314 How to Install Netbeans on Ubuntu and Other Linux.md | 0 .../20200316 Connect your Google Drive to Fedora Workstation.md | 0 .../20200317 Coronavirus challenges remote networking.md | 0 .../20200317 Viewing and configuring password aging on Linux.md | 0 .../20200318 Top 10 open source tools for working from home.md | 0 .../20200319 4 Markdown tools for the Linux command line.md | 0 ...20200319 7 open hardware projects working to solve COVID-19.md | 0 ...19 Fedora 32 Release Date, New Features and Everything Else.md | 0 .../{ => 202003}/20200319 Manually rotating log files on Linux.md | 0 ...ds- Advice on Working From Home during Coronavirus Lockdown.md | 0 .../20200322 Meet DebianDog - Puppy sized Debian Linux.md | 0 ...322 Purism Librem Mini- A Privacy-First Linux-Based Mini PC.md | 0 .../20200327 How open source software is fighting COVID-19.md | 0 72 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 202003}/20170918 Fun and Games in Emacs.md (100%) rename published/{ => 202003}/20180306 Exploring free and open web fonts.md (100%) rename published/{ => 202003}/20180522 Advanced use of the less text file viewer in Linux.md (100%) rename published/{ => 202003}/20180708 Building a Messenger App- Conversations.md (100%) rename published/{ => 202003}/20181231 Troubleshooting hardware problems in Linux.md (100%) rename published/{ => 202003}/20190113 Editing Subtitles in Linux.md (100%) rename published/{ => 202003}/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md (100%) rename published/{ => 202003}/20190422 9 ways to save the planet.md (100%) rename published/{ => 202003}/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md (100%) rename published/{ => 202003}/20190731 How to structure a multi-file C program- Part 2.md (100%) rename published/{ => 202003}/20190813 Building a non-breaking breakpoint for Python debugging.md (100%) rename published/{ => 202003}/20190925 Debugging in Emacs- The Grand Unified Debugger.md (100%) rename published/{ => 202003}/20191126 Calculator N- is an open source scientific calculator for your smartphone.md (100%) rename published/{ => 202003}/20191223 10 articles to learn Linux your way.md (100%) rename published/{ => 202003}/20191223 Prioritizing simplicity in your Python code.md (100%) rename published/{ => 202003}/20191226 10 Linux command tutorials for beginners and experts.md (100%) rename published/{ => 202003}/20200113 How to setup a DNS server with bind.md (100%) rename published/{ => 202003}/20200121 Syncthing- Open Source P2P File Syncing Tool.md (100%) rename published/{ => 202003}/20200123 6 things you should be doing with Emacs.md (100%) rename published/{ => 202003}/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md (100%) rename published/{ => 202003}/20200129 Use Emacs to get social and track your todo list.md (100%) rename published/{ => 202003}/20200130 4 open source productivity tools on my wishlist.md (100%) rename published/{ => 202003}/20200204 DevOps vs Agile- What-s the difference.md (100%) rename published/{ => 202003}/20200211 Basic kubectl and Helm commands for beginners.md (100%) rename published/{ => 202003}/20200212 Extend the life of your SSD drive with fstrim.md (100%) rename published/{ => 202003}/20200214 How to set up your own fast, private open source mesh network.md (100%) rename published/{ => 202003}/20200214 Linux is our love language.md (100%) rename published/{ => 202003}/20200214 PHP Development on Fedora with Eclipse.md (100%) rename published/{ => 202003}/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md (100%) rename published/{ => 202003}/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md (100%) rename published/{ => 202003}/20200219 How to find what you-re looking for on Linux with find.md (100%) rename published/{ => 202003}/20200219 Try this Bash script for-large filesystems.md (100%) rename published/{ => 202003}/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md (100%) rename published/{ => 202003}/20200220 Tools for SSH key management.md (100%) rename published/{ => 202003}/20200224 Using C and C-- for data science.md (100%) rename published/{ => 202003}/20200224 What developers need to know about domain-specific languages.md (100%) rename published/{ => 202003}/20200225 3 eBook readers for the Linux desktop.md (100%) rename published/{ => 202003}/20200225 7 tips for writing an effective technical resume.md (100%) rename published/{ => 202003}/20200226 Use logzero for simple logging in Python.md (100%) rename published/{ => 202003}/20200228 Converting between uppercase and lowercase on the Linux command line.md (100%) rename published/{ => 202003}/20200302 How to Add New Brushes in GIMP -Quick Tip.md (100%) rename published/{ => 202003}/20200302 Install GNU Emacs on Windows.md (100%) rename published/{ => 202003}/20200303 Getting started with the Rust package manager, Cargo.md (100%) rename published/{ => 202003}/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md (100%) rename published/{ => 202003}/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md (100%) rename published/{ => 202003}/20200305 Install and Use Wireshark on Ubuntu Linux.md (100%) rename published/{ => 202003}/20200306 Communicating with other users on the Linux command line.md (100%) rename published/{ => 202003}/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md (100%) rename published/{ => 202003}/20200309 6 Raspberry Pi tutorials to try out.md (100%) rename published/{ => 202003}/20200310 2020 Will Be a Year of Hindsight for SD-WAN.md (100%) rename published/{ => 202003}/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md (100%) rename published/{ => 202003}/20200310 Containers vs. VMs, Istio in production, and more industry news.md (100%) rename published/{ => 202003}/20200310 Run Kubernetes on a Raspberry Pi with k3s.md (100%) rename published/{ => 202003}/20200311 How to install pip to manage PyPI packages easily.md (100%) rename published/{ => 202003}/20200312 Amazon Has Launched Its Own Linux Distribution But It-s Not for Everyone.md (100%) rename published/{ => 202003}/20200312 How to write effective documentation for your open source project.md (100%) rename published/{ => 202003}/20200313 6 Best AUR (Arch User Repository) Helpers for Arch Linux.md (100%) rename published/{ => 202003}/20200313 GNOME 3.36 Released With Visual - Performance Improvements.md (100%) rename published/{ => 202003}/20200313 How to Change MAC Address in Linux.md (100%) rename published/{ => 202003}/20200314 How to Install Netbeans on Ubuntu and Other Linux.md (100%) rename published/{ => 202003}/20200316 Connect your Google Drive to Fedora Workstation.md (100%) rename published/{ => 202003}/20200317 Coronavirus challenges remote networking.md (100%) rename published/{ => 202003}/20200317 Viewing and configuring password aging on Linux.md (100%) rename published/{ => 202003}/20200318 Top 10 open source tools for working from home.md (100%) rename published/{ => 202003}/20200319 4 Markdown tools for the Linux command line.md (100%) rename published/{ => 202003}/20200319 7 open hardware projects working to solve COVID-19.md (100%) rename published/{ => 202003}/20200319 Fedora 32 Release Date, New Features and Everything Else.md (100%) rename published/{ => 202003}/20200319 Manually rotating log files on Linux.md (100%) rename published/{ => 202003}/20200322 Linus Torvalds- Advice on Working From Home during Coronavirus Lockdown.md (100%) rename published/{ => 202003}/20200322 Meet DebianDog - Puppy sized Debian Linux.md (100%) rename published/{ => 202003}/20200322 Purism Librem Mini- A Privacy-First Linux-Based Mini PC.md (100%) rename published/{ => 202003}/20200327 How open source software is fighting COVID-19.md (100%) diff --git a/published/20170918 Fun and Games in Emacs.md b/published/202003/20170918 Fun and Games in Emacs.md similarity index 100% rename from published/20170918 Fun and Games in Emacs.md rename to published/202003/20170918 Fun and Games in Emacs.md diff --git a/published/20180306 Exploring free and open web fonts.md b/published/202003/20180306 Exploring free and open web fonts.md similarity index 100% rename from published/20180306 Exploring free and open web fonts.md rename to published/202003/20180306 Exploring free and open web fonts.md diff --git a/published/20180522 Advanced use of the less text file viewer in Linux.md b/published/202003/20180522 Advanced use of the less text file viewer in Linux.md similarity index 100% rename from published/20180522 Advanced use of the less text file viewer in Linux.md rename to published/202003/20180522 Advanced use of the less text file viewer in Linux.md diff --git a/published/20180708 Building a Messenger App- Conversations.md b/published/202003/20180708 Building a Messenger App- Conversations.md similarity index 100% rename from published/20180708 Building a Messenger App- Conversations.md rename to published/202003/20180708 Building a Messenger App- Conversations.md diff --git a/published/20181231 Troubleshooting hardware problems in Linux.md b/published/202003/20181231 Troubleshooting hardware problems in Linux.md similarity index 100% rename from published/20181231 Troubleshooting hardware problems in Linux.md rename to published/202003/20181231 Troubleshooting hardware problems in Linux.md diff --git a/published/20190113 Editing Subtitles in Linux.md b/published/202003/20190113 Editing Subtitles in Linux.md similarity index 100% rename from published/20190113 Editing Subtitles in Linux.md rename to published/202003/20190113 Editing Subtitles in Linux.md diff --git a/published/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md b/published/202003/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md similarity index 100% rename from published/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md rename to published/202003/20190124 ffsend - Easily And Securely Share Files From Linux Command Line Using Firefox Send Client.md diff --git a/published/20190422 9 ways to save the planet.md b/published/202003/20190422 9 ways to save the planet.md similarity index 100% rename from published/20190422 9 ways to save the planet.md rename to published/202003/20190422 9 ways to save the planet.md diff --git a/published/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md b/published/202003/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md similarity index 100% rename from published/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md rename to published/202003/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md diff --git a/published/20190731 How to structure a multi-file C program- Part 2.md b/published/202003/20190731 How to structure a multi-file C program- Part 2.md similarity index 100% rename from published/20190731 How to structure a multi-file C program- Part 2.md rename to published/202003/20190731 How to structure a multi-file C program- Part 2.md diff --git a/published/20190813 Building a non-breaking breakpoint for Python debugging.md b/published/202003/20190813 Building a non-breaking breakpoint for Python debugging.md similarity index 100% rename from published/20190813 Building a non-breaking breakpoint for Python debugging.md rename to published/202003/20190813 Building a non-breaking breakpoint for Python debugging.md diff --git a/published/20190925 Debugging in Emacs- The Grand Unified Debugger.md b/published/202003/20190925 Debugging in Emacs- The Grand Unified Debugger.md similarity index 100% rename from published/20190925 Debugging in Emacs- The Grand Unified Debugger.md rename to published/202003/20190925 Debugging in Emacs- The Grand Unified Debugger.md diff --git a/published/20191126 Calculator N- is an open source scientific calculator for your smartphone.md b/published/202003/20191126 Calculator N- is an open source scientific calculator for your smartphone.md similarity index 100% rename from published/20191126 Calculator N- is an open source scientific calculator for your smartphone.md rename to published/202003/20191126 Calculator N- is an open source scientific calculator for your smartphone.md diff --git a/published/20191223 10 articles to learn Linux your way.md b/published/202003/20191223 10 articles to learn Linux your way.md similarity index 100% rename from published/20191223 10 articles to learn Linux your way.md rename to published/202003/20191223 10 articles to learn Linux your way.md diff --git a/published/20191223 Prioritizing simplicity in your Python code.md b/published/202003/20191223 Prioritizing simplicity in your Python code.md similarity index 100% rename from published/20191223 Prioritizing simplicity in your Python code.md rename to published/202003/20191223 Prioritizing simplicity in your Python code.md diff --git a/published/20191226 10 Linux command tutorials for beginners and experts.md b/published/202003/20191226 10 Linux command tutorials for beginners and experts.md similarity index 100% rename from published/20191226 10 Linux command tutorials for beginners and experts.md rename to published/202003/20191226 10 Linux command tutorials for beginners and experts.md diff --git a/published/20200113 How to setup a DNS server with bind.md b/published/202003/20200113 How to setup a DNS server with bind.md similarity index 100% rename from published/20200113 How to setup a DNS server with bind.md rename to published/202003/20200113 How to setup a DNS server with bind.md diff --git a/published/20200121 Syncthing- Open Source P2P File Syncing Tool.md b/published/202003/20200121 Syncthing- Open Source P2P File Syncing Tool.md similarity index 100% rename from published/20200121 Syncthing- Open Source P2P File Syncing Tool.md rename to published/202003/20200121 Syncthing- Open Source P2P File Syncing Tool.md diff --git a/published/20200123 6 things you should be doing with Emacs.md b/published/202003/20200123 6 things you should be doing with Emacs.md similarity index 100% rename from published/20200123 6 things you should be doing with Emacs.md rename to published/202003/20200123 6 things you should be doing with Emacs.md diff --git a/published/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md b/published/202003/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md similarity index 100% rename from published/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md rename to published/202003/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md diff --git a/published/20200129 Use Emacs to get social and track your todo list.md b/published/202003/20200129 Use Emacs to get social and track your todo list.md similarity index 100% rename from published/20200129 Use Emacs to get social and track your todo list.md rename to published/202003/20200129 Use Emacs to get social and track your todo list.md diff --git a/published/20200130 4 open source productivity tools on my wishlist.md b/published/202003/20200130 4 open source productivity tools on my wishlist.md similarity index 100% rename from published/20200130 4 open source productivity tools on my wishlist.md rename to published/202003/20200130 4 open source productivity tools on my wishlist.md diff --git a/published/20200204 DevOps vs Agile- What-s the difference.md b/published/202003/20200204 DevOps vs Agile- What-s the difference.md similarity index 100% rename from published/20200204 DevOps vs Agile- What-s the difference.md rename to published/202003/20200204 DevOps vs Agile- What-s the difference.md diff --git a/published/20200211 Basic kubectl and Helm commands for beginners.md b/published/202003/20200211 Basic kubectl and Helm commands for beginners.md similarity index 100% rename from published/20200211 Basic kubectl and Helm commands for beginners.md rename to published/202003/20200211 Basic kubectl and Helm commands for beginners.md diff --git a/published/20200212 Extend the life of your SSD drive with fstrim.md b/published/202003/20200212 Extend the life of your SSD drive with fstrim.md similarity index 100% rename from published/20200212 Extend the life of your SSD drive with fstrim.md rename to published/202003/20200212 Extend the life of your SSD drive with fstrim.md diff --git a/published/20200214 How to set up your own fast, private open source mesh network.md b/published/202003/20200214 How to set up your own fast, private open source mesh network.md similarity index 100% rename from published/20200214 How to set up your own fast, private open source mesh network.md rename to published/202003/20200214 How to set up your own fast, private open source mesh network.md diff --git a/published/20200214 Linux is our love language.md b/published/202003/20200214 Linux is our love language.md similarity index 100% rename from published/20200214 Linux is our love language.md rename to published/202003/20200214 Linux is our love language.md diff --git a/published/20200214 PHP Development on Fedora with Eclipse.md b/published/202003/20200214 PHP Development on Fedora with Eclipse.md similarity index 100% rename from published/20200214 PHP Development on Fedora with Eclipse.md rename to published/202003/20200214 PHP Development on Fedora with Eclipse.md diff --git a/published/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md b/published/202003/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md similarity index 100% rename from published/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md rename to published/202003/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md diff --git a/published/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md b/published/202003/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md similarity index 100% rename from published/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md rename to published/202003/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md diff --git a/published/20200219 How to find what you-re looking for on Linux with find.md b/published/202003/20200219 How to find what you-re looking for on Linux with find.md similarity index 100% rename from published/20200219 How to find what you-re looking for on Linux with find.md rename to published/202003/20200219 How to find what you-re looking for on Linux with find.md diff --git a/published/20200219 Try this Bash script for-large filesystems.md b/published/202003/20200219 Try this Bash script for-large filesystems.md similarity index 100% rename from published/20200219 Try this Bash script for-large filesystems.md rename to published/202003/20200219 Try this Bash script for-large filesystems.md diff --git a/published/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md b/published/202003/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md similarity index 100% rename from published/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md rename to published/202003/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md diff --git a/published/20200220 Tools for SSH key management.md b/published/202003/20200220 Tools for SSH key management.md similarity index 100% rename from published/20200220 Tools for SSH key management.md rename to published/202003/20200220 Tools for SSH key management.md diff --git a/published/20200224 Using C and C-- for data science.md b/published/202003/20200224 Using C and C-- for data science.md similarity index 100% rename from published/20200224 Using C and C-- for data science.md rename to published/202003/20200224 Using C and C-- for data science.md diff --git a/published/20200224 What developers need to know about domain-specific languages.md b/published/202003/20200224 What developers need to know about domain-specific languages.md similarity index 100% rename from published/20200224 What developers need to know about domain-specific languages.md rename to published/202003/20200224 What developers need to know about domain-specific languages.md diff --git a/published/20200225 3 eBook readers for the Linux desktop.md b/published/202003/20200225 3 eBook readers for the Linux desktop.md similarity index 100% rename from published/20200225 3 eBook readers for the Linux desktop.md rename to published/202003/20200225 3 eBook readers for the Linux desktop.md diff --git a/published/20200225 7 tips for writing an effective technical resume.md b/published/202003/20200225 7 tips for writing an effective technical resume.md similarity index 100% rename from published/20200225 7 tips for writing an effective technical resume.md rename to published/202003/20200225 7 tips for writing an effective technical resume.md diff --git a/published/20200226 Use logzero for simple logging in Python.md b/published/202003/20200226 Use logzero for simple logging in Python.md similarity index 100% rename from published/20200226 Use logzero for simple logging in Python.md rename to published/202003/20200226 Use logzero for simple logging in Python.md diff --git a/published/20200228 Converting between uppercase and lowercase on the Linux command line.md b/published/202003/20200228 Converting between uppercase and lowercase on the Linux command line.md similarity index 100% rename from published/20200228 Converting between uppercase and lowercase on the Linux command line.md rename to published/202003/20200228 Converting between uppercase and lowercase on the Linux command line.md diff --git a/published/20200302 How to Add New Brushes in GIMP -Quick Tip.md b/published/202003/20200302 How to Add New Brushes in GIMP -Quick Tip.md similarity index 100% rename from published/20200302 How to Add New Brushes in GIMP -Quick Tip.md rename to published/202003/20200302 How to Add New Brushes in GIMP -Quick Tip.md diff --git a/published/20200302 Install GNU Emacs on Windows.md b/published/202003/20200302 Install GNU Emacs on Windows.md similarity index 100% rename from published/20200302 Install GNU Emacs on Windows.md rename to published/202003/20200302 Install GNU Emacs on Windows.md diff --git a/published/20200303 Getting started with the Rust package manager, Cargo.md b/published/202003/20200303 Getting started with the Rust package manager, Cargo.md similarity index 100% rename from published/20200303 Getting started with the Rust package manager, Cargo.md rename to published/202003/20200303 Getting started with the Rust package manager, Cargo.md diff --git a/published/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md b/published/202003/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md similarity index 100% rename from published/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md rename to published/202003/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md diff --git a/published/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md b/published/202003/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md similarity index 100% rename from published/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md rename to published/202003/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md diff --git a/published/20200305 Install and Use Wireshark on Ubuntu Linux.md b/published/202003/20200305 Install and Use Wireshark on Ubuntu Linux.md similarity index 100% rename from published/20200305 Install and Use Wireshark on Ubuntu Linux.md rename to published/202003/20200305 Install and Use Wireshark on Ubuntu Linux.md diff --git a/published/20200306 Communicating with other users on the Linux command line.md b/published/202003/20200306 Communicating with other users on the Linux command line.md similarity index 100% rename from published/20200306 Communicating with other users on the Linux command line.md rename to published/202003/20200306 Communicating with other users on the Linux command line.md diff --git a/published/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md b/published/202003/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md similarity index 100% rename from published/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md rename to published/202003/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md diff --git a/published/20200309 6 Raspberry Pi tutorials to try out.md b/published/202003/20200309 6 Raspberry Pi tutorials to try out.md similarity index 100% rename from published/20200309 6 Raspberry Pi tutorials to try out.md rename to published/202003/20200309 6 Raspberry Pi tutorials to try out.md diff --git a/published/20200310 2020 Will Be a Year of Hindsight for SD-WAN.md b/published/202003/20200310 2020 Will Be a Year of Hindsight for SD-WAN.md similarity index 100% rename from published/20200310 2020 Will Be a Year of Hindsight for SD-WAN.md rename to published/202003/20200310 2020 Will Be a Year of Hindsight for SD-WAN.md diff --git a/published/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md b/published/202003/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md similarity index 100% rename from published/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md rename to published/202003/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md diff --git a/published/20200310 Containers vs. VMs, Istio in production, and more industry news.md b/published/202003/20200310 Containers vs. VMs, Istio in production, and more industry news.md similarity index 100% rename from published/20200310 Containers vs. VMs, Istio in production, and more industry news.md rename to published/202003/20200310 Containers vs. VMs, Istio in production, and more industry news.md diff --git a/published/20200310 Run Kubernetes on a Raspberry Pi with k3s.md b/published/202003/20200310 Run Kubernetes on a Raspberry Pi with k3s.md similarity index 100% rename from published/20200310 Run Kubernetes on a Raspberry Pi with k3s.md rename to published/202003/20200310 Run Kubernetes on a Raspberry Pi with k3s.md diff --git a/published/20200311 How to install pip to manage PyPI packages easily.md b/published/202003/20200311 How to install pip to manage PyPI packages easily.md similarity index 100% rename from published/20200311 How to install pip to manage PyPI packages easily.md rename to published/202003/20200311 How to install pip to manage PyPI packages easily.md diff --git a/published/20200312 Amazon Has Launched Its Own Linux Distribution But It-s Not for Everyone.md b/published/202003/20200312 Amazon Has Launched Its Own Linux Distribution But It-s Not for Everyone.md similarity index 100% rename from published/20200312 Amazon Has Launched Its Own Linux Distribution But It-s Not for Everyone.md rename to published/202003/20200312 Amazon Has Launched Its Own Linux Distribution But It-s Not for Everyone.md diff --git a/published/20200312 How to write effective documentation for your open source project.md b/published/202003/20200312 How to write effective documentation for your open source project.md similarity index 100% rename from published/20200312 How to write effective documentation for your open source project.md rename to published/202003/20200312 How to write effective documentation for your open source project.md diff --git a/published/20200313 6 Best AUR (Arch User Repository) Helpers for Arch Linux.md b/published/202003/20200313 6 Best AUR (Arch User Repository) Helpers for Arch Linux.md similarity index 100% rename from published/20200313 6 Best AUR (Arch User Repository) Helpers for Arch Linux.md rename to published/202003/20200313 6 Best AUR (Arch User Repository) Helpers for Arch Linux.md diff --git a/published/20200313 GNOME 3.36 Released With Visual - Performance Improvements.md b/published/202003/20200313 GNOME 3.36 Released With Visual - Performance Improvements.md similarity index 100% rename from published/20200313 GNOME 3.36 Released With Visual - Performance Improvements.md rename to published/202003/20200313 GNOME 3.36 Released With Visual - Performance Improvements.md diff --git a/published/20200313 How to Change MAC Address in Linux.md b/published/202003/20200313 How to Change MAC Address in Linux.md similarity index 100% rename from published/20200313 How to Change MAC Address in Linux.md rename to published/202003/20200313 How to Change MAC Address in Linux.md diff --git a/published/20200314 How to Install Netbeans on Ubuntu and Other Linux.md b/published/202003/20200314 How to Install Netbeans on Ubuntu and Other Linux.md similarity index 100% rename from published/20200314 How to Install Netbeans on Ubuntu and Other Linux.md rename to published/202003/20200314 How to Install Netbeans on Ubuntu and Other Linux.md diff --git a/published/20200316 Connect your Google Drive to Fedora Workstation.md b/published/202003/20200316 Connect your Google Drive to Fedora Workstation.md similarity index 100% rename from published/20200316 Connect your Google Drive to Fedora Workstation.md rename to published/202003/20200316 Connect your Google Drive to Fedora Workstation.md diff --git a/published/20200317 Coronavirus challenges remote networking.md b/published/202003/20200317 Coronavirus challenges remote networking.md similarity index 100% rename from published/20200317 Coronavirus challenges remote networking.md rename to published/202003/20200317 Coronavirus challenges remote networking.md diff --git a/published/20200317 Viewing and configuring password aging on Linux.md b/published/202003/20200317 Viewing and configuring password aging on Linux.md similarity index 100% rename from published/20200317 Viewing and configuring password aging on Linux.md rename to published/202003/20200317 Viewing and configuring password aging on Linux.md diff --git a/published/20200318 Top 10 open source tools for working from home.md b/published/202003/20200318 Top 10 open source tools for working from home.md similarity index 100% rename from published/20200318 Top 10 open source tools for working from home.md rename to published/202003/20200318 Top 10 open source tools for working from home.md diff --git a/published/20200319 4 Markdown tools for the Linux command line.md b/published/202003/20200319 4 Markdown tools for the Linux command line.md similarity index 100% rename from published/20200319 4 Markdown tools for the Linux command line.md rename to published/202003/20200319 4 Markdown tools for the Linux command line.md diff --git a/published/20200319 7 open hardware projects working to solve COVID-19.md b/published/202003/20200319 7 open hardware projects working to solve COVID-19.md similarity index 100% rename from published/20200319 7 open hardware projects working to solve COVID-19.md rename to published/202003/20200319 7 open hardware projects working to solve COVID-19.md diff --git a/published/20200319 Fedora 32 Release Date, New Features and Everything Else.md b/published/202003/20200319 Fedora 32 Release Date, New Features and Everything Else.md similarity index 100% rename from published/20200319 Fedora 32 Release Date, New Features and Everything Else.md rename to published/202003/20200319 Fedora 32 Release Date, New Features and Everything Else.md diff --git a/published/20200319 Manually rotating log files on Linux.md b/published/202003/20200319 Manually rotating log files on Linux.md similarity index 100% rename from published/20200319 Manually rotating log files on Linux.md rename to published/202003/20200319 Manually rotating log files on Linux.md diff --git a/published/20200322 Linus Torvalds- Advice on Working From Home during Coronavirus Lockdown.md b/published/202003/20200322 Linus Torvalds- Advice on Working From Home during Coronavirus Lockdown.md similarity index 100% rename from published/20200322 Linus Torvalds- Advice on Working From Home during Coronavirus Lockdown.md rename to published/202003/20200322 Linus Torvalds- Advice on Working From Home during Coronavirus Lockdown.md diff --git a/published/20200322 Meet DebianDog - Puppy sized Debian Linux.md b/published/202003/20200322 Meet DebianDog - Puppy sized Debian Linux.md similarity index 100% rename from published/20200322 Meet DebianDog - Puppy sized Debian Linux.md rename to published/202003/20200322 Meet DebianDog - Puppy sized Debian Linux.md diff --git a/published/20200322 Purism Librem Mini- A Privacy-First Linux-Based Mini PC.md b/published/202003/20200322 Purism Librem Mini- A Privacy-First Linux-Based Mini PC.md similarity index 100% rename from published/20200322 Purism Librem Mini- A Privacy-First Linux-Based Mini PC.md rename to published/202003/20200322 Purism Librem Mini- A Privacy-First Linux-Based Mini PC.md diff --git a/published/20200327 How open source software is fighting COVID-19.md b/published/202003/20200327 How open source software is fighting COVID-19.md similarity index 100% rename from published/20200327 How open source software is fighting COVID-19.md rename to published/202003/20200327 How open source software is fighting COVID-19.md From ee061ab1bf9c1d1ac703eafb0081b67d5513fca0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 Apr 2020 10:05:26 +0800 Subject: [PATCH 0078/1809] Rename sources/tech/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md to sources/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md --- ... Association Launches an Open Source Collaboration Platform.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md (100%) diff --git a/sources/tech/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md b/sources/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md similarity index 100% rename from sources/tech/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md rename to sources/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md From 81a52b25b8bab1c1877d58d4f5649615a0bac95f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 Apr 2020 10:09:08 +0800 Subject: [PATCH 0079/1809] Rename sources/tech/20200331 How failure-driven development makes you successful.md to sources/talk/20200331 How failure-driven development makes you successful.md --- ...0200331 How failure-driven development makes you successful.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200331 How failure-driven development makes you successful.md (100%) diff --git a/sources/tech/20200331 How failure-driven development makes you successful.md b/sources/talk/20200331 How failure-driven development makes you successful.md similarity index 100% rename from sources/tech/20200331 How failure-driven development makes you successful.md rename to sources/talk/20200331 How failure-driven development makes you successful.md From 2b720b37ffef0210fe20550f3bdd612e01848fe7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Apr 2020 10:50:12 +0800 Subject: [PATCH 0080/1809] PRF @geekpi --- ... Expiration Date for All Users on Linux.md | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/translated/tech/20200320 How to Check Password Expiration Date for All Users on Linux.md b/translated/tech/20200320 How to Check Password Expiration Date for All Users on Linux.md index 0991e386b8..7040c3d5fc 100644 --- a/translated/tech/20200320 How to Check Password Expiration Date for All Users on Linux.md +++ b/translated/tech/20200320 How to Check Password Expiration Date for All Users on Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Check Password Expiration Date for All Users on Linux) @@ -10,37 +10,33 @@ 如何在 Linux 上检查所有用户密码到期日期 ====== -如果你在 **[Linux 上启用了密码策略][1]**。 +![](https://img.linux.net.cn/data/attachment/album/202004/01/104918dn0n0anhxoia40rc.jpg) -密码必须在到期前进行更改,并且登录到系统时会收到通知。 +如果你在 [Linux 上启用了密码策略][1]。密码必须在到期前进行更改,并且登录到系统时会收到通知。 -如果你很少使用自己的帐户,那么可能由于密码过期而被锁定。 +如果你很少使用自己的帐户,那么可能由于密码过期而被锁定。在许多情况下,这可能会在[无需密码登录][2]的服务帐户中发生,因为没人会注意到它。 -在许多情况下,这可能会在[无需密码登录][2]的服务帐户中发生,因为没人会注意到它。 - -这将导致停止服务器上配置的 **[cronjob/crontab][3]**。 +这将导致停止服务器上配置的 [cronjob/crontab][3]。 如果如此,该如何缓解这种情况。 -你可以写一个 **[shell 脚本][4]**来获得有关它的通知,我们前一段时间为此写了一篇文章。 - - * **[发送 “X” 日内到期的用户帐户列表邮件的 Bash 脚本][5]** - +你可以写一个 shell 脚本来获得有关它的通知,我们前一段时间为此写了一篇文章。 + * [使用 Bash 脚本发送包含几天内到期的用户账号列表的电子邮件][5] 它将给出天数,但是本文旨在在终端中给你实际日期。 -这可以使用 chage 命令来实现。 +这可以使用 `chage` 命令来实现。 ### 什么是 chage 命令? -chage 代表更改时效 (change age)。它更改用户密码到期信息。 +`chage` 代表更改时效change age。它更改用户密码到期信息。 -chage 命令更改两次密码更改之间的天数,以及最后一次更改密码的日期。 +`chage` 命令可以修改两次密码更改之间的天数,以及最后一次更改密码的日期。 系统使用此信息来确定用户何时应更改密码。 -它允许用户执行其他功能,例如设置帐户到期日期、在到期后将密码设置为无效、显示帐户时效信息、设置密码更改之前的最小和最大天数以及设置到期警告天数。 +它还允许用户执行其他功能,例如设置帐户到期日期、在到期后将密码设置为无效、显示帐户时效信息、设置密码更改之前的最小和最大天数以及设置到期警告天数。 ### 1)如何在 Linux 上检查特定用户的密码到期日期 @@ -60,8 +56,7 @@ Number of days of warning before password expires : 7 ### 2)如何在 Linux 上检查所有用户的密码到期日期 -You can use the chage command directly for a single user, which may not work as expected for many users, but you can use it. -你可以直接对单个用户使用 chage 命令,这对你可以使用的多个用户可能无效。 +你可以直接对单个用户使用 chage 命令,不过可能你对多个用户使用时可能无效。 为此,你需要编写一个小的 shell 脚本。下面的 shell 脚本可以列出添加到系统中的所有用户,包括系统用户。 @@ -111,14 +106,14 @@ via: https://www.2daygeek.com/linux-check-user-password-expiration-date/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/magesh/ [b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/how-to-set-password-complexity-policy-on-linux/ +[1]: https://linux.cn/article-10698-1.html [2]: https://www.2daygeek.com/configure-setup-passwordless-ssh-key-based-authentication-linux/ [3]: https://www.2daygeek.com/linux-crontab-cron-job-to-schedule-jobs-task/ [4]: https://www.2daygeek.com/category/shell-script/ -[5]: https://www.2daygeek.com/bash-script-to-check-user-account-password-expiry-linux/ +[5]: https://linux.cn/article-11781-1.html From ff5dd49a19c4e52267911e0453720dcb1a92f5ea Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Apr 2020 10:50:38 +0800 Subject: [PATCH 0081/1809] PUB @geekpi https://linux.cn/article-12062-1.html --- ...o Check Password Expiration Date for All Users on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200320 How to Check Password Expiration Date for All Users on Linux.md (98%) diff --git a/translated/tech/20200320 How to Check Password Expiration Date for All Users on Linux.md b/published/20200320 How to Check Password Expiration Date for All Users on Linux.md similarity index 98% rename from translated/tech/20200320 How to Check Password Expiration Date for All Users on Linux.md rename to published/20200320 How to Check Password Expiration Date for All Users on Linux.md index 7040c3d5fc..1633f32694 100644 --- a/translated/tech/20200320 How to Check Password Expiration Date for All Users on Linux.md +++ b/published/20200320 How to Check Password Expiration Date for All Users on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12062-1.html) [#]: subject: (How to Check Password Expiration Date for All Users on Linux) [#]: via: (https://www.2daygeek.com/linux-check-user-password-expiration-date/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 3d80b17be6aaa9116fadf86386d858a48bcc8c8b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Apr 2020 15:03:24 +0800 Subject: [PATCH 0082/1809] APL --- ...Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md b/sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md index 3db70ec4e1..d4242d0473 100644 --- a/sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md +++ b/sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 831915e13cd5a7a9c6b6589c49bf3af99ef48e85 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Apr 2020 15:45:17 +0800 Subject: [PATCH 0083/1809] TSL --- ...to a Smart TV With KDE Plasma Bigscreen.md | 96 ------------------- ...to a Smart TV With KDE Plasma Bigscreen.md | 96 +++++++++++++++++++ 2 files changed, 96 insertions(+), 96 deletions(-) delete mode 100644 sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md create mode 100644 translated/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md diff --git a/sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md b/sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md deleted file mode 100644 index d4242d0473..0000000000 --- a/sources/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen) -[#]: via: (https://itsfoss.com/kde-plasma-bigscreen/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen -====== - -_**Brief: KDE’s upcoming Plasma Bigscreen project lets you use open source technologies to turn your regular TV into a smart one.**_ - -Smart TVs are the new normal these days. Mostly based on Android, these smart TVs let you play YouTube, Netflix, Spotify and other streaming services. You can even use voice commands to control your smart TV. - -One major problem with these so-called [smart TVs are that they probably are spying on you][1]. Your data is being collected with or without your knowledge. - -This is the problem KDE’s [Plasma Bigscreen project][2] is aiming to solve. - -### Plasma Bigscreen: Make your TV smart with open source technologies - -![][3] - -You probably already know about the [KDE][4] project. It started as a Linux desktop environment project more than 20 years ago. The KDE project grew bigger and this is why they created Plasma desktop environment to make it clear that KDE is no more just “K Desktop Environment”. - -The Plasma project itself is quite versatile. You can of course use it on your desktop Linux computer. [Plasma also has a mobile version][5] that you can run on Linux-based smartphones like [Librem5][6] and [PinePhone][7]. - -The Plasma Bigscreen is a new project from KDE that aims to provide interface and features similar to what Smart TVs provide. - -All you need is a [single board computer like Raspberry Pi][8] and a TV with HDMI port. Install Plasma Bigscreen on your device and connect it to your TV. - -### Plasma Bigscreen features: More than just a media server - -![YouTube In Plasma Bigscreen][9] - -Though it may look like one at the first glance, but Plasma Bigscreen is not like Kodi and other [media servers for Linux][10]. It’s more than that. - -#### Control with your regular remote - -You don’t need a new specialized remote control. Thanks to [CEC][11], you can use your regular TV remote control. - -#### Voice control with open source Mycroft AI - -Plasma Bigscreen takes advantage of the open source Mycroft AI project. With Mycroft built in to Bigscreen, you can use voice command to play content, check weather and control other aspects of your smart TV. You can further train this AI by teaching it new skills. - -#### Traditional desktop applications - -Plasma Bigscreen delivers not only media-rich applications, but also traditional desktop applications redesigned to fit the Bigscreen experience. - -#### Free and open source software - -The most important feature is that it is an open source project and it uses other open source technologies to give you the complete control over your data and your smart TV. - -Since it is open source, I believe once it is released, there will be a few vendors providing it as a plug and play device. - -### How to get Plasma Bigscreen? - -Plasma Bigscreen is still in beta phase and there is no definite timeline for the stable release. - -However, the beta version is also working good on devices like Raspberry Pi 4. Here’s a video by one of the developers working on this project. - -[Subscribe to our YouTube channel for more Linux videos][12] - -If you have a Raspberry Pi 4, you can [download Plasma Bigscreen][13] beta version from its official download page and follow the steps [here][14] to install it. - -Personally, I am really excited about it. I am going to take out some time and try it on my [Raspberry Pi 4][15]. What about you? Do you think the project has potential? Will you give it a try? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/kde-plasma-bigscreen/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://www.zdnet.com/article/fbi-warns-about-snoopy-smart-tvs-spying-on-you/ -[2]: https://plasma-bigscreen.org/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/plasma-bigscreen-menu.jpg?ssl=1 -[4]: https://kde.org/ -[5]: https://itsfoss.com/kde-announces-plasma-mobile/ -[6]: https://itsfoss.com/librem-linux-phone/ -[7]: https://itsfoss.com/pinephone/ -[8]: https://itsfoss.com/raspberry-pi-alternatives/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/youtube-in-plasma-bigscreen.jpg?ssl=1 -[10]: https://itsfoss.com/best-linux-media-server/ -[11]: http://libcec.pulse-eight.com/ -[12]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[13]: https://plasma-bigscreen.org/#download-jumpto -[14]: https://plasma-bigscreen.org/manual/ -[15]: https://itsfoss.com/raspberry-pi-4/ diff --git a/translated/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md b/translated/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md new file mode 100644 index 0000000000..6e62546f5a --- /dev/null +++ b/translated/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen) +[#]: via: (https://itsfoss.com/kde-plasma-bigscreen/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +用 KDE “等离子大屏幕”把你的普通电视变成智能电视 +====== + +> KDE 即将推出的“等离子大屏幕”项目可让你使用开源技术将普通电视变成智能电视。 + +如今,智能电视已成为新的常态。这些智能电视主要基于 Android,可让你播放 YouTube、Netflix、Spotify 和其他流媒体服务。你甚至可以使用语音命令来控制你的智能电视。 + +这些所谓的“智能电视”的一个主要问题是它们可能正在[监视你][1]。你的数据在你或许知道或许不知道的情况下被收集。 + +这就是 KDE 的“[等离子大屏幕项目][2]”旨在解决的问题。(LCTT 译注: 等离子Plasma恰是 KDE 桌面环境的名称。) + +### 等离子大屏幕:通过开源技术使电视更智能 + +![][3] + +你可能了解 [KDE][4] 项目。它开始是一个 Linux 桌面环境项目,发展了 20 多年后,KDE 项目变得越来越大,这就是为什么他们创建了 Plasma 桌面环境的原因,以明确表明 KDE 不再仅仅是“K 桌面环境K Desktop Environment(KDE)”了。 + +Plasma 项目本身具有多种用途,当然,你可以在台式机 Linux 计算机上使用它,而 [Plasma 也具有移动版本][5],你可以在基于 Linux 的智能手机上运行它,例如 [Librem5][6] 和 [PinePhone][7]。 + +“等离子大屏幕”是 KDE 的一个新项目,旨在提供类似于智能电视所提供的界面和功能。 + +你需要的是一台[树莓派之类的单板计算机][8]和一台带 HDMI 端口的电视,然后在你的树莓派设备上安装“等离子大屏幕”,将其连接到电视就行。 + +### “等离子大屏幕”的功能:不仅仅是媒体服务器 + +![YouTube In Plasma Bigscreen][9] + +乍一看,它看起来很像是一个媒体服务器,但“等离子大屏幕”却与 Kodi 和其它 [Linux 媒体服务器][10] 不同,它不止于此。 + +#### 使用常规遥控器进行控制 + +你不需要新的专用遥控器。多亏了 [CEC][11],你可以使用常规的电视遥控器。 + +####带有开源 Mycroft AI 的语音控制 + +“等离子大屏幕”利用了开源 Mycroft AI 项目。借助“等离子大屏幕”内置的 Mycroft AI,你可以使用语音命令播放内容、检查天气并控制智能电视的其他方面。你可以通过教它新技能来进一步训练它。 + +#### 传统的桌面应用程序 + +“等离子大屏幕”不仅提供丰富的媒体应用程序,还提供经过重新设计以适合它的体验的传统桌面应用程序。 + +#### 自由开源软件 + +最重要的是它是一个开源项目,它使用其他开源技术为你提供对数据和智能电视的完全控制。 + +由于它是开源的,我相信一旦发布,就会有一些供应商将其作为即插即用设备提供。 + +### 如何获取“等离子大屏幕”? + +“等离子大屏幕”仍处于测试阶段,没有确定稳定版发布的时间表。 + +但是,测试版已经可以在树莓派 4 等设备上正常运行。下面是一个从事此项目的开发人员的视频。 + +- [video](https://youtu.be/iOxMuexAPaQ) + +如果你有树莓派 4,则可以从其官方下载页面上下载“[等离子大屏幕][13]”的测试版,然后按照[此处][14]的步骤进行安装。 + +就个人而言,我对此感到非常兴奋。我要花一些时间在[树莓派 4][15]上尝试一下。你呢?你认为该项目具有潜力吗?你想试试看吗? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/kde-plasma-bigscreen/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.zdnet.com/article/fbi-warns-about-snoopy-smart-tvs-spying-on-you/ +[2]: https://plasma-bigscreen.org/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/plasma-bigscreen-menu.jpg?ssl=1 +[4]: https://kde.org/ +[5]: https://itsfoss.com/kde-announces-plasma-mobile/ +[6]: https://itsfoss.com/librem-linux-phone/ +[7]: https://itsfoss.com/pinephone/ +[8]: https://itsfoss.com/raspberry-pi-alternatives/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/youtube-in-plasma-bigscreen.jpg?ssl=1 +[10]: https://itsfoss.com/best-linux-media-server/ +[11]: http://libcec.pulse-eight.com/ +[12]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[13]: https://plasma-bigscreen.org/#download-jumpto +[14]: https://plasma-bigscreen.org/manual/ +[15]: https://itsfoss.com/raspberry-pi-4/ From 1f9d578b309a200b22bbb5785808b30b2caef995 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Apr 2020 19:55:06 +0800 Subject: [PATCH 0084/1809] PRF --- ...nto a Smart TV With KDE Plasma Bigscreen.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md b/translated/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md index 6e62546f5a..a12268a7f9 100644 --- a/translated/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md +++ b/translated/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen) @@ -16,17 +16,17 @@ 这些所谓的“智能电视”的一个主要问题是它们可能正在[监视你][1]。你的数据在你或许知道或许不知道的情况下被收集。 -这就是 KDE 的“[等离子大屏幕项目][2]”旨在解决的问题。(LCTT 译注: 等离子Plasma恰是 KDE 桌面环境的名称。) +这就是 KDE 的“[等离子大屏幕项目][2]”旨在解决的问题。(LCTT 译注: 等离子Plasma恰是 KDE 桌面环境的名称,和大屏幕Bigscreen很搭,因此这个惯常不翻译的名称这里翻译出来。) -### 等离子大屏幕:通过开源技术使电视更智能 +### “等离子大屏幕”:通过开源技术使电视更智能 ![][3] -你可能了解 [KDE][4] 项目。它开始是一个 Linux 桌面环境项目,发展了 20 多年后,KDE 项目变得越来越大,这就是为什么他们创建了 Plasma 桌面环境的原因,以明确表明 KDE 不再仅仅是“K 桌面环境K Desktop Environment(KDE)”了。 +你可能了解 [KDE][4] 项目。它开始是一个 Linux 桌面环境项目,而在发展了 20 多年后,KDE 项目变得越来越大,这就是为什么他们创建了 Plasma 桌面环境的原因,以明确表明 KDE 不再仅仅是“K 桌面环境K Desktop Environment(KDE)”了。 Plasma 项目本身具有多种用途,当然,你可以在台式机 Linux 计算机上使用它,而 [Plasma 也具有移动版本][5],你可以在基于 Linux 的智能手机上运行它,例如 [Librem5][6] 和 [PinePhone][7]。 -“等离子大屏幕”是 KDE 的一个新项目,旨在提供类似于智能电视所提供的界面和功能。 +“等离子大屏幕Plasma Bigscreen”是 KDE 的一个新项目,旨在提供类似于智能电视所提供的界面和功能。 你需要的是一台[树莓派之类的单板计算机][8]和一台带 HDMI 端口的电视,然后在你的树莓派设备上安装“等离子大屏幕”,将其连接到电视就行。 @@ -34,19 +34,19 @@ Plasma 项目本身具有多种用途,当然,你可以在台式机 Linux 计 ![YouTube In Plasma Bigscreen][9] -乍一看,它看起来很像是一个媒体服务器,但“等离子大屏幕”却与 Kodi 和其它 [Linux 媒体服务器][10] 不同,它不止于此。 +乍一看,它看起来很像是一个媒体服务器,但“等离子大屏幕”却和 Kodi 及其它 [Linux 媒体服务器][10] 不同,它不止于此。 #### 使用常规遥控器进行控制 你不需要新的专用遥控器。多亏了 [CEC][11],你可以使用常规的电视遥控器。 -####带有开源 Mycroft AI 的语音控制 +#### 带有开源 Mycroft AI 的语音控制 “等离子大屏幕”利用了开源 Mycroft AI 项目。借助“等离子大屏幕”内置的 Mycroft AI,你可以使用语音命令播放内容、检查天气并控制智能电视的其他方面。你可以通过教它新技能来进一步训练它。 #### 传统的桌面应用程序 -“等离子大屏幕”不仅提供丰富的媒体应用程序,还提供经过重新设计以适合它的体验的传统桌面应用程序。 +“等离子大屏幕”不仅提供丰富的媒体应用程序,还提供经过重新设计,适合它的体验的传统桌面应用程序。 #### 自由开源软件 @@ -73,7 +73,7 @@ via: https://itsfoss.com/kde-plasma-bigscreen/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5070544f740aba199f55639c98a14600f0952ceb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Apr 2020 19:55:40 +0800 Subject: [PATCH 0085/1809] PUB @wxy https://linux.cn/article-12063-1.html --- ...ur Regular TV into a Smart TV With KDE Plasma Bigscreen.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md (98%) diff --git a/translated/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md b/published/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md similarity index 98% rename from translated/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md rename to published/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md index a12268a7f9..fd51a345f3 100644 --- a/translated/tech/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md +++ b/published/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12063-1.html) [#]: subject: (Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen) [#]: via: (https://itsfoss.com/kde-plasma-bigscreen/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 2e12f52a83026136b1d193573673084994992177 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Apr 2020 00:59:39 +0800 Subject: [PATCH 0086/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200402=20How?= =?UTF-8?q?=20to=20Upgrade=20to=20Ubuntu=2020.04=20Beta=20from=2018.04=20&?= =?UTF-8?q?=2019.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md --- ...to Ubuntu 20.04 Beta from 18.04 - 19.10.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md diff --git a/sources/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md b/sources/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md new file mode 100644 index 0000000000..aa74979e36 --- /dev/null +++ b/sources/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Upgrade to Ubuntu 20.04 Beta from 18.04 & 19.10) +[#]: via: (https://itsfoss.com/upgrade-ubuntu-beta/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Upgrade to Ubuntu 20.04 Beta from 18.04 & 19.10 +====== + +[Ubuntu 20.04 LTS release][1] is less than a month away. It has plenty of visual changes and several performance improvements. + +If you are still using Ubuntu 18.04 LTS, you’ll find Ubuntu 20.04 stunningly beautiful with its dark Yaru theme. Here’s a [video showing what Ubuntu 20.04 looks like][2]. Have a look and judge it yourself. + +[Subscribe to our YouTube channel for more Linux videos][3] + +Looks great, isn’t it? If you are excited about Ubuntu 20.04 and cannot wait till the final stable release on 23rd April, you can start using it even today. It’s fairly stable and it could even help Ubuntu team in testing this release. + +There’s always the option to download the daily build and install it afresh. But if you are using Ubuntu 18.04 or Ubuntu 19.10, you can upgrade to Ubuntu 20.04 beta from your existing system. + +Please check this tutorial to learn [how to find out which Ubuntu version you are using][4]. + +In this tutorial, I’ll show you the steps to upgrade to Ubuntu 20.04 beta. + +### How to upgrade to Ubuntu 20.04 beta from Ubuntu 18.04 and 19.10 + +![Upgrade Ubuntu 20 04 Beta][5] + +Before you see the steps, let me answer some of the common questions regarding upgrading to Ubuntu beta version. + + * The upgrade from one version to another is an easy process but you need to have a good internet connection that could download a couple of GBs of data at a good speed. + * Upgrading to a newer version disables the third-party repositories ([PPA][6] you added on your own). Some of these PPAs might not be available for the new version yet. You can manually enable the PPAs after upgrading. + * Having a backup of your important data on an external USB disk is always recommended. Just copy all your important files from Documents, Pictures, Music, Downloads and other places and put it on an external USB or hard disk. + * Once you have upgraded to a newer version, you cannot go back to the older version you were using. Reinstalling the older version is the only option. + * If you upgrade to the Ubuntu 20.04 beta version, you don’t need to install it again when the final stable version is released. Just update your Ubuntu system regularly and you’ll already be using the same 20.04 when it is released. + * You cannot upgrade to Ubuntu 20.04 directly from Ubuntu 16.04, 17, 18, 19.04. + + + +Alright! You know enough now. Let’s see the steps to upgrade to Ubuntu 20.04 beta from Ubuntu 19.10 and 18.04. + +#### Step 1: Make sure the settings are right + +Go to Software & Updates application: + +![Software & Updates application in Ubuntu][7] + +In the Updates tab, check that Notify me of a new Ubuntu version is set to “Any new version” or “LTS version”: + +![Ubuntu Upgrade Version Settings][8] + +This may reload the Software repository cache. + +#### Step 2: Update your system for any pending software updates + +Once you have the correct settings in place, open a terminal ([use Ctrl+Alt+T shortcut in Ubuntu][9]) and use the following [command to update your Ubuntu system][10]: + +``` +sudo apt update && sudo apt full-upgrade +``` + +The apt full-upgrade or dist-upgrade function the same as ‘apt upgrade’ but it will remove currently installed packages if this is needed to upgrade the system as a whole (i.e. a version upgrade). + +Your system may ask to restart after installing updates. That’s fine. Restart and resume upgrading to beta release from step 3. + +#### Step 3: Run update manager with development release upgrade option + +Now that you have all the necessary updates installed, you can open the update manager but with -d option. The -d option tells it to look for development releases. + +``` +update-manager -d +``` + +It may take a couple of minutes before informing you that a new version of Ubuntu is available. + +![Availability of Ubuntu 20.04 in Ubuntu 19.10][11] + +A similar message is displayed in Ubuntu 18.04 as well: + +![Availability of Ubuntu 20.04 in Ubuntu 18.04][12] + +Hit the upgrade button when you see the above message. + +#### Step 4: Start upgrading to Ubuntu 20.04 beta + +The rest of the upgrade procedure is basically waiting for update downloads and clicking okay wherever requested. + +![][13] + +Hit the upgrade button and follow the on-screen instructions. + +![][14] + +You might be notified that all the third party sources have been disabled. At some point, it will also inform you of the packages that will be upgraded, removed etc. It will also ask if you want to keep obsolete packages or not. I prefer to remove them. + +Depending on your internet speed, the upgrade may take a couple of hours. Once the upgrade process is complete, you’ll be asked to restart your system. + +![][15] + +This video shows all the steps in action: + +See, it wasn’t that difficult. Enjoy all the new features in Ubuntu 20.04. + +Questions or suggestions? Feel free to leave a comment below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/upgrade-ubuntu-beta/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-20-04-release-features/ +[2]: https://www.youtube.com/watch?v=9u5B0njRgOw +[3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[4]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-beta.jpg?ssl=1 +[6]: https://itsfoss.com/ppa-guide/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/software-updates-app-ubuntu.jpg?ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/ubuntu-upgrade-version-settings.jpg?ssl=1 +[9]: https://itsfoss.com/ubuntu-shortcuts/ +[10]: https://itsfoss.com/update-ubuntu/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04.jpg?ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-from-18-04.jpg?ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-steps-1.jpg?ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-steps-2.jpg?ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/restart-to-finish-beta-upgarde-ubuntu-20-04.jpg?ssl=1 From f7cd942c36141fb711cbfb1ec631d43a42fcbaed Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Apr 2020 01:02:23 +0800 Subject: [PATCH 0087/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200401=203=20?= =?UTF-8?q?Python=20templating=20languages=20you=20should=20(probably)=20n?= =?UTF-8?q?ever=20use?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200401 3 Python templating languages you should (probably) never use.md --- ...nguages you should (probably) never use.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 sources/tech/20200401 3 Python templating languages you should (probably) never use.md diff --git a/sources/tech/20200401 3 Python templating languages you should (probably) never use.md b/sources/tech/20200401 3 Python templating languages you should (probably) never use.md new file mode 100644 index 0000000000..e23b443b0d --- /dev/null +++ b/sources/tech/20200401 3 Python templating languages you should (probably) never use.md @@ -0,0 +1,180 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 Python templating languages you should (probably) never use) +[#]: via: (https://opensource.com/article/20/4/python-templating-languages) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +3 Python templating languages you should (probably) never use +====== +Python has accumulated a lot of templating languages, including these +three that are perfect for April Fools' Day. +![Hands on a keyboard with a Python book ][1] + +When reaching for a templating language for writing a [Python][2] web application, there are an abundance of robust solutions.  + +There are [Jinja2][3], [Genshi, and Mako][4]. There are even solutions like [Chameleon][5], which are a bit older, but still recommended by the [Pyramid][6] framework. + +Python has been around for a long time. In that time, deep in the corners of its system, it has accumulated some almost forgotten templating languages that are well worth poking at. + +Like cute koalas on top of a eucalyptus tree, happy in their ecological niche, and sometimes as dangerous to work with, these are the templating languages few have heard of—and even fewer should use. + +### 3\. string.Template + +Have you ever wondered, "How can I get a templating language with no features, but also without needing to **pip install** anything?" The Python standard library has you covered. While it does no looping or conditionals, the **string.Template** class is a minimal templating language. + +Using it is simplicity itself. + + +``` +>>> import string +>>> greeting = string.Template("Hello, $name, good $time!") +>>> greeting.substitute(name="OpenSource.com", time="afternoon") +'Hello, OpenSource.com, good afternoon!' +``` + +### 2\. twisted.web.template + +What gift do you give the library that has everything? + +Not a templating language, certainly, because it already has one. Nestled in **twisted.web.template** are two templating languages. One is XML-based and has a [great tutorial][7]. + +But there is another one, one that is based on using Python as a domain-specific language to produce HTML documents. + +It is based on two primitives: **twisted.web.template.tags**, which contains tag objects, and **twisted.web.template.flattenString**, which will render them. Because it is part of Twisted, it has built-in support for rendering async results efficiently. + +This example will render a silly little page: + + +``` +async def render(reactor): +    my_title = "A Fun page" +    things = ["one", "two", "red", "blue"] +    template = tags.html( +            tags.head( +                tags.title(my_title), +            ), +            tags.body( +                tags.h1(my_title), +                tags.ul( +                    [tags.li(thing) for thing in things], +                ), +                tags.p( +                    task.deferLater(reactor, 3, lambda: "Hello "), +                    task.deferLater(reactor, 3, lambda: "world!"), +                ) +            ) +    ) +    res = await flattenString(None, template) +    res = res.decode('utf-8') +    with open("hello.html", 'w') as fpout: +        fpout.write(res) +``` + +The template is regular Python code that uses the **tags.<TAGNAME>** to indicate the hierarchy. It natively supports strings as renderables, so any string is fine. + +To render it, the only things you need to do are to add a preamble: + + +``` +from twisted.internet import task, defer +from twisted.web.template import tags, flattenString + +def main(reactor): +    return defer.ensureDeferred(render(reactor)) +``` + +and an epilogue to run the whole thing: + + +``` +`task.react(main)` +``` + +In just _three_ seconds (and not _six_), it will render a nice HTML page. In real-life, those **deferLater**s can be, for example, calls to an HTTP API: they will be sent and processed in parallel, without having to put in any effort. I recommend you instead read about a [far better use for Twisted][8]. But still, this works. + +### 1\. Quixote + +You will say, "But Python is not _optimized_ for being an HTML-spouting domain-specific language." What if, instead of settling for Python-as-is, there was a language that [transpiles][9] to Python, but is better at defining templates? A "Python template language" (PTL), if you will. + +Writing your own language is sometimes said to be a dreamer's project for someone who tilts at windmills. Irony was not lost on the creators of Quixote (available on [PyPI][10]) when they decided to do exactly that. + +The following will render an equivalent template to the one done with Twisted above. _Warning: the following is not valid Python_: + + +``` +import time + +def render [html] (): +    my_title = "A Fun page" +    things = ["one", "two", "red", "blue"] +    "<html><head><title>" +    my_title +    "</head></title><body><h1>" +    my_title +    "</h1>" +    "<ul>" +    for thing in things: +        "<li>" +        thing +        "</li>" +    "<p>" +    time.sleep(3) +    (lambda: "Hello ")() +    time.sleep(3) +    (lambda: "world!")() +    "</p>" +    "</body></html>" + +def write(): +    result = render() +    with open("hello.html", 'w') as fpout: +        fpout.write(str(result)) +``` + +However, if you put it in a file called **template.ptl**, you can make it importable to Quixote and write out the rendered version of the template: + + +``` +>>> from quixote import enable_ptl +>>> enable_ptl() +>>> import template +>>> template.write() +``` + +Quixote installs an import hook that will cause PTL files to transpile into Python. Note that this render takes _six_ seconds, not _three_; you no longer gain free asynchronicity. + +### So many templates in Python + +Python has a long and winding history of libraries, some of which can achieve the same outcomes in more or less similar ways (for example, Python [package management][11]). + +On this April Fools' Day, I hope you enjoyed exploring three ways you _can_ create templates in Python. Instead, I recommend starting with [one of these libraries][4] for ways you _should_ template. + +Do you have another esoteric way to template? Share it in the comments below! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/python-templating-languages + +作者:[Moshe Zadka][a] +选题:[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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) +[2]: https://opensource.com/resources/python +[3]: https://opensource.com/article/20/2/jinja2-cheat-sheet +[4]: https://opensource.com/resources/python/template-libraries +[5]: https://chameleon.readthedocs.io/en/latest/ +[6]: https://opensource.com/article/18/5/pyramid-framework +[7]: https://twistedmatrix.com/documents/13.1.0/web/howto/twisted-templates.html +[8]: https://opensource.com/article/20/3/treq-python +[9]: https://en.wikipedia.org/wiki/Source-to-source_compiler +[10]: https://pypi.org/project/Quixote/ +[11]: https://opensource.com/article/19/4/managing-python-packages From 057715a126b81dd872d0e9679e851f32db4bdf08 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Apr 2020 01:03:35 +0800 Subject: [PATCH 0088/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200401=20How?= =?UTF-8?q?=20does=20kanban=20relate=C2=A0to=20DevOps=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200401 How does kanban relate-to DevOps.md --- ...200401 How does kanban relate-to DevOps.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20200401 How does kanban relate-to DevOps.md diff --git a/sources/tech/20200401 How does kanban relate-to DevOps.md b/sources/tech/20200401 How does kanban relate-to DevOps.md new file mode 100644 index 0000000000..3f37c35a4c --- /dev/null +++ b/sources/tech/20200401 How does kanban relate-to DevOps.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How does kanban relate to DevOps?) +[#]: via: (https://opensource.com/article/20/4/kanban-devops) +[#]: author: (Willy-Peter Schaub https://opensource.com/users/wpschaub) + +How does kanban relate to DevOps? +====== +Reduce waste, optimize the flow of value, and continuously deliver value +to delighted users. +![two women kanban brainstorming and brainmapping with post-it notes on a whiteboard ][1] + +Kanban is nothing new; in fact, it predates most readers of this article. Its age becomes apparent when we add the year Toyota introduced kanban in its main plant machine shop (1953) to the timeline image from our [analyzing the DNA of DevOps][2] article. + +![DevOps timeline][3] + +I have intuitively been using kanban, in one form or the other, for more than two decades to track personal plans, engineering projects, and digital transformations. Only in the past few weeks have I pondered the origins, power, and synergy of kanban with other frameworks and systems, while introducing teams to kanban and helping them embrace it as a powerful system in our common engineering system. + +### What is kanban? + +Kanban means "visual signal" and has its roots in the Toyota manufacturing industry. It was developed by [Taiichi Ohno][4] to improve manufacturing efficiency. When we jump a few decades into the future, kanban complements agile and lean, often used with frameworks such as scrum, Scaled Agile Framework, and Disciplined Agile to visualize and manage work. + +![Kanban complements agile and lean][5] + +You can explore the many interpretations of kanban on the internet, in books, and in vibrant discussions with other engineers who have embraced the system. In the context of our common collaboration and engineering system, kanban delivers four pivotal practices: + + * **Visualize work:** We visualize all work and look for triggers such as cards turning **red** when the work they represent is blocked or has been dormant for more than two days. + * **Limit work in progress:** We agree on and enforce (soft) work-in-progress limits to encourage reduced batch sizes and manage queue lengths. + * **Focus on flow:** We _pull_ not push work, which helps us to defer commitment until we meet our definition of done (_DoD_) and we have the capacity to commit to the next _activity_. + * **Continuous improvement:** It is important to measure work from when it enters our backlog, how long it takes to get through the process (lead time), and how efficient we are working (cycle/lead time). This enables us to continuously inspect and improve how we work and track progress. + + + +![Kanban practices and terminology][6] + +We use colorful, visual cards to represent activities that flow through one or more _activities_ in one of many _swim lanes_. Each kanban column represents an activity, and each swim lane represents a person, group, or another bucket to segment the cards. There are no rules for the color of the cards, but **red** typically signals a problem. But remember to combine color with a meaningful icon to visualize special states for users who are color-blind. + +> "_We should defer commitment until our Definition of Ready (DOR) is met so that we can ensure that our Definition of Done (DOD) is achieved sooner and with high quality. I like the two distinct terms (DOR and DOD) because the [project owner] should be accountable for the DOR while the team can take ownership of the DOD_." —[Mathew Mathai][7] + +I often use this analogy to explain the difference between _lead_ and _cycle_ time to new teams: Imagine you walk into a restaurant. You sit down, study the menu, and decide what you would like to drink and eat. When the waiter takes your order, the _lead_ cycle time starts ticking. When the bar starts pouring your favorite potion and the kitchen starts preparing your meal, the _cycle_ time starts ticking. As the order arrives at your table, both the lead and cycle time are stopped if (and only if) you are satisfied. + +Therefore, the _lead_ time measures how long you, the customer, had to wait until you received your order. The _cycle_ time measures the process time of an activity to prepare your order. From a customer perspective, the _lead_ time is important. + +It is important to _make your policies explicit_, such as when you start measuring lead and cycle times. Some customers start their "impatience" clock when they enter the restaurant, while others start the clock when they place their order. In both cases, they need to understand how you measure your flow to avoid misunderstandings, unfeasible expectations, and disappointment. + +This image is extracted from one of our information transfer posters, and it summarizes key learnings when we started adopting the kanban system. + +![Key kanban learnings][8] + +### What about DevOps? + +In _[Using PowerShell to automate Linux, macOS, and Windows processes][9]_, we briefly introduced value-stream mapping. It enables us to measure individual and total lead times, cycle times, efficiency, and quality and unearth different activities, groups, and silos that cancel out each other. + +![value-stream mapping][10] + +You will notice a similarity between the kanban board and the value-stream mapping images. Both _visualize_ and _focus_ on the flow of activities represented by individual cards pulled across a visual board. + +![Continuous delivery pipeline][11] + +Continuous flow and efficiency are core to a healthy DevOps mindset. It transforms into a continuous delivery pipeline, as shown above, which unites different teams, such as business, development, security, and quality assurance, to implement ideas from ideation to production. Continuously measuring and streamlining the delivery pipeline not only helps improve the flow of value, but also the quality of value. + +It should be evident that (similar to kanban) the focus here is on flow. Flipping back and forth between activities is frowned upon in kanban and impractical with continuous delivery pipelines. It reminds me of a recent whiteboard discussion where we discussed the challenge of visualizing and managing the flow of work that requires two teams. + +![Dividing a job between two teams][12] + +As shown here, we slice a job that requires team X to perform activities, then team Y, and again team X, into three stories. The three stories are visualized by three cards on two kanban boards, flowing from A to B to C, with clear ownership by team X and Y, which we can measure independently as lead and cycle time. + +We are drifting into another exciting topic of flow optimization … let's get back to the original question. + +### What is the relationship between kanban and DevOps? + +[Donovan Brown][13] defines DevOps as "_the union of people, process, and products to enable continuous delivery of value to our end users._" + +When we unpack this definition, we realize that the core of the DevOps [mindset][14] is to continuously deliver value and delight our customers. + + * _"Feedback from stakeholders is essential."_ + * _"Improve beyond the limits of today's processes."_ + * _"No new silos to break down silos."_ + * _"Knowing your customers means cross-organization collaboration."_ + * _"Inspire adoption through enthusiasm."_ + + + +The kanban system helps us visualize and improve the efficiency of value delivery, resulting in delighted customers. I argue that if you are comfortable with kanban, you will enjoy the full benefits of DevOps through _visualization_, _flow improvement_, _feedback_, and _continuous innovation_. + +We have collaboration at its finest—_synergy_**,** or is that _symbiosis_? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/kanban-devops + +作者:[Willy-Peter Schaub][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/wpschaub +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/whiteboard-brainstorming-brainmapping-design-thinking-postits-kanban.png?itok=Is2Tg1Jk (Brainstorming with post-it notes on a whiteboard) +[2]: https://opensource.com/article/18/11/analyzing-devops +[3]: https://opensource.com/sites/default/files/uploads/devops-timeline.png (DevOps timeline) +[4]: https://en.wikipedia.org/wiki/Taiichi_Ohno +[5]: https://opensource.com/sites/default/files/uploads/kanban-agile-lean-devops.png (Kanban complements agile and lean) +[6]: https://opensource.com/sites/default/files/uploads/kanban-practices-terms.png (Kanban practices and terminology) +[7]: https://opensource.com/users/anicheinc +[8]: https://opensource.com/sites/default/files/uploads/kanban-key-learnings.png (Key kanban learnings) +[9]: https://opensource.com/article/20/2/devops-automation +[10]: https://opensource.com/sites/default/files/uploads/value-stream-mapping.png (value-stream mapping) +[11]: https://opensource.com/sites/default/files/uploads/cd-pipeline.png (Continuous delivery pipeline) +[12]: https://opensource.com/sites/default/files/uploads/splitting-jobs.png (Dividing a job between two teams) +[13]: https://www.donovanbrown.com/post/what-is-devops +[14]: https://opensource.com/article/19/5/values-devops-mindset From 2c7a430b7b8c13f5c6415bec9a59a748b1dac787 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Apr 2020 01:05:53 +0800 Subject: [PATCH 0089/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200401=20The?= =?UTF-8?q?=20ins=20and=20outs=20of=20high-performance=20computing=20as=20?= =?UTF-8?q?a=20service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200401 The ins and outs of high-performance computing as a service.md --- ...high-performance computing as a service.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/talk/20200401 The ins and outs of high-performance computing as a service.md diff --git a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md new file mode 100644 index 0000000000..cbf7a5a44f --- /dev/null +++ b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The ins and outs of high-performance computing as a service) +[#]: via: (https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html) +[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) + +The ins and outs of high-performance computing as a service +====== +HPC services can be a way to meet expanding supercomputing needs, but depending on the use case, they’re not necessarily better than on-premises supercomputers. +Dell EMC + +Electronics on missiles and military helicopters need to survive extreme conditions. Before any of that physical hardware can be deployed, defense contractor McCormick Stevenson Corp. simulates the real-world conditions it will endure, relying on finite element analysis software like Ansys, which requires significant computing power. + +Then one day a few years ago, it unexpectedly ran up against its computing limits. + +[10 of the world's fastest supercomputers][1] + +"We had some jobs that would have overwhelmed the computers that we had in office," says Mike Krawczyk, principal engineer at McCormick Stevenson. "It did not make economic or schedule sense to buy a machine and install software." Instead, the company contracted with Rescale, which could sell them cycles on a supercomputer-class system for a tiny fraction of what they would've spent on new hardware. + +McCormick Stevenson had become an early adopter in a market known as supercomputing as a service or high-performance computing (HPC) as a service – two terms that are closely related. HPC is the application of supercomputers to computationally complex problems, while supercomputers are those computers at the cutting edge of processing capacity, according to the National Institute for Computational Sciences. + +Whatever it's called, these services are upending the traditional supercomputing market and bringing HPC power to customers who could never afford it before. But it's no panacea, and it's definitely not plug-and-play – at least not yet. + +### HPC services in practice + +From the end user's perspective, HPC as a service resembles the batch-processing model that dates back to the early mainframe era. "We create an Ansys batch file and send that up, and after it runs, we pull down the result files and import them locally here," Krawczyk says. + +Behind the scenes, cloud providers are running the supercomputing infrastructure in their own data centers – though that doesn't necessarily imply the sort of cutting-edge hardware you might be visualizing when you hear "supercomputer." As Dave Turek, Vice President of Technical Computing at IBM OpenPOWER, explains it, HPC services at their core are "a collection of servers that are strung together with an interconnect. You have the ability to invoke this virtual computing infrastructure that allows you to bring a lot of different servers to work together in a parallel construct to solve the problem when you present it." + +[][2] + +Sounds simple in theory. But making it viable in practice required some chipping away at technical problems, according to Theo Lynn, Professor of Digital Business at Dublin City University. What differentiates ordinary computing from HPC is those interconnects – high-speed, low-latency, and expensive – so those needed to be brought to the world of cloud infrastructure. Storage performance and data transport also needed to be brought up to a level at least in the same ballpark as on-prem HPC before HPC services could be viable. + +But Lynn says that some of the innovations that have helped HPC services take off have been more institutional than technological. In particular, "we are now seeing more and more traditional HPC applications adopting cloud-friendly licensing models – a barrier to adoption in the past." + +And the economics have also shifted the potential customer base, he says. "Cloud service providers have opened up the market more by targeting low-end HPC buyers who couldn’t afford the capex associated with traditional HPC and opening up the market to new users. As the markets open up, the hyperscale economic model becomes more and more feasible, costs start coming down." + +Avoid on-premises CAPEX** +** + +HPC services are attractive to private-sector customers in the same fields where traditional supercomputing has long held sway. These include sectors that rely heavily on complex mathematical modeling, including defense contractors like McCormick Stevenson, along with oil and gas companies, financial services firms, and biotech companies. Dublin City University's Lynn adds that loosely coupled workloads are a particularly good use case, which meant that many early adopters used it for 3D image rendering and related applications. + +But when does it make sense to consider HPC services over on-premises HPC? For hhpberlin, a German company that simulates smoke propagation in and fire damage to structural components of buildings, the move came as it outgrew its current resources. + +"For several years, we had run our own small cluster with up to 80 processor cores," says Susanne Kilian, hhpberlin's scientific head of numerical simulation. "With the rise in application complexity, however, this constellation has increasingly proven to be inadequate; the available capacity was not always sufficient to handle projects promptly." + +But just spending money on a new cluster wasn't an ideal solution, she says: "In view of the size and administrative environment of our company, the necessity of constant maintenance of this cluster (regular software and hardware upgrades) turned out to be impractical. Plus, the number of required simulation projects is subject to significant fluctuations, such that the utilization of the cluster was not really predictable. Typically, phases with very intensive use alternate with phases with little to no use." By moving to an HPC service model, hhpberlin shed that excess capacity and the need to pay up front for upgrades. + +IBM's Turek explains the calculus that different companies go through while assessing their needs. For a biosciences startup with 30 people, "you need computing, but you really can't afford to have 15% of your staff dedicated to it. It's just like you might also say you don't want to have on-staff legal representation, so you'll get that as a service as well." For a bigger company, though, it comes down to weighing the operational expense of an HPC service against the capacity expense of buying an in-house supercomputer or HPC cluster. + +So far, those are the same sorts of arguments you'd have over adopting any cloud service. But the opex vs. capex dilemma can be weighted towards the former by some of the specifics of the HPC market. Supercomputers aren't commodity hardware like storage or x86 servers; they're very expensive, and technological advances can swiftly render them obsolete. As McCormick Stevenson's Krawczyk puts it, "It's like buying a car: as soon as you drive off the lot it starts to depreciate." And for many companies –especially larger and less nimble ones – the process of buying a supercomputer can get hopelessly bogged down. "You're caught up in planning issues, building issues, construction issues, training issues, and then you have to execute an RFP," says IBM's Turek. "You have to work through the CIO. You have to work with your internal customers to make sure there's continuity of service. It's a very, very complex process and not something that a lot of institutions are really excellent at executing." + +Once you choose to go down the services route for HPC, you'll find you get many of the advantages you expect from cloud services, particularly the ability to pay only for HPC power when you need it, which results in an efficient use of resources. Chirag Dekate, Senior Director and Analyst at Gartner, says bursty workloads, when you have short-term needs for high-performance computing, are a key use case driving adoption of HPC  services. + +"In the manufacturing industry, you tend to have a high peak of HPC activity around the product design stage," he says. "But once the product is designed, HPC resources are less utilized during the rest of the product-development cycle." In contrast, he says, "when you have large, long-running jobs, the economics of the cloud wear down." + +With clever system design, you can integrate those HPC-services bursts of activity with your own in-house conventional computing. Teresa Tung, managing director in Accenture Labs, gives an example: "Accessing HPC via APIs makes it seamless to mix with traditional computing. A traditional AI pipeline might have its training done on a high-end supercomputer at the stage when the model is being developed, but then the resulting trained model that runs predictions over and over would be deployed on other services in the cloud or even devices at the edge." + +### It's not for all use cases** + +** + +Use of HPC services lends itself to batch-processing and loosely-coupled use cases. That ties into a common HPC downside: data transfer issues. High-performance computing by its very nature often involves huge data sets, and sending all that information over the internet to a cloud service provider is no simple thing. "We have clients I talk to in the biotech industry who spend $10 million a month on just the data charges," says IBM's Turek. + +And money isn't the only potential problem. Building a workflow that makes use of your data can challenge you to work around the long times required for data transfer. "When we had our own HPC cluster, local access to the simulation results already produced – and thus an interactive interim evaluation — was of course possible at any time," says hhpberlin's Kilian. "We're currently working on being able to access and evaluate the data produced in the cloud even more efficiently and interactively at any desired time of the simulation without the need to download large amounts of simulation data." + +Mike Krawczyk cites another stumbling block: compliance issues. Any service a defense contractor uses needs to be complaint with the International Traffic in Arms Regulations (ITAR), and McCormick Stevenson went with Rescale in part because it was the only vendor they found that checked that box. While more do today, any company looking to use cloud services should be aware of the legal and data-protection issues involved in living on someone else's infrastructure, and the sensitive nature of many of HPC's use cases makes this doubly true for HPC as a service. + +In addition, the IT governance that HPC services require goes beyond regulatory needs. For instance, you'll need to keep track of whether your software licenses permit cloud use ­– especially with specialized software packages written to run on an on-premises HPC cluster. And in general, you need to keep track of how you use HPC services, which can be a tempting resource, especially if you've transitioned from in-house systems where staff was used to having idle HPC capabilities available. For instance, Ron Gilpin, senior director and Azure Platform Services global lead at Avanade, suggests dialing back how many processing cores you use for tasks that aren't time sensitive. "If a job only needs to be completed in an hour instead of ten minutes," he says, "that might use 165 processors instead of 1,000, a savings of thousands of dollars." + +### A premium on HPC skills** + +** + +One of the biggest barriers to HPC adoption has always been the unique in-house skills it requires, and HPC services don't magically make that barrier vanish. "Many CIOs have migrated a lot of their workloads into the cloud and they have seen cost savings and increased agility and efficiency, and believe that they can achieve similar results in HPC ecosystems," says Gartner's Dekate. "And a common misperception is that they can somehow optimize human resource cost by essentially moving away from system admins and hiring new cloud experts who can solve their HPC workloads." + +"But HPC is not one of the main enterprise environments," he says. "You're dealing with high-end compute nodes interconnected with high-bandwidth, low-latency networking stacks, along with incredibly complicated application and middleware stacks. Even the filesystem layers in many cases are unique to HPC environments. Not having the right skills can be destabilizing." + +But supercomputing skills are in shortening supply, something Dekate refers to as the workforce "greying," in the wake of a generation of developers going to splashy startups rather than academia or the more staid firms where HPC is in use. As a result, vendors of HPC services are doing what they can to bridge the gap. IBM's Turek says that many HPC vets will always want to roll their own exquisitely fine-tuned code and will need specialized debuggers and other tools to help them do that for the cloud. But even HPC newbies can make calls to code libraries built by vendors to exploit supercomputing's parallel processing. And third-party software providers sell turnkey software packages that abstract away much of HPC's complication. + +Accenture's Tung says the sector needs to lean further into this in order to truly prosper. "HPCaaS has created dramatically impactful new capability, but what needs to happen is making this easy to apply for the data scientist, the enterprise architect, or the software developer," she says. "This includes easy to use APIs, documentation, and sample code. It includes user support to answer questions. It’s not enough to provide an API; that API needs to be fit-for-purpose. For a data scientist this should likely be in Python and easily change out for the frameworks she is already using. The value comes from enabling these users who ultimately will have their jobs improved through new efficiencies and performance, if only they can access the new capabilities." If vendors can pull that off, HPC services might truly bring supercomputing to the masses. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html + +作者:[Josh Fruhlinger][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Josh-Fruhlinger/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html +[2]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From f856967ab3ee70555d691b01905d4c0675d8b4ff Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Apr 2020 01:07:35 +0800 Subject: [PATCH 0090/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200401=20How?= =?UTF-8?q?=20enterprise=20networking=20is=20changing=20with=20a=20work-at?= =?UTF-8?q?-home=20workforce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200401 How enterprise networking is changing with a work-at-home workforce.md --- ... changing with a work-at-home workforce.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/talk/20200401 How enterprise networking is changing with a work-at-home workforce.md diff --git a/sources/talk/20200401 How enterprise networking is changing with a work-at-home workforce.md b/sources/talk/20200401 How enterprise networking is changing with a work-at-home workforce.md new file mode 100644 index 0000000000..f87bc0a8f8 --- /dev/null +++ b/sources/talk/20200401 How enterprise networking is changing with a work-at-home workforce.md @@ -0,0 +1,114 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How enterprise networking is changing with a work-at-home workforce) +[#]: via: (https://www.networkworld.com/article/3534037/how-enterprise-networking-is-changing-with-a-work-at-home-workforce.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +How enterprise networking is changing with a work-at-home workforce +====== +Network World updates the latest COVID-19-related networking news +Ig0rZh / Getty Images + +_As the coronavirus spreads, public and private companies as well as government entities are requiring employees to work from home, putting unforeseen strain on all manner of networking technologies and causing bandwidth and security concerns.  What follows is a round-up of news and traffic updates that Network World will update as needed to help keep up with the ever-changing situation.  Check back frequently!_ + +UPDATE: 3.30 + +AT&T said its core network traffic – which includes business, home broadband and wireless  – was up 24% through March 30 compared to the same day last month.  It broke down some mobility traffic patterns as well: voice calls: +33%, instant messaging: +63%, text messaging: +41%, email: -18%, web browsing: -5%, video: +4% (also accounts for over half of all mobility traffic). It also usage for conferencing: AT&T’s global audio-conferencing solution: +200%; audio, web and video conferencing tools: +400%; Large-scale webcast events: +200%. + +[RELATED: Firewall face-off for the enterprise][1] + +AT&T said its investment in artificial intelligence technology is helping it keep up with demand. For example, the company said AI is helping remotely troubleshoot and diagnose problems with customer equipment, by identifying the cause or even proactively identifying a potential issue before it occurs. “We’ve expedited deployments of new AI capabilities in certain markets that will allow us to balance the traffic load within a sector and across sectors to help avoid overloading specific cells and improve the experience.” + +DNS vendor BlueCat says it has been tracking the use of DNS over HTTPS (DoH) – a method of encrypting queries to prevent visibility into DNS traffic patterns.  Over the last week through March 27, the company said it has  seen a massive increase in the use of DoH across its customer base wrote Ben Ball, director of strategy and content marketing at BlueCat in a [blog][2] about the trend. “In the course of a single weekend, the number of endpoints attempting to use DoH went from an average of 90 to about 1,400.  That’s a 1,500% increase in the use of DoH. Around 45% of these queries are from Firefox (which now activates DoH by default).  Aside from that, we’re seeing queries to eleven different DoH services from all kinds of applications. DoH usage is fairly uniform across our customer base as well – this isn’t one company or industry vertical; this is a broad trend. While we haven’t seen any clear indications that any of these queries are from [DoH enabled malware][3], that is an emerging threat that we are tracking,” Ball stated. + +Ookla’s [SpeedTest][4] shows mean download speed over fixed broadband declined only slightly in Mexico and the U.S. when comparing the week of March 23 to that of March 16, while a decline in Canada’s mean download speed over fixed broadband was more evident. Mean download speed over mobile was down in the U.S. and Canada during the week of March 23, while it rose slightly in Mexico during the same period. + +**UPDATE 3.27** + +[][5] + +Broadband watchers at [BroadbandNow][6] say users in most of the cities it analyzed are experiencing normal network conditions, suggesting that ISP’s (and their networks) are holding up to the shifting demand. In a March 25 [post][7] the firm wrote: “Encouragingly, many of the areas hit hardest by the spread of the coronavirus are holding up to increased network demand. Cities like Los Angeles, Chicago, Brooklyn, and San Francisco have all experienced little or no disruption. New York City,  now the epicenter of the virus in the U.S., has seen a 24% dip out of its previous ten-week range. However, with a new median speed of nearly 52 Mbps, home connections still appear to be holding up overall.” + +Other BroadbandNow findings included: + + * Eighty eight (44%) of the 200 cities it analyzed experienced some degree of network degradation over the past week compared to the 10 weeks prior. However, only 27 (13.5%) cities experienced dips of 20% below range or greater. + * Seattle download speeds have continued to hold up over the past week, while New York City’s speeds have fallen out of range by 24%. Both cities are currently heavily affected by the coronavirus pandemic. + * Three cities – Austin, Texas, Winston Salem, N.C., and Oxnard, Calif. – have experienced significant degradations, falling out of their 10-week range by more than 40%. + + + +Cisco’s Talos threat-intelligence arm [wrote][8] on March 26 about the COVID security threat noting what it called three broad categories of attacks leveraging COVID with known advanced persistent threat participation in: [Malware and phishing campaigns][9] using COVID-themed lures; attacks against organizations that carry out research and other work related to COVID; and fraud and disinformation. From an enterprise security perspective, Talos recommended: + + * Remote access: Do not expose Remote Desktop Protocol (RDP) to the internet. Use secure VPN connections with multi-factor authentication schemes. Network access control packages can be used to ensure that systems attempting to remotely connect to the corporate environment meet a minimum set of security standards such as anti-malware protection, patch levels, etc,. prior to granting them access to corporate resources. Continually identify and remediate access-policy violations. + * Identity Management: Protect critical and public-facing applications with multi-factor authentication and supporting corporate policies. Verify that remote-account and access-termination capabilities work as intended in a remote environment. + * Endpoint Control: Because many people may be working from home networks, endpoint visibility, protection, and mitigation is now more important than ever. Consider whether remediation and reimaging capabilities will work as intended in a remote environment. Encrypt devices where possible, and add this check to your NAC solution as a gate for connectivity. Another simple method of protecting endpoints is via DNS, such as with [Cisco’s] Umbrella, by blocking the resolution of malicious domains before the host has a chance to make a connection. + + + +In an [FAQ][10] about the impact of COVID-19 on fulfilling customer hardware orders, VMware stated: “Some VMware SD-WAN hardware appliances are on backorder as a result of supply chain issues. As a result, we are extending the option to update existing orders with different appliances where inventory is more readily available. Customers may contact a special email hotline with questions related to backordered appliances. Please send an email to [sd-wan-hotline@vmware.com][11] with your questions and include the order number, urgent quantities, and contact information. We will do our best to respond within 48 hours.” + +Cisco said it has been analyzing traffic statistics with major carriers across Asia, Europe, and the Americas, and its data shows that typically, the most congested point in the network occurs at inter-provider peering points, Jonathan Davidson, senior vice president and general manager of Cisco's Mass-Scale Infrastructure Group wrote in a [blog][12] on March 26. “However, the traffic exchanged at these bottlenecks is only a part of the total internet traffic, meaning reports on traffic may be higher overall as private peering and local destinations also contribute to more traffic growth.” + +“Our analysis at these locations shows an increase in traffic of 10% to 33% over normal levels. In every country, traffic spiked with the decision to shut down non-essential businesses and keep people at home. Since then, traffic has remained stable or has experienced a slight uptick over the days that followed,” Davidson stated. + +He said that traffic during peak hours from 6 p.m. and 10 p.m. has increased slightly, but is not the primary driver for the overall inrease. Busy hours have extended to 9 a.m. 10 p.m., although the new busy-hour (9 a.m. to 6 p.m.) traffic is still below the traditional peak hours. "Service providers are certainly paying attention to these changes, but they are not yet a dire concern, as most networks are designed for growth. Current capacities are utilized more over the course of the entire day,” he wrote. + +Spanish multinational telecommunications company [Telefonica][13]’ said IP networks are experiencing traffic increases of close to 40% while mobile voice use is up about 50% and data is up 25%. In general, traffic through IP networks has experienced increases of nearly 40% while mobile use has increased by about 50% for voice and 25% for data. Likewise, traffic from instant-messaging tools such as Whatsapp has increased fivefold in recent days. + +**UPDATE: 3.26** + + * Week over week (ending March 23) [Ookla][14] says it has started to see a degradation of mobile and fixed-broadband performance worldwide. More detail on specific locations is available below. Comparing the week of March 16 to the week of March 9, mean download speed over mobile and fixed broadband decreased in Canada and the U.S. while both remained relatively flat in Mexico. + * What is the impact of the coronavirus on corporate network planning? Depends on how long the work-from-home mandate goes on really. Tom Nolle, president of CIMI Corp. [takes an interesting look at the situation][15] saying the shutdown “could eventually produce a major uptick for SD-WAN services, particularly in [managed service provider]    Businesses would be much more likely to embark on an SD-WAN VPN adventure that didn’t involve purchase/licensing, favoring a service approach in general, and in particular one with a fairly short contract period.” + * Statistics from VPN provider [NordVPN][16] show the growth of VPN usage across the globe.  For example, the company said the US has experienced a 65.93% growth in the use of business VPNs since March 11. It reported that mass remote working has contributed towards a rise in desktop (94.09%) and mobile app (0.39%) usage among Americans. Globally, NordVPN teams has seen a 165% spike in the use of business VPNs and business VPN usage in Netherlands (240.49%), Canada (206.29%) and Austria (207.86%) has skyrocketed beyond 200%. Italy has had the most modest growth in business VPN usage at just 10.57%. + + + +**UPDATE: 3. 25**: + + * According to [Atlas VPN][17] user data, VPN usage in the US increased by 124% during the last two weeks. VPN usage in the country increased by 71% between March 16 and 22 alone. Atlas said it measured how much traffic traveled through its servers during that period compared to March 9 to 15. The data came from the company's 53,000 weekly users. + * Verizon [reports][18] that voice usage, long declining in the age of texting, chat and social media, is up 25% in the last week. The network report shows the primary driver is accessing conference calls. In addition, people are talking longer on mobile devices with wireless voice usage notching a 10% increase and calls lasting 15% longer.  + * AT&T also [reported][19] increased calling, especially Wi-Fi calling, up 88% on March 22 versus a normal Sunday. It says that consumer home voice calls were up 74% more than an average Sunday; traffic from Netflix dipped after all-time highs on Friday and Saturday; and data traffic due to heavy video streaming between its network and peered networks tied record highs. AT&T said it has deployed portable cell nodes to bolster coverage supporting FirstNet customers in Indiana, Connecticut, New Jersey, California and New York. + * Microsoft this week advised users of Office 365 it was throttling back some services: + * **OneNote: ** OneNote in Teams will be read-only for commercial tenants, excluding EDU. Users can go to OneNote for the web for editing. Download size and sync frequency of file attachments has been changed. You can find details on these and other OneNote related updates as . + * **SharePoint:** We are rescheduling specific backend operations to regional evening and weekend business hours. Impacted capabilities include migration, DLP and delays in file management after uploading a new file, video or image. Reduced video resolution for playback videos. + * **Stream:** People timeline has been disabled for newly uploaded videos. Pre-existing videos will not be impacted. Meeting recording video resolution adjusted to 720p. + + + +**RELATED COVID-19 NEWS:** + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3534037/how-enterprise-networking-is-changing-with-a-work-at-home-workforce.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3189176/security/face-off-cisco-vs-fortinet-for-enterprise-firewalls.html +[2]: https://www.bluecatnetworks.com/blog/wfh-doh/ +[3]: https://blog.netlab.360.com/an-analysis-of-godlua-backdoor-en/ +[4]: https://www.speedtest.net/insights/blog/tracking-covid-19-impact-global-internet-performance/ +[5]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[6]: https://broadbandnow.com/ +[7]: https://broadbandnow.com/report/internet-speed-analysis-march-15th-21st/ +[8]: https://blog.talosintelligence.com/2020/03/covid-19-pandemic-threats.html +[9]: https://blog.talosintelligence.com/2020/02/coronavirus-themed-malware.html +[10]: https://www.vmware.com/company/news/updates/vmware-response-covid-19.html?mid=31381&eid=CVMW2000048242496 +[11]: mailto:sd-wan-hotline@vmware.com +[12]: https://blogs.cisco.com/news/global-traffic-spikes-no-panic-at-the-cisco +[13]: https://www.telefonica.com/en/web/press-office/-/telefonica-announces-measures-related-to-covid-19 +[14]: https://downdetector.com/?utm_campaign=Ookla%20Insights%20Blog%20Subscription&utm_source=hs_email&utm_medium=email&utm_content=85202785&_hsenc=p2ANqtz--Nj93d_eQyJpsqxrPJyNPtTiMBWBQU984psLyalw51K61e4d1WODareMF5NWFriHY2Uzw3WF7rF-2vSfH5cR53Jg3K5Q&_hsmi=85202785 +[15]: https://blog.cimicorp.com/?p=4068 +[16]: https://nordvpnteams.com/ +[17]: https://atlasvpn.com/blog/lockdowns-and-panic-leads-to-a-124-surge-in-vpn-usage-in-the-us/ +[18]: https://www.verizon.com/about/news/update-verizon-serve-customers-covid-19 +[19]: https://about.att.com/pages/COVID-19.html From 471e64aa4fc5c2f61ec636029e181ec6d9aebb4c Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 2 Apr 2020 08:27:17 +0800 Subject: [PATCH 0091/1809] translated --- ...a 14- How to Install it on Ubuntu Linux.md | 82 ------------------- ...a 14- How to Install it on Ubuntu Linux.md | 82 +++++++++++++++++++ 2 files changed, 82 insertions(+), 82 deletions(-) delete mode 100644 sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md create mode 100644 translated/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md diff --git a/sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md b/sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md deleted file mode 100644 index 3e2c6d9acc..0000000000 --- a/sources/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Oracle Announces Java 14! How to Install it on Ubuntu Linux) -[#]: via: (https://itsfoss.com/java-14-ubuntu/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Oracle Announces Java 14! How to Install it on Ubuntu Linux -====== - -Recently, Oracle announced the general availability of Java 14 (or the Oracle JDK 14). If you are someone who wants to have the latest and greatest to experiment and develop stuff – you can try installing Java 14 on your Linux system. - -Oracle JDK 14 (or simply Java 14) [release][1] includes a couple of new features if you’re interested to preview them. I’ve linked them below: - - * [Pattern matching for instanceof][2] - * [Records][3] - * [Text Blocks][4] - - - -In addition to the preview features, it packs in several improvements and additions. Quoting the press release, they mentioned the additional improvements as well: - -> Additionally, the latest Java release adds Java language support for switch expressions, exposes new APIs for continuous monitoring of JDK Flight Recorder data, extends the availability of the low-latency Z Garbage Collector to macOS and Windows, and adds, in incubator modules, the packaging of self-contained Java applications and a new Foreign memory access API for safe, efficient access to memory outside of the Java heap. - -Of course, if you want to dive into the exact details, you should check the [official announcement][1]. - -In this tutorial, I’ll show you the easy way to get Java 14 installed on your Ubuntu system. Read on. - -**Note:** If you opt for Oracle Java 11 or above, you should learn about the new [Oracle Technology Network License Agreement][5] to know how it affects personal users, developers, and commercial organizations. Usually, these are free to use for development and testing – but not for production. - -### How To Install Java 14 on Ubuntu Linux? - -![][6] - -For reference, I’ve successfully tried it on **Pop!_OS 19.10** where I had the **OpenJDK 11** installed as the default. - -Here, we are going to use the Java 14 installer (originally based on WebUpd8 Java Package) by [Linux Uprising][7]. - -Simply enter the commands below in the terminal to get it installed: - -``` -sudo add-apt-repository ppa:linuxuprising/java -sudo apt update -sudo apt install oracle-java14-installer -``` - -This should do the job. And, when it’s done, if you want to make it the default, you can type in the following command to do it: - -``` -sudo apt install oracle-java14-set-default -``` - -It is worth noting that this is only for Ubuntu-based distributions. If you want to install it on Debian and other Linux distributions, you can follow [Linux Uprising’s detailed guide][7] on installing Java 14 as well. - -### Wrapping Up - -Of course, while this is about the bleeding edge features – if you do not want to break things, you might want to hold on to Java 11. If you want to experiment while knowing the risks, go ahead and give it a try! - -Feel free to let me know your thoughts on Java 14 in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/java-14-ubuntu/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://www.oracle.com/corporate/pressrelease/oracle-announces-java14-031720.html -[2]: https://openjdk.java.net/jeps/305 -[3]: https://openjdk.java.net/jeps/359 -[4]: https://openjdk.java.net/jeps/368 -[5]: https://www.oracle.com/technetwork/java/javase/overview/oracle-jdk-faqs.html -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/install-java-14-ubuntu.png?ssl=1 -[7]: https://www.linuxuprising.com/2020/03/how-to-install-oracle-java-14-jdk14-on.html diff --git a/translated/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md b/translated/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md new file mode 100644 index 0000000000..e030ed192e --- /dev/null +++ b/translated/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Oracle Announces Java 14! How to Install it on Ubuntu Linux) +[#]: via: (https://itsfoss.com/java-14-ubuntu/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Oracle 发布 Java 14!如何在 Ubuntu Linux 上安装 +====== + +最近,Oracle 宣布 Java 14(或 Oracle JDK 14)正式开放。如果你想进行最新的实验或者开发的话,那么你可以试试在 Linux 系统上安装 Java 14。 + +Oracle JDK 14(或简称 Java 14)[发行版][1]包含几个新功能,如果你想预览它们的话。我已添加了链接: + + * [instanceof 的模式匹配][2] + * [Records][3] + * [Text Blocks][4] + + + +除预览功能外,它还包含一些改进和补充。在新闻中,他们还提到了其他改进: + +>此外,最新的 Java 版本增加了 Java 语言对 switch 表达式的支持,新增了用于持续监控 JDK Flight Recorder 数据的新 API,将低延迟 zgc 扩展到了 macOS 和 Windows,并添加在 incubator 模块中,独立的 Java 应用打包和为了安全的新的外部内存访问 API 来有效地访问 Java 堆外部的内存。 + +当然,如果你想详细了解细节,那么你应查看[官方公告][1]。 + +在本教程中,我将向你展示在 Ubuntu 系统上安装 Java 14 的简便方法。继续阅读。 + +**注意:**如果你选择 Oracle Java 11 或更高版本,那么应该了解新的 [Oracle 技术网络许可协议][5],以了解它如何影响个人用户、开发人员和商业组织。通常,它们可以免费用于开发和测试,但不能用于生产。 + +### 如何在 Ubuntu Linux 上安装 Java 14? + +![][6] + +作为参考,我已成功在默认安装 **OpenJDK 11** 的 **Pop!_OS 19.10** 上成功安装了它。 + +这里,我们将使用 [Linux Uprising][7] 的 Java 14 安装程序(最初基于 WebUpd8 Java 软件包)。 + +只需在终端中输入以下命令即可进行安装: + +``` +sudo add-apt-repository ppa:linuxuprising/java +sudo apt update +sudo apt install oracle-java14-installer +``` + +这应该就完成了,如果你想将它设为默认,那么你可以输入以下命令: + +``` +sudo apt install oracle-java14-set-default +``` + +值得注意的是,这仅适用于基于 Ubuntu 的发行版。如果要在 Debian 和其他 Linux 发行版上安装它,那么也可以按照 [Linux Uprising 中的详细指南][7]安装 Java 14。 + +### 总结 + +当然,这些是最新的特性,如果你不想破环环境,你或许会希望继续使用 Java11。如果你想在了解风险的情况下进行试验,请继续尝试! + +欢迎在下面的评论中让我知道你对 Java 14 的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/java-14-ubuntu/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.oracle.com/corporate/pressrelease/oracle-announces-java14-031720.html +[2]: https://openjdk.java.net/jeps/305 +[3]: https://openjdk.java.net/jeps/359 +[4]: https://openjdk.java.net/jeps/368 +[5]: https://www.oracle.com/technetwork/java/javase/overview/oracle-jdk-faqs.html +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/install-java-14-ubuntu.png?ssl=1 +[7]: https://www.linuxuprising.com/2020/03/how-to-install-oracle-java-14-jdk14-on.html From 3ff19319186f5301b15fc49b318fb54ea2622ab9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 2 Apr 2020 08:35:13 +0800 Subject: [PATCH 0092/1809] translating --- ...0401 How to Find Which Graphics Card do You Have in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md b/sources/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md index 18db3d8c8d..112a024b5c 100644 --- a/sources/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md +++ b/sources/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ac42a35dc9e8af631e8f61f3cc3a6fc343bc6ca7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Apr 2020 10:11:01 +0800 Subject: [PATCH 0093/1809] PRF @MjSeven --- ...n your blog on GitHub Pages with Python.md | 95 ++++++++++--------- 1 file changed, 48 insertions(+), 47 deletions(-) diff --git a/translated/tech/20190523 Run your blog on GitHub Pages with Python.md b/translated/tech/20190523 Run your blog on GitHub Pages with Python.md index 47134718ee..302ff61426 100644 --- a/translated/tech/20190523 Run your blog on GitHub Pages with Python.md +++ b/translated/tech/20190523 Run your blog on GitHub Pages with Python.md @@ -1,21 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Run your blog on GitHub Pages with Python) [#]: via: (https://opensource.com/article/19/5/run-your-blog-github-pages-python) [#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani) -在 GitHub 上使用 Python 运行你的博客 +使用 Python 在 GitHub 上运行你的博客 ====== -使用 Pelican(一个基于 Python 的平台)在 GitHub 上创建博客,看起来很不错。 -![Raspberry Pi and Python][1] +> 使用 Pelican 创建博客,这是一个基于 Python 的平台,与 GitHub 配合的不错。 + +![](https://img.linux.net.cn/data/attachment/album/202004/02/101030cy0t0f0e0jvf5e5e.jpg) [GitHub][2] 是一个非常流行的用于源代码控制的 Web 服务,它使用 [Git][3] 同步本地文件和 GitHub 服务器上保留的副本,这样你就可以轻松地共享和备份你的工作。 -除了为代码仓库提供用户界面之外,GitHub 还运允许用户直接从仓库[发布网页][4]。GitHub 推荐的网站生成软件包是 [Jekll][5],使用 Ruby 编写。因为我是 [Python][6] 的忠实粉丝,所以我更喜欢 [Pelican][7],这是一个基于 Python 的博客平台,可与 GitHub 很好地协同工作。 +除了为代码仓库提供用户界面之外,GitHub 还运允许用户直接从仓库[发布网页][4]。GitHub 推荐的网站生成软件包是 [Jekll][5],是使用 Ruby 编写的。因为我是 [Python][6] 的忠实粉丝,所以我更喜欢 [Pelican][7],这是一个基于 Python 的博客平台,可与 GitHub 很好地协同工作。 Pelican 和 Jekll 都可以将 [Markdown][8] 或 [reStructuredText][9] 中编写的内容转换为 HTML 以生成静态网站,并且两个生成器都支持定制的主题。 @@ -23,21 +24,21 @@ Pelican 和 Jekll 都可以将 [Markdown][8] 或 [reStructuredText][9] 中编写 ### 安装 Pelican 并创建仓库 -首先,你必须在本地计算机上安装 Pelican 和 **ghp-import**。使用 Python 软件包安装工具 [pip][12](你有,对吧?),这非常容易: +首先,你必须在本地计算机上安装 Pelican 和 `ghp-import`。使用 Python 软件包安装工具 [pip][12](你有,对吧?),这非常容易: ``` $ pip install pelican ghp-import Markdown ``` -然后,打开浏览器并在 GitHub 上为你的新博客创建一个新的仓库,命名如下(在此处以及整个教程中,用 GitHub 用户名替换 ): +然后,打开浏览器并在 GitHub 上为你新鲜出炉的博客创建一个新仓库,命名如下(在此处以及整个教程中,用 GitHub 用户名替换 `username`): ``` https://GitHub.com/username/username.github.io ``` -让它保持空白,稍后我们用引人注目的博客内容来填充它。 +让它保持为空,稍后我们用引人注目的博客内容来填充它。 -使用命令行(确保正确),将空的 Git 仓库克隆到本地计算机: +使用命令行(确保正确),将这个空 Git 仓库克隆到本地计算机: ``` $ git clone blog @@ -46,9 +47,9 @@ $ cd blog ### 奇怪的把戏... -在 GitHub 上发布 Web 内容有一个不太明显的技巧,对于用户页面(托管在名为 _username.github.io_ 的仓库的页面上),其内容来自 **master** 分支。 +在 GitHub 上发布 Web 内容有一个不太引入注意的技巧,对于托管在名为 `username.github.io` 的仓库的用户页面,其内容由 `master` 分支提供服务。 -我强烈建议不要将所有 Pelican 配置文件和原始 Markdown 文件都保留在 **master** 中,**master** 中只保留 Web 内容中。因此,我将 Pelican 配置和原始内容保留在一个我喜欢称为 **content** 的单独分支中。(你可以随意创建一个分支,但以下内容沿用 **content**。)我喜欢这种结构,因为我可以放弃掉 **master** 中的所有文件,然后用 **content** 分支重新填充它。 +我强烈建议所有的 Pelican 配置文件和原始的 Markdown 文件都不要保留在 `master` 中,`master` 中只保留 Web 内容。因此,我将 Pelican 配置和原始内容保留在一个我喜欢称为 `content` 的单独分支中。(你可以随意创建一个分支,但以下内容沿用 `content`。)我喜欢这种结构,因为我可以放弃掉 `master` 中的所有文件,然后用 `content` 分支重新填充它。 ``` $ git checkout -b content @@ -57,7 +58,7 @@ Switched to a new branch 'content' ### 配置 Pelican -现在该进行内容配置了。Pelican 提供了一个很棒的初始化工具 **pelican-quickstart**,它会询问你有关博客的一系列问题。 +现在该进行内容配置了。Pelican 提供了一个很棒的初始化工具 `pelican-quickstart`,它会询问你有关博客的一系列问题。 ``` $ pelican-quickstart @@ -68,11 +69,11 @@ This script will help you create a new Pelican-based website. Please answer the following questions so this script can generate the files needed by Pelican. -> Where do you want to create your new web site? [.] +> Where do you want to create your new web site? [.] > What will be the title of this web site? Super blog > Who will be the author of this web site? username > What will be the default language of this web site? [en] -> Do you want to specify a URL prefix? e.g., (Y/n) n +> Do you want to specify a URL prefix? e.g., http://example.com (Y/n) n > Do you want to enable article pagination? (Y/n) > How many articles per page do you want? [10] > What is your time zone? [Europe/Paris] US/Central @@ -90,13 +91,12 @@ Done. Your new project is available at /Users/username/blog 你可以对每个问题都采用默认值,但除了以下这些问题: - * 网站标题,应该唯一且特殊 - * 网站作者,可以是个人用户名或你的全名 - * 时区,可能你不在巴黎 - * 上传到 GitHub 页面,我们选择 "y" +* 网站标题,应该唯一且特殊 +* 网站作者,可以是个人用户名或你的全名 +* 时区,可能你不在巴黎 +* 上传到 GitHub 页面,我们选择 `y` - -回答完所有问题后,Pelican 会在当前目录中保留以下内容: +回答完所有问题后,Pelican 会在当前目录中留下以下内容: ``` $ ls @@ -105,11 +105,11 @@ fabfile.py output/ pelicanconf.py publishconf.py ``` -你可以查看 [Pelican 文档][13]来了解如何使用这些文件,但 _现在_ 我们要做的是完成手头的工作。说实话,我也没有阅读文档。 +你可以查看 [Pelican 文档][13]来了解如何使用这些文件,但**现在**我们要做的是完成手头的工作。说实话,我也没有阅读文档。 ### 继续 -将所有 Pelican 生成的文件添加到本地 Git 仓库的 **content** 分支,提交更改,然后将本地更改推送到 Github 上托管的远程仓库: +将所有 Pelican 生成的文件添加到本地 Git 仓库的 `content` 分支,提交更改,然后将本地更改推送到 Github 上托管的远程仓库: ``` $ git add . @@ -117,11 +117,11 @@ $ git commit -m 'initial pelican commit to content' $ git push origin content ``` -这件事情并不是特别令人兴奋,但是如果我们需要将内容恢复到这些文件的时候,这将非常方便。 +这件事情并不是特别令人兴奋,但是如果我们需要撤销这些文件之一的修改时,这将非常方便。 ### 终于 -终于,现在你得到一个博客了!你所有的博客文章、照片、图像、PDF 等都将位于 **content** 目录中,它最初是空的。要开始创建第一篇博客和关于页面,输入: +终于,现在你得到一个博客了!你所有的博客文章、照片、图像、PDF 等都将位于 `content` 目录中,它最初是空的。要开始创建第一篇博客和关于页面,输入: ``` $ cd content @@ -131,7 +131,7 @@ $ touch first-post.md $ touch pages/about.md ``` -接下来,在你喜欢的文本编辑器中打开 **first-post.md**,并添加以下内容: +接下来,在你喜欢的文本编辑器中打开 `first-post.md`,并添加以下内容: ``` title: First Post on My Sweet New Blog @@ -147,7 +147,7 @@ the reader! 前三行是 Pelican 用于组织内容的元数据。有很多不同的元数据可供你选择。再说一次,文档是你了解更多选项的最佳选择。 -现在,打开空白文件 **pages/about.md** 并添加以下文本: +现在,打开空白文件 `pages/about.md` 并添加以下文本: ``` title: About @@ -164,7 +164,7 @@ and I would probably have been burned at the stake. [my_sweet_photo]: {static}/images/HotPhotoOfMe.jpg ``` -现在,content 目录中将包含三个新的 Web 内容,在 content 分支中还有很多内容。 +现在,`content` 目录中将包含三个新的 Web 内容,在 `content` 分支中还有很多内容。 ### 发布 @@ -172,27 +172,28 @@ and I would probably have been burned at the stake. 剩下要做的就是: - * 运行 Pelican 以在 **output** 中生成静态 HTML 文件: - ``` - `$ pelican content -o output -s publishconf.py` - ``` +* 运行 Pelican 以在 `output` 中生成静态 HTML 文件: - * 使用 **ghp-import** 将 **output** 目录的内容添加到 **master** 分支中: - ``` - $ ghp-import -m "Generate Pelican site" --no-jekyll -b master output` - ``` + ``` +$ pelican content -o output -s publishconf.py +``` +* 使用 `ghp-import` 将 `output` 目录的内容添加到 `master` 分支中: - * 将本地 master 分支推送到远程仓库: - ``` - $ git push origin master - ``` - - * 提交新内容并将其推送到 **content** 分支 - ``` - $ git add content - $ git commit -m 'added a first post, a photo and an about page' - $ git push origin content - ``` + ``` +$ ghp-import -m "Generate Pelican site" --no-jekyll -b master output +``` +* 将本地 `master` 分支推送到远程仓库: + + ``` +$ git push origin master +``` +* 提交新内容并将其推送到 `content` 分支 + + ``` +$ git add content +$ git commit -m 'added a first post, a photo and an about page' +$ git push origin content +``` ### OMG,我成功了 @@ -211,7 +212,7 @@ via: https://opensource.com/article/19/5/run-your-blog-github-pages-python 作者:[Erik O'Shaughnessy][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f0e882d9c2cdf28afcb09e829cae5dd5e791975f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Apr 2020 10:11:32 +0800 Subject: [PATCH 0094/1809] PUB @MjSeven https://linux.cn/article-12064-1.html --- .../20190523 Run your blog on GitHub Pages with Python.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190523 Run your blog on GitHub Pages with Python.md (99%) diff --git a/translated/tech/20190523 Run your blog on GitHub Pages with Python.md b/published/20190523 Run your blog on GitHub Pages with Python.md similarity index 99% rename from translated/tech/20190523 Run your blog on GitHub Pages with Python.md rename to published/20190523 Run your blog on GitHub Pages with Python.md index 302ff61426..ea62c62a04 100644 --- a/translated/tech/20190523 Run your blog on GitHub Pages with Python.md +++ b/published/20190523 Run your blog on GitHub Pages with Python.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12064-1.html) [#]: subject: (Run your blog on GitHub Pages with Python) [#]: via: (https://opensource.com/article/19/5/run-your-blog-github-pages-python) [#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani) From c207c3a91b56c21d7bbb624e1b6434a5736cab13 Mon Sep 17 00:00:00 2001 From: Hank Chow <280630620@qq.com> Date: Thu, 2 Apr 2020 10:57:22 +0800 Subject: [PATCH 0095/1809] hankchow translating --- ...02 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md b/sources/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md index aa74979e36..cbbe8f7866 100644 --- a/sources/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md +++ b/sources/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0b20ce72e7dc4c82b468dd65602c7d3a5d22e369 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Apr 2020 11:13:05 +0800 Subject: [PATCH 0096/1809] APL --- .../tech/20200311 Directing Kubernetes traffic with Traefik.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200311 Directing Kubernetes traffic with Traefik.md b/sources/tech/20200311 Directing Kubernetes traffic with Traefik.md index 76a457be59..a76138274b 100644 --- a/sources/tech/20200311 Directing Kubernetes traffic with Traefik.md +++ b/sources/tech/20200311 Directing Kubernetes traffic with Traefik.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3b87db4c5ef239abf1575103960cb44d8b273189 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Apr 2020 13:04:09 +0800 Subject: [PATCH 0097/1809] TSL --- ...recting Kubernetes traffic with Traefik.md | 394 ------------------ ...recting Kubernetes traffic with Traefik.md | 381 +++++++++++++++++ 2 files changed, 381 insertions(+), 394 deletions(-) delete mode 100644 sources/tech/20200311 Directing Kubernetes traffic with Traefik.md create mode 100644 translated/tech/20200311 Directing Kubernetes traffic with Traefik.md diff --git a/sources/tech/20200311 Directing Kubernetes traffic with Traefik.md b/sources/tech/20200311 Directing Kubernetes traffic with Traefik.md deleted file mode 100644 index a76138274b..0000000000 --- a/sources/tech/20200311 Directing Kubernetes traffic with Traefik.md +++ /dev/null @@ -1,394 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Directing Kubernetes traffic with Traefik) -[#]: via: (https://opensource.com/article/20/3/kubernetes-traefik) -[#]: author: (Lee Carpenter https://opensource.com/users/carpie) - -Directing Kubernetes traffic with Traefik -====== -A step-by-step walkthrough on ingressing traffic into a -Kubernetes-Raspberry Pi cluster. -![Digital creative of a browser on the internet][1] - -In this article, we will deploy a couple of simple websites and learn how to ingress traffic from the outside world into our cluster using Traefik. After that, we will learn how to remove Kubernetes resources as well. Let’s get started! - -### Materials needed - -To follow along with the article, you only need [the k3s Raspberry Pi cluster][2] we built in a previous article. Since your cluster will be pulling images from the web, the cluster will need to be able to access the internet. - -Some configuration files and sample HTML files will be shown in this article for explanation purposes. All sample files can be downloaded [here][3]. - -### Deploying a simple website - -Previously, we did a direct deploy with **kubectl**. This is not the typical way to deploy things, however. Generally, YAML configuration files are used, and that is what we will use in this article. We will start at the top and create our configuration files in a top-down approach. - -### Deployment configuration - -First up is the deployment configuration. The configuration is shown below, and the explanation follows. I typically use the samples from the [Kubernetes documentation][4] as a starting point and then modify them to suit my needs. For example, the configuration below was modified after copying the sample from the [deployment docs][5]. - -Create a file, **mysite.yaml**, with the following contents: - - -``` -apiVersion: apps/v1 -kind: Deployment -metadata: -  name: mysite-nginx -  labels: -    app: mysite-nginx -spec: -  replicas: 1 -  selector: -    matchLabels: -      app: mysite-nginx -  template: -    metadata: -      labels: -        app: mysite-nginx -    spec: -      containers: -      - name: nginx -        image: nginx -        ports: -        - containerPort: 80 -``` - -Most of this is boilerplate. The important parts, we have named our deployment **mysite-nginx** with an **app** label of **mysite-nginx **as well. We have specified that we want one **replica** which means there will only be one pod created. We also specified **one container**, which we named **nginx**. We specified the **image** to be **nginx**. This means, on deployment, k3s will download the **nginx** image from DockerHub and create a pod from it. Finally, we specified a **containerPort** of **80**, which just means that inside the container the pod will listen on port **80**. - -I emphasized "inside the container" above because it is an important distinction. As we have the container configured, it is only accessible inside the container, and it is further restricted to an internal network. This is necessary to allow multiple containers to listen on the same container ports. In other words, with this configuration, some other pod could listen on its container port 80 as well and not conflict with this one. To provide formal access to this pod, we need a **service** configuration. - -### Service configuration - -In Kubernetes, a **service** is an abstraction. It provides a means to access a pod or set of pods. One connects to the service and the service routes to a single pod or load balances to multiple pods if multiple pod replicas are defined. - -The service can be specified in the same configuration file, and that is what we will do here. Separate configuration areas with **`---`**. Add the following to **mysite.yaml**: - - -``` -\--- -apiVersion: v1 -kind: Service -metadata: -  name: mysite-nginx-service -spec: -  selector: -    app: mysite-nginx -  ports: -    - protocol: TCP -      port: 80 -``` - -In this configuration, we have named our service **mysite-nginx-service**. We provided a `selector` of **app: mysite-nginx**. This is how the service chooses the application containers it routes to. Remember, we provided an **app** label for our container as **mysite-nginx**. This is what the service will use to find our container. Finally, we specified that the service protocol is **TCP** and the service listens on port **80**. - -### Ingress configuration - -The ingress configuration specifies how to get traffic from outside our cluster to services inside our cluster. Remember, k3s comes pre-configured with Traefik as an ingress controller. Therefore, we will write our ingress configuration specific to Traefik. Add the following to **mysite.yaml **( and don’t forget to separate with **`---`**): - - -``` -\--- -apiVersion: networking.k8s.io/v1beta1 -kind: Ingress -metadata: -  name: mysite-nginx-ingress -  annotations: -    kubernetes.io/ingress.class: "traefik" -spec: -  rules: -  - http: -      paths: -      - path: / -        backend: -          serviceName: mysite-nginx-service -          servicePort: 80 -``` - -In this configuration, we have named the ingress record **mysite-nginx-ingress**. And we told Kubernetes that we expect **traefik** to be our ingress controller with the **kubernetes.io/ingress.class** annotation. - -In the **rules** section, we are basically saying, when **http** traffic comes in, and the **path** matches **`/`** (or anything below that), route it to the **backend** service specified by the **serviceName mysite-nginx-service**, and route it to **servicePort 80**. This connects incoming HTTP traffic to the service we defined earlier. - -### Something to deploy - -That is really it as far as configuration goes. If we deployed now, we would get the default **nginx** page, but that is not what we want. Let’s create something simple but custom to deploy. Create the file **index.html** with the following contents: - - -``` -<html> -<head><title>K3S!</title> -  <style> -    html { -      font-size: 62.5%; -    } -    body { -      font-family: sans-serif; -      background-color: midnightblue; -      color: white; -      display: flex; -      flex-direction: column; -      justify-content: center; -      height: 100vh; -    } -    div { -      text-align: center; -      font-size: 8rem; -      text-shadow: 3px 3px 4px dimgrey; -    } -  </style> -</head> -<body> -  <div>Hello from K3S!</div> -</body> -</html> -``` - -We have not yet covered storage mechanisms in Kubernetes, so we are going to cheat a bit and just store this file in a Kubernetes config map. This is not the recommended way to deploy a website, but it will work for our purposes. Run the following: - - -``` -`kubectl create configmap mysite-html --from-file index.html` -``` - -This command creates a `configmap` resource named **mysite-html** from the local file **index.html**. This essentially stores a file (or set of files) inside a Kubernetes resource that we can call out in configuration. It is typically used to store configuration files (hence the name), so we are abusing it a bit here. In a later article, we will discuss proper storage solutions in Kubernetes. - -With the config map created, let’s mount it inside our **nginx** container. We do this in two steps. First, we need to specify a **volume**, calling out the config map. Then we need to mount the volume into the **nginx** container. Complete the first step by adding the following under the **spec** label, just after **containers** in **mysite.yaml**: - - -``` -      volumes: -      - name: html-volume -        configMap: -          name: mysite-html -``` - -This tells Kubernetes that we want to define a **volume**, with the name **html-volume** and that volume should contain the contents of the **configMap** named **html-volume** (which we created in the previous step). - -Next, in the **nginx** container specification, just under **ports**, add the following: - - -``` -        volumeMounts: -        - name: html-volume -          mountPath: /usr/share/nginx/html -``` - -This tells Kubernetes, for the **nginx** container, we want to mount a **volume** named **html-volume** at the path (in the container) **/usr/share/nginx/html**. Why **/usr/share/nginx/html**? That is where the **nginx** image serves HTML from. By mounting our volume at that path, we have replaced the default contents with our volume contents. - -For reference, the **deployment** section of the configuration file should now look like this: - - -``` -apiVersion: apps/v1 -kind: Deployment -metadata: -  name: mysite-nginx -  labels: -    app: mysite-nginx -spec: -  replicas: 1 -  selector: -    matchLabels: -      app: mysite-nginx -  template: -    metadata: -      labels: -        app: mysite-nginx -    spec: -      containers: -      - name: nginx -        image: nginx -        ports: -        - containerPort: 80 -        volumeMounts: -        - name: html-volume -          mountPath: /usr/share/nginx/html -      volumes: -      - name: html-volume -        configMap: -          name: mysite-html -``` - -### Deploy it! - -Now we are ready to deploy! We can do that with: - - -``` -`kubectl apply -f mysite.yaml` -``` - -You should see something similar to the following: - - -``` -deployment.apps/mysite-nginx created -service/mysite-nginx-service created -ingress.networking.k8s.io/mysite-nginx-ingress created -``` - -This means that Kubernetes created resources for each of the three configurations we specified. Check on the status of the pods with: - - -``` -`kubectl get pods` -``` - -If you see a status of **ContainerCreating**, give it some time and run **kubectl get pods** again. Typically, the first time, it will take a while because k3s has to download the **nginx** image to create the pod. After a while, you should get a status of **Running**. - -### Try it! - -Once the pod is running, it is time to try it. Open up a browser and type **kmaster** into the address bar. - -![][6] - -Congratulations! You’ve deployed a website on your k3s cluster! - -### Another one - -So now we have a whole k3s cluster running a single website. But we can do more! What if we have another website we want to serve on the same cluster? Let’s see how to do that. - -Again, we need something to deploy. It just so happens that my dog has a message she has wanted the world to know for some time. So, I crafted some HTML just for her (available from the samples zip file). Again, we will use the config map trick to host our HTML. This time we are going to poke a whole directory (the **html** directory) into a config map, but the invocation is the same. - - -``` -`kubectl create configmap mydog-html --from-file html` -``` - -Now we need to create a configuration file for this site. It is almost exactly the same as the one for **mysite.yaml**, so start by copying **mysite.yaml** to **mydog.yaml**. Now edit **mydog.yaml** to be: - - -``` -apiVersion: apps/v1 -kind: Deployment -metadata: -  name: mydog-nginx -  labels: -    app: mydog-nginx -spec: -  replicas: 1 -  selector: -    matchLabels: -      app: mydog-nginx -  template: -    metadata: -      labels: -        app: mydog-nginx -    spec: -      containers: -      - name: nginx -        image: nginx -        ports: -        - containerPort: 80 -        volumeMounts: -        - name: html-volume -          mountPath: /usr/share/nginx/html -      volumes: -      - name: html-volume -        configMap: -          name: mydog-html -\--- -apiVersion: v1 -kind: Service -metadata: -  name: mydog-nginx-service -spec: -  selector: -    app: mydog-nginx -  ports: -    - protocol: TCP -      port: 80 -\--- -apiVersion: networking.k8s.io/v1beta1 -kind: Ingress -metadata: -  name: mydog-nginx-ingress -  annotations: -    kubernetes.io/ingress.class: "traefik" -    traefik.frontend.rule.type: PathPrefixStrip -spec: -  rules: -  - http: -      paths: -      - path: /mydog -        backend: -          serviceName: mydog-nginx-service -          servicePort: 80 -``` - -We can do most of the edits by simply doing a search and replace of **mysite** to **mydog**. The two other edits are in the ingress section. We changed **path** to **/mydog **and we added an annotation, **traefik.frontend.rule.type: PathPrefixStrip**. - -The specification of the path **/mydog** instructs Traefik to route any incoming request that requests a path starting with **/mydog** to the **mydog-nginx-service**. Any other path will continue to be routed to **mysite-nginx-service.** - -The new annotation, **PathPrefixStrip**, tells Traefik to strip off the prefix **/mydog** before sending the request to **mydog-nginx-service**. We did this because the **mydog-nginx** application doesn’t expect a prefix. This means we could change where the service was mounted simply by changing the prefix in the ingress record. - -Now we can deploy like we did before: - - -``` -`kubectl apply -f mydog.yaml` -``` - -And now, my dog’s message should be available at . - -![][7] - -Phew! The message is out! Maybe we can all get some sleep tonight. - -So now, we have a k3s cluster hosting two websites with Traefik making decisions, based on path names, as to which service to pass the request to! We are not limited to path-based routing, however. We could use hostname based routing as well, which we will explore in a future article. - -Also, the websites we just hosted are standard unencrypted HTML sites. Everything these days is encrypted with SSL/TLS. In our next article, we will add support to our k3s cluster to host SSL/TLS HTTPS sites as well! - -### Cleaning up - -Before you go, since this article mostly dealt with sample sites, I would like to show you how to delete things in case you don’t want the samples hanging around on your cluster. - -For most configurations, you can undo the configuration simply by running the **delete** command with the same configuration file you deployed with. So let’s clean up both **mysite** and **mydog**. - - -``` -kubectl delete -f mysite.yaml -kubectl delete -f mydog.yaml -``` - -Since we manually created the config maps, we’ll need to delete those manually as well. - - -``` -kubectl delete configmap mysite-html -kubectl delete configmap mydog-html -``` - -Now if we do a **kubectl get pods**, we should see that our nginx pods are no longer around. - - -``` -$ kubectl get pods -No resources found in default namespace. -``` - -Everything is cleaned up. - -Tell me what thoughts you have on this project in the comments below. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/kubernetes-traefik - -作者:[Lee Carpenter][a] -选题:[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/carpie -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) -[2]: https://opensource.com/article/20/3/kubernetes-raspberry-pi -[3]: https://gitlab.com/carpie/ingressing_with_k3s/-/archive/master/ingressing_with_k3s-master.zip -[4]: https://kubernetes.io/docs/ -[5]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment -[6]: https://opensource.com/sites/default/files/uploads/mysite.jpg -[7]: https://opensource.com/sites/default/files/uploads/mydog.jpg diff --git a/translated/tech/20200311 Directing Kubernetes traffic with Traefik.md b/translated/tech/20200311 Directing Kubernetes traffic with Traefik.md new file mode 100644 index 0000000000..bb35205ad2 --- /dev/null +++ b/translated/tech/20200311 Directing Kubernetes traffic with Traefik.md @@ -0,0 +1,381 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Directing Kubernetes traffic with Traefik) +[#]: via: (https://opensource.com/article/20/3/kubernetes-traefik) +[#]: author: (Lee Carpenter https://opensource.com/users/carpie) + +使用 Traefik 引导 Kubernetes 流量 +====== + +> 将流量引入 Kubernetes 树莓派集群的分步指南。 + +![Digital creative of a browser on the internet][1] + +在本文中,我们将部署几个简单的网站,并学习如何使用 Traefik 将来自外部世界的流量引入到我们的集群中。之后,我们还将学习如何删除 Kubernetes 资源。让我们开始吧! + +- [video](https://youtu.be/QcC-5fRhsM8) + +### 准备 + +要继续阅读本文,你只需要我们在上一篇文章中构建的 [k3s 树莓派集群][2]。由于你的集群将从网络上拉取图像,因此该集群需要能够访问互联网。 + +出于解释目的,本文将显示一些配置文件和示例 HTML 文件。所有示例文件都可以在[此处][3]下载。 + +### 部署一个简单的网站 + +之前,我们使用 `kubectl` 进行了直接部署。但是,这不是部署事物的典型方法。通常,会使用 YAML 配置文件,这就是我们将在本文中使用的配置文件。我们将从顶部开始,并以自顶向下的方式创建该配置文件。 + +### 部署配置 + +首先是部署配置。配置如下所示,并在下面进行说明。我通常以 [Kubernetes 文档][4]中的示例为起点,然后对其进行修改以适合我的需求。例如,从[部署文档][5]复制示例后,修改下面的配置。 + +创建一个文件 `mysite.yaml`,其内容如下: + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mysite-nginx + labels: + app: mysite-nginx +spec: + replicas: 1 + selector: + matchLabels: + app: mysite-nginx + template: + metadata: + labels: + app: mysite-nginx + spec: + containers: + - name: nginx + image: nginx + ports: + - containerPort: 80 +``` + +其中大部分是样板。重要的部分,我们会将该部署命名为 `mysite-nginx`,并加上 `mysite-nginx` 的 `app` 标签。我们已指定要一个副本replica,这意味着将只创建一个 Pod。我们还指定了一个容器,我们将其命名为 `nginx`。我们将镜像image指定为 `nginx`。这意味着在部署时,k3s 将从 DockerHub 下载 `nginx` 镜像并从中创建一个 Pod。最后,我们指定了容器端口containerPort为 `80`,这只意味着在容器内部 Pod 会监听 `80` 端口。 + +我在上面强调了“在容器内部”,因为这是一个重要的区别。由于我们是按容器配置的,因此只能在容器内部访问它,并且进一步将其限制为内部网络。这是允许多个容器在同一容器端口上监听所必需的。换句话说,通过这种配置,其他某些 Pod 也可以在其容器端口 80 上侦听,并且不会与此容器冲突。为了提供对该 Pod 的正式访问权限,我们需要一个服务service配置。 + +### 服务配置 + +在 Kubernetes 中,服务service是一种抽象。它提供了一种访问一个或一组 Pod 的方法。如果定义了多个 Pod 副本,则一个连接到服务,并且由服务路由到单个 Pod,或通过负载均衡路由到多个 Pod。 + +可以在同一配置文件中指定该服务,这就是我们将在此处执行的操作。用 `---` 分隔配置区域。将以下内容添加到 `mysite.yaml` 中: + +``` +--- +apiVersion: v1 +kind: Service +metadata: + name: mysite-nginx-service +spec: + selector: + app: mysite-nginx + ports: + - protocol: TCP + port: 80 +``` + +在此配置中,我们将服务命名为 `mysite-nginx-service`。我们提供了 `app: mysite-nginx` 的选择器selector。这是服务选择其路由到的应用程序容器的方式。请记住,我们为容器提供了一个内容为 `mysite-nginx` 的 `app` 标签。这就是服务用来查找我们的容器的方式。最后,我们指定服务协议为 `TCP`,在端口 `80` 上侦听。 + +### 入口配置 + +入口Ingress配置指定如何将流量从集群外部传递到集群内部的服务。请记住,k3s 预先配置了 Traefik 作为入口控制器。因此,我们将编写特定于 Traefik 的入口配置。将以下内容添加到 `mysite.yaml` 中(不要忘了用 `---` 分隔): + +``` +--- +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: mysite-nginx-ingress + annotations: + kubernetes.io/ingress.class: "traefik" +spec: + rules: + - http: + paths: + - path: / + backend: + serviceName: mysite-nginx-service + servicePort: 80 +``` + +在此配置中,我们将入口记录命名为 `mysite-nginx-ingress`。我们告诉 Kubernetes,我们希望 `traefik` 成为我们的入口控制器,带有 `kubernetes.io/ingress.class` 的注解。 + +在规则rules部分中,我们基本上是说,当 `http` 流量进入时,并且 `path` 匹配 `/`(或其下的任何内容),将其路由到由 `serviceName mysite-nginx-service` 指定的后端backend服务中,并将其路由到 `servicePort 80`。这会将传入的 HTTP 流量连接到我们之前定义的服务。 + +### 部署的东西 + +就配置而言,确实如此。如果现在部署,我们将获得默认的 nginx 页面,但这不是我们想要的。让我们创建一些简单但可自定义的部署方式。创建具有以下内容的文件 `index.html`: + +``` + +K3S! + + + +
Hello from K3S!
+ + +``` + +我们尚未介绍 Kubernetes 中的存储机制,因此在这里我们偷懒一下,仅将该文件存储在 Kubernetes 配置映射中。这不是建议的网站部署方式,但可以满足我们的目的。运行以下命令: + +``` +kubectl create configmap mysite-html --from-file index.html +``` + +该命令从本地文件 `index.html` 创建名为 `mysite-html` 的配置映射configmap资源。这实际上是在 Kubernetes 资源中存储一个文件(或一组文件),我们可以在配置中调出该文件。它通常用于存储配置文件(因此而得名),因此我们在这里稍加滥用。在以后的文章中,我们将讨论 Kubernetes 中适当的存储解决方案。 + +创建配置映射后,让我们将其挂载在我们的 `nginx` 容器中。我们分两个步骤进行。首先,我们需要指定一个volume来调出配置映射。然后我们需要将该卷挂载到 `nginx` 容器中。通过在 `mysite.yaml` 中的 `container` 后面的 `spec` 标签下添加以下内容来完成第一步: + +``` +      volumes: +      - name: html-volume +        configMap: +          name: mysite-html +``` + +这告诉 Kubernetes 我们要定义一个名为 `html-volume` 的卷,并且该卷应包含名为 `html-volume`(我们在上一步中创建的)的配置映射的内容。 + +接下来,在 `nginx` 容器规范中的端口port下方,添加以下内容: + +``` +        volumeMounts: +        - name: html-volume +          mountPath: /usr/share/nginx/html +``` + +这告诉 Kubernetes,对于 `nginx` 容器,我们想在容器中的 `/usr/share/nginx/html` 路径中挂载名为 `html-volume` 的卷。 为什么要使用 `/usr/share/nginx/html`?那个位置就是 `nginx` 镜像提供 HTML 服务的地方。通过在该路径上挂载卷,我们用该卷内容替换了默认内容。 + +作为参考,配置文件的 `deployment` 部分现在应如下所示: + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: mysite-nginx +  labels: +    app: mysite-nginx +spec: +  replicas: 1 +  selector: +    matchLabels: +      app: mysite-nginx +  template: +    metadata: +      labels: +        app: mysite-nginx +    spec: +      containers: +      - name: nginx +        image: nginx +        ports: +        - containerPort: 80 +        volumeMounts: +        - name: html-volume +          mountPath: /usr/share/nginx/html +      volumes: +      - name: html-volume +        configMap: +          name: mysite-html +``` + +### 部署它! + +现在我们准备部署! 我们可以这样做: + +``` +kubectl apply -f mysite.yaml +``` + +你应该看到类似于以下内容: + +``` +deployment.apps/mysite-nginx created +service/mysite-nginx-service created +ingress.networking.k8s.io/mysite-nginx-ingress created +``` + +这意味着 Kubernetes 为我们指定的三个配置分别创建了资源。使用以下方法检查 Pod 的状态: + +``` +kubectl get pods +``` + +如果看到状态为 `ContainerCreating`,请给它一些时间并再次运行 `kubectl get pods`。通常,第一次会花一些时间,因为 k3s 必须下载 `nginx` 镜像来创建 Pod。一段时间后,你应该看到 `Running` 的状态。 + +### 尝试一下! + +Pod 运行之后,就该尝试了。 开浏览器,然后在地址栏中输入 `kmaster`。 + +![][6] + +恭喜你!你已经在 k3s 集群上部署了一个网站! + +### 另一个 + +因此,现在我们有了一个运行单个网站的整个 k3s 集群。但是我们可以做更多!如果我们要在同一集群中提供另一个网站怎么办?让我们看看如何做到这一点。 + +同样,我们需要部署一些东西。碰巧我的狗有一条信息,她想让世界知道一段时间。因此,我专门为她制作了一些 HTML(可从示例 zip 文件中获得)。同样,我们将使用配置映射的技巧来托管这些 HTML。这次我们将把整个目录(`html` 目录)放到配置映射中,但是调用是相同的。 + +``` +kubectl create configmap mydog-html --from-file html +``` + +现在,我们需要为此站点创建一个配置文件。它几乎与用于 `mysite.yaml` 的完全相同,因此首先将 `mysite.yaml` 复制为 `mydog.yaml`。现在将 `mydog.yaml` 修改为: + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mydog-nginx + labels: + app: mydog-nginx +spec: + replicas: 1 + selector: + matchLabels: + app: mydog-nginx + template: + metadata: + labels: + app: mydog-nginx + spec: + containers: + - name: nginx + image: nginx + ports: + - containerPort: 80 + volumeMounts: + - name: html-volume + mountPath: /usr/share/nginx/html + volumes: + - name: html-volume + configMap: + name: mydog-html +--- +apiVersion: v1 +kind: Service +metadata: + name: mydog-nginx-service +spec: + selector: + app: mydog-nginx + ports: + - protocol: TCP + port: 80 +--- +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: mydog-nginx-ingress + annotations: + kubernetes.io/ingress.class: "traefik" + traefik.frontend.rule.type: PathPrefixStrip +spec: + rules: + - http: + paths: + - path: /mydog + backend: + serviceName: mydog-nginx-service + servicePort: 80 +``` + +我们只需进行搜索并将 `mysite` 替换为 `mydog`即可完成大多数修改。其他两个修改在入口部分中。我们将 `path` 更改为 `/mydog`,并添加了一个注解 `traefik.frontend.rule.type: PathPrefixStrip`。 + +`/mydog` 路径的规范指示 Traefik 将以 `/mydog` 路径开头的所有传入请求路由到 `mydog-nginx-service`。任何其他路径将继续路由到 `mysite-nginx-service`。 + +新的注解 `PathPrefixStrip` 告诉 Traefik 在将请求发送到 `mydog-nginx-service` 之前先去除前缀 `/mydog`。我们这样做是因为 `mydog-nginx` 应用程序不需要前缀。这意味着我们可以简单地通过更改入口记录中的前缀来更改挂载的服务的位置。 + +现在我们可以像以前一样进行部署: + +``` +kubectl apply -f mydog.yaml +``` + +现在,我的狗的消息应该可以在 上找到。 + +![][7] + + +呼!消息出来了!也许今晚我们都可以睡一觉。 + +因此,现在,我们有了一个 k3s 集群,该集群托管了两个网站,Traefik 根据路径名决定将请求传递给哪个服务!但是,我们不仅限于基于路径的路由。我们也可以使用基于主机名的路由,我们将在以后的文章中进行探讨。 + +另外,我们刚刚托管的网站是标准的未加密 HTML 网站,如今的所有内容都使用 SSL/TLS 加密。在我们的下一篇文章中,我们将为 k3s 集群添加支持以托管 SSL/TLS HTTPS 站点! + +### 清理 + +在开始之前,由于本文主要涉及的是示例站点,因此我想向你展示如何删除内容,以防万一你不希望将这些示例丢在集群中。 + +对于大多数配置,只需使用与部署时使用的相同配置文件运行 `delete` 命令即可撤消配置。因此,让我们同时清理 `mysite` 和 `mydog`。 + +``` +kubectl delete -f mysite.yaml +kubectl delete -f mydog.yaml +``` + +由于我们是手动创建配置映射的,因此我们也需要手动删除它们。 + +``` +kubectl delete configmap mysite-html +kubectl delete configmap mydog-html +``` + +现在,如果我们执行 `kubectl get pods`,我们应该看到我们的 nginx Pod 不存在了。 + +``` +$ kubectl get pods +No resources found in default namespace. +``` + +一切都清理了。 + +请在下面的评论中告诉我你对这个项目有什么想法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/kubernetes-traefik + +作者:[Lee Carpenter][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/carpie +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://opensource.com/article/20/3/kubernetes-raspberry-pi +[3]: https://gitlab.com/carpie/ingressing_with_k3s/-/archive/master/ingressing_with_k3s-master.zip +[4]: https://kubernetes.io/docs/ +[5]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment +[6]: https://opensource.com/sites/default/files/uploads/mysite.jpg +[7]: https://opensource.com/sites/default/files/uploads/mydog.jpg From 59362ca799f82ca0451846d7ccc152bdcf40a61c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Apr 2020 17:40:13 +0800 Subject: [PATCH 0098/1809] APL --- sources/tech/20200331 5 ways to level up your Vim skills.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200331 5 ways to level up your Vim skills.md b/sources/tech/20200331 5 ways to level up your Vim skills.md index f5c315b1e7..d927fb59da 100644 --- a/sources/tech/20200331 5 ways to level up your Vim skills.md +++ b/sources/tech/20200331 5 ways to level up your Vim skills.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2991518b037cbd35ce30ee623bee31ac52e13543 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Apr 2020 19:19:19 +0800 Subject: [PATCH 0099/1809] TSL PART 1 --- ...0331 5 ways to level up your Vim skills.md | 161 ------------------ ...0331 5 ways to level up your Vim skills.md | 159 +++++++++++++++++ 2 files changed, 159 insertions(+), 161 deletions(-) delete mode 100644 sources/tech/20200331 5 ways to level up your Vim skills.md create mode 100644 translated/tech/20200331 5 ways to level up your Vim skills.md diff --git a/sources/tech/20200331 5 ways to level up your Vim skills.md b/sources/tech/20200331 5 ways to level up your Vim skills.md deleted file mode 100644 index d927fb59da..0000000000 --- a/sources/tech/20200331 5 ways to level up your Vim skills.md +++ /dev/null @@ -1,161 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 ways to level up your Vim skills) -[#]: via: (https://opensource.com/article/20/3/vim-skills) -[#]: author: (Detlef Johnson https://opensource.com/users/deckart) - -5 ways to level up your Vim skills -====== -Kick your text editor up a notch with a few fun tricks. -![Computer keyboard typing][1] - -Vim is one of the most popular text editors out there, so it is definitely worth taking time to learn how to use it. If the only things you learn how to do with the ubiquitous [Vi(m)][2] command-line text editor are to open a file, enter and edit some text, save the edited files, and exit the program, you will be much better off for it. - -Circumstances where you will find it extremely convenient to know Vim nearly always involve tasks running remote shell operations. If you regularly use secure shell:  - - -``` -`$ ssh user@hostname.provider.com` -``` - -and work with virtual private servers (VPS) or local virtualization containers, for that matter, you could benefit greatly from strong Vim skills. - -### Set Vim as your default text editor - -Vim is readily available in nearly all modern Linux (or BSD) distributions at the terminal emulator shell-command prompt. Once you've defined Vim as your default editor in your user shell, then you can navigate built-in utilities like **$ man** using familiar Vim key bindings. I'll explain how to do that with both Bash and Z shell (zsh), which is now the default shell for macOS users (since Catalina). - -#### Set Vim as default in Bash - -Bash manages settings through a combination of dotfiles. It's most common to add your preferred editor to your **.bashrc** file in your home directory, but it can be added to **.bash_profile** as well. (Read the [GNU Bash documentation][3] to understand the difference). - -Set Vim as your default editor by adding the following to **~/.bashrc**: - - -``` -# set default editor to Vim -export EDITOR=vim -``` - -A line starting with a **#** is an optional comment, which is a good way to remind yourself what a command does. - -#### Set Vim as default in Zsh - -Zsh is an increasingly popular terminal emulator, especially since Apple's FreeBSD-based Darwin system recently switched from Bash to zsh. - -The zsh dotfile parallels Bash's, so you can choose between **~/.zshrc** or **~/.zprofile**. See [the zsh documentation][4] for details on when to use which one. - -Set it as default with: - - -``` -# set default editor to Vim -export EDITOR=vim -``` - -### Optimize your Vim configuration - -Vim, much like a terminal emulator shell, uses dotfiles to set personal preferences. If you spotted the pattern, you might have guessed it's **~/.vimrc**. - -The first setting you may want to change is switching legacy Vi compatibility mode to Off. Since Vim is a superset of Vi, everything in Vi is available and vastly improved in Vim, and you get many advanced features. The latest version (8.2) allows you to open a terminal as a subprocess shell running in a split window. - -As an aside, setting legacy compatibility off might not seem like it's doing anything ([and in fact, it might not be][5]). Vim automatically switches the mode to Off by implication when it encounters a **.vimrc** file. It can still be important at times to explicitly turn it off. The shorthand "nocp" is synonymous with "nocompatible," which also works. There are many "[TIMTOWTDI][6]" conveniences for switching preferences as you work. - -Lines that begin with **"** are comments in **.vimrc** syntax (just like **#** in **.bashrc** files). They can help you remember things like why you chose a cryptic setting name. - -To turn off Vi compatibility, add the following to your **~/.vimrc** file: - - -``` -" ensure that legacy compatibility mode is off -" documentation: ' -set nocp -``` - -### Understand modes - -The notion of Vim's "modes" is very important to learn about, especially the difference between the very distinct **Normal** and **Insert** modes. Confusion about modes is what trips up most new users. Modes aren't unique to Vim, nor were they introduced by Vi. Command mode is so old that it predates the invention of [copy and paste][7] functionality in the 1970s. - -#### Important modes - -Vim depends on different modes to define keyboard-stroke behavior. The important modes to know are: - - * **Normal mode**: Default mode used primarily for navigation and opening files - * **Insert mode** (includes Replace): Where Vim allows for text input to an open file - * **Visual mode**: Where Vim acts similar to mouse-based input, such as copying, editing, replacing, and more - * **Command mode** (including Line, Ex command, and Last-line mode): A powerful way to do more in Vim - - - -Each mode has a great deal to explore. Use [Vimtutor][8] (**$ vimtutor**) to interactively learn about movement, modes, and running Ex commands in "Last Line" mode. Some indispensable productivity operators include: - -**:E** | Opens explorer for locating files and directories ----|--- -**.** | Repeats the last edit action -**;** | Repeats the last motion or movement forward -**,** | Repeats the last motion or movement backward -**/** | Searches document forward -**?** | Searches document backward -***** | Finds next occurrence of the word under the cursor -**#** | Finds the previous occurrence of the word under the cursor -**~** | Toggles case -**%** | Toggles between opening and closing **()**, **[]**, and **{}**; highly useful for coding -**z=** | Makes spelling suggestions - -### Play Vim like a piano - -While it's important to commit Vim's operator "language" to memory, the challenge to gaining mastery is to learn to think like a musician and combine operators and movements into "key chords in harmony" so that you can play Vim like a piano. That's where the power of text manipulation with Vim rivals that of the other notable command-line editor, Emacs. (While one of these editors will wear down your **Esc** key, using the other will wear down your **Ctrl** key.) - -When describing key chords, it's conventional in Vim to designate the **Ctrl** key using the capital letter C, followed by a hyphen (**C-**). It's not universal, but I will follow that convention from here onward and clarify when there is any potential for confusion. - -If you type long lines in Vim, you'll want to set it to wrap your text. To start personalizing Vim for the way you work, think about that setting: How would you like Vim to handle text wrapping by default when it starts? On or off? I like it turned off and leave it out of the runtime commands file. When I want text to wrap, I simply set it in command-line mode with **:set wrap**. - -There's nothing wrong with having Vim set to wrap text by default. It's simply a matter of preference—which can change over time. The same goes for handling paste, code language indent syntax, and the **Tab** key (tabs or spaces? and how many spaces then? Dive into these options [here][9]). All these options for default behavior are entirely configurable and changeable in real time as you work with command-line mode operations. - -You will find many suggestions for setting Vim defaults in community forums, on Vim wikis, and in articles (like this one). Setting preferences for your personal computing environment should be fairly familiar to you, and Vim is no different. I highly recommend that you start by making very small changes to your settings, and make additional changes slowly so that you can easily revert settings. This way, you might avoid the use of plugins for years—or entirely. - -### Splits, tabs, and terminals in Vim 8.2 - -There are two ways to split your working files into different views: they can appear side-by-side, or you can switch between them with full (window) screens using application tabs. These changes to your application window are initiated from command-line mode, which requires a colon (**:**) to call up the prompt. - -Each window split can host a file for editing, and you can arrange tabs to switch between additional files as much as you like. There is limited screen space for splits, so tabs are handy when you want to split more screens. How you decide to work is purely a matter of preference. To split a window horizontally, use **:sp**, and use **:vs** for vertical splits. - -As of [Vim 8.2][10], you can open a terminal shell sub-process in a vertical split with **:vert term** to run operations on the command line right alongside your code. You need to type **exit** to close your terminal process, just like you would end a shell session, but you close splits and tabs the same way you would close any ordinary Vim window, with **:q**. - -To initialize a tab, use a special edit command: **:tabedit**, which automatically switches you to the new open tab. If you give the command a file name as an argument, that file will open for editing. If you neglect to give it a file name as an argument, the command-line mode edit **:e filename.txt** works just like it would in any ordinary Vim window. Navigate tabs with the next (**:tabn**) and previous (**:tabp**) commands. - -To use splits, you need to know how to navigate among them using the key-chord combination **C-w** plus a movement key in the direction you want to move, such as left (**h**), down (**j**), up (**k**), or right (**l**). When you want to learn more key chords specific to splits and tabs, read the **:help split** and **:help tabpage** for the Vim manual entries. - -### Get help - -While the Vim manual is referenced in Vimtutor, opening Vim help with **:help** will let you spend time with the editor on your own and get more productive without wholly relying on articles like this one. Experience is key to Vim mastery. The experience contributes to your overall computing intuition since so much of what has gone into Vim is drawn from the Unix universe. - -Have fun exploring the beauty of Vim, and share any questions you have in the comments. - -Want to become a master of text editing in the terminal, and beyond? These tips for getting started... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/vim-skills - -作者:[Detlef Johnson][a] -选题:[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/deckart -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboaord_enter_writing_documentation.jpg?itok=kKrnXc5h (Computer keyboard typing) -[2]: https://www.vim.org/ -[3]: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html -[4]: http://zsh.sourceforge.net/Intro/intro_3.html -[5]: http://vimdoc.sourceforge.net/htmldoc/starting.html#compatible-default -[6]: https://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_do_it -[7]: https://www.npr.org/2020/02/22/808404858/remembering-the-pioneer-behind-your-computers-cut-copy-and-paste-functions -[8]: http://www2.geog.ucl.ac.uk/~plewis/teaching/unix/vimtutor -[9]: https://opensource.com/article/18/9/vi-editor-productivity-powerhouse -[10]: https://www.vim.org/vim-8.2-released.php diff --git a/translated/tech/20200331 5 ways to level up your Vim skills.md b/translated/tech/20200331 5 ways to level up your Vim skills.md new file mode 100644 index 0000000000..6ca9cc0d65 --- /dev/null +++ b/translated/tech/20200331 5 ways to level up your Vim skills.md @@ -0,0 +1,159 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 ways to level up your Vim skills) +[#]: via: (https://opensource.com/article/20/3/vim-skills) +[#]: author: (Detlef Johnson https://opensource.com/users/deckart) + +提升你的 Vim 技能的 5 个方法 +====== + +> 通过一些有趣的技巧使你的文本编辑器更上一层楼。 + +![Computer keyboard typing][1] + +Vim 是最受欢迎的文本编辑器之一,因此绝对值得花时间学习如何使用它。如果你使用这个无处不在的 [Vi(m)][2] 命令行文本编辑器来做的只是打开文件、输入和编辑一些文本、保存编辑的文件并退出程序,那么你还有很大的提示空间、。 + +在某些情况下你会发现,使用 Vim 非常方便的的场景几乎总是涉及到运行远程 Shell 操作的任务。如果你时不时地使用 ssh,比如 + +``` +$ ssh user@hostname.provider.com +``` + +并在虚拟专用服务器(VPS)或本地虚拟化容器中工作,那么就可以从这些强大的 Vim 技能中受益匪浅。 + +### 将 Vim 设置为默认的文本编辑器 + +几乎在所有现代 Linux(或 BSD)发行版中,都可以在终端仿真器的 shell 命令提示符下使用 Vim。在用户 shell 程序中将 Vim 定义为默认编辑器后,即可使用熟悉的 Vim 键绑定来浏览内置的实用程序,例如 `man`。我将说明如何使用 Bash 和 Z shell(zsh)来实现此目的,zsh 现在是 macOS 用户的默认shell(自 Catalina 起)。 + +#### 在 Bash 中将 Vim 设置为默认 + +Bash 通过点文件的组合来管理设置。将首选编辑器添加到主目录中的 `.bashrc` 文件中是最常见的,但也可以将其添加到 `.bash_profile` 中。(请阅读 [GNU Bash 文档][3]了解不同之处)。 + +通过在 `~/.bashrc` 中添加以下内容,将 Vim 设置为默认编辑器: + +``` +# set default editor to Vim +export EDITOR=vim +``` + +以 `#` 开头的行是可选的注释,这是提醒自己该命令的功能的好方法。 + +#### 在 zsh 中将 Vim 设置为默认 + +zsh 是一种越来越流行的终端模拟器,尤其是自苹果的基于 FreeBSD 的 Darwin 系统最近从 Bash 切换到 zsh 以来。 + +zsh 点文件与 Bash 的文件相当,因此你可以在 `~/.zshrc` 或 `~/.zprofile` 之间进行选择。有关何时使用哪一个的详细信息,请参见 [zsh文档][4]。 + +将其设置为默认: + +``` +# set default editor to Vim +export EDITOR=vim +``` + +### 优化 Vim 配置 + +Vim 很像终端仿真器外壳,它使用点文件来设置个人偏好。如果发现该模式,则可能已经猜到它是 `~/.vimrc`。 + +你可能要更改的第一个设置是将对旧 Vi 兼容模式切换为“关”。由于 Vim 是 Vi 的超集,因此 Vi 中的所有功能都可用,并在 Vim 中进行了很大的改进,你可以获得许多高级功能。最新版本(8.2)允许你在拆分的窗口中打开终端运行一个子进程 shell 程序。 + +顺便说一句,关闭旧版兼容性似乎没有做什么事情([事实上,可能不是][5])。当遇到一个 `.vimrc` 文件时,Vim 会自动将该模式切换为关闭。但有时将其明确关闭仍然很重要。缩写 `nocp` 是 `nocompatible` 的同义词,也可以使用它。[条条大道通罗马][6],切换首选项有很多方式。 + +在 `.vimrc` 语法中, 以 `"` 开头的行是注释(就像 `.bashrc` 文件中的 `#` 一样),这些注释可以帮助你记住诸如为何选择一个隐秘的设置名称之类的内容。 + +要关闭 Vi 兼容性,请将以下内容添加到 `~/.vimrc` 文件中: + +``` +" ensure that legacy compatibility mode is off +" documentation: ' +set nocp +``` + +### Understand modes + +The notion of Vim's "modes" is very important to learn about, especially the difference between the very distinct `Normal` and `Insert` modes. Confusion about modes is what trips up most new users. Modes aren't unique to Vim, nor were they introduced by Vi. Command mode is so old that it predates the invention of [copy and paste][7] functionality in the 1970s. + +#### Important modes + +Vim depends on different modes to define keyboard-stroke behavior. The important modes to know are: + + * `Normal mode`: Default mode used primarily for navigation and opening files + * `Insert mode` (includes Replace): Where Vim allows for text input to an open file + * `Visual mode`: Where Vim acts similar to mouse-based input, such as copying, editing, replacing, and more + * `Command mode` (including Line, Ex command, and Last-line mode): A powerful way to do more in Vim + + + +Each mode has a great deal to explore. Use [Vimtutor][8] (`$ vimtutor`) to interactively learn about movement, modes, and running Ex commands in "Last Line" mode. Some indispensable productivity operators include: + +`:E` | Opens explorer for locating files and directories +---|--- +`.` | Repeats the last edit action +`;` | Repeats the last motion or movement forward +`,` | Repeats the last motion or movement backward +`/` | Searches document forward +`?` | Searches document backward +``* | Finds next occurrence of the word under the cursor +`#` | Finds the previous occurrence of the word under the cursor +`~` | Toggles case +`%` | Toggles between opening and closing `()`, `[]`, and `{}`; highly useful for coding +`z=` | Makes spelling suggestions + +### Play Vim like a piano + +While it's important to commit Vim's operator "language" to memory, the challenge to gaining mastery is to learn to think like a musician and combine operators and movements into "key chords in harmony" so that you can play Vim like a piano. That's where the power of text manipulation with Vim rivals that of the other notable command-line editor, Emacs. (While one of these editors will wear down your `Esc` key, using the other will wear down your `Ctrl` key.) + +When describing key chords, it's conventional in Vim to designate the `Ctrl` key using the capital letter C, followed by a hyphen (`C-`). It's not universal, but I will follow that convention from here onward and clarify when there is any potential for confusion. + +If you type long lines in Vim, you'll want to set it to wrap your text. To start personalizing Vim for the way you work, think about that setting: How would you like Vim to handle text wrapping by default when it starts? On or off? I like it turned off and leave it out of the runtime commands file. When I want text to wrap, I simply set it in command-line mode with `:set wrap`. + +There's nothing wrong with having Vim set to wrap text by default. It's simply a matter of preference—which can change over time. The same goes for handling paste, code language indent syntax, and the `Tab` key (tabs or spaces? and how many spaces then? Dive into these options [here][9]). All these options for default behavior are entirely configurable and changeable in real time as you work with command-line mode operations. + +You will find many suggestions for setting Vim defaults in community forums, on Vim wikis, and in articles (like this one). Setting preferences for your personal computing environment should be fairly familiar to you, and Vim is no different. I highly recommend that you start by making very small changes to your settings, and make additional changes slowly so that you can easily revert settings. This way, you might avoid the use of plugins for years—or entirely. + +### Splits, tabs, and terminals in Vim 8.2 + +There are two ways to split your working files into different views: they can appear side-by-side, or you can switch between them with full (window) screens using application tabs. These changes to your application window are initiated from command-line mode, which requires a colon (`:`) to call up the prompt. + +Each window split can host a file for editing, and you can arrange tabs to switch between additional files as much as you like. There is limited screen space for splits, so tabs are handy when you want to split more screens. How you decide to work is purely a matter of preference. To split a window horizontally, use `:sp`, and use `:vs` for vertical splits. + +As of [Vim 8.2][10], you can open a terminal shell sub-process in a vertical split with `:vert term` to run operations on the command line right alongside your code. You need to type `exit` to close your terminal process, just like you would end a shell session, but you close splits and tabs the same way you would close any ordinary Vim window, with `:q`. + +To initialize a tab, use a special edit command: `:tabedit`, which automatically switches you to the new open tab. If you give the command a file name as an argument, that file will open for editing. If you neglect to give it a file name as an argument, the command-line mode edit `:e filename.txt` works just like it would in any ordinary Vim window. Navigate tabs with the next (`:tabn`) and previous (`:tabp`) commands. + +To use splits, you need to know how to navigate among them using the key-chord combination `C-w` plus a movement key in the direction you want to move, such as left (`h`), down (`j`), up (`k`), or right (`l`). When you want to learn more key chords specific to splits and tabs, read the `:help split` and `:help tabpage` for the Vim manual entries. + +### Get help + +While the Vim manual is referenced in Vimtutor, opening Vim help with `:help` will let you spend time with the editor on your own and get more productive without wholly relying on articles like this one. Experience is key to Vim mastery. The experience contributes to your overall computing intuition since so much of what has gone into Vim is drawn from the Unix universe. + +Have fun exploring the beauty of Vim, and share any questions you have in the comments. + +Want to become a master of text editing in the terminal, and beyond? These tips for getting started... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/vim-skills + +作者:[Detlef Johnson][a] +选题:[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/deckart +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboaord_enter_writing_documentation.jpg?itok=kKrnXc5h (Computer keyboard typing) +[2]: https://www.vim.org/ +[3]: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html +[4]: http://zsh.sourceforge.net/Intro/intro_3.html +[5]: http://vimdoc.sourceforge.net/htmldoc/starting.html#compatible-default +[6]: https://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_do_it +[7]: https://www.npr.org/2020/02/22/808404858/remembering-the-pioneer-behind-your-computers-cut-copy-and-paste-functions +[8]: http://www2.geog.ucl.ac.uk/~plewis/teaching/unix/vimtutor +[9]: https://opensource.com/article/18/9/vi-editor-productivity-powerhouse +[10]: https://www.vim.org/vim-8.2-released.php From 879801b46439c8cbc3ca272fb80e78791b90aa2e Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 3 Apr 2020 08:20:30 +0800 Subject: [PATCH 0100/1809] translated --- sources/tech/20190605 What is GraphQL.md | 129 -------------------- translated/tech/20190605 What is GraphQL.md | 127 +++++++++++++++++++ 2 files changed, 127 insertions(+), 129 deletions(-) delete mode 100644 sources/tech/20190605 What is GraphQL.md create mode 100644 translated/tech/20190605 What is GraphQL.md diff --git a/sources/tech/20190605 What is GraphQL.md b/sources/tech/20190605 What is GraphQL.md deleted file mode 100644 index 11b36946f4..0000000000 --- a/sources/tech/20190605 What is GraphQL.md +++ /dev/null @@ -1,129 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What is GraphQL?) -[#]: via: (https://opensource.com/article/19/6/what-is-graphql) -[#]: author: (Zach Lendon https://opensource.com/users/zachlendon) - -What is GraphQL? -====== -GraphQL is a query language, an execution engine, and a specification, -and it's leading developers to rethink how they build client and API -applications. -![Analytics: Charts and Graphs][1] - -GraphQL is one of the biggest buzzwords in software tech today. But _what is it_ _actually_? Is it a query language like [SQL][2]? An execution engine like the [JVM][3]? A specification like [XML][4]? - -If you answered all of the above, you are correct! [GraphQL][5] is a query language syntax, a programming language-agnostic execution engine, and a continuously evolving specification. - -Let's dive into how GraphQL can be all of these things and get a glimpse of why people are excited about it. - -### Query language - -GraphQL as a query language seems reasonable—"QL" seemed important enough to be in the name, after all. But what are we querying? It probably helps to look at a sample query request and the corresponding response. - -The following user query: - - -``` -{ - user(id: 4) { -   name -   email -   phoneNumber - } -} -``` - -might return the following JSON response: - - -``` -{ - "user": { -   "name": "Zach Lendon" -   “email”: “[zach@hydrate.io][6]” -   “phoneNumber”: “867-5309” - } -} -``` - -Imagine a client application querying for user details, taking the result, and using it to populate a profile screen. As a query language, one of GraphQL's core benefits is that a client application can request _only the data it needs_ and expect it to be returned in a consistent manner. - -_What_ is returning the GraphQL response, though? This is where the execution engine, typically in the form of a GraphQL server, comes into play. - -### Execution engine - -![GraphQL execution engine][7] - -The GraphQL execution engine is what is responsible for processing a GraphQL query and returning a JSON response. All GraphQL servers are made up of two core components that define the structure and behavior of the execution engine: a schema and resolvers, respectively. - -A GraphQL schema is a custom typed language that exposes which queries are both permitted (valid) and handled by a GraphQL server implementation. The schema for our user example query above might look like: - - -``` -type User { -        name: String -        email: String -        phoneNumber: String -} - -type Query { -        user: User -} -``` - -This schema defines a user query that returns a user. Clients can request any of the fields on a user via the user query, and the GraphQL server will return only those fields in its response. By using the strongly typed schema, a GraphQL server can validate incoming queries to ensure they are valid based on the defined schema. - -Once a query is determined to be valid, it is processed by a GraphQL server by resolvers. A resolver function backs each field of each GraphQL type. An example resolver for our user query might look like: - - -``` -Query: { -  user(obj, args, context, info) { -    return context.db.loadUserById(args.id).then( -      userData => new User(userData) -    ) -  } -} -``` - -While the above example is in JavaScript, GraphQL servers can be written in any number of languages. This is due to the fact that GraphQL is _also_ a specification! - -### Specification - -The GraphQL specification defines the capabilities and characteristics that GraphQL implementations must follow. As an open specification available under the Open Web Foundation Final Specification Agreement ([OWFa 1.0][8]), the technology community has the opportunity to both review what a GraphQL implementation must do to be spec-compliant and help craft the future of the language. - -While the specification is very specific about GraphQL's syntax, what is a valid query, and how a schema works, it provides no direction on how to store data or what implementation programming languages GraphQL servers should use. This is incredibly powerful and relatively unique in the software space—it allows GraphQL servers to be created in any number of programming languages, and clients will know exactly how they function since they are spec-compliant. And GraphQL server implementations have been created across many programming languages, not just ones folks might expect like JavaScript, Java, and C#, but languages like Go, Elixir, and Haskell. The language a server is implemented in will not be a barrier to adoption—not only are there implementations in many languages, but they are all open source. If there isn't an implementation in your language of choice, you are free to create your own. - -### Conclusion - -GraphQL is an exciting, relatively new entrant into the open source API space. It couples a query language and execution engine with an open source specification that defines how GraphQL implementations should look and function. - -GraphQL has already started to change how companies think about building both client and API applications. With GraphQL as part of a technology stack, front-end developers are freed to query for the data they want, and back-end developers can decouple client application needs from their back-end system architectures. Often companies journey into GraphQL by first building a GraphQL API "layer" that sits on top of their existing back-end services. This allows the client applications to begin to gain the performance and operational efficiencies they seek, while allowing the back-end teams an opportunity to determine what, if any, changes they might want to make "under the hood," behind their GraphQL layer. Often, those changes will be geared towards optimizations that will help ensure that applications using GraphQL can operate as performantly as possible. Because of the abstraction GraphQL provides, systems teams can make those changes while continuing to honor the GraphQL "contract" at their GraphQL API level. - -Because GraphQL is relatively new, developers are still finding new and exciting ways to leverage it to build better software solutions. How will GraphQL change how you build applications, and does it live up to the hype? There's only one way to find out—go out there and build something with GraphQL! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/6/what-is-graphql - -作者:[Zach Lendon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/zachlendon -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/analytics-graphs-charts.png?itok=sersoqbV (Analytics: Charts and Graphs) -[2]: https://opensource.com/article/18/2/getting-started-sql -[3]: https://www.cubrid.org/blog/understanding-jvm-internals/ -[4]: https://www.w3.org/TR/xml/ -[5]: http://graphql.org/ -[6]: mailto:zach@hydrate.io -[7]: https://opensource.com/sites/default/files/pictures/graphql-execution-engine.png (GraphQL execution engine) -[8]: http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0---patent-only diff --git a/translated/tech/20190605 What is GraphQL.md b/translated/tech/20190605 What is GraphQL.md new file mode 100644 index 0000000000..0f005efd40 --- /dev/null +++ b/translated/tech/20190605 What is GraphQL.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is GraphQL?) +[#]: via: (https://opensource.com/article/19/6/what-is-graphql) +[#]: author: (Zach Lendon https://opensource.com/users/zachlendon) + +什么是 GraphQL? +====== +GraphQL 是一种查询语言、执行引擎和规范,它让开发人员重新思考如何构建客户端和 API + 应用。 +![Analytics: Charts and Graphs][1] + +GraphQL 是当今软件技术中最大的流行语之一。但它_实际上_是什么?它是像 [SQL][2] 这样的查询语言吗?像 [JVM][3] 这样的执行引擎?像 [XML][4] 这样的规范? + +如果你的回答是上面这些,那么你是对的![GraphQL][5] 是查询语言语法、编程语言无关的执行引擎和不断发展的规范。 + +让我们深入了解 GraphQL 如何成为这些,并了解人们为什么对此感到兴奋。 + +### 查询语言 + +GraphQL 作为查询语言似乎是合理的—”QL“ 似乎足够重要,毕竟它出现在名称中。但是我们在查询什么?查看示例查询请求和相应的响应可能会有所帮助。 + +以下的用户查询: + + +``` +{ + user(id: 4) { +   name +   email +   phoneNumber + } +} +``` + +可能会返回下面的 JSON 结果: + + +``` +{ + "user": { +   "name": "Zach Lendon" +   “email”: “[zach@hydrate.io][6]” +   “phoneNumber”: “867-5309” + } +} +``` + +想象一下,客户端应用查询用户详细信息,获取结果,并使用它填充配置文件。作为查询语言,GraphQL 的核心优势之一是客户端应用可以_只请求它需要_的数据,并期望以一致的方式返回这些数据。 + +那么_什么_返回了 GraphQL 响应?这就是执行引擎(通常以 GraphQL 服务器的形式)发挥作用的地方。 + +### 执行引擎 + +![GraphQL execution engine][7] + +GraphQL 执行引擎负责处理 GraphQL 查询并返回 JSON 响应。所有 GraphQL 服务器由两个核心组件组成,分别定义了执行引擎的结构和行为:schema 和解析器。 + +GraphQL schema 是一种自定义类型语言,它公开哪些查询既允许(有效),又由 GraphQL 服务器实现处理。上面用户示例查询的 schema 可能如下所示: + + +``` +type User { +        name: String +        email: String +        phoneNumber: String +} + +type Query { +        user: User +} +``` + +此 schema 定义返回用户的用户查询。客户端可以通过用户查询请求用户上的任何字段,并且 GraphQL 服务器将仅返回请求的字段。通过使用强类型架构,GraphQL 服务器可以验证传入查询,以确保它们基于定义的 schema 有效。 + +确定查询有效后,它由 GraphQL 服务器的解析器处理。解析器函数支持每个 GraphQL 类型的每个字段。用户查询的示例解析器可能如下所示: + +``` +Query: { +  user(obj, args, context, info) { +    return context.db.loadUserById(args.id).then( +      userData => new User(userData) +    ) +  } +} +``` + +虽然上面的例子是 JavaScript,但 GraphQL 服务器可以用任意语言编写。这是因为 GraphQL 也是_也是_一种规范! + +### 规范 + +GraphQL 规范定义了 GraphQL 实现必须遵循的功能和特性。作为开放网络基金会最终规范协议([OWFa 1.0][8])所提供的开放规范,技术社区可以借此机会查看 GraphQL 实现必须符合规范的要求,并帮助制定 GraphQL 的未来。 + +虽然该规范对 GraphQL 的语法,什么是有效查询以及 schema 进行了非常具体的说明,但它没有提供有关如何存储数据或 GraphQL 服务器应使用哪种编程语言实现的指导。这在软件领域是非常强大且相对独特。它允许以多种编程语言创建 GraphQL 服务器,并且由于它们符合规范,因此客户端将确切知道它们的工作方式。GraphQL 服务器已经有多种语言实现,人们不仅可以期望像 JavaScript、Java和 C# 这样的语言,还可以使用Go、Elixir 和 Haskell 等。服务器实现所使用的语言不会成为采用过程的障碍。它不仅存在多种语言实现,而且它们都是开源的。如果没有你选择的语言的实现,那么可以自己实现。 + +### 总结 + +GraphQL 是开源 API 领域中一个令人兴奋的,相对较新的参与者。它将查询语言和执行引擎与开源规范结合在一起,它定义了 GraphQL 实现的功能。 + +GraphQL 已经开始改变公司对构建客户端和 API 应用的看法。通过将 GraphQL 作为技术栈的一部分,前端开发人员可以自由查询所需的数据,而后端开发人员可以将客户端应用需求与后端系统架构分离。通常,公司首先通过在其现有后端服务之上构建一个 GraphQL API “层”来使用 GraphQL。这使客户端应用开始获得寻求的性能和运营效率,同时使后端团队有机会在 GraphQL 层后面进行所需的“幕后”更改(如果有)。通常,这些更改将针对优化,这些优化将帮助确保使用 GraphQL 的应用可以尽可能高效地运行。由于 GraphQL 提供了抽象,因此系统团队可以进行更改的同时继续在其 GraphQL API 级别上遵守 GraphQL 的“合约”。 + +由于 GraphQL 相对较新,因此开发人员仍在寻找新颖而激动人心的方法来利用它构建更好的软件解决方案。GraphQL 将如何改变你构建应用的方式,它不会辜负宣传吗?只有一种方法可以找到答案。去使用 GraphQL 构建一些东西! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/what-is-graphql + +作者:[Zach Lendon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/zachlendon +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/analytics-graphs-charts.png?itok=sersoqbV (Analytics: Charts and Graphs) +[2]: https://opensource.com/article/18/2/getting-started-sql +[3]: https://www.cubrid.org/blog/understanding-jvm-internals/ +[4]: https://www.w3.org/TR/xml/ +[5]: http://graphql.org/ +[6]: mailto:zach@hydrate.io +[7]: https://opensource.com/sites/default/files/pictures/graphql-execution-engine.png (GraphQL execution engine) +[8]: http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0---patent-only From b067bfe532365294fa5001bd8ae8073cc979aae9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 3 Apr 2020 08:25:07 +0800 Subject: [PATCH 0101/1809] translating --- ...200330 Using data from spreadsheets in Fedora with Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200330 Using data from spreadsheets in Fedora with Python.md b/sources/tech/20200330 Using data from spreadsheets in Fedora with Python.md index a32cf4165d..a24dd7faa9 100644 --- a/sources/tech/20200330 Using data from spreadsheets in Fedora with Python.md +++ b/sources/tech/20200330 Using data from spreadsheets in Fedora with Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 60840217728ec415f042d77e86d67dff8d442f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 3 Apr 2020 08:53:42 +0800 Subject: [PATCH 0102/1809] Translated --- ...ype Fonts on Ubuntu-based Distributions.md | 114 ----------------- ...ype Fonts on Ubuntu-based Distributions.md | 115 ++++++++++++++++++ 2 files changed, 115 insertions(+), 114 deletions(-) delete mode 100644 sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md create mode 100644 translated/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md diff --git a/sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md b/sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md deleted file mode 100644 index 82deeed260..0000000000 --- a/sources/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to install Microsoft TrueType Fonts on Ubuntu-based Distributions) -[#]: via: (https://itsfoss.com/install-microsoft-fonts-ubuntu/) -[#]: author: (Community https://itsfoss.com/author/itsfoss/) - -How to install Microsoft TrueType Fonts on Ubuntu-based Distributions -====== - -If you open some Microsoft documents in LibreOffice on Linux, you’ll notice that the fonts look a bit different. You’ll also notice that you cannot find common fonts like [Times New Roman][1], Arial etc. - -Don’t worry. I’ll show you how to install these fonts in Ubuntu and other Ubuntu-based Linux distributions. But before that, let me tell you why these fonts are not available by default. - -### Why Microsoft fonts are not installed by default in Linux? - -![][2] - -Times New Roman, Arial and other such fonts are owned by Microsoft and they are not open source. Many Linux distributions don’t provide proprietary software by default to avoid licensing issue. - -This is why Ubuntu and other Linux distributions use an open source fonts “Liberation fonts” to substitute Microsoft fonts by default. The [Liberation Fonts][3] were created by [Red Hat][4] to substitute Arial, Arial Narrow, Times New Roman and Courier New as their width is the same. When you open a document written in Times New Roman, the equivalent Liberation Font will be used to keep the document uninterrupted. - -However Liberation fonts are not identical to Microsoft’s fonts and in some cases you may need to use Arial or Times New Roman. A very common scenario is that Microsoft’s fonts are the only option is in schools, universities and other public and private organizations. They require you to submit the documents in one of those fonts. - -Good thing is that you can install the Microsoft fonts on Ubuntu and other distributions easily. This way, you will be able to increase compatibility of LibreOffice and have the freedom to choose an open source office software. - -### Installing Microsoft fonts on Ubuntu-based Linux distributions - -You can [install new fonts in Ubuntu][5] by downloading them on your own. But since Microsoft fonts are very popular (and is provided free of cost), Ubuntu provides an easy way of installing it. - -Be aware that despite Microsoft has released its core fonts for free of charge, the usage of the fonts is restricted in other operating systems. You’ll have to read and accept EULA (End User License Agreement) before installing Microsoft fonts in Ubuntu. - -These fonts are [available in the multiverse repositories so make sure to enable it][6] first: - -``` -sudo add-apt-repository multiverse -``` - -After that, you can update your Ubuntu repository cache and install the Microsoft fonts like this: - -``` -sudo apt update && sudo apt install ttf-mscorefonts-installer -``` - -Press tab to select **OK** and the press enter when the Microsoft’s End user agreement appears. - -![Press tab to highlight the selection][7] - -Click **Yes** to accept the Microsoft’s agreement: - -![Use tab key to make a selection and then press enter][8] - -When the installation is done, you should update the font cache using the command below: - -``` -sudo fc-cache -f -v -``` - -![][9] - -If you open the LibreOffice now, you’ll see the Microsoft [TrueType fonts][10]. - -![][11] - -In case that you accidentally reject the license agreement, you can reinstall the installer with this command: - -``` -sudo apt install –reinstall ttf-mscorefonts-installer -``` - -Microsoft TrueType fonts are also available via the [Ubuntu Restricted Extras package][12] that contains other proprietary media codecs to play files like MP3 etc. - -Don’t underestimate proprietary fonts - -You may think what’s the big deal with fonts? After all, it’s just a font, not a crucial piece of software, right? -But did you know that for years, [Netflix paid millions of dollars for the proprietary font][13] it used? At the end, they created their own custom fonts and that saved them a considerable amount of money. - -I hope you find this quick tutorial useful. More productivity tutorials are down the line, leave your comments below and subscribe to our social media for more! - -![][14] - -### Dimitrios Savvopoulos - -Dimitrios is an MSc Mechanical Engineer but a Linux enthusiast in heart. He is well settled in Solus OS but curiosity drives him to constantly test other distros. Challenge is part of his personality and his hobby is to compete from 5k to the marathon distance. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-microsoft-fonts-ubuntu/ - -作者:[Community][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/itsfoss/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Times_New_Roman -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/microsoft-fonts-ubuntu.png?ssl=1 -[3]: https://en.wikipedia.org/wiki/Liberation_fonts -[4]: https://en.wikipedia.org/wiki/Red_Hat -[5]: https://itsfoss.com/install-fonts-ubuntu/ -[6]: https://itsfoss.com/ubuntu-repositories/ -[7]: https://i1.wp.com/i.imgur.com/JoEJp5w.png?ssl=1 -[8]: https://i0.wp.com/i.imgur.com/M8zTc7f.png?ssl=1 -[9]: https://i0.wp.com/i.imgur.com/Cshle6S.png?ssl=1 -[10]: https://en.wikipedia.org/wiki/TrueType -[11]: https://i1.wp.com/i.imgur.com/9oIu3oj.png?ssl=1 -[12]: https://itsfoss.com/install-media-codecs-ubuntu/ -[13]: https://thehustle.co/nextflix-sans-custom-font/ -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Dimitrios.jpg?ssl=1 diff --git a/translated/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md b/translated/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md new file mode 100644 index 0000000000..f94e89c807 --- /dev/null +++ b/translated/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to install Microsoft TrueType Fonts on Ubuntu-based Distributions) +[#]: via: (https://itsfoss.com/install-microsoft-fonts-ubuntu/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +如何在基于 Ubuntu 的发行版上安装微软 TrueType 字体 +====== + +如果你在 Linux 上打开一些微软文档,你将注意到字体会看起来有一点不同。你也将注意到你不能找到一些常见的字体,像 [Times New Roman][1], Arial 等等。 + +不用担心。我将向你展示如何在 Ubuntu 上和其它基于 Ubuntu 的 Linux 发行版上安装这些字体。但是在此之前,让我告诉你为什么这些字体没有被默认安装。 + +### 为什么微软字体不被默认安装在 Linux 中? + +![][2] + +Times New Roman, Arial 和其它此类字体归微软所有,并且这些字体不是开源的。很多 Linux 发行版默认不提供专有软件来避免许可证问题。 + +这就是为什么在默认情况下 Ubuntu 和其它 Linux 发行版使用开源字体 “Liberation fonts” 来替代微软字体的原因。[Red Hat][4] 创建 [Liberation Fonts][3]来代替 Arial, Arial Narrow, Times New Roman 和 Courier New ,如同这些字体的宽度一样。当你打开一个使用 Times New Roman 字体的文档时, 对应的 Liberation Font 将被用来保持文档文字间间隔等距连续。 + +不过,Liberation fonts 与微软的字体并不是完全相同的,在一些情况下,你可能需要使用 Arial 或 Times New Roman 。一个非常常见的情况是,在学校,大学和其他公共和私人组织中,微软的字体是唯一的选择。他们要求你使用微软字体中的其中一种字体来提交文档。 + +你可以在 Ubuntu 和其它发行版上很容易地安装微软字体的一件很好的事。以这种方式,你将增强 LibreOffice 的兼容性,并将有选择开源办公软件的自由。 + +### 在基于 Ubuntu 的 Linux 发行版上安装微软字体 + +你可以自己下载字体,并 [在 Ubuntu 中安装新的字体][5] 。但是自从微软字体变得非常流行(并且免费提供),Ubuntu 提供了一种简单的方法来安装它们。 + +要知道尽管微软已经免费发布了其核心字体,在其它操作系统中使用字体依然受到限制。在 Ubuntu 中安装微软字体前,你必须阅读并接受 EULA (最终用户许可协议) 。 + +这些字体 [在 multiverse 存储库中可获得,首先要确保启用它][6] : + +``` +sudo add-apt-repository multiverse +``` + +在此之后,你可以更新你的 Ubuntu 存储库缓存,并像这样安装微软字体: + +``` +sudo apt update && sudo apt install ttf-mscorefonts-installer +``` + +当微软的最终用户协议出现时,按 tab 键来选择 **OK** ,并按回车键。 + +![按 tab 键来高亮选择][7] + +单击 **Yes** 来接受微软的协议: + +![使用 tab 键来作出选择,并按回车键][8] + +当安装完成后,你应该使用下面的命令来更新字体缓存: + +``` +sudo fc-cache -f -v +``` + +![][9] + +如果你现在打开 LibreOffice ,你将看到微软 [TrueType 字体][10] 。 + +![][11] + +如果意外地拒绝许可协议,你可以使用这个命令来重新安装安装程序: + +``` +sudo apt install –reinstall ttf-mscorefonts-installer +``` + +微软的 TrueType 字体也可以通过 [Ubuntu Restricted Extras package][12] 获得,其包含用来播放 MP3 等文件的其它专有的多媒体编解码器。 + +不要轻视专有字体。 + +你可能认为字体有什么大不了的呢?毕竟,它只是一款字体,而不是软件的一个关键部分,对吧? +但是你知道,这些年来 [Netflix 为其使用的专有字体支付了数百万美元][13] 吗?最后,他们创建了自己的自定义字体,这为他们节省了一大笔钱。 + +我希望你发现这个快速教程是有用的。更多的创造性的教程已下线,请在下面留下你的评论,了解更多信息请订阅我们的社交媒体! + +![][14] + +### Dimitrios Savvopoulos + +Dimitrios 是一名机械工程师理学硕士,但是在内心深处是一名 Linux 狂热爱好者。他习惯于使用 Solus 操作系统,但好奇心驱使者他不断测试其它的发行版。 +挑战是他魅力的一部分,他的爱好是自5公里到马拉松的长距离比赛。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-microsoft-fonts-ubuntu/ + +作者:[Community][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Times_New_Roman +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/microsoft-fonts-ubuntu.png?ssl=1 +[3]: https://en.wikipedia.org/wiki/Liberation_fonts +[4]: https://en.wikipedia.org/wiki/Red_Hat +[5]: https://itsfoss.com/install-fonts-ubuntu/ +[6]: https://itsfoss.com/ubuntu-repositories/ +[7]: https://i1.wp.com/i.imgur.com/JoEJp5w.png?ssl=1 +[8]: https://i0.wp.com/i.imgur.com/M8zTc7f.png?ssl=1 +[9]: https://i0.wp.com/i.imgur.com/Cshle6S.png?ssl=1 +[10]: https://en.wikipedia.org/wiki/TrueType +[11]: https://i1.wp.com/i.imgur.com/9oIu3oj.png?ssl=1 +[12]: https://itsfoss.com/install-media-codecs-ubuntu/ +[13]: https://thehustle.co/nextflix-sans-custom-font/ +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Dimitrios.jpg?ssl=1 From 1c99795ad871c33fbce3759ede5277d6c023c807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 3 Apr 2020 09:01:53 +0800 Subject: [PATCH 0103/1809] Translating --- ...1209 Use the Fluxbox Linux desktop as your window manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md b/sources/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md index 8c7ddcb1e5..6d1d84b9bd 100644 --- a/sources/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md +++ b/sources/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 780bb15cec63726ca84a4e13710d28bb6f1ce6d4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Apr 2020 11:42:34 +0800 Subject: [PATCH 0104/1809] TSL --- ...0331 5 ways to level up your Vim skills.md | 78 +++++++++---------- 1 file changed, 37 insertions(+), 41 deletions(-) diff --git a/translated/tech/20200331 5 ways to level up your Vim skills.md b/translated/tech/20200331 5 ways to level up your Vim skills.md index 6ca9cc0d65..2ddeb2f40d 100644 --- a/translated/tech/20200331 5 ways to level up your Vim skills.md +++ b/translated/tech/20200331 5 ways to level up your Vim skills.md @@ -72,67 +72,63 @@ Vim 很像终端仿真器外壳,它使用点文件来设置个人偏好。如 set nocp ``` -### Understand modes +### 理解模式 -The notion of Vim's "modes" is very important to learn about, especially the difference between the very distinct `Normal` and `Insert` modes. Confusion about modes is what trips up most new users. Modes aren't unique to Vim, nor were they introduced by Vi. Command mode is so old that it predates the invention of [copy and paste][7] functionality in the 1970s. +Vim的 “模式”概念是非常重要的,尤其是“正常模式”和“插入模式”之间的区别。对模式的混淆是大多数新用户的困扰。模式并不是 Vim 所独有的,甚至也不是 Vi 所引入的。命令模式是如此的古老,以至于它比 70 年代的[复制和粘贴][7]功能的发明还要早。 -#### Important modes +#### 重要的模式 -Vim depends on different modes to define keyboard-stroke behavior. The important modes to know are: +Vim 依赖于不同的模式来定义键盘的敲击行为。需要了解的重要模式有 - * `Normal mode`: Default mode used primarily for navigation and opening files - * `Insert mode` (includes Replace): Where Vim allows for text input to an open file - * `Visual mode`: Where Vim acts similar to mouse-based input, such as copying, editing, replacing, and more - * `Command mode` (including Line, Ex command, and Last-line mode): A powerful way to do more in Vim +* 正常模式:默认模式,主要用于导航和打开文件。 +* 插入模式(包括替换):这种模式下 Vim 允许将文本输入到打开的文件中。 +* 可视模式:Vim 的行为类似于基于鼠标的输入方式,如复制、编辑、替换等。 +* 命令模式(包括行模式、Ex 命令模式和末行模式):在 Vim 中做更多事情的强大方法。 +每种模式都有很多值得探索的地方。使用 [Vimtutor][8](`vimtutor`)可以交互式地学习移动光标、模式和在末行模式下运行 Ex 命令。一些不可缺少的生产力操作符包括: +`:E` | 打开资源管理器,用于定位文件和目录。 +--- | --- +`.` | 重复上次的编辑操作。 +`;` | 向前重复上一次的动作或移动 +`,` | 向后重复上一次的动作或移动。 +`/` | 向前搜索文档。 +`?` | 向后搜索文档。 +`*` | 查找光标所在处的单词的下一个出现的地方。 +`#` | 查找光标所在处的单词的上一次出现的地方。 +`~` | 切换大小写。 +`%` | 在打开和关闭的 `()`、`[]` 和 `{}` 之间切换;对编码非常有用。 +`z=` | 提出拼写建议。 -Each mode has a great deal to explore. Use [Vimtutor][8] (`$ vimtutor`) to interactively learn about movement, modes, and running Ex commands in "Last Line" mode. Some indispensable productivity operators include: +### 像钢琴一样弹奏 Vim -`:E` | Opens explorer for locating files and directories ----|--- -`.` | Repeats the last edit action -`;` | Repeats the last motion or movement forward -`,` | Repeats the last motion or movement backward -`/` | Searches document forward -`?` | Searches document backward -``* | Finds next occurrence of the word under the cursor -`#` | Finds the previous occurrence of the word under the cursor -`~` | Toggles case -`%` | Toggles between opening and closing `()`, `[]`, and `{}`; highly useful for coding -`z=` | Makes spelling suggestions +把 Vim 的操作符“语言”记在记忆中是很重要的,但要想掌握它,难点在于学会像音乐家一样思考,把操作符和动作组合成“和声和弦”,这样你就可以像弹钢琴一样弹奏 Vim。这就是 Vim 的文本操作能力可以与另一个著名的命令行编辑器 Emacs 相媲美的地方。(虽然其中一个编辑器会让磨损掉你的 `Esc` 键,而另一个编辑器会让你的 `Ctrl` 键磨损掉。) -### Play Vim like a piano +在描述和弦时,Vim 中的传统做法是用大写字母 `C` 来指代 `Ctrl` 键,后面加上一个连字符(`C-`)。这并不是通用的,但我将从这里开始遵循这一惯例,并在有可能引起混淆的时候加以说明。 -While it's important to commit Vim's operator "language" to memory, the challenge to gaining mastery is to learn to think like a musician and combine operators and movements into "key chords in harmony" so that you can play Vim like a piano. That's where the power of text manipulation with Vim rivals that of the other notable command-line editor, Emacs. (While one of these editors will wear down your `Esc` key, using the other will wear down your `Ctrl` key.) +如果你在 Vim 中键入长行,你会想把它设置成可以换行你的文字。想要根据你的工作方式对 Vim 进行个性化设置,请考虑一下这个设置:当 Vim 启动时,你希望 Vim 默认情况下如何处理文本换行?开着还是关着?我喜欢将其关闭,并在运行时用命令打开它。当我想让文本换行时,我只需在命令行模式下用 `:set wrap` 设置即可。 -When describing key chords, it's conventional in Vim to designate the `Ctrl` key using the capital letter C, followed by a hyphen (`C-`). It's not universal, but I will follow that convention from here onward and clarify when there is any potential for confusion. +让 Vim 设置为默认文字换行并没有什么问题。这只是一个偏好的问题 —— 它可能随着时间的推移而改变。同样你也可以控制粘贴、代码语言缩进语法和 `Tab` 键的设置(制表符还是空格?多少个空格?可也在[这里][9]深入研究这些选项)。所有这些默认行为的选项都是完全可配置的,并且在你使用命令行模式操作时可以实时更改。 -If you type long lines in Vim, you'll want to set it to wrap your text. To start personalizing Vim for the way you work, think about that setting: How would you like Vim to handle text wrapping by default when it starts? On or off? I like it turned off and leave it out of the runtime commands file. When I want text to wrap, I simply set it in command-line mode with `:set wrap`. +你会在社区论坛、Vim 维基和文章中找到很多关于设置 Vim 默认设置的建议(比如这篇文章)。为你的个人计算环境设置首选项对你来说应该相当熟悉,Vim 也不例外。我强烈建议你从对你的设置进行非常小的更改开始,慢慢地进行更多的更改,这样你就可以轻松地恢复设置。这样一来,你就可以避免使用插件好多年或完全不用。 -There's nothing wrong with having Vim set to wrap text by default. It's simply a matter of preference—which can change over time. The same goes for handling paste, code language indent syntax, and the `Tab` key (tabs or spaces? and how many spaces then? Dive into these options [here][9]). All these options for default behavior are entirely configurable and changeable in real time as you work with command-line mode operations. +### Vim 8.2中的分割、标签和终端 -You will find many suggestions for setting Vim defaults in community forums, on Vim wikis, and in articles (like this one). Setting preferences for your personal computing environment should be fairly familiar to you, and Vim is no different. I highly recommend that you start by making very small changes to your settings, and make additional changes slowly so that you can easily revert settings. This way, you might avoid the use of plugins for years—or entirely. +有两种方法可以将你正在处理的文件分割成不同的视图:它们可以并排显示,也可以使用应用程序标签页在全屏(窗口)中切换。这些对应用程序窗口的更改是从命令模式启动的,这需要使用冒号(`:`)来调起提示符。 -### Splits, tabs, and terminals in Vim 8.2 +每个分割的窗口可以容纳一个文件进行编辑,你可以通过标签页在更多的文件之间随意切换。分割的屏幕空间是有限的,所以当你想分割更多的屏幕时,标签页是很方便的。想要如何设置,纯属个人喜好的问题。要横向分割一个窗口,使用 `:sp`,垂直分割时使用 `:vs`。 -There are two ways to split your working files into different views: they can appear side-by-side, or you can switch between them with full (window) screens using application tabs. These changes to your application window are initiated from command-line mode, which requires a colon (`:`) to call up the prompt. +从 [Vim 8.2][10] 开始,你可以用 `:vert term` 打开一个垂直分割的终端 shell 子进程,来在你的代码旁边在命令行进行操作。你需要键入 `exit` 来关闭你的终端进程,就像你结束一个 shell 会话一样,但你关闭这个分割的窗口和标签页的方式和关闭任何普通的 Vim 窗口一样,用 `:q` 来关闭。 -Each window split can host a file for editing, and you can arrange tabs to switch between additional files as much as you like. There is limited screen space for splits, so tabs are handy when you want to split more screens. How you decide to work is purely a matter of preference. To split a window horizontally, use `:sp`, and use `:vs` for vertical splits. +要初始化一个标签页,请使用一个特殊的编辑命令:`:tabedit`,它会自动切换到新打开的标签页。如果你给该命令一个文件名作为参数,将会打开该文件并进行编辑。如果你忽略了给它一个文件名作为参数,可以在命令行模式下的使用编辑命令 `:e filename.txt`,就像在任何一个普通的 Vim 窗口中一样。可以使用下一个(`:tabn`)和上一个(`:tabp`)命令在标签页间导航。 -As of [Vim 8.2][10], you can open a terminal shell sub-process in a vertical split with `:vert term` to run operations on the command line right alongside your code. You need to type `exit` to close your terminal process, just like you would end a shell session, but you close splits and tabs the same way you would close any ordinary Vim window, with `:q`. +要使用分割,你需要知道如何使用组合键 `C-w` 和你想要移动的方向的移动键,例如左(`h`)、下(`j`)、左(`k`)、右(`l`)。如果你想学习更多的组合键,请阅读 Vim 手册中的 `:help split` 和 `:help tabpage`。 -To initialize a tab, use a special edit command: `:tabedit`, which automatically switches you to the new open tab. If you give the command a file name as an argument, that file will open for editing. If you neglect to give it a file name as an argument, the command-line mode edit `:e filename.txt` works just like it would in any ordinary Vim window. Navigate tabs with the next (`:tabn`) and previous (`:tabp`) commands. +### 获取帮助 -To use splits, you need to know how to navigate among them using the key-chord combination `C-w` plus a movement key in the direction you want to move, such as left (`h`), down (`j`), up (`k`), or right (`l`). When you want to learn more key chords specific to splits and tabs, read the `:help split` and `:help tabpage` for the Vim manual entries. +虽然可以在 Vimtutor 中打开参考 Vim 手册,但用 `:help` 打开 Vim 帮助,可以让你自己把时间花在编辑器上,不用完全依赖像这样的文章,就能获得更多的成果。经验是掌握 Vim 的关键。经验有助于提高你的整体计算直觉,因为 Vim 中的很多东西都是从 Unix 宇宙中汲取的。 -### Get help - -While the Vim manual is referenced in Vimtutor, opening Vim help with `:help` will let you spend time with the editor on your own and get more productive without wholly relying on articles like this one. Experience is key to Vim mastery. The experience contributes to your overall computing intuition since so much of what has gone into Vim is drawn from the Unix universe. - -Have fun exploring the beauty of Vim, and share any questions you have in the comments. - -Want to become a master of text editing in the terminal, and beyond? These tips for getting started... +祝你在探索 Vim 之美的过程中玩得开心,有什么问题可以在评论中分享。 -------------------------------------------------------------------------------- @@ -140,7 +136,7 @@ via: https://opensource.com/article/20/3/vim-skills 作者:[Detlef Johnson][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1fd07ed4aaaced9c3ab577cbb8ced3b46d8f301e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Apr 2020 12:25:00 +0800 Subject: [PATCH 0105/1809] PRF @geekpi --- ...00323 Don-t love diff- Use Meld instead.md | 57 +++++++++---------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/translated/tech/20200323 Don-t love diff- Use Meld instead.md b/translated/tech/20200323 Don-t love diff- Use Meld instead.md index 7f3c980685..375c6ff0d4 100644 --- a/translated/tech/20200323 Don-t love diff- Use Meld instead.md +++ b/translated/tech/20200323 Don-t love diff- Use Meld instead.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Don't love diff? Use Meld instead) @@ -9,84 +9,81 @@ 不喜欢 diff 么?试试 Meld 吧 ====== -Meld 是一个可视化 diff 工具,它可让你轻松比较和合并文件、目录、Git 仓库等的更改。 -![Person drinking a hat drink at the computer][1] -Meld 是我处理代码和数据文件的基本工具之一。它是一个图形化的 diff 工具,因此,如果你曾经使用过 **diff** 命令并难以理解输出,那么 [Meld][2] 可以为你提供帮助。 +> Meld 是一个可视化 diff 工具,它可让你轻松比较和合并文件、目录、Git 仓库等的更改。 + +![](https://img.linux.net.cn/data/attachment/album/202004/03/122428dkagz1qtgh9f2g10.jpg) + +Meld 是我处理代码和数据文件的基本工具之一。它是一个图形化的 diff 工具,因此,如果你曾经使用过 `diff` 命令并难以理解输出,那么 [Meld][2] 可以为你提供帮助。 这是该项目网站的精彩描述: ->“ Meld 是面向开发人员的可视化 diff 和合并工具。Meld 帮助你比较文件、目录和版本控制的项目。它提供文件和目录的双向和三向比较,并支持许多流行的版本控制系统。“ +>“Meld 是面向开发人员的可视化 diff 和合并工具。Meld 可以帮助你比较文件、目录和版本控制的项目。它提供文件和目录的双向和三向比较,并支持许多流行的版本控制系统。” > ->“ Meld 帮助你检查代码更改并了解补丁。它甚至可以帮助你弄清你一直在避免的合并中发生了什么。” +>“Meld 可以帮助你检查代码更改并了解补丁。它甚至可以帮助你弄清你一直在避免的合并中发生了什么。” 你可以使用以下命令在 Debian/Ubuntu 系统(包括 Raspbian)上安装 Meld: - ``` -`$ sudo apt install meld` +$ sudo apt install meld ``` -在 Fedora 或类似产品上,是: - +在 Fedora 或类似产品上: ``` -`$ sudo dnf install meld` +$ sudo dnf install meld ``` Meld 是跨平台的,它有一个使用 [Chocolately][4] 包管理器的 [Windows 安装包][3]。尽管它在 macOS 上不受官方支持,但有[可用于 Mac 的版本][5],你可以使用 Homebrew 安装: - ``` -`$ brew cask install meld` +$ brew cask install meld ``` 有关[其他系统][2],请参见 Meld 的主页。 ### Meld 对比 diff 命令 -如果你有两个相似的文件(也许一个是另一个的修改版本),并想要查看它们之间的更改,那么可以在终端中运行 **diff** 命令查看它们的区别: +如果你有两个相似的文件(也许一个是另一个的修改版本),并想要查看它们之间的更改,那么可以在终端中运行 `diff` 命令查看它们的区别: ![diff output][6] -此例显示了 **conway1.py** 和 **conway2.py** 之间的区别。表明我: +此例显示了 `conway1.py` 和 `conway2.py` 之间的区别。表明我: - * 删除了 [shebang][7] 和第二行 -  * 从类声明中删除了 **(object)** -  * 为类添加了 docstring -  * 在方法中交换了 **alive** 和 **neighbours == 2** 的顺序 - - -这是使用 **meld** 命令的相同例子。你可以在命令行中运行以下命令进行相同的比较: +* 删除了[释伴][7]和第二行 +* 从类声明中删除了 `(object)` +* 为类添加了 docstring +* 在方法中交换了 `alive` 和 `neighbours == 2` 的顺序 +这是使用 `meld` 命令的相同例子。你可以在命令行中运行以下命令进行相同的比较: ``` -`$ meld conway1.py conway2.py` +$ meld conway1.py conway2.py ``` ![Meld output][8] Meld 更清晰! -你可以单击箭头(上下都行)轻松查看并合并文件之间的更改。你甚至可以实时编辑文件(在输入时,Meld 可以用作具有实时比较功能的简单文本编辑器)—仅在关闭窗口之前一定要保存。 +你可以轻松查看并单击箭头(左右都行)合并文件之间的更改。你甚至可以实时编辑文件(在输入时,Meld 可以用作具有实时比较功能的简单文本编辑器)—只是要记得在关闭窗口之前保存。 你甚至可以比较和编辑三个不同的文件: ![Comparing three files in Meld][9] -### Meld 的 Git 认知 +### Meld 的 Git 感知 -希望你正在使用 [Git][10] 之类的版本控制系统。如果是这样,那么你的比较不是在两个不同文件之间进行,而是要查找当前文件与 Git 历史文件之间的差异。Meld 理解这一点,因此,如果你运行 **meld conway.py**(Git 中有 **conway.py**),它将显示自上次 Git 提交以来所做的更改: +希望你正在使用 [Git][10] 之类的版本控制系统。如果是这样,那么你的比较就不是在两个不同文件之间进行,而是要查找当前文件与 Git 历史文件之间的差异。Meld 理解这一点,因此,如果你运行 `meld conway.py`(`conway.py` 在 Git 中),它将显示自上次 Git 提交以来所做的更改: ![Comparing Git files in Meld][11] 你可以看到当前版本(右侧)和仓库版本(左侧)之间的更改。你可以看到,自上次提交以来,我删除了一个方法,并添加了一个参数和一个循环。 -如果你运行 **meld .**,你将看到当前目录(如果位于根目录,就是整个仓库)中的所有更改: +如果你运行 `meld .`,你将看到当前目录(如果位于仓库的根目录,就是整个仓库)中的所有更改: ![Meld . output][12] -你会看到一个文件被修改,另一个文件未加入版本控制(这意味着它对 Git 是新的,因此在比较之前,我需要 **git add** 该文件),以及许多其他未修改的文件。顶部的图标提供了各种显示选项。 +你会看到一个文件被修改了,另一个文件未加入版本控制(这意味着它对 Git 是新的,因此在比较之前,我需要 `git add` 添加该文件),以及许多其他未修改的文件。顶部的图标提供了各种显示选项。 你还可以比较两个目录,这有时很方便: @@ -98,7 +95,7 @@ Meld 更清晰! * * * -_本文最初发表在 Ben Nuttall 的 [Tooling blog][14] 上,并经允许重新使用。_ +*本文最初发表在 Ben Nuttall 的 [Tooling blog][14] 上,并经允许重新使用。* -------------------------------------------------------------------------------- @@ -107,7 +104,7 @@ via: https://opensource.com/article/20/3/meld 作者:[Ben Nuttall][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 54f3fa9c4efa23df17b42771dc06812af6db82e4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Apr 2020 12:27:00 +0800 Subject: [PATCH 0106/1809] PUB @geekpi https://linux.cn/article-12067-1.html --- .../20200323 Don-t love diff- Use Meld instead.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200323 Don-t love diff- Use Meld instead.md (98%) diff --git a/translated/tech/20200323 Don-t love diff- Use Meld instead.md b/published/20200323 Don-t love diff- Use Meld instead.md similarity index 98% rename from translated/tech/20200323 Don-t love diff- Use Meld instead.md rename to published/20200323 Don-t love diff- Use Meld instead.md index 375c6ff0d4..9fd421118f 100644 --- a/translated/tech/20200323 Don-t love diff- Use Meld instead.md +++ b/published/20200323 Don-t love diff- Use Meld instead.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12067-1.html) [#]: subject: (Don't love diff? Use Meld instead) [#]: via: (https://opensource.com/article/20/3/meld) [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) From c1b9a5c43b700126a22a80a1a0601e13306d5255 Mon Sep 17 00:00:00 2001 From: Chunibyo <359806334@qq.com> Date: Fri, 3 Apr 2020 12:51:09 +0800 Subject: [PATCH 0107/1809] chunibyo is translating --- sources/tech/20190612 How to write a loop in Bash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190612 How to write a loop in Bash.md b/sources/tech/20190612 How to write a loop in Bash.md index f63bff9cd3..c795a3bf82 100644 --- a/sources/tech/20190612 How to write a loop in Bash.md +++ b/sources/tech/20190612 How to write a loop in Bash.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chunibyo-wly) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ffdbb7c7a3eb79fe2a9cbb492f12159c3c1b7949 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Apr 2020 14:24:48 +0800 Subject: [PATCH 0108/1809] PRF @wxy --- ...0190822 How the Linux desktop has grown.md | 71 ++++++++++--------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/translated/talk/20190822 How the Linux desktop has grown.md b/translated/talk/20190822 How the Linux desktop has grown.md index faa1bbac3e..e1305bec8a 100644 --- a/translated/talk/20190822 How the Linux desktop has grown.md +++ b/translated/talk/20190822 How the Linux desktop has grown.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How the Linux desktop has grown) @@ -9,89 +9,90 @@ Linux 桌面史话 ====== -> 自 1990 年代初以来,Linux 桌面已从简单的窗口管理器发展为完整的桌面。与我们一起来探索 Linux 桌面的历史。 -![Person typing on a 1980's computer][1] +> 自 20 世纪 90 年代初以来,Linux 桌面已从一个简单的窗口管理器发展为一个完整的桌面。让我们一起来回顾一下 Linux 桌面的历史。 -我首次安装 Linux 是 1993 年。那时,安装这种操作系统没有太多的选择。早期,许多人只是从别人那里复制一个正在运行的镜像。然后有人想到了一个精巧的主意,创建一个 Linux 的“发行版”,使你可以自定义要安装的软件。那就是 Softlanding Linux 系统(SLS),也是我首次见到了 Linux。 +![](https://img.linux.net.cn/data/attachment/album/202004/03/142430kei55auvvv254aka.jpg) -我的 386 PC 虽然内存不多,但也足够了。SLS 1.03 需要 2MB 的内存才能运行,如果要编译程序,则需要 4MB 的内存。如果要运行 X Window 系统,则需要多达 8MB 的内存!而我的电脑正好有足够的内存来运行 X Window 系统。 +我第一次安装 Linux 是在 1993 年。那时,安装这种操作系统没有太多的选择。早期,许多人只是从别人那里复制一个运行中的镜像。然后有人有了一个很好的想法,创建一个 Linux 的“发行版”,让你可以自定义要安装的软件。这就是 Softlanding Linux 系统(SLS),也是我首次接触 Linux。 -因为我是在命令行中成长的,图形用户界面对我来说并不是必不可少的。但它确实很方便。我可以在不同的窗口中运行应用程序,并轻松地在任务之间切换。 +当时我的 386 PC 虽然内存不多,但已经足够了。SLS 1.03 需要 2MB 的内存才能运行,如果要编译程序,则需要 4MB 的内存。如果要运行 X 窗口系统,则需要多达 8MB 的内存!而我的电脑正好有足够的内存来运行 X 窗口系统。 -从我首次体验 Linux 开始,我就迷上了它。从那以后,我一直在台式机上使用 Linux。和许多人一样,我在双引导配置下运行 Linux 已有一段时间,因此我可以跳回到 MS-DOS 和 Windows 来运行某些程序。直到 1998 年,我终于冒了个险,全面投身于 Linux 之中。 +因为我是在命令行中成长的,所以图形化的用户界面对我来说并不重要,但它确实很方便,我可以在不同的窗口中运行应用程序,并在任务间轻松切换。 -在过去的 26 年中,我目睹了 Linux 桌面的成熟。在那段时间里,我还尝试了一种有趣的桌面环境组合,我会在下面通过 Linux 桌面的历史之旅分享它。 +从我第一次尝试 Linux 开始,我就迷上了它。从那以后,我一直在台式机上使用 Linux。和许多人一样,我也曾有一段时间以双引导配置运行 Linux,这样我就可以跳回到 MS-DOS 和 Windows 来运行某些程序。直到 1998 年,我终于冒了个险,全面投身于 Linux 之中。 + +在过去的 26 年中,我看着 Linux 桌面逐渐成熟。在这段时间里,我还尝试了各种有趣的桌面环境,下面我来分享一下 Linux 桌面的历史。 ### X 和窗口管理器 -Linux 上的第一个“桌面”其实不是桌面。相反,它们是运行在 X Window 系统上的“窗口管理器window manager”(WM)。X 提供了图形用户界面的基本组件,如在屏幕上创建窗口以及提供键盘和鼠标输入。就其本身而言,X 并没有做太多事情。为了使 X 图形环境能够用起来,你需要一种方法来管理会话中的所有窗口。这就出现了窗口管理器window manager。运行 xterm 或 xclock 之类的 X 程序会在一个窗口中打开该程序。窗口管理器会跟踪窗口并进行基本的内部管理,例如让你可以来回移动窗口并将其最小化。其余的事情取决于你自己。你可以通过将程序名列在 `~/ .xinitrc` 文件中以在 X 开始时启动这些程序,但是通常,你会从 xterm 中运行新程序。 +Linux 上的第一个“桌面”还不是桌面。相反,它们是运行在 X 窗口系统上的“窗口管理器window manager”(WM)。X 提供了图形用户界面的基本构件,比如在屏幕上创建窗口,并提供键盘和鼠标输入。就其本身而言,X 的用处并不大。为了使 X 图形环境变得有用,你需要一种方法来管理会话中的所有窗口。这就出现了窗口管理器window manager。运行 xterm 或 xclock 之类的 X 程序就会在一个窗口中打开该程序。窗口管理器可以跟踪窗口并进行基本的内部管理,例如让你可以来回移动窗口并将其最小化。其余的事情取决于你自己。你可以通过将程序名列在 `~/.xinitrc` 文件中以在 X 开始时启动这些程序,但是通常,你会从 xterm 中运行新程序。 -在 1993 年,最常见的窗口管理器是 TWM,它的历史可以追溯到 1988 年。TWM 极其简单,仅仅提供了基本的窗口管理功能。 +在 1993 年,最常见的窗口管理器是 TWM,它的历史可以追溯到 1988 年。TWM 相当简单,仅仅提供了基本的窗口管理功能。 ![TWM on SLS 1.05][2] *SLS 1.05 上的 TWM,显示了 xterm、xclock 和 Emacs 编辑器* -另一个早期的窗口管理器是 OpenLook 虚拟窗口管理器(OLVWM)。OpenLook 是 Sun 微系统公司在 1980 年代开发的图形用户界面,后来又移植到其他 Unix 平台。作为一个*虚拟*窗口管理器,OLVWM 支持多个工作区。 +另一个早期的窗口管理器是 OpenLook 虚拟窗口管理器(OLVWM)。OpenLook 是 Sun 微系统公司在 20世纪 80 年代开发的图形用户界面,后来被移植到其它 Unix 平台。作为一个*虚拟*窗口管理器,OLVWM 支持多个工作区。 ![OLVWM on SLS 1.05][3] *SLS 1.05 上的 OLVWM,显示了 xterm 和虚拟工作区选择器* -当 Linux 开始流行时,没多久就有人创建出具有更流畅性能和改进界面的新的窗口管理器。这些新的窗口管理器中首先出现的是虚拟窗口管理器 FVWM。FVWM 比 TWM 或 OLVWM 更具现代感。但是,我们仍然没有桌面。 +当 Linux 开始流行起来的时候,没多久就有人创建出性能更流畅、界面更好的新窗口管理器。这些新的窗口管理器中首先出现的是虚拟窗口管理器 FVWM。FVWM 比 TWM 或 OLVWM 更具现代感。但是,我们仍然没有桌面。 ![FVWM on SLS 1.05][4] *SLS 1.05 上的 FVWM,显示了 xterm 和文件管理器* -以现代的眼光来看,TWM 和 FVWM 可能看起来很普通。但重要的是要想想当时其它图形环境的外观。 Windows 当时的版本看起来也相当简单。Windows 版本 1 到版本 3 使用了一个称为“程序管理器”的普通启动器。 +以现代的眼光来看,TWM 和 FVWM 可能看起来很朴素。但重要的是要想想当时其它图形环境是什么样子。 Windows 当时的版本看起来也相当简单。Windows 版本 1 到版本 3 使用了一个称为“程序管理器”的普通启动器。 ![Windows 3.11][5] *Windows 3.11,显示程序管理器和记事本编辑器* -1995 年 8 月,微软发布了 Windows 95,改变了现代 PC 桌面的格局。当然,我对此印象深刻。我觉得 Windows 3.x 笨拙而丑陋,但 Windows 95 却流畅而漂亮。更重要的是,我们现在将 Windows 95 视为“ **桌面**”。新的“桌面”隐喻是向前迈出的一大步。你可以在桌面上放置图标——实际上,Windows 95 提供了两个默认的桌面图标,分别是“我的电脑”(用于打开文件管理器)和“回收站”(用于放置以后要删除的文件)。 +1995 年 8 月,微软发布了 Windows 95,改变了现代 PC 桌面的格局。当然,我当时对此印象很深刻。我曾觉得 Windows 3.x 笨拙而丑陋,但 Windows 95 却流畅而漂亮。更重要的是,我们现在将 Windows 95 视为“**桌面**”。新的“桌面”隐喻是一个巨大的进步。你可以在桌面上放置图标——事实上,Windows 95 提供了两个默认的桌面图标,分别是“我的电脑”(用于打开文件管理器)和“回收站”(用于放置以后要删除的文件)。 -但是,更重要的是,Windows 95 桌面的意味着*集成*。程序管理器不见了,取而代之的是屏幕底部的任务栏,可让你使用更简单的“开始”菜单启动新程序。任务栏是多功能的,还通过一系列的按钮显示了你正在运行的程序,而托盘显示了时间、扬声器音量和其它简单的控件。你可以在这个新桌面上右键单击任何对象, Windows 95 会为你提供一个上下文相关的菜单,其中包含你可以执行的操作。 +但是,更重要的是,Windows 95 桌面的意味着*整合*。程序管理器不见了,取而代之的是屏幕底部的任务栏,可让你使用更简单的“开始”菜单启动新程序。任务栏是多功能的,还通过一系列的按钮显示了你正在运行的程序,而托盘显示了时间、扬声器音量和其它简单的控件。你可以在这个新桌面上右键单击任何对象, Windows 95 会为你提供一个上下文相关的菜单,其中又你可以执行的操作。 ![Windows 95][6] *Windows 95,显示了记事本编辑器* -与以前版本的 Windows 甚至其它 Linux 窗口管理器相比,Windows 95 的界面更加流畅并且易于使用。值得一提的是,Linux 开发人员创建了一个模仿 Windows 95 界面的 FVWM 的新版本。名为 FVWM95 的新窗口管理器仍然不是桌面,但看起来非常漂亮。新的任务栏使你可以使用“开始”菜单启动新的 X 程序。任务栏还使用类似于 Windows 95 的按钮显示了正在运行的程序。 +与以前版本的 Windows 甚至其它 Linux 窗口管理器相比,Windows 95 的界面更加流畅并且易于使用。值得一提的是,Linux 开发人员创建了一个模仿 Windows 95 界面的 FVWM 的新版本。名为 FVWM95 的新窗口管理器仍然不是桌面,但它看起来非常漂亮。新的任务栏让你可以使用“开始”菜单启动新的 X 程序。任务栏还可以使用类似于 Windows 95 的按钮显示了正在运行的程序。 ![FVWM95 on Red Hat Linux 5.2][7] *在 Red Hat Linux 5.2 上的 FVWM95,显示了 xterm 和一个带有 xterm 图标、文件管理器和其他程序的快速访问程序启动器* -在 FVWM95 和其他窗口管理器还在改进的同时,核心问题仍然存在:Linux 并没有真正的桌面。它具有一堆窗口管理器,仅此而已。使用图形用户界面的 Linux 应用程序(基本上意味着它们是 X 应用程序)看起来形态各异且工作方式也不同。除了 X Window 系统提供的简单的纯文本复制/粘贴功能外,你无法从一个应用程序复制和粘贴到另一个应用程序里。Linux 真正需要的是在其图形用户界面中完全重新打造以创建它的第一个桌面。 +虽然 FVWM95 和其他窗口管理器都在改进,但核心问题仍然存在:Linux 并没有真正的桌面。它具有一堆窗口管理器,仅此而已。使用图形用户界面的 Linux 应用程序(基本上意味着它们是 X 应用程序)看起来形态各异且工作方式也不同。除了 X 窗口系统提供的简单的纯文本复制/粘贴功能外,你不能从一个应用程序复制和粘贴到另一个应用程序里。Linux 真正需要的是在其图形用户界面中进行彻底的重新打造,以创建它的第一个桌面。 ### Linux 桌面之初啼 -在 1996 年,Matthias Ettrich 感于 X 之下 Linux 应用程序体验不一致的困扰。他想使找个图形环境更易于使用,而且更重要的是,他想使所有东西都像实际的桌面一样“集成”在一起。 +在 1996 年,Matthias Ettrich 有感于 X 之下 Linux 应用程序体验不一致的困扰。他想使找个更易于使用的图形环境,而且更重要的是,他想让所有东西都“集成”在一起,就像真正的桌面一样。 -Matthias 开始研究K 桌面环境K Desktop Environment(KDE)。那个 K 代表着 “Kool”(LCTT 译注:即 Cool)。但是 KDE 这个名字也意味着可以在通用桌面环境Common Desktop Environment(CDE)上发挥作用,而通用桌面环境是“大 Unix”世界的标准。尽管到了 1996 年,CDE 看起来已经有点过时了。CDE 基于 Motif 部件集,这与 FVWM 模仿的设计相同。KDE 1.0 于 1998 年 7 月完成,是对 FVWM95 等普通窗口管理器的绝对改进。 +Matthias 开始了K 桌面环境K Desktop Environment(KDE)的工作。那个 K 代表着 “Kool”(LCTT 译注:即 Cool)。但是 KDE 这个名字也意味着可以类似通用桌面环境Common Desktop Environment(CDE)的做法,而 CDE 是“大 Unix”世界的标准。尽管到了 1996 年,CDE 看起来已经有点过时了。CDE 基于 Motif 部件集,这也是 FVWM 所模仿的设计。KDE 1.0 于 1998 年 7 月完成,与 FVWM95 等普通窗口管理器相比,它有了明显改进。 ![KDE 1.0][8] *K 桌面环境(KDE)版本 1.0。图片来源:Paul Brown / KDE* -KDE 是 Linux 向前迈出的一大步。最终,Linux 有了一个具有应用程序集成和更现代的桌面图标的真正的桌面。KDE 的设计与 Windows 95 并无不同。屏幕底部有一个任务栏,它提供与 Windows 95 的“开始”菜单等效的功能以及一些应用程序快捷方式。KDE 还支持虚拟桌面,它们被巧妙地标记为 “One”、“ Two”、“Three” 和 “Four”。而正在运行的应用程序则通过屏幕顶部单独的任务栏中的按钮表示。 +KDE 是 Linux 向前迈出的一大步。最终,Linux 有了一个真正的桌面,集成了应用程序和更多现代的桌面图标。KDE 的设计与 Windows 95 并无不同。屏幕底部有一个任务栏,它提供了相当于 Windows 95 的“开始”菜单以及一些应用程序的快捷键。KDE 还支持虚拟桌面,这些桌面被巧妙地标记为 “One”、“ Two”、“Three” 和 “Four”。正在运行的应用程序通过位于屏幕顶部单独的任务栏的按钮表示。 -但是并不是每个人都对 KDE 感到满意。为了从系统中抽象出 GUI 来,KDE 使用了 Trolltech 的 Qt 工具套件库。不幸的是,Qt 并不是以自由软件的许可证进行分发的。Trolltech 允许 Qt 免费在自由软件应用程序中使用,但在商业或专有应用程序中要收取使用费。而且这种二分法与自由软件不符。这给 Linux 发行版带来了问题:它们应该包括 KDE 吗?还是默认使用较旧而属于自由软件的图形用户界面(例如 FVWM)? +但并不是每个人都对 KDE 感到满意。为了将 GUI 从系统中抽象出来,KDE 使用了 Trolltech 的 Qt 工具套件库。不幸的是,Qt 并不是以自由软件的许可证进行分发的。Trolltech 允许 Qt 在自由软件应用程序中免费使用,但在商业或专有应用程序中要收取使用费。而且这种二分法与自由软件不符。这给 Linux 发行版带来了问题:它们应该包括 KDE 吗?还是默认使用 FVWM 这样老式但属于自由软件的图形用户界面? -面对这种情况,Miguel de Icaza 和 Federico Mena 于 1997 年开始开发新的 Linux 桌面上。这个新项目被称为 GNOME,即GNU 网络对象模型环境GNU Network Object Model Environment的缩写。GNOME 旨在成为完全自由的软件,并使用了来自 GIMP 图像编辑器中的另一种工具套件(称为 GTK)。 GTK 从字面上代表 GIMP 工具套件GIMP Tool Kit。当 GNOME 1.0 最终于 1999 年发布时,Linux 有了另一个现代化的桌面环境。 +面对这种情况,Miguel de Icaza 和 Federico Mena 于 1997 年开始开发新的 Linux 桌面上。这个新项目被称为 GNOME,即GNU 网络对象模型环境GNU Network Object Model Environment的缩写。GNOME 旨在成为一个完全自由的软件,并使用了一个不同的工具套件库 —— 来自 GIMP 图像编辑器的 GTK。GTK 从字面上的意思 GIMP 工具套件GIMP Tool Kit。当 GNOME 1.0 终于在 1999 年发布时,Linux 又多了一个现代化的桌面环境。 ![GNOME 1.0][9] *GNOME 1.0 版。图片来源:GNOME 文档项目* -有两个 Linux 桌面环境固然很棒,但“KDE 与 GNOME”之争仍持续了一段时间。到 1999 年,Trolltech 以新的公共许可证 Q 公共许可证Q Public License(QPL)重新发布了 Qt 库。但是,新许可证有其自己的包袱—-QPL 仅适用于 Qt 在开源软件项目中的使用,而不适用于商业项目。因此,自由软件基金会Free Software Foundation(FSF)认为 QPL 与 GNU 通用公共许可证GNU General Public License(GNU GPL)[不兼容][10]。在 Trolltech 在 2000 年根据 GNU GPL v2 重新发布 Qt 库之前,这个许可证问题一直存在。 +有两个 Linux 桌面环境固然很棒,但“KDE 与 GNOME”之争仍持续了一段时间。到了 1999 年,Trolltech 以新的公共许可证 Q 公共许可证Q Public License(QPL)重新发布了 Qt 库。但是,新许可证有其自身的包袱—-QPL 仅适用于 Qt 在开源软件项目中的使用,而不适用于商业项目。因此,自由软件基金会Free Software Foundation(FSF)认为 QPL 与 GNU 通用公共许可证GNU General Public License(GNU GPL)[不兼容][10]。这个许可证问题一直持续到 2000 年 Trolltech 在 GNU GPL v2 下重新发布 Qt 库。 ### 随着时间的发展 -Linux 桌面继续成熟。KDE 和 GNOME 进行了一场友好的竞争,不仅增加了新功能,还互相交流了思想和观念。到 2004 年,GNOME 和 KDE 都取得了长足的进步,但用户界面只是在原有基础上添加了一些变化。 +Linux 桌面继续走向成熟。KDE 和 GNOME 进行了一场友好的竞争,促使双方都在增加了新的功能,还互相交流了思想和观念。到了 2004 年,GNOME 和 KDE 都取得了长足的进步,但只是给用户界面带来了渐进式的变化。 KDE 2 和 3 继续依赖屏幕底部的任务栏概念,但并入了用于运行应用程序的按钮。KDE 最明显的变化之一是添加了 Konqueror 浏览器,该浏览器首次出现在 KDE 2 中。 @@ -103,21 +104,21 @@ KDE 2 和 3 继续依赖屏幕底部的任务栏概念,但并入了用于运 *Fedora Core 2 上的 KDE 3.2.2(2004),显示了 Konqueror 文件管理器(使用 Fedora Core 2 主题)* -GNOME 2 还使用了任务栏概念,但将其分为两个部分:位于屏幕顶部的任务栏以启动应用程序并响应桌面警报,以及位于页面底部的任务栏以显示正在运行的应用程序。我自己将这两个任务栏称之为“你可以做的事情”(顶部)和“你正在做的事情”(底部)。除了精简的用户界面外,GNOME 还添加了由 Eazel 开发的名为 Nautilus 的更新文件管理器。 +GNOME 2 也使用了任务栏概念,但将任务栏一分为二:屏幕顶部的任务栏用于启动应用程序并响应桌面提示,屏幕底部的任务栏用于显示正在运行的应用程序。我把这两个任务栏称之为“你可以做的事情”(顶部)和“你正在做的事情”(底部)。除了精简的用户界面外,GNOME 还添加了由 Eazel 开发的更新过的文件管理器,名为 Nautilus。 ![GNOME 2.6.0][13] *Fedora Core 2 上的 GNOME 2.6.0(2004),显示了 Nautilus 文件管理器(使用 Fedora Core 2 主题)* -随着时间的流逝,KDE 和 GNOME 走了不同的路径。两者都提供了功能丰富、健壮且现代化的桌面环境,但是却具有不同的用户界面目标。2011 年,GNOME 和 KDE 处理桌面界面的方式之间存在重大偏差。KDE 4.6(2011 年 1 月)和 KDE 4.7(2011 年 7 月)提供了更传统的桌面感受,同时继续根植于许多用户熟悉的任务栏概念。当然,可以看到 KDE 发生很多变化,但是它仍然保留了熟悉的外观。 +随着时间的流逝,KDE 和 GNOME 走了不同的道路。两者都提供了功能丰富、健壮且现代化的桌面环境,但是却具有不同的用户界面目标。2011 年,GNOME 和 KDE 在桌面界面上出现了很大的偏差。KDE 4.6(2011 年 1 月)和 KDE 4.7(2011 年 7 月)提供了更传统的桌面感受,同时继续根植于许多用户熟悉的任务栏概念。当然,KDE 的底层发生很多变化,但是它仍然保留了熟悉的外观。 ![KDE 4.6][14] *KDE 4.6,显示 Gwenview 图像查看器。图片来源:KDE* -2011 年,GNOME 通过新的桌面概念彻底改变了走向。GNOME 3 旨在创建一个更简单、更精简的桌面体验,使用户可以专注于自己的工作。任务栏消失了,取而代之的是屏幕顶部的黑色状态栏,其中包括音量和网络控件,显示了时间和电池状态,并允许用户通过重新设计过的菜单启动新程序。 +2011 年,GNOME 以一个新的桌面概念彻底改变了走向。GNOME 3 旨在创建一个更简单、更精简的桌面体验,使用户能够专注于自己的工作。任务栏消失了,取而代之的是屏幕顶部的黑色状态栏,其中包括音量和网络控件,显示了时间和电池状态,并允许用户通过重新设计过的菜单启动新程序。 -菜单的变化最具最戏剧性。单击“活动”菜单或将鼠标移到“活动”的“热角”,会将所有打开的应用程序显示为单独的窗口。用户还可以从概述中单击“应用程序”选项卡以启动新程序。“概述”还提供了内部集成的搜索功能。 +菜单的变化最具最戏剧性。单击“活动”菜单或将鼠标移到“活动”的“热角”,所有打开的应用程序会显示为单独的窗口。用户还可以从“概述”中单击“应用程序”选项卡以启动新程序。“概述”还提供了一个内部集成的搜索功能。 ![GNOME 3.0][15] @@ -129,13 +130,13 @@ GNOME 2 还使用了任务栏概念,但将其分为两个部分:位于屏幕 ### 你的桌面之选 -拥有两个 Linux 桌面意味着用户有很多选择。有些人喜欢 KDE,而另一些人喜欢 GNOME。没关系,选择最适合你的桌面就行。 +拥有两个 Linux 桌面意味着用户有很大的选择余地。有些人喜欢 KDE,而另一些人喜欢 GNOME。没关系,选择最适合你的桌面就行。 -可以肯定的是,KDE 和 GNOME 都有拥护者和批评者。例如,GNOME 放弃任务栏以支持“活动概述”而受到了很多批评。也许最著名的批评家是 Linus Torvalds,他在 2011 年[大声斥责并抛弃了][17]新的 GNOME,将其视为“邪恶的烂摊子”,然后在两年后[回到了][18] GNOME。 +可以肯定的是,KDE 和 GNOME 都有拥护者和批评者。例如,GNOME 因为放弃任务栏而改成“活动概述”而受到了不少批评。也许最著名的批评者是 Linus Torvalds,他在 2011 年[大声斥责并抛弃了][17]新的 GNOME,将其视为“邪恶的烂摊子”,然后在两年后又[回到了][18] GNOME。 -其他人也对 GNOME 3 提出了类似的批评,以至于一些开发人员复刻 GNOME 2 的源代码来创建 MATE 桌面。MATE(是MATE 高级传统环境MATE Advanced Traditional Environment的递归缩写)延续了 GNOME 2 的传统任务栏界面。 +其他人也对 GNOME 3 提出了类似的批评,以至于一些开发人员复刻 GNOME 2 的源代码创建了 MATE 桌面。MATE(是MATE 高级传统环境MATE Advanced Traditional Environment的递归缩写)延续了 GNOME 2 的传统任务栏界面。 -无论如何,毫无疑问当今两个最受欢迎的 Linux 桌面是 KDE 和 GNOME。它们的当前版本非常成熟,并且具有很多功能。 KDE 5.16(2019)和 GNOME 3.32(2019)都试图简化和精简 Linux 桌面体验,但是方式有所不同。GNOME 3.32 继续致力于极简外观,删除所有分散用户注意力的用户界面元素,以便用户可以专注于其应用程序和工作。 KDE 5.16 在任务栏上采用了更为熟悉的方法,但是增加了其他视觉上的改进和特质,尤其是围绕改进的小部件处理和图标。 +无论如何,毫无疑问当今两个最受欢迎的 Linux 桌面是 KDE 和 GNOME。它们的当前版本非常成熟,功能也很丰富。KDE 5.16(2019)和 GNOME 3.32(2019)都试图简化和精简 Linux 桌面体验,但是方式有所不同。GNOME 3.32 继续致力于极简外观,删除所有分散用户注意力的用户界面元素,以便用户可以专注于其应用程序和工作。KDE 5.16 采用了更为熟悉的任务栏方法,但也增加了其他视觉上的改进和亮点,尤其是改进的小部件处理和图标。 ![KDE 5.16 Plasma][19] @@ -145,9 +146,9 @@ GNOME 2 还使用了任务栏概念,但将其分为两个部分:位于屏幕 *GNOME 3.32。图片来源:GNOME* -同时,你也不会完全失去它们之间的兼容性。每个主要的 Linux 发行版都提供兼容性库,因此你可以在运行 GNOME 时从 KDE 运行应用程序。在当你实际要使用的应用程序是为其他桌面环境编写的时候,这非常有用。 你可以在 GNOME 上运行 KDE 应用程序,反之亦然。 +同时,你也不会完全失去它们之间的兼容性。每个主要的 Linux 发行版都提供了兼容性库,因此你可以在运行 GNOME 的同时来运行 KDE 应用程序。当你真正想使用的应用程序是为其他桌面环境编写的,这一点非常有用。你可以在 GNOME 上运行 KDE 应用程序,反之亦然。 -我认为这种态势不会很快改变,这是一件好事。KDE 和 GNOME 之间的良性竞争使这两个阵营的开发人员都可以避免故步自封。无论你使用 KDE 还是 GNOME,你都将拥有一个集成度很高的现代化桌面。最重要的是,这意味着 Linux 拥有自由软件的最佳特性:选择。 +我认为这种态势不会很快改变,这是一件好事。KDE 和 GNOME 之间的良性竞争使这两个阵营的开发人员可以避免故步自封。无论你使用 KDE 还是 GNOME,你都将拥有一个集成度很高的现代化桌面。而最重要的是,这意味着 Linux 拥有自由软件最好的特点:选择。 -------------------------------------------------------------------------------- @@ -156,7 +157,7 @@ via: https://opensource.com/article/19/8/how-linux-desktop-grown 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 64c8c59667b103a42a48504a000ebb74c283a04b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Apr 2020 14:28:17 +0800 Subject: [PATCH 0109/1809] PUB @wxy https://linux.cn/article-12068-1.html --- .../20190822 How the Linux desktop has grown.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190822 How the Linux desktop has grown.md (99%) diff --git a/translated/talk/20190822 How the Linux desktop has grown.md b/published/20190822 How the Linux desktop has grown.md similarity index 99% rename from translated/talk/20190822 How the Linux desktop has grown.md rename to published/20190822 How the Linux desktop has grown.md index e1305bec8a..0bfb102dd6 100644 --- a/translated/talk/20190822 How the Linux desktop has grown.md +++ b/published/20190822 How the Linux desktop has grown.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12068-1.html) [#]: subject: (How the Linux desktop has grown) [#]: via: (https://opensource.com/article/19/8/how-linux-desktop-grown) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) From b91de55a510cdb3c9a2eae305ce0d7a48bf06107 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Apr 2020 21:44:01 +0800 Subject: [PATCH 0110/1809] PRF @geekpi --- ...309 Fish - A Friendly Interactive Shell.md | 77 ++++++++----------- 1 file changed, 33 insertions(+), 44 deletions(-) diff --git a/translated/tech/20200309 Fish - A Friendly Interactive Shell.md b/translated/tech/20200309 Fish - A Friendly Interactive Shell.md index 8f786287ad..7e3fc59f99 100644 --- a/translated/tech/20200309 Fish - A Friendly Interactive Shell.md +++ b/translated/tech/20200309 Fish - A Friendly Interactive Shell.md @@ -1,45 +1,39 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Fish – A Friendly Interactive Shell) [#]: via: (https://fedoramagazine.org/fish-a-friendly-interactive-shell/) [#]: author: (Michal Konečný https://fedoramagazine.org/author/zlopez/) -Fish – 一个友好的交互式 Shell +Fish:一个友好的交互式 Shell ====== ![Fish — A Friendly Interactive Shell][1] -你是否正在寻找 bash 的替代品?你是否在寻找更人性化的东西?再往前看看,因为你刚发现了 fish! +你是否正在寻找 bash 的替代品?你是否在寻找更人性化的东西?不用再看了,因为你刚发现了 fish! -Fish(友好的交互式 shell)是一个智能且用户友好的命令行 shell,可在 Linux、MacOS 和其他操作系统上运行。将其用于终端的日常工作和脚本编写。用 fish 编写的脚本比相同的 bash 版本具有更少的神秘性。 +Fish(友好的交互式 shell)是一个智能且用户友好的命令行 shell,可在 Linux、MacOS 和其他操作系统上运行。可以将其用于终端的日常工作和脚本编写。用 fish 编写的脚本比相同的 bash 版本具有更少的神秘性。 ### Fish 的用户友好功能 - * **建议** -Fish 会建议你之前写过的命令。当经常输入相同命令时,这可以提高生产率。 - * **健全的脚本** -Fish 避免使用隐秘字符。这提供了更清晰和更友好的语法。 - * **基于手册页的补全** -Fish 会根据命令的手册页自动补全参数。 - * **语法高亮** -Fish 会高亮显示命令语法以使其在视觉上友好。 - - +* **建议**:Fish 会提示你之前写过的命令。当经常输入相同命令时,这样可以提高生产率。 +* **健全的脚本能力**:Fish 避免使用那些隐秘字符。这提供了更清晰和更友好的语法。 +* **基于手册页的补全**:Fish 会根据命令的手册页自动补全参数。 +* **语法高亮**:Fish 会高亮显示命令语法以使其在视觉上友好。 ### 安装 #### Fedora 工作站 -使用 _dnf_ 命令安装 fish: +使用 `dnf` 命令安装 fish: ``` $ sudo dnf install fish ``` -安装 _util-linux-user_ 包,然后使用适当的参数运行 _chsh_(更改 shell 程序)命令,将 fish 设置为默认 shell 程序: +安装 `util-linux-user` 包,然后使用适当的参数运行 `chsh`(更改 shell 程序)命令,将 fish 设置为默认 shell 程序: ``` $ sudo dnf install util-linux-user @@ -50,7 +44,7 @@ $ chsh -s /usr/bin/fish #### Fedora Silverblue -由于它不是 GUI 应用,因此你需要使用 _rpm-ostree_ 安装。使用以下命令在 Fedora Silverblue 上安装 fish: +由于它不是 GUI 应用,因此你需要使用 `rpm-ostree` 将其加到层内。使用以下命令在 Fedora Silverblue 上安装 fish: ``` $ rpm-ostree install fish @@ -58,35 +52,31 @@ $ rpm-ostree install fish 在 Fedora Silverblue 上,你需要重启 PC 才能切换到新的 ostree 镜像。 -如果你想在 Fedora Silverblue 用 fish 作为主要 shell,最简单的方法是更新 _/etc/passwd_ 文件。找到你的用户,并将 _/bin/bash_ 更改为 _/usr/bin/fish_。 +如果你想在 Fedora Silverblue 用 fish 作为主要 shell,最简单的方法是更新 `/etc/passwd` 文件。找到你的用户,并将 `/bin/bash` 更改为 `/usr/bin/fish`。 -、你需要 [root 权限][2]来编辑 _/etc/passwd_ 文件。另外,你需要注销并重新登录才能使更改生效。 +你需要 [root 权限][2]来编辑 `/etc/passwd` 文件。另外,你需要注销并重新登录才能使更改生效。 ### 配置 -fish 的用户配置文件在 _~/.config/fish/config.fish_。要更改所有用户的配置,请编辑 _/etc/fish/config.fish_。 +fish 的用户配置文件在 `~/.config/fish/config.fish`。要更改所有用户的配置,请编辑 `/etc/fish/config.fish`。 -每个用户的配置文件必须手动创建。安装脚本不会创建 _〜/ .config / fish / config.fish_。 +用户配置文件必须手动创建。安装脚本不会创建 `~/.config/fish/config.fish`。 -以下是几个配置示例以及它们的 bash 等效项,以帮助你入门: +以下是两个个配置示例以及它们的 bash 等效项,以帮助你入门: #### 创建别名 - * _~/.bashrc_: alias ll='ls -lh' - * _~/.config/fish/config.fish_: alias ll='ls -lh' - - +* `~/.bashrc`:`alias ll='ls -lh'` +* `~/.config/fish/config.fish`: `alias ll='ls -lh'` #### 设置环境变量 - * _~/.bashrc_: export PATH=$PATH:~/bin - * _~/.config/fish/config.fish_: set -gx PATH $PATH ~/bin - - + * `~/.bashrc`:`export PATH=$PATH:~/bin` + * `~/.config/fish/config.fish`:`set -gx PATH $PATH ~/bin` ### 使用 fish 工作 -将 fish 配置为默认 shell 程序后,命令提示符将类似于下图所示。如果尚未将 fish 配置为默认 shell,只需运行 _fish_ 命令以在当前终端会话中启动。 +将 fish 配置为默认 shell 程序后,命令提示符将类似于下图所示。如果尚未将 fish 配置为默认 shell,只需运行 `fish` 命令以在当前终端会话中启动。 ![][3] @@ -100,37 +90,37 @@ fish 的用户配置文件在 _~/.config/fish/config.fish_。要更改所有用 ![][5] -注意输入时出现的灰色文本。灰色文本显示建议之前编写的命令。要自动补全,只需按 **CTRL+F**。 +注意输入时出现的灰色文本。灰色文本显示建议之前编写的命令。要自动补全,只需按 `CTRL+F`。 -通过输入连接号(**–**)然后使用 **TAB** 键,它会根据前面命令的手册页获取参数建议: +通过输入连接号(`–`)然后使用 `TAB` 键,它会根据前面命令的手册页获取参数建议: ![][6] -如果你按一次 **TAB**,它将显示前几个建议(或所有建议,如果只有少量参数可用)。如果再次按 **TAB**,它将显示所有建议。如果连续三次按 **TAB**,它将切换到交互模式,你可以使用箭头键选择一个参数。 +如果你按一次 `TAB`,它将显示前几个建议(或所有建议,如果只有少量参数可用)。如果再次按 `TAB`,它将显示所有建议。如果连续三次按 `TAB`,它将切换到交互模式,你可以使用箭头键选择一个参数。 除此之外,fish 的工作与大多数其他 shell 相似。其他差异已经写在文档中。因此,找到你可能感兴趣的其他功能应该不难。 ### 让 fish 变得更强大 -使用 [powerline][7] 使 fish 变得更强大。Powerline 将命令执行时间、彩色化 git 状态、当前 git 分支等添加到了 fish 的界面中。 +使用 [powerline][7] 使 fish 变得更强大。Powerline 可以为 fish 的界面添加命令执行时间、彩色化 git 状态、当前 git 分支等。 -在安装 powerline 之前,你必须先安装 [Oh My Fish][8]。Oh My Fish 扩展了 fish 的核心基础架构,以支持安装其他插件。安装 Oh My Fish 的最简单方法是使用 _curl_ 命令: +在安装 powerline 之前,你必须先安装 [Oh My Fish][8]。Oh My Fish 扩展了 fish 的核心基础架构,以支持安装其他插件。安装 Oh My Fish 的最简单方法是使用 `curl` 命令: ``` > curl -L https://get.oh-my.fish | fish ``` -如果你不想直接将安装命令管道传给 _fish_,请参见 Oh My Fish 的 [README][9] 的安装部分,以了解其他安装方法。 +如果你不想直接将安装命令管道传给 `fish`,请参见 Oh My Fish 的 [README][9] 的安装部分,以了解其他安装方法。 -Fish 的 powerline 插件是 [bobthefish][7]。Bobthefish 需要 _powerline-fonts_ 包。 +Fish 的 powerline 插件是 [bobthefish][7]。Bobthefish 需要 `powerline-fonts` 包。 -**在Fedora工作站上**: +在 Fedora 工作站上: ``` > sudo dnf install powerline-fonts ``` -**在 Fedora Silverblue 上**: +在 Fedora Silverblue 上: ``` > rpm-ostree install powerline-fonts @@ -138,7 +128,7 @@ Fish 的 powerline 插件是 [bobthefish][7]。Bobthefish 需要 _powerline-font 在 Fedora Silverblue 上,你必须重启以完成字体的安装。 -安装 _powerline-fonts_ 之后,安装 _bobthefish_: +安装 `powerline-fonts` 之后,安装 `bobthefish`: ``` > omf install bobthefish @@ -148,7 +138,7 @@ Fish 的 powerline 插件是 [bobthefish][7]。Bobthefish 需要 _powerline-font ![][10] -### 额外的资源 +### 更多资源 查看这些网页,了解更多 fish 内容: @@ -161,7 +151,6 @@ Fish 的 powerline 插件是 [bobthefish][7]。Bobthefish 需要 _powerline-font * [GitHub][17] - -------------------------------------------------------------------------------- via: https://fedoramagazine.org/fish-a-friendly-interactive-shell/ @@ -169,7 +158,7 @@ via: https://fedoramagazine.org/fish-a-friendly-interactive-shell/ 作者:[Michal Konečný][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b14ccc2e1b65dfdcffe954203a46170c02f91c33 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Apr 2020 21:44:29 +0800 Subject: [PATCH 0111/1809] PUB @geekpi https://linux.cn/article-12069-1.html --- .../20200309 Fish - A Friendly Interactive Shell.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200309 Fish - A Friendly Interactive Shell.md (98%) diff --git a/translated/tech/20200309 Fish - A Friendly Interactive Shell.md b/published/20200309 Fish - A Friendly Interactive Shell.md similarity index 98% rename from translated/tech/20200309 Fish - A Friendly Interactive Shell.md rename to published/20200309 Fish - A Friendly Interactive Shell.md index 7e3fc59f99..cb7b6cb62d 100644 --- a/translated/tech/20200309 Fish - A Friendly Interactive Shell.md +++ b/published/20200309 Fish - A Friendly Interactive Shell.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12069-1.html) [#]: subject: (Fish – A Friendly Interactive Shell) [#]: via: (https://fedoramagazine.org/fish-a-friendly-interactive-shell/) [#]: author: (Michal Konečný https://fedoramagazine.org/author/zlopez/) From bde50e9a07198d5fb4fe5aba5ecb8f0f179db6aa Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Apr 2020 01:16:49 +0800 Subject: [PATCH 0112/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200403=20Take?= =?UTF-8?q?=20back=20your=20dotfiles=20with=20Chezmoi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200403 Take back your dotfiles with Chezmoi.md --- ...03 Take back your dotfiles with Chezmoi.md | 309 ++++++++++++++++++ 1 file changed, 309 insertions(+) create mode 100644 sources/tech/20200403 Take back your dotfiles with Chezmoi.md diff --git a/sources/tech/20200403 Take back your dotfiles with Chezmoi.md b/sources/tech/20200403 Take back your dotfiles with Chezmoi.md new file mode 100644 index 0000000000..2b2bed6621 --- /dev/null +++ b/sources/tech/20200403 Take back your dotfiles with Chezmoi.md @@ -0,0 +1,309 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Take back your dotfiles with Chezmoi) +[#]: via: (https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/) +[#]: author: (Ryan Walter https://fedoramagazine.org/author/rwaltr/) + +Take back your dotfiles with Chezmoi +====== + +![][1] + +In Linux, dotfiles are hidden text files that are used to store various configuration settings for many such as Bash and Git to more complex applications like i3 or VSCode. + +Most of these files are contained in the _~/.config_ directory or right in the home directory. Editing these files allows you to customize applications beyond what a settings menu may provide, and they tend to be portable across devices and even other Linux distributions. But one talking point across the Linux enthusiast community is how to manage these dotfiles and how to share them. + +We will be showcasing a tool called [Chezmoi][2] that does this task a little differently from the others. + +### The history of dotfile management + +If you search [GitHub for dotfiles][3], what you will see are over 100k repositories after one goal: Store people’s dotfiles in a shareable and repeatable manor. However, other than using git, they store their files differently. + +While Git has solved code management problems that also translates to config file management, It does not solve how to separate between distributions, roles (such as home vs work computers) secrets management, and per device configuration. + +Because of this, many users decide to craft their own solutions, and the community has responded with multiple answers over the years. This article will briefly cover some of the solutions that have been created. + +#### Experiment in an isolated environment + +Do you want to try these below solutions quickly in a contained environment? Run: + +``` +$ podman run --rm -it fedora +``` + +… to create a Fedora container to try the applications in. This container will automatically delete itself when you exit the shell. + +#### The install problem + +If you store your dotfiles in Git repository, you will want to make it easy for your changes to automatically be applied inside your home directory, the easiest way to do this at first glance is to use a symlink, such as _ln -s ~/.dotfies/bashrc ~/.bashrc_. This will allow your changes to take place instantly when your repository is updated. + +The problem with symlinks is that managing symlinks can be a chore. Stow and [RCM (covered here on Fedora Magazine)][4] can help you manage those, but these are not seamless solutions. Files that are private will need to be modified and chmoded properly after download. If you revamp your dotfiles on one system, and download your repository to another system, you may get conflicts and require troubleshooting. + +Another solution to this problem is writing your own install script. This is the most flexible option, but has the tradeoff of requiring more time into building a custom solution. + +#### The secrets problem + +Git is designed to track changes. If you store a secret such as a password or an API key in your git repository, you will have a difficult time and will need to rewrite your git history to remove that secret. If your repository is public, your secret would be impossible to recover if someone else has downloaded your repository. This problem alone will prevent many individuals from sharing their dotfiles with the public world. + +#### The multi-device config problem + +The problem is not pulling your config to multiple devices, the problem is when you have multiple devices that require different configuration. Most individuals handle this by either having different folders or by using different forks. This makes it difficult to share configs across the different devices and role sets + +### How Chezmoi works + +Chezmoi is a tool to manage your dotfiles with the above problems in mind, it doesn’t blindly copy or symlink files from your repository. Chezmoi acts more like a template engine to generate your dotfiles based on system variables, templates, secret managers, and Chezmoi’s own config file. + +#### Getting Started with Chezmoi + +Currently Chezmoi is not in the default repositories. You can download the current version of Chezmoi as of writing with the following command. + +``` +$ sudo dnf install https://github.com/twpayne/chezmoi/releases/download/v1.7.17/chezmoi-1.7.17-x86_64.rpm +``` + +This will install the pre-packaged RPM to your system. + +Lets go ahead and create your repository using: + +``` +$ chezmoi init +``` + +It will create your new repository in _~/.local/share/chezmoi/_. You can easily cd to this directory by using: + +``` +$ chezmoi cd +``` + +Lets add our first file: + +``` +chezmoi add ~/.bashrc +``` + +… to add your bashrc file to your chezmoi repository. + +Note: if your bashrc file is actually a symlink, you will need to add the -f flag to follow it and read the contents of the real file. + +You can now edit this file using: + +``` +$ chezmoi edit ~/.bashrc +``` + +Now lets add a private file, This is a file that has the permissions 600 or similar. I have a file at .ssh/config that I would like to add by using + +``` +$ chezmoi add ~/.ssh/config +``` + +Chezmoi uses special prefixes to keep track of what is a hidden file and a private file to work around Git’s limitations. Run the following command to see it: + +``` +$ chezmoi cd +``` + +**Do note that files that are marked as private are not actually private, they are still saved as plain text in your git repo. More on that later.** + +You can apply any changes by using: + +``` +$ chezmoi apply +``` + +and inspect what is different by using + +``` +$ chezmoi diff +``` + +#### Using variables and templates + +To export all of your data Chezmoi can gather, run: + +``` +$ chezmoi data +``` + +Most of these are information about your username, arch, hostname, os type and os name. But you can also add our own variables. + +Go ahead and run: + +``` +$ chezmoi edit-config +``` + +… and input the following: + +``` +[data] + email = "fedorauser@example.com" + name = "Fedora Mcdora" +``` + +Save your file and run chezmoi data again. You will see on the bottom that your email and name are now added. You can now use these with templates with Chezmoi. Run: + +``` +$ chezmoi add -T --autotemplate ~/.gitconfig +``` + +… to add your gitconfig as a template into Chezmoi. If Chezmoi is successful in inferring template correctly, you could get the following: + +``` +[user] + email = "{{ .email }}" + name = "{{ .name }}" +``` + +If it does not, you can change the file to this instead. + +Inspect your file with: + +``` +$ chezmoi edit ~/.gitconfig +``` + +After using + +``` +$ chezmoi cat ~/.gitconfig +``` + +… to see what chezmoi will generate for this file. My generated example is below: + +``` +[root@a6e273a8d010 ~]# chezmoi cat ~/.gitconfig + [user] + email = "fedorauser@example.com" + name = "Fedora Mcdora" + [root@a6e273a8d010 ~]# +``` + +It will generate a file filled with the variables in our chezmoi config. +You can also use the varibles to perform simple logic statements. One example is: + +``` +{{- if eq .chezmoi.hostname "fsteel" }} +# this will only be included if the host name is equal to "fsteel" +{{- end }} +``` + +Do note that for this to work the file has to be a template. You can check this by seeing if the file has a “.tmpl” appended to its name on the file in _chezmoi cd_, or by readding the file using the -T option + +#### Keeping secrets… secret + +To troubleshoot your setup, use the following command. + +``` +$ chezmoi doctor +``` + +What is important here is that it also shows you the [password managers it supports][5]. + +``` +[root@a6e273a8d010 ~]# chezmoi doctor + warning: version dev + ok: runtime.GOOS linux, runtime.GOARCH amd64 + ok: /root/.local/share/chezmoi (source directory, perm 700) + ok: /root (destination directory, perm 550) + ok: /root/.config/chezmoi/chezmoi.toml (configuration file) + ok: /bin/bash (shell) + ok: /usr/bin/vi (editor) + warning: vimdiff (merge command, not found) + ok: /usr/bin/git (source VCS command, version 2.25.1) + ok: /usr/bin/gpg (GnuPG, version 2.2.18) + warning: op (1Password CLI, not found) + warning: bw (Bitwarden CLI, not found) + warning: gopass (gopass CLI, not found) + warning: keepassxc-cli (KeePassXC CLI, not found) + warning: lpass (LastPass CLI, not found) + warning: pass (pass CLI, not found) + warning: vault (Vault CLI, not found) + [root@a6e273a8d010 ~]# +``` + +You can use either of these clients, or a [generic client][6], or your system’s [Keyring][7]. + +For GPG, you will need to add the following to your config using: + +``` +$ chezmoi edit-config +``` + +``` +[gpg] + recipient = " Date: Sat, 4 Apr 2020 01:43:28 +0800 Subject: [PATCH 0113/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200404=20Best?= =?UTF-8?q?=20Raspberry=20Pi=20Operating=20Systems=20for=20Various=20Purpo?= =?UTF-8?q?ses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md --- ... Operating Systems for Various Purposes.md | 296 ++++++++++++++++++ 1 file changed, 296 insertions(+) create mode 100644 sources/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md diff --git a/sources/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md b/sources/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md new file mode 100644 index 0000000000..f4b09c9dbc --- /dev/null +++ b/sources/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md @@ -0,0 +1,296 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Best Raspberry Pi Operating Systems for Various Purposes) +[#]: via: (https://itsfoss.com/raspberry-pi-os/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Best Raspberry Pi Operating Systems for Various Purposes +====== + +[Raspberry Pi][1] is an indispensable single-board computer that comes in handy for a lot of work. Don’t believe me? Just [go through this list of Raspberry Pi projects][2] to get a gist of what this tiny device is capable of. + +Considering how useful a Raspberry Pi is – it is an important task to choose the right operating system for it. Of course, you can do a lot of things with Linux but an OS specially configured for a specific purpose can save you considerable time and effort. + +So, in this article, I will be mentioning some of the popular and useful operating systems tailored for Raspberry Pi. + +### Installing any OS on Raspberry Pi is really easy thanks to the Raspberry Pi Imager tool + +[Installing a Raspberry PI operating system on an SD card][3] is easier than ever before. You can simply get the [Raspberry Pi Imager][4] and get any Raspberry Pi OS installed quickly. Check the official video to see how easy it is. + +You may also utilize [NOOBS][5] (New Out Of the Box Software) to easily install different operating systems on Raspberry Pi. You might also get a pre-installed SD card from the list of their supported retailers mentioned in their [official NOOBS download page][5]. + +Feel free to explore more about installing the operating systems in their [official documentation][6]. + +[Raspberry Pi OS Download][4] + +Now that you know how to install it (and where to get it from), let me highlight a list of useful Raspberry Pi OS to help you out. + +### Various operating systems for Raspberry Pi + +Please keep in mind that I have taken some effort to list only those Raspberry Pi operating system projects that are being actively maintained. If a project gets discontinued in near future, let me know in the comment section and I’ll update this article. + +Another thing is that I have focused on the latest Raspberry 4 but this should not be considered a list of Raspberry Pi 4 OS. You should be able to use it on Raspberry Pi 3, 3 B+ and other variants as well but please check the official project websites for the exact details. + +**Note:** The list is in no particular order of ranking. + +#### 1\. Raspbian OS: The official Raspberry Pi OS + +![][7] + +Raspbian is the officially supported OS for Raspberry Pi boards. It comes baked in with several tools for education, programming, and general use. Specifically, it includes Python, Scratch, Sonic Pi, Java, and several other important packages. + +Originally, Raspbian is based on Debian and comes pre-installed with loads of useful packages. So, when you get this installed, you probably don’t need to install essentials separately – you should find almost everything pre-installed. + +Raspbian OS is actively maintained and it is one of the most popular Raspberry Pi OS out there. You can install it using [NOOBS][5] or follow the [official documentation][6] to get it installed. + +[Raspbian OS][8] + +#### 2\. Ubuntu MATE: For general purpose computing + +![][9] + +Even though Raspbian is the officially supported OS, it does not feature the latest and greatest packages. So, if you want quicker updates and potentially latest packages, you can try Ubuntu MATE for Raspberry Pi. + +Ubuntu MATE tailored as a Raspberry Pi OS is an incredibly lightweight distribution to have installed. It’s also popularly used on [NVIDIA’s Jetson Nano][10]. In other words, you can utilize it for several use-cases with the Raspberry Pi. + +To help you out, we also have a detailed guide on [how to install Ubuntu MATE on Raspberry Pi][11]. + +[Ubuntu MATE for Raspberry Pi][12] + +#### 3\. Ubuntu Server: To use it as a Linux server + +![][13] + +If you’re planning to use your Raspberry Pi as some sort of server for your project, Ubuntu Server can be a great choice to have installed. + +You can find both 32-bit and 64-bit images of the OS. And, depending on what board you have (if it supports 64-bit), you can go ahead and install the same. + +However, it is worth noting that Ubuntu Server isn’t tailored for desktop usage. So, you need to keep in mind that you will have no proper graphical user interface installed by default. + +[Ubuntu Server][14] + +#### 4\. LibreELEC: For media server + +![][15] + +While we already have a list of [media server software available for Linux][16], LibreELEC is one of them. + +It’s a great lightweight OS system capable enough to have [KODI][17] on your Raspberry Pi. You can try installing it using the Raspberry Pi Imager. + +You can easily head to their [official download webpage][18] and find a suitable installer image for your board. + +[LibreELEC][19] + +#### 5\. OSMC: For media server + +![][20] + +OSMC is yet another [popular media server software][16] for Linux. While considering the use of Raspberry Pi boards as media center devices, this is one of the best Raspberry Pi OS that you can recommend to someone. + +Similar to LibreELEC, OSMC also runs KODI to help you manage your media files and enjoy watching the content you already have. + +OSMC does not officially mention the support for **Raspberry Pi 4**. So, if you have Raspberry Pi 3 or lower, you should be good to go. + +[OSMC][21] + +#### 6\. RISC OS: The original ARM OS + +![][22] + +Originally crafted for ARM devices, RISC OS has been around for almost 30 years or so. + +We also have a separate detailed article on [RISC OS][23], if you’re curious to know more about it. Long story short, RISC OS is also tailored for modern ARM-based single-board computers like the Raspberry Pi. It presents a simple user interface with a focus on performance. + +Again, this is not something meant for the Raspberry Pi 4. So, only if you have a Raspberry Pi 3 or lower, you can give it a try. + +[RISC OS][24] + +#### 7\. Mozilla WebThings Gateway: For IoT projects + +![][25] + +As part of Mozilla’s [open-source implementation for IoT devices][26], WebThings Gateway lets you monitor and control all your connected IoT devices. + +You can follow the [official documentation][27] to check the requirements and the instructions to get it installed on a Raspberry Pi. Definitely, one of the most useful Raspberry Pi OS for IoT applications. + +[WebThings Gateway][28] + +#### 8\. Ubuntu Core: For IoT projects + +Yet another Raspberry Pi OS for potential [IoT][29] applications or just to simply test snaps – Ubuntu Core. + +Ubuntu core is specifically tailored for IoT devices or specifically Raspberry Pi, here. I wouldn’t make any claims about it- but Ubuntu Core is a suitable secure OS for Raspberry Pi boards. You can give this a try for yourself! + +[Ubuntu Core][30] + +#### 9\. DietPi: Lightweight Raspberry Pi OS + +![DietPi Screenshot via Distrowatch][31] + +DietPi is a lightweight [Debian][32] operating system that also claims to be lighter than the “Raspbian Lite” OS. + +While considering it as a lightweight Raspberry Pi OS, it offers a lot of features that could come in handy for several use-cases. Ranging from easy installers for software packages to a backup solution, there’s a lot to explore. + +If you’re aiming to get an OS with a low footprint but potentially better performance, you could give this a try. + +[DietPi][33] + +#### 10\. Lakka Linux: Make a retro gaming console + +![][34] + +Looking for a way to turn your Raspberry Pi to a retro gaming console? + +Lakka Linux distribution is originally built on the RetroArch emulator. So, you can have all your retro games on your Raspberry Pi in no time. + +We also have a separate article on [Lakka Linux][35] – if you’re curious to know about it. Or else, just go right ahead and test it out! + +[Lakka][36] + +#### 11\. RetroPie: For retro gaming + +![ ][37] + +RetroPie is yet another popular Raspberry Pi OS that turns it into a retro gaming console. It features several configuration tools so that you can customize the theme or just tweak the emulator to have the best retro games. + +It is worth noting that it does not include any copyrighted games. You can give it a try and see how it works! + +[RetroPie][38] + +#### 12\. Kali Linux: For hacking on budget + +![][39] + +Want to try and learn some ethical hacking skills on your Raspberry Pi? Kali Linux can be a perfect fit for it. And, yes, it usually supports the latest Raspberry Pi as soon as it launches. + +Not just limited to Raspberry Pi, but you can get a long list of other supported devices as well. Try it out and have fun! + +[Kali Linux][40] + +#### 13\. OpenMediaVault: For Network Attached Storage (NAS) + +![][41] + +If you’re trying to set up a [NAS][42] (Network Attached Storage) solution on minimal hardware, Raspberry Pi can help. + +Originally, based on Debian Linux, OpenMediaVault offers a bunch of features that include web-based administration capabilities, plugin support, and more. It does support most of the Raspberry Pi models – so you can try downloading it and get it installed! + +[OpenMediaVault][43] + +#### 14\. ROKOS: For crypto mining + +![][44] + +If you’re someone who’s interested in cryptocurrencies and bitcoins specifically, this could interest you. + +ROKOS is a Debian-based OS that basically lets you turn your Raspberry Pi into a node while having pre-installed drivers and packages for the same. Of course, you need to know how it works before getting it installed. So, I suggest you do some research if you’re not sure what you’re doing. + +[ROKOS][45] + +#### 15\. Alpine Linux: Lightweight security-focused Linux + +Nowadays, a lot of users are usually looking for security-focused and [privacy-focused distributions][46]. And, if you are one of them, you might as well try Alpine Linux for Raspberry Pi. + +It may not be as user-friendly as you’d expect (or beginner-friendly) if you’re just getting started with Raspberry Pi. But, if you want something different to start with, you can try Alpine Linux, which is a security-focused Linux distribution. + +[Alpine Linux][47] + +#### 16\. Kano OS: Operating system for kids’education + +![][48] + +If you’re looking for an open-source OS for Raspberry Pi to make things interesting to learn and educate kids, Kano OS is a good choice. + +It’s being actively maintained and the user experience for the desktop integration on Kano OS is quite simple and fun for someone to play and make kids learn from it. + +[Kano OS][49] + +#### 17\. KDE Plasma Bigscreen: To convert regular TVs into Smart TVs + +![][50] + +This is an under development project from KDE. With [KDE Plasma Bigscreen OS][51] installed on Raspberry Pi, you can use your regular TV like a smart TV. + +You don’t need a special remote to control the TV. You can use the regular remote control. + +Plasma Bigscreen also integrates [MyCroft open source AI][52] for voice control. + +The project is in beta phase so expect some bugs and issues if you are willing to give it a try. + +[Plasma Bigscreen][53] + +#### Wrapping Up + +I’m sure there are a lot of other operating systems tailored for Raspberry Pi – but I’ve tried to list the most popular or the useful ones that are actively maintained. + +If you think I missed one of best suited Raspberry Pi OS, feel free to let me know about it in the comments below! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/raspberry-pi-os/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/ +[2]: https://itsfoss.com/raspberry-pi-projects/ +[3]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[4]: https://www.raspberrypi.org/downloads/ +[5]: https://www.raspberrypi.org/downloads/noobs/ +[6]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/raspbian_home_screen.jpg?resize=800%2C492&ssl=1 +[8]: https://www.raspbian.org/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Desktop-ubuntu.jpg?resize=800%2C600&ssl=1 +[10]: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-nano/ +[11]: https://itsfoss.com/ubuntu-mate-raspberry-pi/ +[12]: https://ubuntu-mate.org/raspberry-pi/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/ubunt-server.png?ssl=1 +[14]: https://ubuntu.com/download/raspberry-pi +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/libreelec.jpg?resize=800%2C600&ssl=1 +[16]: https://itsfoss.com/best-linux-media-server/ +[17]: https://kodi.tv/ +[18]: https://libreelec.tv/downloads_new/ +[19]: https://libreelec.tv/ +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/osmc-server.jpg?resize=800%2C450&ssl=1 +[21]: https://osmc.tv/ +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/10/riscos5.1.jpg?resize=800%2C600&ssl=1 +[23]: https://itsfoss.com/risc-os-is-now-open-source/ +[24]: https://www.riscosopen.org/content/ +[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/web-things-gateway.png?ssl=1 +[26]: https://iot.mozilla.org/about/ +[27]: https://iot.mozilla.org/docs/gateway-getting-started-guide.html +[28]: https://iot.mozilla.org/gateway/ +[29]: https://en.wikipedia.org/wiki/Internet_of_things +[30]: https://ubuntu.com/download/raspberry-pi-core +[31]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/diet-pi.jpg?ssl=1 +[32]: https://www.debian.org/ +[33]: https://dietpi.com/ +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/08/lakkaos.jpg?resize=1024%2C640&ssl=1 +[35]: https://itsfoss.com/lakka-retrogaming-linux/ +[36]: http://www.lakka.tv/ +[37]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/retro-pie.png?ssl=1 +[38]: https://retropie.org.uk/ +[39]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/kali-linux-pi.png?ssl=1 +[40]: https://www.offensive-security.com/kali-linux-arm-images/ +[41]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/openmediavault.jpg?ssl=1 +[42]: https://en.wikipedia.org/wiki/Network-attached_storage +[43]: https://www.openmediavault.org/ +[44]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rocos-bitcoin-pi.jpg?ssl=1 +[45]: https://rokos.space/ +[46]: https://itsfoss.com/privacy-focused-linux-distributions/ +[47]: https://alpinelinux.org/ +[48]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/kano-os-pi.jpeg?ssl=1 +[49]: https://kano.me/row/downloadable +[50]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/plasma-bigscreen-menu.jpg?ssl=1 +[51]: https://itsfoss.com/kde-plasma-bigscreen/ +[52]: https://itsfoss.com/mycroft-mark-2/ +[53]: https://plasma-bigscreen.org/#download-jumpto From d23f034925750f9fba6caaf674be9e887222e27e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Apr 2020 01:44:23 +0800 Subject: [PATCH 0114/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200404=20Bodh?= =?UTF-8?q?i=20Linux=205.1=20Review:=20Slightly=20Different=20Lightweight?= =?UTF-8?q?=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md --- ...w- Slightly Different Lightweight Linux.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md diff --git a/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md b/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md new file mode 100644 index 0000000000..d4892ffbcc --- /dev/null +++ b/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md @@ -0,0 +1,129 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Bodhi Linux 5.1 Review: Slightly Different Lightweight Linux) +[#]: via: (https://itsfoss.com/bodhi-linux-review/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Bodhi Linux 5.1 Review: Slightly Different Lightweight Linux +====== + +Bodhi Linux is a [lightweight Linux distribution][1] based on Ubuntu. Unlike most other distributions, Bodhi uses its own Moksha desktop and focuses on providing you a minimal setup to run on older computers. + +### What is Bodhi Linux? + +![Bodhi Start Page][2] + +[Bodhi Linux][3] was first introduced in 2011. It is designed with “[minimalism, resource efficiency, and user choice][4]” in mind. The devs strove to provide a “[system that is functional but not bloated][5]“. As such, it uses the lightweight Moksha Desktop and has only the basic applications preinstalled. The idea is to give the user a stable platform to build the system that they want. It is based on the latest Ubuntu LTS. + +### Moksha Desktop + +![Bodhi Desktop][6] + +Originally Bodhi shipped with the [Enlightenment desktop environment][7]. Bodhi Linux has long been known as the “Enlightened” Linux distro. In fact, the word ‘bodhi’ is based on the Sanskrit word for “enlightenment”. + +However, that changed when Enlightenment 18 was released. The release was in such bad shape that it was not included in Bodhi. Enlightenment 19 was released and fixed some of the problems, but still had issues. + +After trying to work with the Enlightenment dev team and getting nowhere, the Bodhi devs [forked][8] Enlightenment 17 in 2015. The new desktop environment would be named [Moksha][9], which is based on the Sanskrit word for “emancipation, liberation, or release”. You can find the code for it on [GitHub][10]. + +### What is new in 5.1.0? + +[Subscribe to our YouTube channel for more Linux videos][11] + +[Bodhi 5.1.0][12] is the first release in two years and the second release to be based on Ubuntu 18.04. Besides updating packages, it also has new default icons and theme. This release makes several changes to the default applications. Leafpad comes preinstalled instead of epad and [GNOME Web][13] (also known as Epiphany) replaces [Midori][14]). The eepDater system updater was removed. + +There are currently [four different versions][15] of Bodhi 5.1.0 available to [download][16]: Standard, Hwe, Legacy, and AppPack. + + * Standard will work for systems made in the last decade. It does not push kernel updates. + * Hwe (Hardware Enablement) edition is new to the Bodhi family and is designed to include support for newer hardware and will received kernel updates. The 5.1 release features the 5.3.0-42 kernel. + * Legacy is the only edition that is 32-bit. It uses the “older 4.9.0-6-686 Linux kernel that is optimized for old (15+ years old) hardware. This kernel also does not include the PAE extension which is not supported on many older systems.” + * The AppPack edition is for those who want a fully-loaded system out of the box and comes with many applications preinstalled. + + + +### System Requirements for Bodhi Linux + +Minimum system requirement + + * 500 MHz processor + * 256 MB of RAM + * 5 GB of drive space + + + +Recommended system requirement + + * 1.0 GHz processor + * 512 MB of RAM + * 10 GB of drive space + + + +### Experiencing Bodhi Linux + +![Old Bodhi Linux][17] + +Since it is based on Ubuntu, installing Bodhi was very simple. After I signed into Bodhi, I was surprised by the new theme and icon set. The last time I installed Bodhi (including 5.0 a couple of months ago) I thought that it needed a new look. There was nothing really wrong with the previous theme, but it looked like something from the early 2000. The new theme gives it a more modern look. + +![Bodhi Linux 5.1][18] + +I was also glad to see that Midori had been replaced by GNOME Web. I’m not a fan of [Midori browser][19]. It always seemed too minimal for me. (However, that might change in the future with [Midori Next][20].) Web felt more like the web browser I need. Most importantly it comes with Firefox Sync, so I can keep all of my bookmarks and passwords synced. + +Unlike many Linux distros, Bodhi doesn’t really come with a stand-alone software center. Instead, if you click the AppCenter icon it opens the browser and navigates to the [AppCenter p][21][a][21][ge][21] of the Bodhi website. Here apps are sorted by category. Most of them are [lightweight applications][22]. + +![Bodhi Linux Appcenter][23] + +If you click on one of the pages and click “Install”, Bodhi will install it (after to type in your passwords). This is achieved using a neat little program named [apturl][24] that “is a very simple way to install a software package from a web browser”. It’s pretty slick and I wish more Ubuntu-based distros would use it. + +Overall, I like the Moksha desktop. It adheres to the desktop metaphor we have seen for decades (and which I am most comfortable with). It stays out of your way but is very easy to change and modify. The only thing I miss is that the application menu doesn’t open when I hit the super key. But I guess you can’t have everything in life. + +### Final Thoughts + +I was pleasantly surprised by this recent release of Bodhi Linux. In the past, I’ve played with it from time to time. I always liked it, but this last release has been the best so far. In a way, they have broken free of the idea that Bodhi is only for older system by adding support for newer kernels. + +If you are looking for a change of scenery while staying close to the world of Ubuntu give [Bodhi Linux][3] a try. + +Have you ever used Bodhi Linux? What is your favorite Ubuntu-based distro? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][25]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/bodhi-linux-review/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/lightweight-linux-beginners/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/bodhi-start-page.png?resize=800%2C500&ssl=1 +[3]: https://www.bodhilinux.com/ +[4]: https://www.bodhilinux.com/w/wiki/ +[5]: https://www.bodhilinux.com/w/what-is-bodhi-linux/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/bodhi-desktop.jpg?resize=800%2C500&ssl=1 +[7]: https://www.enlightenment.org/start +[8]: https://www.bodhilinux.com/2015/04/28/introducing-the-moksha-desktop/ +[9]: https://www.bodhilinux.com/moksha-desktop/ +[10]: https://github.com/JeffHoogland/moksha +[11]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[12]: https://www.bodhilinux.com/2020/03/25/bodhi-linux-5-1-0-released/ +[13]: https://wiki.gnome.org/Apps/Web/ +[14]: https://en.wikipedia.org/wiki/Midori_(web_browser +[15]: https://www.bodhilinux.com/w/selecting-the-correct-iso-image/ +[16]: https://www.bodhilinux.com/download/ +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/bodhi.png?resize=800%2C400&ssl=1 +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/bodhi-Linux-5-1-screenshot.jpg?ssl=1 +[19]: https://itsfoss.com/midori-browser/ +[20]: https://www.midori-browser.org/2020/01/15/midori-next-come-on-yarovi-we-can/ +[21]: https://www.bodhilinux.com/a/ +[22]: https://itsfoss.com/lightweight-alternative-applications-ubuntu/ +[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Bodhi-Linux-AppCenter.png?resize=800%2C500&ssl=1 +[24]: https://wiki.ubuntu.com/AptUrl +[25]: https://reddit.com/r/linuxusersgroup From 95bed27498aed397e912d351a26d5a466449c7ea Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Apr 2020 01:45:14 +0800 Subject: [PATCH 0115/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200404=20What?= =?UTF-8?q?=20is=20Arch=20User=20Repository=20(AUR)=3F=20How=20to=20Use=20?= =?UTF-8?q?AUR=20on=20Arch=20and=20Manjaro=20Linux=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md --- ...ow to Use AUR on Arch and Manjaro Linux.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md diff --git a/sources/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md b/sources/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md new file mode 100644 index 0000000000..c9c4ff7340 --- /dev/null +++ b/sources/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is Arch User Repository (AUR)? How to Use AUR on Arch and Manjaro Linux?) +[#]: via: (https://itsfoss.com/aur-arch-linux/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +What is Arch User Repository (AUR)? How to Use AUR on Arch and Manjaro Linux? +====== + +If you have been using [Arch Linux][1] or other distribution based on Arch such as Manjaro, you might have comes across the term AUR. You try to install a new software and someone suggests to install it from AUR. This leaves you confused. + +What is this AUR? Why is it used? How to use AUR? I’ll answer these questions in this article. + +### What is AUR? + +![][2] + +AUR stands for Arch User Repository. It is a community-driven repository for Arch-based Linux distributions users. It contains package descriptions named [PKGBUILDs][3] that allow you to compile a package from source with [makepkg][4] and then install it via [pacman][5] (package manager in Arch Linux). + +The AUR was created to organize and share new packages from the community and to help accelerate popular packages’ inclusion into the [community repository][6]. + +A good number of new packages that enter the official repositories start in the AUR. In the AUR, users are able to contribute their own package builds (PKGBUILD and related files). + +The AUR community has the ability to vote for packages in the AUR. If a package becomes popular enough — provided it has a compatible license and good packaging technique — it may be entered into the community repository directly accessible by pacman. + +In short, AUR is the way for developers to make new software available to Arch Linux users before the software is officially included in Arch repositories. + +### Should you use AUR? What’s the risk involved? + +Using the AUR is like crossing the street. If you proceed with caution you should be fine. + +If you are new to Linux it is advised to not to use the AUR until you build a foundation knowledge about Arch/Manjaro and Linux in general. + +It is true that anyone can upload packages to the AUR but the [Trusted Users][7] (TUs) are charged with keeping an eye on what gets uploaded. Although TUs perform quality control to the uploaded packages, there is in no guarantee that packages in the AUR are well formed or not malicious. + +In practice the AUR seems to be quite safe but in theory it can do some damage, but only if you are not careful. A smart Arch user, **always** inspects PKGBUILDs and *.install files when building packages from the AUR. + +Additionally TUs (Trusted Users) also remove packages in the AUR that are included in core/extra/community so there should be no naming conflicts between them. The AUR will often contain developmental versions of packages (cvs/svn/git/etc) but they will have modified names such as foo-git. + +As for the AUR packages, pacman handles dependency resolution and detects file conflicts so you never have to worry about overwriting files in one package with files from another package unless you use the “–force” option by default. If you do that, you probably have more serious problems than file conflicts. + +### How to use AUR? + +The simplest way to use AUR is through a AUR helper. An [AUR helper][8] is a command line tool (some has GUI as well) that lets you search for packages published on the AUR and install them. + +##### Installing an AUR helper on Arch Linux + +Let’s say you want to use [Yay AUR helper][9]. Make sure that you have git installed on Linux. And then clone the repository, go to the directory and build the package. + +Use these commands one by one for that: + +``` +sudo pacman -S git +sudo git clone https://aur.archlinux.org/yay-git.git +cd yay +makepkg -si +``` + +Once installed, you can use yay command like this to install a package: + +``` +yay -S package_name +``` + +It’s not that you must use AUR helper for installing packages from AUR. Expand the next section to see how to use AUR without AUR helper. + +##### Installing AUR packages without AUR helpers + +If you don’t want to use AUR helper, you can install packages from AUR on your own as well. + +As soon as you find the package you want to install on [AUR page][10] it is advised to confirm “Licence”, “Popularity”, “Last Updated”, “Dependencies” and so on as an extra quality control step. + +``` +git clone [package URL] +cd [package name] +makepkg -si +``` + +For example. let’s say you want to install [telegram desktop package][11]: + +``` +git clone https://aur.archlinux.org/telegram-desktop-git.git +cd telegram-desktop-git +makepkg -si +``` + +#### Enabling AUR support in Manjaro Linux + +AUR isn’t enabled by default and you have to enable it through pamac. My laptop runs [Manjaro][12] Cinnamon but the steps are same for all Manjaro flavors. + +Open Pamac (listed as Add/Remove Software): + +![][13] + +Once you are in pamac go to preferences like shown below. + +![][14] + +In preferences dialog box go to AUR tab, enable the AUR support, enable check for updates and close the dialog box. + +![][15] + +You can now search for packages and those which belong to AUR can be identified by the tag under the package descriptions. + +![][16] + +I hope you find this article useful and keep an eye on social media for upcoming Arch related topics. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/aur-arch-linux/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://www.archlinux.org/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/what-is-aur.png?ssl=1 +[3]: https://wiki.archlinux.org/index.php/PKGBUILD +[4]: https://wiki.archlinux.org/index.php/Makepkg +[5]: https://wiki.archlinux.org/index.php/Pacman#Additional_commands +[6]: https://wiki.archlinux.org/index.php/Community_repository +[7]: https://wiki.archlinux.org/index.php/Trusted_Users +[8]: https://itsfoss.com/best-aur-helpers/ +[9]: https://github.com/Jguer/yay +[10]: https://aur.archlinux.org/ +[11]: https://aur.archlinux.org/packages/telegram-desktop-git +[12]: https://manjaro.org/ +[13]: https://i1.wp.com/i.imgur.com/kFF6HtW.png?ssl=1 +[14]: https://i0.wp.com/i.imgur.com/47r963A.png?ssl=1 +[15]: https://i1.wp.com/i.imgur.com/UThiDHO.png?ssl=1 +[16]: https://i2.wp.com/i.imgur.com/RM5BKi2.png?ssl=1 From 3bf5932488f8b065f51fa2b272eb862169e2bd45 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Apr 2020 01:48:45 +0800 Subject: [PATCH 0116/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200403=20Buil?= =?UTF-8?q?ding=20a=20sensing=20prosthetic=20with=20the=20Raspberry=20Pi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200403 Building a sensing prosthetic with the Raspberry Pi.md --- ...ensing prosthetic with the Raspberry Pi.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20200403 Building a sensing prosthetic with the Raspberry Pi.md diff --git a/sources/tech/20200403 Building a sensing prosthetic with the Raspberry Pi.md b/sources/tech/20200403 Building a sensing prosthetic with the Raspberry Pi.md new file mode 100644 index 0000000000..0eef549525 --- /dev/null +++ b/sources/tech/20200403 Building a sensing prosthetic with the Raspberry Pi.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building a sensing prosthetic with the Raspberry Pi) +[#]: via: (https://opensource.com/article/20/4/raspberry-pi-sensebreast) +[#]: author: (Kathy Reid https://opensource.com/users/kathyreid) + +Building a sensing prosthetic with the Raspberry Pi +====== +SenseBreast is an early prototype of a sensing mastectomy prosthetic +based on open hardware. +![Open source doctor.][1] + +_Content advisory: this article contains frank discussions of breast cancer._ + +What's the first question you ask your surgeon when you're discussing reconstruction options after breast cancer? + +"How many USB ports can you give me?" is probably not the one that comes to mind for many people! + +Although the remark was said jokingly, it sparked a thread that would ultimately become [SenseBreast][2]—an early prototype of a sensing mastectomy prosthetic, based on open hardware. + +### How did SenseBreast come about? + +All technology has a history—an origin story of experimentation, missteps, successes, setbacks, and breakthroughs. SenseBreast is no different. SenseBreast was developed as a term project for the Masters of Applied Cybernetics—a highly selective course at the Australian National University's [3A Institute][3]. The mission of the 3Ai is to bring artificial intelligence and cyber-physical systems safely, responsibly, and sustainably to scale. The purpose of the assignment was to explore the nexus between the electronic, virtual world, and the physical, tactile world. + +### What is SenseBreast? + +SenseBreast combines two distinct elements: a cyber component—electronics, sensors, and storage for gathering data, and a physical component—a breast form designed to be worn inside a mastectomy bra. SenseBreast is a rudimentary cyber-physical system. In cyber-physical systems, physical and software components are deeply intertwined and interact in different ways depending on context. + +The SenseBreast draws on a rich heritage of open source hardware and software. Based on the Raspberry Pi 3B+, it uses the Debian-flavored Raspbian operating system, Python to interact with the onboard sensors, and d3.js to visualize the data that the sensors generate. + +Early versions of the SenseBreast used the SenseHAT, but in the true spirit of open source collaboration, I partnered with Australian open source luminary Jon Oxer to develop a custom SenseBreast board. This contains an inertial motion unit (IMU) and temperature, humidity, and pressure sensors, just like the SenseHAT, but in addition, it contains the BME680 volatile gas sensor and a breakout for a heart rate monitor. + +![SenseBreast open hardware board developed by Jon Oxer and Kathy Reid][4] + +SenseBreast is wearable tech, so the physical form of the cyber-physical system is also important. Factors like comfort, texture, and fit in clothing are important in the design of wearables because technology isn't better unless it's better for people! The early attempts at building a housing for SenseBreast were spectacular failures; in fact, the very first iteration was put together using acrylic render and linen cloth, and held together with paper clips—in true hacker style! It wasn't comfortable to wear at all, but it served as a proof point for further exploration. + +![First attempt at creating a breast form using acrylic render covered in linen cloth][5] + +Later iterations used a different approach. This involved taking a cast of a breast, using quick-dry silicone supported by a plaster cast. The resulting mold was then used with slow-setting silicone to create a true-to-life shape. A recess was carved into the form to house the electronic components, and an additional silicone layer was added to protect the wearer's skin from contact with electronics. + +### What did we learn from SenseBreast? + +The key learning from SenseBreast is that data is partial. It only tells part of a story. It can be misleading and untrustworthy, which makes the decisions based on that data unreliable too. For example, the sensor data gathered by SenseBreast was affected by how hard the CPU was working. The graph below plots a sequence of 5 minutes of data from SenseBreast, just after the device has booted. You can see that the temperature decreases over time; this is because the CPU has to work harder as the Raspberry Pi boots, and then cools down after the boot operations are completed. + +![Data visualisation of the readings in SenseBreast using the d3.js library][6] + +These sorts of learnings have implications on a broader scale. + +What if the SenseBreast were not an open source device, but a commercial wearable that stored data about me? What if part of the business model of that company was to sell the data that was harvested? What if my health insurer had access to that data? Or prospective employers? Now, more than ever, it's important that we have private, open solutions for sensing data about ourselves. + +### What's next for the SenseBreast project? + +The SenseBreast is a very early prototype, but it has the potential to develop through many different arcs. It could be used to assess range of movement post-surgery, to research how different garments and fabrics adjust to temperature and humidity, and to identify correlations between ambient air pressure and conditions such as lymphoedema. The path SenseBreast takes will be dependent on the passion, needs, and dedication of the incredible global open source community. + +You can learn more about SenseBreast at [https://sensebreast.org][2] and see my presentation at [linux.conf.au][7] 2020 [here][8]. + +The code for SenseBreast is available on [GitHub][9]. + +Health IT has been surprisingly unwilling to deeply support open source software. Despite the huge... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/raspberry-pi-sensebreast + +作者:[Kathy Reid][a] +选题:[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/kathyreid +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_520x292_opensourcedoctor.png?itok=fk79NwpC (Open source doctor.) +[2]: https://sensebreast.org/ +[3]: https://3ainstitute.cecs.anu.edu.au/ +[4]: https://opensource.com/sites/default/files/uploads/49427571178_bb5df37c3a_c.jpg (SenseBreast open hardware board developed by Jon Oxer and Kathy Reid) +[5]: https://opensource.com/sites/default/files/uploads/49641040471_6d0cc91619_c.jpg (First attempt at creating a breast form using acrylic render covered in linen cloth) +[6]: https://opensource.com/sites/default/files/uploads/49640513813_5a7d63803a_c.jpg (Data visualisation of the readings in SenseBreast using the d3.js library) +[7]: http://linux.conf.au +[8]: https://www.youtube.com/watch?v=G3QfZ11DCpc. +[9]: https://github.com/KathyReid/sensebreast From fcf1f7e1539972c41af086ee7604d3d3f3793837 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Apr 2020 01:50:07 +0800 Subject: [PATCH 0117/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200402=20Ansi?= =?UTF-8?q?ble=20streaming=20video=20series,=20open=20source=20security=20?= =?UTF-8?q?tools,=20and=20more=20industry=20trends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200402 Ansible streaming video series, open source security tools, and more industry trends.md --- ...ecurity tools, and more industry trends.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20200402 Ansible streaming video series, open source security tools, and more industry trends.md diff --git a/sources/tech/20200402 Ansible streaming video series, open source security tools, and more industry trends.md b/sources/tech/20200402 Ansible streaming video series, open source security tools, and more industry trends.md new file mode 100644 index 0000000000..d2dba3b1cb --- /dev/null +++ b/sources/tech/20200402 Ansible streaming video series, open source security tools, and more industry trends.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ansible streaming video series, open source security tools, and more industry trends) +[#]: via: (https://opensource.com/article/20/4/ansible-security-more-industry-trends) +[#]: author: (Tim Hildred https://opensource.com/users/thildred) + +Ansible streaming video series, open source security tools, and more industry trends +====== +A weekly look at open source community and industry trends. +![Person standing in front of a giant computer screen with numbers, data][1] + +As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. + +## [Ansible 101 by Jeff Geerling: a YouTube streaming series][2] + +> After the incredible response I got from [making my Ansible books free for the rest of March][3] to help people learn new automation skills, I tried to think of some other things I could do to help developers who may be experiencing hardship during the coronavirus pandemic and market upheaval. + +**The impact**: Not everyone is a frontline worker in this crisis, but then not every problem it has created needs one. This is a great example of someone using their resources to help in a unique way. + +## [Open source security tools for cloud and container applications][4] + +> Open-source security tools play an important role in securing your container-based infrastructure. Tools such as Anchore can be used for strong governance capabilities, while on the other hand, Dagda can be used to perform static analysis of known vulnerabilities. Two other tools, OpenSCAP and Clair, also provide good capabilities for vulnerability scanning and compliance management. So, depending upon your business requirements and priorities, you can select the right tool to secure your container investments. + +**The impact**: Containers are Linux, and container security is open source as well. + +## [Cloud cover: Clearing up some misunderstandings about data centres][5] + +> The [carbon footprint of data][6] is becoming more and more of a concern, but there appears to be little economic interest in decreasing the amount of data flowing around the world to mitigate this. In that scenario, finding the most energy-efficient and carbon-neutral ways to run purpose-built data centres could be the only answer. + +**The impact**: I was talking to a colleague who manages a team of virtualization engineers about this very problem. He seemed optimistic about the amount of headway his team could make on improving the energy consumption of things like KVM at the kernel level; though at the moment customers aren't asking for it. I'd guess that if, for example, the price of carbon emissions were to go up for some reason, that situation would change pretty quickly. + +## [Business culture is key in OpenStack network requirements][7] + +> The main question is: What is your [culture][8]? Do you go to a vendor and say, 'Give me your design, tell me what to buy and how to support it'? Starting out, you evaluate systems. What are your options? +> +> If you have siloed folks that work on a particular model of equipment, then OpenStack is probably not for you. If you have people that function at a higher level with some fundamental understanding about the underlying architecture that makes things work, then OpenStack can be very useful for you, and you're much less restricted. + +**The impact:** Not every organization can adopt a given technology. Certainly not without a willingness to change at a fundamental level. + +_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/ansible-security-more-industry-trends + +作者:[Tim Hildred][a] +选题:[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/thildred +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) +[2]: https://www.jeffgeerling.com/blog/2020/ansible-101-jeff-geerling-youtube-streaming-series +[3]: https://www.jeffgeerling.com/blog/2020/you-can-get-my-devops-books-free-rest-month +[4]: http://techgenix.com/open-source-security-tools/ +[5]: https://www.siliconrepublic.com/enterprise/data-centres-seamus-dunne-interxion +[6]: https://www.siliconrepublic.com/machines/data-carbon-footprint +[7]: https://searchnetworking.techtarget.com/feature/Business-culture-is-key-in-OpenStack-network-requirements +[8]: https://whatis.techtarget.com/definition/corporate-culture From 3771c22e142174f7929558f50fb30dadcae27cfd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Apr 2020 01:53:14 +0800 Subject: [PATCH 0118/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200402=20When?= =?UTF-8?q?=20debugging,=20your=20attitude=20matters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200402 When debugging, your attitude matters.md --- ...2 When debugging, your attitude matters.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20200402 When debugging, your attitude matters.md diff --git a/sources/tech/20200402 When debugging, your attitude matters.md b/sources/tech/20200402 When debugging, your attitude matters.md new file mode 100644 index 0000000000..106b40a64a --- /dev/null +++ b/sources/tech/20200402 When debugging, your attitude matters.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (When debugging, your attitude matters) +[#]: via: (https://jvns.ca/blog/debugging-attitude-matters/) +[#]: author: (Julia Evans https://jvns.ca/) + +When debugging, your attitude matters +====== + +A while back I wrote [What does debugging a program look like?][1] on what to do when debugging (change one thing at a time! check your assumptions!). + +But I was debugging some CSS last week, and I think that post is missing something important: **your attitude**. + +Now – I’m not a very good CSS developer yet. I’ve never written CSS professionally and I don’t understand a lot of basic CSS concepts (I think I finally understood for the first time recently how `position: absolute` works). And last week I was working on the most complicated CSS project I’d ever attempted. + +While I was debugging my CSS, I noticed myself doing some bad things that I normally would not! I was: + + * making random changes to my code in the hopes that it would work + * googling a lot of things and trying them without understanding what they did + * if something broke, reverting my changes and starting again + + + +This strategy was exactly as effective as you might imagine (not very effective!), and it was because of my attitude about CSS! I had this unusual-for-me belief that CSS was Too Hard and impossible for me to understand. So let’s talk about that attitude a bit! + +### the problem attitude: “this is too hard for me to understand” + +One specific problem I was having was – I had 2 divs stacked on top of one another, and I wanted Div A to be on top of Div B. My model of CSS stacking order at the start of this was basically “if you want Thing A to be on top of Thing B, change the z-index to make it work”. So I changed the z-index of Div A to be 5 or something. + +But it didn’t work! In Firefox, div A was on top, but in Chrome, Div B was on top. Argh! Why? CSS is impossible!!! + +I googled a bit, and I found out that a possible reason z-index might not work was because Div A and Div B were actually in different “stacking contexts”. If that was true, even if I set the z-index of Div A to 999999 it would still not put it on top of Div B. ([here’s a small example of what this z-index problem looks like, though I think my specific bug had some extra complications][2]) + +I thought “man, this stacking context thing seems really complicated, why is it different between Firefox and Chrome, I’m not going to be able to figure this out”. So I tried a bunch of random things a bunch of blog posts suggested, which as usual did not work. + +Finally I gave up this “change random things and pray” strategy and thought “well, what if I just read the documentation on stacking order, maybe it’s not that bad”. + +So I read the [MDN page on stacking order][3], which says: + +> When the z-index property is not specified on any element, elements are stacked in the following order (from bottom to top): +> 1\. The background and borders of the root element +> 2\. Descendant non-positioned blocks, in order of appearance in the HTML +> 3\. Descendant positioned elements, in order of appearance in the HTML + +This is SO SIMPLE! It just depends on the order in the HTML! I put Div A after Div B in the HTML (as a sibling) and it made everything work in both browsers. + +### better attitude: “let’s learn the basics and see if that helps” + +This whole stacking problem turned out to really not be that complicated – all I needed to do was read a very short and simple documentation page to understand how stacking works! + +Of course, computer things are not always this simple (and even in this specific case the [rules about what creates a new stacking context][4] are pretty complicated.). But I did not need to understand those more complicated rules in order to put Div A on top of Div B! I only needed to know the much simpler 3 rules above. + +So – calm down for a second, learn a few of the basics, and see if that helps. + +### watching people who know what they’re doing is inspiring + +Another area of CSS that I thought was “too hard” for me to understand was this whole `position: absolute` and `position: relative` business. I kept seeing (and sometimes using!) examples where people made complicated CSS things with `position: absolute` but I didn’t understand how they worked. Doesn’t `position: absolute` mean that the element is always in the same place on the screen? Why are these `position: absolute` things moving when I scroll like the rest of the document? (spoiler: no, that’s `position: fixed`.) + +But last week, I paired with someone who’s a lot better at CSS than me on some code, and I saw that they were just typing in `position: absolute` and `position: relative` confidently into their code without seeming confused about it!! Could that be me? + +I looked up the [documentation on MDN][5] on `position: absolute`, and it said: + +> The element is removed from the normal document flow, and no space is created for the element in the page layout. It is positioned relative to its closest positioned ancestor… Its final position is determined by the values of top, right, bottom, and left. + +So things with `position: absolute` are positioned relative to their closest positioned ancestor! And you just use `top/bottom/right/left` to pick where! That’s so simple! + +### documentation that you can trust makes a big difference + +I think another big source of my frustration with CSS is that I didn’t have the best grasp of where to find accurate information & advice. I knew that MDN was a reliable reference, but MDN doesn’t really help answer questions like “ok but seriously how do I center a div???” and I found myself reading a lot of random Stack Overflow answers/blog posts that I wasn’t 100% sure were correct. + +This week I learned about [CSS Tricks][6] which has a lot of GREAT articles like [Centering in CSS: A Complete Guide][7] which seems very reputable and is written in a super clear way. + +### that’s all! + +I don’t really know why I started to believe that it was “impossible” to understand basic CSS concepts since I don’t believe that about computers in general. Maybe because I’ve been writing CSS at a beginner level for a very long time but hadn’t ever really tried to do a more involved CSS project than “let’s arrange some divs in a grid with flexbox”! + +But this attitude really got in the way of me writing the CSS I wanted to write! And once I let go of it and used my normal debugging techniques I was able to get a lot more things to work the way I wanted. + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/debugging-attitude-matters/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://jvns.ca/blog/2019/06/23/a-few-debugging-resources/ +[2]: https://codepen.io/jvns-css-fun/pen/YzXMMdQ +[3]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/Stacking_without_z-index +[4]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context +[5]: https://developer.mozilla.org/en-US/docs/Web/CSS/position +[6]: https://css-tricks.com +[7]: https://css-tricks.com/centering-css-complete-guide/ From 1e87d41d23b33de0f9e3f93fdd74dcc0f0839f40 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Apr 2020 01:55:27 +0800 Subject: [PATCH 0119/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200403=20Sche?= =?UTF-8?q?duling=20tasks=20on=20Linux=20using=20the=20at=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200403 Scheduling tasks on Linux using the at command.md --- ...ing tasks on Linux using the at command.md | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 sources/tech/20200403 Scheduling tasks on Linux using the at command.md diff --git a/sources/tech/20200403 Scheduling tasks on Linux using the at command.md b/sources/tech/20200403 Scheduling tasks on Linux using the at command.md new file mode 100644 index 0000000000..090ae1620a --- /dev/null +++ b/sources/tech/20200403 Scheduling tasks on Linux using the at command.md @@ -0,0 +1,162 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Scheduling tasks on Linux using the at command) +[#]: via: (https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-using-the-at-command.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Scheduling tasks on Linux using the at command +====== +The at command makes it easy to schedule Linux tasks to be run at any time or date you choose. Check out what it can do for you. +romkaz / Getty Images + +When you want commands or scripts to run at some particular time, you don’t have to sit with your fingers hovering over the keyboard waiting to press the enter key or even be at your desk at the right time. Instead, you can set your task to be run through the **at** command. In this post, we’ll look at how tasks are scheduled using **at**, how you can precisely select the time you want your process to run and how to view what’s been scheduled to run using **at**. + +### at vs cron + +For those who’ve been scheduling tasks on Linux systems using **cron**, the **at** command is something like **cron** in that you can schedule tasks to run at a selected time, but **cron** is used for jobs that are run periodically – even if that means only once a year. Most **cron** jobs are set up to be run daily, weekly or monthly, though you control how often and when. + +The **at** command, on the other hand, is used for tasks which are run only once. Want to reboot your system at midnight tonight? No problem, **at** can do that for you assuming you have the proper permissions. If you want the system rebooted every Saturday night at 2 a.m., use **cron** instead. + +### Using at + +The **at** command is easy to use ,and there are only a few things to remember. A simple use of **at** might look like this: + +``` +$ at 5:00PM +at> date >> thisfile +at> +``` + +After typing “at” and the time the command should be run, **at** prompts you for the command to be run (in this case, the **date** command). Type **^D** to complete your request. + +Assuming we set up this **at** command earlier than 5 p.m., the date and time will be added to the end of a file named “thisfile” later the same day. Otherwise, the command will run at 5 p.m. the following day. + +You can enter more than one command when interacting with the **at** command. If you want more than one command to be run at the same time, simply specify more than one command line: + +[][1] + +``` +$ at 6:22 +warning: commands will be executed using /bin/sh +at> echo first >> thisfile +at> echo second >> thisfile +at> +``` + +In the commands above, we’re using a regular user account and adding some simple text to a file in that user’s home directory. If it’s after 6:22 a.m. when this command is run, the command will run the following day because 6:22 is taken to mean 6:22 a.m. If you want it to run at 6:22 p.m., either use 6:22 PM or 18:22. “6:22 PM” also works. + +You can use **at** to schedule commands to run on specific dates either by specifying the dates or specifying dates and times like “10:00AM April 15 2021” or “noon + 5 days” (run at noon five days from today). Here are some examples: + +``` +at 6PM tomorrow +at noon April 15 2021 +at noon + 5 days +at 9:15 + 1000 days +``` + +After you specify the command to run and press **^D**, you will notice that the **at** command has assigned a job number to each request. This number will show up in the **at** command's job queue. + +``` +$ at noon + 1000 days +warning: commands will be executed using /bin/sh +at> date >> thisfile +at> +job 36 at Tue Dec 27 12:00:00 2022 <== job # is 36 +``` + +### Checking the queue + +You can look at the queue of **at** jobs with the **atq** (at queue) command: + +``` +$ atq +32 Thu Apr 2 03:06:00 2020 a shs +35 Mon Apr 6 12:00:00 2020 a shs +36 Tue Dec 27 12:00:00 2022 a shs +34 Thu Apr 2 18:00:00 2020 a shs +``` + +If you need to cancel one of the jobs in the queue, use the **atrm** (at remove) command along with the job number. + +``` +$ atrm 32 +$ atq +35 Mon Apr 6 12:00:00 2020 a shs +36 Tue Dec 27 12:00:00 2022 a shs +34 Thu Apr 2 18:00:00 2020 a shs +``` + +You can look into the details of a scheduled task using the **at -c** command. Additional details (the active search path, etc.) are also available, but the bottom lines of the output will show you what command has been scheduled to run. + +``` +$ at -c 36 | tail -6 +cd /home/shs || { + echo 'Execution directory inaccessible' >&2 + exit 1 +} +date >> thisfile +``` + +Notice that the command shown begins with testing whether the user’s directory can be entered with a **cd** command. The job will exit with an error if this is not the case. Otherwise the command specified when the **at** command was issued will be run. Read the command as "move into /home/shs OR exit with the error shown". + +### Running jobs as root + +To run **at** jobs as root, simply use **sudo** with your **at** command like this: + +``` +$ sudo at 8PM +[sudo] password for shs: +warning: commands will be executed using /bin/sh +at> reboot now +at> +job 37 at Wed Apr 1 16:00:00 2020 +``` + +Notice that the root task shows up in the queue with **root** as the one to execute it. + +``` +35 Mon Apr 6 12:00:00 2020 a shs +36 Tue Dec 27 12:00:00 2022 a shs +37 Wed Apr 1 20:00:00 2020 a root <== +``` + +### Running scripts + +You can also use the **at** command to run scripts. Here's an example: + +``` +$ at 4:30PM +warning: commands will be executed using /bin/sh +at> bin/tryme +at> +``` + +### Denying use of the at command + +The **/etc/at.deny** file provides a way to disallow users from being able to make use of the **at** command. By default, it will probably include a list of disallowed accounts like **ftp** and **nobody**. An **/etc/at.allow** file could be used to do the opposite but, generally, only the **at.deny** file is configured. + +**Wrap-Up** + +The **at** command is very versatile and easy to use when you want to schedule a one-time task – even if you want it to run this afternoon or years in the future. + +Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-using-the-at-command.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[2]: https://www.facebook.com/NetworkWorld/ +[3]: https://www.linkedin.com/company/network-world From 224d59ceac3b51571f22f3a28c41dadd67613ba5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Apr 2020 11:29:57 +0800 Subject: [PATCH 0120/1809] PRF @geekpi --- translated/tech/20190605 What is GraphQL.md | 84 ++++++++++----------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/translated/tech/20190605 What is GraphQL.md b/translated/tech/20190605 What is GraphQL.md index 0f005efd40..ab1765d855 100644 --- a/translated/tech/20190605 What is GraphQL.md +++ b/translated/tech/20190605 What is GraphQL.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What is GraphQL?) @@ -9,100 +9,98 @@ 什么是 GraphQL? ====== -GraphQL 是一种查询语言、执行引擎和规范,它让开发人员重新思考如何构建客户端和 API - 应用。 -![Analytics: Charts and Graphs][1] -GraphQL 是当今软件技术中最大的流行语之一。但它_实际上_是什么?它是像 [SQL][2] 这样的查询语言吗?像 [JVM][3] 这样的执行引擎?像 [XML][4] 这样的规范? +> GraphQL 是一种查询语言、一个执行引擎,也是一种规范,它让开发人员重新思考如何构建客户端和 API 应用。 -如果你的回答是上面这些,那么你是对的![GraphQL][5] 是查询语言语法、编程语言无关的执行引擎和不断发展的规范。 +![](https://img.linux.net.cn/data/attachment/album/202004/04/112938odz6sbw6hzwsh7f6.jpg) -让我们深入了解 GraphQL 如何成为这些,并了解人们为什么对此感到兴奋。 +GraphQL 是当今软件技术中最大的流行语之一。但它*究竟*是什么?是像 [SQL][2] 一样的查询语言吗?是像 [JVM][3] 这样的执行引擎?还是像 [XML][4] 这样的规范? + +如果你回答上面这些都是,那么你是对的![GraphQL][5] 是一种查询语言的语法、是一种编程语言无关的执行引擎,也是一种不断发展的规范。 + +让我们深入了解一下 GraphQL 如何成为所有这些东西的,并了解一下人们为什么对它感到兴奋。 ### 查询语言 -GraphQL 作为查询语言似乎是合理的—”QL“ 似乎足够重要,毕竟它出现在名称中。但是我们在查询什么?查看示例查询请求和相应的响应可能会有所帮助。 +GraphQL 作为查询语言似乎是合理的 —— 毕竟 “QL” 似乎重要到出现在名称中。但是我们查询什么呢?看一个示例查询请求和相应的响应可能会有所帮助。 以下的用户查询: - ``` { - user(id: 4) { -   name -   email -   phoneNumber - } + user(id: 4) { +    name +    email +    phoneNumber +  } } ``` 可能会返回下面的 JSON 结果: - ``` { - "user": { -   "name": "Zach Lendon" -   “email”: “[zach@hydrate.io][6]” -   “phoneNumber”: “867-5309” - } +  "user": { +    "name": "Zach Lendon" +    “email”: “zach@hydrate.io” +    “phoneNumber”: “867-5309” +  } } ``` -想象一下,客户端应用查询用户详细信息,获取结果,并使用它填充配置文件。作为查询语言,GraphQL 的核心优势之一是客户端应用可以_只请求它需要_的数据,并期望以一致的方式返回这些数据。 +想象一下,客户端应用查询用户详细信息、获取结果,并使用它填充配置屏幕。作为查询语言,GraphQL 的核心优势之一是客户端应用可以*只请求它需要*的数据,并期望以一致的方式返回这些数据。 -那么_什么_返回了 GraphQL 响应?这就是执行引擎(通常以 GraphQL 服务器的形式)发挥作用的地方。 +那么 GraphQL 响应返回的*什么*呢?这就是执行引擎发挥的作用,通常是以 GraphQL 服务器的形式出现。 ### 执行引擎 ![GraphQL execution engine][7] -GraphQL 执行引擎负责处理 GraphQL 查询并返回 JSON 响应。所有 GraphQL 服务器由两个核心组件组成,分别定义了执行引擎的结构和行为:schema 和解析器。 - -GraphQL schema 是一种自定义类型语言,它公开哪些查询既允许(有效),又由 GraphQL 服务器实现处理。上面用户示例查询的 schema 可能如下所示: +GraphQL 执行引擎负责处理 GraphQL 查询并返回 JSON 响应。所有 GraphQL 服务器由两个核心组件组成,分别定义了执行引擎的结构和行为:模式和解析器。 +GraphQL 模式是一种自定义类型语言,它公开哪些查询既允许(有效),又由 GraphQL 服务器实现处理。上面用户示例查询的模式可能如下所示: ``` type User { -        name: String -        email: String -        phoneNumber: String + name: String +    email: String +    phoneNumber: String } type Query { -        user: User +    user: User } ``` -此 schema 定义返回用户的用户查询。客户端可以通过用户查询请求用户上的任何字段,并且 GraphQL 服务器将仅返回请求的字段。通过使用强类型架构,GraphQL 服务器可以验证传入查询,以确保它们基于定义的 schema 有效。 +此模式定义了一个返回用户的用户查询。客户端可以通过用户查询请求用户上的任何字段,并且 GraphQL 服务器将仅返回请求的字段。通过使用强类型模式,GraphQL 服务器可以根据定义的模式验证传入的查询,以确保是有效的。 -确定查询有效后,它由 GraphQL 服务器的解析器处理。解析器函数支持每个 GraphQL 类型的每个字段。用户查询的示例解析器可能如下所示: +确定查询有效后,就会由 GraphQL 服务器的解析器处理。解析器函数支持每个 GraphQL 类型的每个字段。我们的这个用户查询的示例解析器可能如下所示: ``` Query: { -  user(obj, args, context, info) { -    return context.db.loadUserById(args.id).then( -      userData => new User(userData) -    ) -  } + user(obj, args, context, info) { + return context.db.loadUserById(args.id).then( + userData => new User(userData) + ) + } } ``` -虽然上面的例子是 JavaScript,但 GraphQL 服务器可以用任意语言编写。这是因为 GraphQL 也是_也是_一种规范! +虽然上面的例子是用 JavaScript 编写的,但 GraphQL 服务器可以用任意语言编写。这是因为 GraphQL 也是*也是*一种规范! ### 规范 -GraphQL 规范定义了 GraphQL 实现必须遵循的功能和特性。作为开放网络基金会最终规范协议([OWFa 1.0][8])所提供的开放规范,技术社区可以借此机会查看 GraphQL 实现必须符合规范的要求,并帮助制定 GraphQL 的未来。 +GraphQL 规范定义了 GraphQL 实现必须遵循的功能和特性。作为一个在开放网络基金会的最终规范协议([OWFa 1.0][8])下提供的开放规范,技术社区可以审查 GraphQL 实现必须符合规范的要求,并帮助制定 GraphQL 的未来。 -虽然该规范对 GraphQL 的语法,什么是有效查询以及 schema 进行了非常具体的说明,但它没有提供有关如何存储数据或 GraphQL 服务器应使用哪种编程语言实现的指导。这在软件领域是非常强大且相对独特。它允许以多种编程语言创建 GraphQL 服务器,并且由于它们符合规范,因此客户端将确切知道它们的工作方式。GraphQL 服务器已经有多种语言实现,人们不仅可以期望像 JavaScript、Java和 C# 这样的语言,还可以使用Go、Elixir 和 Haskell 等。服务器实现所使用的语言不会成为采用过程的障碍。它不仅存在多种语言实现,而且它们都是开源的。如果没有你选择的语言的实现,那么可以自己实现。 +虽然该规范对 GraphQL 的语法,什么是有效查询以及模式的工作方式进行了非常具体的说明,但它没有提供有关如何存储数据或 GraphQL 服务器应使用哪种编程语言实现的指导。这在软件领域是非常强大的,也是相对独特的。它允许以各种编程语言创建 GraphQL 服务器,并且由于它们符合规范,因此客户端会确切知道它们的工作方式。GraphQL 服务器已经有多种语言实现,人们不仅可以期望像 JavaScript、Java和 C# 这样的语言,还可以使用 Go、Elixir 和 Haskell 等。服务器实现所使用的语言不会成为采用过程的障碍。它不仅存在多种语言实现,而且它们都是开源的。如果没有你选择的语言的实现,那么可以自己实现。 ### 总结 -GraphQL 是开源 API 领域中一个令人兴奋的,相对较新的参与者。它将查询语言和执行引擎与开源规范结合在一起,它定义了 GraphQL 实现的功能。 +GraphQL 是开源 API 领域中一个令人兴奋的、相对较新的参与者。它将查询语言、执行引擎与开源规范结合在一起,它定义了 GraphQL 实现的外观和功能。 -GraphQL 已经开始改变公司对构建客户端和 API 应用的看法。通过将 GraphQL 作为技术栈的一部分,前端开发人员可以自由查询所需的数据,而后端开发人员可以将客户端应用需求与后端系统架构分离。通常,公司首先通过在其现有后端服务之上构建一个 GraphQL API “层”来使用 GraphQL。这使客户端应用开始获得寻求的性能和运营效率,同时使后端团队有机会在 GraphQL 层后面进行所需的“幕后”更改(如果有)。通常,这些更改将针对优化,这些优化将帮助确保使用 GraphQL 的应用可以尽可能高效地运行。由于 GraphQL 提供了抽象,因此系统团队可以进行更改的同时继续在其 GraphQL API 级别上遵守 GraphQL 的“合约”。 +GraphQL 已经开始改变企业对构建客户端和 API 应用的看法。通过将 GraphQL 作为技术栈的一部分,前端开发人员可以自由地查询所需的数据,而后端开发人员可以将客户端应用需求与后端系统架构分离。通常,公司在使用 GraphQL 的过程中,首先会在其现有的后端服务之上构建一个 GraphQL API “层”。这使得客户端应用开始获得他们所追求的性能和运营效率,同时使后端团队有机会确定他们可能需要在 GraphQL 层后面的“幕后”进行哪些更改。通常,这些更改都是为了优化,这些优化有助于确保使用 GraphQL 的应用可以尽可能高效地运行。由于 GraphQL 提供了抽象性,因此系统团队可以进行更改的同时继续在其 GraphQL API 级别上遵守 GraphQL 的“合约”。 -由于 GraphQL 相对较新,因此开发人员仍在寻找新颖而激动人心的方法来利用它构建更好的软件解决方案。GraphQL 将如何改变你构建应用的方式,它不会辜负宣传吗?只有一种方法可以找到答案。去使用 GraphQL 构建一些东西! +由于 GraphQL 相对较新,因此开发人员仍在寻找新颖而激动人心的方法来利用它构建更好的软件解决方案。GraphQL 将如何改变你构建应用的方式,它是否对得起众望所归?只有一种方法可以找到答案 —— 用 GraphQL 构建一些东西! -------------------------------------------------------------------------------- @@ -111,7 +109,7 @@ via: https://opensource.com/article/19/6/what-is-graphql 作者:[Zach Lendon][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d40a9d8a07439573ea70545ff9694c1ba14d4a7f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Apr 2020 11:31:08 +0800 Subject: [PATCH 0121/1809] PUB @geekpi https://linux.cn/article-12070-1.html --- {translated/tech => published}/20190605 What is GraphQL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190605 What is GraphQL.md (98%) diff --git a/translated/tech/20190605 What is GraphQL.md b/published/20190605 What is GraphQL.md similarity index 98% rename from translated/tech/20190605 What is GraphQL.md rename to published/20190605 What is GraphQL.md index ab1765d855..49d68894b1 100644 --- a/translated/tech/20190605 What is GraphQL.md +++ b/published/20190605 What is GraphQL.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12070-1.html) [#]: subject: (What is GraphQL?) [#]: via: (https://opensource.com/article/19/6/what-is-graphql) [#]: author: (Zach Lendon https://opensource.com/users/zachlendon) From b2776636478a7cd18cfd7a946505c9e291bfced9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 Apr 2020 12:15:44 +0800 Subject: [PATCH 0122/1809] Rename sources/tech/20200402 Ansible streaming video series, open source security tools, and more industry trends.md to sources/news/20200402 Ansible streaming video series, open source security tools, and more industry trends.md --- ...eries, open source security tools, and more industry trends.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200402 Ansible streaming video series, open source security tools, and more industry trends.md (100%) diff --git a/sources/tech/20200402 Ansible streaming video series, open source security tools, and more industry trends.md b/sources/news/20200402 Ansible streaming video series, open source security tools, and more industry trends.md similarity index 100% rename from sources/tech/20200402 Ansible streaming video series, open source security tools, and more industry trends.md rename to sources/news/20200402 Ansible streaming video series, open source security tools, and more industry trends.md From 3cbb48102c35bdc9f5e9ad879c2b69e3a25c874f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 Apr 2020 12:20:41 +0800 Subject: [PATCH 0123/1809] Rename sources/tech/20200402 When debugging, your attitude matters.md to sources/talk/20200402 When debugging, your attitude matters.md --- .../20200402 When debugging, your attitude matters.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200402 When debugging, your attitude matters.md (100%) diff --git a/sources/tech/20200402 When debugging, your attitude matters.md b/sources/talk/20200402 When debugging, your attitude matters.md similarity index 100% rename from sources/tech/20200402 When debugging, your attitude matters.md rename to sources/talk/20200402 When debugging, your attitude matters.md From 66d9dd378df0b0ff325d6b9257deb195d75cc0d5 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sat, 4 Apr 2020 14:29:18 +0800 Subject: [PATCH 0124/1809] translating --- ...e Keyring Concept in Ubuntu- What is It and How to Use it.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md index e5eec51802..7026431f0c 100644 --- a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md +++ b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (messon007) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a8eae33d071123e1815676245bf9351fade102f9 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sat, 4 Apr 2020 14:34:58 +0800 Subject: [PATCH 0125/1809] translating --- .../20190814 9 open source cloud native projects to consider.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190814 9 open source cloud native projects to consider.md b/sources/tech/20190814 9 open source cloud native projects to consider.md index 8f95262799..b3d31fc7af 100644 --- a/sources/tech/20190814 9 open source cloud native projects to consider.md +++ b/sources/tech/20190814 9 open source cloud native projects to consider.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (messon007) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9c6ea9e1222cbf7e4c1493cab3ed585e73bde706 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sat, 4 Apr 2020 14:53:06 +0800 Subject: [PATCH 0126/1809] translating --- .../20200313 What is the internet backbone and how it works.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20200313 What is the internet backbone and how it works.md b/sources/talk/20200313 What is the internet backbone and how it works.md index 7a163fce7f..8393026255 100644 --- a/sources/talk/20200313 What is the internet backbone and how it works.md +++ b/sources/talk/20200313 What is the internet backbone and how it works.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (messon007) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ef4a6d01af1874f70c9351b4008b58d31daf50f7 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sat, 4 Apr 2020 14:57:36 +0800 Subject: [PATCH 0127/1809] translating --- ...e ins and outs of high-performance computing as a service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md index cbf7a5a44f..0b0a1ac39b 100644 --- a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md +++ b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (messon007) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From be5797405993ae262c733421ae4f671ebc6b0ee7 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 4 Apr 2020 23:43:12 +0800 Subject: [PATCH 0128/1809] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20200325 Linux firewall basics with ufw.md | 72 +++++++------------ 1 file changed, 27 insertions(+), 45 deletions(-) rename {sources => translated}/tech/20200325 Linux firewall basics with ufw.md (56%) diff --git a/sources/tech/20200325 Linux firewall basics with ufw.md b/translated/tech/20200325 Linux firewall basics with ufw.md similarity index 56% rename from sources/tech/20200325 Linux firewall basics with ufw.md rename to translated/tech/20200325 Linux firewall basics with ufw.md index c81af35c1e..e281821b70 100644 --- a/sources/tech/20200325 Linux firewall basics with ufw.md +++ b/translated/tech/20200325 Linux firewall basics with ufw.md @@ -7,24 +7,17 @@ [#]: via: (https://www.networkworld.com/article/3533551/linux-firewall-basics-with-ufw.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -Linux firewall basics with ufw Linux 防火墙 ufw 简介 ====== -We take a look at ufw - the uncomplicated firewall - on Linux, providing some insights and commands for making changes. -Vertigo3D / Getty Images -我们来看看 ufw - linux 上一个简单的防火墙,它提供了一些见解和进行更改的命令。 +我们来研究下 ufw - linux 上一个简单的防火墙,它为防火墙更改提供了一些见解和命令。 -The **ufw** (uncomplicated firewall) represents a serious simplification to [iptables][1] and, in the years that it’s been available, has become the default firewall on systems such as Ubuntu and Debian. And, yes, **ufw** is surprisingly uncomplicated – a boon for newer admins who might otherwise have to invest a lot of time to get up to speed on firewall management. -**ufw** 可以说是 [iptables][1] 的简化版,在未来几年,它已经成为 Ubuntu 和 Debian 等系统上的默认防火墙。而且它并不复杂,这对新管理员来说是一个福音,否则他们可能不得不投入大量时间来加快防火墙管理的速度。 +![][0] -GUIs are available for **ufw** (like **gufw**), but **ufw** commands are generally issued on the command line. This post examines some commands for using **ufw** and looks into how it works. -**ufw** 也有 GUI(例如 **gufw**),但是 **ufw** 命令通常在命令行上发布。这篇文章检查了一些使用 **ufw** 的命令,并研究了它的工作方式。 - -First, one quick way to see how **ufw** is configured is to look at its configuration file – **/etc/default/ufw**. In the command below, we display the settings, using **grep** to suppress the display of both blank lines and comments (line starting with #). -首先,查看 **ufw** 配置方式的一种快速方法是查看其配置文件 **/etc/default/ufw**。在下面的命令中,我们显示设置,使用 **grep** 禁止显示空白行和注释(以 # 开头的行), - -[RELATED: Linux hardening: a 15-step checklist for a secure Linux server][2] +**ufw** (简易防火墙)可以说是 [iptables][1] 的简化版,最近几年,它已经成为 Ubuntu 和 Debian 等系统上的默认防火墙。而且 **ufw** 出乎意料的简单,这对新管理员来说是一个福音,否则他们可能不得不投入大量时间来加快防火墙管理的速度。 +**ufw** 也有 GUI 客户端(例如 **gufw**),但是 **ufw** 命令通常在命令行上发出。本文介绍了一些使用 **ufw** 的命令,并研究了它的工作方式。 + +首先,查看 **ufw** 如何配置的一个快速方法是查看其配置文件 -- **/etc/default/ufw**。使用下面的命令可以查看其配置,使用 **grep** 来禁止显示空白行和注释(以 # 开头的行)。 ``` $ grep -v '^#\|^$' /etc/default/ufw IPV6=yes @@ -37,22 +30,16 @@ IPT_SYSCTL=/etc/ufw/sysctl.conf IPT_MODULES="nf_conntrack_ftp nf_nat_ftp nf_conntrack_netbios_ns" ``` -As you can see, the default policy is to drop input and allow output. Additional rules that allow the connections that you specifically want to be accept are configured separately. -正如你所看到的,默认策略是删除输入并允许输入。允许你专门接受的连接的其它规则是单独配置的。 - -The basic syntax for ufw commands might look like thee below, though this synopsis is not meant to imply that typing only “ufw” will get you further than a quick error telling you that arguments are required. -ufw 命令的基本语法如下所示,尽管该提要并不意味着仅输入 ufw 将使你走的更远,而不是一个快速的错误提示你需要参数。 +正如你所看到的,默认策略是丢弃输入但允许输出。如果你想接受专有连接,你需要单独配置。 +ufw 命令的基本语法如下所示,但是这个概要并不意味着你只需要输入 "ufw" 就能熟悉它,而是通过一个个错误提示来告诉你需要哪些参数。 ``` ufw [--dry-run] [options] [rule syntax] ``` -The **\--dry-run** option means that **ufw** won’t run the command you specify, but will show you the results that you would see if it did. It will, however, display the entire set of rules as they would exist if the change were made, so be prepared for more than a few lines of output. - -To check the status of **ufw**, run a command like the following. Note that even this command requires use of **sudo** or use of the root account. - -[][3] +**\--dry-run** 选项意味着 **ufw** 不会运行你指定的命令,但你会看到它是否执行了的结果。如果进行了更改,它将显示整个规则集,因此你要做好多行输出的准备。 +运行以下命令来检查 **ufw** 的状态。注意,即使此命令也需要使用 **sudo** 或 root 账户。 ``` $ sudo ufw status Status: active @@ -64,15 +51,13 @@ To Action From 9090 (v6) ALLOW Anywhere (v6) ``` -Otherwise, you will see something like this: - +否则,你会看到以下内容: ``` $ ufw status ERROR: You need to be root to run this script ``` -Adding "verbose" provides a few additional details: - +"verbose" 选项将提供一些其它细节: ``` $ sudo ufw status verbose Status: active @@ -87,15 +72,13 @@ To Action From 9090 (v6) ALLOW IN Anywhere (v6) ``` -You can easily allow and deny connections by port number with commands like these: - +你可以使用以下命令轻松地通过端口号允许和拒绝连接: ``` -$ sudo ufw allow 80 <== allow http access -$ sudo ufw deny 25 <== deny smtp access +$ sudo ufw allow 80 <== 允许 http 访问 +$ sudo ufw deny 25 <== 拒绝 smtp 访问 ``` -You can check out the **/etc/services** file to find the connections between port numbers and service names. - +你可以查看 **/etc/services** 文件来找到端口号和服务名称之间的联系。 ``` $ grep 80/ /etc/services http 80/tcp www # WorldWideWeb HTTP @@ -108,7 +91,7 @@ amanda 10080/udp canna 5680/tcp # cannaserver ``` -Alternately, you can use service names like in these commands. +或者,你可以命令中直接使用服务的名称。 ``` $ sudo ufw allow http @@ -119,7 +102,7 @@ Rule added Rule added (v6) ``` -After making changes, you should check the status again to see that those changes have been made: +进行更改后,你应该再次检查状态来查看是否生效: ``` $ sudo ufw status @@ -136,7 +119,7 @@ To Action From 443/tcp (v6) ALLOW Anywhere (v6) <== ``` -The rules that **ufw** follows are stored in the **/etc/ufw** directory. Note that you need root access to view these files and that each contains a large number of rules. +**ufw** 遵循的规则存储在 **/etc/ufw** 目录中,注意,你需要 root 用户访问权限才能查看这些文件,每个文件都包含大量规则。 ``` $ ls -ltr /etc/ufw @@ -154,8 +137,7 @@ drwxr-xr-x 3 root root 4096 Nov 12 08:21 applications.d -rw-r----- 1 root root 1530 Mar 19 10:42 user6.rules ``` -The changes made earlier in this post (the addition of port **80** for **http** access and **443** for **https** (encrypted http) access will look like this in the **user.rules** and **user6.rules** files: - +本文前面所作的更改,为 **http** 访问添加了端口 **80** 和为 **https** 访问添加了端口 **443**,在 **user.rules** 和 **user6.rules** 文件中看起来像这样: ``` # grep " 80 " user*.rules user6.rules:### tuple ### allow tcp 80 ::/0 any ::/0 in @@ -170,15 +152,13 @@ user.rules:### tuple ### allow tcp 443 0.0.0.0/0 any 0.0.0.0/0 in user.rules:-A ufw-user-input -p tcp --dport 443 -j ACCEPT ``` -With **ufw**, you can also easily block connections from a system using a command like this: - +使用 **ufw**,你还可以使用以下命令轻松地阻止来自一个系统的连接: ``` $ sudo ufw deny from 208.176.0.50 Rule added ``` -The status command will show the change: - +status 命令将显示更改: ``` $ sudo ufw status verbose Status: active @@ -198,9 +178,9 @@ Anywhere DENY IN 208.176.0.50 <== new 443/tcp (v6) ALLOW IN Anywhere (v6) ``` -All in all, **ufw** is both easy to configure and easy to understand. +总而言之,**ufw** 不仅容易配置,而且且容易理解。 -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. +加入 [Facebook][4] 和 [LinkedIn][5] 上的网络世界社区,评论最火的主题。 -------------------------------------------------------------------------------- @@ -208,13 +188,15 @@ via: https://www.networkworld.com/article/3533551/linux-firewall-basics-with-ufw 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[MjSeven](https://github.com/MjSeven) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + [a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ [b]: https://github.com/lujun9972 +[0]: https://images.idgesg.net/images/article/2019/06/cso_network_security_encryption_automation_by_vertigo3d_gettyimages-597931354_2400x1600-100798880-large.jpg [1]: https://www.networkworld.com/article/2716098/working-with-iptables.html [2]: https://www.networkworld.com/article/3143050/linux/linux-hardening-a-15-step-checklist-for-a-secure-linux-server.html#tk.nww-fsb [3]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) From f1427aaf25a5e5c987d6199b1df5c61a5c23fd4e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Apr 2020 09:28:05 +0800 Subject: [PATCH 0129/1809] PRF @geekpi --- ...en source tools for sticking to a budget.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/translated/tech/20200326 3 open source tools for sticking to a budget.md b/translated/tech/20200326 3 open source tools for sticking to a budget.md index 99786659e5..b3c945464b 100644 --- a/translated/tech/20200326 3 open source tools for sticking to a budget.md +++ b/translated/tech/20200326 3 open source tools for sticking to a budget.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (3 open source tools for sticking to a budget) @@ -9,16 +9,18 @@ 3 个控制预算的开源工具 ====== -在这篇开源预算工具汇总中找到适合你的解决方案。另外学习有关开源税收准备软件。 -![A dollar sign in a network][1] -鉴于目前世界上许多国家/地区的经济形势都在变化,你可能会想修改或改善财务状况和你对它的了解。或者,也许你的新年决心之一是开始预算?你不是一个人。 +> 在这篇开源预算工具汇总中找到适合你的解决方案。另外学习有关开源的备税务软件。 + +![](https://img.linux.net.cn/data/attachment/album/202004/05/092735ni323vgji9sbigq9.jpg) + +鉴于目前世界上许多国家/地区的经济形势都在变化,你可能会想改造或改善财务状况和你对它的了解。或者,也许你的新年决心之一是开始预算?你并不孤单。 坚持该决心的最佳方法是定期跟踪你的支出和收入。问题是,许多流行的个人理财应用都是专有的。你是否正在寻找 Quicken、Mint 或 You Need a Budget 的开源替代方案?无论你是开源软件新手,还是预算新手,这些工具之一都将满足你的需求和舒适度。 ### LibreOffice Calc -我建议希望做预算的任何开源新手使用 LibreOffice Calc。如果你使用过 Google Sheets 或 Microsoft Excel 等专有电子表格,那么 LibreOffice Calc 模板将非常熟悉。在此[预算教程][2]中,作者 Jess Weichler 已经为你提供了方便、可下载的模板。该模板已经有费用类别,例如水电费、杂货、外出就餐等,但是你可以自由地根据自己的生活方式对其进行自定义。在第二篇文章中,她向你展示了如何[创建自己的模板][3]。 +我向希望做预算的任何开源新手推荐使用 LibreOffice Calc。如果你使用过 Google Sheets 或 Microsoft Excel 等专有电子表格,那么 LibreOffice Calc 模板将非常熟悉。在此[预算教程][2]中,作者 Jess Weichler 已经为你提供了方便、可下载的模板。该模板已经有费用类别,例如水电费、杂货、外出就餐等,但是你可以自由地根据自己的生活方式对其进行自定义。在第二篇文章中,她向你展示了如何[创建自己的模板][3]。 ### HomeBank @@ -28,9 +30,9 @@ 就像这里提到的其他预算工具一样,GnuCash 可以在 Windows、macOS 和 Linux 上使用。它提供了大量文档,但 Don Watkins 会在[此教程][5]中指导你在 Linux 上设置 GnuCash。GnuCash 不仅是控制个人财务的绝佳选择,而且还有开发票等功能来帮助你管理小型企业。 -### 额外一个:OpenTaxSolver +### 赠品:OpenTaxSolver -对许多美国人来说,可怕的税收季可能是一个压力大的时期。许多人购买 TurboTax 或请会计师或税务服务来缴税。与普遍的看法相反,存在开源的税务准备软件!作者 Jessica Cherry 在[本文][6]中做了研究,并向读者介绍 OpenTaxSolver。要正确使用 OpenTaxSolver,你需要特别注意细节,但是你不必担心进行复杂的数学运算。 +对许多美国人来说,可怕的税收季可能是一个压力很大的时期。许多人购买 TurboTax 或请会计师或税务服务来缴税。与普遍的看法相反,开源的备税务软件是存在的!作者 Jessica Cherry 在[本文][6]中做了研究,并向读者介绍 OpenTaxSolver。要正确使用 OpenTaxSolver,你需要特别注意细节,但是你不必担心进行复杂的数学运算。 你会尝试使用哪个开源预算应用?你是否有我在此列表中未提及的最喜欢的工具?请在评论区分享你的观点。 @@ -41,7 +43,7 @@ via: https://opensource.com/article/20/3/open-source-budget 作者:[Lauren Pritchett][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d92dec7e31f33bfc8995a473bf0be44bbb010327 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Apr 2020 09:28:36 +0800 Subject: [PATCH 0130/1809] PUB @geekpi https://linux.cn/article-12072-1.html --- .../20200326 3 open source tools for sticking to a budget.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200326 3 open source tools for sticking to a budget.md (98%) diff --git a/translated/tech/20200326 3 open source tools for sticking to a budget.md b/published/20200326 3 open source tools for sticking to a budget.md similarity index 98% rename from translated/tech/20200326 3 open source tools for sticking to a budget.md rename to published/20200326 3 open source tools for sticking to a budget.md index b3c945464b..8504fec779 100644 --- a/translated/tech/20200326 3 open source tools for sticking to a budget.md +++ b/published/20200326 3 open source tools for sticking to a budget.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12072-1.html) [#]: subject: (3 open source tools for sticking to a budget) [#]: via: (https://opensource.com/article/20/3/open-source-budget) [#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) From 32b04c1659a6509fb26f4c7273b75f692320f90c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Apr 2020 10:08:31 +0800 Subject: [PATCH 0131/1809] PRF @robsean --- ...ype Fonts on Ubuntu-based Distributions.md | 46 ++++++++----------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/translated/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md b/translated/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md index f94e89c807..889bab7f26 100644 --- a/translated/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md +++ b/translated/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md @@ -1,16 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to install Microsoft TrueType Fonts on Ubuntu-based Distributions) [#]: via: (https://itsfoss.com/install-microsoft-fonts-ubuntu/) -[#]: author: (Community https://itsfoss.com/author/itsfoss/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/itsfoss/) 如何在基于 Ubuntu 的发行版上安装微软 TrueType 字体 ====== -如果你在 Linux 上打开一些微软文档,你将注意到字体会看起来有一点不同。你也将注意到你不能找到一些常见的字体,像 [Times New Roman][1], Arial 等等。 +如果你在 Linux 上用 LibreOffice 打开一些微软文档,你会发现字体看起来有一点不同。你也将注意到有些常用字体找不到,如 [Times New Roman][1]、Arial 等等。 不用担心。我将向你展示如何在 Ubuntu 上和其它基于 Ubuntu 的 Linux 发行版上安装这些字体。但是在此之前,让我告诉你为什么这些字体没有被默认安装。 @@ -18,21 +18,21 @@ ![][2] -Times New Roman, Arial 和其它此类字体归微软所有,并且这些字体不是开源的。很多 Linux 发行版默认不提供专有软件来避免许可证问题。 +Times New Roman、Arial 等字体都是微软的,并且这些字体不是开源的。很多 Linux 发行版默认不提供专有软件,以避免授权问题。 -这就是为什么在默认情况下 Ubuntu 和其它 Linux 发行版使用开源字体 “Liberation fonts” 来替代微软字体的原因。[Red Hat][4] 创建 [Liberation Fonts][3]来代替 Arial, Arial Narrow, Times New Roman 和 Courier New ,如同这些字体的宽度一样。当你打开一个使用 Times New Roman 字体的文档时, 对应的 Liberation Font 将被用来保持文档文字间间隔等距连续。 +这就是为什么在默认情况下 Ubuntu 和其它 Linux 发行版使用开源字体 “Liberation” 字体来替代微软字体的原因。[Red Hat][4] 创建 [Liberation 字体][3] 来代替 Arial、Arial Narrow、 Times New Roman 和 Courier New,因为这些字体的宽度一样。当你打开一个使用 Times New Roman 字体书写的文档时,会使用对应的 Liberation 字体来保持文档不被破坏。 -不过,Liberation fonts 与微软的字体并不是完全相同的,在一些情况下,你可能需要使用 Arial 或 Times New Roman 。一个非常常见的情况是,在学校,大学和其他公共和私人组织中,微软的字体是唯一的选择。他们要求你使用微软字体中的其中一种字体来提交文档。 +不过,Liberation 字体与微软的字体并不是完全相同的,在一些情况下,你可能需要使用 Arial 或 Times New Roman。一个非常常见的情况是,在学校、大学和其他公共或私人机构中,微软的字体是唯一的选择。他们要求你使用这些字体之一来提交文档。 -你可以在 Ubuntu 和其它发行版上很容易地安装微软字体的一件很好的事。以这种方式,你将增强 LibreOffice 的兼容性,并将有选择开源办公软件的自由。 +好在,你可以在 Ubuntu 和其它发行版上很容易地安装微软字体。以这种方式,你将增强 LibreOffice 的兼容性,并可以自由选择开源办公软件。 ### 在基于 Ubuntu 的 Linux 发行版上安装微软字体 -你可以自己下载字体,并 [在 Ubuntu 中安装新的字体][5] 。但是自从微软字体变得非常流行(并且免费提供),Ubuntu 提供了一种简单的方法来安装它们。 +你可以自行下载字体,并[在 Ubuntu 中安装新的字体][5]。但是由于微软字体非常受欢迎(并且是免费提供的),所以 Ubuntu 提供了一种简单的方法来安装它们。 -要知道尽管微软已经免费发布了其核心字体,在其它操作系统中使用字体依然受到限制。在 Ubuntu 中安装微软字体前,你必须阅读并接受 EULA (最终用户许可协议) 。 +要知道尽管微软已经免费发布了其核心字体,在其它操作系统中使用该字体依然是受到限制的。在 Ubuntu 中安装微软字体前,你必须阅读并接受 EULA (最终用户许可协议) 。 -这些字体 [在 multiverse 存储库中可获得,首先要确保启用它][6] : +这些字体 [可在 multiverse 存储库中获得,首先要确保启用它][6]: ``` sudo add-apt-repository multiverse @@ -44,11 +44,11 @@ sudo add-apt-repository multiverse sudo apt update && sudo apt install ttf-mscorefonts-installer ``` -当微软的最终用户协议出现时,按 tab 键来选择 **OK** ,并按回车键。 +当微软的最终用户协议出现时,按 `tab` 键来选择 “OK” ,并按回车键。 ![按 tab 键来高亮选择][7] -单击 **Yes** 来接受微软的协议: +单击 “Yes” 来接受微软的协议: ![使用 tab 键来作出选择,并按回车键][8] @@ -64,7 +64,7 @@ sudo fc-cache -f -v ![][11] -如果意外地拒绝许可协议,你可以使用这个命令来重新安装安装程序: +如果意外地拒绝了许可协议,你可以使用这个命令来重新安装安装程序: ``` sudo apt install –reinstall ttf-mscorefonts-installer @@ -72,28 +72,20 @@ sudo apt install –reinstall ttf-mscorefonts-installer 微软的 TrueType 字体也可以通过 [Ubuntu Restricted Extras package][12] 获得,其包含用来播放 MP3 等文件的其它专有的多媒体编解码器。 -不要轻视专有字体。 +> 不要轻视专有字体。 +> +> 你可能认为字体有什么大不了的呢?毕竟,它只是一款字体,而不是软件的一个关键部分,对吧?但是你知道,这些年来 [Netflix 为其使用的专有字体支付了数百万美元][13]吗?最后,他们创建了自己的自定义字体,这为他们节省了一大笔钱。 -你可能认为字体有什么大不了的呢?毕竟,它只是一款字体,而不是软件的一个关键部分,对吧? -但是你知道,这些年来 [Netflix 为其使用的专有字体支付了数百万美元][13] 吗?最后,他们创建了自己的自定义字体,这为他们节省了一大笔钱。 - -我希望你发现这个快速教程是有用的。更多的创造性的教程已下线,请在下面留下你的评论,了解更多信息请订阅我们的社交媒体! - -![][14] - -### Dimitrios Savvopoulos - -Dimitrios 是一名机械工程师理学硕士,但是在内心深处是一名 Linux 狂热爱好者。他习惯于使用 Solus 操作系统,但好奇心驱使者他不断测试其它的发行版。 -挑战是他魅力的一部分,他的爱好是自5公里到马拉松的长距离比赛。 +希望这个快速教程有用。更多的生产力教程即将上线,请在下面留下你的评论,了解更多信息请订阅我们的社交媒体! -------------------------------------------------------------------------------- via: https://itsfoss.com/install-microsoft-fonts-ubuntu/ -作者:[Community][a] +作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 403d99e60058b8a11539e36c18a7700a5db38174 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Apr 2020 10:09:08 +0800 Subject: [PATCH 0132/1809] PUB @robsean https://linux.cn/article-12074-1.html --- ... Microsoft TrueType Fonts on Ubuntu-based Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md (98%) diff --git a/translated/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md b/published/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md similarity index 98% rename from translated/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md rename to published/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md index 889bab7f26..2300ffee80 100644 --- a/translated/tech/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md +++ b/published/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12074-1.html) [#]: subject: (How to install Microsoft TrueType Fonts on Ubuntu-based Distributions) [#]: via: (https://itsfoss.com/install-microsoft-fonts-ubuntu/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/itsfoss/) From 6a5951003a10eb7851130c22c40004e56de1e5d1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Apr 2020 10:58:32 +0800 Subject: [PATCH 0133/1809] PRF @wxy --- translated/tech/20190612 Why use GraphQL.md | 56 ++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/translated/tech/20190612 Why use GraphQL.md b/translated/tech/20190612 Why use GraphQL.md index e63f55622d..763d352cb2 100644 --- a/translated/tech/20190612 Why use GraphQL.md +++ b/translated/tech/20190612 Why use GraphQL.md @@ -1,76 +1,76 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Why use GraphQL?) [#]: via: (https://opensource.com/article/19/6/why-use-graphql) [#]: author: (Zach Lendon https://opensource.com/users/zachlendon/users/goncasousa/users/patrickhousley) -为什么使用 GraphQL? +为什么使用 GraphQL? ====== -> 这就是 GraphQL 在标准 REST API 技术上获得发展的原因。 +> 以下是 GraphQL 在标准 REST API 技术上获得发展的原因。 -[][1] +[](https://img.linux.net.cn/data/attachment/album/202004/05/105820rdnjrppprjdjddfd.jpg) -正如我[以前][3]所写,[GraphQL][2] 是下一代 API 技术,它正在改变客户端应用程序与后端系统的通信方式以及后端系统的设计方式。 +正如我[以前][3]所写,[GraphQL][2] 是一种下一代 API 技术,它正在改变客户端应用程序与后端系统的通信方式以及后端系统的设计方式。 -由于一开始就从创建它的组织 Facebook 获得了支持,并得到了其他技术巨头(如 Github、Twitter 和 AirBnB)的支持,因此 GraphQL 作为应用程序系统的关键技术的地位似乎是可靠的 —— 无论现在还是将来。 +由于一开始就从创建它的组织 Facebook 获得了支持,并得到了其他技术巨头(如 Github、Twitter 和 AirBnB)的支持,因此 GraphQL 作为应用程序系统的关键技术的地位似乎是稳固的 —— 无论现在还是将来。 -### GraphQL 在崛起 +### GraphQL 的崛起 移动应用程序性能和组织敏捷性重要性的提高为 GraphQL 登上现代企业体系结构的顶端提供了助推器。 -鉴于 [REST][4] 是一种非常流行的体系结构风格,早已提供了数据交互机制,与 [REST][4] 相比,GraphQL 这项新技术具有哪些优势?GraphQL 中的 “QL” 代表查询语言,而这是一个很好的起点。 +鉴于 [REST][4] 是一种非常流行的体系结构风格,早已提供了数据交互机制,与 [REST][4] 相比,GraphQL 这项新技术具有哪些优势呢?GraphQL 中的 “QL” 代表着查询语言,而这是一个很好的起点。 -借助 GraphQL,组织内的不同客户端应用程序可以轻松地仅查询所需数据,从而取代了其他 REST 方法,并提高了实际应用程序的性能。 使用传统的 [REST][4] API 端点,客户端应用程序将详询服务器资源,并接收包含了与请求匹配的所有数据的响应。如果来自 [REST][4] API 端点的成功响应返回 35 个字段,那么客户端应用程序就会接收 35 个字段。 +借助 GraphQL,组织内的不同客户端应用程序可以轻松地仅查询所需数据,这一点超越了其它 REST 方法,并带来了实际应用程序性能的提高。使用传统的 [REST][4] API 端点,客户端应用程序将详询服务器资源,并接受包含了与请求匹配的所有数据的响应。如果来自 [REST][4] API 端点的成功响应返回 35 个字段,那么客户端应用程序就会收到 35 个字段。 -### 提取的问题 +### 获取的问题 -传统上,[REST][4] API 无法为客户端应用程序提供简便的方法来仅检索或更新它们关心的数据。这通常被描述为“过度获取over-fetching”的问题。随着移动应用程序在人们的日常生活中的普遍使用,过度获取问题会给现实世界带来不良后果。移动应用程序需要发出的每个请求都必须发送和接收的每个字节,对最终用户的性能造成的负面影响越来越大。数据连接速度较慢的用户尤其会受到不太好的 API 设计方案的影响。在性能体验不佳时,使用移动应用程序的客户更有可能不购买产品或不使用服务。低效的 API 设计只会浪费公司的钱。 +传统上,[REST][4] API 没有为客户端应用程序提供简便的方法来仅检索或只更新它们关心的数据。这通常被描述为“过度获取over-fetching”的问题。随着移动应用程序在人们的日常生活中的普遍使用,过度获取问题会给现实世界带来不良后果。移动应用程序发出的每个请求、每一个字节的接受和发送,对终端用户的性能影响越来越大。数据连接速度较慢的用户尤其会受到不太好的 API 设计方案的影响。使用移动应用程序而性能体验不佳的客户更有可能不购买产品或不使用服务。低效的 API 设计只会浪费企业的钱。 -并非只有“过度获取”是问题,“欠缺获取”同样也是问题。默认情况下,仅返回客户端实际需要的部分数据的端点或许会要求客户端进行其他调用以满足其数据需求,这就需要其他的 HTTP 请求。由于过度和欠缺的获取问题及其对客户端应用程序性能的影响,促进有效获取的 API 技术才有机会在市场上引起轰动 —— GraphQL 大胆地介入并填补了这一空白。 +并非只有“过度获取”是问题,“欠缺获取”同样也是问题。默认情况下,端点只返回客户端实际需要的部分数据,这需要客户端进行额外的调用以满足其数据需求,这就产生了额外的 HTTP 请求。由于过度和欠缺的获取问题及其对客户端应用程序性能的影响,促进有效获取的 API 技术才有机会在市场上引起轰动 —— GraphQL 大胆地介入并填补了这一空白。 ### REST 的应对 -[REST][4] API 设计师不战而退,他们尝试通过以下几种方式来应对移动应用程序性能问题: +[REST][4] API 设计师不甘心不战而退,他们试图通过以下几种方式来应对移动应用程序性能问题: -* “include” 和 “exclude” 查询参数,允许客户端应用程序通过可能较长的查询格式来指定所需的字段。 -* “复合”服务,组合了多个端点,以使客户端应用程序在其发出的请求数量和接收到的数据方面更高效。 +* “包含”和“排除”查询参数,允许客户端应用程序通过可能较长的查询格式来指定所需的字段。 +* “复合”服务,将多个端点组合在一起,以使客户端应用程序在其发出的请求数量和接收到的数据方面更高效。    尽管这些模式是 [REST][4] API 社区为解决移动客户端所面临的挑战而做出的英勇尝试,但它们在以下几个关键方面仍存在不足: -* 包含和排除查询的键/值对很快变得混乱,特别是对于需要嵌套“点表示法”语法(或类似方法)以包含和排除更深的目标数据的对象图而言。此外,在此模型中调试查询字符串的问题通常需要手动分解 URL。 -* 包含和排除查询的服务器实现通常是自定义的,因为基于服务器的应用程序没有标准的方式来处理包含和排除查询的使用,就像没有定义包含和排除查询的标准方式一样。 -* 复合服务的兴起创建了更加紧密耦合的后端和前端系统,需要加强协调以交付项目,并且一旦将敏捷项目转回瀑布式。这种协调和耦合顺便还能稍减组织敏捷性的痛苦。此外,根据定义,组合服务不是 RESTful。 +* 包含和排除查询键/值对很快就会变得混乱,特别是对于需要用嵌套“点表示法”语法(或类似方法)以对目标数据进行包含和排除的深层对象图而言,更是如此。此外,在此模型中调试查询字符串的问题通常需要手动分解 URL。 +* 包含和排除查询的服务器的实现往往是自定义的,因为基于服务器的应用程序没有标准的方式来处理包含和排除查询的使用,就像没有定义包含和排除查询的标准方式一样。 +* 复合服务的兴起形成了更加紧密耦合的后端和前端系统,这就需要加强协调以交付项目,并且将曾经的敏捷项目转回瀑布式开发。这种协调和耦合还有一个痛苦的副作用,那就是减宦了组织的敏捷性。此外,顾名思义,组合服务不是 RESTful。    ### GraphQL 的起源 -对于 Facebook 来说,从其 2011-2012 年基于 HTML5 版本的旗舰移动应用程序中感受到的痛点和体验,才造就了 GraphQL。Facebook 工程师意识到提高性能至关重要,因此意识到他们需要一种新的 API 设计来确保最佳性能。可能考虑到以上 [REST][4] 的局限性,并且需要支持许多 API 客户端的不同需求,因此人们开始去了解其共同创建者 Lee Byron 和 Dan Schaeffer(那时尚是 Facebook 员工)撒播下的早期种子,创建了后来被称之为 GraphQL 的技术。 +对于 Facebook 来说,从其 2011-2012 年基于 HTML5 版本的旗舰移动应用程序中感受到的痛点和体验,才造就了 GraphQL。Facebook 工程师意识到提高性能至关重要,因此意识到他们需要一种新的 API 设计来确保最佳性能。可能考虑到上述 [REST][4] 的局限性,并且需要支持许多 API 客户端的不同需求,因此人们可以理解是什么导致其共同创建者 Lee Byron 和 Dan Schaeffer(那时尚是 Facebook 员工)创建了后来被称之为 GraphQL 的技术的早期种子。 -通过 GraphQL 查询语言,客户端(通常是单个 GraphQL 端点)应用程序通常可以显著减少所需的网络调用数量,并确保仅检索所需的数据。在许多方面,这可以追溯到早期的 Web 编程模型,在该模型中,客户端应用程序代码将直接查询后端系统,有些人可能还记得 10 到 15 年前在 JSP 上用 JSTL 编写 SQL 查询吧! +通过 GraphQL 查询语言,客户端(通常是单个 GraphQL 端点)应用程序通常可以显著减少所需的网络调用数量,并确保仅检索所需的数据。在许多方面,这可以追溯到早期的 Web 编程模型,在该模型中,客户端应用程序代码会直接查询后端系统 —— 比如说,有些人可能还记得 10 到 15 年前在 JSP 上用 JSTL 编写 SQL 查询的情形吧! -现在最大的区别是使用 GraphQL,我们有了一个跨多种客户端和服务器语言和库实现的规范。借助 GraphQL 这样一种 API 技术,我们通过引入 GraphQL 应用程序中间层来分离后端和前端应用程序系统,该层提供了一种以与组织的业务领域相一致的方式来访问组织数据的机制。 +现在最大的区别是使用 GraphQL,我们有了一个跨多种客户端和服务器语言和库实现的规范。借助 GraphQL 这样一种 API 技术,我们通过引入 GraphQL 应用程序中间层来解耦后端和前端应用程序系统,该层提供了一种机制,以与组织的业务领域相一致的方式来访问组织数据。 除了解决软件工程团队遇到的技术挑战之外,GraphQL 还促进了组织敏捷性的提高,特别是在企业中。启用 GraphQL 的组织敏捷性通常归因于以下因素: - * GraphQL API 设计人员和开发人员无需在客户端需要一个或多个新字段时创建新的端点,而是能够将这些字段包含在现有的图形实现中,从而以较少的开发工作量和跨应用程序系统的较少更改的方式公开新功能。 - * 通过鼓励 API 设计团队将更多的精力放在定义对象图上,而不是在专注于客户端应用程序交付上,前端和后端软件团队为客户交付解决方案的速度日益解耦。 + * GraphQL API 设计人员和开发人员无需在客户端需要一个或多个新字段时创建新的端点,而是能够将这些字段包含在现有的图实现中,从而以较少的开发工作量和跨应用程序系统的较少更改的方式展示出新功能。 + * 通过鼓励 API 设计团队将更多的精力放在定义对象图上,而不是在专注于客户端应用程序交付上,前端和后端软件团队为客户交付解决方案的速度日益解耦。    ### 采纳之前的注意事项 尽管 GraphQL 具有引人注目的优势,但 GraphQL 并非没有实施挑战。一些例子包括: * 为 [REST][4] API 建立的缓存机制更加成熟。 -* 用于使用 [REST][4] 来构建 API 的模式已经非常完善。 +* 使用 [REST][4] 来构建 API 的模式更加完善。 * 尽管工程师可能更喜欢 GraphQL 等新技术,但与 GraphQL 相比,市场上的人才库更多是从事于构建基于 [REST][4] 的解决方案。 ### 结论 -通过同时提高性能和组织敏捷性,GraphQL 在公司中的采纳在过去几年中猛增。但是,与 RESTful API 设计生态系统相比,它确实还需要更成熟一些。 +通过同时提高性能和组织敏捷性,GraphQL 在过去几年中被企业采纳的数量激增。但是,与 API 设计的 RESTful 生态系统相比,它确实还需要更成熟一些。 -GraphQL 的一大优点是,它并不是作为替代 API 解决方案的批发替代品而设计的。相反,可以实现 GraphQL 来补充或增强现有的 API。因此,鼓励公司探索逐步采用 GraphQL 的方法,这对他们来说最有意义,他们发现它对应用程序性能和组织敏捷性具有最大的积极影响。 +GraphQL 的一大优点是,它并不是作为替代 API 解决方案的批发替代品而设计的。相反,GraphQL 可以用来补充或增强现有的 API。因此,鼓励企业探索在 GraphQL 对其最有意义的地方逐步采用 GraphQL —— 在他们发现它对应用程序性能和组织敏捷性具有最大的积极影响的地方。 -------------------------------------------------------------------------------- @@ -79,7 +79,7 @@ via: https://opensource.com/article/19/6/why-use-graphql 作者:[Zach Lendon][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -87,5 +87,5 @@ via: https://opensource.com/article/19/6/why-use-graphql [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_graph_stats_blue.png?itok=OKCc_60D [2]: https://graphql.org/ -[3]: https://opensource.com/article/19/6/what-is-graphql +[3]: https://linux.cn/article-12070-1.html [4]: https://en.wikipedia.org/wiki/Representational_state_transfer From ee6430e5b48a9c0a25f331741c9ed706557bcb63 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Apr 2020 11:03:59 +0800 Subject: [PATCH 0134/1809] PUB @wxy https://linux.cn/article-12075-1.html --- {translated/tech => published}/20190612 Why use GraphQL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190612 Why use GraphQL.md (99%) diff --git a/translated/tech/20190612 Why use GraphQL.md b/published/20190612 Why use GraphQL.md similarity index 99% rename from translated/tech/20190612 Why use GraphQL.md rename to published/20190612 Why use GraphQL.md index 763d352cb2..b71cb64206 100644 --- a/translated/tech/20190612 Why use GraphQL.md +++ b/published/20190612 Why use GraphQL.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12075-1.html) [#]: subject: (Why use GraphQL?) [#]: via: (https://opensource.com/article/19/6/why-use-graphql) [#]: author: (Zach Lendon https://opensource.com/users/zachlendon/users/goncasousa/users/patrickhousley) From 0e95c3eedae46d1dbf7e174ad58f2dc710875b67 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 5 Apr 2020 11:05:56 +0800 Subject: [PATCH 0135/1809] Translating --- .../20200403 Scheduling tasks on Linux using the at command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200403 Scheduling tasks on Linux using the at command.md b/sources/tech/20200403 Scheduling tasks on Linux using the at command.md index 090ae1620a..42b1025fe4 100644 --- a/sources/tech/20200403 Scheduling tasks on Linux using the at command.md +++ b/sources/tech/20200403 Scheduling tasks on Linux using the at command.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4529cabf72d9396e2b6b9e085a0352ee39a3e3ca Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Sun, 5 Apr 2020 20:51:56 +0800 Subject: [PATCH 0136/1809] hankchow translated --- ...to Ubuntu 20.04 Beta from 18.04 - 19.10.md | 135 ------------------ ...to Ubuntu 20.04 Beta from 18.04 - 19.10.md | 134 +++++++++++++++++ 2 files changed, 134 insertions(+), 135 deletions(-) delete mode 100644 sources/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md create mode 100644 translated/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md diff --git a/sources/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md b/sources/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md deleted file mode 100644 index cbbe8f7866..0000000000 --- a/sources/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md +++ /dev/null @@ -1,135 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Upgrade to Ubuntu 20.04 Beta from 18.04 & 19.10) -[#]: via: (https://itsfoss.com/upgrade-ubuntu-beta/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Upgrade to Ubuntu 20.04 Beta from 18.04 & 19.10 -====== - -[Ubuntu 20.04 LTS release][1] is less than a month away. It has plenty of visual changes and several performance improvements. - -If you are still using Ubuntu 18.04 LTS, you’ll find Ubuntu 20.04 stunningly beautiful with its dark Yaru theme. Here’s a [video showing what Ubuntu 20.04 looks like][2]. Have a look and judge it yourself. - -[Subscribe to our YouTube channel for more Linux videos][3] - -Looks great, isn’t it? If you are excited about Ubuntu 20.04 and cannot wait till the final stable release on 23rd April, you can start using it even today. It’s fairly stable and it could even help Ubuntu team in testing this release. - -There’s always the option to download the daily build and install it afresh. But if you are using Ubuntu 18.04 or Ubuntu 19.10, you can upgrade to Ubuntu 20.04 beta from your existing system. - -Please check this tutorial to learn [how to find out which Ubuntu version you are using][4]. - -In this tutorial, I’ll show you the steps to upgrade to Ubuntu 20.04 beta. - -### How to upgrade to Ubuntu 20.04 beta from Ubuntu 18.04 and 19.10 - -![Upgrade Ubuntu 20 04 Beta][5] - -Before you see the steps, let me answer some of the common questions regarding upgrading to Ubuntu beta version. - - * The upgrade from one version to another is an easy process but you need to have a good internet connection that could download a couple of GBs of data at a good speed. - * Upgrading to a newer version disables the third-party repositories ([PPA][6] you added on your own). Some of these PPAs might not be available for the new version yet. You can manually enable the PPAs after upgrading. - * Having a backup of your important data on an external USB disk is always recommended. Just copy all your important files from Documents, Pictures, Music, Downloads and other places and put it on an external USB or hard disk. - * Once you have upgraded to a newer version, you cannot go back to the older version you were using. Reinstalling the older version is the only option. - * If you upgrade to the Ubuntu 20.04 beta version, you don’t need to install it again when the final stable version is released. Just update your Ubuntu system regularly and you’ll already be using the same 20.04 when it is released. - * You cannot upgrade to Ubuntu 20.04 directly from Ubuntu 16.04, 17, 18, 19.04. - - - -Alright! You know enough now. Let’s see the steps to upgrade to Ubuntu 20.04 beta from Ubuntu 19.10 and 18.04. - -#### Step 1: Make sure the settings are right - -Go to Software & Updates application: - -![Software & Updates application in Ubuntu][7] - -In the Updates tab, check that Notify me of a new Ubuntu version is set to “Any new version” or “LTS version”: - -![Ubuntu Upgrade Version Settings][8] - -This may reload the Software repository cache. - -#### Step 2: Update your system for any pending software updates - -Once you have the correct settings in place, open a terminal ([use Ctrl+Alt+T shortcut in Ubuntu][9]) and use the following [command to update your Ubuntu system][10]: - -``` -sudo apt update && sudo apt full-upgrade -``` - -The apt full-upgrade or dist-upgrade function the same as ‘apt upgrade’ but it will remove currently installed packages if this is needed to upgrade the system as a whole (i.e. a version upgrade). - -Your system may ask to restart after installing updates. That’s fine. Restart and resume upgrading to beta release from step 3. - -#### Step 3: Run update manager with development release upgrade option - -Now that you have all the necessary updates installed, you can open the update manager but with -d option. The -d option tells it to look for development releases. - -``` -update-manager -d -``` - -It may take a couple of minutes before informing you that a new version of Ubuntu is available. - -![Availability of Ubuntu 20.04 in Ubuntu 19.10][11] - -A similar message is displayed in Ubuntu 18.04 as well: - -![Availability of Ubuntu 20.04 in Ubuntu 18.04][12] - -Hit the upgrade button when you see the above message. - -#### Step 4: Start upgrading to Ubuntu 20.04 beta - -The rest of the upgrade procedure is basically waiting for update downloads and clicking okay wherever requested. - -![][13] - -Hit the upgrade button and follow the on-screen instructions. - -![][14] - -You might be notified that all the third party sources have been disabled. At some point, it will also inform you of the packages that will be upgraded, removed etc. It will also ask if you want to keep obsolete packages or not. I prefer to remove them. - -Depending on your internet speed, the upgrade may take a couple of hours. Once the upgrade process is complete, you’ll be asked to restart your system. - -![][15] - -This video shows all the steps in action: - -See, it wasn’t that difficult. Enjoy all the new features in Ubuntu 20.04. - -Questions or suggestions? Feel free to leave a comment below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/upgrade-ubuntu-beta/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/ubuntu-20-04-release-features/ -[2]: https://www.youtube.com/watch?v=9u5B0njRgOw -[3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[4]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-beta.jpg?ssl=1 -[6]: https://itsfoss.com/ppa-guide/ -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/software-updates-app-ubuntu.jpg?ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/ubuntu-upgrade-version-settings.jpg?ssl=1 -[9]: https://itsfoss.com/ubuntu-shortcuts/ -[10]: https://itsfoss.com/update-ubuntu/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04.jpg?ssl=1 -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-from-18-04.jpg?ssl=1 -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-steps-1.jpg?ssl=1 -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-steps-2.jpg?ssl=1 -[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/restart-to-finish-beta-upgarde-ubuntu-20-04.jpg?ssl=1 diff --git a/translated/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md b/translated/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md new file mode 100644 index 0000000000..fd629c8db7 --- /dev/null +++ b/translated/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md @@ -0,0 +1,134 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Upgrade to Ubuntu 20.04 Beta from 18.04 & 19.10) +[#]: via: (https://itsfoss.com/upgrade-ubuntu-beta/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何将 Ubuntu 18.04/19.10 升级到 Ubuntu 20.04 beta +====== + +[Ubuntu 20.04 LTS 版本][1]还有不到一个月就发布了,Ubuntu 在这一个版本中对视觉效果作出了大变动,同时在性能方面也有所提高。 + +如果你还在使用 Ubuntu 18.04 LTS 版本,你会发现 Ubuntu 20.04 配合深色 Yaru 主题非常惊艳,看过 [Ubuntu 20.04 的展示视频][2]你就知道了。 + +[订阅我们的 YouTube 频道观看更多 Linux 视频][3] + +感觉确实不错。如果你想在 4 月 23 日最终稳定版正式发布前率先使用 Ubuntu 20.04,也可以在官方网站上下载 beta 版本。尽管如此,它的稳定性并不差,同时你也可以在使用这个版本的过程中帮助 Ubuntu 团队进行测试。 + +你可以下载每日构建daily build版并进行重新安装,如果你正在使用的是 Ubuntu 18.04 或 Ubuntu 19.10,也可以在现有系统的基础上直接升级到 Ubuntu 20.04 beta 版本。 + +如果你需要确认正在使用的 Ubuntu 版本,可以参考[这篇文章][4]。 + +在本文中,我将会介绍如何升级到 Ubuntu 20.04 beta 版本。 + +### 如何将 Ubuntu 18.04/19.10 升级到 Ubuntu 20.04 beta + +![Upgrade Ubuntu 20 04 Beta][5] + +在你阅读后面的内容之前,我首先说明一些关于升级到 Ubuntu beta 版本的常见问题。 + + * 版本升级的过程并不复杂,但在整个过程中需要有良好的网络连接,以便下载高达好几 GB 的数据。 + * 版本升级的过程中,第三方存储库(比如你自行添加的 [PPA][6])会被禁用,有些 PPA 可能也和新版本不兼容,在版本升级完毕后,你可以手动启用 PPA。 + * 强烈建议将重要数据备份到外部的 USB 硬盘上。你只需要将各个目录下的重要文件直接复制到外部 USB 硬盘上保存即可。 + * 升级到新版本之后,就无法再回滚到之前的旧版本了,只能重新安装旧版本系统。 + * 如果你选择升级到 Ubuntu 20.04 beta 版本,那么在 Ubuntu 20.04 最终稳定版发布之后,你也不需要重新安装。只需要保持定期更新 Ubuntu 系统,届时你就可以直接用上最终稳定版了。 + * Ubuntu 16.04/17/18/19.04 都无法直接升级到 Ubuntu 20.04。 + +了解完上面的内容之后,下面开始从 Ubuntu 18.04/19.10 升级到 Ubuntu 20.04。 + +#### 步骤 1:检查设置是否正确 + +进入“软件和升级Software & Updates”应用: + +![Software & Updates application in Ubuntu][7] + +在“升级Updates”选项卡中,设置“有任何新版本 Ubuntu 都提醒我”或“有 LTS 版本 Ubuntu 就提醒我”: + +![Ubuntu Upgrade Version Settings][8] + +设置完成后,系统会刷新软件库缓存。 + +#### 步骤 2:安装系统更新 + +在上面的步骤完成之后,打开终端(在 Ubuntu 中可以使用 `Ctrl+Alt+T` [快捷键][9]),然后使用以下命令[更新 Ubuntu 系统][10]: + +``` +sudo apt update && sudo apt full-upgrade +``` + +`apt full-upgrade` 或 `apt dist-upgrade` 的功能和 `apt upgrade` 大致相同,但对于系统版本的升级,`apt full-upgrade` 会在需要的情况下将当前已安装的软件移除掉。 + +更新安装完成后,系统可能会需要重新启动。在重新启动之后,就可以进入步骤 3 了。 + +#### 步骤 3:使用更新管理器查找开发版本 + +在步骤 2 中已经安装了所有必要的更新,现在通过下面的命令打开更新管理器,其中 `-d` 参数表示需要查找开发版本: + +``` +update-manager -d +``` + +整个过程可能需要好几分钟,随后会提示有新版本的 Ubuntu 可用: + +![Availability of Ubuntu 20.04 in Ubuntu 19.10][11] + +在 Ubuntu 18.04 上的提示是这样的: + +![Availability of Ubuntu 20.04 in Ubuntu 18.04][12] + +然后点击对话框中的“升级upgrade”按钮。 + +#### 步骤 4:开始升级到 Ubuntu 20.04 beta + +接下来只要等待下载更新就可以了,遇到对话框直接点击 OK 即可。 + +![][13] + +点击“升级upgrade”按钮,然后按照提示进行操作。 + +![][14] + +在升级过程中,可能会有提示信息告知所有第三方源都已经禁用。有时候还会提示有哪些软件包需要升级或删除,以及是否需要保留一些已经过时了的软件包。一般情况下,我会选择直接删除。 + +整个升级过程通常会需要几个小时,但主要还是取决于实际的网速。升级完成后,系统会提示需要重新启动。 + +![][15] + +下面的视频展示了所有相关步骤。 + +由此可见,这个升级流程并不复杂。欢迎体验 Ubuntu 20.04 带来的新特性。 + +如果你有疑问或建议,欢迎在评论区留言。 + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/upgrade-ubuntu-beta/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-20-04-release-features/ +[2]: https://www.youtube.com/watch?v=9u5B0njRgOw +[3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[4]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-beta.jpg?ssl=1 +[6]: https://itsfoss.com/ppa-guide/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/software-updates-app-ubuntu.jpg?ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/ubuntu-upgrade-version-settings.jpg?ssl=1 +[9]: https://itsfoss.com/ubuntu-shortcuts/ +[10]: https://itsfoss.com/update-ubuntu/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04.jpg?ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-from-18-04.jpg?ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-steps-1.jpg?ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-steps-2.jpg?ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/restart-to-finish-beta-upgarde-ubuntu-20-04.jpg?ssl=1 From 808bdd3e5e493a34cb4fefab36346be7c0876800 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Apr 2020 20:54:20 +0800 Subject: [PATCH 0137/1809] PRF @geekpi --- ...a 14- How to Install it on Ubuntu Linux.md | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/translated/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md b/translated/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md index e030ed192e..62b77b4a1c 100644 --- a/translated/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md +++ b/translated/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md @@ -1,39 +1,37 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Oracle Announces Java 14! How to Install it on Ubuntu Linux) [#]: via: (https://itsfoss.com/java-14-ubuntu/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -Oracle 发布 Java 14!如何在 Ubuntu Linux 上安装 +如何在 Ubuntu Linux 上安装 Oracle Java 14 ====== -最近,Oracle 宣布 Java 14(或 Oracle JDK 14)正式开放。如果你想进行最新的实验或者开发的话,那么你可以试试在 Linux 系统上安装 Java 14。 +![](https://img.linux.net.cn/data/attachment/album/202004/05/205313e188lsbrbgz9932d.jpg) -Oracle JDK 14(或简称 Java 14)[发行版][1]包含几个新功能,如果你想预览它们的话。我已添加了链接: +最近,Oracle 宣布 Java 14(或 Oracle JDK 14)公开可用。如果你想进行最新的实验或者开发的话,那么你可以试试在 Linux 系统上安装 Java 14。 + +Oracle JDK 14(或简称 Java 14)[发布版][1]包含几个新功能,如果你想预览它们的话。我已添加了链接: * [instanceof 的模式匹配][2] * [Records][3] * [Text Blocks][4] - - 除预览功能外,它还包含一些改进和补充。在新闻中,他们还提到了其他改进: ->此外,最新的 Java 版本增加了 Java 语言对 switch 表达式的支持,新增了用于持续监控 JDK Flight Recorder 数据的新 API,将低延迟 zgc 扩展到了 macOS 和 Windows,并添加在 incubator 模块中,独立的 Java 应用打包和为了安全的新的外部内存访问 API 来有效地访问 Java 堆外部的内存。 +> 此外,最新的 Java 版本增加了 Java 语言对 switch 表达式的支持,新增了用于持续监控 JDK Flight Recorder 数据的新 API,将低延迟 zgc 扩展到了 macOS 和 Windows,并添加在 incubator 模块中,独立的 Java 应用打包,以及为了安全、有效地访问 Java 堆外部内存的新的外部内存访问 API。 -当然,如果你想详细了解细节,那么你应查看[官方公告][1]。 +当然,如果你想深入了解细节,那么你应查看[官方公告][1]。 -在本教程中,我将向你展示在 Ubuntu 系统上安装 Java 14 的简便方法。继续阅读。 +在本教程中,我将向你展示在 Ubuntu 系统上安装 Java 14 的简便方法。请继续阅读。 -**注意:**如果你选择 Oracle Java 11 或更高版本,那么应该了解新的 [Oracle 技术网络许可协议][5],以了解它如何影响个人用户、开发人员和商业组织。通常,它们可以免费用于开发和测试,但不能用于生产。 +**注意:**如果你选择使用 Oracle Java 11 或更高版本,那么应该了解新的 [Oracle 技术网络许可协议][5],以了解它如何影响个人用户、开发人员和商业组织。通常,它们可以免费用于开发和测试,但不能用于生产环境。 ### 如何在 Ubuntu Linux 上安装 Java 14? -![][6] - 作为参考,我已成功在默认安装 **OpenJDK 11** 的 **Pop!_OS 19.10** 上成功安装了它。 这里,我们将使用 [Linux Uprising][7] 的 Java 14 安装程序(最初基于 WebUpd8 Java 软件包)。 @@ -56,7 +54,7 @@ sudo apt install oracle-java14-set-default ### 总结 -当然,这些是最新的特性,如果你不想破环环境,你或许会希望继续使用 Java11。如果你想在了解风险的情况下进行试验,请继续尝试! +当然,这些会带来最新的特性,如果你不想破环原有环境,你或许会希望继续使用 Java 11。如果你想在了解风险的情况下进行试验,请继续尝试! 欢迎在下面的评论中让我知道你对 Java 14 的想法。 @@ -67,7 +65,7 @@ via: https://itsfoss.com/java-14-ubuntu/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 924b3609a6f2a55f735d204037124032776cc2e7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Apr 2020 20:55:33 +0800 Subject: [PATCH 0138/1809] PUB @geekpi https://linux.cn/article-12076-1.html --- ...le Announces Java 14- How to Install it on Ubuntu Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md (98%) diff --git a/translated/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md b/published/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md similarity index 98% rename from translated/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md rename to published/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md index 62b77b4a1c..fc7af79bb5 100644 --- a/translated/tech/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md +++ b/published/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12076-1.html) [#]: subject: (Oracle Announces Java 14! How to Install it on Ubuntu Linux) [#]: via: (https://itsfoss.com/java-14-ubuntu/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From b772fd958d9c428d235465db500be4d5ef43ff41 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Apr 2020 23:25:01 +0800 Subject: [PATCH 0139/1809] PRF @wxy --- ...0331 5 ways to level up your Vim skills.md | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/translated/tech/20200331 5 ways to level up your Vim skills.md b/translated/tech/20200331 5 ways to level up your Vim skills.md index 2ddeb2f40d..53e49926dd 100644 --- a/translated/tech/20200331 5 ways to level up your Vim skills.md +++ b/translated/tech/20200331 5 ways to level up your Vim skills.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 ways to level up your Vim skills) @@ -10,13 +10,13 @@ 提升你的 Vim 技能的 5 个方法 ====== -> 通过一些有趣的技巧使你的文本编辑器更上一层楼。 +> 通过一些有趣的小技巧使你的文本编辑器更上一层楼。 -![Computer keyboard typing][1] +![](https://img.linux.net.cn/data/attachment/album/202004/05/232434x1hnzlnhcnm3nrc7.jpg) -Vim 是最受欢迎的文本编辑器之一,因此绝对值得花时间学习如何使用它。如果你使用这个无处不在的 [Vi(m)][2] 命令行文本编辑器来做的只是打开文件、输入和编辑一些文本、保存编辑的文件并退出程序,那么你还有很大的提示空间、。 +Vim 是最受欢迎的文本编辑器之一,因此绝对值得你花时间去学习如何使用它。就算你只是学习使用这个无处不在的 [Vi(m)][2] 命令行文本编辑器打开文件、输入和编辑一些文本、保存编辑的文件并退出程序,你都会受益匪浅。 -在某些情况下你会发现,使用 Vim 非常方便的的场景几乎总是涉及到运行远程 Shell 操作的任务。如果你时不时地使用 ssh,比如 +你会发现,使用 Vim 非常方便的的场景几乎总是涉及到运行远程 Shell 操作的任务。如果你时不时地使用 ssh,比如 ``` $ ssh user@hostname.provider.com @@ -26,11 +26,11 @@ $ ssh user@hostname.provider.com ### 将 Vim 设置为默认的文本编辑器 -几乎在所有现代 Linux(或 BSD)发行版中,都可以在终端仿真器的 shell 命令提示符下使用 Vim。在用户 shell 程序中将 Vim 定义为默认编辑器后,即可使用熟悉的 Vim 键绑定来浏览内置的实用程序,例如 `man`。我将说明如何使用 Bash 和 Z shell(zsh)来实现此目的,zsh 现在是 macOS 用户的默认shell(自 Catalina 起)。 +几乎所有的现代 Linux(或 BSD)发行版中,都可以在终端仿真器的 shell 命令提示符下使用 Vim。一旦在你的用户 shell 程序中将 Vim 定义为默认编辑器后,那么就可以使用熟悉的 Vim 键绑定来在内置的实用程序(例如 `man`)中导航。我将说明如何使用 Bash 和 Z shell(zsh)来实现此目的,zsh 现在是 macOS 用户的默认 shell(自 Catalina 起)。 #### 在 Bash 中将 Vim 设置为默认 -Bash 通过点文件的组合来管理设置。将首选编辑器添加到主目录中的 `.bashrc` 文件中是最常见的,但也可以将其添加到 `.bash_profile` 中。(请阅读 [GNU Bash 文档][3]了解不同之处)。 +Bash 通过点文件的组合来管理设置。最常见的的做法将你的编辑器添加到主目录中的 `.bashrc` 文件中,但也可以将其添加到 `.bash_profile` 中。(请阅读 [GNU Bash 文档][3]了解两者的不同之处)。 通过在 `~/.bashrc` 中添加以下内容,将 Vim 设置为默认编辑器: @@ -39,11 +39,11 @@ Bash 通过点文件的组合来管理设置。将首选编辑器添加到主目 export EDITOR=vim ``` -以 `#` 开头的行是可选的注释,这是提醒自己该命令的功能的好方法。 +以 `#` 开头的行是可选的注释,这是一个好方法,可以提醒自己该命令的作用。 #### 在 zsh 中将 Vim 设置为默认 -zsh 是一种越来越流行的终端模拟器,尤其是自苹果的基于 FreeBSD 的 Darwin 系统最近从 Bash 切换到 zsh 以来。 +zsh 是一种越来越流行的终端仿真器,尤其是在苹果公司的基于 FreeBSD 的 Darwin 系统最近从 Bash 转向 zsh 以来。 zsh 点文件与 Bash 的文件相当,因此你可以在 `~/.zshrc` 或 `~/.zprofile` 之间进行选择。有关何时使用哪一个的详细信息,请参见 [zsh文档][4]。 @@ -56,13 +56,13 @@ export EDITOR=vim ### 优化 Vim 配置 -Vim 很像终端仿真器外壳,它使用点文件来设置个人偏好。如果发现该模式,则可能已经猜到它是 `~/.vimrc`。 +Vim 像是终端仿真器 shell 一样,也使用点文件来设置个人偏好。如果你发现了这种模式,则可能已经猜到它是 `~/.vimrc`。 -你可能要更改的第一个设置是将对旧 Vi 兼容模式切换为“关”。由于 Vim 是 Vi 的超集,因此 Vi 中的所有功能都可用,并在 Vim 中进行了很大的改进,你可以获得许多高级功能。最新版本(8.2)允许你在拆分的窗口中打开终端运行一个子进程 shell 程序。 +你可能要更改的第一个设置是将对传统的 Vi 兼容模式切换为“关闭”。由于 Vim 是 Vi 的超集,因此 Vi 中的所有功能在 Vim 中都是可用的,并且在 Vim 中得到了很大的改进,你可以获得许多高级功能。最新版本(8.2)允许你在分割的窗口中以子进程 shell 的方式打开一个终端。 -顺便说一句,关闭旧版兼容性似乎没有做什么事情([事实上,可能不是][5])。当遇到一个 `.vimrc` 文件时,Vim 会自动将该模式切换为关闭。但有时将其明确关闭仍然很重要。缩写 `nocp` 是 `nocompatible` 的同义词,也可以使用它。[条条大道通罗马][6],切换首选项有很多方式。 +顺便说一句,明确关闭对传统的 Vi 的兼容性看起来没有什么作用([事实上,可能并没有什么作用][5])。当 Vim 遇到 `.vimrc` 文件时,它会暗暗地自动将兼容模式切换到关闭。但有时将其明确关闭仍然很重要。缩写 `nocp` 是 `nocompatible` 的同义词,作用是一样的。[条条大道通罗马][6],切换首选项有很多方式。 -在 `.vimrc` 语法中, 以 `"` 开头的行是注释(就像 `.bashrc` 文件中的 `#` 一样),这些注释可以帮助你记住诸如为何选择一个隐秘的设置名称之类的内容。 +在 `.vimrc` 语法中, 以 `"` 开头的行是注释(就像 `.bashrc` 文件中的 `#` 一样),这些注释可以帮助你记住诸如为何选择了一个隐晦的设置名称之类的内容。 要关闭 Vi 兼容性,请将以下内容添加到 `~/.vimrc` 文件中: @@ -74,21 +74,22 @@ set nocp ### 理解模式 -Vim的 “模式”概念是非常重要的,尤其是“正常模式”和“插入模式”之间的区别。对模式的混淆是大多数新用户的困扰。模式并不是 Vim 所独有的,甚至也不是 Vi 所引入的。命令模式是如此的古老,以至于它比 70 年代的[复制和粘贴][7]功能的发明还要早。 +Vim 的 “模式”概念是非常重要的,尤其是“普通模式”和“插入模式”之间的区别。对模式的混淆是大多数新用户的困扰。模式并不是 Vim 所独有的,甚至也不是 Vi 所引入的。命令模式是如此的古老,以至于它比 70 年代发明的[复制和粘贴][7]功能还要早。 #### 重要的模式 -Vim 依赖于不同的模式来定义键盘的敲击行为。需要了解的重要模式有 +Vim 依赖于不同的模式来定义键盘的敲击行为。需要了解的重要模式有: -* 正常模式:默认模式,主要用于导航和打开文件。 +* 普通模式:默认模式,主要用于导航和打开文件。 * 插入模式(包括替换):这种模式下 Vim 允许将文本输入到打开的文件中。 * 可视模式:Vim 的行为类似于基于鼠标的输入方式,如复制、编辑、替换等。 -* 命令模式(包括行模式、Ex 命令模式和末行模式):在 Vim 中做更多事情的强大方法。 +* 命令模式(包括行模式、Ex 命令模式和末行模式):是在 Vim 中做更多事情的强大方法。 每种模式都有很多值得探索的地方。使用 [Vimtutor][8](`vimtutor`)可以交互式地学习移动光标、模式和在末行模式下运行 Ex 命令。一些不可缺少的生产力操作符包括: -`:E` | 打开资源管理器,用于定位文件和目录。 +操作符 | 说明 --- | --- +`:E` | 打开资源管理器,用于定位文件和目录。 `.` | 重复上次的编辑操作。 `;` | 向前重复上一次的动作或移动 `,` | 向后重复上一次的动作或移动。 @@ -97,30 +98,30 @@ Vim 依赖于不同的模式来定义键盘的敲击行为。需要了解的重 `*` | 查找光标所在处的单词的下一个出现的地方。 `#` | 查找光标所在处的单词的上一次出现的地方。 `~` | 切换大小写。 -`%` | 在打开和关闭的 `()`、`[]` 和 `{}` 之间切换;对编码非常有用。 +`%` | 在 `()`、`[]` 和 `{}` 的开闭符号之间切换;对编码非常有用。 `z=` | 提出拼写建议。 ### 像钢琴一样弹奏 Vim -把 Vim 的操作符“语言”记在记忆中是很重要的,但要想掌握它,难点在于学会像音乐家一样思考,把操作符和动作组合成“和声和弦”,这样你就可以像弹钢琴一样弹奏 Vim。这就是 Vim 的文本操作能力可以与另一个著名的命令行编辑器 Emacs 相媲美的地方。(虽然其中一个编辑器会让磨损掉你的 `Esc` 键,而另一个编辑器会让你的 `Ctrl` 键磨损掉。) +尽管把 Vim 的操作符“语言”记在记忆中是很重要的,但要想掌握它,难点在于学会像音乐家一样思考,把操作符和动作组合成“和弦”,这样你就可以像弹钢琴一样弹奏 Vim。这就是 Vim 的文本操作能力可以与另一个著名的命令行编辑器 Emacs 相媲美的地方。(虽然其中一个编辑器会让磨损掉你的 `Esc` 键,而另一个编辑器会让你的 `Ctrl` 键磨损掉。) -在描述和弦时,Vim 中的传统做法是用大写字母 `C` 来指代 `Ctrl` 键,后面加上一个连字符(`C-`)。这并不是通用的,但我将从这里开始遵循这一惯例,并在有可能引起混淆的时候加以说明。 +在描述键“和弦”时,Vim 中的传统做法是用大写字母 C 后面加上一个连字符(`C-`)来指代 `Ctrl` 键。这并不是通用的,但我将从这里开始遵循这一惯例,并在有可能引起混淆的时候加以说明。 -如果你在 Vim 中键入长行,你会想把它设置成可以换行你的文字。想要根据你的工作方式对 Vim 进行个性化设置,请考虑一下这个设置:当 Vim 启动时,你希望 Vim 默认情况下如何处理文本换行?开着还是关着?我喜欢将其关闭,并在运行时用命令打开它。当我想让文本换行时,我只需在命令行模式下用 `:set wrap` 设置即可。 +如果你在 Vim 中键入长行,你会想把它设置成可以换行。想要根据你的工作方式对 Vim 进行个性化设置,请考虑一下这个设置:默认情况下,你希望 Vim 启动时如何处理文本换行?开还是关?我喜欢将其关闭,并将其留在运行命令文件之外。当我想让文本自动换行时,我只需在命令行模式下用 `:set wrap` 设置即可。 -让 Vim 设置为默认文字换行并没有什么问题。这只是一个偏好的问题 —— 它可能随着时间的推移而改变。同样你也可以控制粘贴、代码语言缩进语法和 `Tab` 键的设置(制表符还是空格?多少个空格?可也在[这里][9]深入研究这些选项)。所有这些默认行为的选项都是完全可配置的,并且在你使用命令行模式操作时可以实时更改。 +让 Vim 设置为默认情况下自动换行并没有错,这只是一个偏好问题 —— 它可能随着时间的推移而改变。同样你也可以控制粘贴、代码语言缩进语法和 `Tab` 键的设置(制表符还是空格?多少个空格?可也在[这里][9]深入研究这些选项)。所有这些默认行为的选项都是完全可配置和可更改的,并且在你使用命令行模式操作时可以实时更改。 -你会在社区论坛、Vim 维基和文章中找到很多关于设置 Vim 默认设置的建议(比如这篇文章)。为你的个人计算环境设置首选项对你来说应该相当熟悉,Vim 也不例外。我强烈建议你从对你的设置进行非常小的更改开始,慢慢地进行更多的更改,这样你就可以轻松地恢复设置。这样一来,你就可以避免使用插件好多年或完全不用。 +你会在社区论坛、Vim 维基和文章(比如这篇文章)中找到很多关于设置 Vim 默认设置的建议。你应该很熟悉为你的个人计算环境设置首选项,Vim 也不例外。我强烈建议你从对设置进行很小的更改开始,慢慢地进行其它更改,以便你可以轻松地恢复设置。这样一来,你就可以好多年避免使用插件或完全不用插件。 -### Vim 8.2中的分割、标签和终端 +### Vim 8.2 中的分割、标签和终端 有两种方法可以将你正在处理的文件分割成不同的视图:它们可以并排显示,也可以使用应用程序标签页在全屏(窗口)中切换。这些对应用程序窗口的更改是从命令模式启动的,这需要使用冒号(`:`)来调起提示符。 -每个分割的窗口可以容纳一个文件进行编辑,你可以通过标签页在更多的文件之间随意切换。分割的屏幕空间是有限的,所以当你想分割更多的屏幕时,标签页是很方便的。想要如何设置,纯属个人喜好的问题。要横向分割一个窗口,使用 `:sp`,垂直分割时使用 `:vs`。 +每个分割的窗口可以容纳一个文件进行编辑,你可以通过标签页在更多的文件之间随意切换。分割的屏幕空间有限,所以当你想分割更多的屏幕时,标签页是很方便的。想要如何设置,纯属个人喜好的问题。要水平分割一个窗口,使用 `:sp`,垂直分割时使用 `:vs`。 -从 [Vim 8.2][10] 开始,你可以用 `:vert term` 打开一个垂直分割的终端 shell 子进程,来在你的代码旁边在命令行进行操作。你需要键入 `exit` 来关闭你的终端进程,就像你结束一个 shell 会话一样,但你关闭这个分割的窗口和标签页的方式和关闭任何普通的 Vim 窗口一样,用 `:q` 来关闭。 +从 [Vim 8.2][10] 开始,你可以用 `:vert term` 打开一个垂直分割的终端 shell 子进程,以在你的代码旁边的命令行上进行操作。你需要键入 `exit` 来关闭你的终端进程,就像你结束一个 shell 会话一样,但你关闭这个分割的窗口和标签页的方式和关闭任何普通的 Vim 窗口一样,要用 `:q` 来关闭。 -要初始化一个标签页,请使用一个特殊的编辑命令:`:tabedit`,它会自动切换到新打开的标签页。如果你给该命令一个文件名作为参数,将会打开该文件并进行编辑。如果你忽略了给它一个文件名作为参数,可以在命令行模式下的使用编辑命令 `:e filename.txt`,就像在任何一个普通的 Vim 窗口中一样。可以使用下一个(`:tabn`)和上一个(`:tabp`)命令在标签页间导航。 +要初始化一个标签页,请使用一个特殊的编辑命令:`:tabedit`,它会自动切换到新打开的标签页。如果你给该命令一个文件名作为参数,会打开该文件并进行编辑。如果你忽略了给它一个文件名作为参数,可以在命令行模式下的使用编辑命令 `:e filename.txt`,就像在任何一个普通的 Vim 窗口中一样。可以使用下一个(`:tabn`)和上一个(`:tabp`)命令在标签页间导航。 要使用分割,你需要知道如何使用组合键 `C-w` 和你想要移动的方向的移动键,例如左(`h`)、下(`j`)、左(`k`)、右(`l`)。如果你想学习更多的组合键,请阅读 Vim 手册中的 `:help split` 和 `:help tabpage`。 @@ -137,7 +138,7 @@ via: https://opensource.com/article/20/3/vim-skills 作者:[Detlef Johnson][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4afce28ccd3222f72b7b40eca505ec7f019ef9ba Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Apr 2020 23:25:38 +0800 Subject: [PATCH 0140/1809] PUB @wxy https://linux.cn/article-12077-1.html --- .../20200331 5 ways to level up your Vim skills.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200331 5 ways to level up your Vim skills.md (99%) diff --git a/translated/tech/20200331 5 ways to level up your Vim skills.md b/published/20200331 5 ways to level up your Vim skills.md similarity index 99% rename from translated/tech/20200331 5 ways to level up your Vim skills.md rename to published/20200331 5 ways to level up your Vim skills.md index 53e49926dd..487f0247ba 100644 --- a/translated/tech/20200331 5 ways to level up your Vim skills.md +++ b/published/20200331 5 ways to level up your Vim skills.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12077-1.html) [#]: subject: (5 ways to level up your Vim skills) [#]: via: (https://opensource.com/article/20/3/vim-skills) [#]: author: (Detlef Johnson https://opensource.com/users/deckart) From b740f3639678facffcad42187f778ae473460ac1 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sun, 5 Apr 2020 23:27:08 +0800 Subject: [PATCH 0141/1809] Update 20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md --- ...pt in Ubuntu- What is It and How to Use it.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md index 7026431f0c..b84bcf7c57 100644 --- a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md +++ b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md @@ -8,36 +8,48 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) The Keyring Concept in Ubuntu: What is It and How to Use it? +认识Ubuntu里的密钥环 ====== If you use [automatic login in Ubuntu][1] or other Linux distributions, you might have come across a pop-up message of this sort: +如果你使用ubuntu里的自动登录功能或者其他的Linux发行版, 你可能遇到过这种弹出消息: -**Enter password to unlock your login keyring -The login keyring did not get unlocked when you logged into your computer.** +**Enter password to unlock your login keyring 请输入密码解锁你的登录密钥环 +The login keyring did not get unlocked when you logged into your computer. 当你登录时登录密钥环未被解锁** ![Enter Password To Unlock Your Login Keyring Ubuntu][2] It keeps on popping up several times before disappearing if you keep on clicking cancel. You may wonder why do you keep seeing this keyring message all the time? +你需要点击多次取消才能让它消失。你可能想知道为什么系统会一直提示这个密钥环消息框? Let me tell you something. It’s not an error. It’s a security feature. +让我来告诉你答案。它其实并没有出错,它只是一个安全特性。 Surprised? Let me explain the keyring concept in Linux. +奇怪吗?下面就让我来解释下Linux里的密钥环概念。 ### What is keyring in Linux and why is it used? +Linux里的密钥环是什么以及为什么需要它? ![][3] Why do you use a keyring (also called [keychain][4]) in the real life? You use it to keep one or more keys grouped together so that they are easy to find and carry. +在现实生活中你为什么要用一个钥匙环(也叫钥匙链)? 你用它把一把或多把钥匙挂到一起, 以便于携带和寻找。 It’s the same concept in Linux. The keyring feature allows your system to group various passwords together and keep it one place. +Linux里也是类似的。密钥环功能使您的系统可以将各种密码放在一起,并将其保存在一个地方。 Most desktop environments like GNOME, KDE, Xfce etc use an implementation of [gnome-keyring][5] to provide this keyring feature in Linux. +大多数Linux桌面环境像GNOME, KDE, Xfce等采用gnome的密钥环实现来提供这个功能。 This keyring keeps your ssh keys, GPG keys and keys from applications that use this feature, like Chromium browser. By default, the **keyring is locked with a master password** which is often the login password of the account. +该密钥环保存了ssh密钥,GPG密钥以及使用此功能的应用程序(例如Chromium浏览器)的密钥。 默认情况下,**“密钥环”通过主密码来保护**,该密码通常是帐户的登录密码。 Every user on your system has its own keyring with (usually) the same password as that of the user account itself. When you login to your system with your password, your keyring is unlocked automatically with your account’s password. +系统上的每个用户都有自己的密钥环,(通常)密码与用户帐户本身的密码相同。 当您使用密码登录系统时,您的密匙环将使用您帐户的密码自动解锁。 The problem comes when you [switch to auto-login in Ubuntu][1]. This means that you login to the system without entering the password. In such case, your keyring is not unlocked automatically. +当您[启用Ubuntu中的自动登录功能时][1]时,就有问题了。这意味着您无需输入密码即可登录系统。 在这种情况下,您的密钥环不会自动解锁。 #### Keyring is a security feature From dd2301299b010ff80108cf6f445c6114162df5e9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 6 Apr 2020 00:53:57 +0800 Subject: [PATCH 0142/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200406=20Meet?= =?UTF-8?q?=20LBRY,=20A=20Blockchain-based=20Decentralized=20Alternative?= =?UTF-8?q?=20to=20YouTube?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200406 Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube.md --- ...ed Decentralized Alternative to YouTube.md | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 sources/tech/20200406 Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube.md diff --git a/sources/tech/20200406 Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube.md b/sources/tech/20200406 Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube.md new file mode 100644 index 0000000000..6c6c84e084 --- /dev/null +++ b/sources/tech/20200406 Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube) +[#]: via: (https://itsfoss.com/lbry/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube +====== + +_**LBRY is a new Blockchain-based, open source platform for sharing digital content. It is gaining popularity as a decentralized alternative to YouTube but LBRY is more than just a video sharing service.**_ + +### LBRY is an open source blockchain based platform for content sharing + +At the core of it, [LBRY][1] is a new protocol which is a peer to peer, decentralized file sharing and payment network secured by [blockchain][2] technology. Anyone can build apps on top of LBRY protocol that interact with digital content on the LBRY network. But these technical stuff is for developers. + +As a user you can use [LBRY platform][3] for watching videos, listening to music and reading eBooks. + +As a content creator, you can use LBRY to share your digital content like video, music, images, podcasts, eBooks etc. + +Unlike YouTube, your activities are not tracked to serve you ads. In fact, LBRY is ad free. If you are logged into the network, you won’t see any ads anywhere on its website. + +### No ads, and you may even earn cryptocurrency for viewing videos on LBRY + +The LBRY is ‘governed’ by its own cryptocurrency called LBC (LBRY Credits). + +Like any other cryptocurrency, you can mine it, buy it or get it from someone else. Content creators can set a price in LBC for streaming their content or they can provide it for free and get tipped in LBC by the viewers. + +Don’t worry, you don’t necessarily need to buy LBC. Since its new, you’ll get LBC as rewards for doing simple tasks as viewing videos, exploring LBRY, following channels etc. In fact, you’ll get a few LBC simply for creating an account at LBRY and setting up your profile. + +![LBRY Rewards Sample][4] + +You’ll also get LBC in rewards for inviting other users to LBRY platform. For example, if you join [LBRY from It’s FOSS invite link][5], both you and I get LBC as reward. + +The LBRY reward system will change once the platform grows. Remember initially Bitcoins were also readily available and now it values thousands of dollars. + +### Open source, peer to peer, blockchain: LBRY ticks all the right blocks for a privacy-aware user + +![LBRY interface][6] + +While the cyptocurrency is essential to create a fair and open marketplace in LBRY, its main feature is the peer to peer, decentralized network using blockchain. LBRY puts emphasis on treating you as user, not a product. + +Everything built to power LBRY is open source. You can find the entire source code on its GitHub repository. + +[LBRY on GitHub][7] + +The [LBRY FAQ page][8] is a good resource to know more about LBRY and how it works. + +### Using LBRY + +![][9] + +If you want to give LBRY a try, you can check out its [video sharing platform][3]. If you are logged in or using its app, you won’t see any ads. + +Creating an account on LBRY will also let you get the LBRY rewards (i.e. the LBC cryptocurrency). You can watch the videos on LBRY web site or on its application. + +I have noticed that video streaming is slightly faster when you use the app instead of web browser. [LBRY app is available][10] for Linux, Windows, macOS, iOS and Android. + +As a web publisher, It’s FOSS is on all major social media channels. We appreciate and respect such decentralized services and try to make a presence on such offbeat platform. You can [find us on Mastodon][11], a [decentralized alternative to Twitter][12]. You can also find It’s FOSS on LBRY. + +While we will be putting our video content primarily on YouTube and Vimeo (for ad-free experience), our YouTube content will be automatically available on LBRY as well. + +So if you are going to use LBRY, you can follow us there to watch all our videos on LBRY. + +[Join LBRY and follow It’s FOSS][5] + +### Conclusion + +There may not be a lot of content on LBRY right now. LBRY is trying to encourage and reward creators who publish on LBRY first instead of YouTube. + +LBRY is in early stages but its team is working hard to become a viable alternative to YouTube. It has an open road map where they have shared an insight into all their future plans. You may [check it out yourself][13]. + +By the way, LBRY is not the only platform of this kind. [PeerTube][14] is a similar service that provides a peer to peer video sharing platform. + +_**If you are someone who doesn’t like tech giants like Google, Microsoft, Huawei ‘spying’ on your data, keeping a profile of you to serve you targeted ads, you may try platforms like PeerTube and LBRY.**_ + +What do you think of LBRY? Are you already using something like LBRY or PeerTube? If not, are you willing to give it a try? What’s your overall feeling about P2P platforms like LBRY? Do share your views in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/lbry/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://lbry.com/ +[2]: https://en.wikipedia.org/wiki/Blockchain +[3]: https://lbry.tv/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry-rewards-sample.png?ssl=1 +[5]: https://lbry.tv/$/invite/@itsfoss:0 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry.png?ssl=1 +[7]: https://github.com/lbryio/ +[8]: https://lbry.com/faq +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry-interface.jpg?ssl=1 +[10]: https://lbry.com/get +[11]: https://mastodon.social/@itsfoss +[12]: https://itsfoss.com/mastodon-open-source-alternative-twitter/ +[13]: https://lbry.com/roadmap +[14]: https://joinpeertube.org/ From 7c43be9ed00020ca35be8a1d949c87e117a9875a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 6 Apr 2020 00:55:18 +0800 Subject: [PATCH 0143/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200405=20Book?= =?UTF-8?q?=20review:=20Nine=20Lies=20About=20Work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200405 Book review- Nine Lies About Work.md --- ...00405 Book review- Nine Lies About Work.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20200405 Book review- Nine Lies About Work.md diff --git a/sources/tech/20200405 Book review- Nine Lies About Work.md b/sources/tech/20200405 Book review- Nine Lies About Work.md new file mode 100644 index 0000000000..a4c06438aa --- /dev/null +++ b/sources/tech/20200405 Book review- Nine Lies About Work.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Book review: Nine Lies About Work) +[#]: via: (https://opensource.com/open-organization/20/4/book-review-nine-lies-about-work) +[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland) + +Book review: Nine Lies About Work +====== +An examination of common work misconceptions and how open organizations +are often ahead of the curve. +![Carrot on a stick][1] + +In _Nine Lies About Work_, authors Marcus Buckingham and Ashley Goodall examine what we might consider "common theories" about aspects of contemporary organizational life—and they debunk those theories. The book's so-called "lies" are, therefore, not really lies but rather common beliefs about work that simply aren't accurate in actual working environments today. + +In this review, I'll outline all nine of those misconceptions and explain what the authors believe is really true in the case of each one. But then I'll focus more on explaining the misconceptions that are especially relevant to [open organizations][2]. + +### Liar, liar + +Buckingham and Goodall address the following nine "lies" about work. + +Lie #1—People care about which company they work for. The authors believe that people really care about which team they're directly working on. That is where we [find engagement][3]. + +Lie #2—The best plan wins. The authors believe that the best front-line intelligence and feedback wins. In this rapidly changing world, [plans only tell you where you are now][4] and where you may be in the very near future (that is, in a few weeks or months). + +Lie #3—The best companies cascade goals. The authors believe that the best companies [disseminate downward meaning][5] (that is, public purpose) to their staff. + +Lie #4—The best people are well-rounded. The authors believe that the best people are good only at specific tasks (and not _necessarily_ other tasks). + +Lie #5—People need feedback. The authors believe that people need nonjudgmental, uncritical attention, and to be recognized; they don't need criticism. + +Lie #6—People can reliably rate other people. The authors believe that people can reliably rate their own experience and [evaluate their own performance][6] often better than others can. + +Lie #7—People have potential. The authors believe that every person possesses individual needs and individual feelings of forward momentum and progress. Therefore, their potential cannot be determined. + +Lie #8—Work-life balance matters most. The authors believe that love-in-work matters most. Companies should promote each individual finding the [love of what they do at work][7], then expand on that love. Companies should promote having fun at work, but they rarely do. + +Lie #9—Leadership is a thing. The authors believe that [we each follow people with a vision][8] in which we believe. To say a person is "a good leader" is, therefore, only situational according to individual followers. No universal criteria, rule, or model for effective leadership exists. + +### Teams over companies + +Now let's take a hard look at Lie #1. The authors believe that someone seeking a job will care about the quality of a company, their status inside that company, and their pay, but as soon as work begins, team engagement becomes far more important to them. That's because teams focus on what we do on a daily basis. Those teams might even be unofficial groups inside an organization—"[internal communities][9]," we might call them. Buckingham and Goodall provide eight characteristics of great teams, and these characteristics would ring equally true in [open organization communities][2]. The authors present them separated into two categories—"We"-related and "Me"-related): + + * The members are enthusiastic about the team mission ("We"). + * Each is surrounded by people who share the same values ("We"). + * Their teammates will stand behind them when needed ("We") + * The members feel confident regarding the future of the company ("We"). + * Each member understands what is expected ("Me"). + * Everyone feels they have a chance to use their particular strengths ("Me"). According to a 2018 study from ADP Research Institute, cited in the book's appendix, if we can use our strengths that bring us joy and energizes us 20% of the time at work, total work engagement skyrockets. + * All members can be recognized for excellent work ("Me"). + * The members are challenged to grow ("Me"). + + + +All these characteristics describe a healthy culture in an open organization community. + +According to the authors, a company should explore what [informal, unofficial teams][10] it has and learn what they're involved in. Usually, they say, the average person is on five teams, each with different purposes. Ask people if they have these types of teams (or a single mentor) with whom they can consult inside the company. Larger, more formal groups are less important. + +More important, however, are lunch meetings between informal team members or chats in corners discussing how they can help each other. When I was providing sales seminars, for example, I would walk around the company cafeteria and have these discussions with global sales departments. By doing this, I developed strong communities over a 20-year period. The quality and quantities of these teams are directly connected to employee engagement and are extremely important to the success of a company, according to the authors. An organizational leader's primary job is to create an environment where these teams can grow and thrive. + +### Forget planning + +Next, let's turn to Lie #2: the best plan wins. Buckingham and Goodall believe the best front-line intelligence wins. Open organizations [rely a great deal on bottom-up management techniques][11], which fits nicely into what the authors are saying here. All the action is on the front-line, and real-time reporting to management on situational developments is extremely important, according to the authors. Conditions are changing so fast that [by the time some plans are introduced, they are already out-of-date][12]. That is why open organizations strongly believe in cultivating ground-level decision-making practices. People closest to the issues know what's happening. + +Regarding [open organization principles][2], we might note the emphasis on getting front-line information in real-time and broadly distributing it as much as possible (inclusivity, transparency, broader community), as well as encouraging and reporting front-line suggestions (collaboration, adaptability). Communication is two-way. To share information efficiently and understand when it's needed, Buckingham and Goodall believe that many small, short, frequent meetings are always more productive than large, long, infrequent ones. + +### Don't judge + +Next, let's examine Lie #5: People need feedback. The authors do recognize people's need for nonjudgmental, uncritical attention, and their desire to be recognized. A leader's level of uncritical attention is directly connected to the level of staff engagement. Just asking, "[How are you doing in your work?][13]" and "Well, how can I help?" is all that is needed. + +The authors believe that the worst managers are those that ignore people. Average managers don't ignore people, but they give negative feedback, which weakens their teams' feelings of engagement. The best managers, team leaders, or community leaders don't ignore and don't judge. At least weekly, they simply ask questions and provide help if needed. A high degree of managerial attention directly improves front-line engagement. The authors believe that it makes members feel connected, supported, and understood. + +Buckingham and Goodall believe that looking at a staff's negative qualities is a natural tendency. Therefore, leaders and managers must make strong efforts to avoid doing so. This effort is worth it, the authors argue, as it results in greater performance, engagement, and growth. For example, when I was giving sales manager training, I frequently needed to address the situation of handling sales staff coming to the manager to help them with a customer problem. I recommended that the manager just ask the sales staff a simple question: "What did you do and say when you met the customer, and what would you do differently if you could visit the customer all over again?" This forced salespeople to come up with their own advice. + +### Concluding thoughts + +_Nine Lies about Work_ has much to teach anyone interested in open organizations. Buckingham is a global researcher in human strengths development and performance; Goodall is a senior VP in leadership and team intelligence at Cisco. It is amazing how closely their beliefs align with open organization principles. The ways they articulate those beliefs in this book are enlightening. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/20/4/book-review-nine-lies-about-work + +作者:[Ron McFarland][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_pink2.png?itok=I5Wgct6V (Carrot on a stick) +[2]: https://opensource.com/open-organization/resources/open-org-definition +[3]: https://opensource.com/open-organization/18/10/understanding-engagement-empowerment +[4]: https://opensource.com/open-organization/19/5/planning-future-unknowable +[5]: https://opensource.com/open-organization/18/7/culture-of-experimentation-in-4-steps +[6]: https://opensource.com/open-organization/15/5/measuring-performance-open-source-way +[7]: https://opensource.com/open-organization/15/11/reigniting-employee-passion +[8]: https://opensource.com/open-organization/18/12/what-is-open-leadership +[9]: https://opensource.com/open-organization/19/11/what-is-community-practice +[10]: https://opensource.com/open-organization/20/1/why-build-community-of-practice +[11]: https://opensource.com/open-organization/17/3/making-better-open-decisions +[12]: https://opensource.com/open-organization/18/3/try-learn-modify +[13]: https://opensource.com/open-organization/16/10/how-ask-why-without-upsetting-anyone From 0d8d697091c5286edc3981f8a63e6bf31e96f5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Mon, 6 Apr 2020 08:37:48 +0800 Subject: [PATCH 0144/1809] Translated --- ...ox Linux desktop as your window manager.md | 164 ------------------ ...ox Linux desktop as your window manager.md | 164 ++++++++++++++++++ 2 files changed, 164 insertions(+), 164 deletions(-) delete mode 100644 sources/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md create mode 100644 translated/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md diff --git a/sources/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md b/sources/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md deleted file mode 100644 index 6d1d84b9bd..0000000000 --- a/sources/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md +++ /dev/null @@ -1,164 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use the Fluxbox Linux desktop as your window manager) -[#]: via: (https://opensource.com/article/19/12/fluxbox-linux-desktop) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Use the Fluxbox Linux desktop as your window manager -====== -This article is part of a special series of 24 days of Linux desktops. -Fluxbox is very light on system resources, yet it has vital Linux -desktop features to make your user experience easy, blazingly efficient, -and unduly fast. -![Text editor on a browser, in blue][1] - -The concept of a desktop may differ from one computer user to another. Many people see the desktop as a home base, or a comfy living room, or even a literal desktop where they place frequently used notepads, their best pens and pencils, and their favorite coffee mug. KDE, GNOME, Pantheon (and so on) provide that kind of comfort on Linux. - -But for some users, the desktop is just empty monitor space, a side effect of not yet having any free-floating application windows projected directly onto their retina. For these users, the desktop is a void over which they can run applications—whether big office and graphic suites, or a simple terminal window, or docked applets—to manage services. This model of operating a [POSIX][2] computer has a long history, and one branch of that family tree is the *box window managers: Blackbox, Fluxbox, and Openbox. - -[Fluxbox][3] is a window manager for X11 systems that's based on an older project called Blackbox. Blackbox development was waning when I discovered Linux, so I fell into Fluxbox, and I've used it ever since on at least one of my active systems. It is written in C++ and is licensed under the MIT open source license. - -### Installing Fluxbox - -You are likely to find Fluxbox included in the software repository of your Linux distribution, but you can also find it on [Fluxbox.org][4]. If you're already running a different desktop, it's safe to install Fluxbox on the same system because Fluxbox doesn't predetermine any configuration or accompanying applications. - -After installing Fluxbox, log out of your current desktop session so you can log into your new one. By default, your session manager (KDM, GDM, LightDM, or XDM, depending on your setup) will continue to log you into your previous desktop, so you must override that before logging in. - -To override the desktop with GDM: - -![Select your desktop session in GDM][5] - -Or with KDM: - -![Select your desktop session with KDM][6] - -### Configuring the Fluxbox desktop - -When you first log in, the screen is mostly empty because all Fluxbox provides are panels (for a taskbar, system tray, and so on) and window decoration for application windows. - -![Default Fluxbox configuration on CentOS 7][7] - -If your distribution delivers a plain Fluxbox desktop, you can set a background for your desktop using the **feh** command (you may need to install it from your distribution's repository). This command has a few options for setting the background, including **\--bg-fill** to fill the screen with your wallpaper of choice, **\--bg-scale** to scale it to fit, and so on. - - -``` -`$ feh --bg-fill ~/photo/oamaru/leaf-spiral.jpg` -``` - -![Fluxbox with a theme applied][8] - -By default, Fluxbox auto-generates a menu, available with a right-click anywhere on the desktop, that gives you access to applications. Depending on your distribution, this menu may be very minimal, or it may list all the launchers in your **/usr/share/applications** directory. - -Fluxbox configuration is set in text files, and those text files are contained in the **$HOME/.fluxbox** directory. You can: - - * Set keyboard shortcuts in **keys** - * Set startup services and applications in **startup** - * Set desktop preferences (such as the number of workspaces, locations of panels, and so on) in **init** - * Set menu items in **menu** - - - -The text configuration files are easy to reverse-engineer, but you also can (and should) read the Fluxbox [documentation][9]. - -For example, this is my typical menu (or at least the basic structure of it): - - -``` -# to use your own menu, copy this to ~/.fluxbox/menu, then edit -# ~/.fluxbox/init and change the session.menuFile path to ~/.fluxbox/menu - -[begin] (fluxkbox) - [submenu] (apps) {} -  [submenu] (txt) {} -   [exec] (Emacs 23 (text\\)) { x-terminal-emulator -T "Emacs (text)" -e /usr/bin/emacs -nw} <> -   [exec] (Emacs (X11\\)) {/usr/bin/emacs} <> -   [exec] (LibreOffice) {/usr/bin/libreoffice} -  [end] -  [submenu] (code) {} -   [exec] (qtCreator) {/usr/bin/qtcreator} -   [exec] (eclipse) {/usr/bin/eclipse} -  [end] -  [submenu] (graphics) {} -   [exec] (ksnapshot) {/usr/bin/ksnapshot} -   [exec] (gimp) {/usr/bin/gimp} -   [exec] (blender) {/usr/bin/blender} -  [end] -  [submenu] (files) {} -   [exec] (dolphin) {/usr/bin/dolphin} -   [exec] (konqueror) { /usr/bin/kfmclient openURL $HOME } -  [end] -  [submenu] (network) {} -   [exec] (firefox) {/usr/bin/firefox} -   [exec] (konqueror) {/usr/bin/konqueror} -  [end] - [end] -## change window manager or work env -[submenu] (environments) {} - [restart] (flux)  {/usr/bin/startfluxbox} - [restart] (ratpoison)  {/usr/bin/ratpoison} - [exec] (openIndiana) {/home/kenlon/qemu/startSolaris.sh} -[end] - -[config] (config) - [submenu] (styles) {} -  [stylesdir] (/usr/share/fluxbox/styles) -  [stylesdir] (~/.fluxbox/styles) - [end] -[workspaces] (workspaces) -[reconfig] (reconfigure) -[restart] (restart) -[exit] (exeunt) -[end] -``` - -The menu also provides a few preference settings, such as the ability to pick a theme and restart or log out from your Fluxbox session. - -I launch most applications using keyboard shortcuts, which are entered into the **keys** configuration file. Here are some examples (the **Mod4** key is the Super key, which I use to designate global shortcuts): - - -``` -# open apps -Mod4 t :Exec konsole -Mod4 k :Exec konqueror -Mod4 z :Exec fbrun -Mod4 e :Exec emacs -Mod4 f :Exec firefox -Mod4 x :Exec urxvt -Mod4 d :Exec dolphin -Mod4 q :Exec xscreensaver-command -activate -Mod4 3 :Exec ksnapshot -``` - -Between these shortcuts and an open terminal, I have little use for a mouse during most of my workday, so there's no wasted time switching from one controller to another. And because Fluxbox stays well out of the way, there's little distraction. - -### Why you should use Fluxbox - -Fluxbox is very light on system resources, yet it has vital features to make your user experience easy, blazingly efficient, and unduly fast. It's simple to customize, and it allows you to define your own workflow. You don't have to use Fluxbox's panels, because there are other excellent panels out there. You can even middle-click and drag two separate application windows into one another so that they become one window, each in its own tab. - -The possibilities are endless, so try the steady simplicity that is Fluxbox on your Linux box today! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/fluxbox-linux-desktop - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) -[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[3]: http://fluxbox.org -[4]: http://fluxbox.org/download/ -[5]: https://opensource.com/sites/default/files/advent-gdm_0.jpg (Select your desktop session in GDM) -[6]: https://opensource.com/sites/default/files/advent-kdm.jpg (Select your desktop session with KDM) -[7]: https://opensource.com/sites/default/files/advent-fluxbox-default.jpg (Default Fluxbox configuration on CentOS 7) -[8]: https://opensource.com/sites/default/files/advent-fluxbox-green.jpg (Fluxbox with a theme applied) -[9]: http://fluxbox.org/features/ diff --git a/translated/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md b/translated/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md new file mode 100644 index 0000000000..3fd04333d3 --- /dev/null +++ b/translated/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md @@ -0,0 +1,164 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use the Fluxbox Linux desktop as your window manager) +[#]: via: (https://opensource.com/article/19/12/fluxbox-linux-desktop) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +使用 Fluxbox Linux desktop 作为你的窗口管理器 +====== +这篇文章是Linux 桌面24天的特别系列的一部分。 +Fluxbox 对系统资源的占用非常轻量,但是它拥有重要的 Linux +桌面特色来使你的用户体验轻松快速高效。 +![在蓝色区域中是,在浏览器上的文本编辑器][1] + +桌面的概念可谓是仁者见仁智者见智。很多人把桌面看作一个家基地,或者一个舒适的客厅,甚至是一个字面意义上的桌面,在其中放置着他们经常使用的记事本,最好的笔和铅笔,还有他们最喜欢的咖啡杯。KDE, GNOME, Pantheon (等等)在 Linux 上提供了这种舒适的生活方式。 + +但是对一些用户来说,桌面只是一个空荡荡的监控控件,将还没有自由浮动的应用程序窗口直接投射到显示器上的一个侧面效果。对于这些用户来说,桌面是真空的,在其中他们可以运行应用程序—不管的大型办公软件和图形套件,还是一个简单的终端窗口,或是来管理服务的停靠小程序。这种操作一台 [POSIX][2] 计算机的模式有很长的历史,该家族树的一支是 *box 窗口管理器:Blackbox, Fluxbox 和 Openbox 。 + +[Fluxbox][3] 是一个针对 X11 系统的窗口管理器,它基于一个较老的名为 Blackbox 的项目。当我发现 Linux 时,Blackbox 的开发已进入衰退期,因此我进入 Fluxbox ,此后我至少在一个以上的活跃的系统上使用它。它使用 C++ 编写,并在 MIT 开源许可证下授权。 + +### 安装 Fluxbox + +你很可能会在你的 Linux 发行版的存储库中找到 Fluxbox ,但是你也可以在 [Fluxbox.org][4] 上找到它。如果你正在运行一个不同的桌面,在同一个系统上安装 Fluxbox 是安全的,因为 Fluxbox 不预先决定任何配置或附带应用程序。 + +在安装 Fluxbox 后,注销你当前的桌面会话,以便你可以登录一个新的桌面会话。默认情况下,你的桌面会话管理器 (KDM, GDM, LightDM 或 XDM,取决于你的安装设置) 将你继续登录到上一个在桌面,所以你在登录前必需要覆盖上一个桌面。 + +使用 GDM 覆盖一个桌面: + +![在 GDM 中选择你的桌面会话][5] + +或者使用 KDM: + +![使用 KDM 选择你的桌面会话][6] + +### 配置 Fluxbox 桌面 + +当你第一次登录到桌面时,屏幕大部分是空的,因为 Fluxbox 提供的所有东西是面板(用于任务栏,系统托盘等等)和用于应用程序窗口的窗口装饰品。 + +![在 CentOS 7 上的默认 Fluxbox 配置][7] + +如果你的发行版提供一个简单的 Fluxbox 桌面,你可以使用 **feh** 命令 (你可能需要从你的发行版存储库中来安装它) 来为你的桌面设置背景。这个命令有一些用于设置背景的选项,包括使用你选择的墙纸来填充屏幕的 **\--bg-fill** ,来按比例缩放的 **\--bg-scale** 等等选项。 + + +``` +`$ feh --bg-fill ~/photo/oamaru/leaf-spiral.jpg` +``` + +![应用主题的 Fluxbox ][8] + +默认情况下,Fluxbox 自动生成一个菜单,在桌面上任意位置右键单击可用该菜单,这给予你访问应用程序的能力。取决于你的发行版,这个菜单可能非常小,也可能列出 **/usr/share/applications** 目录中的所有启动程序。 + +Fluxbox 配置是在文本文件中设置的,这些文本文件包含在 **$HOME/.fluxbox** 目录中。你可以: + + * 在 **keys** 中设置键盘快捷键 + * 在 **startup** 中启动服务和应用程序 + * 在 **init** 设置桌面首选项(例如工作区数量、面板位置等等) + * 在 **menu** 中设置菜单项 + + + +该文本配置文件非常易于逆向工程,但是你也可以 (并且是应该) 阅读 Fluxbox [文档][9] 。 + +例如,这是我的典型菜单 (或者说至少有它的基本结构): + + +``` +# 为使用你自己的菜单,复制这些文本到 ~/.fluxbox/menu,然后编辑 +# ~/.fluxbox/init ,并更改 session.menuFile 文件到 ~/.fluxbox/menu + +[begin] (fluxkbox) + [submenu] (apps) {} + [submenu] (txt) {} + [exec] (Emacs 23 (text\)) { x-terminal-emulator -T "Emacs (text)" -e /usr/bin/emacs -nw} <> + [exec] (Emacs (X11\)) {/usr/bin/emacs} <> + [exec] (LibreOffice) {/usr/bin/libreoffice} + [end] + [submenu] (code) {} + [exec] (qtCreator) {/usr/bin/qtcreator} + [exec] (eclipse) {/usr/bin/eclipse} + [end] + [submenu] (graphics) {} + [exec] (ksnapshot) {/usr/bin/ksnapshot} + [exec] (gimp) {/usr/bin/gimp} + [exec] (blender) {/usr/bin/blender} + [end] + [submenu] (files) {} + [exec] (dolphin) {/usr/bin/dolphin} + [exec] (konqueror) { /usr/bin/kfmclient openURL $HOME } + [end] + [submenu] (network) {} + [exec] (firefox) {/usr/bin/firefox} + [exec] (konqueror) {/usr/bin/konqueror} + [end] + [end] +## 更改窗口管理器或工作环境 +[submenu] (environments) {} + [restart] (flux) {/usr/bin/startfluxbox} + [restart] (ratpoison) {/usr/bin/ratpoison} + [exec] (openIndiana) {/home/kenlon/qemu/startSolaris.sh} +[end] + +[config] (config) + [submenu] (styles) {} + [stylesdir] (/usr/share/fluxbox/styles) + [stylesdir] (~/.fluxbox/styles) + [end] +[workspaces] (workspaces) +[reconfig] (reconfigure) +[restart] (restart) +[exit] (exeunt) +[end] +``` + +该菜单也提供一些首选项设置,例如,选择一个主题和从 Fluxbox 会话中重启或注销的能力。 + +我使用键盘快捷键来启动大多数的应用程序,这些快捷键写入到 **keys** 配置文件中。这里有一些示例 ( **Mod4** 按键是超级按键,我使用其来指定全局快捷键): + + +``` +# 打开应用程序 +Mod4 t :Exec konsole +Mod4 k :Exec konqueror +Mod4 z :Exec fbrun +Mod4 e :Exec emacs +Mod4 f :Exec firefox +Mod4 x :Exec urxvt +Mod4 d :Exec dolphin +Mod4 q :Exec xscreensaver-command -activate +Mod4 3 :Exec ksnapshot +``` + +在这些快捷方式和一个打开的终端之间,在我工作日的大部分时间内很少使用鼠标,因此从一个控制器切换到另一个控制器不会浪费时间。并且因为 Fluxbox 很好地避开了控制器之间切换的方法,因此在其中操作没有一丝干扰。 + +### 为什么你应该使用 Fluxbox + +Fluxbox 对系统资源的占用非常轻量,但是它拥有重要的功能来使你的用户体验轻松快速高效。它很容易定制,并且它允许你定义你自己的工作流。你不必使用 Fluxbox 的面板,因为在这里有其它的极好的面板。你甚至可以鼠标双击和拖动两个独立的应用程序窗口到彼此之中,以便它们成为一个窗口,每个窗口都有自己的选项卡。 + + +无穷的可能性,所以今天就在你的 Linux 上尝试一下 Fluxbox 的简单稳定吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/fluxbox-linux-desktop + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) +[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[3]: http://fluxbox.org +[4]: http://fluxbox.org/download/ +[5]: https://opensource.com/sites/default/files/advent-gdm_0.jpg (Select your desktop session in GDM) +[6]: https://opensource.com/sites/default/files/advent-kdm.jpg (Select your desktop session with KDM) +[7]: https://opensource.com/sites/default/files/advent-fluxbox-default.jpg (Default Fluxbox configuration on CentOS 7) +[8]: https://opensource.com/sites/default/files/advent-fluxbox-green.jpg (Fluxbox with a theme applied) +[9]: http://fluxbox.org/features/ From 65fa4f5493d600bd4bf2c54f7445860d1ad52627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Mon, 6 Apr 2020 08:40:48 +0800 Subject: [PATCH 0145/1809] Translating --- ...nstalling Kali Linux on VirtualBox- Quickest - Safest Way.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md b/sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md index e8722c63cc..3b7629d2a6 100644 --- a/sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md +++ b/sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1c6dbb9797f719c441518b6bb33bca1fb9971e65 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 6 Apr 2020 09:59:21 +0800 Subject: [PATCH 0146/1809] translating --- ...epository (AUR)- How to Use AUR on Arch and Manjaro Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md b/sources/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md index c9c4ff7340..550ac3f9e4 100644 --- a/sources/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md +++ b/sources/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4e56d10e589e1a7c0abf59a43543f78dcc1625d6 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Mon, 6 Apr 2020 10:44:54 +0800 Subject: [PATCH 0147/1809] =?UTF-8?q?=E5=88=9D=E7=A8=BF=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ing tasks on Linux using the at command.md | 39 ++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) rename {sources => translated}/tech/20200403 Scheduling tasks on Linux using the at command.md (62%) diff --git a/sources/tech/20200403 Scheduling tasks on Linux using the at command.md b/translated/tech/20200403 Scheduling tasks on Linux using the at command.md similarity index 62% rename from sources/tech/20200403 Scheduling tasks on Linux using the at command.md rename to translated/tech/20200403 Scheduling tasks on Linux using the at command.md index 42b1025fe4..81b9d6f7a4 100644 --- a/sources/tech/20200403 Scheduling tasks on Linux using the at command.md +++ b/translated/tech/20200403 Scheduling tasks on Linux using the at command.md @@ -8,22 +8,28 @@ [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) Scheduling tasks on Linux using the at command +在 Linux 上使用 at 命令来管理任务 ====== The at command makes it easy to schedule Linux tasks to be run at any time or date you choose. Check out what it can do for you. +at 命令很容易安排 Linux 任务在你选择的任何时间或日期运行,看看它能为你做什么。 + romkaz / Getty Images When you want commands or scripts to run at some particular time, you don’t have to sit with your fingers hovering over the keyboard waiting to press the enter key or even be at your desk at the right time. Instead, you can set your task to be run through the **at** command. In this post, we’ll look at how tasks are scheduled using **at**, how you can precisely select the time you want your process to run and how to view what’s been scheduled to run using **at**. +当你想要命令或脚本在某个特定时间运行时,你不需要用你的手指在键盘上盘旋等待按下 enter 键,甚至在特定时间坐在办公桌前。相反,你可以通过 **at** 命令来设置任务。在本文中,我们将研究如何使用 **at** 来安排任务,如何精确选择要运行的时间以及如何查看使用 **at** 安排的时间。 ### at vs cron For those who’ve been scheduling tasks on Linux systems using **cron**, the **at** command is something like **cron** in that you can schedule tasks to run at a selected time, but **cron** is used for jobs that are run periodically – even if that means only once a year. Most **cron** jobs are set up to be run daily, weekly or monthly, though you control how often and when. +对于那些使用 **cron** 在 Linux 系统上计划任务的人来说,**at** 命令类似于 **cron**,因为你可以计划在选定时间运行的任务,但是 **cron** 用于定期运行的工作-即使着意味着每年仅一次。大多数 **cron** 作业都设置为每天,每周或每月运行,尽管你可以控制频率和时间。 The **at** command, on the other hand, is used for tasks which are run only once. Want to reboot your system at midnight tonight? No problem, **at** can do that for you assuming you have the proper permissions. If you want the system rebooted every Saturday night at 2 a.m., use **cron** instead. +另一方面,**at** 命令用于仅运行一次的任务。是否想在今晚午夜重启系统?没问题,假设你拥有适当的权限,**at** 可以为你完成此操作。如果你希望系统在每个星期六晚上凌晨 2 点重启,请改用 **cron**。 -### Using at +### 使用 at The **at** command is easy to use ,and there are only a few things to remember. A simple use of **at** might look like this: - +**at** 命令易于使用,只需记住几件事。**at** 的简单用法如下所示: ``` $ at 5:00PM at> date >> thisfile @@ -31,11 +37,13 @@ at> ``` After typing “at” and the time the command should be run, **at** prompts you for the command to be run (in this case, the **date** command). Type **^D** to complete your request. +在输入 "at" 并允许命令的时间后,**at** 会提示你运行该命令(在这种情况下,是 "date" 命令)。输入 **^D** 来完成请求。 Assuming we set up this **at** command earlier than 5 p.m., the date and time will be added to the end of a file named “thisfile” later the same day. Otherwise, the command will run at 5 p.m. the following day. +假设我们在下午 5 点之前设置此 **at** 命令,那么日期和时间将在当天晚些时候添加到名为 "thisfile" 的文件的末尾。否则,该命令将在下午 5 点运行。 You can enter more than one command when interacting with the **at** command. If you want more than one command to be run at the same time, simply specify more than one command line: - +与 **at** 命令进行交互时,可以输入多个命令。如果要同时运行多个目录,只需指定多个命令行即可: [][1] ``` @@ -47,8 +55,10 @@ at> ``` In the commands above, we’re using a regular user account and adding some simple text to a file in that user’s home directory. If it’s after 6:22 a.m. when this command is run, the command will run the following day because 6:22 is taken to mean 6:22 a.m. If you want it to run at 6:22 p.m., either use 6:22 PM or 18:22. “6:22 PM” also works. +在上面的命令中,我们使用常规账户,将一些简单的文本添加到该用户主目录的文件中。如果运行此命令的时间是上午 6:22 之后,则该命令将在第二天运行,因为 6:22 表示上午 6:22。如果要使其在下午 6:22 运行,使用 6:22 PM 或者 18:22。 You can use **at** to schedule commands to run on specific dates either by specifying the dates or specifying dates and times like “10:00AM April 15 2021” or “noon + 5 days” (run at noon five days from today). Here are some examples: +你可以通过指定日期或指定日期和时间,例如 “2021 年 4 月 15 日上午 10:00”或“中午 + 5 天”(从今天起中午五点运行),使用 **at** 来安排命令在特定日期运行。以下是些例子: ``` at 6PM tomorrow @@ -58,6 +68,7 @@ at 9:15 + 1000 days ``` After you specify the command to run and press **^D**, you will notice that the **at** command has assigned a job number to each request. This number will show up in the **at** command's job queue. +指定要运行的命令并按下 **^D** 后,你会注意到 **at** 命令已为每个请求分配了作业编号,此数字将显示在 **at** 命令的作业队列中。 ``` $ at noon + 1000 days @@ -67,9 +78,10 @@ at> job 36 at Tue Dec 27 12:00:00 2022 <== job # is 36 ``` -### Checking the queue +### Checking the queue检查队列 You can look at the queue of **at** jobs with the **atq** (at queue) command: +你可以使用 **atq**(at queue) 命令来查看 **at** 作业队列: ``` $ atq @@ -80,6 +92,7 @@ $ atq ``` If you need to cancel one of the jobs in the queue, use the **atrm** (at remove) command along with the job number. +如果你需要取消队列中作业之一,使用 **atrm**(at remote) 命令和作业编号: ``` $ atrm 32 @@ -90,6 +103,7 @@ $ atq ``` You can look into the details of a scheduled task using the **at -c** command. Additional details (the active search path, etc.) are also available, but the bottom lines of the output will show you what command has been scheduled to run. +你可以使用 **at -c** 命令来查看计划任务的详细信息。还可以提供其它详细信息(活动的搜索路径等),但是输出的底行将显示已计划运行的命令。 ``` $ at -c 36 | tail -6 @@ -101,10 +115,12 @@ date >> thisfile ``` Notice that the command shown begins with testing whether the user’s directory can be entered with a **cd** command. The job will exit with an error if this is not the case. Otherwise the command specified when the **at** command was issued will be run. Read the command as "move into /home/shs OR exit with the error shown". +注意,显示的命令首先测试是否可以通过 **cd** 命令输入用户目录。如果不是这种情况,作业将退出并出现错误。否则,将运行发出 **at** 目录时指定的命令。将命令读为 "move into /home/shs 或退出并显示错误"。 -### Running jobs as root +### Running jobs as root以 root 身份运行作业 To run **at** jobs as root, simply use **sudo** with your **at** command like this: +要以 root 身份运行 **at** 作业,只需将 **sudo** 与你的 **at** 命令一起使用,如下所示: ``` $ sudo at 8PM @@ -116,6 +132,7 @@ job 37 at Wed Apr 1 16:00:00 2020 ``` Notice that the root task shows up in the queue with **root** as the one to execute it. +注意,根任务以 **root** 作为执行任务显示在队列中。 ``` 35 Mon Apr 6 12:00:00 2020 a shs @@ -123,9 +140,10 @@ Notice that the root task shows up in the queue with **root** as the one to exec 37 Wed Apr 1 20:00:00 2020 a root <== ``` -### Running scripts +### 运行脚本 You can also use the **at** command to run scripts. Here's an example: +你可以使用 **at** 命令来运行脚本,这是一个例子: ``` $ at 4:30PM @@ -134,15 +152,18 @@ at> bin/tryme at> ``` -### Denying use of the at command +### Denying use of the at command 拒绝使用 at 命令 The **/etc/at.deny** file provides a way to disallow users from being able to make use of the **at** command. By default, it will probably include a list of disallowed accounts like **ftp** and **nobody**. An **/etc/at.allow** file could be used to do the opposite but, generally, only the **at.deny** file is configured. +**/etc/at.deny** 文件提供了一种禁止用户使用 **at** 命令的方法。默认情况下,它可能会包含不允许的账户列表,例如 ftp 和 nobody。可以使用 **/etc/at.allow** 文件执行相反的操作,但是通常只配置 **at.deny** 文件。 -**Wrap-Up** +**总结** The **at** command is very versatile and easy to use when you want to schedule a one-time task – even if you want it to run this afternoon or years in the future. +当你要计划一项一次性任务时,即使你希望在今天下午或将来运行该任务,**at** 命令也非常通用且易于使用。 Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind. +加入 [Facebook][2] 和 [LinkedIn][3] 上的网络世界社区,评论最火的主题。 -------------------------------------------------------------------------------- @@ -150,7 +171,7 @@ via: https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-usin 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[MjSeven](https://github.com/MjSeven) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 78dc8c4c9032bc67647356a3c3be0c7b23ac2b5d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 Apr 2020 10:47:13 +0800 Subject: [PATCH 0148/1809] Rename sources/tech/20200405 Book review- Nine Lies About Work.md to sources/talk/20200405 Book review- Nine Lies About Work.md --- .../{tech => talk}/20200405 Book review- Nine Lies About Work.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200405 Book review- Nine Lies About Work.md (100%) diff --git a/sources/tech/20200405 Book review- Nine Lies About Work.md b/sources/talk/20200405 Book review- Nine Lies About Work.md similarity index 100% rename from sources/tech/20200405 Book review- Nine Lies About Work.md rename to sources/talk/20200405 Book review- Nine Lies About Work.md From 09bf2f9f879dc108f223f86839c830122326d50d Mon Sep 17 00:00:00 2001 From: MjSeven Date: Mon, 6 Apr 2020 20:43:53 +0800 Subject: [PATCH 0149/1809] Done --- ...ing tasks on Linux using the at command.md | 73 ++++++------------- 1 file changed, 22 insertions(+), 51 deletions(-) diff --git a/translated/tech/20200403 Scheduling tasks on Linux using the at command.md b/translated/tech/20200403 Scheduling tasks on Linux using the at command.md index 81b9d6f7a4..a8986be39a 100644 --- a/translated/tech/20200403 Scheduling tasks on Linux using the at command.md +++ b/translated/tech/20200403 Scheduling tasks on Linux using the at command.md @@ -7,43 +7,34 @@ [#]: via: (https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-using-the-at-command.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -Scheduling tasks on Linux using the at command -在 Linux 上使用 at 命令来管理任务 +使用 at 命令在 Linu 上安排任务 ====== -The at command makes it easy to schedule Linux tasks to be run at any time or date you choose. Check out what it can do for you. -at 命令很容易安排 Linux 任务在你选择的任何时间或日期运行,看看它能为你做什么。 +at 命令可以很容易地安排 Linux 任务在你选择的任何时间或日期运行,让我们来看看它能为你做什么。 romkaz / Getty Images -When you want commands or scripts to run at some particular time, you don’t have to sit with your fingers hovering over the keyboard waiting to press the enter key or even be at your desk at the right time. Instead, you can set your task to be run through the **at** command. In this post, we’ll look at how tasks are scheduled using **at**, how you can precisely select the time you want your process to run and how to view what’s been scheduled to run using **at**. -当你想要命令或脚本在某个特定时间运行时,你不需要用你的手指在键盘上盘旋等待按下 enter 键,甚至在特定时间坐在办公桌前。相反,你可以通过 **at** 命令来设置任务。在本文中,我们将研究如何使用 **at** 来安排任务,如何精确选择要运行的时间以及如何查看使用 **at** 安排的时间。 +当你希望命令或脚本在某个特定时间运行时,你不需要将手指放在键盘上盘旋等待按下回车键,或者是在特定时间坐在办公桌前。相反,你可以通过 **at** 命令来设置任务。在本文中,我们将研究如何使用 **at** 来安排任务,如何精确地选择任务希望运行的时间以及如何使用 **at** 来查看安排运行的任务。 ### at vs cron -For those who’ve been scheduling tasks on Linux systems using **cron**, the **at** command is something like **cron** in that you can schedule tasks to run at a selected time, but **cron** is used for jobs that are run periodically – even if that means only once a year. Most **cron** jobs are set up to be run daily, weekly or monthly, though you control how often and when. -对于那些使用 **cron** 在 Linux 系统上计划任务的人来说,**at** 命令类似于 **cron**,因为你可以计划在选定时间运行的任务,但是 **cron** 用于定期运行的工作-即使着意味着每年仅一次。大多数 **cron** 作业都设置为每天,每周或每月运行,尽管你可以控制频率和时间。 +对于那些使用 **cron** 在 Linux 系统上安排任务的人来说,**at** 命令类似于 **cron**,因为你可以在选定的时间调度任务,但是 **cron** 用于定期运行的作业 - 甚至是每年仅一次。大多数 **cron** 作业的频率都设置为每天、每周或每月运行一次,不过你可以控制运行的频率和时间。 -The **at** command, on the other hand, is used for tasks which are run only once. Want to reboot your system at midnight tonight? No problem, **at** can do that for you assuming you have the proper permissions. If you want the system rebooted every Saturday night at 2 a.m., use **cron** instead. -另一方面,**at** 命令用于仅运行一次的任务。是否想在今晚午夜重启系统?没问题,假设你拥有适当的权限,**at** 可以为你完成此操作。如果你希望系统在每个星期六晚上凌晨 2 点重启,请改用 **cron**。 +另一方面,**at** 命令用于仅运行一次的任务。想在午夜重启系统?没问题,假设你有适当的权限,**at** 可以为你完成此操作。如果你希望系统在每个星期六凌晨 2 点重启,那么改用 **cron**。 ### 使用 at -The **at** command is easy to use ,and there are only a few things to remember. A simple use of **at** might look like this: -**at** 命令易于使用,只需记住几件事。**at** 的简单用法如下所示: +**at** 命令很容易使用,只需记住几件事。一个简单的使用 **at** 类似于这样: ``` $ at 5:00PM at> date >> thisfile at> ``` -After typing “at” and the time the command should be run, **at** prompts you for the command to be run (in this case, the **date** command). Type **^D** to complete your request. -在输入 "at" 并允许命令的时间后,**at** 会提示你运行该命令(在这种情况下,是 "date" 命令)。输入 **^D** 来完成请求。 +在输入 "at" 和应该运行命令的时间,**at** 会提示你在设定时间会运行该命令(此例中是 **`date`** 命令)。输入 **^D** 来完成请求。 -Assuming we set up this **at** command earlier than 5 p.m., the date and time will be added to the end of a file named “thisfile” later the same day. Otherwise, the command will run at 5 p.m. the following day. -假设我们在下午 5 点之前设置此 **at** 命令,那么日期和时间将在当天晚些时候添加到名为 "thisfile" 的文件的末尾。否则,该命令将在下午 5 点运行。 +假设我们在下午 5 点之前设置这个 **at** 命令,那么日期和时间将在当天下午 5 点添加到名为 "thisfile" 文件的末尾。否则,该命令将在第二天下午 5 点运行。 -You can enter more than one command when interacting with the **at** command. If you want more than one command to be run at the same time, simply specify more than one command line: -与 **at** 命令进行交互时,可以输入多个命令。如果要同时运行多个目录,只需指定多个命令行即可: +与 **at** 命令进行交互时,可以输入多个命令。如果你要同时运行多个命令,只需输入多个命令行即可: [][1] ``` @@ -54,11 +45,9 @@ at> echo second >> thisfile at> ``` -In the commands above, we’re using a regular user account and adding some simple text to a file in that user’s home directory. If it’s after 6:22 a.m. when this command is run, the command will run the following day because 6:22 is taken to mean 6:22 a.m. If you want it to run at 6:22 p.m., either use 6:22 PM or 18:22. “6:22 PM” also works. -在上面的命令中,我们使用常规账户,将一些简单的文本添加到该用户主目录的文件中。如果运行此命令的时间是上午 6:22 之后,则该命令将在第二天运行,因为 6:22 表示上午 6:22。如果要使其在下午 6:22 运行,使用 6:22 PM 或者 18:22。 +在上面的命令中,我们使用了一个普通的用户账户,将一些简单的文本添加到该用户主目录的文件中。如果在上午 6:22 之后运行这些命令,那么命令会在第二天运行,因为 6:22 表示上午 6:22。如果你想在下午 6:22 运行,使用 6:22 PM 或者 18:22,"6:22 PM" 也可以。 -You can use **at** to schedule commands to run on specific dates either by specifying the dates or specifying dates and times like “10:00AM April 15 2021” or “noon + 5 days” (run at noon five days from today). Here are some examples: -你可以通过指定日期或指定日期和时间,例如 “2021 年 4 月 15 日上午 10:00”或“中午 + 5 天”(从今天起中午五点运行),使用 **at** 来安排命令在特定日期运行。以下是些例子: +你也可以通过使用 **at** 来安排命令在指定的日期或时间运行,例如 "10:00AM April 15 2021" 或 "noon + 5 days"(从今天起 5 天内的中午运行),以下是一些例子: ``` at 6PM tomorrow @@ -67,9 +56,7 @@ at noon + 5 days at 9:15 + 1000 days ``` -After you specify the command to run and press **^D**, you will notice that the **at** command has assigned a job number to each request. This number will show up in the **at** command's job queue. -指定要运行的命令并按下 **^D** 后,你会注意到 **at** 命令已为每个请求分配了作业编号,此数字将显示在 **at** 命令的作业队列中。 - +在指定要运行的命令并按下 **^D** 后,你会注意到 **at** 命令为每个请求分配了一个作业编号,这个数字将显示在 **at** 命令的作业队列中。 ``` $ at noon + 1000 days warning: commands will be executed using /bin/sh @@ -78,11 +65,9 @@ at> job 36 at Tue Dec 27 12:00:00 2022 <== job # is 36 ``` -### Checking the queue检查队列 +### 检查队列 -You can look at the queue of **at** jobs with the **atq** (at queue) command: 你可以使用 **atq**(at queue) 命令来查看 **at** 作业队列: - ``` $ atq 32 Thu Apr 2 03:06:00 2020 a shs @@ -91,9 +76,7 @@ $ atq 34 Thu Apr 2 18:00:00 2020 a shs ``` -If you need to cancel one of the jobs in the queue, use the **atrm** (at remove) command along with the job number. -如果你需要取消队列中作业之一,使用 **atrm**(at remote) 命令和作业编号: - +如果你需要取消队列中的一个作业,使用 **atrm**(at remote) 命令和作业编号: ``` $ atrm 32 $ atq @@ -102,9 +85,7 @@ $ atq 34 Thu Apr 2 18:00:00 2020 a shs ``` -You can look into the details of a scheduled task using the **at -c** command. Additional details (the active search path, etc.) are also available, but the bottom lines of the output will show you what command has been scheduled to run. -你可以使用 **at -c** 命令来查看计划任务的详细信息。还可以提供其它详细信息(活动的搜索路径等),但是输出的底行将显示已计划运行的命令。 - +你可以使用 **at -c** 命令来查看安排任务的详细信息,其它详细信息(活动的搜索路径等)也可以,但是输出的最后一行将显示计划运行的命令。 ``` $ at -c 36 | tail -6 cd /home/shs || { @@ -114,14 +95,11 @@ cd /home/shs || { date >> thisfile ``` -Notice that the command shown begins with testing whether the user’s directory can be entered with a **cd** command. The job will exit with an error if this is not the case. Otherwise the command specified when the **at** command was issued will be run. Read the command as "move into /home/shs OR exit with the error shown". -注意,显示的命令首先测试是否可以通过 **cd** 命令输入用户目录。如果不是这种情况,作业将退出并出现错误。否则,将运行发出 **at** 目录时指定的命令。将命令读为 "move into /home/shs 或退出并显示错误"。 +注意,命令首先会测试是否可以通过 **cd** 命令进入用户目录。如果不可以,作业将退出并显示错误。如果可以,则运行在 **at** 中指定的命令。它将命令视为 “进入 /home/shs 或退出并显示错误”。 -### Running jobs as root以 root 身份运行作业 +### 以 root 身份运行作业 -To run **at** jobs as root, simply use **sudo** with your **at** command like this: 要以 root 身份运行 **at** 作业,只需将 **sudo** 与你的 **at** 命令一起使用,如下所示: - ``` $ sudo at 8PM [sudo] password for shs: @@ -131,9 +109,7 @@ at> job 37 at Wed Apr 1 16:00:00 2020 ``` -Notice that the root task shows up in the queue with **root** as the one to execute it. -注意,根任务以 **root** 作为执行任务显示在队列中。 - +注意,root 的任务以 **root** 作为执行者显示在队列中。 ``` 35 Mon Apr 6 12:00:00 2020 a shs 36 Tue Dec 27 12:00:00 2022 a shs @@ -142,9 +118,7 @@ Notice that the root task shows up in the queue with **root** as the one to exec ### 运行脚本 -You can also use the **at** command to run scripts. Here's an example: -你可以使用 **at** 命令来运行脚本,这是一个例子: - +你还可以使用 **at** 命令来运行脚本,这里有一个例子: ``` $ at 4:30PM warning: commands will be executed using /bin/sh @@ -152,17 +126,14 @@ at> bin/tryme at> ``` -### Denying use of the at command 拒绝使用 at 命令 +### 禁止使用 at 命令 -The **/etc/at.deny** file provides a way to disallow users from being able to make use of the **at** command. By default, it will probably include a list of disallowed accounts like **ftp** and **nobody**. An **/etc/at.allow** file could be used to do the opposite but, generally, only the **at.deny** file is configured. -**/etc/at.deny** 文件提供了一种禁止用户使用 **at** 命令的方法。默认情况下,它可能会包含不允许的账户列表,例如 ftp 和 nobody。可以使用 **/etc/at.allow** 文件执行相反的操作,但是通常只配置 **at.deny** 文件。 +**/etc/at.deny** 文件提供了一种禁止用户使用 **at** 命令的方法。默认情况下,它可能会包含一个不允许的账户列表,例如 **ftp** 和 **nobody**。可以使用 **/etc/at.allow** 文件执行相反的操作,但是通常只配置 **at.deny** 文件。 **总结** -The **at** command is very versatile and easy to use when you want to schedule a one-time task – even if you want it to run this afternoon or years in the future. -当你要计划一项一次性任务时,即使你希望在今天下午或将来运行该任务,**at** 命令也非常通用且易于使用。 +当你要安排一项一次性任务时,即使你希望在今天下午或几年后运行,**at** 命令是通用且易于使用的。 -Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind. 加入 [Facebook][2] 和 [LinkedIn][3] 上的网络世界社区,评论最火的主题。 -------------------------------------------------------------------------------- From 7e52f3cbb00acb5cf9a8b9f4e657074f163c2360 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 6 Apr 2020 21:42:51 +0800 Subject: [PATCH 0150/1809] PRF @MjSeven --- ...20200325 Linux firewall basics with ufw.md | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/translated/tech/20200325 Linux firewall basics with ufw.md b/translated/tech/20200325 Linux firewall basics with ufw.md index e281821b70..bfdd782f85 100644 --- a/translated/tech/20200325 Linux firewall basics with ufw.md +++ b/translated/tech/20200325 Linux firewall basics with ufw.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Linux firewall basics with ufw) @@ -9,15 +9,17 @@ Linux 防火墙 ufw 简介 ====== -我们来研究下 ufw - linux 上一个简单的防火墙,它为防火墙更改提供了一些见解和命令。 + +> 我们来研究下 Linux 上的 ufw(简单防火墙),为你更改防火墙提供一些见解和命令。 ![][0] -**ufw** (简易防火墙)可以说是 [iptables][1] 的简化版,最近几年,它已经成为 Ubuntu 和 Debian 等系统上的默认防火墙。而且 **ufw** 出乎意料的简单,这对新管理员来说是一个福音,否则他们可能不得不投入大量时间来加快防火墙管理的速度。 +`ufw`(简单防火墙Uncomplicated FireWall)真正地简化了 [iptables][1],它从出现的这几年,已经成为 Ubuntu 和 Debian 等系统上的默认防火墙。而且 `ufw` 出乎意料的简单,这对新管理员来说是一个福音,否则他们可能需要投入大量时间来学习防火墙管理。 -**ufw** 也有 GUI 客户端(例如 **gufw**),但是 **ufw** 命令通常在命令行上发出。本文介绍了一些使用 **ufw** 的命令,并研究了它的工作方式。 +`ufw` 也有 GUI 客户端(例如 `gufw`),但是 `ufw` 命令通常在命令行上执行的。本文介绍了一些使用 `ufw` 的命令,并研究了它的工作方式。 -首先,查看 **ufw** 如何配置的一个快速方法是查看其配置文件 -- **/etc/default/ufw**。使用下面的命令可以查看其配置,使用 **grep** 来禁止显示空白行和注释(以 # 开头的行)。 +首先,快速查看 `ufw` 配置的方法是查看其配置文件 —— `/etc/default/ufw`。使用下面的命令可以查看其配置,使用 `grep` 来抑制了空行和注释(以 # 开头的行)的显示。 + ``` $ grep -v '^#\|^$' /etc/default/ufw IPV6=yes @@ -30,16 +32,18 @@ IPT_SYSCTL=/etc/ufw/sysctl.conf IPT_MODULES="nf_conntrack_ftp nf_nat_ftp nf_conntrack_netbios_ns" ``` -正如你所看到的,默认策略是丢弃输入但允许输出。如果你想接受专有连接,你需要单独配置。 +正如你所看到的,默认策略是丢弃输入但允许输出。允许你接受特定的连接的其它规则是需要单独配置的。 + +`ufw` 命令的基本语法如下所示,但是这个概要并不意味着你只需要输入 `ufw` 就行,而是一个告诉你需要哪些参数的快速提示。 -ufw 命令的基本语法如下所示,但是这个概要并不意味着你只需要输入 "ufw" 就能熟悉它,而是通过一个个错误提示来告诉你需要哪些参数。 ``` ufw [--dry-run] [options] [rule syntax] ``` -**\--dry-run** 选项意味着 **ufw** 不会运行你指定的命令,但你会看到它是否执行了的结果。如果进行了更改,它将显示整个规则集,因此你要做好多行输出的准备。 +`--dry-run` 选项意味着 `ufw` 不会运行你指定的命令,但会显示给你如果执行后的结果。但是它会显示假如更改后的整个规则集,因此你要做有好多行输出的准备。 + +要检查 `ufw` 的状态,请运行以下命令。注意,即使是这个命令也需要使用 `sudo` 或 root 账户。 -运行以下命令来检查 **ufw** 的状态。注意,即使此命令也需要使用 **sudo** 或 root 账户。 ``` $ sudo ufw status Status: active @@ -52,12 +56,14 @@ To Action From ``` 否则,你会看到以下内容: + ``` $ ufw status ERROR: You need to be root to run this script ``` -"verbose" 选项将提供一些其它细节: +加上 `verbose` 选项会提供一些其它细节: + ``` $ sudo ufw status verbose Status: active @@ -73,12 +79,14 @@ To Action From ``` 你可以使用以下命令轻松地通过端口号允许和拒绝连接: + ``` $ sudo ufw allow 80 <== 允许 http 访问 $ sudo ufw deny 25 <== 拒绝 smtp 访问 ``` -你可以查看 **/etc/services** 文件来找到端口号和服务名称之间的联系。 +你可以查看 `/etc/services` 文件来找到端口号和服务名称之间的联系。 + ``` $ grep 80/ /etc/services http 80/tcp www # WorldWideWeb HTTP @@ -119,7 +127,7 @@ To Action From 443/tcp (v6) ALLOW Anywhere (v6) <== ``` -**ufw** 遵循的规则存储在 **/etc/ufw** 目录中,注意,你需要 root 用户访问权限才能查看这些文件,每个文件都包含大量规则。 +`ufw` 遵循的规则存储在 `/etc/ufw` 目录中。注意,你需要 root 用户访问权限才能查看这些文件,每个文件都包含大量规则。 ``` $ ls -ltr /etc/ufw @@ -137,7 +145,8 @@ drwxr-xr-x 3 root root 4096 Nov 12 08:21 applications.d -rw-r----- 1 root root 1530 Mar 19 10:42 user6.rules ``` -本文前面所作的更改,为 **http** 访问添加了端口 **80** 和为 **https** 访问添加了端口 **443**,在 **user.rules** 和 **user6.rules** 文件中看起来像这样: +本文前面所作的更改,为 `http` 访问添加了端口 `80` 和为 `https` 访问添加了端口 `443`,在 `user.rules` 和 `user6.rules` 文件中看起来像这样: + ``` # grep " 80 " user*.rules user6.rules:### tuple ### allow tcp 80 ::/0 any ::/0 in @@ -152,13 +161,15 @@ user.rules:### tuple ### allow tcp 443 0.0.0.0/0 any 0.0.0.0/0 in user.rules:-A ufw-user-input -p tcp --dport 443 -j ACCEPT ``` -使用 **ufw**,你还可以使用以下命令轻松地阻止来自一个系统的连接: +使用 `ufw`,你还可以使用以下命令轻松地阻止来自一个 IP 地址的连接: + ``` $ sudo ufw deny from 208.176.0.50 Rule added ``` -status 命令将显示更改: +`status` 命令将显示更改: + ``` $ sudo ufw status verbose Status: active @@ -178,9 +189,7 @@ Anywhere DENY IN 208.176.0.50 <== new 443/tcp (v6) ALLOW IN Anywhere (v6) ``` -总而言之,**ufw** 不仅容易配置,而且且容易理解。 - -加入 [Facebook][4] 和 [LinkedIn][5] 上的网络世界社区,评论最火的主题。 +总而言之,`ufw` 不仅容易配置,而且且容易理解。 -------------------------------------------------------------------------------- @@ -189,7 +198,7 @@ via: https://www.networkworld.com/article/3533551/linux-firewall-basics-with-ufw 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8ac5e24cd0a87eed4bc2bdb1d22d36f591dc4d9c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 6 Apr 2020 21:43:50 +0800 Subject: [PATCH 0151/1809] PUB @MjSeven https://linux.cn/article-12079-1.html --- .../20200325 Linux firewall basics with ufw.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200325 Linux firewall basics with ufw.md (99%) diff --git a/translated/tech/20200325 Linux firewall basics with ufw.md b/published/20200325 Linux firewall basics with ufw.md similarity index 99% rename from translated/tech/20200325 Linux firewall basics with ufw.md rename to published/20200325 Linux firewall basics with ufw.md index bfdd782f85..538d1a928a 100644 --- a/translated/tech/20200325 Linux firewall basics with ufw.md +++ b/published/20200325 Linux firewall basics with ufw.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12079-1.html) [#]: subject: (Linux firewall basics with ufw) [#]: via: (https://www.networkworld.com/article/3533551/linux-firewall-basics-with-ufw.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 7d9ef64876784d5c02167a51c34785f482b6cd9f Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Mon, 6 Apr 2020 22:09:41 +0800 Subject: [PATCH 0152/1809] Update 20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md --- ...in Ubuntu- What is It and How to Use it.md | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md index b84bcf7c57..4aabc122d5 100644 --- a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md +++ b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md @@ -12,10 +12,10 @@ The Keyring Concept in Ubuntu: What is It and How to Use it? ====== If you use [automatic login in Ubuntu][1] or other Linux distributions, you might have come across a pop-up message of this sort: -如果你使用ubuntu里的自动登录功能或者其他的Linux发行版, 你可能遇到过这种弹出消息: +如果您用过[ubuntu里的自动登录功能][1]或者其他的Linux发行版, 您可能遇到过这种弹出消息: -**Enter password to unlock your login keyring 请输入密码解锁你的登录密钥环 -The login keyring did not get unlocked when you logged into your computer. 当你登录时登录密钥环未被解锁** +**Enter password to unlock your login keyring 请输入密码解锁您的登录密钥环 +The login keyring did not get unlocked when you logged into your computer. 当您登录时登录密钥环未被解锁** ![Enter Password To Unlock Your Login Keyring Ubuntu][2] @@ -34,13 +34,13 @@ Linux里的密钥环是什么以及为什么需要它? ![][3] Why do you use a keyring (also called [keychain][4]) in the real life? You use it to keep one or more keys grouped together so that they are easy to find and carry. -在现实生活中你为什么要用一个钥匙环(也叫钥匙链)? 你用它把一把或多把钥匙挂到一起, 以便于携带和寻找。 +在现实生活中你为什么要用一个钥匙环(也叫[钥匙链][4])? 你用它把一把或多把钥匙挂到一起, 以便于携带和寻找。 It’s the same concept in Linux. The keyring feature allows your system to group various passwords together and keep it one place. Linux里也是类似的。密钥环功能使您的系统可以将各种密码放在一起,并将其保存在一个地方。 Most desktop environments like GNOME, KDE, Xfce etc use an implementation of [gnome-keyring][5] to provide this keyring feature in Linux. -大多数Linux桌面环境像GNOME, KDE, Xfce等采用gnome的密钥环实现来提供这个功能。 +大多数Linux桌面环境像GNOME, KDE, Xfce等采用[gnome的密钥环][5]实现来提供这个功能。 This keyring keeps your ssh keys, GPG keys and keys from applications that use this feature, like Chromium browser. By default, the **keyring is locked with a master password** which is often the login password of the account. 该密钥环保存了ssh密钥,GPG密钥以及使用此功能的应用程序(例如Chromium浏览器)的密钥。 默认情况下,**“密钥环”通过主密码来保护**,该密码通常是帐户的登录密码。 @@ -51,49 +51,64 @@ Every user on your system has its own keyring with (usually) the same password a The problem comes when you [switch to auto-login in Ubuntu][1]. This means that you login to the system without entering the password. In such case, your keyring is not unlocked automatically. 当您[启用Ubuntu中的自动登录功能时][1]时,就有问题了。这意味着您无需输入密码即可登录系统。 在这种情况下,您的密钥环不会自动解锁。 -#### Keyring is a security feature +#### Keyring is a security feature 密钥环是一个安全特性 Remember I told you that the keyring was a security feature? Now imagine that on your Linux desktop, you are using auto-login. Anyone with access to your desktop can enter the system without password but you have no issues with that perhaps because you use it to browse internet only. +记得我说过密钥环是一个安全特性吗?现在想象一下您在您的Linux电脑上开启了自动登录功能。有权访问您电脑的任何人无需密码就能进入您的系统。但是您可能不会在意,因为您只是用它来访问互联网。 But if you use a browser like Chromium or [Google Chrome in Ubuntu][6], and use it to save your login-password for various websites, you have an issue on your hand. Anyone can use the browser and login to the websites for which you have saved password in your browser. That’s risky, isn’t it? +但是,如果您使用Chromium或[Ubuntu中的Google Chrome][6]之类的浏览器,并使用它来保存各种网站的登录密码,那么您将遇到麻烦。任何人都可以使用浏览器并利用您在浏览器中保存的密码登录网站。那不就是风险吗? This is why when you try to use Chrome, it will ask you to unlock the keyring repeatedly. This ensures that only the person who knows the keyring’s password (i.e. the account password) can use the saved password in browser for logging in to their respective websites. +这就是为什么当您使用Chrome时,它将重复地提示您先解锁密钥环。这确保了只有知道密钥环密码的人才能使用在浏览器中保存的密码来登录它们相关联的网站。 If you keep on cancelling the prompt for keyring unlock, it will eventually go away and let you use the browser. However, the saved password won’t be unlocked and you’ll see ‘sync paused’ in Chromium/Chrome browsers. +如果您继续取消解锁密钥环的提示,它最终将消失并允许您使用浏览器。但是,保存的密码将不会被解锁,您在Chromium/Chome浏览器上将会看到'同步暂停'的提示。 ![Sync paused in Google Chrome][7] -#### If this keyring always exited, why you never saw it? +#### If this keyring always exited, why you never saw it? 如果密钥环总是存在的,为什么您从来没有见过它呢? That’s a valid question if you have never seen this keyring thing in your Linux system. +如果您在您的Linux系统上从没见过它的话,这就是一个有效的问题。 If you never used automatic login (or changed your account’s password), you might not even have realized that this feature exists. +如果您从没有用过自动登录功能(或者修改您的账户密码),您可能都没有意识到这个特性的存在。 This is because when you login to your system with your password, your keyring is unlocked automatically with your account’s password. +这是因为当您通过您的密码登录系统时,您的密钥环被您的账户密码自动解锁了。 Ubuntu (and other distributions) asks for password for common admin tasks like modifying users, installing new software etc irrespective of whether you auto login or not. But for regular tasks like using a browser, it doesn’t ask for password because keyring is already unlocked. +Ubuntu(和其他发行版)对于通用的管理任务像修改用户, 安装新软件等需要输入密码,无论您是否是自动登录的。但是对于日常任务像使用浏览器,它不需要输入密码因为密钥环已经被解锁了。 When you switch to automatic login, you don’t enter the password for login anymore. This means that the keyring is not unlocked and hence when you try to use a browser which uses the keyring feature, it will ask to unlock the keyring. +当您切换到自动登录时,您不再需要输入登录密码。这意味着密钥环没有被自动解锁,因此当您使用利用了密钥环特性的浏览器时,它将提示您来解锁密钥环。 -#### You can easily manage the keyring and passwords +#### You can easily manage the keyring and passwords 您可以容易地管理密钥环和密码 Where is this keyring located? At the core, it’s a daemon (a program that runs automatically in the background). +这个密钥环放在哪里?它的核心是一个守护任务(一个后台自动运行的程序)。 Don’t worry. You don’t have to ‘fight the daemon’ in the terminal. Most desktop environments come with a graphical application that interacts with this daemon. On KDE, there is KDE Wallet, on GNOME and others, it’s called Password and Keys (originally known as [Seahorse][8]). +别担心。您不必通过终端来操作守护任务。大多数桌面环境都自带有图形化的应用程序可以和守护进程进行交互。KDE上有KDE钱包,GNOME和其他桌面上叫做密码和密钥(原来叫[海马][8])。 -![Password And Keys App in Ubuntu][9] +![Password And Keys App in Ubuntu][9] Ubuntu上的密码和密钥App You can use this GUI application to see what application use the keyring to manage/lock passwords. +您可以用这个GUI程序来查看什么应用程序在用密钥环来管理/保护密码。 As you can see, my system has the login keyring which is automatically created. There is also a keyrings for storing GPG and SSH keys. The [Certificates][10] is for keeping the certificates (like HTTPS certificates) issued by a certificate authority. +您可以看到,我的系统有自动创建的登录密钥环。也有一个存储GPG和SSH密钥的密钥环。那个[证书][10]是用来保存证书机构颁发的证书(像HTTPS证书)的。 -![Password and Keys application in Ubuntu][11] +![Password and Keys application in Ubuntu][11] Ubuntu上的密码和密钥应用程序 You can also use this application to manually store passwords for website. For example, I created a new password-protected keyring called ‘Test’ and stored a password in this keyring manually. +您也可以使用这个应用程序来手动保存网站的密码。例如,我创建了一个新的叫做'Test'的被密码保护的密钥环,并手动存储了一个密码。 This is slightly better than keeping a list of passwords in a text file. At least in this case your passwords can be viewed only when you unlock the keyring with password. +这比保存一批密码在一个文本文件中要好一些。至少在这种情况下,您的密码只有在您通过密码解锁了密钥环时才允许被看到。 -![Saving New Password Seahorse][12] +![Saving New Password Seahorse][12] 保存新密码 One potential problem here is that if you format your system, the manually saved passwords are definitely lost. Normally, you make backup of personal files, not of all the user specific data such as keyring files. From 5d91178493f5d4ed77d1e5b0d7a79fc591d5d05a Mon Sep 17 00:00:00 2001 From: MjSeven Date: Mon, 6 Apr 2020 22:10:45 +0800 Subject: [PATCH 0153/1809] ok --- ... Scheduling tasks on Linux using the at command.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/translated/tech/20200403 Scheduling tasks on Linux using the at command.md b/translated/tech/20200403 Scheduling tasks on Linux using the at command.md index a8986be39a..3e44489281 100644 --- a/translated/tech/20200403 Scheduling tasks on Linux using the at command.md +++ b/translated/tech/20200403 Scheduling tasks on Linux using the at command.md @@ -10,7 +10,7 @@ 使用 at 命令在 Linu 上安排任务 ====== at 命令可以很容易地安排 Linux 任务在你选择的任何时间或日期运行,让我们来看看它能为你做什么。 - +![][0] romkaz / Getty Images 当你希望命令或脚本在某个特定时间运行时,你不需要将手指放在键盘上盘旋等待按下回车键,或者是在特定时间坐在办公桌前。相反,你可以通过 **at** 命令来设置任务。在本文中,我们将研究如何使用 **at** 来安排任务,如何精确地选择任务希望运行的时间以及如何使用 **at** 来查看安排运行的任务。 @@ -23,14 +23,14 @@ romkaz / Getty Images ### 使用 at -**at** 命令很容易使用,只需记住几件事。一个简单的使用 **at** 类似于这样: +**at** 命令很容易使用,只需记住几件事。一个简单使用 **at** 的例子类似于这样: ``` $ at 5:00PM at> date >> thisfile at> ``` -在输入 "at" 和应该运行命令的时间,**at** 会提示你在设定时间会运行该命令(此例中是 **`date`** 命令)。输入 **^D** 来完成请求。 +在输入 "at" 和应该运行命令的时间,**at** 会提示你在设定时间会运行该命令(此例中是 **`date`** 命令)。输入 **^D**(Ctrl + d) 来完成请求。 假设我们在下午 5 点之前设置这个 **at** 命令,那么日期和时间将在当天下午 5 点添加到名为 "thisfile" 文件的末尾。否则,该命令将在第二天下午 5 点运行。 @@ -132,9 +132,7 @@ at> **总结** -当你要安排一项一次性任务时,即使你希望在今天下午或几年后运行,**at** 命令是通用且易于使用的。 - -加入 [Facebook][2] 和 [LinkedIn][3] 上的网络世界社区,评论最火的主题。 +当你要安排一项一次性任务时,无论你是希望在今天下午或几年后运行,**at** 命令都是通用且易于使用的。 -------------------------------------------------------------------------------- @@ -149,6 +147,7 @@ via: https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-usin [a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ [b]: https://github.com/lujun9972 +[0]: https://images.idgesg.net/images/article/2019/08/gettyimages-140389307-100808283-large.jpg [1]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) [2]: https://www.facebook.com/NetworkWorld/ [3]: https://www.linkedin.com/company/network-world From 303717ee21dc23572f5817b68656526a2448e47c Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Mon, 6 Apr 2020 23:19:26 +0800 Subject: [PATCH 0154/1809] Update 20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md --- ...in Ubuntu- What is It and How to Use it.md | 48 +++++++++++++------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md index 4aabc122d5..4e2b84c1ab 100644 --- a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md +++ b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md @@ -108,74 +108,92 @@ You can also use this application to manually store passwords for website. For e This is slightly better than keeping a list of passwords in a text file. At least in this case your passwords can be viewed only when you unlock the keyring with password. 这比保存一批密码在一个文本文件中要好一些。至少在这种情况下,您的密码只有在您通过密码解锁了密钥环时才允许被看到。 -![Saving New Password Seahorse][12] 保存新密码 +![Saving New Password Seahorse][12] One potential problem here is that if you format your system, the manually saved passwords are definitely lost. Normally, you make backup of personal files, not of all the user specific data such as keyring files. +一个潜在的问题是如果您格式化您的系统,手动保存的密码必然会丢失。通常,您会备份您的个人文件,但并不是所有的用户特定数据如密钥环文件。 There is way to handle that. The keyring data is usually stored in ~/.local/share/keyrings directory. You can see all the keyrings here but you cannot see its content directly. If you remove the password of the keyring (I’ll show the steps in later section of this article), you can read the content of the keyring like a regular text file. You can copy this unlocked keyring file entirely and import it in the Password and Keys application on some other Linux computer (running this application). +有一种办法能解决它。密钥环数据通常保存在~/.local/share/keyrings目录。在这里您可以看到所有的密钥环但是您不能直接看到它们的内容。如果您移除密钥环的密码(我会在这篇文章的后面描述操作步骤),您可以像一个普通的文本文件一样读取密钥环的内容。您可以完整地拷贝这个解锁后的密钥环文件并在其他的Linux机器(安装了密码和密钥应用)上导入到密码和密钥应用程序。 So, let me summarize what you have learned so far: - - * Most Linux has this ‘keyring feature’ installed and activated by default - * Each user on a system has its own keyring - * The keyring is normally locked with the account’s password - * Keyring is unlocked automatically when you login with your password - * For auto-login, the keyring is not unlocked and hence you are asked to unlock it when you try to use an application that uses keyring - * Not all browsers or application use the keyring feature - * There is a GUI application installed to interact with keyring - * You can use the keyring to manually store passwords in encrypted format - * You can change the keyring password on your own - * You can export (by unlocking the keyring first) and import it on some other computer to get your manually saved passwords +来总结一下目前为止所学的内容: + * Most Linux has this ‘keyring feature’ installed and activated by default 大多数Linux缺省已经安装并激活了密钥环特性 + * Each user on a system has its own keyring 系统上的每个用户都拥有他自己的密钥环 + * The keyring is normally locked with the account’s password 密钥环通常被账户密码锁定(保护) + * Keyring is unlocked automatically when you login with your password 当您通过密码登录时密钥环会被自动解锁 + * For auto-login, the keyring is not unlocked and hence you are asked to unlock it when you try to use an application that uses keyring 对于自动登录,密钥环不会自动解锁,因此当您试图使用依赖密钥环的应用程序时会被提示先解锁它 + * Not all browsers or application use the keyring feature 并不是所有的浏览器或应用程序利用了密钥环特性 + * There is a GUI application installed to interact with keyring (Linux上)安装了一个GUI程序可以和密钥环交互 + * You can use the keyring to manually store passwords in encrypted format 您可以用密钥环来手动以加密格式来存储密码 + * You can change the keyring password on your own 您可以自己修改密钥环密码 + * You can export (by unlocking the keyring first) and import it on some other computer to get your manually saved passwords 您可以通过导出(需要先解锁密钥环)并导入(到其他计算机上)的方式来获取手工保存的密码。 -### Change keyring password +### Change keyring password 修改密钥环密码 Suppose you changed your account password. Now when you login, your system tries to unlock the keyring automatically using the new login password. But the keyring still uses the old login password. +假设您修改了您的账户密码。当您登录时,您的系统试图通过新的登录密码来自动解锁密钥环。但是密钥环还在使用老的登录密码。 In such a case, you can change the keyring password to the new login password so that the keyring gets unlocked automatically as soon as you login to your system. +这种情况下,您可以修改密钥环密码为新的登录密码,这样密码环才能在您登录系统时自动解锁。 Open the Password and Keys application from the menu: +从菜单中打开密码和密钥应用程序: ![Look for Password and Keys app in the menu][9] Now, right click on the Login keyring and click on Change Password: +在登录密钥环上右击并点击修改密码: ![Change Keyring Password][13] What if you don’t remember the old login password? +如果您不记得老的登录密码怎么办? You probably know that it is [easy to reset forgotten password in Ubuntu][14]. The problem comes with the keyring in such cases. You changed the account password but you don’t remember the old account password that is still used by the keyring. +您可能知道[Ubuntu上复位忘记的密码是很容易的][14]。但是密钥环在这种场景下还是有问题。您修改了账户密码但是您不记得仍然被密钥环使用的老的账户密码。 Now you cannot change it because you don’t know the old password. What to do now? +您不能修改它因为您不知道老的密码。怎么办? In such a case, you’ll have to remove the entire keyring itself. You can do that from the Passwords and Keys application: +这种情况下,您将不得不移除整个密钥环。您可以通过密码和密钥应用程序来操作: ![Delete Keyring Ubuntu][15] It will ask for your confirmation: +它会提示您进行确认: ![Delete Keyring][16] Alternatively, you may also manually delete the keyring files in ~/.local/share/keyrings directory. +另外,您也可以手动删除~/.local/share/keyrings目录下的密钥环文件。 When the old keyring is removed and you try to use Chrome/Chromium, it will ask you to create new keyring. +老的密钥环文件被移除后,您再打开Chrome/Chromium时,它会提示您创建一个新的密钥环。 ![New Keyring Password][17] You can use the new login password so that the keyring gets unlocked automatically. +您可以用新的登录密码,密钥环就会被自动解锁了。 -### Disable keyring password +### Disable keyring password 禁用密钥环密码 In cases where you want to use automatic login but don’t want to unlockk keyring manually, you may choose to disable the keyring with a workaround. Keep in mind that you are disabling a security feature so think twice before doing so. +在您想用自动登录但又不想手动解锁密钥环时,您可以把禁用密钥环密码作为一个规避方法。记住您正在禁用一个安全特性,因此请三思。 The process is similar to changing keyring password. Open Password and Keys application and go on to change the keyring password. +操作步骤和修改密钥环相似。打开密码和密钥应用程序,然后修改密钥环密码。 The trick is that when it asks to change the password, don’t enter a new password and hit Continue instead. This will remove any password from the keyring. +技巧在于当它提示修改密码时,不要输入新密码,而是点击继续按钮。这将移除密钥环的密码。 ![Disable Keyring password by not setting any password at all][18] This way, the keyring will have no password and it remains unlocked all the time. +这种方法,密钥环没有密码保护并将一直处于解锁状态。 -------------------------------------------------------------------------------- @@ -183,7 +201,7 @@ via: https://itsfoss.com/ubuntu-keyring/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[messon007](https://github.com/messon007) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5eae2561b8390b3221bd43cfb4450263276b828d Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Mon, 6 Apr 2020 23:31:16 +0800 Subject: [PATCH 0155/1809] Almost Finished Almost Finished --- ...in Ubuntu- What is It and How to Use it.md | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md index 4e2b84c1ab..f1f390c55f 100644 --- a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md +++ b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md @@ -8,19 +8,19 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) The Keyring Concept in Ubuntu: What is It and How to Use it? -认识Ubuntu里的密钥环 +解读Ubuntu里的密钥环概念 ====== If you use [automatic login in Ubuntu][1] or other Linux distributions, you might have come across a pop-up message of this sort: 如果您用过[ubuntu里的自动登录功能][1]或者其他的Linux发行版, 您可能遇到过这种弹出消息: -**Enter password to unlock your login keyring 请输入密码解锁您的登录密钥环 -The login keyring did not get unlocked when you logged into your computer. 当您登录时登录密钥环未被解锁** +**Enter password to unlock your login keyring 请输入密码以解锁您的登录密钥环 +The login keyring did not get unlocked when you logged into your computer. 登录密钥环在您登录系统时未解锁** ![Enter Password To Unlock Your Login Keyring Ubuntu][2] It keeps on popping up several times before disappearing if you keep on clicking cancel. You may wonder why do you keep seeing this keyring message all the time? -你需要点击多次取消才能让它消失。你可能想知道为什么系统会一直提示这个密钥环消息框? +你需要点击多次取消才能让它消失。你可能想知道为什么系统会多次反复提示这个密钥环消息? Let me tell you something. It’s not an error. It’s a security feature. 让我来告诉你答案。它其实并没有出错,它只是一个安全特性。 @@ -28,16 +28,15 @@ Let me tell you something. It’s not an error. It’s a security feature. Surprised? Let me explain the keyring concept in Linux. 奇怪吗?下面就让我来解释下Linux里的密钥环概念。 -### What is keyring in Linux and why is it used? -Linux里的密钥环是什么以及为什么需要它? +### What is keyring in Linux and why is it used? Linux里的密钥环是什么以及为什么需要它? ![][3] Why do you use a keyring (also called [keychain][4]) in the real life? You use it to keep one or more keys grouped together so that they are easy to find and carry. -在现实生活中你为什么要用一个钥匙环(也叫[钥匙链][4])? 你用它把一把或多把钥匙挂到一起, 以便于携带和寻找。 +在现实生活中您为什么要用钥匙环(也叫[钥匙链][4])? 您用它把一把或多把钥匙串到一起, 以便于携带和查找。 It’s the same concept in Linux. The keyring feature allows your system to group various passwords together and keep it one place. -Linux里也是类似的。密钥环功能使您的系统可以将各种密码放在一起,并将其保存在一个地方。 +Linux里也是类似的。密钥环特性使您的系统可以将各种密码放在一起,并将其保存在一个地方。 Most desktop environments like GNOME, KDE, Xfce etc use an implementation of [gnome-keyring][5] to provide this keyring feature in Linux. 大多数Linux桌面环境像GNOME, KDE, Xfce等采用[gnome的密钥环][5]实现来提供这个功能。 @@ -60,10 +59,10 @@ But if you use a browser like Chromium or [Google Chrome in Ubuntu][6], and use 但是,如果您使用Chromium或[Ubuntu中的Google Chrome][6]之类的浏览器,并使用它来保存各种网站的登录密码,那么您将遇到麻烦。任何人都可以使用浏览器并利用您在浏览器中保存的密码登录网站。那不就是风险吗? This is why when you try to use Chrome, it will ask you to unlock the keyring repeatedly. This ensures that only the person who knows the keyring’s password (i.e. the account password) can use the saved password in browser for logging in to their respective websites. -这就是为什么当您使用Chrome时,它将重复地提示您先解锁密钥环。这确保了只有知道密钥环密码的人才能使用在浏览器中保存的密码来登录它们相关联的网站。 +这就是为什么当您使用Chrome时,它将反复地提示您先解锁密钥环。这确保了只有知道密钥环密码的人才能使用在浏览器中保存的密码来登录它们相关的网站。 If you keep on cancelling the prompt for keyring unlock, it will eventually go away and let you use the browser. However, the saved password won’t be unlocked and you’ll see ‘sync paused’ in Chromium/Chrome browsers. -如果您继续取消解锁密钥环的提示,它最终将消失并允许您使用浏览器。但是,保存的密码将不会被解锁,您在Chromium/Chome浏览器上将会看到'同步暂停'的提示。 +如果您反复取消解锁密钥环的提示,它最终将消失并允许您使用浏览器。但是,保存的密码将不会被解锁,您在Chromium/Chome浏览器上将会看到'同步暂停'的提示。 ![Sync paused in Google Chrome][7] @@ -92,7 +91,7 @@ Where is this keyring located? At the core, it’s a daemon (a program that runs Don’t worry. You don’t have to ‘fight the daemon’ in the terminal. Most desktop environments come with a graphical application that interacts with this daemon. On KDE, there is KDE Wallet, on GNOME and others, it’s called Password and Keys (originally known as [Seahorse][8]). 别担心。您不必通过终端来操作守护任务。大多数桌面环境都自带有图形化的应用程序可以和守护进程进行交互。KDE上有KDE钱包,GNOME和其他桌面上叫做密码和密钥(原来叫[海马][8])。 -![Password And Keys App in Ubuntu][9] Ubuntu上的密码和密钥App +![Password And Keys App in Ubuntu][9] You can use this GUI application to see what application use the keyring to manage/lock passwords. 您可以用这个GUI程序来查看什么应用程序在用密钥环来管理/保护密码。 @@ -100,7 +99,7 @@ You can use this GUI application to see what application use the keyring to mana As you can see, my system has the login keyring which is automatically created. There is also a keyrings for storing GPG and SSH keys. The [Certificates][10] is for keeping the certificates (like HTTPS certificates) issued by a certificate authority. 您可以看到,我的系统有自动创建的登录密钥环。也有一个存储GPG和SSH密钥的密钥环。那个[证书][10]是用来保存证书机构颁发的证书(像HTTPS证书)的。 -![Password and Keys application in Ubuntu][11] Ubuntu上的密码和密钥应用程序 +![Password and Keys application in Ubuntu][11] You can also use this application to manually store passwords for website. For example, I created a new password-protected keyring called ‘Test’ and stored a password in this keyring manually. 您也可以使用这个应用程序来手动保存网站的密码。例如,我创建了一个新的叫做'Test'的被密码保护的密钥环,并手动存储了一个密码。 From 642760f25e652912b1582a6c2915bf191342c7c3 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Mon, 6 Apr 2020 23:36:46 +0800 Subject: [PATCH 0156/1809] Remove origin Remove origin --- ...in Ubuntu- What is It and How to Use it.md | 83 +++++-------------- 1 file changed, 19 insertions(+), 64 deletions(-) diff --git a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md index f1f390c55f..f2c2602601 100644 --- a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md +++ b/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md @@ -7,191 +7,146 @@ [#]: via: (https://itsfoss.com/ubuntu-keyring/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -The Keyring Concept in Ubuntu: What is It and How to Use it? 解读Ubuntu里的密钥环概念 ====== -If you use [automatic login in Ubuntu][1] or other Linux distributions, you might have come across a pop-up message of this sort: 如果您用过[ubuntu里的自动登录功能][1]或者其他的Linux发行版, 您可能遇到过这种弹出消息: -**Enter password to unlock your login keyring 请输入密码以解锁您的登录密钥环 -The login keyring did not get unlocked when you logged into your computer. 登录密钥环在您登录系统时未解锁** +**请输入密码以解锁您的登录密钥环 + 登录密钥环在您登录系统时未解锁** ![Enter Password To Unlock Your Login Keyring Ubuntu][2] -It keeps on popping up several times before disappearing if you keep on clicking cancel. You may wonder why do you keep seeing this keyring message all the time? 你需要点击多次取消才能让它消失。你可能想知道为什么系统会多次反复提示这个密钥环消息? -Let me tell you something. It’s not an error. It’s a security feature. 让我来告诉你答案。它其实并没有出错,它只是一个安全特性。 -Surprised? Let me explain the keyring concept in Linux. 奇怪吗?下面就让我来解释下Linux里的密钥环概念。 -### What is keyring in Linux and why is it used? Linux里的密钥环是什么以及为什么需要它? +### Linux里的密钥环是什么以及为什么需要它? ![][3] -Why do you use a keyring (also called [keychain][4]) in the real life? You use it to keep one or more keys grouped together so that they are easy to find and carry. 在现实生活中您为什么要用钥匙环(也叫[钥匙链][4])? 您用它把一把或多把钥匙串到一起, 以便于携带和查找。 -It’s the same concept in Linux. The keyring feature allows your system to group various passwords together and keep it one place. Linux里也是类似的。密钥环特性使您的系统可以将各种密码放在一起,并将其保存在一个地方。 -Most desktop environments like GNOME, KDE, Xfce etc use an implementation of [gnome-keyring][5] to provide this keyring feature in Linux. 大多数Linux桌面环境像GNOME, KDE, Xfce等采用[gnome的密钥环][5]实现来提供这个功能。 -This keyring keeps your ssh keys, GPG keys and keys from applications that use this feature, like Chromium browser. By default, the **keyring is locked with a master password** which is often the login password of the account. 该密钥环保存了ssh密钥,GPG密钥以及使用此功能的应用程序(例如Chromium浏览器)的密钥。 默认情况下,**“密钥环”通过主密码来保护**,该密码通常是帐户的登录密码。 -Every user on your system has its own keyring with (usually) the same password as that of the user account itself. When you login to your system with your password, your keyring is unlocked automatically with your account’s password. 系统上的每个用户都有自己的密钥环,(通常)密码与用户帐户本身的密码相同。 当您使用密码登录系统时,您的密匙环将使用您帐户的密码自动解锁。 -The problem comes when you [switch to auto-login in Ubuntu][1]. This means that you login to the system without entering the password. In such case, your keyring is not unlocked automatically. 当您[启用Ubuntu中的自动登录功能时][1]时,就有问题了。这意味着您无需输入密码即可登录系统。 在这种情况下,您的密钥环不会自动解锁。 -#### Keyring is a security feature 密钥环是一个安全特性 +#### 密钥环是一个安全特性 -Remember I told you that the keyring was a security feature? Now imagine that on your Linux desktop, you are using auto-login. Anyone with access to your desktop can enter the system without password but you have no issues with that perhaps because you use it to browse internet only. 记得我说过密钥环是一个安全特性吗?现在想象一下您在您的Linux电脑上开启了自动登录功能。有权访问您电脑的任何人无需密码就能进入您的系统。但是您可能不会在意,因为您只是用它来访问互联网。 -But if you use a browser like Chromium or [Google Chrome in Ubuntu][6], and use it to save your login-password for various websites, you have an issue on your hand. Anyone can use the browser and login to the websites for which you have saved password in your browser. That’s risky, isn’t it? 但是,如果您使用Chromium或[Ubuntu中的Google Chrome][6]之类的浏览器,并使用它来保存各种网站的登录密码,那么您将遇到麻烦。任何人都可以使用浏览器并利用您在浏览器中保存的密码登录网站。那不就是风险吗? -This is why when you try to use Chrome, it will ask you to unlock the keyring repeatedly. This ensures that only the person who knows the keyring’s password (i.e. the account password) can use the saved password in browser for logging in to their respective websites. 这就是为什么当您使用Chrome时,它将反复地提示您先解锁密钥环。这确保了只有知道密钥环密码的人才能使用在浏览器中保存的密码来登录它们相关的网站。 -If you keep on cancelling the prompt for keyring unlock, it will eventually go away and let you use the browser. However, the saved password won’t be unlocked and you’ll see ‘sync paused’ in Chromium/Chrome browsers. 如果您反复取消解锁密钥环的提示,它最终将消失并允许您使用浏览器。但是,保存的密码将不会被解锁,您在Chromium/Chome浏览器上将会看到'同步暂停'的提示。 ![Sync paused in Google Chrome][7] -#### If this keyring always exited, why you never saw it? 如果密钥环总是存在的,为什么您从来没有见过它呢? +#### 如果密钥环总是存在的,为什么您从来没有见过它呢? -That’s a valid question if you have never seen this keyring thing in your Linux system. 如果您在您的Linux系统上从没见过它的话,这就是一个有效的问题。 -If you never used automatic login (or changed your account’s password), you might not even have realized that this feature exists. 如果您从没有用过自动登录功能(或者修改您的账户密码),您可能都没有意识到这个特性的存在。 -This is because when you login to your system with your password, your keyring is unlocked automatically with your account’s password. 这是因为当您通过您的密码登录系统时,您的密钥环被您的账户密码自动解锁了。 -Ubuntu (and other distributions) asks for password for common admin tasks like modifying users, installing new software etc irrespective of whether you auto login or not. But for regular tasks like using a browser, it doesn’t ask for password because keyring is already unlocked. Ubuntu(和其他发行版)对于通用的管理任务像修改用户, 安装新软件等需要输入密码,无论您是否是自动登录的。但是对于日常任务像使用浏览器,它不需要输入密码因为密钥环已经被解锁了。 -When you switch to automatic login, you don’t enter the password for login anymore. This means that the keyring is not unlocked and hence when you try to use a browser which uses the keyring feature, it will ask to unlock the keyring. 当您切换到自动登录时,您不再需要输入登录密码。这意味着密钥环没有被自动解锁,因此当您使用利用了密钥环特性的浏览器时,它将提示您来解锁密钥环。 -#### You can easily manage the keyring and passwords 您可以容易地管理密钥环和密码 +#### 您可以容易地管理密钥环和密码 -Where is this keyring located? At the core, it’s a daemon (a program that runs automatically in the background). 这个密钥环放在哪里?它的核心是一个守护任务(一个后台自动运行的程序)。 -Don’t worry. You don’t have to ‘fight the daemon’ in the terminal. Most desktop environments come with a graphical application that interacts with this daemon. On KDE, there is KDE Wallet, on GNOME and others, it’s called Password and Keys (originally known as [Seahorse][8]). 别担心。您不必通过终端来操作守护任务。大多数桌面环境都自带有图形化的应用程序可以和守护进程进行交互。KDE上有KDE钱包,GNOME和其他桌面上叫做密码和密钥(原来叫[海马][8])。 ![Password And Keys App in Ubuntu][9] -You can use this GUI application to see what application use the keyring to manage/lock passwords. 您可以用这个GUI程序来查看什么应用程序在用密钥环来管理/保护密码。 -As you can see, my system has the login keyring which is automatically created. There is also a keyrings for storing GPG and SSH keys. The [Certificates][10] is for keeping the certificates (like HTTPS certificates) issued by a certificate authority. 您可以看到,我的系统有自动创建的登录密钥环。也有一个存储GPG和SSH密钥的密钥环。那个[证书][10]是用来保存证书机构颁发的证书(像HTTPS证书)的。 ![Password and Keys application in Ubuntu][11] -You can also use this application to manually store passwords for website. For example, I created a new password-protected keyring called ‘Test’ and stored a password in this keyring manually. 您也可以使用这个应用程序来手动保存网站的密码。例如,我创建了一个新的叫做'Test'的被密码保护的密钥环,并手动存储了一个密码。 -This is slightly better than keeping a list of passwords in a text file. At least in this case your passwords can be viewed only when you unlock the keyring with password. 这比保存一批密码在一个文本文件中要好一些。至少在这种情况下,您的密码只有在您通过密码解锁了密钥环时才允许被看到。 ![Saving New Password Seahorse][12] -One potential problem here is that if you format your system, the manually saved passwords are definitely lost. Normally, you make backup of personal files, not of all the user specific data such as keyring files. 一个潜在的问题是如果您格式化您的系统,手动保存的密码必然会丢失。通常,您会备份您的个人文件,但并不是所有的用户特定数据如密钥环文件。 -There is way to handle that. The keyring data is usually stored in ~/.local/share/keyrings directory. You can see all the keyrings here but you cannot see its content directly. If you remove the password of the keyring (I’ll show the steps in later section of this article), you can read the content of the keyring like a regular text file. You can copy this unlocked keyring file entirely and import it in the Password and Keys application on some other Linux computer (running this application). 有一种办法能解决它。密钥环数据通常保存在~/.local/share/keyrings目录。在这里您可以看到所有的密钥环但是您不能直接看到它们的内容。如果您移除密钥环的密码(我会在这篇文章的后面描述操作步骤),您可以像一个普通的文本文件一样读取密钥环的内容。您可以完整地拷贝这个解锁后的密钥环文件并在其他的Linux机器(安装了密码和密钥应用)上导入到密码和密钥应用程序。 -So, let me summarize what you have learned so far: -来总结一下目前为止所学的内容: - * Most Linux has this ‘keyring feature’ installed and activated by default 大多数Linux缺省已经安装并激活了密钥环特性 - * Each user on a system has its own keyring 系统上的每个用户都拥有他自己的密钥环 - * The keyring is normally locked with the account’s password 密钥环通常被账户密码锁定(保护) - * Keyring is unlocked automatically when you login with your password 当您通过密码登录时密钥环会被自动解锁 - * For auto-login, the keyring is not unlocked and hence you are asked to unlock it when you try to use an application that uses keyring 对于自动登录,密钥环不会自动解锁,因此当您试图使用依赖密钥环的应用程序时会被提示先解锁它 - * Not all browsers or application use the keyring feature 并不是所有的浏览器或应用程序利用了密钥环特性 - * There is a GUI application installed to interact with keyring (Linux上)安装了一个GUI程序可以和密钥环交互 - * You can use the keyring to manually store passwords in encrypted format 您可以用密钥环来手动以加密格式来存储密码 - * You can change the keyring password on your own 您可以自己修改密钥环密码 - * You can export (by unlocking the keyring first) and import it on some other computer to get your manually saved passwords 您可以通过导出(需要先解锁密钥环)并导入(到其他计算机上)的方式来获取手工保存的密码。 +总结一下目前为止所学的内容: + * 大多数Linux缺省已经安装并激活了密钥环特性 + * 系统上的每个用户都拥有他自己的密钥环 + * 密钥环通常被账户密码锁定(保护) + * 当您通过密码登录时密钥环会被自动解锁 + * 对于自动登录,密钥环不会自动解锁,因此当您试图使用依赖密钥环的应用程序时会被提示先解锁它 + * 并不是所有的浏览器或应用程序利用了密钥环特性 + * (Linux上)安装了一个GUI程序可以和密钥环交互 + * 您可以用密钥环来手动以加密格式来存储密码 + * 您可以自己修改密钥环密码 + * 您可以通过导出(需要先解锁密钥环)并导入(到其他计算机上)的方式来获取手工保存的密码。 -### Change keyring password 修改密钥环密码 +### 修改密钥环密码 -Suppose you changed your account password. Now when you login, your system tries to unlock the keyring automatically using the new login password. But the keyring still uses the old login password. 假设您修改了您的账户密码。当您登录时,您的系统试图通过新的登录密码来自动解锁密钥环。但是密钥环还在使用老的登录密码。 -In such a case, you can change the keyring password to the new login password so that the keyring gets unlocked automatically as soon as you login to your system. 这种情况下,您可以修改密钥环密码为新的登录密码,这样密码环才能在您登录系统时自动解锁。 -Open the Password and Keys application from the menu: 从菜单中打开密码和密钥应用程序: ![Look for Password and Keys app in the menu][9] -Now, right click on the Login keyring and click on Change Password: 在登录密钥环上右击并点击修改密码: ![Change Keyring Password][13] -What if you don’t remember the old login password? 如果您不记得老的登录密码怎么办? -You probably know that it is [easy to reset forgotten password in Ubuntu][14]. The problem comes with the keyring in such cases. You changed the account password but you don’t remember the old account password that is still used by the keyring. 您可能知道[Ubuntu上复位忘记的密码是很容易的][14]。但是密钥环在这种场景下还是有问题。您修改了账户密码但是您不记得仍然被密钥环使用的老的账户密码。 -Now you cannot change it because you don’t know the old password. What to do now? 您不能修改它因为您不知道老的密码。怎么办? -In such a case, you’ll have to remove the entire keyring itself. You can do that from the Passwords and Keys application: 这种情况下,您将不得不移除整个密钥环。您可以通过密码和密钥应用程序来操作: ![Delete Keyring Ubuntu][15] -It will ask for your confirmation: 它会提示您进行确认: ![Delete Keyring][16] -Alternatively, you may also manually delete the keyring files in ~/.local/share/keyrings directory. 另外,您也可以手动删除~/.local/share/keyrings目录下的密钥环文件。 -When the old keyring is removed and you try to use Chrome/Chromium, it will ask you to create new keyring. 老的密钥环文件被移除后,您再打开Chrome/Chromium时,它会提示您创建一个新的密钥环。 ![New Keyring Password][17] -You can use the new login password so that the keyring gets unlocked automatically. 您可以用新的登录密码,密钥环就会被自动解锁了。 -### Disable keyring password 禁用密钥环密码 +### 禁用密钥环密码 -In cases where you want to use automatic login but don’t want to unlockk keyring manually, you may choose to disable the keyring with a workaround. Keep in mind that you are disabling a security feature so think twice before doing so. 在您想用自动登录但又不想手动解锁密钥环时,您可以把禁用密钥环密码作为一个规避方法。记住您正在禁用一个安全特性,因此请三思。 -The process is similar to changing keyring password. Open Password and Keys application and go on to change the keyring password. 操作步骤和修改密钥环相似。打开密码和密钥应用程序,然后修改密钥环密码。 -The trick is that when it asks to change the password, don’t enter a new password and hit Continue instead. This will remove any password from the keyring. 技巧在于当它提示修改密码时,不要输入新密码,而是点击继续按钮。这将移除密钥环的密码。 ![Disable Keyring password by not setting any password at all][18] -This way, the keyring will have no password and it remains unlocked all the time. 这种方法,密钥环没有密码保护并将一直处于解锁状态。 -------------------------------------------------------------------------------- From 92ac29628b592c3b1b7ab9fd0cddfbe2d9e565be Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Mon, 6 Apr 2020 23:39:33 +0800 Subject: [PATCH 0157/1809] Move to translated Move to translated --- ...The Keyring Concept in Ubuntu- What is It and How to Use it.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md (100%) diff --git a/sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md b/translated/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md similarity index 100% rename from sources/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md rename to translated/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md From 39ca3d5193ba4b86e6fc063915431bc4b895660f Mon Sep 17 00:00:00 2001 From: Name1e5s Date: Mon, 6 Apr 2020 23:57:13 +0800 Subject: [PATCH 0158/1809] [name1e5s translating] 20200402 When debugging, your attitude matters --- sources/talk/20200402 When debugging, your attitude matters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20200402 When debugging, your attitude matters.md b/sources/talk/20200402 When debugging, your attitude matters.md index 106b40a64a..6968d3f8e3 100644 --- a/sources/talk/20200402 When debugging, your attitude matters.md +++ b/sources/talk/20200402 When debugging, your attitude matters.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (name1e5s) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 51e856036649ff7a75db544bf1da8c7c66da2542 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Tue, 7 Apr 2020 00:21:46 +0800 Subject: [PATCH 0159/1809] Update 20190814 9 open source cloud native projects to consider.md --- ...ource cloud native projects to consider.md | 61 ++++++++++++++----- 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/sources/tech/20190814 9 open source cloud native projects to consider.md b/sources/tech/20190814 9 open source cloud native projects to consider.md index b3d31fc7af..2ab8fb2dc2 100644 --- a/sources/tech/20190814 9 open source cloud native projects to consider.md +++ b/sources/tech/20190814 9 open source cloud native projects to consider.md @@ -7,48 +7,58 @@ [#]: via: (https://opensource.com/article/19/8/cloud-native-projects) [#]: author: (Bryant Son https://opensource.com/users/brsonhttps://opensource.com/users/marcobravo) -9 open source cloud native projects to consider +9 open source cloud native projects to consider 值得考虑的9个开源的云原生项目 ====== Work with containers? Get familiar with these projects from the Cloud Native Computing Foundation +工作中使用了容器?熟悉来自云原生计算基金会的这些项目 ![clouds in the sky with blue pattern][1] -As the practice of developing applications with containers is getting more popular, [cloud-native applications][2] are also on the rise. By [definition][3]: +As the practice of developing applications with containers is getting more popular, [cloud-native applications][2] are also on the rise. By [definition][3]: +随着通过容器开发应用的实践变得流行,[云原生应用][2]也在上升。其定义: +云原生技术被用于开发应用程序,这些程序通过将服务打包在容器中来完成构建,部署为微服务,通过敏捷的DevOps流程和持续集成工作流在弹性基础设施上管理。 > "Cloud-native technologies are used to develop applications built with services packaged in containers, deployed as microservices, and managed on elastic infrastructure through agile DevOps processes and continuous delivery workflows." -This description includes four elements that are integral to cloud-native applications: +This description includes four elements that are integral to cloud-native applications: +这个描述包括构成云原生应用的4个元素: - 1. Container - 2. Microservice - 3. DevOps - 4. Continuous integration and continuous delivery (CI/CD) + 1. Container 容器 + 2. Microservice 微服务 + 3. DevOps DevOps + 4. Continuous integration and continuous delivery (CI/CD) 持续集成和持续交付 -Although these technologies have very distinct histories, they complement each other well and have led to surprisingly exponential growth of cloud-native applications and toolsets in a short time. This [Cloud Native Computing Foundation][4] (CNCF) infographic shows the size and breadth of the cloud-native application ecosystem today. +Although these technologies have very distinct histories, they complement each other well and have led to surprisingly exponential growth of cloud-native applications and toolsets in a short time. This [Cloud Native Computing Foundation][4] (CNCF) infographic shows the size and breadth of the cloud-native application ecosystem today. +尽管这些技术有非常独特的历史,它们互相补充,共同导致了短时间内的云原生应用和工具的惊人的指数级增长。这个[云原生计算基金会][4]信息图现实了今天的云原生应用生态的规模和广度。 ![Cloud-Native Computing Foundation applications ecosystem][5] Cloud-Native Computing Foundation projects +云原生计算基金会项目 I mean, just look at that! And this is just a start. Just as NodeJS’s creation sparked the explosion of endless JavaScript tools, the popularity of container technology started the exponential growth of cloud-native applications. +我的意思是,看看那! 这仅仅是一个开始。 正如NodeJS的出现引发了无休止的JavaScript工具的爆炸式增长一样,容器技术的普及也推动了云原生应用程序的指数增长。 The good news is that there are several organizations that oversee and connect these dots together. One is the [**Open Containers Initiative (OCI)**][6], which is a lightweight, open governance structure (or project), "formed under the auspices of the Linux Foundation for the express purpose of creating open industry standards around container formats and runtime." The other is the **CNCF**, "an open source software foundation dedicated to making cloud native computing universal and sustainable." +好消息是,有几个组织负责监管这些技术并将它们融合在一起。 其中之一是[** Open Containers Initiative(OCI)**][6],它是一种轻量级的,开放的治理结构(或项目),“是在Linux基金会的主持下形成的,其明确目的是创建开放的行业标准容器格式和运行时。” 另一个是** CNCF **,“致力于使云原生计算具有通用性和可持续性的开源软件基金会”。 In addition to building a community around cloud-native applications generally, CNCF also helps projects set up structured governance around their cloud-native applications. CNCF created the concept of maturity levels—Sandbox, Incubating, or Graduated—which correspond to the Innovators, Early Adopters, and Early Majority tiers on the diagram below. - +除了通常围绕云原生应用建立社区之外,CNCF还帮助项目围绕其云原生应用建立结构化的管理。CNCF创建了成熟度级别的概念(沙箱,孵化或毕业),与下图中的“创新者”,“早期采用者”和“早期多数”层相对应。 ![CNCF project maturity levels][7] -CNCF project maturity levels +CNCF project maturity levels CNCF项目成熟度级别 The CNCF has detailed [criteria][8] for each maturity level (included below for readers’ convenience). A two-thirds supermajority of the Technical Oversight Committee (TOC) is required for a project to be Incubating or Graduated. +CNCF为每个成熟度级别制定了详细的[标准][8](为方便读者而列在下面)。 获得技术监督委员会(TOC)的三分之二的同意才能转为孵化或毕业项目。 -### Sandbox stage +### Sandbox stage 沙箱级 -> To be accepted in the sandbox, a project must have at least two TOC sponsors. See the CNCF Sandbox Guidelines v1.0 for the detailed process. +> To be accepted in the sandbox, a project must have at least two TOC sponsors. See the CNCF Sandbox Guidelines v1.0 for the detailed process. 要成为沙箱级,一个项目必须至少有两个TOC赞助商。 有关详细过程,请参见《 CNCF沙箱指南v1.0》。 -### Incubating stage + +### Incubating stage 孵化级 > Note: The incubation level is the point at which we expect to perform full due diligence on projects. > @@ -59,9 +69,18 @@ The CNCF has detailed [criteria][8] for each maturity level (included below for > * Demonstrate a substantial ongoing flow of commits and merged contributions. > * Since these metrics can vary significantly depending on the type, scope, and size of a project, the TOC has final judgement over the level of activity that is adequate to meet these criteria > +>注意:孵化级是我们期望对项目进行全面尽职调查的起点。 +> +>要进入孵化阶段,项目除了满足沙箱阶段的要求之外还要满足: +> +> *证明至少有三个独立的最终用户已成功将其用于生产,且TOC判断这些最终用户具有足够的质量和范围。 +> *合入者的数量要合理。合入者定义为具有合入权的人。即可以接受对部分或全部项目贡献的人。 +> *演示有大量正在进行的提交和合并的贡献。 +> *由于这些指标可能会根据项目的类型,范围和大小而有很大差异,因此TOC对足以满足这些标准的活动级别拥有最终决策权 -### Graduated stage + +### Graduated stage 毕业级 > To graduate from sandbox or incubating status, or for a new project to join as a graduated project, a project must meet the incubating stage criteria plus: > @@ -73,13 +92,23 @@ The CNCF has detailed [criteria][8] for each maturity level (included below for > * Have a public list of project adopters for at least the primary repo (e.g., ADOPTERS.md or logos on the project website). > * Receive a supermajority vote from the TOC to move to graduation stage. Projects can attempt to move directly from sandbox to graduation, if they can demonstrate sufficient maturity. Projects can remain in an incubating state indefinitely, but they are normally expected to graduate within two years. > +>要从沙箱或孵化状态毕业,或者要使一个新项目作为已毕业项目加入,项目除了必须满足孵化阶段标准外还要满足: +> +> *至少有两个组织的提交者。 +> *已获得并维护了“核心基础设施计划最佳实践徽章”。 +> *已完成独立和第三方安全审核,并发布了具有与以下示例类似的范围和质量的结果(包括已解决的关键漏洞):和所有关键毕业之前需要解决漏洞。 +> *采用CNCF行为准则。 +> *明确定义项目治理和提交流程。最好将其排布在GOVERNANCE.md文件中,并引用显示当前提交者和荣誉提交者的OWNERS.md文件。 +> *至少有主仓的项目采用者的公开列表(例如,ADOPTERS.md或项目网站上的徽标)。 +> *获得TOC的多数票,进入毕业阶段。如果项目能够证明足够的成熟度,则可以尝试直接从沙箱过渡到毕业。项目可以无限期保持孵化状态,但是通常预计它们会在两年内毕业。 - -## 9 projects to consider +## 9 projects to consider 值得考虑的9个项目 While it’s impossible to cover all of the CNCF projects in this article, I’ll describe are nine of most interesting Graduated and Incubating open source projects. +本文不可能涵盖所有的CNCF项目,我将介绍最有趣的9个“毕业和孵化中”的开源项目。 Name | License | What It Is +名称|授权类型|简要描述 ---|---|--- [Kubernetes][9] | Apache 2.0 | Orchestration platform for containers [Prometheus][10] | Apache 2.0 | Systems and service monitoring tool From 83cdc851292fd26410981106d695f29209559ff2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Apr 2020 00:52:29 +0800 Subject: [PATCH 0160/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200407=20Bitw?= =?UTF-8?q?arden:=20A=20Free=20&=20Open=20Source=20Password=20Manager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md --- ...- A Free - Open Source Password Manager.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md diff --git a/sources/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md b/sources/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md new file mode 100644 index 0000000000..26fa46b858 --- /dev/null +++ b/sources/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md @@ -0,0 +1,114 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Bitwarden: A Free & Open Source Password Manager) +[#]: via: (https://itsfoss.com/bitwarden/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Bitwarden: A Free & Open Source Password Manager +====== + +_**Brief:** Bitwarden is a popular open-source password manager. Here, we take a look at what it has to offer._ + +![][1] + +[Bitwarden][2] is a free and open-source password manager. You might remember that earlier we listed it as one of the [best password managers available for Linux][3]. + +Personally, I’ve been using Bitwarden as my password manager across multiple devices for several months now. So, in this article, I’ll be mentioning the features it offers along with my experience with it. + +**Note:** _In case you have questions about how secure the service is, check out their official security [FAQ page][4] to explore about it._ + +### Features of Bitwarden password manager + +![][5] + +[Bitwarden][2] is an impressive alternative to a lot of other convenient password managers out there. + +Here’s a breakdown of the features: + + * Free & Paid options available + * Available for Teams (Enterprise) and Individuals + * Open source + * Self-hosting support + * Ability to use it as an authenticator app (like Google Authenticator) + * Cross-platform support (Android, iOS, Linux, Windows, & macOS) + * Browser extensions available (Firefox, Chrome, Opera, Edge, Safari) + * Offers command-line tools + * Offers a Web Vault + * Ability to Import/Export Passwords + * [Password Generator][6] + * Auto-fill password + * Two-step authentication + + + +Technically, Bitwarden is completely free to use – however, it also offers some paid plans (Personal pricing plans & Business plans). + +With the premium plans, you get the ability to share the passwords with more users, get API access (business use), and more such premium perks. + +Here’s how the pricing looks like (at the time of writing this article): + +![][7] + +For most individuals, the premium personal plan of **$10/year** shouldn’t be an issue considering the fact that you will be supporting an open-source project. Of course, you can also choose to use it for free with no essential restrictions. + +### Installing Bitwarden on Linux + +![][8] + +It’s quite easy to get Bitwarden installed on your Linux system because it offers an .**AppImage** file. You can refer to our guide on [how to use AppImage][9] files, if you didn’t know it already. + +If you don’t prefer using AppImage – you can opt for the [snap package][10] or simply download the **.deb** or **.rpm** file available on their [official download page][11]. You can also check out their [GitHub page][12] for more information. + +[Download Bitwarden][2] + +You can also utilize the browser extensions if you’re not interested in using the desktop app. + +### My experience with Bitwarden + +Before Bitwarden, I was using [LastPass][13] as my password manager. Even though that’s not a bad option – it’s not an open-source software. + +So, I decided to switch to Bitwarden as soon as I found out about it. + +To start with, I simply exported my data from LastPass and imported it to Bitwarden without any hiccups. I didn’t lose any data in the process. + +In addition to the desktop app, I’ve been using Bitwarden the Firefox add-on, and the Android app. I haven’t had any issues with it after over six months of usage. So, I’d definitely give it thumbs up from my side if you’re willing to try it out! + +### Wrapping Up + +I’d say that Bitwarden is a complete solution for Linux users who want a password manager that works everywhere and syncs easily across multiple devices. + +You can get started for free but if you can, please go for the premium plan of **$10/year** to support this open-source project. + +You may also check our list of [top 5 password managers for Linux][3] should come in handy if you’re looking for more options. + +Have you tried Bitwarden yet? If not, give it a try! Also, what is your favorite password manager? Let me know in the comments below! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/bitwarden/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-screenshot.jpg?ssl=1 +[2]: https://bitwarden.com/ +[3]: https://itsfoss.com/password-managers-linux/ +[4]: https://help.bitwarden.com/security/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-dark-mode.jpg?ssl=1 +[6]: https://itsfoss.com/password-generators-linux/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-pricing.jpg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-settings.png?ssl=1 +[9]: https://itsfoss.com/use-appimage-linux/ +[10]: https://snapcraft.io/bitwarden +[11]: https://bitwarden.com/#download +[12]: https://github.com/bitwarden +[13]: https://www.lastpass.com/ From f8b6cceff55b08393f53830530cbd65fc8ab106d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Apr 2020 00:53:26 +0800 Subject: [PATCH 0161/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200407=20New?= =?UTF-8?q?=20Linux=20Distribution=20UbuntuDDE=20Brings=20The=20Beautiful?= =?UTF-8?q?=20Deepin=20Desktop=20to=20Ubuntu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md --- ... The Beautiful Deepin Desktop to Ubuntu.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md diff --git a/sources/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md b/sources/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md new file mode 100644 index 0000000000..20ea7834d6 --- /dev/null +++ b/sources/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu) +[#]: via: (https://itsfoss.com/ubuntudde/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu +====== + +Deepin is a beautiful desktop environment with an intuitive UI. UbuntuDDE project combines the power of Ubuntu and the beauty of Deepin. + +[Deepin Desktop Environment][1] (DDE) is a beautiful desktop environment created by the developers of [Deepin Linux][2]. Initially, Deepin Linux was based on [Ubuntu][3] but later they switched to [Debian][4]. + +![Deepin Desktop Environment in Ubuntu][5] + +One major problem with Deepin Linux is its slow servers. A regular system takes hours to download for the fact that they have all their servers in China and these servers are unfortunately extremely slow. + +If you want to use Deepin desktop, nothing stops you from installing it on your regular Ubuntu system. [UbuntuDDE][6] is trying to make it simpler by providing you an out of the box Deepin desktop experience on top of Ubuntu. This saves you time and effort in installing and configuring Deepin on Ubuntu. + +![Screenshot of UbuntuDDE][7] + +### Ubuntu DDE: Power of Ubuntu and beauty of Deepin desktop + +Please note that UbuntuDDE is not an official flavor of Ubuntu. UbuntuDDE developers are not associated with the Ubuntu team. UbuntuDDE is currently a Remix distribution and is aiming for getting recognized as Ubuntu’s official flavor in future releases. + +UbuntuDDE developers are helped by Alan Pope of Ubuntu’s Snapcraft team and teams of Ubuntu Budgie and [Ubuntu Cinnamon][8] and a few other developers. + +In a conversation with It’s FOSS, its lead developer Arun highlighted that the important aspect of this project is to regularly maintain the DDE packages for Ubuntu and help users enjoy the full taste of DDE (Deepin Desktop Environment). + +![Ubuntu Deepin Edition login screen][9] + +Arun also mentioned that this Ubuntu Deepin remix project started first by maintaining and packaging the packages to the latest release from the upstream i.e. Deepin Repository. Then, it eventually got spin with Ubuntu 20.04 focal resulting in an image file that everyone can install without the hassle to install regular Ubuntu first and then the Deepin Desktop. UbuntuDDE is not just the combo of DDE and Ubuntu but also the fusion of selective packages and design changes by the UbuntuDDE Team. + +![UbuntuDDE screenshot][10] + +Unlike Deepin Linux, UbuntuDDE doesn’t use Deepin Appstore. It uses Ubuntu Software Center instead. This should be a good news if you are spooked by the [spyware labeling of Wuhan-based Deepin Linux][11]. + +### Download UbuntuDDE 20.04 Beta + +UbuntuDDE is aiming to release its first official stable release with Ubuntu 20.04. Like [other Ubuntu flavors][12], UbuntuDDE 20.04 beta is also available for you to download and try. + +Warning! + +A word of warning. UbuntuDDE is a novice project under development. Please don’t use it on your main system. If you want to try it, use it in virtual machine or on a spare system. + +[Download Ubuntu 20.04 DDE Beta][13] + +![Installing UbuntuDDE][14] + +Since it is essentially Ubuntu, installing UbuntuDDE is the same as installing Ubuntu. You may refer to this tutorial showing [how to install Ubuntu inside VirtualBox][15]. + +I know you may think ‘not another Ubuntu’ or ‘it’s just Deepin on Ubuntu that anyone can do’ and you do have a point. But I also know there is a small segment of users who like projects like UbuntuDDE that makes thing easier for them. I mean that’s how many Ubuntu flavor came into existence. What do you think? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntudde/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.deepin.org/en/dde/ +[2]: https://www.deepin.org/en/ +[3]: https://ubuntu.com/ +[4]: https://www.debian.org/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot.jpg?ssl=1 +[6]: https://ubuntudde.com/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot-1.jpg?ssl=1 +[8]: https://itsfoss.com/ubuntu-cinnamon/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot-5.jpg?ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot-2.jpg?ssl=1 +[11]: https://www.deepin.org/en/2018/04/14/linux-deepin-is-not-spyware/ +[12]: https://itsfoss.com/which-ubuntu-install/ +[13]: https://ubuntudde.com/download/ +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot-4.jpg?ssl=1 +[15]: https://itsfoss.com/install-linux-in-virtualbox/ From 3caeead340a71b5505da54beebfb699eda260b28 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Apr 2020 00:55:54 +0800 Subject: [PATCH 0162/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200406=20What?= =?UTF-8?q?=20is=20good=20documentation=20for=20software=20projects=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200406 What is good documentation for software projects.md --- ...ood documentation for software projects.md | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 sources/tech/20200406 What is good documentation for software projects.md diff --git a/sources/tech/20200406 What is good documentation for software projects.md b/sources/tech/20200406 What is good documentation for software projects.md new file mode 100644 index 0000000000..7726287131 --- /dev/null +++ b/sources/tech/20200406 What is good documentation for software projects.md @@ -0,0 +1,156 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is good documentation for software projects?) +[#]: via: (https://opensource.com/article/20/4/documentation) +[#]: author: (Cameron Shorter https://opensource.com/users/cameronshorter) + +What is good documentation for software projects? +====== +Mixing experienced tech writers with open source communities reveals new +approaches for creating better docs. +![Typewriter with hands][1] + +The [Open Geospatial (OSGeo) Foundation][2] recently participated in Google's first [Season of Docs][3], in which Google sponsored senior technical writers to contribute to open source projects. OSGeo is an umbrella organization for around 50 geospatial open source projects. I've contributed to a number of these projects over the years and recently co-mentored the two Season of Docs technical writers Google allocated to OSGeo. + +We discovered during our involvement that, like many open source projects, we knew little about: + + * The state of our docs + * What we were aiming for + * Our priorities + * The details of the challenges we faced + * How to improve + + + +We discovered: + + * How hard it is to keep tech docs current + * Skillsets from multiple roles are needed to create good docs + * Open source's docs and writing processes are immature when compared to software development + + + +It is an exciting problem space with high-value challenges ready to be tackled. It reminds me of the early days of open source, before it became trendy with business. + +### What should tech writers work on? + +Open source communities welcomed the chance to have tech writers improve our docs and expressed a pressing need for it, but found it hard to articulate exactly what needed to be fixed: + + * People explained that their project docs often hadn't been updated between doc releases. + * Some projects had new features that had not been documented. + * Other projects had issue lists, collating observed deficiencies, but had no systematic review. + * Most observed that docs were created by developers with no formal tech writing training. + * Many noted that their English docs were written by non-native English speakers. + + + +But where should we start? We needed to decide on what we wanted and what we should work on first. + +### Defining good docs + +We then realized that we didn't have a good definition of "good documentation." For our software projects, we have a comprehensive [incubation process][4] to assess the maturity of software and the project's community, but we couldn't find a similar set of metrics to define "good documentation." So we started the [Good Docs Project][5] to collate "best-practice templates and writing instructions for documenting open source software." This helped us define what we were aiming for and prioritize what we can achieve with our available resources. + +### Documentation audit + +Once we knew what good docs looked like, we could audit the status of a project's docs: + + * What documentation do we have? + * Does it cover all the functionality? + * Does it cover end-user needs? + * Is the documentation any good? + + + +We discovered that the quality, currency, and completeness of our OSGeo docs were immature when compared to the quality of the software they described. + +### It takes a village to raise good docs + +In researching open source projects' documentation needs, it became clear that crafting good docs requires multiple skillsets. Ideally, a doc team has access to: + + * A developer with a deep understanding of the software being described + * A software user who can explain the application within the context of the application's domain + * An educator who understands the principles of learning + * An information architect who understands how to structure material + * A writer who writes clearly and concisely with good grammar + * Someone who speaks English as a first language (for English docs) + * A translator who is good at translating docs into multiple languages + * A DevOps person who can set up doc-build pipelines + * A community builder, facilitator, and coordinator who can inspire collective action, capture offers of help, and help all these different personas collaborate + + + +Technical writers usually have a high-level understanding of most of these domains, and their skills are often under-appreciated and under-utilized, especially if they are directed with a vague "just clean up the grammar and stuff." + +However, the best docs typically have been influenced by multiple stakeholders. This can be partly achieved by [using templates to collaborate][6] between domains, timeframes, projects, and organizations. + +### Tools for documenting open source projects are painful + +We experienced significant pain in trying to convert between software and [writing toolsets][7]. We love the versioning of Git, are frustrated by clunky Markdown interfaces, and want access to editing and review workflows in Word and Google Docs along with grammar and syntax plugin tools such as Grammarly. Translation tools such as Transifex are pretty cool, too. + +Could someone please write an application that addresses this use case? Maybe there is an idea in here for a future [Google Summer of Code][8]? + +### Achievements during OSGeo's Season of Docs + +We're quite proud of our achievements during OSGeo's participation in Google's Season of Docs. Our allocated tech writers amplified the effectiveness of our existing documentation communities, and our documentation communities amplified the effectiveness of these tech writers: + + * [Felicity Brand][9] worked with around 50 of OSGeo's open source projects to update the Quickstarts as part of our [OSGeoLive][10] distribution of software. + * [Swapnil Ogale][11] worked directly with [GeoNetwork's][12] documentation team, auditing the breadth and quality of docs, setting up templates for future docs, and updating many of the docs. + + + +Further: + + * We kicked off the Good Docs Project to establish "best-practice templates and writing instructions for documenting open source software." + * In conjunction with the [OGC][13] and [ISO][14] spatial standards communities, we kicked off an [OSGeo Lexicon][15] project to coordinate official definitions for terminology used within the OSGeo context. This will apply best-practice definitions to previously haphazard glossaries. + * We did a [deep-dive analysis][16] of the documentation challenges faced by QGIS, one of OSGeo's most successful projects. Surprisingly, its biggest problem isn't a lack of tech writers or complicated tools (although they are factors). Key problems center around: + * Poorly capturing community goodwill and offers of assistance + * Lack of direction + * Struggling to keep up with a rapidly evolving software baseline + * Insufficient writing expertise + * A high technical barrier to entry + * Documentation and training being generated outside of the core project + * Awkward documentation tools and processes + + + +### Thanks, Google + +We are grateful to Google for sponsoring Season of Docs. We've learned plenty from Felicity and Swapnil, the great writers that Google provided to us, and we hope what we have learned will help make future Season of Docs initiatives even better. + +* * * + +_This originally appeared on [Cameron Shorter's blog][17] and is republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/documentation + +作者:[Cameron Shorter][a] +选题:[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/cameronshorter +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/typewriter-hands.jpg?itok=oPugBzgv (Typewriter with hands) +[2]: https://www.osgeo.org/ +[3]: https://developers.google.com/season-of-docs +[4]: https://www.osgeo.org/about/committees/incubation/graduation/ +[5]: https://thegooddocsproject.dev/ +[6]: http://cameronshorter.blogspot.com/2019/02/inspiring-techies-to-become-great.html +[7]: https://opensource.com/article/20/3/open-source-writing-tools +[8]: https://summerofcode.withgoogle.com/ +[9]: https://flicstar.com/2019/11/27/project-report-for-season-of-docs-2019/ +[10]: https://live.osgeo.org/en/index.html +[11]: https://docs.google.com/document/d/1sTGz8aWPTS6moxgrtsBRz19roemJlilcdQk6B-9IZOo +[12]: https://geonetwork-opensource.org/ +[13]: https://www.ogc.org/ +[14]: https://committee.iso.org/home/tc211 +[15]: https://wiki.osgeo.org/wiki/Lexicon_Committee +[16]: http://cameronshorter.blogspot.com/2019/12/why-qgis-docs-team-is-struggling.html +[17]: https://cameronshorter.blogspot.com/2020/03/insights-from-mixing-writers-with-open.html From 623885d1524e1a11fb4463bc93061eef400611fa Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Apr 2020 01:03:15 +0800 Subject: [PATCH 0163/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200406=20How?= =?UTF-8?q?=20to=20Use=20a=20Differential=20Analyzer=20(to=20Murder=20Peop?= =?UTF-8?q?le)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200406 How to Use a Differential Analyzer (to Murder People).md --- ...ifferential Analyzer (to Murder People).md | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 sources/talk/20200406 How to Use a Differential Analyzer (to Murder People).md diff --git a/sources/talk/20200406 How to Use a Differential Analyzer (to Murder People).md b/sources/talk/20200406 How to Use a Differential Analyzer (to Murder People).md new file mode 100644 index 0000000000..6796e25603 --- /dev/null +++ b/sources/talk/20200406 How to Use a Differential Analyzer (to Murder People).md @@ -0,0 +1,147 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: 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) + +How to Use a Differential Analyzer (to Murder People) +====== + +A differential analyzer is a mechanical, analog computer that can solve differential equations. Differential analyzers aren’t 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? That’s 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. + +Let’s 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 let’s 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. That’s 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 I’ve 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 won’t 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 won’t even complete his master’s thesis for another year yet (the one in which he casually implements Boolean algebra using electronic circuits). Without digital computers, I’m 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, Bush’s 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. It’s 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, I’m 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 ball’s velocity at a rate that is proportional to its velocity (the (k) here is some proportionality constant whose value we don’t 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 analyzer’s 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, here’s 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 we’ve 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 I’ve 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 rod’s 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 it’s true that the differential analyzer is not so magical that it can write out a neat mathematical expression for the solution to our problem, it’s 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 don’t 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 it’s 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 don’t want to get too deep into how these mathematical theories work, because the math is complicated and I don’t 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 we’ve 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 world’s 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 it’s unfair to single out the differential analyzer for moral hand-wringing. The differential analyzer isn’t 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: +> +> — 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. 506–547., . [↩︎][10] + + 2. Karl Kempf. “Electronic Computers within the Ordnance Corps,” 1961, accessed April 6, 2020, . [↩︎][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.GUgd146Tkg#fn:1 +[6]: tmp.GUgd146Tkg#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.GUgd146Tkg#fnref:1 +[11]: tmp.GUgd146Tkg#fnref:2 From f36146f1b3f3bbfcc32e9f45cf548de5cff40dc9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 7 Apr 2020 08:31:01 +0800 Subject: [PATCH 0164/1809] translated --- ...hich Graphics Card do You Have in Linux.md | 102 ------------------ ...hich Graphics Card do You Have in Linux.md | 102 ++++++++++++++++++ 2 files changed, 102 insertions(+), 102 deletions(-) delete mode 100644 sources/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md create mode 100644 translated/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md diff --git a/sources/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md b/sources/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md deleted file mode 100644 index 112a024b5c..0000000000 --- a/sources/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md +++ /dev/null @@ -1,102 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Find Which Graphics Card do You Have in Linux?) -[#]: via: (https://itsfoss.com/check-graphics-card-linux/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Find Which Graphics Card do You Have in Linux? -====== - -Be it [Nvidia][1] or [Radeon][2] or Intel, they all may have some issues with Linux. When you are on your way to troubleshoot the graphics problem, the first thing you want to know is which graphics card do you have in your system. - -Linux has several commands to check hardware information. You can use them to check what graphics card (also refer to as video card) do you have. Let me show you a couple of commands to get GPU information in Linux. - -### Check graphics card details in Linux command line - -![][3] - -#### Use lspci command to find graphics card - -The lspci command displays the information about devices connected through [PCI][4] (peripheral Component Interconnect) buses. Basically, this command gives you the detail about all the peripheral devices to your system from keyboard and mouse to sound, network and graphics cards. - -By default, you’ll have a huge list of such peripheral devices. This is why you need to filter the output for graphics card with grep command in this manner: - -``` -lspci | grep VGA -``` - -This should show a one line information about your graphics card: - -``` -[email protected]:~$ lspci | grep VGA -00:02.0 VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02) -``` - -As you can see, my system has Intel HD 620 video card. - -#### Get detailed graphics card information with lshw command in Linux - -The lspci command is good enough to see what graphics card you have but it doesn’t tell you a lot. You can use lshw command to get more information on it. - -This command requires you to have root access. You need to specify that you are looking for video card (graphics card) information in this fashion: - -``` -sudo lshw -C video -``` - -And as you can see in the output below, this command gives more information on the graphics card such as clock rate, width, driver etc. - -``` -[email protected]:~$ sudo lshw -C video -[sudo] password for abhishek: - *-display - description: VGA compatible controller - product: HD Graphics 620 - vendor: Intel Corporation - physical id: 2 - bus info: [email protected]:00:02.0 - version: 02 - width: 64 bits - clock: 33MHz - capabilities: pciexpress msi pm vga_controller bus_master cap_list rom - configuration: driver=i915 latency=0 - resources: irq:139 memory:db000000-dbffffff memory:90000000-9fffffff ioport:f000(size=64) memory:c0000-dffff -``` - -#### Bonus Tip: Check graphics card details graphically - -It’s not that you must use the command line to find graphics card details in Linux. Most Linux distributions (or should I say desktop environments) provide essential details in the settings application. - -For example, if you are using [GNOME desktop environment][5], you can check the details by going to About section of Settings. Here’s what it looks like in [Ubuntu 20.04][6]: - -![Graphics card information check graphically][7] - -I hope you find this quick tip helpful. You can also use the same commands to [find your network adapter][8] and [CPU information in Linux][9]. - -If you have questions or suggestions, don’t hesitate to write a comment. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/check-graphics-card-linux/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://www.nvidia.com/en-us/ -[2]: https://www.amd.com/en/graphics/radeon-rx-graphics -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/check-gpu-info-linux.jpg?ssl=1 -[4]: https://en.wikipedia.org/wiki/Conventional_PCI -[5]: https://www.gnome.org/ -[6]: https://itsfoss.com/ubuntu-20-04-release-features/ -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/ubuntu-gpu-check.jpg?ssl=1 -[8]: https://itsfoss.com/find-network-adapter-ubuntu-linux/ -[9]: https://linuxhandbook.com/check-cpu-info-linux/ diff --git a/translated/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md b/translated/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md new file mode 100644 index 0000000000..68e41c5b9a --- /dev/null +++ b/translated/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Find Which Graphics Card do You Have in Linux?) +[#]: via: (https://itsfoss.com/check-graphics-card-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何找出 Linux 中的显卡? +====== + +无论是 [Nvidia][1] 还是 [Radeon][2] 或者 Intel,它们都可能在 Linux 中有问题。当你要对图形问题进行故障排除时,首先要了解系统中装有哪种显卡。 + +Linux 有几个命令可以检查硬件信息。你可以使用它们来检查你有哪些显卡(也称为视频卡)。让我向你展示一些命令来获取 Linux 中的 GPU 信息。 + +### 在 Linux 命令行中检查显卡详细信息 + +![][3] + +#### 使用 lspci 命令查找显卡 + +lspci 命令显示通过 [PCI][4](外设组件互连)总线连接的设备的信息。基本上,此命令提供有关系统所有外设的详细信息,从键盘和鼠标到声卡、网卡和显卡。 + +默认情况下,你会有大量的此类外设列表。这就是为什么你需要用 grep 命令过滤显卡的原因: + +``` +lspci | grep VGA +``` + +这应该会显示一行有关你显卡的信息: + +``` +[email protected]:~$ lspci | grep VGA +00:02.0 VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02) +``` + +如你所见,我的系统中有 Intel HD 620 显卡。 + +#### 在 Linux 中使用 lshw 命令获取显卡详细信息 + +lspci 命令足以查看你的显卡,但是并不能告诉你很多信息。你可以使用 lshw 命令获取有关它的更多信息。 + +此命令要求你有 root 用户权限。你需要以这种方式查找视频卡(显卡)信息: + +``` +sudo lshw -C video +``` + +正如你在下面的输出中看到的那样,此命令提供了有关显卡的更多信息,例如时钟频率、位宽、驱动等。 + +``` +[email protected]:~$ sudo lshw -C video +[sudo] password for abhishek: + *-display + description: VGA compatible controller + product: HD Graphics 620 + vendor: Intel Corporation + physical id: 2 + bus info: [email protected]:00:02.0 + version: 02 + width: 64 bits + clock: 33MHz + capabilities: pciexpress msi pm vga_controller bus_master cap_list rom + configuration: driver=i915 latency=0 + resources: irq:139 memory:db000000-dbffffff memory:90000000-9fffffff ioport:f000(size=64) memory:c0000-dffff +``` + +#### 额外的技巧:以图形方式检查显卡详细信息 + +并非必须使用命令行在 Linux 中查找显卡详细信息。大多数 Linux 发行版(或者应该说是桌面环境)在设置中提供了必要的详细信息。 + +例如,如果你使用的是 [GNOME 桌面环境][5],那么可以进入“设置”的“关于”部分来检查详细信息。[Ubuntu 20.04][6] 中看上去像这样: + +![Graphics card information check graphically][7] + +我希望这个快速技巧对你有所帮助。你也可以使用相同的命令来[查找网卡][8]和 [Linux 中的 CPU 信息][9]。 + +如果你有任何疑问或建议,请随时发表评论。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/check-graphics-card-linux/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.nvidia.com/en-us/ +[2]: https://www.amd.com/en/graphics/radeon-rx-graphics +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/check-gpu-info-linux.jpg?ssl=1 +[4]: https://en.wikipedia.org/wiki/Conventional_PCI +[5]: https://www.gnome.org/ +[6]: https://itsfoss.com/ubuntu-20-04-release-features/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/ubuntu-gpu-check.jpg?ssl=1 +[8]: https://itsfoss.com/find-network-adapter-ubuntu-linux/ +[9]: https://linuxhandbook.com/check-cpu-info-linux/ From dfcac2b5417a66f3ad8f4493879662bdf0e7ec98 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 7 Apr 2020 08:42:24 +0800 Subject: [PATCH 0165/1809] translating --- ...a private chat server with a Raspberry Pi and Rocket.Chat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md b/sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md index 26e823de79..8c7b49e7c3 100644 --- a/sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md +++ b/sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a8b438fc8c351f723d3c1487693a480a74ac1be7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 Apr 2020 09:46:51 +0800 Subject: [PATCH 0166/1809] Rename sources/tech/20200406 What is good documentation for software projects.md to sources/talk/20200406 What is good documentation for software projects.md --- .../20200406 What is good documentation for software projects.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200406 What is good documentation for software projects.md (100%) diff --git a/sources/tech/20200406 What is good documentation for software projects.md b/sources/talk/20200406 What is good documentation for software projects.md similarity index 100% rename from sources/tech/20200406 What is good documentation for software projects.md rename to sources/talk/20200406 What is good documentation for software projects.md From a26ba55a7d4002cbe3aca3504fb9d9ed0e30825b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Apr 2020 10:41:00 +0800 Subject: [PATCH 0167/1809] PRF @wxy --- ...recting Kubernetes traffic with Traefik.md | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/translated/tech/20200311 Directing Kubernetes traffic with Traefik.md b/translated/tech/20200311 Directing Kubernetes traffic with Traefik.md index bb35205ad2..fce1c26ee6 100644 --- a/translated/tech/20200311 Directing Kubernetes traffic with Traefik.md +++ b/translated/tech/20200311 Directing Kubernetes traffic with Traefik.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Directing Kubernetes traffic with Traefik) @@ -16,21 +16,21 @@ 在本文中,我们将部署几个简单的网站,并学习如何使用 Traefik 将来自外部世界的流量引入到我们的集群中。之后,我们还将学习如何删除 Kubernetes 资源。让我们开始吧! -- [video](https://youtu.be/QcC-5fRhsM8) +- [video](https://img.linux.net.cn/static/video/Ingressing%20with%20k3s-QcC-5fRhsM8.mp4) ### 准备 -要继续阅读本文,你只需要我们在上一篇文章中构建的 [k3s 树莓派集群][2]。由于你的集群将从网络上拉取图像,因此该集群需要能够访问互联网。 +要继续阅读本文,你只需要我们在上一篇文章中构建的 [k3s 树莓派集群][2]。由于你的集群将从网络上拉取镜像,因此该集群需要能够访问互联网。 出于解释目的,本文将显示一些配置文件和示例 HTML 文件。所有示例文件都可以在[此处][3]下载。 ### 部署一个简单的网站 -之前,我们使用 `kubectl` 进行了直接部署。但是,这不是部署事物的典型方法。通常,会使用 YAML 配置文件,这就是我们将在本文中使用的配置文件。我们将从顶部开始,并以自顶向下的方式创建该配置文件。 +之前,我们使用 `kubectl` 进行了直接部署。但是,这不是典型的部署方法。一般情况都会使用 YAML 配置文件,这也是我们要在本文中使用的配置文件。我们将从顶部开始,并以自顶向下的方式创建该配置文件。 ### 部署配置 -首先是部署配置。配置如下所示,并在下面进行说明。我通常以 [Kubernetes 文档][4]中的示例为起点,然后对其进行修改以适合我的需求。例如,从[部署文档][5]复制示例后,修改下面的配置。 +首先是部署配置。配置如下所示,并在下面进行说明。我通常以 [Kubernetes 文档][4]中的示例为起点,然后根据需要对其进行修改。例如,下面的配置是复制了[部署文档][5]中的示例后修改的。 创建一个文件 `mysite.yaml`,其内容如下: @@ -58,15 +58,15 @@ spec: - containerPort: 80 ``` -其中大部分是样板。重要的部分,我们会将该部署命名为 `mysite-nginx`,并加上 `mysite-nginx` 的 `app` 标签。我们已指定要一个副本replica,这意味着将只创建一个 Pod。我们还指定了一个容器,我们将其命名为 `nginx`。我们将镜像image指定为 `nginx`。这意味着在部署时,k3s 将从 DockerHub 下载 `nginx` 镜像并从中创建一个 Pod。最后,我们指定了容器端口containerPort为 `80`,这只意味着在容器内部 Pod 会监听 `80` 端口。 +其中大部分是样板。重要的部分,我们会将该部署命名为 `mysite-nginx`,并为其加上同名的 `app` 标签。我们指定了一个副本replica,这意味着将只创建一个 Pod。我们还指定了一个容器,我们将其命名为 `nginx`。我们将镜像image指定为 `nginx`。这意味着在部署时,k3s 将从 DockerHub 下载 `nginx` 镜像并从中创建一个 Pod。最后,我们指定了容器端口containerPort为 `80`,这只意味着在容器内部 Pod 会监听 `80` 端口。 -我在上面强调了“在容器内部”,因为这是一个重要的区别。由于我们是按容器配置的,因此只能在容器内部访问它,并且进一步将其限制为内部网络。这是允许多个容器在同一容器端口上监听所必需的。换句话说,通过这种配置,其他某些 Pod 也可以在其容器端口 80 上侦听,并且不会与此容器冲突。为了提供对该 Pod 的正式访问权限,我们需要一个服务service配置。 +我在上面强调了“在容器内部”,因为这是一个重要的区别。由于我们是按容器配置的,因此只能在容器内部访问它,并且进一步将其限制为内部网络。这对于允许多个容器在同一容器端口上监听所是必要的。换句话说,通过这种配置,其他一些 Pod 也可以在其容器端口 80 上侦听,并且不会与此容器冲突。为了提供对该 Pod 的正式访问权限,我们需要一个服务service配置。 ### 服务配置 -在 Kubernetes 中,服务service是一种抽象。它提供了一种访问一个或一组 Pod 的方法。如果定义了多个 Pod 副本,则一个连接到服务,并且由服务路由到单个 Pod,或通过负载均衡路由到多个 Pod。 +在 Kubernetes 中,服务service是一种抽象。它提供了一种访问 Pod 或 Pod 集合的方法。当连接到服务时,服务会路由到单个 Pod,或者如果定义了多个 Pod 副本,会通过负载均衡路由到多个 Pod。 -可以在同一配置文件中指定该服务,这就是我们将在此处执行的操作。用 `---` 分隔配置区域。将以下内容添加到 `mysite.yaml` 中: +可以在同一配置文件中指定该服务,这就是我们将在此处要做的。用 `---` 分隔配置区域,将以下内容添加到 `mysite.yaml` 中: ``` --- @@ -82,11 +82,11 @@ spec: port: 80 ``` -在此配置中,我们将服务命名为 `mysite-nginx-service`。我们提供了 `app: mysite-nginx` 的选择器selector。这是服务选择其路由到的应用程序容器的方式。请记住,我们为容器提供了一个内容为 `mysite-nginx` 的 `app` 标签。这就是服务用来查找我们的容器的方式。最后,我们指定服务协议为 `TCP`,在端口 `80` 上侦听。 +在此配置中,我们将服务命名为 `mysite-nginx-service`。我们提供了一个选择器selector:`app: mysite-nginx`。这是服务选择其路由到的应用程序容器的方式。请记住,我们为容器提供了 `app` 标签:`mysite-nginx` 。这就是服务用来查找我们的容器的方式。最后,我们指定服务协议为 `TCP`,在端口 `80` 上监听。 ### 入口配置 -入口Ingress配置指定如何将流量从集群外部传递到集群内部的服务。请记住,k3s 预先配置了 Traefik 作为入口控制器。因此,我们将编写特定于 Traefik 的入口配置。将以下内容添加到 `mysite.yaml` 中(不要忘了用 `---` 分隔): +入口Ingress配置指定了如何将流量从集群外部传递到集群内部的服务。请记住,k3s 预先配置了 Traefik 作为入口控制器。因此,我们将编写特定于 Traefik 的入口配置。将以下内容添加到 `mysite.yaml` 中(不要忘了用 `---` 分隔): ``` --- @@ -106,13 +106,13 @@ spec: servicePort: 80 ``` -在此配置中,我们将入口记录命名为 `mysite-nginx-ingress`。我们告诉 Kubernetes,我们希望 `traefik` 成为我们的入口控制器,带有 `kubernetes.io/ingress.class` 的注解。 +在此配置中,我们将入口记录命名为 `mysite-nginx-ingress`。我们告诉 Kubernetes,我们希望 `traefik` 成为我们的入口控制器,再加上 `kubernetes.io/ingress.class` 的注解。 在规则rules部分中,我们基本上是说,当 `http` 流量进入时,并且 `path` 匹配 `/`(或其下的任何内容),将其路由到由 `serviceName mysite-nginx-service` 指定的后端backend服务中,并将其路由到 `servicePort 80`。这会将传入的 HTTP 流量连接到我们之前定义的服务。 -### 部署的东西 +### 需要部署的东西 -就配置而言,确实如此。如果现在部署,我们将获得默认的 nginx 页面,但这不是我们想要的。让我们创建一些简单但可自定义的部署方式。创建具有以下内容的文件 `index.html`: +就配置而言,就是这样了。如果我们现在部署,我们将获得默认的 nginx 页面,但这不是我们想要的。让我们创建一些简单但可自定义的部署方式。创建具有以下内容的文件 `index.html`: ``` @@ -143,13 +143,13 @@ spec: ``` -我们尚未介绍 Kubernetes 中的存储机制,因此在这里我们偷懒一下,仅将该文件存储在 Kubernetes 配置映射中。这不是建议的网站部署方式,但可以满足我们的目的。运行以下命令: +我们尚未介绍 Kubernetes 中的存储机制,因此在这里我们偷懒一下,仅将该文件存储在 Kubernetes 配置映射中。这不是我们推荐的部署网站的方式,但对于我们的目的来说是可行的。运行以下命令: ``` kubectl create configmap mysite-html --from-file index.html ``` -该命令从本地文件 `index.html` 创建名为 `mysite-html` 的配置映射configmap资源。这实际上是在 Kubernetes 资源中存储一个文件(或一组文件),我们可以在配置中调出该文件。它通常用于存储配置文件(因此而得名),因此我们在这里稍加滥用。在以后的文章中,我们将讨论 Kubernetes 中适当的存储解决方案。 +该命令从本地文件 `index.html` 创建名为 `mysite-html` 的配置映射configmap资源。这实际上是在 Kubernetes 资源中存储一个文件(或一组文件),我们可以在配置中调出该文件。它通常用于存储配置文件(因此而得名),我们在这里稍加滥用。在以后的文章中,我们将讨论 Kubernetes 中适当的存储解决方案。 创建配置映射后,让我们将其挂载在我们的 `nginx` 容器中。我们分两个步骤进行。首先,我们需要指定一个volume来调出配置映射。然后我们需要将该卷挂载到 `nginx` 容器中。通过在 `mysite.yaml` 中的 `container` 后面的 `spec` 标签下添加以下内容来完成第一步: @@ -162,7 +162,7 @@ kubectl create configmap mysite-html --from-file index.html 这告诉 Kubernetes 我们要定义一个名为 `html-volume` 的卷,并且该卷应包含名为 `html-volume`(我们在上一步中创建的)的配置映射的内容。 -接下来,在 `nginx` 容器规范中的端口port下方,添加以下内容: +接下来,在 `nginx` 容器规范中的端口ports下方,添加以下内容: ```         volumeMounts: @@ -170,7 +170,7 @@ kubectl create configmap mysite-html --from-file index.html           mountPath: /usr/share/nginx/html ``` -这告诉 Kubernetes,对于 `nginx` 容器,我们想在容器中的 `/usr/share/nginx/html` 路径中挂载名为 `html-volume` 的卷。 为什么要使用 `/usr/share/nginx/html`?那个位置就是 `nginx` 镜像提供 HTML 服务的地方。通过在该路径上挂载卷,我们用该卷内容替换了默认内容。 +这告诉 Kubernetes,对于 `nginx` 容器,我们想在容器中的 `/usr/share/nginx/html` 路径上挂载名为 `html-volume` 的卷。 为什么要使用 `/usr/share/nginx/html`?那个位置就是 `nginx` 镜像提供 HTML 服务的地方。通过在该路径上挂载卷,我们用该卷内容替换了默认内容。 作为参考,配置文件的 `deployment` 部分现在应如下所示: @@ -231,7 +231,7 @@ kubectl get pods ### 尝试一下! -Pod 运行之后,就该尝试了。 开浏览器,然后在地址栏中输入 `kmaster`。 +Pod 运行之后,就该尝试了。打开浏览器,然后在地址栏中输入 `kmaster`。 ![][6] @@ -239,9 +239,9 @@ Pod 运行之后,就该尝试了。 开浏览器,然后在地址栏中输入 ### 另一个 -因此,现在我们有了一个运行单个网站的整个 k3s 集群。但是我们可以做更多!如果我们要在同一集群中提供另一个网站怎么办?让我们看看如何做到这一点。 +因此,现在我们有了一个运行单个网站的整个 k3s 集群。但是我们可以有更多的网站!如果我们要在同一集群中提供另一个网站怎么办?让我们看看如何做到这一点。 -同样,我们需要部署一些东西。碰巧我的狗有一条信息,她想让世界知道一段时间。因此,我专门为她制作了一些 HTML(可从示例 zip 文件中获得)。同样,我们将使用配置映射的技巧来托管这些 HTML。这次我们将把整个目录(`html` 目录)放到配置映射中,但是调用是相同的。 +同样,我们需要部署一些东西。碰巧我的狗有一条她想让全世界都知道的信息,她想了好久了。因此,我专门为她制作了一些 HTML(可从示例 zip 文件中获得)。同样,我们将使用配置映射的技巧来托管这些 HTML。这次我们将把整个目录(`html` 目录)放到配置映射中,但是调用是相同的。 ``` kubectl create configmap mydog-html --from-file html @@ -324,11 +324,11 @@ kubectl apply -f mydog.yaml ![][7] -呼!消息出来了!也许今晚我们都可以睡一觉。 +呼!消息发出去了!也许今晚我们都可以睡一觉。 -因此,现在,我们有了一个 k3s 集群,该集群托管了两个网站,Traefik 根据路径名决定将请求传递给哪个服务!但是,我们不仅限于基于路径的路由。我们也可以使用基于主机名的路由,我们将在以后的文章中进行探讨。 +因此,现在,我们有了一个 k3s 集群,该集群托管了两个网站,Traefik 根据路径名决定将请求传递给哪个服务!但是,不仅限于基于路径的路由,我们也可以使用基于主机名的路由,我们将在以后的文章中进行探讨。 -另外,我们刚刚托管的网站是标准的未加密 HTML 网站,如今的所有内容都使用 SSL/TLS 加密。在我们的下一篇文章中,我们将为 k3s 集群添加支持以托管 SSL/TLS HTTPS 站点! +另外,我们刚刚托管的网站是标准的未加密 HTML 网站,而如今的所有内容都使用 SSL/TLS 加密。在我们的下一篇文章中,我们将为 k3s 集群添加支持以托管 SSL/TLS HTTPS 站点! ### 清理 @@ -366,14 +366,14 @@ via: https://opensource.com/article/20/3/kubernetes-traefik 作者:[Lee Carpenter][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/carpie [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) -[2]: https://opensource.com/article/20/3/kubernetes-raspberry-pi +[2]: https://linux.cn/article-12049-1.html [3]: https://gitlab.com/carpie/ingressing_with_k3s/-/archive/master/ingressing_with_k3s-master.zip [4]: https://kubernetes.io/docs/ [5]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment From 3551996215a9bd75425eb25a0f92597382452a1b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Apr 2020 10:41:34 +0800 Subject: [PATCH 0168/1809] PUB @wxy https://linux.cn/article-12049-1.html --- .../20200311 Directing Kubernetes traffic with Traefik.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200311 Directing Kubernetes traffic with Traefik.md (99%) diff --git a/translated/tech/20200311 Directing Kubernetes traffic with Traefik.md b/published/20200311 Directing Kubernetes traffic with Traefik.md similarity index 99% rename from translated/tech/20200311 Directing Kubernetes traffic with Traefik.md rename to published/20200311 Directing Kubernetes traffic with Traefik.md index fce1c26ee6..c9cc3c3f8e 100644 --- a/translated/tech/20200311 Directing Kubernetes traffic with Traefik.md +++ b/published/20200311 Directing Kubernetes traffic with Traefik.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12049-1.html) [#]: subject: (Directing Kubernetes traffic with Traefik) [#]: via: (https://opensource.com/article/20/3/kubernetes-traefik) [#]: author: (Lee Carpenter https://opensource.com/users/carpie) From b52a82df766031a55dcd4235c93675b6b18dd650 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Apr 2020 11:32:39 +0800 Subject: [PATCH 0169/1809] PRF @robsean --- ...ox Linux desktop as your window manager.md | 64 +++++++++---------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/translated/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md b/translated/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md index 3fd04333d3..c637a2416e 100644 --- a/translated/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md +++ b/translated/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md @@ -1,73 +1,69 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Use the Fluxbox Linux desktop as your window manager) [#]: via: (https://opensource.com/article/19/12/fluxbox-linux-desktop) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -使用 Fluxbox Linux desktop 作为你的窗口管理器 +使用 Fluxbox 桌面作为你的窗口管理器 ====== -这篇文章是Linux 桌面24天的特别系列的一部分。 -Fluxbox 对系统资源的占用非常轻量,但是它拥有重要的 Linux -桌面特色来使你的用户体验轻松快速高效。 -![在蓝色区域中是,在浏览器上的文本编辑器][1] -桌面的概念可谓是仁者见仁智者见智。很多人把桌面看作一个家基地,或者一个舒适的客厅,甚至是一个字面意义上的桌面,在其中放置着他们经常使用的记事本,最好的笔和铅笔,还有他们最喜欢的咖啡杯。KDE, GNOME, Pantheon (等等)在 Linux 上提供了这种舒适的生活方式。 +> 本文是 24 天 Linux 桌面特别系列的一部分。Fluxbox 对系统资源的占用非常轻量,但它拥有重要的 Linux 桌面功能,让你的用户体验轻松、高效、快捷。 -但是对一些用户来说,桌面只是一个空荡荡的监控控件,将还没有自由浮动的应用程序窗口直接投射到显示器上的一个侧面效果。对于这些用户来说,桌面是真空的,在其中他们可以运行应用程序—不管的大型办公软件和图形套件,还是一个简单的终端窗口,或是来管理服务的停靠小程序。这种操作一台 [POSIX][2] 计算机的模式有很长的历史,该家族树的一支是 *box 窗口管理器:Blackbox, Fluxbox 和 Openbox 。 +![](https://img.linux.net.cn/data/attachment/album/202004/07/113105p0ng5skkn5kmvdm0.jpg) -[Fluxbox][3] 是一个针对 X11 系统的窗口管理器,它基于一个较老的名为 Blackbox 的项目。当我发现 Linux 时,Blackbox 的开发已进入衰退期,因此我进入 Fluxbox ,此后我至少在一个以上的活跃的系统上使用它。它使用 C++ 编写,并在 MIT 开源许可证下授权。 +桌面的概念可谓是仁者见仁智者见智。很多人把桌面看作一个家的基地,或者一个舒适的客厅,甚至是一个字面意义上的桌面,在其中放置着他们经常使用的记事本、最好的笔和铅笔,还有他们最喜欢的咖啡杯。KDE、 GNOME、Pantheon 等等在 Linux 上提供了这种舒适的生活方式。 + +但是对一些用户来说,桌面只是一个空荡荡的显示器空间,这是还没有任何可以自由浮动的应用程序窗口直接投射到他们的视网膜上的副作用。对于这些用户来说,桌面是一个空的空间,他们可以在上面运行应用程序 —— 无论是大型办公软件和图形套件,还是一个简单的终端窗口,或是来管理服务的托盘小程序。这种操作 [POSIX][2] 计算机的模式由来已久,该家族树的一支是 *box 窗口管理器:Blackbox、Fluxbox 和 Openbox。 + +[Fluxbox][3] 是一个 X11 系统的窗口管理器,它基于一个较老的名为 Blackbox 的项目。当我发现 Linux 时,Blackbox 的开发已进入衰退期,因此我就喜欢上了 Fluxbox ,此后我至少在一个以上的常用的系统上使用过它。它是用 C++ 编写的,并在 MIT 开源许可证下授权。 ### 安装 Fluxbox -你很可能会在你的 Linux 发行版的存储库中找到 Fluxbox ,但是你也可以在 [Fluxbox.org][4] 上找到它。如果你正在运行一个不同的桌面,在同一个系统上安装 Fluxbox 是安全的,因为 Fluxbox 不预先决定任何配置或附带应用程序。 +你很可能会在你的 Linux 发行版的软件库中找到 Fluxbox,但是你也可以在 [Fluxbox.org][4] 上找到它。如果你正在运行另外一个桌面,在同一个系统上安装 Fluxbox 是安全的,因为 Fluxbox 不会预设任何配置或附带的应用程序。 -在安装 Fluxbox 后,注销你当前的桌面会话,以便你可以登录一个新的桌面会话。默认情况下,你的桌面会话管理器 (KDM, GDM, LightDM 或 XDM,取决于你的安装设置) 将你继续登录到上一个在桌面,所以你在登录前必需要覆盖上一个桌面。 +在安装 Fluxbox 后,注销你当前的桌面会话,以便你可以登录一个新的桌面会话。默认情况下,你的桌面会话管理器 (KDM、GDM、LightDM 或 XDM,取决于你的安装设置) 将继续让登录到之前的桌面,所以你在登录前必需要覆盖上一个桌面。 使用 GDM 覆盖一个桌面: ![在 GDM 中选择你的桌面会话][5] -或者使用 KDM: +或者使用 KDM: ![使用 KDM 选择你的桌面会话][6] ### 配置 Fluxbox 桌面 -当你第一次登录到桌面时,屏幕大部分是空的,因为 Fluxbox 提供的所有东西是面板(用于任务栏,系统托盘等等)和用于应用程序窗口的窗口装饰品。 +当你第一次登录到桌面时,屏幕基本是空的,因为 Fluxbox 提供的所有东西是面板(用于任务栏、系统托盘等等)和用于应用程序窗口的窗口装饰品。 ![在 CentOS 7 上的默认 Fluxbox 配置][7] -如果你的发行版提供一个简单的 Fluxbox 桌面,你可以使用 **feh** 命令 (你可能需要从你的发行版存储库中来安装它) 来为你的桌面设置背景。这个命令有一些用于设置背景的选项,包括使用你选择的墙纸来填充屏幕的 **\--bg-fill** ,来按比例缩放的 **\--bg-scale** 等等选项。 - +如果你的发行版提供一个简单的 Fluxbox 桌面,你可以使用 `feh` 命令(你可能需要从你的发行版的软件库中安装它)来为你的桌面设置背景。这个命令有几个用于设置背景的选项,包括使用你选择的墙纸来填充屏幕的 `--bg-fill` 选项,来按比例缩放的 `--bg-scale` 等等选项。 ``` -`$ feh --bg-fill ~/photo/oamaru/leaf-spiral.jpg` +$ feh --bg-fill ~/photo/oamaru/leaf-spiral.jpg ``` ![应用主题的 Fluxbox ][8] -默认情况下,Fluxbox 自动生成一个菜单,在桌面上任意位置右键单击可用该菜单,这给予你访问应用程序的能力。取决于你的发行版,这个菜单可能非常小,也可能列出 **/usr/share/applications** 目录中的所有启动程序。 +默认情况下,Fluxbox 自动生成一个菜单,在桌面上任意位置右键单击可用该菜单,这给予你访问应用程序的能力。根据你的发行版的不同,这个菜单可能非常小,也可能列出 `/usr/share/applications` 目录中的所有启动程序。 -Fluxbox 配置是在文本文件中设置的,这些文本文件包含在 **$HOME/.fluxbox** 目录中。你可以: +Fluxbox 配置是在文本文件中设置的,这些文本文件包含在 `$HOME/.fluxbox` 目录中。你可以: - * 在 **keys** 中设置键盘快捷键 - * 在 **startup** 中启动服务和应用程序 - * 在 **init** 设置桌面首选项(例如工作区数量、面板位置等等) - * 在 **menu** 中设置菜单项 +* 在 `keys` 中设置键盘快捷键 +* 在 `startup` 中启动的服务和应用程序 +* 在 `init` 设置桌面首选项(例如工作区数量、面板位置等等) +* 在 `menu` 中设置菜单项 +该文本配置文件非常易于推断,但是你也可以(并且是应该)阅读 Fluxbox 的[文档][9]。 - -该文本配置文件非常易于逆向工程,但是你也可以 (并且是应该) 阅读 Fluxbox [文档][9] 。 - -例如,这是我的典型菜单 (或者说至少有它的基本结构): - +例如,这是我的典型菜单(或者说至少有它的基本结构): ``` # 为使用你自己的菜单,复制这些文本到 ~/.fluxbox/menu,然后编辑 -# ~/.fluxbox/init ,并更改 session.menuFile 文件到 ~/.fluxbox/menu +# ~/.fluxbox/init ,并更改 session.menuFile 文件路径到 ~/.fluxbox/menu [begin] (fluxkbox) [submenu] (apps) {} @@ -113,10 +109,9 @@ Fluxbox 配置是在文本文件中设置的,这些文本文件包含在 **$HO [end] ``` -该菜单也提供一些首选项设置,例如,选择一个主题和从 Fluxbox 会话中重启或注销的能力。 - -我使用键盘快捷键来启动大多数的应用程序,这些快捷键写入到 **keys** 配置文件中。这里有一些示例 ( **Mod4** 按键是超级按键,我使用其来指定全局快捷键): +该菜单也提供一些首选项设置,例如,选择一个主题,从 Fluxbox 会话中重启或注销的能力。 +我使用键盘快捷键来启动大多数的应用程序,这些快捷键写入到 `keys` 配置文件中。这里有一些示例(`Mod4` 按键是 `Super` 键,我使用其来指定全局快捷键): ``` # 打开应用程序 @@ -135,10 +130,9 @@ Mod4 3 :Exec ksnapshot ### 为什么你应该使用 Fluxbox -Fluxbox 对系统资源的占用非常轻量,但是它拥有重要的功能来使你的用户体验轻松快速高效。它很容易定制,并且它允许你定义你自己的工作流。你不必使用 Fluxbox 的面板,因为在这里有其它的极好的面板。你甚至可以鼠标双击和拖动两个独立的应用程序窗口到彼此之中,以便它们成为一个窗口,每个窗口都有自己的选项卡。 +Fluxbox 对系统资源的占用非常轻量,但是它拥有重要的功能,可以使你的用户体验轻松、快速、高效。它很容易定制,并且允许你定义你自己的工作流。你不必使用 Fluxbox 的面板,因为还有其它优秀的面板。你甚至可以鼠标中键点击并拖动两个独立的应用程序窗口到彼此之中,以便它们成为一个窗口,每个窗口都有自己的选项卡。 - -无穷的可能性,所以今天就在你的 Linux 上尝试一下 Fluxbox 的简单稳定吧! +可能性是无穷的,所以今天就在你的 Linux 上尝试一下 Fluxbox 的简单稳定吧! -------------------------------------------------------------------------------- @@ -147,7 +141,7 @@ via: https://opensource.com/article/19/12/fluxbox-linux-desktop 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f44609b7d36d1ca3982145413ac7181c00174179 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Apr 2020 11:35:00 +0800 Subject: [PATCH 0170/1809] PUB @robsean https://linux.cn/article-12082-1.html --- ...09 Use the Fluxbox Linux desktop as your window manager.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191209 Use the Fluxbox Linux desktop as your window manager.md (99%) diff --git a/translated/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md b/published/20191209 Use the Fluxbox Linux desktop as your window manager.md similarity index 99% rename from translated/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md rename to published/20191209 Use the Fluxbox Linux desktop as your window manager.md index c637a2416e..d3eb78339e 100644 --- a/translated/tech/20191209 Use the Fluxbox Linux desktop as your window manager.md +++ b/published/20191209 Use the Fluxbox Linux desktop as your window manager.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12082-1.html) [#]: subject: (Use the Fluxbox Linux desktop as your window manager) [#]: via: (https://opensource.com/article/19/12/fluxbox-linux-desktop) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 9e367f35a8b892fe3296c7984a28c680dead12c0 Mon Sep 17 00:00:00 2001 From: Chunibyo <359806334@qq.com> Date: Tue, 7 Apr 2020 17:31:49 +0800 Subject: [PATCH 0171/1809] =?UTF-8?q?chunibyo-wly=20=E5=8F=91=E5=B8=83=20(?= =?UTF-8?q?#18017)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 20/04/03 * 20/04/03 * 20/04/06 * 190612 翻译完成 * 审阅完成 * 发布 --- .../20190612 How to write a loop in Bash.md | 282 ------------------ .../20190612 How to write a loop in Bash.md | 260 ++++++++++++++++ ...0331 5 ways to level up your Vim skills.md | 155 ++++++++++ 3 files changed, 415 insertions(+), 282 deletions(-) delete mode 100644 sources/tech/20190612 How to write a loop in Bash.md create mode 100644 translated/tech/20190612 How to write a loop in Bash.md create mode 100644 translated/tech/20200331 5 ways to level up your Vim skills.md diff --git a/sources/tech/20190612 How to write a loop in Bash.md b/sources/tech/20190612 How to write a loop in Bash.md deleted file mode 100644 index c795a3bf82..0000000000 --- a/sources/tech/20190612 How to write a loop in Bash.md +++ /dev/null @@ -1,282 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (chunibyo-wly) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to write a loop in Bash) -[#]: via: (https://opensource.com/article/19/6/how-write-loop-bash) -[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/goncasousa/users/howtopamm/users/howtopamm/users/seth/users/wavesailor/users/seth) - -How to write a loop in Bash -====== -Automatically perform a set of actions on multiple files with for loops -and find commands. -![bash logo on green background][1] - -A common reason people want to learn the Unix shell is to unlock the power of batch processing. If you want to perform some set of actions on many files, one of the ways to do that is by constructing a command that iterates over those files. In programming terminology, this is called _execution control,_ and one of the most common examples of it is the **for** loop. - -A **for** loop is a recipe detailing what actions you want your computer to take _for_ each data object (such as a file) you specify. - -### The classic for loop - -An easy loop to try is one that analyzes a collection of files. This probably isn't a useful loop on its own, but it's a safe way to prove to yourself that you have the ability to handle each file in a directory individually. First, create a simple test environment by creating a directory and placing some copies of some files into it. Any file will do initially, but later examples require graphic files (such as JPEG, PNG, or similar). You can create the folder and copy files into it using a file manager or in the terminal: - - -``` -$ mkdir example -$ cp ~/Pictures/vacation/*.{png,jpg} example -``` - -Change directory to your new folder, then list the files in it to confirm that your test environment is what you expect: - - -``` -$ cd example -$ ls -1 -cat.jpg -design_maori.png -otago.jpg -waterfall.png -``` - -The syntax to loop through each file individually in a loop is: create a variable ( **f** for file, for example). Then define the data set you want the variable to cycle through. In this case, cycle through all files in the current directory using the ***** wildcard character (the ***** wildcard matches _everything_ ). Then terminate this introductory clause with a semicolon ( **;** ). - - -``` -`$ for f in * ;` -``` - -Depending on your preference, you can choose to press **Return** here. The shell won't try to execute the loop until it is syntactically complete. - -Next, define what you want to happen with each iteration of the loop. For simplicity, use the **file** command to get a little bit of data about each file, represented by the **f** variable (but prepended with a **$** to tell the shell to swap out the value of the variable for whatever the variable currently contains): - - -``` -`do file $f ;` -``` - -Terminate the clause with another semi-colon and close the loop: - - -``` -`done` -``` - -Press **Return** to start the shell cycling through _everything_ in the current directory. The **for** loop assigns each file, one by one, to the variable **f** and runs your command: - - -``` -$ for f in * ; do -> file $f ; -> done -cat.jpg: JPEG image data, EXIF standard 2.2 -design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced -otago.jpg: JPEG image data, EXIF standard 2.2 -waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced -``` - -You can also write it this way: - - -``` -$ for f in *; do file $f; done -cat.jpg: JPEG image data, EXIF standard 2.2 -design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced -otago.jpg: JPEG image data, EXIF standard 2.2 -waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced -``` - -Both the multi-line and single-line formats are the same to your shell and produce the exact same results. - -### A practical example - -Here's a practical example of how a loop can be useful for everyday computing. Assume you have a collection of vacation photos you want to send to friends. Your photo files are huge, making them too large to email and inconvenient to upload to your [photo-sharing service][2]. You want to create smaller web-versions of your photos, but you have 100 photos and don't want to spend the time reducing each photo, one by one. - -First, install the **ImageMagick** command using your package manager on Linux, BSD, or Mac. For instance, on Fedora and RHEL: - - -``` -`$ sudo dnf install ImageMagick` -``` - -On Ubuntu or Debian: - - -``` -`$ sudo apt install ImageMagick` -``` - -On BSD, use **ports** or [pkgsrc][3]. On Mac, use [Homebrew][4] or [MacPorts][5]. - -Once you install ImageMagick, you have a set of new commands to operate on photos. - -Create a destination directory for the files you're about to create: - - -``` -`$ mkdir tmp` -``` - -To reduce each photo to 33% of its original size, try this loop: - - -``` -`$ for f in * ; do convert $f -scale 33% tmp/$f ; done` -``` - -Then look in the **tmp** folder to see your scaled photos. - -You can use any number of commands within a loop, so if you need to perform complex actions on a batch of files, you can place your whole workflow between the **do** and **done** statements of a **for** loop. For example, suppose you want to copy each processed photo straight to a shared photo directory on your web host and remove the photo file from your local system: - - -``` -$ for f in * ; do -convert $f -scale 33% tmp/$f -scp -i seth_web tmp/$f [seth@example.com][6]:~/public_html -trash tmp/$f ; -done -``` - -For each file processed by the **for** loop, your computer automatically runs three commands. This means if you process just 10 photos this way, you save yourself 30 commands and probably at least as many minutes. - -### Limiting your loop - -A loop doesn't always have to look at every file. You might want to process only the JPEG files in your example directory: - - -``` -$ for f in *.jpg ; do convert $f -scale 33% tmp/$f ; done -$ ls -m tmp -cat.jpg, otago.jpg -``` - -Or, instead of processing files, you may need to repeat an action a specific number of times. A **for** loop's variable is defined by whatever data you provide it, so you can create a loop that iterates over numbers instead of files: - - -``` -$ for n in {0..4}; do echo $n ; done -0 -1 -2 -3 -4 -``` - -### More looping - -You now know enough to create your own loops. Until you're comfortable with looping, use them on _copies_ of the files you want to process and, as often as possible, use commands with built-in safeguards to prevent you from clobbering your data and making irreparable mistakes, like accidentally renaming an entire directory of files to the same name, each overwriting the other. - -For advanced **for** loop topics, read on. - -### Not all shells are Bash - -The **for** keyword is built into the Bash shell. Many similar shells use the same keyword and syntax, but some shells, like [tcsh][7], use a different keyword, like **foreach** , instead. - -In tcsh, the syntax is similar in spirit but more strict than Bash. In the following code sample, do not type the string **foreach?** in lines 2 and 3. It is a secondary prompt alerting you that you are still in the process of building your loop. - - -``` -$ foreach f (*) -foreach? file $f -foreach? end -cat.jpg: JPEG image data, EXIF standard 2.2 -design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced -otago.jpg: JPEG image data, EXIF standard 2.2 -waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced -``` - -In tcsh, both **foreach** and **end** must appear alone on separate lines, so you cannot create a **for** loop on one line as you can with Bash and similar shells. - -### For loops with the find command - -In theory, you could find a shell that doesn't provide a **for** loop function, or you may just prefer to use a different command with added features. - -The **find** command is another way to implement the functionality of a **for** loop, as it offers several ways to define the scope of which files to include in your loop as well as options for [Parallel][8] processing. - -The **find** command is meant to help you find files on your hard drives. Its syntax is simple: you provide the path of the location you want to search, and **find** finds all files and directories: - - -``` -$ find . -. -./cat.jpg -./design_maori.png -./otago.jpg -./waterfall.png -``` - -You can filter the search results by adding some portion of the name: - - -``` -$ find . -name "*jpg" -./cat.jpg -./otago.jpg -``` - -The great thing about **find** is that each file it finds can be fed into a loop using the **-exec** flag. For instance, to scale down only the PNG photos in your example directory: - - -``` -$ find . -name "*png" -exec convert {} -scale 33% tmp/{} \; -$ ls -m tmp -design_maori.png, waterfall.png -``` - -In the **-exec** clause, the bracket characters **{}** stand in for whatever item **find** is processing (in other words, any file ending in PNG that has been located, one at a time). The **-exec** clause must be terminated with a semicolon, but Bash usually tries to use the semicolon for itself. You "escape" the semicolon with a backslash ( **\;** ) so that **find** knows to treat that semicolon as its terminating character. - -The **find** command is very good at what it does, and it can be too good sometimes. For instance, if you reuse it to find PNG files for another photo process, you will get a few errors: - - -``` -$ find . -name "*png" -exec convert {} -flip -flop tmp/{} \; -convert: unable to open image `tmp/./tmp/design_maori.png': -No such file or directory @ error/blob.c/OpenBlob/2643. -... -``` - -It seems that **find** has located all the PNG files—not only the ones in your current directory ( **.** ) but also those that you processed before and placed in your **tmp** subdirectory. In some cases, you may want **find** to search the current directory plus all other directories within it (and all directories in _those_ ). It can be a powerful recursive processing tool, especially in complex file structures (like directories of music artists containing directories of albums filled with music files), but you can limit this with the **-maxdepth** option. - -To find only PNG files in the current directory (excluding subdirectories): - - -``` -`$ find . -maxdepth 1 -name "*png"` -``` - -To find and process files in the current directory plus an additional level of subdirectories, increment the maximum depth by 1: - - -``` -`$ find . -maxdepth 2 -name "*png"` -``` - -Its default is to descend into all subdirectories. - -### Looping for fun and profit - -The more you use loops, the more time and effort you save, and the bigger the tasks you can tackle. You're just one user, but with a well-thought-out loop, you can make your computer do the hard work. - -You can and should treat looping like any other command, keeping it close at hand for when you need to repeat a single action or two on several files. However, it's also a legitimate gateway to serious programming, so if you have to accomplish a complex task on any number of files, take a moment out of your day to plan out your workflow. If you can achieve your goal on one file, then wrapping that repeatable process in a **for** loop is relatively simple, and the only "programming" required is an understanding of how variables work and enough organization to separate unprocessed from processed files. With a little practice, you can move from a Linux user to a Linux user who knows how to write a loop, so get out there and make your computer work for you! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/6/how-write-loop-bash - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth/users/goncasousa/users/howtopamm/users/howtopamm/users/seth/users/wavesailor/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) -[2]: http://nextcloud.com -[3]: http://pkgsrc.org -[4]: http://brew.sh -[5]: https://www.macports.org -[6]: mailto:seth@example.com -[7]: https://en.wikipedia.org/wiki/Tcsh -[8]: https://opensource.com/article/18/5/gnu-parallel diff --git a/translated/tech/20190612 How to write a loop in Bash.md b/translated/tech/20190612 How to write a loop in Bash.md new file mode 100644 index 0000000000..d17bfdd4b2 --- /dev/null +++ b/translated/tech/20190612 How to write a loop in Bash.md @@ -0,0 +1,260 @@ +[#]: collector: "lujun9972" +[#]: translator: "chunibyo-wly" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "How to write a loop in Bash" +[#]: via: "https://opensource.com/article/19/6/how-write-loop-bash" +[#]: author: "Seth Kenlon https://opensource.com/users/seth/users/goncasousa/users/howtopamm/users/howtopamm/users/seth/users/wavesailor/users/seth" + +# 如何在 Bash 中使用循环 + +使用循环和查找命令批量自动处理文件。 +![bash logo on green background][1] + +人们希望学习批处理命令的一个普遍原因是批处理具有强大的功能。如果你希望批量的对文件执行指令,制作一个可以重复运行在那些文件上的命令就是一种方法。在编程术语中,这被称作 _execution control_ ,**for** 循环就是其中最常见的一种。 + +**for** 循环可以详细描述你希望你的计算机对 _for_ 遍历的数据对象(比如说文件)所进行的操作。 + +### 一般循环 + +使用循环的一个简单例子是对一组文件进行分析。这个循环可能没什么用,但是这是一个安全的证明自己有能力独立处理文件夹里每一个文件的方法。首先,创建一个文件夹然后拷贝一些文件(例如 JPEG,PNG 等类似的文件)至文件夹中生成一个测试环境。你可以通过文件管理器或者终端来完成创建文件夹和拷贝文件的操作: + +```bash +$ mkdir example +$ cp ~/Pictures/vacation/*.{png,jpg} example +``` + +切换到你刚创建的那个文件夹,然后列出文件并确认这个测试环境是你需要的: + +``` +$ cd example +$ ls -1 +cat.jpg +design_maori.png +otago.jpg +waterfall.png +``` + +在循环中逐一遍历文件的语法是:首先声明一个变量(例如使用 **f** 代表文件),然后定义一个你希望用变量循环的数据集。在这种情况下,使用 **\*** 通配符来遍历当前文件夹下的所有文件(通配符 **\*** 匹配 _一切_)。然后使用一个分号(**;**)来结束这个语句。 + +``` +`$ for f in * ;` +``` + +取决于你个人的喜好,你可以选择在这里按下 **Return**。在语法完成前,shell 是不会尝试执行这个循环的。 + +接下来,定义在每次循环中你想要进行的操作。简单起见,使用 **file** 命令来得到 **f** 变量(使用 **\$** 告诉 shell 使用这个变量的值,无论这个变量现在存储着什么)所存储着的文件的信息: + +``` +`do file $f ;` +``` + +使用另一个引号结束这一行,然后关闭这个循环: + +``` +`done` +``` + +按下 **Return** 启动 shell 对当前文件夹下 _所有东西_ 的遍历。**for** 循环将会一个一个的将文件分配给变量 **f** 并且执行你的命令: + +``` +$ for f in * ; do +> file $f ; +> done +cat.jpg: JPEG image data, EXIF standard 2.2 +design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +otago.jpg: JPEG image data, EXIF standard 2.2 +waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +``` + +你也可以用这种形式书写命令: + +``` +$ for f in *; do file $f; done +cat.jpg: JPEG image data, EXIF standard 2.2 +design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +otago.jpg: JPEG image data, EXIF standard 2.2 +waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +``` + +对你的 shell 来说,多行和单行的格式没有什么区别,并且会输出完全一样的结果。 + +### 一个实用的例子 + +下面是一个循环在日常使用中的实用案例。假如你拥有一堆假期拍的照片想要发给你的朋友。它们对于 email 来说太大了,上传到 [photo-sharing service][2] 也不方便。因此你希望创建小型的 web 版本的照片,但是你不希望花费太多时间在一个一个的压缩图片体积上。 + +首先,在你的 Linux,BSD 或者 Mac 上使用包管理器安装 **ImageMagick** 命令。例如,在 Fedora 和 RHEL 上: + +``` +`$ sudo dnf install ImageMagick` +``` + +在 Ubuntu 和 Debian 上: + +``` +`$ sudo apt install ImageMagick` +``` + +在 BSD 上,使用 **ports** 或者 [pkgsrc][3]。在 Mac 上,使用 [Homebrew][4] 或者 [MacPorts][5]。 + +在你安装了 ImageMagick 之后,你就拥有一系列命令可以用来操作图片了。 + +为你将要创建的文件建立一个目标文件夹: + +``` +`$ mkdir tmp` +``` + +使用下面的循环可以将每张图片减小至原来大小的 33%。 + +``` +`$ for f in * ; do convert $f -scale 33% tmp/$f ; done` +``` + +然后就可以在 **tmp** 文件夹中看到已经缩小了的照片了。 + +你可以在循环体中使用任意数量的命令,因此如果你需要对一批文件进行复杂的操作,可以将你的命令放在一个 **for** 循环的 **do** 和 **done** 声明之间。例如,假设你希望将所有处理过的图片拷贝至你的网站所托管的图片文件夹并且在本地系统移除这些文件: + +``` +$ for f in * ; do +convert $f -scale 33% tmp/$f +scp -i seth_web tmp/$f [seth@example.com][6]:~/public_html +trash tmp/$f ; +done +``` + +你的计算机会对 **for** 循环中处理的每一个文件自动的执行 3 条命令。这意味着假如你仅仅处理 10 张图片,也会省下 30 条指令和更多的时间。 + +### 限制你的循环 + +一个循环常常不需要处理所有文件。在示例文件夹中,你可能需要处理的只是 JPEG 文件: + +``` +$ for f in *.jpg ; do convert $f -scale 33% tmp/$f ; done +$ ls -m tmp +cat.jpg, otago.jpg +``` + +或者,你希望重复特定次数的某个操作而不仅仅只处理文件。**for** 循环的变量的值是被你赋给它的不管何种类型的数据所决定的,所以你可以创建一个循环遍历数字而不只是文件: + +``` +$ for n in {0..4}; do echo $n ; done +0 +1 +2 +3 +4 +``` + +### 更多循环 + +现在你了解的知识已经足够用来创建自己的循环体了。直到你对循环非常熟悉之前,尽可能的在需要处理的文件的 _复制_ 上进行操作。使用固有的保护措施可以预防损坏自己的数据和制造不可复现的错误,例如偶然将一个文件夹下的所有文件重命名为同一个名字,就可能会导致他们的相互覆盖。 + +更多的 **for** 循环话题,请继续阅读。 + +### Not all shells are Bash 不是所有的 shell 都是 Bash + +关键字 **for** 是内置在 Bash shell 中的。许多类似的 shell 会使用和 Bash 同样的关键字和语法,但是也有某些 shell ,比如 [tcsh][7],使用不同的关键字,例如 **foreach**。 + +tcsh 的语法与 Bash 类似,但是它更为严格。例如在下面的例子中,不要在你的终端的第 2,3 行键入 **foreach?** 。它只是提示你仍处在构建循环的过程中。 + +``` +$ foreach f (*) +foreach? file $f +foreach? end +cat.jpg: JPEG image data, EXIF standard 2.2 +design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +otago.jpg: JPEG image data, EXIF standard 2.2 +waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +``` + +在 tcsh 中,**foreach** 和 **end** 都必须单独的在一行中出现。因此你不能像 Bash 或者其他类似的 shell 一样只使用一行命令创建一个 **for** 循环。 + +### for 循环与 find 命令 + +理论上,你可能会用到不支持 **for** 循环的 shell,或者你只是更想使用其他命令的一些特性来完成和循环一样的工作。 + +使用**find** 命令是另一个实现 **for** 循环功能的途径。这个命令通过 [Parallel][8] 提供了几种方法来定义你的循环中需要包括的文件的范围。 + +**find** 命令顾名思义就是帮助你查询存储在硬盘里的文件。他的用法很简单:提供一个你希望它查询的位置的路径,接着 **find** 就会查询这个路径下面的所有文件和文件夹。 + +``` +$ find . +. +./cat.jpg +./design_maori.png +./otago.jpg +./waterfall.png +``` + +你可以通过添加名称的某些部分用于过滤搜索结果: + +``` +$ find . -name "*jpg" +./cat.jpg +./otago.jpg +``` + +**find** 命令非常好的地方在于你可以通过 **-exec** 参数标志将它查询到的每一个文件放入循环中。例如,只对存放在你的 example 文件夹下的 PNG 图片进行体积压缩操作: + +``` +$ find . -name "*png" -exec convert {} -scale 33% tmp/{} \; +$ ls -m tmp +design_maori.png, waterfall.png +``` + +在 **-exec** 短语中,括号 **{}** 表示的是 **find** 正在处理的条目(换句话说,每一个被找到的以 PNG 结尾的文件)。**-exec** 短语必须使用分号结尾,但是 Bash 中常常也会使用分号。为了解决这个二义性问题,你的 **结束符** 可以使用反斜杠加上一个分号(**\;**),使得 **find** 命令可以知道这个结束符是用来标识自己结束使用的。 + +**find** 命令的操作非常棒,某些情况下它甚至可以表现得更棒。比如说,在一个新的进程中使用同一条命令查找 PNG 文件,你可能就会得到一些错误信息: + +``` +$ find . -name "*png" -exec convert {} -flip -flop tmp/{} \; +convert: unable to open image `tmp/./tmp/design_maori.png': +No such file or directory @ error/blob.c/OpenBlob/2643. +... +``` + +看起来 **find** 不只是定位了当前文件夹(**.**)下的所有 PNG 文件,还包括已经处理并且存储到了 **tmp** 下的文件。在一些情况下,你可能希望 **find** 查询当前文件夹下再加上其子文件夹下的所有文件。**find** 命令是一个功能强大的递归工具,特别体现在处理一些文件结构复杂的情境下(比如用来放置存满了音乐人音乐专辑的文件夹),同时你也可以使用 **-maxdepth** 选项来限制最大的递归深度。 + +只在当前文件夹下查找 PNG 文件(不包括子文件夹) + +``` +`$ find . -maxdepth 1 -name "*png"` +``` + +上一条命令的最大深度再加 1 就可以查找和处理当前文件夹及下一级子文件夹下面的文件 + +``` +`$ find . -maxdepth 2 -name "*png"` +``` + +**find** 命令默认是查找每一级文件夹。 + +### 循环的乐趣与收益 + +你使用的循环越多,你就可以越多的省下时间和力气,并且可以应对庞大的任务。虽然你只是一个用户,但是通过使用循环,可以使你的计算机完成困难的任务。 + +你可以并且应该使用循环就像使用其他的命令一样。在你需要重复的处理单个或多个文件时,尽可能的使用这个命令。无论如何,这也算是一项需要被严肃对待的编程活动,因此如果你需要在一些文件上完成复杂的任务,你应该多花点时间在计划自己的工作流上面。如果你可以在一份文件上完成你的工作,接下来将操作包装进 **for** 循环里就相对简单了,这里面唯一的“编程”的需要只是理解变量是如何工作的并且进行充分的规划工作将已处理过的文件和未处理过的文件分开。经过一段时间的练习,你就可以从一名 Linux 用户升级成一位知道如何使用循环的 Linux 用户,所以开始让计算机为你工作吧! + +--- + +via: https://opensource.com/article/19/6/how-write-loop-bash + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[chunibyo-wly](https://github.com/chunibyo-wly) +校对:[校对者 ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth/users/goncasousa/users/howtopamm/users/howtopamm/users/seth/users/wavesailor/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U "bash logo on green background" +[2]: http://nextcloud.com +[3]: http://pkgsrc.org +[4]: http://brew.sh +[5]: https://www.macports.org +[6]: mailto:seth@example.com +[7]: https://en.wikipedia.org/wiki/Tcsh +[8]: https://opensource.com/article/18/5/gnu-parallel diff --git a/translated/tech/20200331 5 ways to level up your Vim skills.md b/translated/tech/20200331 5 ways to level up your Vim skills.md new file mode 100644 index 0000000000..2ddeb2f40d --- /dev/null +++ b/translated/tech/20200331 5 ways to level up your Vim skills.md @@ -0,0 +1,155 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 ways to level up your Vim skills) +[#]: via: (https://opensource.com/article/20/3/vim-skills) +[#]: author: (Detlef Johnson https://opensource.com/users/deckart) + +提升你的 Vim 技能的 5 个方法 +====== + +> 通过一些有趣的技巧使你的文本编辑器更上一层楼。 + +![Computer keyboard typing][1] + +Vim 是最受欢迎的文本编辑器之一,因此绝对值得花时间学习如何使用它。如果你使用这个无处不在的 [Vi(m)][2] 命令行文本编辑器来做的只是打开文件、输入和编辑一些文本、保存编辑的文件并退出程序,那么你还有很大的提示空间、。 + +在某些情况下你会发现,使用 Vim 非常方便的的场景几乎总是涉及到运行远程 Shell 操作的任务。如果你时不时地使用 ssh,比如 + +``` +$ ssh user@hostname.provider.com +``` + +并在虚拟专用服务器(VPS)或本地虚拟化容器中工作,那么就可以从这些强大的 Vim 技能中受益匪浅。 + +### 将 Vim 设置为默认的文本编辑器 + +几乎在所有现代 Linux(或 BSD)发行版中,都可以在终端仿真器的 shell 命令提示符下使用 Vim。在用户 shell 程序中将 Vim 定义为默认编辑器后,即可使用熟悉的 Vim 键绑定来浏览内置的实用程序,例如 `man`。我将说明如何使用 Bash 和 Z shell(zsh)来实现此目的,zsh 现在是 macOS 用户的默认shell(自 Catalina 起)。 + +#### 在 Bash 中将 Vim 设置为默认 + +Bash 通过点文件的组合来管理设置。将首选编辑器添加到主目录中的 `.bashrc` 文件中是最常见的,但也可以将其添加到 `.bash_profile` 中。(请阅读 [GNU Bash 文档][3]了解不同之处)。 + +通过在 `~/.bashrc` 中添加以下内容,将 Vim 设置为默认编辑器: + +``` +# set default editor to Vim +export EDITOR=vim +``` + +以 `#` 开头的行是可选的注释,这是提醒自己该命令的功能的好方法。 + +#### 在 zsh 中将 Vim 设置为默认 + +zsh 是一种越来越流行的终端模拟器,尤其是自苹果的基于 FreeBSD 的 Darwin 系统最近从 Bash 切换到 zsh 以来。 + +zsh 点文件与 Bash 的文件相当,因此你可以在 `~/.zshrc` 或 `~/.zprofile` 之间进行选择。有关何时使用哪一个的详细信息,请参见 [zsh文档][4]。 + +将其设置为默认: + +``` +# set default editor to Vim +export EDITOR=vim +``` + +### 优化 Vim 配置 + +Vim 很像终端仿真器外壳,它使用点文件来设置个人偏好。如果发现该模式,则可能已经猜到它是 `~/.vimrc`。 + +你可能要更改的第一个设置是将对旧 Vi 兼容模式切换为“关”。由于 Vim 是 Vi 的超集,因此 Vi 中的所有功能都可用,并在 Vim 中进行了很大的改进,你可以获得许多高级功能。最新版本(8.2)允许你在拆分的窗口中打开终端运行一个子进程 shell 程序。 + +顺便说一句,关闭旧版兼容性似乎没有做什么事情([事实上,可能不是][5])。当遇到一个 `.vimrc` 文件时,Vim 会自动将该模式切换为关闭。但有时将其明确关闭仍然很重要。缩写 `nocp` 是 `nocompatible` 的同义词,也可以使用它。[条条大道通罗马][6],切换首选项有很多方式。 + +在 `.vimrc` 语法中, 以 `"` 开头的行是注释(就像 `.bashrc` 文件中的 `#` 一样),这些注释可以帮助你记住诸如为何选择一个隐秘的设置名称之类的内容。 + +要关闭 Vi 兼容性,请将以下内容添加到 `~/.vimrc` 文件中: + +``` +" ensure that legacy compatibility mode is off +" documentation: ' +set nocp +``` + +### 理解模式 + +Vim的 “模式”概念是非常重要的,尤其是“正常模式”和“插入模式”之间的区别。对模式的混淆是大多数新用户的困扰。模式并不是 Vim 所独有的,甚至也不是 Vi 所引入的。命令模式是如此的古老,以至于它比 70 年代的[复制和粘贴][7]功能的发明还要早。 + +#### 重要的模式 + +Vim 依赖于不同的模式来定义键盘的敲击行为。需要了解的重要模式有 + +* 正常模式:默认模式,主要用于导航和打开文件。 +* 插入模式(包括替换):这种模式下 Vim 允许将文本输入到打开的文件中。 +* 可视模式:Vim 的行为类似于基于鼠标的输入方式,如复制、编辑、替换等。 +* 命令模式(包括行模式、Ex 命令模式和末行模式):在 Vim 中做更多事情的强大方法。 + +每种模式都有很多值得探索的地方。使用 [Vimtutor][8](`vimtutor`)可以交互式地学习移动光标、模式和在末行模式下运行 Ex 命令。一些不可缺少的生产力操作符包括: + +`:E` | 打开资源管理器,用于定位文件和目录。 +--- | --- +`.` | 重复上次的编辑操作。 +`;` | 向前重复上一次的动作或移动 +`,` | 向后重复上一次的动作或移动。 +`/` | 向前搜索文档。 +`?` | 向后搜索文档。 +`*` | 查找光标所在处的单词的下一个出现的地方。 +`#` | 查找光标所在处的单词的上一次出现的地方。 +`~` | 切换大小写。 +`%` | 在打开和关闭的 `()`、`[]` 和 `{}` 之间切换;对编码非常有用。 +`z=` | 提出拼写建议。 + +### 像钢琴一样弹奏 Vim + +把 Vim 的操作符“语言”记在记忆中是很重要的,但要想掌握它,难点在于学会像音乐家一样思考,把操作符和动作组合成“和声和弦”,这样你就可以像弹钢琴一样弹奏 Vim。这就是 Vim 的文本操作能力可以与另一个著名的命令行编辑器 Emacs 相媲美的地方。(虽然其中一个编辑器会让磨损掉你的 `Esc` 键,而另一个编辑器会让你的 `Ctrl` 键磨损掉。) + +在描述和弦时,Vim 中的传统做法是用大写字母 `C` 来指代 `Ctrl` 键,后面加上一个连字符(`C-`)。这并不是通用的,但我将从这里开始遵循这一惯例,并在有可能引起混淆的时候加以说明。 + +如果你在 Vim 中键入长行,你会想把它设置成可以换行你的文字。想要根据你的工作方式对 Vim 进行个性化设置,请考虑一下这个设置:当 Vim 启动时,你希望 Vim 默认情况下如何处理文本换行?开着还是关着?我喜欢将其关闭,并在运行时用命令打开它。当我想让文本换行时,我只需在命令行模式下用 `:set wrap` 设置即可。 + +让 Vim 设置为默认文字换行并没有什么问题。这只是一个偏好的问题 —— 它可能随着时间的推移而改变。同样你也可以控制粘贴、代码语言缩进语法和 `Tab` 键的设置(制表符还是空格?多少个空格?可也在[这里][9]深入研究这些选项)。所有这些默认行为的选项都是完全可配置的,并且在你使用命令行模式操作时可以实时更改。 + +你会在社区论坛、Vim 维基和文章中找到很多关于设置 Vim 默认设置的建议(比如这篇文章)。为你的个人计算环境设置首选项对你来说应该相当熟悉,Vim 也不例外。我强烈建议你从对你的设置进行非常小的更改开始,慢慢地进行更多的更改,这样你就可以轻松地恢复设置。这样一来,你就可以避免使用插件好多年或完全不用。 + +### Vim 8.2中的分割、标签和终端 + +有两种方法可以将你正在处理的文件分割成不同的视图:它们可以并排显示,也可以使用应用程序标签页在全屏(窗口)中切换。这些对应用程序窗口的更改是从命令模式启动的,这需要使用冒号(`:`)来调起提示符。 + +每个分割的窗口可以容纳一个文件进行编辑,你可以通过标签页在更多的文件之间随意切换。分割的屏幕空间是有限的,所以当你想分割更多的屏幕时,标签页是很方便的。想要如何设置,纯属个人喜好的问题。要横向分割一个窗口,使用 `:sp`,垂直分割时使用 `:vs`。 + +从 [Vim 8.2][10] 开始,你可以用 `:vert term` 打开一个垂直分割的终端 shell 子进程,来在你的代码旁边在命令行进行操作。你需要键入 `exit` 来关闭你的终端进程,就像你结束一个 shell 会话一样,但你关闭这个分割的窗口和标签页的方式和关闭任何普通的 Vim 窗口一样,用 `:q` 来关闭。 + +要初始化一个标签页,请使用一个特殊的编辑命令:`:tabedit`,它会自动切换到新打开的标签页。如果你给该命令一个文件名作为参数,将会打开该文件并进行编辑。如果你忽略了给它一个文件名作为参数,可以在命令行模式下的使用编辑命令 `:e filename.txt`,就像在任何一个普通的 Vim 窗口中一样。可以使用下一个(`:tabn`)和上一个(`:tabp`)命令在标签页间导航。 + +要使用分割,你需要知道如何使用组合键 `C-w` 和你想要移动的方向的移动键,例如左(`h`)、下(`j`)、左(`k`)、右(`l`)。如果你想学习更多的组合键,请阅读 Vim 手册中的 `:help split` 和 `:help tabpage`。 + +### 获取帮助 + +虽然可以在 Vimtutor 中打开参考 Vim 手册,但用 `:help` 打开 Vim 帮助,可以让你自己把时间花在编辑器上,不用完全依赖像这样的文章,就能获得更多的成果。经验是掌握 Vim 的关键。经验有助于提高你的整体计算直觉,因为 Vim 中的很多东西都是从 Unix 宇宙中汲取的。 + +祝你在探索 Vim 之美的过程中玩得开心,有什么问题可以在评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/vim-skills + +作者:[Detlef Johnson][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/deckart +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboaord_enter_writing_documentation.jpg?itok=kKrnXc5h (Computer keyboard typing) +[2]: https://www.vim.org/ +[3]: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html +[4]: http://zsh.sourceforge.net/Intro/intro_3.html +[5]: http://vimdoc.sourceforge.net/htmldoc/starting.html#compatible-default +[6]: https://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_do_it +[7]: https://www.npr.org/2020/02/22/808404858/remembering-the-pioneer-behind-your-computers-cut-copy-and-paste-functions +[8]: http://www2.geog.ucl.ac.uk/~plewis/teaching/unix/vimtutor +[9]: https://opensource.com/article/18/9/vi-editor-productivity-powerhouse +[10]: https://www.vim.org/vim-8.2-released.php From da13dbb8081602cedac0467376271ff62e8930da Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Apr 2020 17:45:07 +0800 Subject: [PATCH 0172/1809] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=20PR=20=E6=8F=90=E4=BA=A4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0331 5 ways to level up your Vim skills.md | 155 ------------------ 1 file changed, 155 deletions(-) delete mode 100644 translated/tech/20200331 5 ways to level up your Vim skills.md diff --git a/translated/tech/20200331 5 ways to level up your Vim skills.md b/translated/tech/20200331 5 ways to level up your Vim skills.md deleted file mode 100644 index 2ddeb2f40d..0000000000 --- a/translated/tech/20200331 5 ways to level up your Vim skills.md +++ /dev/null @@ -1,155 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 ways to level up your Vim skills) -[#]: via: (https://opensource.com/article/20/3/vim-skills) -[#]: author: (Detlef Johnson https://opensource.com/users/deckart) - -提升你的 Vim 技能的 5 个方法 -====== - -> 通过一些有趣的技巧使你的文本编辑器更上一层楼。 - -![Computer keyboard typing][1] - -Vim 是最受欢迎的文本编辑器之一,因此绝对值得花时间学习如何使用它。如果你使用这个无处不在的 [Vi(m)][2] 命令行文本编辑器来做的只是打开文件、输入和编辑一些文本、保存编辑的文件并退出程序,那么你还有很大的提示空间、。 - -在某些情况下你会发现,使用 Vim 非常方便的的场景几乎总是涉及到运行远程 Shell 操作的任务。如果你时不时地使用 ssh,比如 - -``` -$ ssh user@hostname.provider.com -``` - -并在虚拟专用服务器(VPS)或本地虚拟化容器中工作,那么就可以从这些强大的 Vim 技能中受益匪浅。 - -### 将 Vim 设置为默认的文本编辑器 - -几乎在所有现代 Linux(或 BSD)发行版中,都可以在终端仿真器的 shell 命令提示符下使用 Vim。在用户 shell 程序中将 Vim 定义为默认编辑器后,即可使用熟悉的 Vim 键绑定来浏览内置的实用程序,例如 `man`。我将说明如何使用 Bash 和 Z shell(zsh)来实现此目的,zsh 现在是 macOS 用户的默认shell(自 Catalina 起)。 - -#### 在 Bash 中将 Vim 设置为默认 - -Bash 通过点文件的组合来管理设置。将首选编辑器添加到主目录中的 `.bashrc` 文件中是最常见的,但也可以将其添加到 `.bash_profile` 中。(请阅读 [GNU Bash 文档][3]了解不同之处)。 - -通过在 `~/.bashrc` 中添加以下内容,将 Vim 设置为默认编辑器: - -``` -# set default editor to Vim -export EDITOR=vim -``` - -以 `#` 开头的行是可选的注释,这是提醒自己该命令的功能的好方法。 - -#### 在 zsh 中将 Vim 设置为默认 - -zsh 是一种越来越流行的终端模拟器,尤其是自苹果的基于 FreeBSD 的 Darwin 系统最近从 Bash 切换到 zsh 以来。 - -zsh 点文件与 Bash 的文件相当,因此你可以在 `~/.zshrc` 或 `~/.zprofile` 之间进行选择。有关何时使用哪一个的详细信息,请参见 [zsh文档][4]。 - -将其设置为默认: - -``` -# set default editor to Vim -export EDITOR=vim -``` - -### 优化 Vim 配置 - -Vim 很像终端仿真器外壳,它使用点文件来设置个人偏好。如果发现该模式,则可能已经猜到它是 `~/.vimrc`。 - -你可能要更改的第一个设置是将对旧 Vi 兼容模式切换为“关”。由于 Vim 是 Vi 的超集,因此 Vi 中的所有功能都可用,并在 Vim 中进行了很大的改进,你可以获得许多高级功能。最新版本(8.2)允许你在拆分的窗口中打开终端运行一个子进程 shell 程序。 - -顺便说一句,关闭旧版兼容性似乎没有做什么事情([事实上,可能不是][5])。当遇到一个 `.vimrc` 文件时,Vim 会自动将该模式切换为关闭。但有时将其明确关闭仍然很重要。缩写 `nocp` 是 `nocompatible` 的同义词,也可以使用它。[条条大道通罗马][6],切换首选项有很多方式。 - -在 `.vimrc` 语法中, 以 `"` 开头的行是注释(就像 `.bashrc` 文件中的 `#` 一样),这些注释可以帮助你记住诸如为何选择一个隐秘的设置名称之类的内容。 - -要关闭 Vi 兼容性,请将以下内容添加到 `~/.vimrc` 文件中: - -``` -" ensure that legacy compatibility mode is off -" documentation: ' -set nocp -``` - -### 理解模式 - -Vim的 “模式”概念是非常重要的,尤其是“正常模式”和“插入模式”之间的区别。对模式的混淆是大多数新用户的困扰。模式并不是 Vim 所独有的,甚至也不是 Vi 所引入的。命令模式是如此的古老,以至于它比 70 年代的[复制和粘贴][7]功能的发明还要早。 - -#### 重要的模式 - -Vim 依赖于不同的模式来定义键盘的敲击行为。需要了解的重要模式有 - -* 正常模式:默认模式,主要用于导航和打开文件。 -* 插入模式(包括替换):这种模式下 Vim 允许将文本输入到打开的文件中。 -* 可视模式:Vim 的行为类似于基于鼠标的输入方式,如复制、编辑、替换等。 -* 命令模式(包括行模式、Ex 命令模式和末行模式):在 Vim 中做更多事情的强大方法。 - -每种模式都有很多值得探索的地方。使用 [Vimtutor][8](`vimtutor`)可以交互式地学习移动光标、模式和在末行模式下运行 Ex 命令。一些不可缺少的生产力操作符包括: - -`:E` | 打开资源管理器,用于定位文件和目录。 ---- | --- -`.` | 重复上次的编辑操作。 -`;` | 向前重复上一次的动作或移动 -`,` | 向后重复上一次的动作或移动。 -`/` | 向前搜索文档。 -`?` | 向后搜索文档。 -`*` | 查找光标所在处的单词的下一个出现的地方。 -`#` | 查找光标所在处的单词的上一次出现的地方。 -`~` | 切换大小写。 -`%` | 在打开和关闭的 `()`、`[]` 和 `{}` 之间切换;对编码非常有用。 -`z=` | 提出拼写建议。 - -### 像钢琴一样弹奏 Vim - -把 Vim 的操作符“语言”记在记忆中是很重要的,但要想掌握它,难点在于学会像音乐家一样思考,把操作符和动作组合成“和声和弦”,这样你就可以像弹钢琴一样弹奏 Vim。这就是 Vim 的文本操作能力可以与另一个著名的命令行编辑器 Emacs 相媲美的地方。(虽然其中一个编辑器会让磨损掉你的 `Esc` 键,而另一个编辑器会让你的 `Ctrl` 键磨损掉。) - -在描述和弦时,Vim 中的传统做法是用大写字母 `C` 来指代 `Ctrl` 键,后面加上一个连字符(`C-`)。这并不是通用的,但我将从这里开始遵循这一惯例,并在有可能引起混淆的时候加以说明。 - -如果你在 Vim 中键入长行,你会想把它设置成可以换行你的文字。想要根据你的工作方式对 Vim 进行个性化设置,请考虑一下这个设置:当 Vim 启动时,你希望 Vim 默认情况下如何处理文本换行?开着还是关着?我喜欢将其关闭,并在运行时用命令打开它。当我想让文本换行时,我只需在命令行模式下用 `:set wrap` 设置即可。 - -让 Vim 设置为默认文字换行并没有什么问题。这只是一个偏好的问题 —— 它可能随着时间的推移而改变。同样你也可以控制粘贴、代码语言缩进语法和 `Tab` 键的设置(制表符还是空格?多少个空格?可也在[这里][9]深入研究这些选项)。所有这些默认行为的选项都是完全可配置的,并且在你使用命令行模式操作时可以实时更改。 - -你会在社区论坛、Vim 维基和文章中找到很多关于设置 Vim 默认设置的建议(比如这篇文章)。为你的个人计算环境设置首选项对你来说应该相当熟悉,Vim 也不例外。我强烈建议你从对你的设置进行非常小的更改开始,慢慢地进行更多的更改,这样你就可以轻松地恢复设置。这样一来,你就可以避免使用插件好多年或完全不用。 - -### Vim 8.2中的分割、标签和终端 - -有两种方法可以将你正在处理的文件分割成不同的视图:它们可以并排显示,也可以使用应用程序标签页在全屏(窗口)中切换。这些对应用程序窗口的更改是从命令模式启动的,这需要使用冒号(`:`)来调起提示符。 - -每个分割的窗口可以容纳一个文件进行编辑,你可以通过标签页在更多的文件之间随意切换。分割的屏幕空间是有限的,所以当你想分割更多的屏幕时,标签页是很方便的。想要如何设置,纯属个人喜好的问题。要横向分割一个窗口,使用 `:sp`,垂直分割时使用 `:vs`。 - -从 [Vim 8.2][10] 开始,你可以用 `:vert term` 打开一个垂直分割的终端 shell 子进程,来在你的代码旁边在命令行进行操作。你需要键入 `exit` 来关闭你的终端进程,就像你结束一个 shell 会话一样,但你关闭这个分割的窗口和标签页的方式和关闭任何普通的 Vim 窗口一样,用 `:q` 来关闭。 - -要初始化一个标签页,请使用一个特殊的编辑命令:`:tabedit`,它会自动切换到新打开的标签页。如果你给该命令一个文件名作为参数,将会打开该文件并进行编辑。如果你忽略了给它一个文件名作为参数,可以在命令行模式下的使用编辑命令 `:e filename.txt`,就像在任何一个普通的 Vim 窗口中一样。可以使用下一个(`:tabn`)和上一个(`:tabp`)命令在标签页间导航。 - -要使用分割,你需要知道如何使用组合键 `C-w` 和你想要移动的方向的移动键,例如左(`h`)、下(`j`)、左(`k`)、右(`l`)。如果你想学习更多的组合键,请阅读 Vim 手册中的 `:help split` 和 `:help tabpage`。 - -### 获取帮助 - -虽然可以在 Vimtutor 中打开参考 Vim 手册,但用 `:help` 打开 Vim 帮助,可以让你自己把时间花在编辑器上,不用完全依赖像这样的文章,就能获得更多的成果。经验是掌握 Vim 的关键。经验有助于提高你的整体计算直觉,因为 Vim 中的很多东西都是从 Unix 宇宙中汲取的。 - -祝你在探索 Vim 之美的过程中玩得开心,有什么问题可以在评论中分享。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/vim-skills - -作者:[Detlef Johnson][a] -选题:[lujun9972][b] -译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/deckart -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboaord_enter_writing_documentation.jpg?itok=kKrnXc5h (Computer keyboard typing) -[2]: https://www.vim.org/ -[3]: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html -[4]: http://zsh.sourceforge.net/Intro/intro_3.html -[5]: http://vimdoc.sourceforge.net/htmldoc/starting.html#compatible-default -[6]: https://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_do_it -[7]: https://www.npr.org/2020/02/22/808404858/remembering-the-pioneer-behind-your-computers-cut-copy-and-paste-functions -[8]: http://www2.geog.ucl.ac.uk/~plewis/teaching/unix/vimtutor -[9]: https://opensource.com/article/18/9/vi-editor-productivity-powerhouse -[10]: https://www.vim.org/vim-8.2-released.php From 6a787fa119ffe7af55f0232f9bf5f5ff5991eebd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 Apr 2020 20:30:31 +0800 Subject: [PATCH 0173/1809] APL (#18018) --- sources/tech/20200403 Take back your dotfiles with Chezmoi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200403 Take back your dotfiles with Chezmoi.md b/sources/tech/20200403 Take back your dotfiles with Chezmoi.md index 2b2bed6621..44846d3beb 100644 --- a/sources/tech/20200403 Take back your dotfiles with Chezmoi.md +++ b/sources/tech/20200403 Take back your dotfiles with Chezmoi.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b7f2aecf4fc38d004a2bdf1fd8ce42d89cd7322d Mon Sep 17 00:00:00 2001 From: cycoe <871873687@qq.com> Date: Tue, 7 Apr 2020 20:32:26 +0800 Subject: [PATCH 0174/1809] Translating by Cycoe (#18019) Co-authored-by: cycoe --- .../20200311 What you need to know about variables in Emacs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200311 What you need to know about variables in Emacs.md b/sources/tech/20200311 What you need to know about variables in Emacs.md index d66ba374f4..fdbeffe90d 100644 --- a/sources/tech/20200311 What you need to know about variables in Emacs.md +++ b/sources/tech/20200311 What you need to know about variables in Emacs.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (cycoe) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b1f2bbb5987844aba51af6f740baadac8ed896d8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Apr 2020 22:20:45 +0800 Subject: [PATCH 0175/1809] TSL --- ...03 Take back your dotfiles with Chezmoi.md | 309 ------------------ ...03 Take back your dotfiles with Chezmoi.md | 308 +++++++++++++++++ 2 files changed, 308 insertions(+), 309 deletions(-) delete mode 100644 sources/tech/20200403 Take back your dotfiles with Chezmoi.md create mode 100644 translated/tech/20200403 Take back your dotfiles with Chezmoi.md diff --git a/sources/tech/20200403 Take back your dotfiles with Chezmoi.md b/sources/tech/20200403 Take back your dotfiles with Chezmoi.md deleted file mode 100644 index 44846d3beb..0000000000 --- a/sources/tech/20200403 Take back your dotfiles with Chezmoi.md +++ /dev/null @@ -1,309 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Take back your dotfiles with Chezmoi) -[#]: via: (https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/) -[#]: author: (Ryan Walter https://fedoramagazine.org/author/rwaltr/) - -Take back your dotfiles with Chezmoi -====== - -![][1] - -In Linux, dotfiles are hidden text files that are used to store various configuration settings for many such as Bash and Git to more complex applications like i3 or VSCode. - -Most of these files are contained in the _~/.config_ directory or right in the home directory. Editing these files allows you to customize applications beyond what a settings menu may provide, and they tend to be portable across devices and even other Linux distributions. But one talking point across the Linux enthusiast community is how to manage these dotfiles and how to share them. - -We will be showcasing a tool called [Chezmoi][2] that does this task a little differently from the others. - -### The history of dotfile management - -If you search [GitHub for dotfiles][3], what you will see are over 100k repositories after one goal: Store people’s dotfiles in a shareable and repeatable manor. However, other than using git, they store their files differently. - -While Git has solved code management problems that also translates to config file management, It does not solve how to separate between distributions, roles (such as home vs work computers) secrets management, and per device configuration. - -Because of this, many users decide to craft their own solutions, and the community has responded with multiple answers over the years. This article will briefly cover some of the solutions that have been created. - -#### Experiment in an isolated environment - -Do you want to try these below solutions quickly in a contained environment? Run: - -``` -$ podman run --rm -it fedora -``` - -… to create a Fedora container to try the applications in. This container will automatically delete itself when you exit the shell. - -#### The install problem - -If you store your dotfiles in Git repository, you will want to make it easy for your changes to automatically be applied inside your home directory, the easiest way to do this at first glance is to use a symlink, such as _ln -s ~/.dotfies/bashrc ~/.bashrc_. This will allow your changes to take place instantly when your repository is updated. - -The problem with symlinks is that managing symlinks can be a chore. Stow and [RCM (covered here on Fedora Magazine)][4] can help you manage those, but these are not seamless solutions. Files that are private will need to be modified and chmoded properly after download. If you revamp your dotfiles on one system, and download your repository to another system, you may get conflicts and require troubleshooting. - -Another solution to this problem is writing your own install script. This is the most flexible option, but has the tradeoff of requiring more time into building a custom solution. - -#### The secrets problem - -Git is designed to track changes. If you store a secret such as a password or an API key in your git repository, you will have a difficult time and will need to rewrite your git history to remove that secret. If your repository is public, your secret would be impossible to recover if someone else has downloaded your repository. This problem alone will prevent many individuals from sharing their dotfiles with the public world. - -#### The multi-device config problem - -The problem is not pulling your config to multiple devices, the problem is when you have multiple devices that require different configuration. Most individuals handle this by either having different folders or by using different forks. This makes it difficult to share configs across the different devices and role sets - -### How Chezmoi works - -Chezmoi is a tool to manage your dotfiles with the above problems in mind, it doesn’t blindly copy or symlink files from your repository. Chezmoi acts more like a template engine to generate your dotfiles based on system variables, templates, secret managers, and Chezmoi’s own config file. - -#### Getting Started with Chezmoi - -Currently Chezmoi is not in the default repositories. You can download the current version of Chezmoi as of writing with the following command. - -``` -$ sudo dnf install https://github.com/twpayne/chezmoi/releases/download/v1.7.17/chezmoi-1.7.17-x86_64.rpm -``` - -This will install the pre-packaged RPM to your system. - -Lets go ahead and create your repository using: - -``` -$ chezmoi init -``` - -It will create your new repository in _~/.local/share/chezmoi/_. You can easily cd to this directory by using: - -``` -$ chezmoi cd -``` - -Lets add our first file: - -``` -chezmoi add ~/.bashrc -``` - -… to add your bashrc file to your chezmoi repository. - -Note: if your bashrc file is actually a symlink, you will need to add the -f flag to follow it and read the contents of the real file. - -You can now edit this file using: - -``` -$ chezmoi edit ~/.bashrc -``` - -Now lets add a private file, This is a file that has the permissions 600 or similar. I have a file at .ssh/config that I would like to add by using - -``` -$ chezmoi add ~/.ssh/config -``` - -Chezmoi uses special prefixes to keep track of what is a hidden file and a private file to work around Git’s limitations. Run the following command to see it: - -``` -$ chezmoi cd -``` - -**Do note that files that are marked as private are not actually private, they are still saved as plain text in your git repo. More on that later.** - -You can apply any changes by using: - -``` -$ chezmoi apply -``` - -and inspect what is different by using - -``` -$ chezmoi diff -``` - -#### Using variables and templates - -To export all of your data Chezmoi can gather, run: - -``` -$ chezmoi data -``` - -Most of these are information about your username, arch, hostname, os type and os name. But you can also add our own variables. - -Go ahead and run: - -``` -$ chezmoi edit-config -``` - -… and input the following: - -``` -[data] - email = "fedorauser@example.com" - name = "Fedora Mcdora" -``` - -Save your file and run chezmoi data again. You will see on the bottom that your email and name are now added. You can now use these with templates with Chezmoi. Run: - -``` -$ chezmoi add -T --autotemplate ~/.gitconfig -``` - -… to add your gitconfig as a template into Chezmoi. If Chezmoi is successful in inferring template correctly, you could get the following: - -``` -[user] - email = "{{ .email }}" - name = "{{ .name }}" -``` - -If it does not, you can change the file to this instead. - -Inspect your file with: - -``` -$ chezmoi edit ~/.gitconfig -``` - -After using - -``` -$ chezmoi cat ~/.gitconfig -``` - -… to see what chezmoi will generate for this file. My generated example is below: - -``` -[root@a6e273a8d010 ~]# chezmoi cat ~/.gitconfig - [user] - email = "fedorauser@example.com" - name = "Fedora Mcdora" - [root@a6e273a8d010 ~]# -``` - -It will generate a file filled with the variables in our chezmoi config. -You can also use the varibles to perform simple logic statements. One example is: - -``` -{{- if eq .chezmoi.hostname "fsteel" }} -# this will only be included if the host name is equal to "fsteel" -{{- end }} -``` - -Do note that for this to work the file has to be a template. You can check this by seeing if the file has a “.tmpl” appended to its name on the file in _chezmoi cd_, or by readding the file using the -T option - -#### Keeping secrets… secret - -To troubleshoot your setup, use the following command. - -``` -$ chezmoi doctor -``` - -What is important here is that it also shows you the [password managers it supports][5]. - -``` -[root@a6e273a8d010 ~]# chezmoi doctor - warning: version dev - ok: runtime.GOOS linux, runtime.GOARCH amd64 - ok: /root/.local/share/chezmoi (source directory, perm 700) - ok: /root (destination directory, perm 550) - ok: /root/.config/chezmoi/chezmoi.toml (configuration file) - ok: /bin/bash (shell) - ok: /usr/bin/vi (editor) - warning: vimdiff (merge command, not found) - ok: /usr/bin/git (source VCS command, version 2.25.1) - ok: /usr/bin/gpg (GnuPG, version 2.2.18) - warning: op (1Password CLI, not found) - warning: bw (Bitwarden CLI, not found) - warning: gopass (gopass CLI, not found) - warning: keepassxc-cli (KeePassXC CLI, not found) - warning: lpass (LastPass CLI, not found) - warning: pass (pass CLI, not found) - warning: vault (Vault CLI, not found) - [root@a6e273a8d010 ~]# -``` - -You can use either of these clients, or a [generic client][6], or your system’s [Keyring][7]. - -For GPG, you will need to add the following to your config using: - -``` -$ chezmoi edit-config -``` - -``` -[gpg] - recipient = " Date: Tue, 7 Apr 2020 23:42:26 +0800 Subject: [PATCH 0176/1809] Update --- ...ource cloud native projects to consider.md | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/sources/tech/20190814 9 open source cloud native projects to consider.md b/sources/tech/20190814 9 open source cloud native projects to consider.md index 2ab8fb2dc2..a543462a0f 100644 --- a/sources/tech/20190814 9 open source cloud native projects to consider.md +++ b/sources/tech/20190814 9 open source cloud native projects to consider.md @@ -12,6 +12,7 @@ Work with containers? Get familiar with these projects from the Cloud Native Computing Foundation 工作中使用了容器?熟悉来自云原生计算基金会的这些项目 + ![clouds in the sky with blue pattern][1] As the practice of developing applications with containers is getting more popular, [cloud-native applications][2] are also on the rise. By [definition][3]: @@ -39,7 +40,7 @@ Cloud-Native Computing Foundation projects 云原生计算基金会项目 I mean, just look at that! And this is just a start. Just as NodeJS’s creation sparked the explosion of endless JavaScript tools, the popularity of container technology started the exponential growth of cloud-native applications. -我的意思是,看看那! 这仅仅是一个开始。 正如NodeJS的出现引发了无休止的JavaScript工具的爆炸式增长一样,容器技术的普及也推动了云原生应用程序的指数增长。 +我的意思是,留意吧!这仅仅是一个开始。 正如NodeJS的出现引发了无休止的JavaScript工具的爆炸式增长一样,容器技术的普及也推动了云原生应用程序的指数增长。 The good news is that there are several organizations that oversee and connect these dots together. One is the [**Open Containers Initiative (OCI)**][6], which is a lightweight, open governance structure (or project), "formed under the auspices of the Linux Foundation for the express purpose of creating open industry standards around container formats and runtime." The other is the **CNCF**, "an open source software foundation dedicated to making cloud native computing universal and sustainable." 好消息是,有几个组织负责监管这些技术并将它们融合在一起。 其中之一是[** Open Containers Initiative(OCI)**][6],它是一种轻量级的,开放的治理结构(或项目),“是在Linux基金会的主持下形成的,其明确目的是创建开放的行业标准容器格式和运行时。” 另一个是** CNCF **,“致力于使云原生计算具有通用性和可持续性的开源软件基金会”。 @@ -110,31 +111,37 @@ While it’s impossible to cover all of the CNCF projects in this article, I’l Name | License | What It Is 名称|授权类型|简要描述 ---|---|--- -[Kubernetes][9] | Apache 2.0 | Orchestration platform for containers -[Prometheus][10] | Apache 2.0 | Systems and service monitoring tool -[Envoy][11] | Apache 2.0 | Edge and service proxy -[rkt][12] | Apache 2.0 | Pod-native container engine -[Jaeger][13] | Apache 2.0 | Distributed tracing system -[Linkerd][14] | Apache 2.0 | Transparent service mesh -[Helm][15] | Apache 2.0 | Kubernetes package manager -[Etcd][16] | Apache 2.0 | Distributed key-value store -[CRI-O][17] | Apache 2.0 | Lightweight runtime for Kubernetes +[Kubernetes][9] | Apache 2.0 | Orchestration platform for containers 容器编排平台 +[Prometheus][10] | Apache 2.0 | Systems and service monitoring tool 系统和服务监控工具 +[Envoy][11] | Apache 2.0 | Edge and service proxy 边缘和服务代理 +[rkt][12] | Apache 2.0 | Pod-native container engine Pod原生的容器引擎 +[Jaeger][13] | Apache 2.0 | Distributed tracing system 分布式跟踪系统 +[Linkerd][14] | Apache 2.0 | Transparent service mesh 无感服务网格 +[Helm][15] | Apache 2.0 | Kubernetes package manager K8s包管理器 +[Etcd][16] | Apache 2.0 | Distributed key-value store 分布式键值存储 +[CRI-O][17] | Apache 2.0 | Lightweight runtime for Kubernetes 专门用于K8s的轻量级运行时环境 I also created this video tutorial to walk through these projects. +我也创建了这个视频材料来介绍这些项目。 -## Graduated projects +## Graduated projects 毕业项目 Graduated projects are considered mature—adopted by many organizations—and must adhere to the CNCF’s guidelines. Following are three of the most popular open source CNCF Graduated projects. (Note that some of these descriptions are adapted and reused from the projects' websites.) +已毕业的项目被认为是成熟的,已被许多组织采用的,并且严格遵守了CNCF的准则。 以下是三个最受欢迎的开源CNCF毕业项目。 (请注意,其中一些描述来源于项目的网站并被做了改编。) -### Kubernetes +### Kubernetes K8S Ah, Kubernetes. How can we talk about cloud-native applications without mentioning Kubernetes? Invented by Google, Kubernetes is undoubtedly the most famous container-orchestration platform for container-based applications, and it is also an open source tool. +Kubernetes。我们如何在不提及Kubernetes的情况下谈论云原生应用程序? Google发明的Kubernetes无疑是最著名的基于容器的应用程序的容器编排平台,而且它还是一个开源工具。 What is a container orchestration platform? Basically, a container engine on its own may be okay for managing a few containers. However, when you are talking about thousands of containers and hundreds of services, managing those containers becomes super complicated. This is where the container engine comes in. The container-orchestration engine helps scale containers by automating the deployment, management, networking, and availability of containers. +什么是容器编排平台? 通常,一个容器引擎本身可以管理几个容器。 但是,当您谈论数千个容器和数百个服务时,管理这些容器变得非常复杂。 这就是容器编排引擎的用武之地。容器编排引擎通过自动化容器的部署,管理,网络和可用性来帮助管理大量的容器。 Docker Swarm and Mesosphere Marathon are other container-orchestration engines, but it is safe to say that Kubernetes has won the race (at least for now). Kubernetes also gave birth to Container-as-a-Service (CaaS) platforms like [OKD][18], the Origin community distribution of Kubernetes that powers [Red Hat OpenShift][19]. +Docker Swarm和Mesosphere Marathon也是容器编排引擎,但是可以肯定地说Kubernetes在竞争中胜出(至少现在是这样)。Kubernetes还诞生了容器即服务(CaaS)平台如[OKD][18],它是Origin社区针对Kubernetes的发行版,并成了[Red Hat OpenShift][19]的一部分。 To get started, visit the [Kubernetes GitHub repository][9], and access its documentation and learning resources from the [Kubernetes documentation][20] page. +想开始学习请访问[Kubernetes GitHub仓库][9],并从[Kubernetes文档][20]页面访问其文档和学习资源。 ### Prometheus From 13a0babac50e8895391898cb31cd5c3223a9e6b7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Apr 2020 00:55:40 +0800 Subject: [PATCH 0177/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200408=20How?= =?UTF-8?q?=20to=20Create=20Templates=20in=20LibreOffice=20to=20Save=20Tim?= =?UTF-8?q?e=20and=20Increase=20Productivity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md --- ... to Save Time and Increase Productivity.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md diff --git a/sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md b/sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md new file mode 100644 index 0000000000..6eb5183c01 --- /dev/null +++ b/sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Create Templates in LibreOffice to Save Time and Increase Productivity) +[#]: via: (https://itsfoss.com/create-templates-libreoffice/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +How to Create Templates in LibreOffice to Save Time and Increase Productivity +====== + +Creating a template in [LibreOffice][1] can save you some time for the documents that you use often. It can be a letter, a financial spreadsheet or even a presentation. + +Time is one factor that a template can save and on the other hand it provides consistency where a group of people in an organization work together at the same project. + +For example, if you are a small organization that has to often issue certificates of experience, instead of copy-pasting from a saved document somewhere, you can create a template. When you need to issue a new certificate of experience, you create a new one from the template, edit it slightly and you are good to go. + +LibreOffice comes with a few templates by default but you are not restricted to use just them. You are free to create your own as per your requirements. + +I think templates are one of the [essential LibreOffice tips][2] that every user should know. Let me show you how to do it. + +### How to create a template in LibreOffice + +First, create the document that you want to reuse with minimal editing. It could be a document, spreadsheet or presentation. I am using a word document in the example but the steps are the same for all of them. + +Now go to file and select Save as Template. You will be prompted to give a name and a category from the menu, the press save. + +![Creating a new template in LibreOffice][3] + +This file will be saved in the LibreOffice template folder in .ots format. You can use these .ots files on other systems that have LibreOffice installed and use the same templates on those systems as well. + +### How to use templates in LibreOffice + +To use a template, select File and then Templates. + +Don’t worry! Opening a template LibreOffice creates a copy without affecting the original template. You can edit the document without worrying about your template getting changed. + +![Using templates][4] + +Once you choose your template, click open. You can edit it as you like. + +### How to change a template in LibreOffice + +Needs may change from time to time and adjustments to your templates can be necessary. + +To edit an existing template go to File -> Templates and then right click on the desired template and click edit. + +![edit Template][5] + +When you finish editing the template, click on save to make the changes permanent. + +**Recommended Read:** + +![][6] + +#### [7 LibreOffice Tips To Get More Out of It][2] + +LibreOffice is an excellent office suite. These LibreOffice tips will enable you to use it more effectively. + +All in all templates are great not only at reducing the workload on repetitive tasks but also for user mistake proofing. You can take advantage of your computer’s ability to handle a repetitive task but with flexibility. It increases your efficiency. + +Bonus Tip! + +You can find tons of additional templates on the [LibreOffice website][7]. You can search for the ones you need, download them and use them. Be advised that these are from third-party, unverified users. So use them at your risk. + +I’ll keep on sharing more such tips in future. Meanwhile, you may also learn about creating templates to [add the “create new document” option in the right click menu context in GNOME][8]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/create-templates-libreoffice/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://www.libreoffice.org/ +[2]: https://itsfoss.com/libreoffice-tips/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/1.Template-save-as.png?resize=800%2C567&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/2.Use-a-template.png?ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/3.edit-template.png?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/12/LibreOffice-logo.jpeg?fit=800%2C450&ssl=1 +[7]: https://extensions.libreoffice.org/templates +[8]: https://itsfoss.com/add-new-document-option/ From c5bd2311bc22ca9730e3ccfcbcd71ababafbecc1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Apr 2020 00:56:58 +0800 Subject: [PATCH 0178/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200407=2015?= =?UTF-8?q?=20years=20of=20Git:=20How=20to=20get=20started=20or=20learn=20?= =?UTF-8?q?something=20new?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200407 15 years of Git- How to get started or learn something new.md --- ...w to get started or learn something new.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20200407 15 years of Git- How to get started or learn something new.md diff --git a/sources/tech/20200407 15 years of Git- How to get started or learn something new.md b/sources/tech/20200407 15 years of Git- How to get started or learn something new.md new file mode 100644 index 0000000000..e4db52398b --- /dev/null +++ b/sources/tech/20200407 15 years of Git- How to get started or learn something new.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (15 years of Git: How to get started or learn something new) +[#]: via: (https://opensource.com/article/20/4/get-started-git) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +15 years of Git: How to get started or learn something new +====== +On Git's 15th anniversary, learn why it is a major component in keeping +the software industry running. +![Scissors cutting open access to files][1] + +If there's anything that's changed software in the past two decades, [Git][2] is at the top of the list. + +If you don't use Git personally, you might think it's just a tech fad, an incidental darling among developers just because it was created by the same person who started the [Linux][3] project itself. There may be some truth to that, but Git does manage to achieve some feats that no other industry has managed. With Git, developers spread all over the world are able to work on the same code, literally at the same time, with a history of every change made, and then merge all the work together to result in a finished product. The complexity is enormous, and so the tool itself can get complex, but in the end, it's a major component in keeping the software industry running. + +Whether you know Git or not, you'll very likely encounter it should you dig deep enough into open source software or enter into computer science. Whether you use Git to just download an installer package or whether you interface with it daily to manage code, learning more about it is elucidating and empowering. + +### Git terminology + +As with any specialized tool, there's a lot of jargon in Git. Terms like "clone" and "merge" and "rebase" are mysterious at best, and at worst can feel almost exclusionary. Trying to understand what all of these terms mean can be overwhelming, but not if you take a little guidance from Matthew Broberg's excellent [Git Terminology 101][4] article. In just one quick read, you'll be able to listen in on conversations about Git with real comprehension. + +### Getting started with Git + +If you need to know how to use Git, then my own [introductory article series about using Git][5] is a great place to start. The articles are several years old now, but as with so many Linux and UNIX technologies, the interface hasn't changed significantly, so the articles are as relevant today as they were when I wrote them. The series introduces you to the most basic concepts of Git, and steps you through the process of creating a repository, committing files, restoring files, merging branches, and much more. + +### Common Git services + +One of the most common uses of Git is a public Git hosting service, such as GitLab and GitHub. In his [How to clone, modify, add, and delete files in Git][6] article, Kedar Vijay Kulkarni demonstrates the everyday tasks most developers perform with Git. This isn't required reading for non-developers, but it's a must for anyone who wants to contribute to a project on a public Git hosting service. This article addresses Github specifically because it's one of the most common platforms today, but the principles apply to any web front-end for Git, including popular open source frameworks like [GitLab][7], [Gogs][8], and [Gitea][9]. + +### Try this Git walkthrough + +Do you prefer a guided tour to aimless exploration? Sometimes the easiest way to learn something is to mimic someone else's exact steps. You know the end result is a guaranteed success, so you have confidence while performing the exercise, and your brain and fingers get the benefit of repetition, which builds memory. If that's your learning style, then follow along with Alan Formy-Duvall's [practical learning exercise for Git][10] and find out what a successful Git session feels like. + +### Git apps + +Believe it or not, Git has more interfaces than text you type into a terminal. Obviously there are the web interfaces of Git hosts online, but you can use Git clients on your computer, too. For just a light layer of assistance, read Jesse Duffield's article about [Lazygit][11] or Olaf Anders' article about [Tig][12]. For the full graphical application experience, read my article about [Git-cola][13], [Sparkleshare][14], and [still others][15]. And yes, there are even [interfaces for your mobile devices][16]! + +### Learn more about Git + +Knowledge is power, so don't let Git be a mystery to you. Whether you use it directly or you only know it by name or you'd never heard of it before, now's a great time to learn about Git. There are great resources out there to help you understand how it works, why it works, and why people love it so much.  Dive in, take it at your own pace, and learn to love Git! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/get-started-git + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2 (Scissors cutting open access to files) +[2]: https://en.wikipedia.org/wiki/Git +[3]: https://opensource.com/resources/linux +[4]: https://opensource.com/article/19/2/git-terminology +[5]: https://opensource.com/life/16/7/stumbling-git +[6]: https://opensource.com/article/18/2/how-clone-modify-add-delete-git-files +[7]: https://about.gitlab.com/install/ +[8]: https://gogs.io/ +[9]: https://gitea.io/en-us/ +[10]: https://opensource.com/article/19/5/practical-learning-exercise-git +[11]: https://opensource.com/article/20/3/lazygit +[12]: https://opensource.com/article/19/6/what-tig +[13]: https://opensource.com/article/20/3/git-cola +[14]: https://opensource.com/article/19/4/file-sharing-git +[15]: https://opensource.com/life/16/8/graphical-tools-git +[16]: https://opensource.com/article/19/4/calendar-git#mobile From b42682737ddfb4ac5554d7bb33a2d5c87088e27f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Apr 2020 00:57:50 +0800 Subject: [PATCH 0179/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200407=20Love?= =?UTF-8?q?=20or=20hate=20chat=3F=204=20best=20practices=20for=20remote=20?= =?UTF-8?q?teams?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200407 Love or hate chat- 4 best practices for remote teams.md --- ...chat- 4 best practices for remote teams.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20200407 Love or hate chat- 4 best practices for remote teams.md diff --git a/sources/tech/20200407 Love or hate chat- 4 best practices for remote teams.md b/sources/tech/20200407 Love or hate chat- 4 best practices for remote teams.md new file mode 100644 index 0000000000..855c622e49 --- /dev/null +++ b/sources/tech/20200407 Love or hate chat- 4 best practices for remote teams.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Love or hate chat? 4 best practices for remote teams) +[#]: via: (https://opensource.com/article/20/4/chat-tools-best-practices) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike) + +Love or hate chat? 4 best practices for remote teams +====== +Plus, learn about a few open source alternatives for chat. +![Chat via email][1] + +Chat is a part of most people's daily lives, especially if you work in tech, and especially if you work with teammates located in different parts of the world. It can be a great way to achieve these goals: + + * **to connect**; to share with teammates on a personal level + * **to get work done**; to communicate with teammates about work in progress + * **to share**; to give notes and feedback from experiences, meetings, and interactions outside of the group that may be relevant to your work or interests + + + +I encourage you to explore [open source alternatives to chat][2] like [Mattermost][3], [Rocket.Chat][4], and [Riot][5]. + +### To chat or not to chat, that is the question + +First, it's important to make time to have a discussion with each member of your team focused on answering whether they are comfortable with using a chat platform to keep in touch throughout the workday. Some people enjoy chat and see it as a vital part of their workday, getting things done and communicating with teammates who they rely on to get that work done and move forward with projects. Others struggle with chat as a way of getting work done and prefer to use it when they feel like having more casual conversations with teammates on topics less focused on work and more on social interaction and personal sharing. Some people wish chat would burn in a fire. + +Gather these opinions and talk through these feelings with each person. You can do this as a group or one-on-one if that feels more appropriate. + +Why? Because communication is important and always will be, and your team will find a way to chat no matter what you do. We're human, and need various levels and types of interaction with each other throughout our days and lives. And when it comes to our work colleagues, it's helpful to put some structure in place to guide your team. + +### Best practices for team chat + +If you have decided to use chat in some form, the next step is to place structure around when and how to use it and **not** use it. These best practices work well for teams who are working remotely and at home, as well as in the office. + +**1\. Create rooms and threads to focus your conversations.** + +My team has a room for each of our sub-teams who work on a particular project together. We also have an at-large room for all of us to banter and share. + +Additionally, we use threads to focus on one topic at a time which is helpful when you have several to dozens of teammates in one room together. It helps conversations to continue and not stop prematurely because they were lost in the mix of other conversations. + +**2\. Decide when your team will be signed in and available to talk.** + +Is it throughout the workday (whatever hours those are for you), during a set timeframe, or as desired? + +My team has set the expectation that they will be signed in and available to chat at some point during the workday **about work-related topics**, and that at that time they will check for and respond to messages that were sent to them while they were away. So, we are using it as an asynchronous way to communicate about work. + +For us, asynchronous chat helps us plan and schedule each day how we see fit with the goal of being productive and serving our project in the best we can _that day_. + +If a teammate does **not** plan on signing in and responding to messages one day, that is OK, and we set the expectation that they will send a message to let the team know. For my team, almost no communication is wrong (see guideline #4), but it should be communicated. We also review our schedules for the following week in a team meeting the week before so we know when someone will be away from their desk, not working, or blocking out a chunk of time for a project. + +**3\. Decide when your teammates are responsible for responding (and when they are not).** + +Use @ mentions if you want someone to see and respond to your question or comment in chat. Don't expect them to be watching every thread and conversation.  + +And I would recommend that you take it a step further and define when teammates should be responsible for responding and when they should not. This type of decision is meant to free you and your teammates, not hold you down. The more you understand the expectations, the freer you are to operate within the same understood universe. When you are unsure of the rules, you may act and make decisions in fear or trepidation instead, like staying signed in to chat all day when you really just need to block it out to get something done. + +Our team has decided that it's nice if you can respond in chat when you are mentioned, but if you don't that is OK. Perhaps you were AFK during that time and lost track of the notification. For us, if you definitely want a response to something from someone, send them an email.  + +**4\. Communicate clearly and with kindness.** + +The way we interpret messages when we are chatting via text is different than when we are chatting verbally, in-person or over video. + +My team uses a lot of humor, emojis, and clear, concise messages to chat with each other. + +We also hold weekly in-person or video conference meetings so that we can get to know each other better. The more you trust someone, the easier it is to give them the benefit of the doubt when you're confused by a message and the better you are at understanding what they are saying and what their intention is behind the text coming through to you. + +### Signing off + +What best practices does your team use? Do you love or hate chat, and why?  + +For all kinds of teams today, chat is a special part of how we stay connected, working, and sharing with each other. Finding ways to do that in a healthy and committed way is part of everyone's responsibility. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/chat-tools-best-practices + +作者:[Jen Wike Huger][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jen-wike +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_chat_communication_message.png?itok=LKjiLnQu (Chat via email) +[2]: https://opensource.com/alternatives/slack +[3]: https://mattermost.com/ +[4]: https://rocket.chat/ +[5]: https://riot.im/app/ From f5670eb8d95cb90c97749f1bf64db1e380b9ed51 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Apr 2020 00:58:29 +0800 Subject: [PATCH 0180/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200407=20How?= =?UTF-8?q?=20to=20use=20pyenv=20to=20run=20multiple=20versions=20of=20Pyt?= =?UTF-8?q?hon=20on=20a=20Mac?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md --- ...un multiple versions of Python on a Mac.md | 186 ++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md diff --git a/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md b/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md new file mode 100644 index 0000000000..4d15072b90 --- /dev/null +++ b/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md @@ -0,0 +1,186 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use pyenv to run multiple versions of Python on a Mac) +[#]: via: (https://opensource.com/article/20/4/pyenv) +[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg) + +How to use pyenv to run multiple versions of Python on a Mac +====== +If you need to run a project that uses a Python version you don't have +installed on macOS, try pyenv. +![Searching for code][1] + +Managing a local Python development environment continues to be a challenge, even for experienced developers. While there are well-documented [strategies for package management][2], there is another step necessary to ensure you are running the version of Python you need when you need it. + +### Why does the version of Python matter? + +It's a strange concept at first, but programming languages change like any other software. They have bugs, fixes, and updates like any of your favorite [APIs][3] and any other software. Similarly again, different releases are identified by a three-digit number known as a [semantic version][4]. + +> 😭😭😭 [pic.twitter.com/yt1Z2439W8][5] +> +> — Denny Perez (@dennyperez18) [May 28, 2019][6] + +For many years, Python 2 was the commonly used major version of the programming language. In January 2020, Python 2 [reached end of life][7], and only Python 3 will be supported by the language's core maintainers from then forward. Python 3 is developing steadily, and releasing new updates regularly. That makes it important for me to regularly get those updates. + +Recently, I tried to run a project on macOS that depended on Python 3.5.9, a version that I did not have installed on my system. It might seem logical to think the Python package manager **pip** could install it*, but that wasn't the case: + + +``` +$ pip install python3.5.9 +Collecting python3.5.9 +  ERROR: Could not find a version that satisfies the requirement python3.5.9 (from versions: none) +ERROR: No matching distribution found for python3.5.9 +``` + +Alternatively, I could have downloaded that version from the official Python website, but how would I run it in on my Mac alongside my existing version of Python? Specifying the version of Python I intend to use every time I run the interpreter (python3.7 or python3.5 for example) seems error-prone at best. There has to be a better way. + +_(A note on the above: I know this makes no sense to seasoned Python developer, but it made sense to me at the time. I would happily talk about why I still think it should.)_ + +### Installing and setting up pyenv + +Thankfully, **pyenv** exists to work around this series of complexities. To start, I needed to install pyenv. I could clone and compile it myself [from source][8], but I prefer to manage packages like this through the Homebrew package manager: + + +``` +`$ brew install pyenv` +``` + +In order to use the version of Python through pyenv, it's essential to understand the shell's PATH variable. PATH determines where the shell searches for files by the name of the command. You must ensure the shell will find the version of Python run by pyenv, not the one installed by default (which is often called the _system version_). If you don't change the path, here is the result: + + +``` +$ which python +/usr/bin/python +``` + +That's the system version of Python. + +To set up pyenv correctly, you can run the following in Bash or zsh: + + +``` +`$ PATH=$(pyenv root)/shims:$PATH` +``` + +Now, if you check the version of Python, you'll see it is the one managed by pyenv: + + +``` +$ which python +/Users/my_username/.pyenv/shims/python +``` + +That export statement (PATH=) will only change for this shell instance, so make it a permanent change, you need to add it to your dotfiles. Since zsh is officially macOS's default shell, I'll focus on it. Append that same syntax to the **~/.zshrc** file: + + +``` +`$ echo 'PATH=$(pyenv root)/shims:$PATH' >> ~/.zshrc` +``` + +Now every time we run a command in zsh, it will use the pyenv version of Python. Note that I used single quotes with **echo** so it does not evaluate and expand the commands. + +The .zshrc file only manages zsh instances, so be sure to check what your shell is and edit the associated dotfiles. If you need to double-check what your default shell is, you can run **echo $SHELL**. If it's zsh, use the command above. If you use Bash, change **~/.zshrc** to **~/.bashrc**. You can dive deep into [path setting][9] in pyenv's README if you would like to learn more. + +### Using pyenv to manage Python versions + +Now that pyenv is in control, we can see it only has the system Python available to it: + + +``` +$ pyenv versions +system +``` + +As mentioned above, you absolutely do not want to use this version ([read more on why][10]). Now that pyenv is set up correctly, I want it to have a few different versions of Python that I regularly use. + +There is a way to see all Python versions available from all the different repositories pyenv has access to by running **pyenv install --list**. It's a long, overwhelming list that may be helpful to review in the future. For now, I stick with the latest of each dot-release (3.5.x or 3.6.x where x is the latest) found on the [Python download page][11]. With that in mind, I'll install 3.5.9 and 3.8.0: + + +``` +$ pyenv install 3.5.9 +$ pyenv install 3.8.0 +``` + +This will take a while, so get some tea (or read one of the links above). It's interesting to note that the output walks through the download and building of that version of Python. For example, the output shows that the file comes directly from [Python.org][12]. + +Once everything is installed, you can set up your defaults. I like to live at the cutting edge, so I set my global default Python version to the latest: + + +``` +`$ pyenv global 3.8.0` +``` + +And that version is immediately set in my shell. To confirm: + + +``` +$ python -V +Python 3.8.0 +``` + +The project I want to run works only with Python 3.5, so I'll set the version locally and confirm it's in use: + + +``` +$ pyenv local 3.5.9 +$ python -V +Python 3.5.9 +``` + +Because I used the **local** option with pyenv, it added a file to my current directory to track that information.  + + +``` +$ cat .python-version +3.5.9 +``` + +Now, I can finally set up a virtual environment for the project I want and be sure I'm running the right version of Python. + + +``` +$ python -m venv venv +$ source ./venv/bin/activate +(venv) $ which python +/Users/mbbroberg/Develop/my_project/venv/bin/python +``` + +To learn more, check out this tutorial about [managing virtual environments on a Mac][13]. + +### Wrapping up + +By default, running multiple Python versions can be a challenge. I find starting with pyenv ensures I have the versions of Python I need set up to run when I need them. + +Do you have other beginner or intermediate Python questions? Leave a comment, and we will consider them for a future article. + +Newcomers to python-ideas occasionally make reference to the idea of "Python 4000" when proposing... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/pyenv + +作者:[Matthew Broberg][a] +选题:[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/mbbroberg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_python_programming.png?itok=ynSL8XRV (Searching for code) +[2]: https://opensource.com/article/19/4/managing-python-packages +[3]: https://opensource.com/article/19/5/api-evolution-right-way +[4]: https://semver.org/ +[5]: https://t.co/yt1Z2439W8 +[6]: https://twitter.com/dennyperez18/status/1133505310516232203?ref_src=twsrc%5Etfw +[7]: https://opensource.com/article/19/11/end-of-life-python-2 +[8]: https://github.com/pyenv/pyenv +[9]: https://github.com/pyenv/pyenv#understanding-path +[10]: https://opensource.com/article/19/5/python-3-default-mac +[11]: https://www.python.org/downloads/ +[12]: http://python.org +[13]: https://opensource.com/article/19/6/python-virtual-environments-mac From 4ae2ba97a8f8dcfeee1031425cab75ac61cd6dad Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Apr 2020 00:59:20 +0800 Subject: [PATCH 0181/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200407=20How?= =?UTF-8?q?=20to=20avoid=20man-in-the-middle=20cyber=20attacks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200407 How to avoid man-in-the-middle cyber attacks.md --- ...o avoid man-in-the-middle cyber attacks.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/tech/20200407 How to avoid man-in-the-middle cyber attacks.md diff --git a/sources/tech/20200407 How to avoid man-in-the-middle cyber attacks.md b/sources/tech/20200407 How to avoid man-in-the-middle cyber attacks.md new file mode 100644 index 0000000000..5db0d5c572 --- /dev/null +++ b/sources/tech/20200407 How to avoid man-in-the-middle cyber attacks.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to avoid man-in-the-middle cyber attacks) +[#]: via: (https://opensource.com/article/20/4/mitm-attacks) +[#]: author: (Jackie Lam https://opensource.com/users/beenverified) + +How to avoid man-in-the-middle cyber attacks +====== +Understanding MITM attacks is the first step in not being a victim of +this high-tech style of eavesdropping. +![Security monster][1] + +Whether you're sending data on your computer or talking to someone online, you want to assume some level of security and privacy. + +But what if a third party is eavesdropping online, unbeknownst to you? And worse, what if they're impersonating someone from a business you trust in order to gain damaging information? This could put your personal data into the hands of dangerous, would-be thieves. + +Welcome to what's called a man-in-the-middle (MITM) attack. + +### What are man-in-the-middle attacks? + +A man-in-the-middle attack occurs when a cybercriminal inserts themselves into communications between you, the targeted victim, and a device in order to steal sensitive information that can be used for a variety of criminal purposes—most notably identity theft, says Steve J. J. Weisman, founder of Scamicide. + +"A man-in-the-middle-attack can also occur when the victim believes he or she is communicating with a legitimate app or website," says Weisman, "when the truth is that the victim is communicating with a phony website or app and thereby providing sensitive information to the criminal." + +One of the oldest forms of cyberattacks, MITM attacks have been around since the 1980s. What's more, they're quite common. As Weisman explains, there are a handful of ways a MITM attack can happen: + + * **Attacking a WiFi router that is not properly secured:** This typically occurs when someone is using public WiFi. "While home routers might be vulnerable, it's more common for criminals to attack public WiFi networks," says Weisman. The goal is to spy on unsuspecting people who are handling sensitive information, such as their online bank accounts, he adds. + * **Hacking email accounts of banks, financial advisers, and other companies:** "Once [the criminals] have hacked these email systems, they send out emails that appear to come from the legitimate bank or other company," Weisman says. "[They ask] for personal information, such as usernames and passwords, under the guise of an emergency. The targeted victim is lured into providing that information." + * **Sending phishing emails:** Thieves might also send emails pretending to be legitimate companies that the targeted victim does business with, asking the recipient for their personal information. "In many instances, the spear-phishing emails will direct the victim to a counterfeit website that appears to be that of a legitimate company with which the victim does business," says Weisman. + * **Using malicious code in legitimate websites:** Attackers can also place malicious code—usually JavaScript—into a legitimate website by way of a web application. "When the victim loads the legitimate page, the malicious code just sits in the background until the user enters sensitive information, such as account login or credit card details, which the malicious code then copies and sends to the attackers' servers," says Nicholas McBride, a cybersecurity consultant. + + + +### What is an example of an MITM attack? + +The Lenovo case is a well-known example of an MITM attack. In 2014 and 2015, the major computer manufacturer sold consumer laptops with preinstalled software that meddled with how a user's browser communicated with websites. Whenever the user's cursor hovered over a product, this software, called VisualDiscovery, sent pop-up ads from retail partners that sold similar products. + +Here's the kicker: This MITM attack allowed VisualDiscovery to access all of the user's personal data, including social security numbers, info about financial transactions, medical info, and logins and passwords. All without the user knowing or granting permission beforehand. The FTC deemed this a deceptive and unfair online scam. Lenovo agreed to pay $8.3 million in a class-action settlement in 2019. + +### How can I protect myself from an online attack? + + * **Avoid using public WiFi:** Weisman recommends never using public WiFi for financial transactions unless you've installed a reliable virtual private network (VPN) client on your device and have a VPN host you can use and trust. Over a VPN connection, your communications are encrypted, so your information can't be stolen. + + * **Be on the lookout:** Be wary of emails or text messages that ask you to update your password or provide your username or personal information. These methods can be used to steal your identity. + +If you are unsure of the actual identity of the party sending you the email, you can use tools such as a reverse phone or email search. With a reverse phone number lookup, you may be able to find out more about the identity of an unknown texter. And with a reverse email lookup, you can try to determine who might have sent you a message. + +Generally, if something's actually a problem, you'll hear from someone you know and trust within your company, or from someone you can also go and meet, in person, at your bank or school or other organization. Important account information is never the purview of an unknown technician. + + * **Don't click on links contained in emails:** If someone sends you an email telling you that you need to sign into an account, don't click on the link provided in the email. Instead, navigate to the site yourself, log in as you normally would, and look for an alert there. If you don't see an alert message in your account settings, contact a representative by phone using contact information on the site and _not_ from the email. + + * **Install reliable security software:** If you're on Windows, install good open source antivirus like [ClamAV][2]. On all platforms, keep your software up to date with the latest security patches. + + * **Take alerts seriously:** If you're visiting a site that starts with HTTPS, your browser might alert you to an issue, says McBride. For instance, if the domain name on the site's certificate doesn't match the one you're trying to visit. Don't ignore the alert. Heed it and navigate away from the site for now. Verify that you haven't [mistyped it][3], and if the problem persists, contact the site owner if you can. + + * **Use an ad blocker:** Pop-up ads (also known as _adware attacks_) can be used to intercept your personal information, so use an ad blocker. "The truth is, as an individual user, it's hard to protect against a MITM attack," says McBride, "as it is designed to leave the victim in the dark and to prevent them from noticing that there is anything wrong." + +A good open source ad blocker (or "wide-spectrum blocker," in the developer's words) is [uBlock origin][4]. It's available for both Firefox and Chromium (and all Chromium-based browsers, such as Chrome, Brave, Vivaldi, Edge, and so on), and even Safari. + + + + +### Stay alert + +Remember, you don't have to click anything online right away, and you don't have to follow random people's instructions, no matter how urgent they may seem. The internet will still be there after you step away from the computer and verify the identity of a person or site demanding your attention. + +While MITM attacks can happen to anyone, understanding what they are, knowing how they happen, and actively taking steps to prevent them can safeguard you from being a victim. + +* * * + +_This article was originally published on [BeenVerified.com][5] under a [CC BY-SA 2.0][6] license._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/mitm-attacks + +作者:[Jackie Lam][a] +选题:[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/beenverified +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security_password_chaos_engineer_monster.png?itok=J31aRccu (Security monster) +[2]: https://www.clamav.net +[3]: https://opensource.com/article/20/1/stop-typosquatting-attacks +[4]: https://github.com/gorhill/uBlock +[5]: https://www.beenverified.com/crime/what-is-a-man-in-the-middle-attack/ +[6]: https://creativecommons.org/licenses/by-sa/2.0/ From 5c316e453dfb2a5813da89cb76c59dd2fd2a3b25 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 8 Apr 2020 08:30:53 +0800 Subject: [PATCH 0182/1809] translated --- ...from spreadsheets in Fedora with Python.md | 117 ------------------ ...from spreadsheets in Fedora with Python.md | 117 ++++++++++++++++++ 2 files changed, 117 insertions(+), 117 deletions(-) delete mode 100644 sources/tech/20200330 Using data from spreadsheets in Fedora with Python.md create mode 100644 translated/tech/20200330 Using data from spreadsheets in Fedora with Python.md diff --git a/sources/tech/20200330 Using data from spreadsheets in Fedora with Python.md b/sources/tech/20200330 Using data from spreadsheets in Fedora with Python.md deleted file mode 100644 index a24dd7faa9..0000000000 --- a/sources/tech/20200330 Using data from spreadsheets in Fedora with Python.md +++ /dev/null @@ -1,117 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using data from spreadsheets in Fedora with Python) -[#]: via: (https://fedoramagazine.org/using-data-from-spreadsheets-in-fedora-with-python/) -[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) - -Using data from spreadsheets in Fedora with Python -====== - -![][1] - -[Python][2] is one of the most popular and powerful programming languages available. Because it’s free and open source, it’s available to everyone — and most Fedora systems come with the language already installed. Python is useful for a wide variety of tasks, but among them is processing comma-separated value (**CSV**) data. CSV files often start off life as tables or spreadsheets. This article shows how to get started working with CSV data in Python 3. - -CSV data is precisely what it sounds like. A CSV file includes one row of data at a time, with data values separated by commas. Each row is defined by the same _fields_. Short CSV files are often easily read and understood. But longer data files, or those with more fields, may be harder to parse with the naked eye, so computers work better in those cases. - -Here’s a simple example where the fields are _Name_, _Email_, and _Country_. In this example, the CSV data includes a field definition as the first row, although that is not always the case. - -``` -Name,Email,Country -John Q. Smith,jqsmith@example.com,USA -Petr Novak,pnovak@example.com,CZ -Bernard Jones,bjones@example.com,UK -``` - -### Reading CSV from spreadsheets - -Python helpfully includes a _csv_ module that has functions for reading and writing CSV data. Most spreadsheet applications, both native like Excel or Numbers, and web-based such as Google Sheets, can export CSV data. In fact, many other services that can publish tabular reports will also export as CSV (PayPal for instance). - -The Python _csv_ module has a built in reader method called _DictReader_ that can deal with each data row as an ordered dictionary (OrderedDict). It expects a file object to access the CSV data. So if our file above is called _example.csv_ in the current directory, this code snippet is one way to get at this data: - -``` -f = open('example.csv', 'r') -from csv import DictReader -d = DictReader(f) -data = [] -for row in d: - data.append(row) -``` - -Now the _data_ object in memory is a list of OrderedDict objects : - -``` -[OrderedDict([('Name', 'John Q. Smith'), - ('Email', 'jqsmith@example.com'), - ('Country', 'USA')]), - OrderedDict([('Name', 'Petr Novak'), - ('Email', 'pnovak@example.com'), - ('Country', 'CZ')]), - OrderedDict([('Name', 'Bernard Jones'), - ('Email', 'bjones@example.com'), - ('Country', 'UK')])] -``` - -Referencing each of these objects is easy: - -``` ->>> print(data[0]['Country']) -USA ->>> print(data[2]['Email']) -bjones@example.com -``` - -By the way, if you have to deal with a CSV file with no header row of field names, the _DictReader_ class lets you define them. In the example above, add the _fieldnames_ argument and pass a sequence of the names: - -``` -d = DictReader(f, fieldnames=['Name', 'Email', 'Country']) -``` - -### A real world example - -I recently wanted to pick a random winner from a long list of individuals. The CSV data I pulled from spreadsheets was a simple list of names and email addresses. - -Fortunately, Python also has a helpful _random_ module good for generating random values. The _randrange_ function in the _Random_ class from that module was just what I needed. You can give it a regular range of numbers — like integers — and a step value between them. The function then generates a random result, meaning I could get a random integer (or row number!) back within the total number of rows in my data. - -So this small program worked well: - -``` -from csv import DictReader -from random import Random - -d = DictReader(open('mydata.csv')) -data = [] -for row in d: - data.append(row) - -r = Random() -winner = data[r.randrange(0, len(data), 1)] -print('The winner is:', winner['Name']) -print('Email address:', winner['Email']) -``` - -Obviously this example is extremely simple. Spreadsheets themselves include sophisticated ways to analyze data. However, if you want to do something outside the realm of your spreadsheet app, Python may be just the trick! - -* * * - -_Photo by [Isaac Smith][3] on [Unsplash][4]._ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/using-data-from-spreadsheets-in-fedora-with-python/ - -作者:[Paul W. Frields][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/pfrields/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/03/spreadsheets-python-816x345.jpg -[2]: https://python.org -[3]: https://unsplash.com/@isaacmsmith?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://unsplash.com/s/photos/spreadsheets?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20200330 Using data from spreadsheets in Fedora with Python.md b/translated/tech/20200330 Using data from spreadsheets in Fedora with Python.md new file mode 100644 index 0000000000..abd3f63cf8 --- /dev/null +++ b/translated/tech/20200330 Using data from spreadsheets in Fedora with Python.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using data from spreadsheets in Fedora with Python) +[#]: via: (https://fedoramagazine.org/using-data-from-spreadsheets-in-fedora-with-python/) +[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) + +在 Fedora 中使用 Python 读取电子表格中的数据 +====== + +![][1] + +[Python][2] 是最流行、功能最强大的编程语言之一。由于它是免费和开源的,因此每个人都可以使用。大多数 Fedora 系统都已安装了该语言。Python 可用于多种任务,其中包括处理逗号分隔值(**CSV**)数据。CSV 文件通常作为表格启动。本文介绍了如何在 Python 3 中处理 CSV 数据。 + +CSV 数据正是它听起来的样子。CSV 文件一次包含一行数据,数值之间用逗号分隔。每行由相同的_字段_定义。简短的 CSV 文件通常易于阅读和理解。但是较长的数据或具有更多字段的数据文件可能很难用肉眼解析,因此在这种情况下计算机做得更好。 + +这是一个简单的示例,其中的字段是 _Name _、_ Email_ 和 _Country_。在此例中,CSV 数据将字段定义作为第一行,尽管并非总是如此。 + +``` +Name,Email,Country +John Q. Smith,jqsmith@example.com,USA +Petr Novak,pnovak@example.com,CZ +Bernard Jones,bjones@example.com,UK +``` + +### 从电子表格读取 CSV + +Python 包含了一个 _csv_ 模块,它可读取和写入 CSV 数据。大多数电子表格应用,无论是原生(例如 Excel 或 Numbers)还是基于 Web 的(例如 Google Sheet),都可以导出 CSV 数据。实际上,许多其他可发布表格报告的服务也将导出为 CSV(例如,PayPal)。 + +Python _csv_ 模块有一个名为 _DictReader_ 的内置读取器方法,它可以将每个数据行作为有序字典 (OrderedDict) 处理。它需要一个文件对象访问 CSV 数据。因此,如果上面的文件在当前目录中为 _example.csv_,那么以下代码段是获取此数据的一种方法: + +``` +f = open('example.csv', 'r') +from csv import DictReader +d = DictReader(f) +data = [] +for row in d: + data.append(row) +``` + +现在,内存中的 _data_ 对象是 OrderedDict 对象的列表: + +``` +[OrderedDict([('Name', 'John Q. Smith'), + ('Email', 'jqsmith@example.com'), + ('Country', 'USA')]), + OrderedDict([('Name', 'Petr Novak'), + ('Email', 'pnovak@example.com'), + ('Country', 'CZ')]), + OrderedDict([('Name', 'Bernard Jones'), + ('Email', 'bjones@example.com'), + ('Country', 'UK')])] +``` + +引用这些对象很容易: + +``` +>>> print(data[0]['Country']) +USA +>>> print(data[2]['Email']) +bjones@example.com +``` + +顺便说一句,如果你需要处理没有字段名标题行的 CSV 文件,那么 _DictReader_ 类可以让你定义它们。在上面的示例中,添加 _fieldnames_ 参数并传递一系列名称: + +``` +d = DictReader(f, fieldnames=['Name', 'Email', 'Country']) +``` + +### 真实例子 + +我最近想从一长串人中随机选择一名赢家。我从电子表格中提取的 CSV 数据是一个简单的名称和邮件地址列表。 + +幸运的是,Python 有一个有用的 _random_ 模块,可以很好地生成随机值。该模块 _Random_ 类中的 _randrange_ 函数正是我需要的。你可以给它一个常规的数字范围(例如整数),以及它们之间的步长值。然后,该函数会生成一个随机结果,这意味着我可以在数据的总行数范围内获得一个随机整数(或行号!)。 + +这个小程序运行良好: + +``` +from csv import DictReader +from random import Random + +d = DictReader(open('mydata.csv')) +data = [] +for row in d: + data.append(row) + +r = Random() +winner = data[r.randrange(0, len(data), 1)] +print('The winner is:', winner['Name']) +print('Email address:', winner['Email']) +``` + +显然,这个例子非常简单。电子表格本身包含了复杂的分析数据的方法。但是,如果你想在电子表格应用之外做某事,Python 或许是一种技巧! + +* * * + +_由 [Isaac Smith][3] 拍摄,发表于 [U​​nsplash][4]。_ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/using-data-from-spreadsheets-in-fedora-with-python/ + +作者:[Paul W. Frields][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/pfrields/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/03/spreadsheets-python-816x345.jpg +[2]: https://python.org +[3]: https://unsplash.com/@isaacmsmith?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://unsplash.com/s/photos/spreadsheets?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From bdd4a01469d915f164958572d75bfc86a2dbe6b1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 8 Apr 2020 08:37:44 +0800 Subject: [PATCH 0183/1809] translating --- ...20200407 Bitwarden- A Free - Open Source Password Manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md b/sources/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md index 26fa46b858..bac49804f7 100644 --- a/sources/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md +++ b/sources/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a636e72e8b8bca6f9592a8e19fe1f27bf2b74141 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 8 Apr 2020 09:31:05 +0800 Subject: [PATCH 0184/1809] Rename sources/tech/20200407 15 years of Git- How to get started or learn something new.md to sources/talk/20200407 15 years of Git- How to get started or learn something new.md --- ... 15 years of Git- How to get started or learn something new.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200407 15 years of Git- How to get started or learn something new.md (100%) diff --git a/sources/tech/20200407 15 years of Git- How to get started or learn something new.md b/sources/talk/20200407 15 years of Git- How to get started or learn something new.md similarity index 100% rename from sources/tech/20200407 15 years of Git- How to get started or learn something new.md rename to sources/talk/20200407 15 years of Git- How to get started or learn something new.md From 621ded7bcea7f6d6586151e28cbdd9a75b2144ed Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Apr 2020 12:52:06 +0800 Subject: [PATCH 0185/1809] PRF @HankChow --- ...to Ubuntu 20.04 Beta from 18.04 - 19.10.md | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/translated/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md b/translated/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md index fd629c8db7..9b542f814b 100644 --- a/translated/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md +++ b/translated/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md @@ -1,26 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Upgrade to Ubuntu 20.04 Beta from 18.04 & 19.10) [#]: via: (https://itsfoss.com/upgrade-ubuntu-beta/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -如何将 Ubuntu 18.04/19.10 升级到 Ubuntu 20.04 beta +如何将 Ubuntu 18.04 LTS/19.10 升级到 Ubuntu 20.04 beta ====== +![](https://img.linux.net.cn/data/attachment/album/202004/08/125043m1qyy7gzvkjazx41.jpg) + [Ubuntu 20.04 LTS 版本][1]还有不到一个月就发布了,Ubuntu 在这一个版本中对视觉效果作出了大变动,同时在性能方面也有所提高。 如果你还在使用 Ubuntu 18.04 LTS 版本,你会发现 Ubuntu 20.04 配合深色 Yaru 主题非常惊艳,看过 [Ubuntu 20.04 的展示视频][2]你就知道了。 -[订阅我们的 YouTube 频道观看更多 Linux 视频][3] +- [video](https://img.linux.net.cn/static/video/Ubuntu%2020.04%20Desktop%20Tour%20-%20Check%20Out%20New%20Features-9u5B0njRgOw.mp4) -感觉确实不错。如果你想在 4 月 23 日最终稳定版正式发布前率先使用 Ubuntu 20.04,也可以在官方网站上下载 beta 版本。尽管如此,它的稳定性并不差,同时你也可以在使用这个版本的过程中帮助 Ubuntu 团队进行测试。 +感觉确实不错。如果你想在 4 月 23 日最终稳定版正式发布前率先使用 Ubuntu 20.04,也可以在官方网站上下载 beta 版本。尽管是测试版本,但它的稳定性并不差,同时你也可以在使用这个版本的过程中帮助 Ubuntu 团队进行测试。 你可以下载每日构建daily build版并进行重新安装,如果你正在使用的是 Ubuntu 18.04 或 Ubuntu 19.10,也可以在现有系统的基础上直接升级到 Ubuntu 20.04 beta 版本。 -如果你需要确认正在使用的 Ubuntu 版本,可以参考[这篇文章][4]。 +从现有系统中升级是很方便的,因为你不会丢失系统设置和其他文件。与重新安装不同的是,你不需要从头开始重新安装所有的软件。当你切换到新版本时,你的主目录、应用程序(大部分)、文件都会保持原样。 + +> 如果你需要确认正在使用的 Ubuntu 版本,可以参考[这篇文章][4]。 在本文中,我将会介绍如何升级到 Ubuntu 20.04 beta 版本。 @@ -31,9 +35,9 @@ 在你阅读后面的内容之前,我首先说明一些关于升级到 Ubuntu beta 版本的常见问题。 * 版本升级的过程并不复杂,但在整个过程中需要有良好的网络连接,以便下载高达好几 GB 的数据。 - * 版本升级的过程中,第三方存储库(比如你自行添加的 [PPA][6])会被禁用,有些 PPA 可能也和新版本不兼容,在版本升级完毕后,你可以手动启用 PPA。 + * 版本升级的过程中,第三方存储库(比如你自行添加的 [PPA][6])会被禁用,有些 PPA 可能也和新版本不兼容,在版本升级完毕后,你可以手动启用这些 PPA。 * 强烈建议将重要数据备份到外部的 USB 硬盘上。你只需要将各个目录下的重要文件直接复制到外部 USB 硬盘上保存即可。 - * 升级到新版本之后,就无法再回滚到之前的旧版本了,只能重新安装旧版本系统。 + * 升级到新版本之后,就无法再回滚到之前的旧版本了,如果需要旧版本的系统,只能重新安装。 * 如果你选择升级到 Ubuntu 20.04 beta 版本,那么在 Ubuntu 20.04 最终稳定版发布之后,你也不需要重新安装。只需要保持定期更新 Ubuntu 系统,届时你就可以直接用上最终稳定版了。 * Ubuntu 16.04/17/18/19.04 都无法直接升级到 Ubuntu 20.04。 @@ -83,7 +87,7 @@ update-manager -d #### 步骤 4:开始升级到 Ubuntu 20.04 beta -接下来只要等待下载更新就可以了,遇到对话框直接点击 OK 即可。 +接下来只要等待下载更新就可以了,遇到对话框直接点击 “OK” 即可。 ![][13] @@ -99,6 +103,8 @@ update-manager -d 下面的视频展示了所有相关步骤。 +- [video](https://img.linux.net.cn/static/video/How%20to%20Upgrade%20to%20Ubuntu%2020.04%20Beta%20from%2018.04%20&%2019.10%20Right%20Now-RkxxEtaTVkA.mp4) + 由此可见,这个升级流程并不复杂。欢迎体验 Ubuntu 20.04 带来的新特性。 如果你有疑问或建议,欢迎在评论区留言。 @@ -111,7 +117,7 @@ via: https://itsfoss.com/upgrade-ubuntu-beta/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -120,7 +126,7 @@ via: https://itsfoss.com/upgrade-ubuntu-beta/ [1]: https://itsfoss.com/ubuntu-20-04-release-features/ [2]: https://www.youtube.com/watch?v=9u5B0njRgOw [3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[4]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ +[4]: https://linux.cn/article-9872-1.html [5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-beta.jpg?ssl=1 [6]: https://itsfoss.com/ppa-guide/ [7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/software-updates-app-ubuntu.jpg?ssl=1 From 2f7a306baf68ec1c3805f11e733ab3324bf6a67c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Apr 2020 12:52:31 +0800 Subject: [PATCH 0186/1809] PUB @HankChow https://linux.cn/article-12085-1.html --- ... How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md (99%) diff --git a/translated/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md b/published/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md similarity index 99% rename from translated/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md rename to published/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md index 9b542f814b..10db11050c 100644 --- a/translated/tech/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md +++ b/published/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12085-1.html) [#]: subject: (How to Upgrade to Ubuntu 20.04 Beta from 18.04 & 19.10) [#]: via: (https://itsfoss.com/upgrade-ubuntu-beta/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From d0e703e71311ac5c8f9fc4d2ea8cfabe203c4b6c Mon Sep 17 00:00:00 2001 From: tinyeyeser Date: Wed, 8 Apr 2020 13:06:25 +0800 Subject: [PATCH 0187/1809] =?UTF-8?q?translated=20by=20=E5=B0=8F=E7=9C=BC?= =?UTF-8?q?=E5=84=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ontrol the firewall at the command line.md | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/sources/tech/20200320 Control the firewall at the command line.md b/sources/tech/20200320 Control the firewall at the command line.md index fb49292d28..d496e169a1 100644 --- a/sources/tech/20200320 Control the firewall at the command line.md +++ b/sources/tech/20200320 Control the firewall at the command line.md @@ -1,47 +1,47 @@ -[#]: collector: (lujun9972) -[#]: translator: (tinyeyeser ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Control the firewall at the command line) -[#]: via: (https://fedoramagazine.org/control-the-firewall-at-the-command-line/) -[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) +[#]: collector: "lujun9972" +[#]: translator: "tinyeyeser " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Control the firewall at the command line" +[#]: via: "https://fedoramagazine.org/control-the-firewall-at-the-command-line/" +[#]: author: "Paul W. Frields https://fedoramagazine.org/author/pfrields/" -Control the firewall at the command line +命令行下玩转防火墙(Fedora) ====== ![][1] -A network _firewall_ is more or less what it sounds like: a protective barrier that prevents unwanted network transmissions. They are most frequently used to prevent outsiders from contacting or using network services on a system. For instance, if you’re running a laptop at school or in a coffee shop, you probably don’t want strangers poking around on it. +网络防火墙,顾名思义:为了阻止不需要的网络连接而设置的防护性屏障。在与外界建立连接或是提供网络服务时常常会用到。例如,在学校或是咖啡厅里使用笔记本电脑时,你一定不想某个陌生人窥探你的电脑。 -Every Fedora system has a firewall built in. It’s part of the network functions in the Linux kernel inside. This article shows you how to change its settings using _firewall-cmd_. +每个 Fedora 系统都内置了一款防火墙。这是 Linux 内核网络功能的一部分。本文介绍如何通过 *firewall-cmd* 命令修改防火墙的配置。 -### Network basics +### 网络基础 -This article can’t teach you [everything][2] about computer networks. But a few basics suffice to get you started. +本文并不教授计算机网络的[所有知识][2],但还是会简单介绍一些网络基础。 -Any computer on a network has an _IP address_. Think of this just like a mailing address that allows correct routing of data. Each computer also has a set of _ports_, numbered 0-65535. These are not physical ports; instead, you can think of them as a set of connection points at the address. +网络中的所有计算机都有一个 *IP 地址*,可以把它想象成一个邮箱地址,有了邮箱地址,邮件才知道发往何处。每台计算机还会拥有一组*端口*,端口号范围从0到65535。同样的,你可以把这些端口想象成用来连接邮箱地址的连接点。 -In many cases, the port is a [standard number][3] or range depending on the application expected to answer. For instance, a web server typically reserves port 80 for non-secure HTTP communications, and/or 443 for secure HTTPS. The port numbers under 1024 are reserved for system and well-known purposes, ports 1024-49151 are registered, and ports 49152 and above are usually ephemeral (used only for a short time). +通常情况下,端口会是一个标准端口号或是根据应用程序的应答要求选定的一个端口范围。例如,一台 web server 通常会保留 80 端口用于 HTTP 通信,443 端口用于 HTTPS。小于1024的端口主要用于系统或常见用途,1024-49151端口用于注册,49152及以上端口多为临时使用(只短时间启用)。 -Each of the two most common protocols for Internet data transfer, [TCP][4] and [UDP][5], have this set of ports. TCP is used when it’s important that all data be received and, if it arrives out of order, reassembled in the right order. UDP is used for more time-sensitive services that can withstand losing some data. +互联网传输中最常见的两个协议,[TCP][4] 和 [UDP][5]。当要传输的数据很重要,不能有丢包时,就使用TCP协议,如果数据包没有按顺序到达,还需要重组为正确的顺序。UDP协议则更多用于对时间敏感的服务,为了保证时效性,有时允许丢失部分数据。 -An application running on the system, such as a web server, reserves one or more ports (as seen above, 80 and 443 for example). Then during network communication, a host establishes a connection between a source address and port, and the destination address and port. +系统中运行的应用,例如 web server,会保留一些端口(例如上文提到的80和443)。在网络传输过程中,主机会为传输的两端建立一个链接,一端是源地址和源端口,另一端是目的地址和目的端口。 -A network firewall can block or permit transmissions of network data based on rules like address, port, or other criteria. The _firewall-cmd_ utility lets you interact with the rule set to view or change how the firewall works. +网络防火墙就是基于地址、端口及其他标准的一组规则集,来对网络数据的传输进行屏蔽或阻断的。通过 *fire-cmd* 命令,我们就可以查看或修改防火墙的工作配置。 -### Firewall zones +### 防火墙域(zone) -To verify the firewall is running, use this command with [sudo][6]. (In fairness, you can run _firewall-cmd_ without the _sudo_ command in environments where [PolicyKit][7] is running.) +为了验证防火墙是否开启,使用 *firewall-cmd* 命令,输入时要加上[sudo](https://fedoramagazine.org/howto-use-sudo/)。(通常,在运行了[PolicyKit](https://en.wikipedia.org/wiki/Polkit)的环境中,你也可以不加 *sudo*) ``` $ sudo firewall-cmd --state running ``` -The firewalld service supports any number of _zones_. Each zone can have its own settings and rules for protection. In addition, each network interface can be placed in any zone individually The default zone for an external facing interface (like the wifi or wired network card) on a Fedora Workstation is the _FedoraWorkstation_ zone. +firewalld 服务支持任意数量的域。每个域都可以拥有独立的配置和防护规则。一台 Fedora 工作站的外部接口(例如 WIFI 或有线网卡)其默认域为 *FedoraWorkstation*。 -To see what zones are active, use the _–get-active-zones_ flag. On this system, there are two network interfaces, a wired Ethernet card _wlp2s0_ and a virtualization (libvirt) bridge interface _virbr0_: +要看有哪些域是激活状态,可以使用 *–get-active-zones* 选项。在本示例中,有两个网卡,有线以太网卡 *wlp2s0* 和虚拟( libvirt )桥接网卡 *virbr0* : ``` $ sudo firewall-cmd --get-active-zones @@ -51,7 +51,7 @@ libvirt interfaces: virbr0 ``` -To see the default zone, or all the defined zones: +如果想看看默认域是什么,或是直接查询所有域: ``` $ sudo firewall-cmd --get-default-zone @@ -60,58 +60,58 @@ $ sudo firewall-cmd --get-zones FedoraServer FedoraWorkstation block dmz drop external home internal libvirt public trusted work ``` -To see the services the firewall is allowing other systems to access in the default zone, use the _–list-services_ flag. Here is an example from a customized system; you may see something different. +查询默认域中防火墙放行了哪些系统,使用 *–list-services* 选项。下例给出了一个定制系统的查询结果,你可以看到与常见的结果有些不同。 ``` $ sudo firewall-cmd --list-services dhcpv6-client mdns samba-client ssh ``` -This system has four services exposed. Each of these has a well-known port number. The firewall recognizes them by name. For instance, the _ssh_ service is associated with port 22. +该系统对外开启了四个服务。每个服务都对应一个常见端口。例如 *ssh* 服务对应 22 端口。 -To see other port settings for the firewall in the current zone, use the _–list-ports_ flag. By the way, you can always declare the zone you want to check: +如果要查看当前域中防火墙还开启了哪些端口,可以使用 *list-ports* 选项。当然,你也可以随时对其他域进行查询: ``` $ sudo firewall-cmd --list-ports --zone=FedoraWorkstation 1025-65535/udp 1025-65535/tcp ``` -This shows that ports 1025 and above (both UDP and TCP) are open by default. +结果表明,从 1025 到 65535 端口(包含UDP和TCP)默认都是开启的。 -### Changing zones, ports, and services +### 修改域、端口及服务 -The above setting is a design decision.* It ensures novice users can use network facing applications they install. If you know what you’re doing and want a more protective default, you can move the interface to the _FedoraServer_ zone, which prohibits any ports not explicitly allowed. _(**Warning:** if you’re using the host via the network, you may break your connection — meaning you’ll have to go to that box physically to make further changes!)_ +以上的配置都是预先设计好的防火墙策略(design decision*)。是为了确保新手用户安装的应用都能够正常访问网络。如果你确定自己心里有数,想要一个保护性更强的策略,可以将接口放入 _FedoraServer_ 域,明确禁止所有端口的访问。_(**警告**:如果你的服务器之前是联网状态,这么做可能会导致连接中断,那你就得到机房里去修改更多的配置项!)_ ``` $ sudo firewall-cmd --change-interface= --zone=FedoraServer success ``` -* _This article is not the place to discuss that decision, which went through many rounds of review and debate in the Fedora community. You are welcome to change settings as needed._ +* _*本文并不讨论如何制定防火墙策略,Fedora社区里已经有很多讨论了。你大可以按照自身需要来修改配置。_ -If you want to open a well-known port that belongs to a service, you can add that service to the default zone (or use _–zone_ to adjust a different zone). You can add more than one at once. This example opens up the well-known ports for your web server for both HTTP and HTTPS traffic, on ports 80 and 443: +如果你想要开放某个服务的常见端口,可以将该服务加入默认域(或使用 _-zone_ 指定一个不同的域)。还可以一次性将其加入多个域。下例开放了 HTTP 和 HTTPS 的常见端口80、443: ``` $ sudo firewall-cmd --add-service=http --add-service=https success ``` -Not all services are defined, but many are. To see the whole list, use the _–get-services_ flag. +并非所有的服务都有默认端口,不过大部分都是有的。使用 _–get-services_ 选项可以查看完整列表。 -If you want to add specific ports, you can do that by number and protocol as well. (You can also combine _–add-service_ and _–add-port_ flags, as many as necessary.) This example opens up the UDP service for a network boot service: +如果你想指定某个特定端口号,可以直接用数字和协议进行配置。(多数情况下,_–add-service_ 和 _–add-port_ 这两个选项是合在一起使用的)下例开启的是UDP协议的网络启动服务: ``` $ sudo firewall-cmd --add-port=67/udp success ``` -**Important:** If you want your changes to be effective after you reboot your system or restart the firewalld service, you **must** add the _–permanent_ flag to your commands. The examples here only change the firewall until one of those events next happens. +**重要**:如果想要在系统重启或是 firewalld 服务重启后,配置仍然生效,**必须**在命令中加上 _–permanent_ 选项。本文中的例子只是临时修改了配置,下次遇到系统重启或是 firewalld 服务重启,这些配置就失效了。 -These are just some of the many functions of the _firewall-cmd_ utility and the firewalld service. There is much more information on firewalld at the project’s [home page][8] that’s worth reading and trying out. +以上只是 _firewall-cmd_ 和 firewalld 服务诸多功能中的一小部分。firewalld 项目的[主页][8]还有更多信息值得你去探索和尝试。 * * * -_Photo by [Jakob Braun][9] on [Unsplash][10]._ +_Photo by [Jakob Braun][9] on [Unsplash][10]._ -------------------------------------------------------------------------------- @@ -119,7 +119,7 @@ via: https://fedoramagazine.org/control-the-firewall-at-the-command-line/ 作者:[Paul W. Frields][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[tinyeyeser](https://github.com/tinyeyeser) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c9ee649cd76ef3a229fca373bb49904359e72fcc Mon Sep 17 00:00:00 2001 From: tinyeyeser Date: Wed, 8 Apr 2020 13:09:30 +0800 Subject: [PATCH 0188/1809] =?UTF-8?q?translated=20by=20=E5=B0=8F=E7=9C=BC?= =?UTF-8?q?=E5=84=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 好几年不翻译了,都忘了commit流程了.... --- .../tech/20200320 Control the firewall at the command line.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20200320 Control the firewall at the command line.md (100%) diff --git a/sources/tech/20200320 Control the firewall at the command line.md b/translated/tech/20200320 Control the firewall at the command line.md similarity index 100% rename from sources/tech/20200320 Control the firewall at the command line.md rename to translated/tech/20200320 Control the firewall at the command line.md From 71a93c952db70ce2ca2eb6869a62a53944ff0f1e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Apr 2020 13:41:51 +0800 Subject: [PATCH 0189/1809] PRF @geekpi --- ...hich Graphics Card do You Have in Linux.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md b/translated/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md index 68e41c5b9a..e7b5957c9e 100644 --- a/translated/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md +++ b/translated/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md @@ -1,16 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Find Which Graphics Card do You Have in Linux?) [#]: via: (https://itsfoss.com/check-graphics-card-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -如何找出 Linux 中的显卡? +如何知道你的 Linux 用的哪种显卡? ====== -无论是 [Nvidia][1] 还是 [Radeon][2] 或者 Intel,它们都可能在 Linux 中有问题。当你要对图形问题进行故障排除时,首先要了解系统中装有哪种显卡。 +无论是 [Nvidia][1] 还是 [Radeon][2] 或者 Intel,它们的显卡都可能在 Linux 中有问题。当你要对图形问题进行故障排除时,首先要了解系统中装有哪种显卡。 Linux 有几个命令可以检查硬件信息。你可以使用它们来检查你有哪些显卡(也称为视频卡)。让我向你展示一些命令来获取 Linux 中的 GPU 信息。 @@ -20,9 +20,9 @@ Linux 有几个命令可以检查硬件信息。你可以使用它们来检查 #### 使用 lspci 命令查找显卡 -lspci 命令显示通过 [PCI][4](外设组件互连)总线连接的设备的信息。基本上,此命令提供有关系统所有外设的详细信息,从键盘和鼠标到声卡、网卡和显卡。 +`lspci` 命令显示通过 [PCI][4](外设组件互连Peripheral Component Interconnect)总线连接的设备的信息。基本上,此命令提供有关系统从键盘和鼠标到声卡、网卡和显卡的所有外设的详细信息。 -默认情况下,你会有大量的此类外设列表。这就是为什么你需要用 grep 命令过滤显卡的原因: +默认情况下,你会有大量的此类外设列表。这就是为什么你需要用 `grep` 命令过滤出显卡的原因: ``` lspci | grep VGA @@ -31,7 +31,7 @@ lspci | grep VGA 这应该会显示一行有关你显卡的信息: ``` -[email protected]:~$ lspci | grep VGA +abhishek@itsfoss:~$ lspci | grep VGA 00:02.0 VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02) ``` @@ -39,7 +39,7 @@ lspci | grep VGA #### 在 Linux 中使用 lshw 命令获取显卡详细信息 -lspci 命令足以查看你的显卡,但是并不能告诉你很多信息。你可以使用 lshw 命令获取有关它的更多信息。 +`lspci` 命令足以查看你的显卡,但是并不能告诉你很多信息。你可以使用 `lshw` 命令获取有关它的更多信息。 此命令要求你有 root 用户权限。你需要以这种方式查找视频卡(显卡)信息: @@ -50,7 +50,7 @@ sudo lshw -C video 正如你在下面的输出中看到的那样,此命令提供了有关显卡的更多信息,例如时钟频率、位宽、驱动等。 ``` -[email protected]:~$ sudo lshw -C video +abhishek@itsfoss:~$ sudo lshw -C video [sudo] password for abhishek: *-display description: VGA compatible controller @@ -66,7 +66,7 @@ sudo lshw -C video resources: irq:139 memory:db000000-dbffffff memory:90000000-9fffffff ioport:f000(size=64) memory:c0000-dffff ``` -#### 额外的技巧:以图形方式检查显卡详细信息 +#### 附赠技巧:以图形方式检查显卡详细信息 并非必须使用命令行在 Linux 中查找显卡详细信息。大多数 Linux 发行版(或者应该说是桌面环境)在设置中提供了必要的详细信息。 @@ -85,7 +85,7 @@ via: https://itsfoss.com/check-graphics-card-linux/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 00a7bcbfbf88e3e72a57ec2f897ff1011aa0d1f6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Apr 2020 13:42:41 +0800 Subject: [PATCH 0190/1809] PUB @geekpi https://linux.cn/article-12086-1.html --- ...01 How to Find Which Graphics Card do You Have in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200401 How to Find Which Graphics Card do You Have in Linux.md (98%) diff --git a/translated/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md b/published/20200401 How to Find Which Graphics Card do You Have in Linux.md similarity index 98% rename from translated/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md rename to published/20200401 How to Find Which Graphics Card do You Have in Linux.md index e7b5957c9e..6ad35a9367 100644 --- a/translated/tech/20200401 How to Find Which Graphics Card do You Have in Linux.md +++ b/published/20200401 How to Find Which Graphics Card do You Have in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12086-1.html) [#]: subject: (How to Find Which Graphics Card do You Have in Linux?) [#]: via: (https://itsfoss.com/check-graphics-card-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 25a151b514e52a876f69986f63c72f575b14d100 Mon Sep 17 00:00:00 2001 From: tinyeyeser Date: Wed, 8 Apr 2020 13:51:07 +0800 Subject: [PATCH 0191/1809] =?UTF-8?q?translating=20by=20=E5=B0=8F=E7=9C=BC?= =?UTF-8?q?=E5=84=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20200407 How to avoid man-in-the-middle cyber attacks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200407 How to avoid man-in-the-middle cyber attacks.md b/sources/tech/20200407 How to avoid man-in-the-middle cyber attacks.md index 5db0d5c572..c8a72579ef 100644 --- a/sources/tech/20200407 How to avoid man-in-the-middle cyber attacks.md +++ b/sources/tech/20200407 How to avoid man-in-the-middle cyber attacks.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tinyeyeser ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 10b94f2ee3e2b25b6acd18d8e0459134f68cf4ff Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Apr 2020 19:18:16 +0800 Subject: [PATCH 0192/1809] PRF --- ...r Python code should be flat and sparse.md | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/translated/tech/20191224 Why your Python code should be flat and sparse.md b/translated/tech/20191224 Why your Python code should be flat and sparse.md index d1d59b5fc6..23de06e38f 100644 --- a/translated/tech/20191224 Why your Python code should be flat and sparse.md +++ b/translated/tech/20191224 Why your Python code should be flat and sparse.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (caiichenr) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Why your Python code should be flat and sparse) @@ -9,19 +9,20 @@ 为何你的 Python 代码应是扁平与稀疏的 ====== -本文是 Python 之禅特别系列当中的一篇,此篇着眼于其中第五与第六条原则:扁平与稀疏。 -![Digital creative of a browser on the internet][1] -[Python之禅][2] 得名如此,正是由于它那简明扼要的规则被设计出的意图在于让读者进行深入地思考,而绝不单是为编程提供一份易于遵守的指南。 +> 本文是 Python 之禅特别系列的第三篇,此篇着眼于其中第五与第六条原则:扁平与稀疏。 -读后不去三思其意,断然难以体会 Python 之禅的妙处。倘若 Python 之禅仅仅罗列出一组清晰的法则,那法则之间的矛盾只能算作一种错误。然而用作引导读者去为最优方案沉思的工具,矛盾却是绝佳的。 +![](https://img.linux.net.cn/data/attachment/album/202004/08/191645uiniiy56keig95gi.jpg) -### 扁平胜过嵌套 Flat is better than nested. +[Python 之禅][2] 之所以得名,正是由于它那简明扼要的规则被设计出的意图在于让读者进行深入地思考,而绝不单是为编程提供一份易于遵守的指南。 -迫于对缩进的强硬要求,Python 对“扁平化”的需求显然远超它者。其余编程语言为了缓解对缩进的需求,通常会在嵌套结构里加入一种“欺诈”的手段。用以说明此点,不妨一同看看JavaScript。 +读后不去三思其意,断然难以体会 Python 之禅的妙处。倘若 Python 之禅仅仅罗列出一组清晰的法则,那法则之间的矛盾是一种缺憾,然而作为引导读者沉思最优方案沉思的工具,矛盾却是绝佳的。 -JavaScript 是原生异步的,这意味着程序员用 JavaScript 写的代码会用到大量的回调函数。 +### 扁平胜过嵌套Flat is better than nested +迫于对缩进的强硬要求,Python 对“扁平化”的需求显然远超它者。其余编程语言为了缓解对缩进的需求,通常会在嵌套结构里加入一种“作弊”的手段。为了理解这一点,不妨一同来看看 JavaScript。 + +JavaScript 本质上是异步的,这意味着程序员用 JavaScript 写的代码会用到大量的回调函数。 ``` a(function(resultsFromA) { @@ -33,8 +34,7 @@ a(function(resultsFromA) { } ``` -忽略这段代码的具体内容,只去观察这段代码的形状与缩进带来极右点的方式。这种独特的“箭头”图形在我们扫看代码时格外扎眼,这种写法也因此被视作不可取,甚至得到了“回调地狱”的绰号。不过,在 JavaScript 中,这种反映嵌套关系的缩进可以通过“欺诈”来回避。 - +忽略这段代码的具体内容,只去观察这段代码的形状与缩进带来一个最右边的点的方式。这种独特的“箭头”图形在我们扫看代码时格外扎眼,这种写法也因此被视作不可取,甚至得到了“回调地狱”的绰号。不过,在 JavaScript 中,这种反映嵌套关系的缩进可以通过“作弊”来回避。 ``` a(function(resultsFromA) { @@ -46,10 +46,9 @@ c(resultsFromC, }}} ``` -Python 并没有提供这种欺诈手段:每一级嵌套在代码中都如实的对应着一层缩进。因此,Python 深层的嵌套关系在_视觉_上也一定是深层嵌套的。这使得“回调地狱”的问题对于 Python 而言要比在 JavaScript 中严重得多:嵌套的回调函数必定带来缩进,而绝无使用花括号来“欺诈”的可能。 - -这项挑战与 Python 之禅的指导原则相结合后,在我参与的库中催生出了一个优雅的解决方案。我们在 [Twisted][3] 框架里提出了 _deferred_ 抽象,日后 JavaScript 中流行的 _promise_ 抽象亦是受其启发而生。正是由于 Python 对整洁代码的坚守,方能推动 Python 开发者去发掘新的,强力的抽象。 +Python 并没有提供这种作弊手段:每一级嵌套在代码中都如实的对应着一层缩进。因此,Python 深层的嵌套关系在*视觉*上也一定是深层嵌套的。这使得“回调地狱”的问题对于 Python 而言要比在 JavaScript 中严重得多:嵌套的回调函数必定带来缩进,而绝无使用花括号来“作弊”的可能。 +这项挑战与 Python 之禅的指导原则相结合后,在我参与的库中催生出了一个优雅的解决方案。我们在 [Twisted][3] 框架里提出了 deferred 抽象,日后 JavaScript 中流行的 promise 抽象亦是受其启发而生。正是由于 Python 对整洁代码的坚守,方能推动 Python 开发者去发掘新的、强力的抽象。 ``` future_value = future_result() @@ -58,11 +57,11 @@ future_value.addCallback(b) future_value.addCallback(c) ``` -(现代 JavaScript 程序员也许会觉得这段代码十分眼熟:Promises 着实受到了 Twisted 里 deferreds 抽象的深远影响。) +(现代 JavaScript 程序员也许会觉得这段代码十分眼熟:promise 着实受到了 Twisted 里 deferred 抽象的深远影响。) -### 稀疏胜过密集 Sparse is better than dense. +### 稀疏胜过密集Sparse is better than dense -最易降低代码密集程度的方法是引入嵌套。这种习惯也正是有关稀疏的原则要随着前一条提出的原因:在竭尽所能地降低代码密集性之后,我们往往会遗留下_密集_的代码或数据结构。此处的密集,是指塞进过量信息的小段代码,它们会导致错误发生后的解析变得困难。 +最易降低代码密集程度的方法是引入嵌套。这种习惯也正是有关稀疏的原则要随着前一条提出的原因:在竭尽所能地减少嵌套之后,我们往往会遗留下*密集的*代码或数据结构。此处的密集,是指塞进过量信息的小段代码,它们会导致错误发生后的解析变得困难。 这种密集性唯有通过创造性的思考方可改善,此外别无捷径。Python 之禅并不为我们提供简单的解决方案,它只会指明改善代码的方向,而非提供“如何”去做的向导。 @@ -75,7 +74,7 @@ via: https://opensource.com/article/19/12/zen-python-flat-sparse 作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[caiichenr](https://github.com/caiichenr) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8790324ab1a7675e41105fa1c1766972d751bb81 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Apr 2020 19:19:21 +0800 Subject: [PATCH 0193/1809] PUB @caiichenr https://linux.cn/article-12087-1.html --- ...20191224 Why your Python code should be flat and sparse.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191224 Why your Python code should be flat and sparse.md (98%) diff --git a/translated/tech/20191224 Why your Python code should be flat and sparse.md b/published/20191224 Why your Python code should be flat and sparse.md similarity index 98% rename from translated/tech/20191224 Why your Python code should be flat and sparse.md rename to published/20191224 Why your Python code should be flat and sparse.md index 23de06e38f..5f9bf864e6 100644 --- a/translated/tech/20191224 Why your Python code should be flat and sparse.md +++ b/published/20191224 Why your Python code should be flat and sparse.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (caiichenr) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12087-1.html) [#]: subject: (Why your Python code should be flat and sparse) [#]: via: (https://opensource.com/article/19/12/zen-python-flat-sparse) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From 44fa3c9e108bf8a419cb2c5447dfc1752eb8695b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Apr 2020 22:57:27 +0800 Subject: [PATCH 0194/1809] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chunibyo-wly 恭喜你完成了第一篇翻译贡献! --- .../20190612 How to write a loop in Bash.md | 110 +++++++++--------- 1 file changed, 56 insertions(+), 54 deletions(-) diff --git a/translated/tech/20190612 How to write a loop in Bash.md b/translated/tech/20190612 How to write a loop in Bash.md index d17bfdd4b2..99844f15ff 100644 --- a/translated/tech/20190612 How to write a loop in Bash.md +++ b/translated/tech/20190612 How to write a loop in Bash.md @@ -1,31 +1,33 @@ [#]: collector: "lujun9972" [#]: translator: "chunibyo-wly" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "How to write a loop in Bash" [#]: via: "https://opensource.com/article/19/6/how-write-loop-bash" -[#]: author: "Seth Kenlon https://opensource.com/users/seth/users/goncasousa/users/howtopamm/users/howtopamm/users/seth/users/wavesailor/users/seth" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" -# 如何在 Bash 中使用循环 +如何在 Bash 中使用循环 +====== -使用循环和查找命令批量自动处理文件。 -![bash logo on green background][1] +> 使用循环和查找命令批量自动对多个文件进行一系列的操作。 -人们希望学习批处理命令的一个普遍原因是批处理具有强大的功能。如果你希望批量的对文件执行指令,制作一个可以重复运行在那些文件上的命令就是一种方法。在编程术语中,这被称作 _execution control_ ,**for** 循环就是其中最常见的一种。 +![](https://img.linux.net.cn/data/attachment/album/202004/08/225655by8i8k7uyppp18ph.jpg) -**for** 循环可以详细描述你希望你的计算机对 _for_ 遍历的数据对象(比如说文件)所进行的操作。 +人们希望学习批处理命令的一个普遍原因是要得到批处理强大的功能。如果你希望批量的对文件执行一些指令,构造一个可以重复运行在那些文件上的命令就是一种方法。在编程术语中,这被称作*执行控制*,`for` 循环就是其中最常见的一种。 -### 一般循环 +`for` 循环可以详细描述你希望计算机对你指定的每个数据对象(比如说文件)所进行的操作。 -使用循环的一个简单例子是对一组文件进行分析。这个循环可能没什么用,但是这是一个安全的证明自己有能力独立处理文件夹里每一个文件的方法。首先,创建一个文件夹然后拷贝一些文件(例如 JPEG,PNG 等类似的文件)至文件夹中生成一个测试环境。你可以通过文件管理器或者终端来完成创建文件夹和拷贝文件的操作: +### 一般的循环 + +使用循环的一个简单例子是对一组文件进行分析。这个循环可能没什么用,但是这是一个安全的证明自己有能力独立处理文件夹里每一个文件的方法。首先,创建一个文件夹然后拷贝一些文件(例如 JPEG、PNG 等类似的文件)至文件夹中生成一个测试环境。你可以通过文件管理器或者终端来完成创建文件夹和拷贝文件的操作: ```bash $ mkdir example $ cp ~/Pictures/vacation/*.{png,jpg} example ``` -切换到你刚创建的那个文件夹,然后列出文件并确认这个测试环境是你需要的: +切换到你刚创建的那个新文件夹,然后列出文件并确认这个测试环境是你需要的: ``` $ cd example @@ -36,27 +38,27 @@ otago.jpg waterfall.png ``` -在循环中逐一遍历文件的语法是:首先声明一个变量(例如使用 **f** 代表文件),然后定义一个你希望用变量循环的数据集。在这种情况下,使用 **\*** 通配符来遍历当前文件夹下的所有文件(通配符 **\*** 匹配 _一切_)。然后使用一个分号(**;**)来结束这个语句。 +在循环中逐一遍历文件的语法是:首先声明一个变量(例如使用 `f` 代表文件),然后定义一个你希望用变量循环的数据集。在这种情况下,使用 `*` 通配符来遍历当前文件夹下的所有文件(通配符 `*` 匹配*所有文件*)。然后使用一个分号(`;`)来结束这个语句。 ``` -`$ for f in * ;` +$ for f in * ; ``` -取决于你个人的喜好,你可以选择在这里按下 **Return**。在语法完成前,shell 是不会尝试执行这个循环的。 +取决于你个人的喜好,你可以选择在这里按下回车键。在语法完成前,shell 是不会尝试执行这个循环的。 -接下来,定义在每次循环中你想要进行的操作。简单起见,使用 **file** 命令来得到 **f** 变量(使用 **\$** 告诉 shell 使用这个变量的值,无论这个变量现在存储着什么)所存储着的文件的信息: +接下来,定义你想在每次循环中进行的操作。简单起见,使用 `file` 命令来得到 `f` 变量(使用 `$` 告诉 shell 使用这个变量的值,无论这个变量现在存储着什么)所存储着的文件的各种信息: ``` -`do file $f ;` +do file $f ; ``` -使用另一个引号结束这一行,然后关闭这个循环: +使用另一个分号结束这一行,然后关闭这个循环: ``` -`done` +done ``` -按下 **Return** 启动 shell 对当前文件夹下 _所有东西_ 的遍历。**for** 循环将会一个一个的将文件分配给变量 **f** 并且执行你的命令: +按下回车键启动 shell 对当前文件夹下*所有东西*的遍历。`for` 循环将会一个一个的将文件分配给变量 `f` 并且执行你的命令: ``` $ for f in * ; do @@ -82,49 +84,49 @@ waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced ### 一个实用的例子 -下面是一个循环在日常使用中的实用案例。假如你拥有一堆假期拍的照片想要发给你的朋友。它们对于 email 来说太大了,上传到 [photo-sharing service][2] 也不方便。因此你希望创建小型的 web 版本的照片,但是你不希望花费太多时间在一个一个的压缩图片体积上。 +下面是一个循环在日常使用中的实用案例。假如你拥有一堆假期拍的照片想要发给你的朋友。但你的照片太大了,无法通过电子邮件发送,上传到[图片分享服务][2]也不方便。因此你想为你的照片创建小型的 web 版本,但是你不希望花费太多时间在一个一个的压缩图片体积上。 -首先,在你的 Linux,BSD 或者 Mac 上使用包管理器安装 **ImageMagick** 命令。例如,在 Fedora 和 RHEL 上: +首先,在你的 Linux、BSD 或者 Mac 上使用包管理器安装 ImageMagick 命令。例如,在 Fedora 和 RHEL 上: ``` -`$ sudo dnf install ImageMagick` +$ sudo dnf install ImageMagick ``` 在 Ubuntu 和 Debian 上: ``` -`$ sudo apt install ImageMagick` +$ sudo apt install ImageMagick ``` -在 BSD 上,使用 **ports** 或者 [pkgsrc][3]。在 Mac 上,使用 [Homebrew][4] 或者 [MacPorts][5]。 +在 BSD 上,使用 `ports` 或者 [pkgsrc][3] 安装。在 Mac 上,使用 [Homebrew][4] 或者 [MacPorts][5] 安装。 -在你安装了 ImageMagick 之后,你就拥有一系列命令可以用来操作图片了。 +在你安装了 ImageMagick 之后,你就拥有一系列可以用来操作图片的新命令了。 为你将要创建的文件建立一个目标文件夹: ``` -`$ mkdir tmp` +$ mkdir tmp ``` 使用下面的循环可以将每张图片减小至原来大小的 33%。 ``` -`$ for f in * ; do convert $f -scale 33% tmp/$f ; done` +$ for f in * ; do convert $f -scale 33% tmp/$f ; done ``` -然后就可以在 **tmp** 文件夹中看到已经缩小了的照片了。 +然后就可以在 `tmp` 文件夹中看到已经缩小了的照片了。 -你可以在循环体中使用任意数量的命令,因此如果你需要对一批文件进行复杂的操作,可以将你的命令放在一个 **for** 循环的 **do** 和 **done** 声明之间。例如,假设你希望将所有处理过的图片拷贝至你的网站所托管的图片文件夹并且在本地系统移除这些文件: +你可以在循环体中使用任意数量的命令,因此如果你需要对一批文件进行复杂的操作,可以将你的命令放在一个 `for` 循环的 `do` 和 `done` 语句之间。例如,假设你希望将所有处理过的图片拷贝至你的网站所托管的图片文件夹并且在本地系统移除这些文件: ``` $ for f in * ; do -convert $f -scale 33% tmp/$f -scp -i seth_web tmp/$f [seth@example.com][6]:~/public_html -trash tmp/$f ; + convert $f -scale 33% tmp/$f + scp -i seth_web tmp/$f seth@example.com:~/public_html + trash tmp/$f ; done ``` -你的计算机会对 **for** 循环中处理的每一个文件自动的执行 3 条命令。这意味着假如你仅仅处理 10 张图片,也会省下 30 条指令和更多的时间。 +你的计算机会对 `for` 循环中处理的每一个文件自动的执行 3 条命令。这意味着假如你仅仅处理 10 张图片,也会省下输入 30 条指令和更多的时间。 ### 限制你的循环 @@ -136,7 +138,7 @@ $ ls -m tmp cat.jpg, otago.jpg ``` -或者,你希望重复特定次数的某个操作而不仅仅只处理文件。**for** 循环的变量的值是被你赋给它的不管何种类型的数据所决定的,所以你可以创建一个循环遍历数字而不只是文件: +或者,你希望重复特定次数的某个操作而不仅仅只处理文件。`for` 循环的变量的值是被你赋给它的(不管何种类型的)数据所决定的,所以你可以创建一个循环遍历数字而不只是文件: ``` $ for n in {0..4}; do echo $n ; done @@ -149,15 +151,15 @@ $ for n in {0..4}; do echo $n ; done ### 更多循环 -现在你了解的知识已经足够用来创建自己的循环体了。直到你对循环非常熟悉之前,尽可能的在需要处理的文件的 _复制_ 上进行操作。使用固有的保护措施可以预防损坏自己的数据和制造不可复现的错误,例如偶然将一个文件夹下的所有文件重命名为同一个名字,就可能会导致他们的相互覆盖。 +现在你了解的知识已经足够用来创建自己的循环体了。直到你对循环非常熟悉之前,尽可能的在需要处理的文件的*副本*上进行操作。使用内置的保护措施可以预防损坏自己的数据和制造不可复现的错误,例如偶然将一个文件夹下的所有文件重命名为同一个名字,就可能会导致他们的相互覆盖。 -更多的 **for** 循环话题,请继续阅读。 +更进一步的 `for` 循环话题,请继续阅读。 -### Not all shells are Bash 不是所有的 shell 都是 Bash +### 不是所有的 shell 都是 Bash -关键字 **for** 是内置在 Bash shell 中的。许多类似的 shell 会使用和 Bash 同样的关键字和语法,但是也有某些 shell ,比如 [tcsh][7],使用不同的关键字,例如 **foreach**。 +关键字 `for` 是内置在 Bash shell 中的。许多类似的 shell 会使用和 Bash 同样的关键字和语法,但是也有某些 shell ,比如 [tcsh][7],使用不同的关键字,例如 `foreach`。 -tcsh 的语法与 Bash 类似,但是它更为严格。例如在下面的例子中,不要在你的终端的第 2,3 行键入 **foreach?** 。它只是提示你仍处在构建循环的过程中。 +tcsh 的语法与 Bash 类似,但是它更为严格。例如在下面的例子中,不要在你的终端的第 2、3 行键入 `foreach?` 。它只是提示你仍处在构建循环的过程中。 ``` $ foreach f (*) @@ -169,15 +171,15 @@ otago.jpg: JPEG image data, EXIF standard 2.2 waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced ``` -在 tcsh 中,**foreach** 和 **end** 都必须单独的在一行中出现。因此你不能像 Bash 或者其他类似的 shell 一样只使用一行命令创建一个 **for** 循环。 +在 tcsh 中,`foreach` 和 `end` 都必须单独的在一行中出现。因此你不能像 Bash 或者其他类似的 shell 一样只使用一行命令创建一个 `for` 循环。 ### for 循环与 find 命令 -理论上,你可能会用到不支持 **for** 循环的 shell,或者你只是更想使用其他命令的一些特性来完成和循环一样的工作。 +理论上,你可能会用到不支持 `for` 循环的 shell,或者你只是更想使用其他命令的一些特性来完成和循环一样的工作。 -使用**find** 命令是另一个实现 **for** 循环功能的途径。这个命令通过 [Parallel][8] 提供了几种方法来定义你的循环中需要包括的文件的范围。 +使用 `find` 命令是另一个实现 `for` 循环功能的途径。这个命令提供了多种方法来定义循环中包含哪些文件的范围以及[并行][8]处理的选项。 -**find** 命令顾名思义就是帮助你查询存储在硬盘里的文件。他的用法很简单:提供一个你希望它查询的位置的路径,接着 **find** 就会查询这个路径下面的所有文件和文件夹。 +`find` 命令顾名思义就是帮助你查询存储在硬盘里的文件。它的用法很简单:提供一个你希望它查询的位置的路径,接着 `find` 就会查询这个路径下面的所有文件和文件夹。 ``` $ find . @@ -188,7 +190,7 @@ $ find . ./waterfall.png ``` -你可以通过添加名称的某些部分用于过滤搜索结果: +你可以通过添加名称的某些部分来过滤搜索结果: ``` $ find . -name "*jpg" @@ -196,7 +198,7 @@ $ find . -name "*jpg" ./otago.jpg ``` -**find** 命令非常好的地方在于你可以通过 **-exec** 参数标志将它查询到的每一个文件放入循环中。例如,只对存放在你的 example 文件夹下的 PNG 图片进行体积压缩操作: +`find` 命令非常好的地方在于你可以通过 `-exec` 参数标志将它查询到的每一个文件放入循环中。例如,只对存放在你的 `example` 文件夹下的 PNG 图片进行体积压缩操作: ``` $ find . -name "*png" -exec convert {} -scale 33% tmp/{} \; @@ -204,9 +206,9 @@ $ ls -m tmp design_maori.png, waterfall.png ``` -在 **-exec** 短语中,括号 **{}** 表示的是 **find** 正在处理的条目(换句话说,每一个被找到的以 PNG 结尾的文件)。**-exec** 短语必须使用分号结尾,但是 Bash 中常常也会使用分号。为了解决这个二义性问题,你的 **结束符** 可以使用反斜杠加上一个分号(**\;**),使得 **find** 命令可以知道这个结束符是用来标识自己结束使用的。 +在 `-exec` 短语中,括号 `{}` 表示的是 `find` 正在处理的条目(换句话说,每一个被找到的以 PNG 结尾的文件)。`-exec` 短语必须使用分号结尾,但是 Bash 中常常也会使用分号。为了解决这个二义性问题,你的 `结束符` 可以使用反斜杠加上一个分号(`\;`),使得 `find` 命令可以知道这个结束符是用来标识自己结束使用的。 -**find** 命令的操作非常棒,某些情况下它甚至可以表现得更棒。比如说,在一个新的进程中使用同一条命令查找 PNG 文件,你可能就会得到一些错误信息: +`find` 命令的操作非常棒,某些情况下它甚至可以表现得更棒。比如说,在一个新的进程中使用同一条命令查找 PNG 文件,你可能就会得到一些错误信息: ``` $ find . -name "*png" -exec convert {} -flip -flop tmp/{} \; @@ -215,27 +217,27 @@ No such file or directory @ error/blob.c/OpenBlob/2643. ... ``` -看起来 **find** 不只是定位了当前文件夹(**.**)下的所有 PNG 文件,还包括已经处理并且存储到了 **tmp** 下的文件。在一些情况下,你可能希望 **find** 查询当前文件夹下再加上其子文件夹下的所有文件。**find** 命令是一个功能强大的递归工具,特别体现在处理一些文件结构复杂的情境下(比如用来放置存满了音乐人音乐专辑的文件夹),同时你也可以使用 **-maxdepth** 选项来限制最大的递归深度。 +看起来 `find` 不只是定位了当前文件夹(`.`)下的所有 PNG 文件,还包括已经处理并且存储到了 `tmp` 下的文件。在一些情况下,你可能希望 `find` 查询当前文件夹下再加上其子文件夹下的所有文件。`find` 命令是一个功能强大的递归工具,特别体现在处理一些文件结构复杂的情境下(比如用来放置存满了音乐人音乐专辑的文件夹),同时你也可以使用 `-maxdepth` 选项来限制最大的递归深度。 -只在当前文件夹下查找 PNG 文件(不包括子文件夹) +只在当前文件夹下查找 PNG 文件(不包括子文件夹): ``` -`$ find . -maxdepth 1 -name "*png"` +$ find . -maxdepth 1 -name "*png" ``` -上一条命令的最大深度再加 1 就可以查找和处理当前文件夹及下一级子文件夹下面的文件 +上一条命令的最大深度再加 1 就可以查找和处理当前文件夹及下一级子文件夹下面的文件: ``` -`$ find . -maxdepth 2 -name "*png"` +$ find . -maxdepth 2 -name "*png" ``` -**find** 命令默认是查找每一级文件夹。 +`find` 命令默认是查找每一级文件夹。 ### 循环的乐趣与收益 你使用的循环越多,你就可以越多的省下时间和力气,并且可以应对庞大的任务。虽然你只是一个用户,但是通过使用循环,可以使你的计算机完成困难的任务。 -你可以并且应该使用循环就像使用其他的命令一样。在你需要重复的处理单个或多个文件时,尽可能的使用这个命令。无论如何,这也算是一项需要被严肃对待的编程活动,因此如果你需要在一些文件上完成复杂的任务,你应该多花点时间在计划自己的工作流上面。如果你可以在一份文件上完成你的工作,接下来将操作包装进 **for** 循环里就相对简单了,这里面唯一的“编程”的需要只是理解变量是如何工作的并且进行充分的规划工作将已处理过的文件和未处理过的文件分开。经过一段时间的练习,你就可以从一名 Linux 用户升级成一位知道如何使用循环的 Linux 用户,所以开始让计算机为你工作吧! +你可以并且应该就像使用其他的命令一样使用循环。在你需要重复处理单个或多个文件时,尽可能的使用这个命令。无论如何,这也算是一项需要被严肃对待的编程活动,因此如果你需要在一些文件上完成复杂的任务,你应该多花点时间在规划自己的工作流上面。如果你可以在一份文件上完成你的工作,接下来将操作包装进 `for` 循环里就相对简单了,这里面唯一的“编程”的需要只是理解变量是如何工作的并且进行充分的规划工作将已处理过的文件和未处理过的文件分开。经过一段时间的练习,你就可以从一名 Linux 用户升级成一位知道如何使用循环的 Linux 用户,所以开始让计算机为你工作吧! --- @@ -244,7 +246,7 @@ via: https://opensource.com/article/19/6/how-write-loop-bash 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[chunibyo-wly](https://github.com/chunibyo-wly) -校对:[校对者 ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 From a87d9e03019bc8e503b2bfa56fde97be045ef508 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Apr 2020 22:58:46 +0800 Subject: [PATCH 0195/1809] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chunibyo-wly 本文首发地址: https://linux.cn/article-12088-1.html 你的 LCTT 专页地址: https://linux.cn/lctt/chunibyo-wly 请注册以领取你的 LCCN: https://lctt.linux.cn/ --- .../20190612 How to write a loop in Bash.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190612 How to write a loop in Bash.md (99%) diff --git a/translated/tech/20190612 How to write a loop in Bash.md b/published/20190612 How to write a loop in Bash.md similarity index 99% rename from translated/tech/20190612 How to write a loop in Bash.md rename to published/20190612 How to write a loop in Bash.md index 99844f15ff..6649f2b926 100644 --- a/translated/tech/20190612 How to write a loop in Bash.md +++ b/published/20190612 How to write a loop in Bash.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "chunibyo-wly" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-12088-1.html" [#]: subject: "How to write a loop in Bash" [#]: via: "https://opensource.com/article/19/6/how-write-loop-bash" [#]: author: "Seth Kenlon https://opensource.com/users/seth" From 866abac6ddb8c2b80a1e952b14ffbae488790703 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Wed, 8 Apr 2020 23:19:09 +0800 Subject: [PATCH 0196/1809] Update 20190814 9 open source cloud native projects to consider.md --- ...90814 9 open source cloud native projects to consider.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190814 9 open source cloud native projects to consider.md b/sources/tech/20190814 9 open source cloud native projects to consider.md index a543462a0f..6d81cf1762 100644 --- a/sources/tech/20190814 9 open source cloud native projects to consider.md +++ b/sources/tech/20190814 9 open source cloud native projects to consider.md @@ -146,14 +146,16 @@ To get started, visit the [Kubernetes GitHub repository][9], and access its docu ### Prometheus Prometheus is an open source system monitoring and alerting toolkit built at SoundCloud in 2012. Since then, many companies and organizations have adopted Prometheus, and the project has a very active developer and user community. It is now a standalone open source project that is maintained independently of the company. +Prometheus是2012年在SoundCloud上构建的一个开源系统监控和告警工具。之后,许多公司和组织都使用了Prometheus,并且该项目拥有非常活跃的开发者和用户群体。 现在,它是一个独立于公司的独立维护的开源项目。 ![Prometheus’ architecture][21] -Prometheus’ architecture +Prometheus’ architecture Prometheus的架构 The easiest way to think about Prometheus is to visualize a production system that needs to be up 24 hours a day and 365 days a year. No system is perfect, and there are techniques to reduce failures (called fault-tolerant systems). However, if an issue occurs, the most important thing is to identify it as soon as possible. That is where a monitoring tool like Prometheus comes in handy. Prometheus is more than a container-monitoring tool, but it is most popular among cloud-native application companies. In addition, other open source monitoring tools, including [Grafana][22], leverage Prometheus. - +理解Prometheus的最简单方法是可视化一个生产系统,该系统需要24(小时)x365天都可以正常运行。 没有哪个系统是完美的,也有减少故障的技术(称为容错系统)。 但是,如果出现问题,最重要的是尽快识别它。 这就是像Prometheus这样的监控工具的用武之地。Prometheus不仅是容器监控工具,它在云原生应用公司中也最受欢迎。 此外,其他开源监视工具,包括[Grafana][22],都借鉴了Prometheus。 The best way to get started with Prometheus is to check out its [GitHub repo][10]. Running Prometheus locally is easy, but you need to have a container engine installed. You can access detailed documentation on [Prometheus’ website][23]. +开始使用Prometheus的最佳方法是下载其[GitHub仓库][10]。 在本地运行Prometheus很容易,但是您需要安装一个容器引擎。 您可以在[Prometheus网站][23]上查看详细的文档。 ### Envoy From 05a9c3d1eb64fa18e0f7e927e845cd072f8a9664 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Apr 2020 00:57:54 +0800 Subject: [PATCH 0197/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200409=20GNOM?= =?UTF-8?q?E=20Announces=20Community=20Engagement=20Challenge=20Offering?= =?UTF-8?q?=20up=20to=20$65,000=20in=20Rewards?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200409 GNOME Announces Community Engagement Challenge Offering up to -65,000 in Rewards.md --- ...lenge Offering up to -65,000 in Rewards.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20200409 GNOME Announces Community Engagement Challenge Offering up to -65,000 in Rewards.md diff --git a/sources/tech/20200409 GNOME Announces Community Engagement Challenge Offering up to -65,000 in Rewards.md b/sources/tech/20200409 GNOME Announces Community Engagement Challenge Offering up to -65,000 in Rewards.md new file mode 100644 index 0000000000..63de71fec7 --- /dev/null +++ b/sources/tech/20200409 GNOME Announces Community Engagement Challenge Offering up to -65,000 in Rewards.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (GNOME Announces Community Engagement Challenge Offering up to $65,000 in Rewards) +[#]: via: (https://itsfoss.com/gnome-community-engagement-challenge/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +GNOME Announces Community Engagement Challenge Offering up to $65,000 in Rewards +====== + +It’s always good to see several competitions or challenges trying to promote Free and Open-Source Software (FOSS) more than ever. + +In a recent effort by GNOME with the help of [Endless][1], they announced the inaugural GNOME Community Engagement Challenge. + +This Community Challenge is a part of their original announcement of [coding education challenge for which GNOME was granted $500,000 funding by Endless][2] last year. + +The three-phase challenge aims to attract new developers to engage with FOSS and potentially create new/unique solutions that would gain more traction from the next-gen coders. + +The challenge will involve up to $65,000 in cash prizes. Sounds exciting, right? Let’s take a look at some of the details involved in the challenge. + +![][3] + +### Why The GNOME Community Engagement Challenge? + +In their official [press release][4], they mentioned their primary motive for the challenge: + +> “Through the Challenge we hope to reach a diverse audience, to encourage beginning coders to get involved with the FOSS community to help ensure that free software is available long into the future,” said Neil McGovern, GNOME Foundation Executive Director. “What better way to do that than to reach out to the community itself to come up with creative ways to inspire the next generation?” + +As Neil mentioned above, it’s definitely a good idea to reach out to more people (community) to look for creative ways to promote and work on FOSS projects that will leave a significant impact on the open-source community. + +And, rewarding for the ideas in the form of a challenge will easily get the attention needed. + +### Here’s How The Community Challenge Works + +To quote the official announcement: + +> The Challenge will ask entrants to devise creative ways to promote open-source software to coders typically in high school and college. How a submission will achieve this goal has deliberately been left open-ended to encourage unique, novel approaches. + +So, there’s no particular constraint for the type of ideas or projects you can propose and submit. But, it would be wise to read the usual [terms and conditions][5] to know about the submission rules, eligibility, requirements, prize details, and more. + +Here are the key information about the three phases of the challenge as per the announcement: + + * The **first phase** of the Challenge asks entrants to submit a written proposal for their concept no later than **July 1, 2020**. Twenty entries will be chosen to move to the next round and receive **$1000 each**. + * The **second phase** of the Challenge will require proof of concept, with four entries receiving **$5000** and moving onto the final round. + * The final round will call for a deliverable end product, with the winner receiving **$15,000** and the second place finisher receiving **$10,000**. + + + +They plan to announce the winner of the challenge in the spring of 2021. + +You can take a look at their [challenge FAQ][6] and the [official webpage][7] for more details before starting to submit your entry on **April 9th**. The last date of submission is **July 1, 2020**. + +Head to their website to get started and explore more about the challenge. + +[GNOME Community Engagement Challenge][7] + +### Wrapping Up + +I think this is a perfect opportunity for developers to get started with FOSS projects that will end up rewarding them with a good amount of money and help the community at the same time. + +What do you think about the community engagement challenge by GNOME? Feel free to let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gnome-community-engagement-challenge/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.endlessnetwork.com/ +[2]: https://itsfoss.com/endless-gnome-coding-education-challenge/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/gnome-community-challenge.png?ssl=1 +[4]: https://www.gnome.org/news/2020/04/gnome-foundation-and-endless-launch-inaugural-community-engagement-challenge/ +[5]: https://www.gnome.org/challenge/terms/ +[6]: https://www.gnome.org/challenge/faq/ +[7]: https://www.gnome.org/challenge/ From 93b8258f3abaa92e92910980100ed3af91a5d72f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Apr 2020 00:58:29 +0800 Subject: [PATCH 0198/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200409=20Here?= =?UTF-8?q?=E2=80=99s=20How=20to=20Find=20Out=20Which=20Desktop=20Environm?= =?UTF-8?q?ent=20You=20are=20Using?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md --- ...Which Desktop Environment You are Using.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md diff --git a/sources/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md b/sources/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md new file mode 100644 index 0000000000..3a8576fc49 --- /dev/null +++ b/sources/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Here’s How to Find Out Which Desktop Environment You are Using) +[#]: via: (https://itsfoss.com/find-desktop-environment/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Here’s How to Find Out Which Desktop Environment You are Using +====== + +If you are a new Linux user and seeking help in one of the Linux forums, you may be asked this question: + +_**“Which desktop environment are you using?”**_ + +You have an idea about what a desktop environment is but how do you know which one are you using? I’ll tell you how to find it out. I’ll show the command line method first because that is applicable to [all kind of Linux distributions][1]. I’ll also show the graphical way of getting this information. + +### Check which desktop environment you are using + +![][2] + +You can [use the echo command in Linux][3] to display the value of XDG_CURRENT_DESKTOP variable in the terminal. + +Open the terminal and copy paste this command: + +``` +echo $XDG_CURRENT_DESKTOP +``` + +For example, it shows that I am using [GNOME desktop][4] in [Ubuntu 20.04][5]: + +``` +[email protected]:~$ echo $XDG_CURRENT_DESKTOP +ubuntu:GNOME +``` + +While this command quickly tells you which desktop environment is being used, it doesn’t give any other information. + +Knowing the version of desktop environment (also called DE) could be important in some cases. Each new version of a software brings new features or removes some. [GNOME 3.36][6] introduces a ‘Do Not Disturb’ option to toggle off all the desktop notifications. + +Suppose you read about this new Do Not Disturb feature. You verify that you are using GNOME and yet you don’t see this option in your GNOME desktop. If you could check the GNOME desktop version you have installed on your system, that could make things clear for you. + +I’ll show you the commands to check the desktop environment’s version first because you can use it in any Linux, running desktop environment. + +### How to get desktop environment version + +Unlike getting the name of desktop environment. getting its version number is not straightforward because there is no standard command or environment variable that could give this information. + +One way to get the desktop environment information in Linux is by using a tool like [Screenfetch][7]. This [command line tool displays the logo of your Linux distribution in ascii format][8] along with a few basic system information. Desktop environment version is one of them. + +In Ubuntu based distributions, you can install Screenfetch by [enabling Universe repository][9] and then using this command: + +``` +sudo apt install screenfetch +``` + +For other Linux distributions, please use your system’s package manager to install this program. + +Once installed, simply type screenfetch in the terminal and it should show the desktop environment version along with other system information. + +![Check Desktop Environment Version][10] + +As you can see in the above image, my system is using GNOME 3.36.1 (basically GNOME 3.36). You can also [check the Linux kernel version][11] and other details here. + +Please keep in mind that it is not necessary that Screenfetch will display the desktop environment version. I checked its source code and it has lots of if-else code to get the version information from a number of sources and parameters in various desktop environments. If it can find nothing on version, it just displays the DE name. + +### Using GUI to check desktop environment version + +Almost all desktop environments provide basic system details in their Settings-About section. + +The one major problem is that most DEs look different and thus I cannot show the exact steps for each of them. I am going to show it for GNOME and I let you discover it in your desktop. + +So, search for Settings in the menu (press Windows key and search): + +![Search for Settings application][12] + +In here, go to the bottom to find the About section. Click on it and you should have the desktop environment along with its version. + +![Check Desktop Environment in Ubuntu][13] + +As you can see, it shows that my system is using GNOME 3.36. + +I hope you find this quick beginner tip useful. If you have questions or suggestions, please leave a comment below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/find-desktop-environment/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/what-is-linux/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/check-desktop-environment.jpg?ssl=1 +[3]: https://linuxhandbook.com/echo-command/ +[4]: https://www.gnome.org/ +[5]: https://itsfoss.com/ubuntu-20-04-release-features/ +[6]: https://itsfoss.com/gnome-3-36-release/ +[7]: https://github.com/KittyKatt/screenFetch +[8]: https://itsfoss.com/display-linux-logo-in-ascii/ +[9]: https://itsfoss.com/ubuntu-repositories/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/check-desktop-environment-version.jpg?ssl=1 +[11]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/applications_menu_settings.jpg?ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/check-desktop-environment-ubuntu.jpg?ssl=1 From 5e2dc96d4941fd5da4be5c5feb0e0253815c9947 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Apr 2020 01:01:10 +0800 Subject: [PATCH 0199/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200408=20My?= =?UTF-8?q?=20Linux=20Story:=20From=208-bit=20enthusiast=20to=20Unix=20sys?= =?UTF-8?q?admin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md --- ... From 8-bit enthusiast to Unix sysadmin.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md diff --git a/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md b/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md new file mode 100644 index 0000000000..569981ebea --- /dev/null +++ b/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (My Linux Story: From 8-bit enthusiast to Unix sysadmin) +[#]: via: (https://opensource.com/article/20/4/linux-story) +[#]: author: (James Farrell https://opensource.com/users/jamesf) + +My Linux Story: From 8-bit enthusiast to Unix sysadmin +====== +How my early interest in computers got me hooked on a career as a +sysadmin and Linux fan. +![Person typing on a 1980's computer][1] + +It all started in the mid-1980s with an [Apple ][c][2] that my parents purchased for our family. Although I enjoyed playing games, I quickly became fascinated with BASIC programming and how useful it could be for work and fun. This was an era when computers were viewed as little more than typewriters, so people with "advanced computer skills" could easily use them to their advantage. + +One example was using BASIC and a dot matrix printer to auto-generate punishment assignments. When I was assigned to write out 200 times some apologetic statements, I asked my teacher if it could be typed out. On confirmation, I wrote a 5 line BASIC program to generate it for me. Another example of subtle trickery was using non-WYSIWYG word processors, such as AppleWorks for micro-manipulation of fonts, line spacing, and margins to "stretch" term papers out to the required length. + +My obsession with computers quickly lead to an Apple ][gs with a RAM drive card and an x86 PC co-processor card. Modems and BBSs were getting hot, and having a dual-hardware system like this gave me all sorts of options for software. However, modem speeds of 2400bps put a real damper on getting anything more than a few KBs of fun downloads per day. I stuck with Apple as a hobby for some time, but that was soon to change. + +### Venturing into Unix + +My undergraduate program was BS in Computer Information Systems (CIS) and my graduate degree was MS in Computer Science. My undergraduate education program put me mostly into PCs and a little into timeshare mainframes. The real fun began in my graduate programs, where dial-in access to Unix machines with internet connections opened a whole new world of exploration. Although I still used my dual-processor ][gs for modem work and writing and printing papers, Unix systems really grabbed my attention with their general-access Telnet-based games, FTP archives, online email, and C programming. Gopher was popular and growing with people like me who were bound to plain terminal interfaces. + +My graduate program took a fateful turn for the better when I was assigned to the academic computing department, which was charged with running computer services for the school. The students had access to [Ultrix][3]-based systems with X Window terminals. Most were grayscale, as color processing was then a CPU intensive task and really affected system performance. The few color systems were nice, but those machines just dragged. + +This was a really fun time for me, as I was given root access to systems and assigned to system and network maintenance. I had some excellent mentors, and this strongly influenced my decision to get into system administration rather than programming (although I still really love programming to this day). + +### From Unix to Linux + +Scarcity is the mother of invention, and we students often got creative when we had to share the scant resources of the school's computer systems. We had three to five times more students than we had Ultrix workstations, so finding resources (especially at project delivery time) was often a challenge. There was a bank of 56k [PPP][4] modems available for remote system access when graphical displays were not needed. However, finding a machine with spare resources and sharing the system for source compilation often resulted in slow progress. Like most, I found working at night often helped, but I needed something else to let me iterate more quickly. + +Then one of the school's sysadmins suggested I check out a Unix system that was freely available. This was Linux, made available as 3.5" floppy images. Given our school's blazing fast T1 line, it was easy for me to search newsgroups and other sources to learn how to download it. It was all 32-bit Intel PC-based, a class of equipment that I did not own. + +Luckily, my work at the school gave me access to junk piles of old computers, so the wheels started turning. + +I found enough discarded PCs to build a solid 80386 PC with some decent RAM (I am sure well under 1GB), a workable graphic display, a thin-net (coax) Ethernet card, and a hard disk. The images I had were Linux kernel 0.98, and I don't recall it being part of an official distribution (it might have been SLS). What I do remember is that it came on a series of floppy images—the first booted the kernel and a minimal installer, next it formatted the drive, and then it asked for each successive floppy image to install the core GNU utilities. After the core was installed and the system bootable, you would download and install other package images, like compilers and such. + +This was a serious boon to me in my academic career. With no X Window server display running, this PC seriously outperformed the Ultrix workstations I had access to at school. I was allowed to connect this machine to the academic network, mount the school's student Network File System (NFS) shares, and access the internet directly. Since my graduate program used [GCC][5] (and sometimes Perl 4) for most student work, I could do my development work locally. This gave me exclusive access to a key resource that enabled me to iterate more quickly on my projects. + +All was not perfect, however. The hardware was a tiny bit unstable (likely why it was discarded), but I could deal with that. What really got me was how much Linux and Ultrix differed at the OS and system library level. I began to appreciate what it meant to port software to other platforms; I was free to develop wherever I wanted, but I had to deliver my projects as Ultrix compiled binaries. The C code that ran perfectly on one platform would crash on the other. This was very frustrating, but probably my rudest awakening was early Linux's handling of null-pointer dereferencing. Linux seemed happy to pass over these as a virtual no-op, but Ultrix promptly dumped core on [SIGSEGV][6]. This was quite a thing to find out when my first port to the target platform happened days before my project was due! This also made my exploration of C++ quite challenging, as my careless use of malloc()/free() along with automatic [constructor and destructor][7] processing peppered my projects with null pointer bombs all over the place. + +Toward the end of my graduate program, I upgraded to a complete beast of a workstation—an Intel 486DX2 66MHz with SCSI hard drives, a CD-ROM drive, a 1024x768 RGB monitor, and a 16550 UART serial card perfectly matched to my new US Robotics V.Everything modem. It could dual-boot Windows and Linux, but more importantly, the graphics card and processor allowed a much more pleasant (and faster) development environment. The old 386 was still in service back at the school, but most of my heavy work and hacking now happened at home. + +Similar to [Mike Harris' story][8] about Linux in the '90s, I really got into those CD bundles that were popular at the time. There was a new Micro Center computer store close to where I lived, and it was a goldmine of hobby PC parts, phenomenal technical books, and every conceivable Linux (and free Unix) CD archive. I remember [Yggdrasil][9] and [Slackware][10] being some of my favorite distributions. What was really incredible was the enormous size of CD storage—650MB! This was an essential resource for getting access to software. Yes, you could download the bits at 56k, but that was quite limiting. Not to mention the fact that most people could not afford to archive that much idle data for later perusal. + +### And on to today + +This is what kicked off my more than 25 years of system administration and open source software fun. Linux has been an important part of both my career and personal development. Nowadays, I am still heavily into Linux (mostly CentOS, RedHat, and Ubuntu), but often have fun with the likes of [FreeBSD][11] and other cool open source offerings. + +My forays into Linux led me to Opensource.com, where I hope to give back a little and help bootstrap new generations of hands-on computer fun. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/linux-story + +作者:[James Farrell][a] +选题:[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/jamesf +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) +[2]: https://en.wikipedia.org/wiki/Apple_IIc +[3]: https://en.wikipedia.org/wiki/Ultrix +[4]: https://en.wikipedia.org/wiki/Point-to-Point_Protocol +[5]: https://en.wikipedia.org/wiki/GNU_Compiler_Collection +[6]: https://en.wikipedia.org/wiki/Segmentation_fault +[7]: https://www.tutorialspoint.com/cplusplus/cpp_constructor_destructor.htm +[8]: https://opensource.com/article/19/11/learning-linux-90s +[9]: https://en.wikipedia.org/wiki/Yggdrasil_Linux/GNU/X +[10]: http://slackware.com +[11]: https://www.freebsd.org/ From 12f0a4eb986490c045d60b5cf9783721e9fc4fd7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Apr 2020 01:02:11 +0800 Subject: [PATCH 0200/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200408=20Crea?= =?UTF-8?q?te=20web=20tutorials=20with=20Reveal.js=20and=20Git?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200408 Create web tutorials with Reveal.js and Git.md --- ...te web tutorials with Reveal.js and Git.md | 221 ++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 sources/tech/20200408 Create web tutorials with Reveal.js and Git.md diff --git a/sources/tech/20200408 Create web tutorials with Reveal.js and Git.md b/sources/tech/20200408 Create web tutorials with Reveal.js and Git.md new file mode 100644 index 0000000000..52e34b34e1 --- /dev/null +++ b/sources/tech/20200408 Create web tutorials with Reveal.js and Git.md @@ -0,0 +1,221 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create web tutorials with Reveal.js and Git) +[#]: via: (https://opensource.com/article/20/4/create-web-tutorial-git) +[#]: author: (Eric D. Schabell https://opensource.com/users/eschabell) + +Create web tutorials with Reveal.js and Git +====== +Workshop slides can be viewed consistently on any browser, device, and +platform with this easy workflow. +![Person reading a book and digital copy][1] + +Whether you're a learner or a teacher, you probably recognize the value of online workshops set up like slideshows for communicating knowledge. If you've ever stumbled upon one of these well-organized tutorials that are set up page by page, chapter by chapter, you may have wondered how hard it was to create such a website. + +Well, I'm here to show you how easy it is to generate this type of workshop using a fully automated process. + +### Introduction + +When I started putting my learning content online, it was not a nice, seamless experience. So, I wanted something repeatable and consistent that was also easy to maintain, since my content changes as the technology I teach progresses. + +I tried many delivery models, from low-level code generators, such as [Asciidoctor][2], to laying out a workshop in a single PDF file. All failed to satisfy me. When I deliver live, onsite workshops, I like using slideshows, so I wondered if I could do the same thing for my online, self-paced workshop experiences. + +After some digging, I built a foundation for creating painless workshop websites. It helped that I was already using a presentation-generation framework that resulted in a website-friendly format (HTML). + +### Setting it up + +Here the basic components you need for this project: + + * Workshop idea (this is your problem, can't help you here) + * Reveal.js for the workshop slides + * GitLab project repository + * Your favorite HTML code editor + * Web browser + * Git installed on your machine + + + +If this list looks intimidating, there's a quick way to get started that doesn't involve pulling all the pieces together one by one: You can use my template project to give you a kickstart with the slides and project setup. + +This article assumes you're familiar with Git and projects hosted on a Git platform like GitLab. If you need a refresher or tutorial, check out our [introductory Git series][3]. + +Start by cloning the template project to your local machine: + + +``` +`$ git clone https://gitlab.com/eschabell/beginners-guide-automated-workshops.git` +``` + +Set up a new GitLab project for this and import the template project as the initial import. + +There are a number of important files for the workshop website. In the **root** directory, you'll find a file called **.gitlab-ci.yml**, which is used as a trigger when you commit changes to the master branch (i.e., merge pull requests to **master**). It triggers a copy of the complete contents of the **slides** directory into the GitLab project's **website** folder. + +I have this hosted as a project called **beginners-guide-automated-workshops** in my GitLab account. When it deploys, you can view the contents of the **slides** directory in your browser by navigating to: + + +``` +`https://eschabell.gitlab.io/beginners-guide-automated-workshops` +``` + +For your user account and project, the URL would look like: + + +``` +`https://[YOUR_USERNAME].gitlab.io/[YOUR_PROJECT_NAME]` +``` + +These are the basic materials you need to start creating your website content. When you push changes, they will automatically generate your updated workshop website. Note that the default template contains several example slides, which will be your first workshop website after you complete the full check-in to your repository. + +The workshop template results in a [reveal.js][4] slideshow that can run in any browser, with automatic resizing that allows it to be viewed by almost anyone, anywhere, on any device. + +How's that for creating handy and accessible workshops? + +### How it works + +With this background in place, you're ready to explore the workshop materials and start putting your content together. Everything you need can be found in the project's **slides** directory; this is where all of the magic happens with reveal.js to create the workshop slideshow in a browser. + +The files and directories you'll be working with to craft your workshop are: + + * The **default.css** file + * The **images** directory + * The **index.html** file + + + +Open each one in your favorite HTML/CSS editor and make the changes described below. It does not matter which editor you use; I prefer [RubyMine IDE][5] because it offers a page preview in the local browser. This helps when I'm testing out content before pushing it online to the workshop website. + +#### Default.css file + +The file **css/theme/default.css** is the base file where you will set important global settings for your workshop slides. The two main items of interest are the default font and background image for all slides. + +In **default.css**, look at the section labeled **GLOBAL STYLES**. The current default font is listed in the line: + + +``` +`font-family: "Red Hat Display", "Overpass", san-serif;` +``` + +If you're using a non-standard font type, you must import it (as was done for the Overpass font type) in the line: + + +``` +`@import url('SOME_URL');` +``` + +The **background** is the default image for every slide you create. It is stored in the **images** directory (see below) and set in the line below (focus on the image path): + + +``` +`background: url("…/…/images/backgrounds/basic.png")` +``` + +To set a default background, just point this line to the image you want to use. + +#### Images directory + +As its name implies, the **images** directory is used for storing the images you want to use on your workshop slides. For example, I usually put screenshots that demonstrate the progress of the workshop topic on my individual slides. + +For now, just know that you need to store the background images in a subdirectory (**backgrounds**) and the images you plan to use in your slides in the **Images** directory. + +#### Index.html file + +Now that you have those two files sorted out, you'll spend the rest of your time creating slides in the HTML files, starting with **index.html**. For your workshop website to start taking shape, pay attention to the following three sections in this file: + + * The **head** section, where you set the title, author, and description + * The **body** section, where you find the individual slides to design + * Each **section**, where you define the contents of individual slides + + + +Start with the **head** section, since it's at the top. The template project has three placeholder lines for you to update: + + +``` +<title>INSERT-YOUR-TITLE-HERE</title> +<meta name="description" content="YOUR DESCIPTION HERE."> +<meta name="author" content="YOUR NAME"> +``` + +The **title** tag contains the text that appears in the browser tab when the file is open. Change it to something relevant to the title of your workshop (or maybe a section of your workshop), but remember to keep it short since tab title space is limited. The **description** meta tag contains a short description of your workshop, and the **author** meta tag is where you should put your name (or the workshop creator's name, if you're doing this for someone else). + +Now move on to the **body** section. You'll notice that it's divided into a number of **section** tags. The opening of the **body** contains a comment that explains that you're creating slides for each open and closing tag labeled **section**: + + +``` +<body> +        <div class="reveal"> + +        <!-- Any section element inside of this container is displayed as a slide --> +        <div class="slides"> +``` + +Next, create your individual slides, with each slide enclosed in **section** tags. The template includes a few slides to help you get started. For example, here's the first slide: + + +``` +<section> +      <div style="width: 1056px; height: 300px"> +            <h1>Beginners guide</h1> +            <h2>to automated workshops</h2> +      </div> +      <div style="width: 1056px; height: 200px; text-align: left"> +            Brought to you by,<br/> +            YOUR-NAME<br/> +      </div> +      <aside class="notes">Here are notes: Welcome to the workshop!</aside> +</section> +``` + +This slide has two areas divided with **div** tags. Spacing separates the title and the author. + +Assuming you have some knowledge of using HTML, try various things to develop your workshop. It's really handy to use a browser as you go to preview the results. Some IDEs provide local viewing of changes, but you can also open the **index.html** file and view your changes before pushing them to the repository. + +Once you're satisfied with your workshop, push your changes, and wait for them to pass through the continuous integration pipeline. They'll be hosted like the template project at . + +### Learn more + +To learn more about what you can do with this workflow, check out the following example workshops and sites that host workshop collections. All of these are based on the workflow described in this article. + +Workshop examples: + + * [Red Hat Process Automation Manage workshop][6] + * [JBoss Travel Agency BPM Suite online workshop][7] + + + +Workshop collections: + + * [Rule the world: Practical decisions & process automation development workshops][8] + * [Application development in the cloud workshop][9] + * [Portfolio architecture: Workshops for creating impactful architectural diagrams][10] + + + +I hope this beginner's guide and the template workshop project show you easy and painless it can be to develop and maintain workshop websites in a consistent manner. I also hope this workflow gives your workshop audiences full access to your content on almost any device so they can learn from the knowledge you're sharing. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/create-web-tutorial-git + +作者:[Eric D. Schabell][a] +选题:[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/eschabell +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/read_book_guide_tutorial_teacher_student_apaper.png?itok=_GOufk6N (Person reading a book and digital copy) +[2]: https://asciidoctor.org/ +[3]: https://opensource.com/resources/what-is-git +[4]: https://revealjs.com/#/ +[5]: https://www.jetbrains.com/ruby/ +[6]: https://gitlab.com/bpmworkshop/rhpam-devops-workshop +[7]: https://gitlab.com/bpmworkshop/presentation-bpmworkshop-travel-agency +[8]: https://bpmworkshop.gitlab.io/ +[9]: https://appdevcloudworkshop.gitlab.io/ +[10]: https://redhatdemocentral.gitlab.io/portfolio-architecture-workshops From c1d36e79b154a820e1a9a20e34fb0ad28be44c7d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Apr 2020 01:05:03 +0800 Subject: [PATCH 0201/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200408=20IBM?= =?UTF-8?q?=20taps=20new=20leaders=20for=20hybrid=20cloud=20battles=20ahea?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200408 IBM taps new leaders for hybrid cloud battles ahead.md --- ... leaders for hybrid cloud battles ahead.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/talk/20200408 IBM taps new leaders for hybrid cloud battles ahead.md diff --git a/sources/talk/20200408 IBM taps new leaders for hybrid cloud battles ahead.md b/sources/talk/20200408 IBM taps new leaders for hybrid cloud battles ahead.md new file mode 100644 index 0000000000..fbcb14b32d --- /dev/null +++ b/sources/talk/20200408 IBM taps new leaders for hybrid cloud battles ahead.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IBM taps new leaders for hybrid cloud battles ahead) +[#]: via: (https://www.networkworld.com/article/3536654/ibm-taps-new-leaders-for-hybrid-cloud-battles-ahead.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +IBM taps new leaders for hybrid cloud battles ahead +====== +IBM installs Arvind Krishna as CEO, and appoints Red Hat execs to round out new cloud-oriented team +Stephen Lawson/IDG + +Amid the business chaos COVID-19 is causing, IBM has set its course by [installing][1] Arvind Krishna as CEO and Red Hat CEO Jim Whitehurst as IBM president.  The company also named Red Hat veteran Paul Cormier as CEO of Red Hat. + +Krishna replaces long-time CEO Virginia Rometty, who will  retire at the end of the year, and the package of executive moves solidifies the team that will lead Big Blue into to [hybrid-cloud][2] world where it will battle Amazon, Google and Microsoft. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +Right now, though, that team must also compete in the face the COVID-19 pandemic, an issue [Krishna][4] mentioned in a [letter he posted on LinkedIn][5] on his first day on the job, April 6. + +“During this challenging time, we all need to have empathy, solidarity, and understanding for each other…If there’s one thing that this public health crisis has brought to light it is the ever essential role of IBM in the world. We are the backbone of some of the most critical systems of the world. Our technologies and services help banks run credit-card transactions, businesses run supply chains, telcos connect customers, healthcare providers improve patient care, and companies and cities tackle cyberthreats,” Krishna wrote. + +IBM has been part of the technology community that is helping address COVID-19.  For example, [IBM Research][6] has been developing cloud and AI-powered technologies that can help researchers battle against coronavirus, in part by accelerating COVID-19 drug discovery.  + +IBM is also leading the [COVID-19 High Performance Computing Consortium][7] with AWS, Google, HPE, and Microsoft as well as US National Labs, NASA, and others to bring [high-performance computing][8] systems together to help researchers run massive modeling calculations. + +While COVID-19 is a focus for now, the long term-goal is developing cloud technologies. + +[][9] + +“I believe we can make IBM the most trusted technology partner of the 21st century. For this to happen, we have to ensure that IBM continues to innovate and lead in the transformational journeys our clients are on. Hybrid cloud and AI are two dominant forces driving change for our clients and must have the maniacal focus of the entire company,” he stated. + +### Linux, Kubernetes and containers + +Krishna also wrote about IBM’s strategic cloud directions going forward. “First, we have to deepen our understanding of IBM’s two strategic battles: the journey to hybrid cloud and AI. We all need to understand and leverage IBM’s sources of competitive advantage. Namely, our open source and security leadership, our deep expertise and trust, and the fact that we enable clients to build mission-critical applications once and run them anywhere,” Krishna stated. + +IBM also has to win the battle for architecting the cloud. “There’s a unique window of opportunity for IBM and Red Hat to establish [Linux][10], containers and Kubernetes as the new standard. We can make Red Hat OpenShift the default choice for hybrid cloud in the same way that Red Hat Enterprise Linux is the default choice for the operating system,” Krishna stated. + +When IBM closed its [acquisition][11] of Red Hat last July for $34 billion it was clear it would take on the hybrid-cloud market and now, especially with the current executive team in place, that path is set more solidly. + +Krishna, 57, was a principal architect of IBM’s $34 billion acquisition of Red Hat last year and was IBM’s senior vice president of Cloud and Cognitive Software. Red Hat said Cormier drove more than 25 acquisitions at Red Hat and is credited with pioneering the subscription model that transformed Red Hat from an open-source disruptor to an enterprise-technology mainstay. + +Also as part of the new team, IBM said it tapped Bank of America telecom and cloud-technology executive Howard Boville as senior vice president of cloud platform, overseeing the IBM Cloud. + +Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3536654/ibm-taps-new-leaders-for-hybrid-cloud-battles-ahead.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3518795/ibms-ceo-virginia-rometty-to-be-replaced-by-its-cloud-red-hat-chiefs.html +[2]: https://www.networkworld.com/article/3233132/what-is-hybrid-cloud-computing.html +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.cnbc.com/video/2020/04/06/watch-cnbcs-full-interview-with-new-ibm-ceo-arvind-krishna.html?linkId=85936703 +[5]: https://www.linkedin.com/pulse/my-first-day-ceo-our-journey-together-arvind-krishna/?trackingId=SRWcJy7mSzagoHDTJX%2Br2Q%3D%3D +[6]: https://www.ibm.com/thought-leadership/covid19/ +[7]: https://www.networkworld.com/article/3533426/covid-19-tech-giants-government-agencies-add-supercomputing-to-the-fight.html +[8]: https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html +[9]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[10]: https://www.networkworld.com/article/3215226/what-is-linux-uses-featres-products-operating-systems.html +[11]: https://www.networkworld.com/article/3317517/the-ibm-red-hat-deal-what-it-means-for-enterprises.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From f7dc249bd7b3817adc0b923918bdf6d0c86f6cb6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 9 Apr 2020 08:46:46 +0800 Subject: [PATCH 0202/1809] translated --- ...ow to Use AUR on Arch and Manjaro Linux.md | 140 ------------------ ...ow to Use AUR on Arch and Manjaro Linux.md | 140 ++++++++++++++++++ 2 files changed, 140 insertions(+), 140 deletions(-) delete mode 100644 sources/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md create mode 100644 translated/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md diff --git a/sources/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md b/sources/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md deleted file mode 100644 index 550ac3f9e4..0000000000 --- a/sources/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md +++ /dev/null @@ -1,140 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What is Arch User Repository (AUR)? How to Use AUR on Arch and Manjaro Linux?) -[#]: via: (https://itsfoss.com/aur-arch-linux/) -[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) - -What is Arch User Repository (AUR)? How to Use AUR on Arch and Manjaro Linux? -====== - -If you have been using [Arch Linux][1] or other distribution based on Arch such as Manjaro, you might have comes across the term AUR. You try to install a new software and someone suggests to install it from AUR. This leaves you confused. - -What is this AUR? Why is it used? How to use AUR? I’ll answer these questions in this article. - -### What is AUR? - -![][2] - -AUR stands for Arch User Repository. It is a community-driven repository for Arch-based Linux distributions users. It contains package descriptions named [PKGBUILDs][3] that allow you to compile a package from source with [makepkg][4] and then install it via [pacman][5] (package manager in Arch Linux). - -The AUR was created to organize and share new packages from the community and to help accelerate popular packages’ inclusion into the [community repository][6]. - -A good number of new packages that enter the official repositories start in the AUR. In the AUR, users are able to contribute their own package builds (PKGBUILD and related files). - -The AUR community has the ability to vote for packages in the AUR. If a package becomes popular enough — provided it has a compatible license and good packaging technique — it may be entered into the community repository directly accessible by pacman. - -In short, AUR is the way for developers to make new software available to Arch Linux users before the software is officially included in Arch repositories. - -### Should you use AUR? What’s the risk involved? - -Using the AUR is like crossing the street. If you proceed with caution you should be fine. - -If you are new to Linux it is advised to not to use the AUR until you build a foundation knowledge about Arch/Manjaro and Linux in general. - -It is true that anyone can upload packages to the AUR but the [Trusted Users][7] (TUs) are charged with keeping an eye on what gets uploaded. Although TUs perform quality control to the uploaded packages, there is in no guarantee that packages in the AUR are well formed or not malicious. - -In practice the AUR seems to be quite safe but in theory it can do some damage, but only if you are not careful. A smart Arch user, **always** inspects PKGBUILDs and *.install files when building packages from the AUR. - -Additionally TUs (Trusted Users) also remove packages in the AUR that are included in core/extra/community so there should be no naming conflicts between them. The AUR will often contain developmental versions of packages (cvs/svn/git/etc) but they will have modified names such as foo-git. - -As for the AUR packages, pacman handles dependency resolution and detects file conflicts so you never have to worry about overwriting files in one package with files from another package unless you use the “–force” option by default. If you do that, you probably have more serious problems than file conflicts. - -### How to use AUR? - -The simplest way to use AUR is through a AUR helper. An [AUR helper][8] is a command line tool (some has GUI as well) that lets you search for packages published on the AUR and install them. - -##### Installing an AUR helper on Arch Linux - -Let’s say you want to use [Yay AUR helper][9]. Make sure that you have git installed on Linux. And then clone the repository, go to the directory and build the package. - -Use these commands one by one for that: - -``` -sudo pacman -S git -sudo git clone https://aur.archlinux.org/yay-git.git -cd yay -makepkg -si -``` - -Once installed, you can use yay command like this to install a package: - -``` -yay -S package_name -``` - -It’s not that you must use AUR helper for installing packages from AUR. Expand the next section to see how to use AUR without AUR helper. - -##### Installing AUR packages without AUR helpers - -If you don’t want to use AUR helper, you can install packages from AUR on your own as well. - -As soon as you find the package you want to install on [AUR page][10] it is advised to confirm “Licence”, “Popularity”, “Last Updated”, “Dependencies” and so on as an extra quality control step. - -``` -git clone [package URL] -cd [package name] -makepkg -si -``` - -For example. let’s say you want to install [telegram desktop package][11]: - -``` -git clone https://aur.archlinux.org/telegram-desktop-git.git -cd telegram-desktop-git -makepkg -si -``` - -#### Enabling AUR support in Manjaro Linux - -AUR isn’t enabled by default and you have to enable it through pamac. My laptop runs [Manjaro][12] Cinnamon but the steps are same for all Manjaro flavors. - -Open Pamac (listed as Add/Remove Software): - -![][13] - -Once you are in pamac go to preferences like shown below. - -![][14] - -In preferences dialog box go to AUR tab, enable the AUR support, enable check for updates and close the dialog box. - -![][15] - -You can now search for packages and those which belong to AUR can be identified by the tag under the package descriptions. - -![][16] - -I hope you find this article useful and keep an eye on social media for upcoming Arch related topics. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/aur-arch-linux/ - -作者:[Dimitrios Savvopoulos][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/dimitrios/ -[b]: https://github.com/lujun9972 -[1]: https://www.archlinux.org/ -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/what-is-aur.png?ssl=1 -[3]: https://wiki.archlinux.org/index.php/PKGBUILD -[4]: https://wiki.archlinux.org/index.php/Makepkg -[5]: https://wiki.archlinux.org/index.php/Pacman#Additional_commands -[6]: https://wiki.archlinux.org/index.php/Community_repository -[7]: https://wiki.archlinux.org/index.php/Trusted_Users -[8]: https://itsfoss.com/best-aur-helpers/ -[9]: https://github.com/Jguer/yay -[10]: https://aur.archlinux.org/ -[11]: https://aur.archlinux.org/packages/telegram-desktop-git -[12]: https://manjaro.org/ -[13]: https://i1.wp.com/i.imgur.com/kFF6HtW.png?ssl=1 -[14]: https://i0.wp.com/i.imgur.com/47r963A.png?ssl=1 -[15]: https://i1.wp.com/i.imgur.com/UThiDHO.png?ssl=1 -[16]: https://i2.wp.com/i.imgur.com/RM5BKi2.png?ssl=1 diff --git a/translated/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md b/translated/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md new file mode 100644 index 0000000000..5a44bc4fef --- /dev/null +++ b/translated/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is Arch User Repository (AUR)? How to Use AUR on Arch and Manjaro Linux?) +[#]: via: (https://itsfoss.com/aur-arch-linux/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +什么是 Arch 用户仓库(AUR)?如何在 Arch 和 Manjaro Linux 上使用 AUR? +====== + +如果你一直在使用 [Arch Linux][1] 或其他基于 Arch 的发行版,如 Manjaro,那么可能会遇到 AUR。你尝试安装新软件,有人建议从 AUR 中安装它。这让你感到困惑。 + +什么是 AUR?为什么使用它?如何使用 AUR?我将在本文中回答这些问题。 + +### 什么是 AUR? + +![][2] + +AUR 表示 Arch 用户仓库 (Arch User Repository)。它是针对基于 Arch 的 Linux 发行版用户的社区驱动的仓库。它包含名为 [PKGBUILDs][3] 的包描述,它可让你使用 [makepkg][4] 从源代码编译软件包,然后通过 [pacman][5](Arch Linux 中的软件包管理器)安装。 + +创建 AUR 的目的是组织和共享社区中的新软件包,并帮助加速将流行的软件包纳入[社区仓库][6]。 + +进入官方仓库的大量新软件包都从 AUR 开始。在 AUR 中,用户可以贡献自己的软件包构建(PKGBUILD 和相关文件)。 + +AUR 社区可以对 AUR 中的软件包进行投票。如果一个软件包变得足够流行(假设它具有兼容的许可证和良好的打包技术),那么可以将其加入 pacman 直接访问的社区仓库中。 + +简而言之,AUR 是开发人员在 Arch 仓库中正式包含新软件之前向 Arch Linux 用户提供新软件的一种方式。 + +### 你应该使用 AUR 吗?有什么风险? + +使用 AUR 就像过马路一样。如果你谨慎操作,应该就没问题。 + +如果你刚接触 Linux,建议你在建立有关 Arch/Manjaro 和 Linux 的基础知识之前不要使用 AUR。 + +的确,任何人都可以将软件包上传到 AUR,但[受信任用户][7] (TU) 负责监视上传的内容。尽管 TU 对上传的软件包执行质量控制,但不能保证 AUR 中的软件包格式正确或没有恶意。 + +在实践中,AUR 似乎很安全,但理论上讲它可以造成一定程度的损害,但前提是你不小心。从 AUR 构建软件包时,聪明的 Arch 用户**总是**检查 PKGBUILD 和 *.install 文件。 + +此外,TU(受信任用户)还删除了 AUR 中包含在 core/extra/community 中的软件包,因此它们之间不应存在命名冲突。AUR 通常会包含软件包的开发版本 (cvs/svn/git 等),但它们的名称会被修改,例如 foo-git。 + +对于 AUR软 件包,pacman 会处理依赖关系并检测文件冲突,因此,除非你默认使用 “–force” 选项,否则你不必担心用另一个包中的文件会覆盖另一个包的文件。如果这么做了,你可能会遇到比文件冲突更严重的问题。 + +### 如何使用 AUR? + +使用 AUR 的最简单方法是通过 AUR helper。 [AUR helper][8] 是一个命令行工具(有些还有 GUI),可让你搜索在 AUR 上发布的软件包并安装。 + +##### 在 Arch Linux 上安装 AUR helper + +假设你要使用 [Yay AUR helper][9]。确保在 Linux 上安装了 git。然后克隆仓库,进入目录并构建软件包。 + +依次使用以下命令: + +``` +sudo pacman -S git +sudo git clone https://aur.archlinux.org/yay-git.git +cd yay +makepkg -si +``` + +安装后,你可以使用 yay 命令来安装软件包: + +``` +yay -S package_name +``` + +并非必须使用 AUR helper 来从 AUR 安装软件包。从以下文章解如何在没有 AUR helper 的情况下使用 AUR。 + +##### 不使用 AUR helper 安装 AUR 软件包 + +如果你不想使用 AUR helper,那么也可以自行从 AUR 安装软件包。 + +在 [AUR 页面][10]上找到要安装的软件包后,建议确认“许可证”、“流行程度”、“最新更新”、“依赖项”等,作为额外的质量控制步骤。 + +``` +git clone [package URL] +cd [package name] +makepkg -si +``` + +例如。假设你要安装 [telegram 桌面包][11]: + +``` +git clone https://aur.archlinux.org/telegram-desktop-git.git +cd telegram-desktop-git +makepkg -si +``` + +#### 在 Manjaro Linux 中启用 AUR 支持 + +它默认情况下未启用 AUR,你必须通过 pamac 启用它。我的笔记本电脑运行 [Manjaro][12] Cinnamon,但是所有 Manjaro 变种的步骤都相同。 + +打开 Pamac(列为 “Add/Remove Software”): + +![][13] + +进入 pamac 后,请进入如下所示的首选项。 + +![][14] + +在首选项对话框中,进入 AUR 选项卡,启用 AUR 支持,启用检查更新并关闭对话框。 + +![][15] + +现在,你可以搜索软件包,并且可以通过软件包描述下的标签来识别属于 AUR 的软件包。 + +![][16] + +希望本文对你有用,并关注社交媒体上即将出现的与 Arch 相关的主题。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/aur-arch-linux/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://www.archlinux.org/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/what-is-aur.png?ssl=1 +[3]: https://wiki.archlinux.org/index.php/PKGBUILD +[4]: https://wiki.archlinux.org/index.php/Makepkg +[5]: https://wiki.archlinux.org/index.php/Pacman#Additional_commands +[6]: https://wiki.archlinux.org/index.php/Community_repository +[7]: https://wiki.archlinux.org/index.php/Trusted_Users +[8]: https://itsfoss.com/best-aur-helpers/ +[9]: https://github.com/Jguer/yay +[10]: https://aur.archlinux.org/ +[11]: https://aur.archlinux.org/packages/telegram-desktop-git +[12]: https://manjaro.org/ +[13]: https://i1.wp.com/i.imgur.com/kFF6HtW.png?ssl=1 +[14]: https://i0.wp.com/i.imgur.com/47r963A.png?ssl=1 +[15]: https://i1.wp.com/i.imgur.com/UThiDHO.png?ssl=1 +[16]: https://i2.wp.com/i.imgur.com/RM5BKi2.png?ssl=1 From a900e7f8615b6e1973a7c37389a92597f0c523a8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 9 Apr 2020 09:00:46 +0800 Subject: [PATCH 0203/1809] translating --- ...n UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md b/sources/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md index 20ea7834d6..b540f8995d 100644 --- a/sources/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md +++ b/sources/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 05bf9826af2249895e0c89bc4300de5f0dd2b343 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 9 Apr 2020 09:27:51 +0800 Subject: [PATCH 0204/1809] Rename sources/talk/20200408 IBM taps new leaders for hybrid cloud battles ahead.md to sources/news/20200408 IBM taps new leaders for hybrid cloud battles ahead.md --- ...0200408 IBM taps new leaders for hybrid cloud battles ahead.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{talk => news}/20200408 IBM taps new leaders for hybrid cloud battles ahead.md (100%) diff --git a/sources/talk/20200408 IBM taps new leaders for hybrid cloud battles ahead.md b/sources/news/20200408 IBM taps new leaders for hybrid cloud battles ahead.md similarity index 100% rename from sources/talk/20200408 IBM taps new leaders for hybrid cloud battles ahead.md rename to sources/news/20200408 IBM taps new leaders for hybrid cloud battles ahead.md From 1c4f864f6928f125760885fa88ced6e2cf739fbd Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Thu, 9 Apr 2020 14:26:28 +0800 Subject: [PATCH 0205/1809] =?UTF-8?q?=E7=94=B3=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qfzy1233 is translating --- ...tes in LibreOffice to Save Time and Increase Productivity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md b/sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md index 6eb5183c01..d464f6ccd4 100644 --- a/sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md +++ b/sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qfzy1233 ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d2a7bb8ebffe7ab075e25b3943bfef2699bfb418 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 9 Apr 2020 21:59:54 +0800 Subject: [PATCH 0206/1809] PRF @MjSeven --- ...ing tasks on Linux using the at command.md | 62 +++++++++++-------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/translated/tech/20200403 Scheduling tasks on Linux using the at command.md b/translated/tech/20200403 Scheduling tasks on Linux using the at command.md index 3e44489281..931cf5315e 100644 --- a/translated/tech/20200403 Scheduling tasks on Linux using the at command.md +++ b/translated/tech/20200403 Scheduling tasks on Linux using the at command.md @@ -1,41 +1,42 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Scheduling tasks on Linux using the at command) [#]: via: (https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-using-the-at-command.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -使用 at 命令在 Linu 上安排任务 +使用 at 命令在 Linux 上安排任务 ====== -at 命令可以很容易地安排 Linux 任务在你选择的任何时间或日期运行,让我们来看看它能为你做什么。 -![][0] -romkaz / Getty Images -当你希望命令或脚本在某个特定时间运行时,你不需要将手指放在键盘上盘旋等待按下回车键,或者是在特定时间坐在办公桌前。相反,你可以通过 **at** 命令来设置任务。在本文中,我们将研究如何使用 **at** 来安排任务,如何精确地选择任务希望运行的时间以及如何使用 **at** 来查看安排运行的任务。 +> at 命令可以很容易地安排 Linux 任务在你选择的任何时间或日期运行,让我们来看看它能为你做什么。 + +![][0] + +当你希望命令或脚本在某个特定时间运行时,你不需要将手指放在键盘上盘旋等待按下回车键,或者是在特定时间坐在办公桌前。相反,你可以通过 `at` 命令来设置任务。在本文中,我们将研究如何使用 `at` 来安排任务,如何精确地选择任务希望运行的时间,以及如何使用 `at` 来查看安排运行的任务。 ### at vs cron -对于那些使用 **cron** 在 Linux 系统上安排任务的人来说,**at** 命令类似于 **cron**,因为你可以在选定的时间调度任务,但是 **cron** 用于定期运行的作业 - 甚至是每年仅一次。大多数 **cron** 作业的频率都设置为每天、每周或每月运行一次,不过你可以控制运行的频率和时间。 +对于那些使用 cron 在 Linux 系统上安排任务的人来说,`at` 命令类似于 cron,因为你可以在选定的时间调度任务,但是 cron 用于定期运行的作业 —— 甚至是每年仅一次。大多数 cron 作业的频率都设置为每天、每周或每月运行一次,不过你可以控制运行的频率和时间。 -另一方面,**at** 命令用于仅运行一次的任务。想在午夜重启系统?没问题,假设你有适当的权限,**at** 可以为你完成此操作。如果你希望系统在每个星期六凌晨 2 点重启,那么改用 **cron**。 +另一方面,`at` 命令用于仅运行一次的任务。想在午夜重启系统?没问题,只要你有适当的权限,`at` 可以为你完成此操作。如果你希望系统在每个星期六凌晨 2 点重启,那么改用 cron。 ### 使用 at -**at** 命令很容易使用,只需记住几件事。一个简单使用 **at** 的例子类似于这样: +`at` 命令很容易使用,只需记住几件事。一个简单使用 `at` 的例子类似于这样: + ``` $ at 5:00PM at> date >> thisfile at> ``` -在输入 "at" 和应该运行命令的时间,**at** 会提示你在设定时间会运行该命令(此例中是 **`date`** 命令)。输入 **^D**(Ctrl + d) 来完成请求。 +在输入 `at` 和应该运行命令的时间,`at` 会提示你在设定时间会运行该命令(此例中是 `date` 命令)。输入 `^D`(`Ctrl + d`)来完成请求。 -假设我们在下午 5 点之前设置这个 **at** 命令,那么日期和时间将在当天下午 5 点添加到名为 "thisfile" 文件的末尾。否则,该命令将在第二天下午 5 点运行。 +假设我们在下午 5 点之前设置这个 `at` 命令,那么这个日期和时间将在当天下午 5 点添加到名为 `thisfile` 文件的末尾。否则,该命令将在第二天下午 5 点运行。 -与 **at** 命令进行交互时,可以输入多个命令。如果你要同时运行多个命令,只需输入多个命令行即可: -[][1] +与 `at` 命令进行交互时,可以输入多个命令。如果你要同时运行多个命令,只需输入多个命令行即可: ``` $ at 6:22 @@ -45,9 +46,9 @@ at> echo second >> thisfile at> ``` -在上面的命令中,我们使用了一个普通的用户账户,将一些简单的文本添加到该用户主目录的文件中。如果在上午 6:22 之后运行这些命令,那么命令会在第二天运行,因为 6:22 表示上午 6:22。如果你想在下午 6:22 运行,使用 6:22 PM 或者 18:22,"6:22 PM" 也可以。 +在上面的命令中,我们使用了一个普通的用户账户,将一些简单的文本添加到该用户主目录的文件中。如果在上午 6:22 之后运行这些命令,那么命令会在第二天运行,因为 6:22 表示上午 6:22。如果你想在下午 6:22 运行,使用 `6:22 PM` 或者 `18:22`。`6:22 PM` 这样也是可以工作的。 -你也可以通过使用 **at** 来安排命令在指定的日期或时间运行,例如 "10:00AM April 15 2021" 或 "noon + 5 days"(从今天起 5 天内的中午运行),以下是一些例子: +你也可以通过使用 `at` 来安排命令在指定的日期或时间运行,例如 `10:00AM April 15 2021` 或 `noon + 5 days`(从今天起 5 天内的中午运行),以下是一些例子: ``` at 6PM tomorrow @@ -56,7 +57,8 @@ at noon + 5 days at 9:15 + 1000 days ``` -在指定要运行的命令并按下 **^D** 后,你会注意到 **at** 命令为每个请求分配了一个作业编号,这个数字将显示在 **at** 命令的作业队列中。 +在指定要运行的命令并按下 `^D` 后,你会注意到 `at` 命令为每个请求分配了一个作业编号,这个数字将显示在 `at` 命令的作业队列中。 + ``` $ at noon + 1000 days warning: commands will be executed using /bin/sh @@ -67,7 +69,8 @@ job 36 at Tue Dec 27 12:00:00 2022 <== job # is 36 ### 检查队列 -你可以使用 **atq**(at queue) 命令来查看 **at** 作业队列: +你可以使用 `atq`(at queue)命令来查看 `at` 作业队列: + ``` $ atq 32 Thu Apr 2 03:06:00 2020 a shs @@ -76,7 +79,8 @@ $ atq 34 Thu Apr 2 18:00:00 2020 a shs ``` -如果你需要取消队列中的一个作业,使用 **atrm**(at remote) 命令和作业编号: +如果你需要取消队列中的一个作业,使用 `atrm`(at remove)命令和作业编号: + ``` $ atrm 32 $ atq @@ -85,7 +89,8 @@ $ atq 34 Thu Apr 2 18:00:00 2020 a shs ``` -你可以使用 **at -c** 命令来查看安排任务的详细信息,其它详细信息(活动的搜索路径等)也可以,但是输出的最后一行将显示计划运行的命令。 +你可以使用 `at -c` 命令来查看安排任务的详细信息,其它详细信息(活动的搜索路径等)也可以看到,但是输出的最后一行将显示计划运行的命令。 + ``` $ at -c 36 | tail -6 cd /home/shs || { @@ -95,11 +100,12 @@ cd /home/shs || { date >> thisfile ``` -注意,命令首先会测试是否可以通过 **cd** 命令进入用户目录。如果不可以,作业将退出并显示错误。如果可以,则运行在 **at** 中指定的命令。它将命令视为 “进入 /home/shs 或退出并显示错误”。 +注意,该命令显示首先会测试是否可以通过 `cd` 命令进入用户目录。如果不可以,作业将退出并显示错误。如果可以,则运行在 `at` 中指定的命令。它将命令视为 “进入 `/home/shs` 或退出并显示错误”。 ### 以 root 身份运行作业 -要以 root 身份运行 **at** 作业,只需将 **sudo** 与你的 **at** 命令一起使用,如下所示: +要以 root 身份运行 `at` 作业,只需将 `sudo` 与你的 `at` 命令一起使用,如下所示: + ``` $ sudo at 8PM [sudo] password for shs: @@ -109,7 +115,8 @@ at> job 37 at Wed Apr 1 16:00:00 2020 ``` -注意,root 的任务以 **root** 作为执行者显示在队列中。 +注意,root 的任务以 `root` 作为执行者显示在队列中。 + ``` 35 Mon Apr 6 12:00:00 2020 a shs 36 Tue Dec 27 12:00:00 2022 a shs @@ -118,7 +125,8 @@ job 37 at Wed Apr 1 16:00:00 2020 ### 运行脚本 -你还可以使用 **at** 命令来运行脚本,这里有一个例子: +你还可以使用 `at` 命令来运行脚本,这里有一个例子: + ``` $ at 4:30PM warning: commands will be executed using /bin/sh @@ -128,11 +136,11 @@ at> ### 禁止使用 at 命令 -**/etc/at.deny** 文件提供了一种禁止用户使用 **at** 命令的方法。默认情况下,它可能会包含一个不允许的账户列表,例如 **ftp** 和 **nobody**。可以使用 **/etc/at.allow** 文件执行相反的操作,但是通常只配置 **at.deny** 文件。 +`/etc/at.deny` 文件提供了一种禁止用户使用 `at` 命令的方法。默认情况下,它可能会包含一个不允许的账户列表,例如 `ftp` 和 `nobody`。可以使用 `/etc/at.allow` 文件执行相反的操作,但是通常只配置 `at.deny` 文件。 -**总结** +### 总结 -当你要安排一项一次性任务时,无论你是希望在今天下午或几年后运行,**at** 命令都是通用且易于使用的。 +当你要安排一项一次性任务时,无论你是希望在今天下午或几年后运行,`at` 命令都是通用且易于使用的。 -------------------------------------------------------------------------------- @@ -141,7 +149,7 @@ via: https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-usin 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3d60cfd54eca04e65167978d96ba8bf49077d987 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 9 Apr 2020 22:00:19 +0800 Subject: [PATCH 0207/1809] PUB @MjSeven https://linux.cn/article-12092-1.html --- ...20200403 Scheduling tasks on Linux using the at command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200403 Scheduling tasks on Linux using the at command.md (98%) diff --git a/translated/tech/20200403 Scheduling tasks on Linux using the at command.md b/published/20200403 Scheduling tasks on Linux using the at command.md similarity index 98% rename from translated/tech/20200403 Scheduling tasks on Linux using the at command.md rename to published/20200403 Scheduling tasks on Linux using the at command.md index 931cf5315e..5c692a68ef 100644 --- a/translated/tech/20200403 Scheduling tasks on Linux using the at command.md +++ b/published/20200403 Scheduling tasks on Linux using the at command.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12092-1.html) [#]: subject: (Scheduling tasks on Linux using the at command) [#]: via: (https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-using-the-at-command.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From acc77f3db0ac59a5d547d084120b22e027ed65de Mon Sep 17 00:00:00 2001 From: MFG <48886453+MFGJT@users.noreply.github.com> Date: Thu, 9 Apr 2020 22:15:14 +0800 Subject: [PATCH 0208/1809] Update and rename sources/tech/20190116 Best Audio Editors For Linux.md to translated/20190116 Best Audio Editors For Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完毕 --- .../20190116 Best Audio Editors For Linux.md | 156 ------------------ .../20190116 Best Audio Editors For Linux.md | 155 +++++++++++++++++ 2 files changed, 155 insertions(+), 156 deletions(-) delete mode 100644 sources/tech/20190116 Best Audio Editors For Linux.md create mode 100644 translated/20190116 Best Audio Editors For Linux.md diff --git a/sources/tech/20190116 Best Audio Editors For Linux.md b/sources/tech/20190116 Best Audio Editors For Linux.md deleted file mode 100644 index 3b14f5b366..0000000000 --- a/sources/tech/20190116 Best Audio Editors For Linux.md +++ /dev/null @@ -1,156 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MFGJT) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Best Audio Editors For Linux) -[#]: via: (https://itsfoss.com/best-audio-editors-linux) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Best Audio Editors For Linux -====== - -You’ve got a lot of choices when it comes to audio editors for Linux. No matter whether you are a professional music producer or just learning to create awesome music, the audio editors will always come in handy. - -Well, for professional-grade usage, a [DAW][1] (Digital Audio Workstation) is always recommended. However, not everyone needs all the functionalities, so you should know about some of the most simple audio editors as well. - -In this article, we will talk about a couple of DAWs and basic audio editors which are available as **free and open source** solutions for Linux and (probably) for other operating systems. - -### Top Audio Editors for Linux - -![Best audio editors and DAW for Linux][2] - -We will not be focusing on all the functionalities that DAWs offer – but the basic audio editing capabilities. You may still consider this as the list of best DAW for Linux. - -**Installation instruction:** You will find all the mentioned audio editors or DAWs in your AppCenter or Software center. In case, you do not find them listed, please head to their official website for more information. - -#### 1\. Audacity - -![audacity audio editor][3] - -Audacity is one of the most basic yet a capable audio editor available for Linux. It is a free and open-source cross-platform tool. A lot of you must be already knowing about it. - -It has improved a lot when compared to the time when it started trending. I do recall that I utilized it to “try” making karaokes by removing the voice from an audio file. Well, you can still do it – but it depends. - -**Features:** - -It also supports plug-ins that include VST effects. Of course, you should not expect it to support VST Instruments. - - * Live audio recording through a microphone or a mixer - * Export/Import capability supporting multiple formats and multiple files at the same time - * Plugin support: LADSPA, LV2, Nyquist, VST and Audio Unit effect plug-ins - * Easy editing with cut, paste, delete and copy functions. - * Spectogram view mode for analyzing frequencies - - - -#### 2\. LMMS - -![][4] - -LMMS is a free and open source (cross-platform) digital audio workstation. It includes all the basic audio editing functionalities along with a lot of advanced features. - -You can mix sounds, arrange them, or create them using VST instruments. It does support them. Also, it comes baked in with some samples, presets, VST Instruments, and effects to get started. In addition, you also get a spectrum analyzer for some advanced audio editing. - -**Features:** - - * Note playback via MIDI - * VST Instrument support - * Native multi-sample support - * Built-in compressor, limiter, delay, reverb, distortion and bass enhancer - - - -#### 3\. Ardour - -![Ardour audio editor][5] - -Ardour is yet another free and open source digital audio workstation. If you have an audio interface, Ardour will support it. Of course, you can add unlimited multichannel tracks. The multichannel tracks can also be routed to different mixer tapes for the ease of editing and recording. - -You can also import a video to it and edit the audio to export the whole thing. It comes with a lot of built-in plugins and supports VST plugins as well. - -**Features:** - - * Non-linear editing - * Vertical window stacking for easy navigation - * Strip silence, push-pull trimming, Rhythm Ferret for transient and note onset-based editing - - - -#### 4\. Cecilia - -![cecilia audio editor][6] - -Cecilia is not an ordinary audio editor application. It is meant to be used by sound designers or if you are just in the process of becoming one. It is technically an audio signal processing environment. It lets you create ear-bending sound out of them. - -You get in-build modules and plugins for sound effects and synthesis. It is tailored for a specific use – if that is what you were looking for – look no further! - -**Features:** - - * Modules to achieve more (UltimateGrainer – A state-of-the-art granulation processing, RandomAccumulator – Variable speed recording accumulator, -UpDistoRes – Distortion with upsampling and resonant lowpass filter) - * Automatic Saving of modulations - - - -#### 5\. Mixxx - -![Mixxx audio DJ ][7] - -If you want to mix and record something while being able to have a virtual DJ tool, [Mixxx][8] would be a perfect tool. You get to know the BPM, key, and utilize the master sync feature to match the tempo and beats of a song. Also, do not forget that it is yet another free and open source application for Linux! - -It supports custom DJ equipment as well. So, if you have one or a MIDI – you can record your live mixes using this tool. - -**Features** - - * Broadcast and record DJ Mixes of your song - * Ability to connect your equipment and perform live - * Key detection and BPM detection - - - -#### 6\. Rosegarden - -![rosegarden audio editor][9] - -Rosegarden is yet another impressive audio editor for Linux which is free and open source. It is neither a fully featured DAW nor a basic audio editing tool. It is a mixture of both with some scaled down functionalities. - -I wouldn’t recommend this for professionals but if you have a home studio or just want to experiment, this would be one of the best audio editors for Linux to have installed. - -**Features:** - - * Music notation editing - * Recording, Mixing, and samples - - - -### Wrapping Up - -These are some of the best audio editors you could find out there for Linux. No matter whether you need a DAW, a cut-paste editing tool, or a basic mixing/recording audio editor, the above-mentioned tools should help you out. - -Did we miss any of your favorite? Let us know about it in the comments below. - - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/best-audio-editors-linux - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Digital_audio_workstation -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/linux-audio-editors-800x450.jpeg?resize=800%2C450&ssl=1 -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/audacity-audio-editor.jpg?fit=800%2C591&ssl=1 -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/lmms-daw.jpg?fit=800%2C472&ssl=1 -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/ardour-audio-editor.jpg?fit=800%2C639&ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/cecilia.jpg?fit=800%2C510&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/mixxx.jpg?fit=800%2C486&ssl=1 -[8]: https://itsfoss.com/dj-mixxx-2/ -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/rosegarden.jpg?fit=800%2C391&ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/linux-audio-editors.jpeg?fit=800%2C450&ssl=1 diff --git a/translated/20190116 Best Audio Editors For Linux.md b/translated/20190116 Best Audio Editors For Linux.md new file mode 100644 index 0000000000..827d5bc3da --- /dev/null +++ b/translated/20190116 Best Audio Editors For Linux.md @@ -0,0 +1,155 @@ +[#]: collector: (lujun9972) +[#]: translator: (MFGJT) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Best Audio Editors For Linux) +[#]: via: (https://itsfoss.com/best-audio-editors-linux) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Linux 上最好的音频编辑工具 +====== + +在 Linux 上,有很多种音频编辑器可供你选用。不论你是一个专业的音乐制作人,还是只想学学怎么做出超棒的音乐的爱好者,这些强大的音频编辑器都是很有用的工具。 + +对于专业级的使用,我总是建议使用 [DAW][1] (数码音频工作站)。但并不是所有人都需要全部的功能,所以你也应该了解一些最简单的音频编辑器。 + +在本文中,我们将讨论几个 DAW 和基础的音频编辑器,而且它们都是在 Linux 和(很有可能)其它操作系统上可以使用的**免费并开源**的音频编辑方案。 + +### Linux 上的最佳音频编辑器 + +![Best audio editors and DAW for Linux][2] + +我们不会关注 DAW 提供的所有功能,而只是关注基本的音频编辑功能。不过,你仍然可以把以下内容看作是 Linux 的最佳 DAW 名单。 + +**安装说明:**你可以在 AppCenter 或 Software center 中找到所有提到的音频编辑器或daw。如果你在这两个地方没有找到它们,请前往它们的官方网站获取更多信息。 + +#### 1\. Audacity + +![Audacity audio editor][3] + +Audacity 是 Linux 中最基本音频编辑器之一,但是它也很强大。它是一个免费的开源跨平台工具。肯定已经有很多人了解这个软件了。 + +现在的它相比它最初流行的时候有了很大的改进。我记得我以前试着通过从音频中去除人声来制作卡拉OK伴奏。现在有些时候,你仍然可以这么做。 + +**特性:** + +它还支持包含 VST 效果的插件。当然,你不应该期望它支持 VST 设备。 + + * 通过麦克风或混音器进行现场录制 + * 支持同时从多种音频格式的文件中批量导出/导入内容 + * 支持 LADSPA,LV2,Nyquist,VST 和 Audio Unit 的效果插件 + * 使用简单,带有剪切、粘贴、删除和拷贝的功能 + * 可观测声音频率的频谱模式 + + + +#### 2\. LMMS + +![LMMS audio editor][4] + +LMMS 是一个免费的开源(跨平台)数码音频工作站。它包括所有基本的音频编辑功能以及许多高级功能。 + +你可以混音,组合音频,或使用 VST 设备创造音频。 LMMS 支持这些功能。此外,它还自带一些样本音频,预设,VST 设备和特效来帮助你起步。创建音频。此外,你还可以得到一个频谱分析仪,以便进行高级的音频编辑工作。 + +**特性:** + + * 基于 MIDI 的音符回放 + * 支持 VST 设备 + * 支持多样本 + * 内置压缩器,限制器,延迟功能,混响功能,失真功能和低音增强器 + + + +#### 3\. Ardour + +![Ardour audio editor][5] + +Ardour 是另一个免费和开源的数码音频工作站。只要你有音频接口,Ardour 就支持它的使用。当然,你也可以无限地添加多通道音轨。这些多通道音轨也可以被指派到不同的混音带,以方便编辑和录音。 + +你也可以导入一个视频,编辑其中的音频,然后导出新的视频和音频。它提供了许多内置插件,并且支持 VST 插件。 + +**特性:** + + * 非线性编辑 + * 垂直窗口堆叠,简单的页面导航 + * 静默消除功能(strip silence),推拉修剪功能(push-pull trimming),和用以短暂片段或基于基于音符开始的编辑的 Rhythm Ferret。 + + + +#### 4\. Cecilia + +![Cecilia audio editor][6] + +Cecilia 不是一个普通的音频编辑器。它的使用者一般是音效设计师或者正在努力成为音效设计师的人。 Cecilia 实际上是一个音频信号处理环境。它可以让你的作品余音绕梁。 + +你还可以得到内置的音效与合成模组和插件。 Cecilia 为一个明确的目的而生:如果你正在找音效设计工具,这是你的不二之选! + +**特性:** + + * 利用模块来完成更多工作(UltimateGrainer——最先进的颗粒化处理工具,RandomAccumulator——记录变量速度的累加器,UpDistoRes——通过上采样和谐振低通滤波器创造失真效果的工具) + * 自动保存调制设定 + + + +#### 5\. Mixxx + +![Mixxx audio DJ][7] + +如果你想要在混合和录制一些东西的同时能够有一个虚拟的 DJ 工具,[Mixxx][8] 将是完美的工具。你可以用到 BPM,key,并使用主同步功能来匹配歌曲的节奏和节拍。另外,不要忘记它也是一个 Linux 的免费并开源的软件。 + +它还支持自定义 DJ 设备。所以,如果你有 DJ 设备或着 MIDI,你可以用这个工具录制你的现场混音。 + +**特性:** + + * 播送和录制你的歌曲的 DJ 混音 + * 可以连接到你的设备并且现场演奏 + * Key 检测和 BPM 检测 + + + +#### 6\. Rosegarden + +![Rosegarden audio editor][9] + +Rosegarden 是另一个令人赞叹的 Linux 的免费并开源的音频编辑器。它既不是一个功能齐全的 DAW,也不是一个基本的音频编辑工具。它是两者的混合体,并带有一些缩减的功能。 + +我不会向专业人士推荐这款软件,但如果你经营家庭音乐工作室或只是想体验一下,这将是 Linux 上可以安装的最好的音频编辑器之一。 + +**特性:** + + * 乐谱编辑 + * 记录、混合以及样本功能 + + + +#### 小结 + +这些是你可以找到的 Linux 上的最棒的一些音频编辑器了。不论你是需要 DAW,一个剪切/粘贴的编辑工具,或者仅仅想要一个拥有基础混音和录音功能的音频编辑工具,上述软件都能够满足你的需求。 + +如果在这篇文章中我们遗漏了你最喜欢的一些音频工具,可以在原文下方评论中回复告诉我们。 + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-audio-editors-linux + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[MFGJT](https://github.com/MFGJT) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Digital_audio_workstation +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/linux-audio-editors-800x450.jpeg?resize=800%2C450&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/audacity-audio-editor.jpg?fit=800%2C591&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/lmms-daw.jpg?fit=800%2C472&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/ardour-audio-editor.jpg?fit=800%2C639&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/cecilia.jpg?fit=800%2C510&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/mixxx.jpg?fit=800%2C486&ssl=1 +[8]: https://itsfoss.com/dj-mixxx-2/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/rosegarden.jpg?fit=800%2C391&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/linux-audio-editors.jpeg?fit=800%2C450&ssl=1 From ceb3ab7530525e35f7a787d0895871689638eb8b Mon Sep 17 00:00:00 2001 From: MFG <48886453+MFGJT@users.noreply.github.com> Date: Thu, 9 Apr 2020 22:17:11 +0800 Subject: [PATCH 0209/1809] Update 20190116 Best Audio Editors For Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正一处空格 --- translated/20190116 Best Audio Editors For Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/20190116 Best Audio Editors For Linux.md b/translated/20190116 Best Audio Editors For Linux.md index 827d5bc3da..4a6557edf2 100644 --- a/translated/20190116 Best Audio Editors For Linux.md +++ b/translated/20190116 Best Audio Editors For Linux.md @@ -12,7 +12,7 @@ Linux 上最好的音频编辑工具 在 Linux 上,有很多种音频编辑器可供你选用。不论你是一个专业的音乐制作人,还是只想学学怎么做出超棒的音乐的爱好者,这些强大的音频编辑器都是很有用的工具。 -对于专业级的使用,我总是建议使用 [DAW][1] (数码音频工作站)。但并不是所有人都需要全部的功能,所以你也应该了解一些最简单的音频编辑器。 +对于专业级的使用,我总是建议使用 [DAW][1](数码音频工作站)。但并不是所有人都需要全部的功能,所以你也应该了解一些最简单的音频编辑器。 在本文中,我们将讨论几个 DAW 和基础的音频编辑器,而且它们都是在 Linux 和(很有可能)其它操作系统上可以使用的**免费并开源**的音频编辑方案。 From 60085b9ae2d62f05f354c71fa44b98a5179d31d9 Mon Sep 17 00:00:00 2001 From: MFG <48886453+MFGJT@users.noreply.github.com> Date: Thu, 9 Apr 2020 22:20:38 +0800 Subject: [PATCH 0210/1809] Update and rename translated/20190116 Best Audio Editors For Linux.md to translated/tech/20190116 Best Audio Editors For Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正一处格式,修正路径 --- translated/{ => tech}/20190116 Best Audio Editors For Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename translated/{ => tech}/20190116 Best Audio Editors For Linux.md (97%) diff --git a/translated/20190116 Best Audio Editors For Linux.md b/translated/tech/20190116 Best Audio Editors For Linux.md similarity index 97% rename from translated/20190116 Best Audio Editors For Linux.md rename to translated/tech/20190116 Best Audio Editors For Linux.md index 4a6557edf2..7c72129b8d 100644 --- a/translated/20190116 Best Audio Editors For Linux.md +++ b/translated/tech/20190116 Best Audio Editors For Linux.md @@ -22,7 +22,8 @@ Linux 上最好的音频编辑工具 我们不会关注 DAW 提供的所有功能,而只是关注基本的音频编辑功能。不过,你仍然可以把以下内容看作是 Linux 的最佳 DAW 名单。 -**安装说明:**你可以在 AppCenter 或 Software center 中找到所有提到的音频编辑器或daw。如果你在这两个地方没有找到它们,请前往它们的官方网站获取更多信息。 +**安装说明:** +你可以在 AppCenter 或 Software center 中找到所有提到的音频编辑器或daw。如果你在这两个地方没有找到它们,请前往它们的官方网站获取更多信息。 #### 1\. Audacity From a2353f369ff4171bf5bf3b9d0adf69937107163e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 9 Apr 2020 23:04:08 +0800 Subject: [PATCH 0211/1809] PRF @messon007 --- ...in Ubuntu- What is It and How to Use it.md | 138 +++++++++--------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/translated/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md b/translated/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md index f2c2602601..020a06ecf0 100644 --- a/translated/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md +++ b/translated/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md @@ -1,153 +1,153 @@ [#]: collector: (lujun9972) [#]: translator: (messon007) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (The Keyring Concept in Ubuntu: What is It and How to Use it?) [#]: via: (https://itsfoss.com/ubuntu-keyring/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -解读Ubuntu里的密钥环概念 +解读 Ubuntu 里的密钥环概念 ====== -如果您用过[ubuntu里的自动登录功能][1]或者其他的Linux发行版, 您可能遇到过这种弹出消息: - -**请输入密码以解锁您的登录密钥环 - 登录密钥环在您登录系统时未解锁** - -![Enter Password To Unlock Your Login Keyring Ubuntu][2] - -你需要点击多次取消才能让它消失。你可能想知道为什么系统会多次反复提示这个密钥环消息? - -让我来告诉你答案。它其实并没有出错,它只是一个安全特性。 - -奇怪吗?下面就让我来解释下Linux里的密钥环概念。 - -### Linux里的密钥环是什么以及为什么需要它? - ![][3] -在现实生活中您为什么要用钥匙环(也叫[钥匙链][4])? 您用它把一把或多把钥匙串到一起, 以便于携带和查找。 +如果你用过 Ubuntu 或者其他的 Linux 发行版里的[自动登录功能][1], 你可能遇到过这种弹出消息: -Linux里也是类似的。密钥环特性使您的系统可以将各种密码放在一起,并将其保存在一个地方。 +> 请输入密码以解锁你的登录密钥环 +> +> 登录密钥环在你登录系统时未解锁。 -大多数Linux桌面环境像GNOME, KDE, Xfce等采用[gnome的密钥环][5]实现来提供这个功能。 +![Enter Password To Unlock Your Login Keyring Ubuntu][2] -该密钥环保存了ssh密钥,GPG密钥以及使用此功能的应用程序(例如Chromium浏览器)的密钥。 默认情况下,**“密钥环”通过主密码来保护**,该密码通常是帐户的登录密码。 +如果你一直点击取消,它会不断弹出几次才会消失。你可能想知道,为什么你会一直看到这个密钥环信息呢? -系统上的每个用户都有自己的密钥环,(通常)密码与用户帐户本身的密码相同。 当您使用密码登录系统时,您的密匙环将使用您帐户的密码自动解锁。 +让我来告诉你吧。它其实不是错误,而是一个安全特性。 -当您[启用Ubuntu中的自动登录功能时][1]时,就有问题了。这意味着您无需输入密码即可登录系统。 在这种情况下,您的密钥环不会自动解锁。 +奇怪吗?下面就让我来解释下 Linux 里的密钥环概念。 + +### Linux 里的密钥环是什么。为什么需要它? + +在现实生活中你为什么要用钥匙环(也叫[钥匙链][4])?你用它把一把或多把钥匙串到一起, 以便于携带和查找。 + +Linux 里也是类似的。密钥环特性使你的系统可以将各种密码放在一起,并将其保存在一个地方。 + +大多数 Linux 桌面环境,如 GNOME、KDE、Xfce 等采用 [GNOME 密钥环][5]来提供这个功能。 + +该密钥环保存了 ssh 密钥、GPG 密钥以及使用此功能的应用程序(例如 Chromium 浏览器)的密钥。默认情况下,**“密钥环”通过主密码来保护**,该密码通常是帐户的登录密码。 + +系统上的每个用户都有自己的密钥环,(通常)密码与用户帐户本身的密码相同。当你使用密码登录系统时,你的密匙环将使用你帐户的密码自动解锁。 + +当你[启用 Ubuntu 中的自动登录功能时][1]时,就有问题了。这意味着你无需输入密码即可登录系统。在这种情况下,你的密钥环不会自动解锁。 #### 密钥环是一个安全特性 -记得我说过密钥环是一个安全特性吗?现在想象一下您在您的Linux电脑上开启了自动登录功能。有权访问您电脑的任何人无需密码就能进入您的系统。但是您可能不会在意,因为您只是用它来访问互联网。 +记得我说过密钥环是一个安全特性吗?现在想象一下你在 Linux 电脑上开启了自动登录功能。有权访问你电脑的任何人无需密码就能进入你的系统。但是你可能不会在意,因为你只是用它来访问互联网。 -但是,如果您使用Chromium或[Ubuntu中的Google Chrome][6]之类的浏览器,并使用它来保存各种网站的登录密码,那么您将遇到麻烦。任何人都可以使用浏览器并利用您在浏览器中保存的密码登录网站。那不就是风险吗? +但是,如果你在 Ubuntu 中使用 Chromium 或 [Google Chrome][6] 之类的浏览器,并使用它来保存各种网站的登录密码,那么你将遇到麻烦。任何人都可以使用浏览器并利用你在浏览器中保存的密码登录网站。这不很危险吗? -这就是为什么当您使用Chrome时,它将反复地提示您先解锁密钥环。这确保了只有知道密钥环密码的人才能使用在浏览器中保存的密码来登录它们相关的网站。 +这就是为什么当你使用 Chrome 时,它将反复地提示你先解锁密钥环。这确保了只有知道密钥环密码(即账户密码)的人才能使用在浏览器中保存的密码来登录它们相关的网站。 -如果您反复取消解锁密钥环的提示,它最终将消失并允许您使用浏览器。但是,保存的密码将不会被解锁,您在Chromium/Chome浏览器上将会看到'同步暂停'的提示。 +如果你反复取消解锁密钥环的提示,它最终将消失,并允许你使用浏览器。但是,保存的密码将不会被解锁,你在 Chromium/Chome 浏览器上将会看到“同步暂停”的提示。 ![Sync paused in Google Chrome][7] -#### 如果密钥环总是存在的,为什么您从来没有见过它呢? +#### 如果密钥环一直存在,为什么你从来没有见过它呢? -如果您在您的Linux系统上从没见过它的话,这就是一个有效的问题。 +如果你在你的 Linux 系统上从没见过它的话,这个问题就很有道理。 -如果您从没有用过自动登录功能(或者修改您的账户密码),您可能都没有意识到这个特性的存在。 +如果你从没有用过自动登录功能(或者修改你的账户密码),你可能都没有意识到这个特性的存在。 -这是因为当您通过您的密码登录系统时,您的密钥环被您的账户密码自动解锁了。 +这是因为当你通过你的密码登录系统时,你的密钥环被你的账户密码自动解锁了。 -Ubuntu(和其他发行版)对于通用的管理任务像修改用户, 安装新软件等需要输入密码,无论您是否是自动登录的。但是对于日常任务像使用浏览器,它不需要输入密码因为密钥环已经被解锁了。 +Ubuntu(和其他发行版)在执行普通的管理任务如修改用户、安装新软件等需要输入密码,无论你是否是自动登录的。但是对于日常任务像使用浏览器,它不需要输入密码因为密钥环已经被解锁了。 -当您切换到自动登录时,您不再需要输入登录密码。这意味着密钥环没有被自动解锁,因此当您使用利用了密钥环特性的浏览器时,它将提示您来解锁密钥环。 +当你切换到自动登录时,你不再需要输入登录密码。这意味着密钥环没有被自动解锁,因此当你使用利用了密钥环特性的浏览器时,它将提示你来解锁密钥环。 -#### 您可以容易地管理密钥环和密码 +#### 你可以轻松地管理密钥环和密码 -这个密钥环放在哪里?它的核心是一个守护任务(一个后台自动运行的程序)。 +这个密钥环放在哪里?它的核心是一个守护任务(一个后台自动运行的程序)。 -别担心。您不必通过终端来操作守护任务。大多数桌面环境都自带有图形化的应用程序可以和守护进程进行交互。KDE上有KDE钱包,GNOME和其他桌面上叫做密码和密钥(原来叫[海马][8])。 +别担心。你不必通过终端来操作守护任务。大多数桌面环境都自带一个可以和这个守护进程进行交互的图形化应用程序。KDE 上有 KDE 钱包,GNOME 和其他桌面上叫做“密码和密钥”(之前叫 [Seahorse][8])。 ![Password And Keys App in Ubuntu][9] -您可以用这个GUI程序来查看什么应用程序在用密钥环来管理/保护密码。 +你可以用这个 GUI 程序来查看哪些应用程序在用密钥环来管理/保护密码。 -您可以看到,我的系统有自动创建的登录密钥环。也有一个存储GPG和SSH密钥的密钥环。那个[证书][10]是用来保存证书机构颁发的证书(像HTTPS证书)的。 +你可以看到,我的系统有自动创建的登录密钥环。也有一个存储 GPG 和 SSH 密钥的密钥环。那个[证书][10]用来保存证书机构颁发的证书(如 HTTPS 证书)。 ![Password and Keys application in Ubuntu][11] -您也可以使用这个应用程序来手动保存网站的密码。例如,我创建了一个新的叫做'Test'的被密码保护的密钥环,并手动存储了一个密码。 +你也可以使用这个应用程序来手动保存网站的密码。例如,我创建了一个新的叫做“Test”的被密码保护的密钥环,并手动存储了一个密码。 -这比保存一批密码在一个文本文件中要好一些。至少在这种情况下,您的密码只有在您通过密码解锁了密钥环时才允许被看到。 +这比在一个文本文件中保存一批密码要好一些。至少在这种情况下,你的密码只有在你通过密码解锁了密钥环时才允许被看到。 ![Saving New Password Seahorse][12] -一个潜在的问题是如果您格式化您的系统,手动保存的密码必然会丢失。通常,您会备份您的个人文件,但并不是所有的用户特定数据如密钥环文件。 +这里有一个潜在的问题,如果你格式化你的系统,手动保存的密码必然会丢失。通常,你会备份你的个人文件,但并不是所有的用户特定数据,如密钥环文件。 -有一种办法能解决它。密钥环数据通常保存在~/.local/share/keyrings目录。在这里您可以看到所有的密钥环但是您不能直接看到它们的内容。如果您移除密钥环的密码(我会在这篇文章的后面描述操作步骤),您可以像一个普通的文本文件一样读取密钥环的内容。您可以完整地拷贝这个解锁后的密钥环文件并在其他的Linux机器(安装了密码和密钥应用)上导入到密码和密钥应用程序。 +有一种办法能解决它。密钥环数据通常保存在 `~/.local/share/keyrings` 目录。在这里你可以看到所有的密钥环,但是你不能直接看到它们的内容。如果你移除密钥环的密码(我会在这篇文章的后面描述操作步骤),你可以像一个普通的文本文件一样读取密钥环的内容。你可以将这个解锁后的密钥环文件完整地复制下来,并在其他的 Linux 机器上运行“密码和密钥”应用程序导入到其中。 总结一下目前为止所学的内容: - * 大多数Linux缺省已经安装并激活了密钥环特性 + + * 大多数 Linux 系统缺省已经安装并激活了密钥环特性 * 系统上的每个用户都拥有他自己的密钥环 - * 密钥环通常被账户密码锁定(保护) - * 当您通过密码登录时密钥环会被自动解锁 - * 对于自动登录,密钥环不会自动解锁,因此当您试图使用依赖密钥环的应用程序时会被提示先解锁它 + * 密钥环通常是用账户密码锁定的(保护) + * 当你通过密码登录时密钥环会被自动解锁 + * 对于自动登录,密钥环不会自动解锁,因此当你试图使用依赖密钥环的应用程序时会被提示先解锁它 * 并不是所有的浏览器或应用程序利用了密钥环特性 - * (Linux上)安装了一个GUI程序可以和密钥环交互 - * 您可以用密钥环来手动以加密格式来存储密码 - * 您可以自己修改密钥环密码 - * 您可以通过导出(需要先解锁密钥环)并导入(到其他计算机上)的方式来获取手工保存的密码。 - - + * (Linux 上)安装一个 GUI 程序可以和密钥环交互 + * 你可以用密钥环来手动存储加密格式的密码 + * 你可以自己修改密钥环密码 + * 你可以通过导出(需要先解锁密钥环)并导入到其他计算机上的方式来获取手工保存的密码。 ### 修改密钥环密码 -假设您修改了您的账户密码。当您登录时,您的系统试图通过新的登录密码来自动解锁密钥环。但是密钥环还在使用老的登录密码。 +假设你修改了你的账户密码。当你登录时,你的系统试图通过新的登录密码来自动解锁密钥环。但是密钥环还在使用老的登录密码。 -这种情况下,您可以修改密钥环密码为新的登录密码,这样密码环才能在您登录系统时自动解锁。 +这种情况下,你可以修改密钥环密码为新的登录密码,这样密码环才能在你登录系统时自动解锁。 -从菜单中打开密码和密钥应用程序: +从菜单中打开“密码和密钥”应用程序: ![Look for Password and Keys app in the menu][9] -在登录密钥环上右击并点击修改密码: +在“Login”密钥环上右击并点击“修改密码”: ![Change Keyring Password][13] -如果您不记得老的登录密码怎么办? +#### 如果你不记得老的登录密码怎么办? -您可能知道[Ubuntu上复位忘记的密码是很容易的][14]。但是密钥环在这种场景下还是有问题。您修改了账户密码但是您不记得仍然被密钥环使用的老的账户密码。 +你可能知道在 [Ubuntu 上重置忘记的密码很容易][14]。但是密钥环在这种场景下还是有问题。你修改了账户密码,但是你不记得仍然被密钥环使用的老的账户密码。 -您不能修改它因为您不知道老的密码。怎么办? +你不能修改它因为你不知道老的密码。怎么办? -这种情况下,您将不得不移除整个密钥环。您可以通过密码和密钥应用程序来操作: +这种情况下,你将不得不移除整个密钥环。你可以通过“密码和密钥”应用程序来操作: ![Delete Keyring Ubuntu][15] -它会提示您进行确认: +它会提示你进行确认: ![Delete Keyring][16] -另外,您也可以手动删除~/.local/share/keyrings目录下的密钥环文件。 +另外,你也可以手动删除 `~/.local/share/keyrings` 目录下的密钥环文件。 -老的密钥环文件被移除后,您再打开Chrome/Chromium时,它会提示您创建一个新的密钥环。 +老的密钥环文件被移除后,你再打开 Chrome/Chromium 时,它会提示你创建一个新的密钥环。 ![New Keyring Password][17] -您可以用新的登录密码,密钥环就会被自动解锁了。 +你可以用新的登录密码,密钥环就会被自动解锁了。 ### 禁用密钥环密码 -在您想用自动登录但又不想手动解锁密钥环时,您可以把禁用密钥环密码作为一个规避方法。记住您正在禁用一个安全特性,因此请三思。 +在你想用自动登录但又不想手动解锁密钥环时,你可以把禁用密钥环密码作为一个规避方法。记住你正在禁用一个安全特性,因此请三思。 -操作步骤和修改密钥环相似。打开密码和密钥应用程序,然后修改密钥环密码。 +操作步骤和修改密钥环相似。打开“密码和密钥”应用程序,然后修改密钥环密码。 -技巧在于当它提示修改密码时,不要输入新密码,而是点击继续按钮。这将移除密钥环的密码。 +技巧在于当它提示修改密码时,不要输入新密码,而是点击“继续”按钮。这将移除密钥环的密码。 ![Disable Keyring password by not setting any password at all][18] -这种方法,密钥环没有密码保护并将一直处于解锁状态。 +这种方法,密钥环没有密码保护,并将一直处于解锁状态。 -------------------------------------------------------------------------------- @@ -156,7 +156,7 @@ via: https://itsfoss.com/ubuntu-keyring/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[messon007](https://github.com/messon007) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1ebce83dfcd5b99c2d50265e2423ba9846ee0d19 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 9 Apr 2020 23:05:03 +0800 Subject: [PATCH 0212/1809] PUB @messon007 https://linux.cn/article-12093-1.html --- ...Keyring Concept in Ubuntu- What is It and How to Use it.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md (99%) diff --git a/translated/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md b/published/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md similarity index 99% rename from translated/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md rename to published/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md index 020a06ecf0..3af840a02c 100644 --- a/translated/tech/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md +++ b/published/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (messon007) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12093-1.html) [#]: subject: (The Keyring Concept in Ubuntu: What is It and How to Use it?) [#]: via: (https://itsfoss.com/ubuntu-keyring/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 6e825ef842be94ecfde84e728f446f085a620493 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Thu, 9 Apr 2020 23:26:44 +0800 Subject: [PATCH 0213/1809] Update 20190814 9 open source cloud native projects to consider.md --- ...9 open source cloud native projects to consider.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sources/tech/20190814 9 open source cloud native projects to consider.md b/sources/tech/20190814 9 open source cloud native projects to consider.md index 6d81cf1762..551c8df7d1 100644 --- a/sources/tech/20190814 9 open source cloud native projects to consider.md +++ b/sources/tech/20190814 9 open source cloud native projects to consider.md @@ -160,8 +160,10 @@ The best way to get started with Prometheus is to check out its [GitHub repo][10 ### Envoy Envoy (or Envoy Proxy) is an open source edge and service proxy designed for cloud-native applications. Created at Lyft, Envoy is a high-performance, C++, distributed proxy designed for single services and applications, as well as a communications bus and a universal data plane designed for large microservice service mesh architectures. Built on the learnings of solutions such as Nginx, HAProxy, hardware load balancers, and cloud load balancers, Envoy runs alongside every application and abstracts the network by providing common features in a platform-agnostic manner. +Envoy(或Envoy代理)是专为云原生应用设计的开源的边缘和服务代理。 由Lyft创建的Envoy是为单一服务和应用而设计的高性能的C++分布式代理,同时也是为由大量微服务组成的服务网格架构而设计的通信总线和通用数据平面。 基于对Nginx,HAProxy,硬件负载均衡器和云负载均衡器等方案了解的基础上,Envoy与每个应用相伴运行,并对网络进行了高度抽象,最终以平台无关的方式来提供通用功能。 When all service traffic in an infrastructure flows through an Envoy mesh, it becomes easy to visualize problem areas via consistent observability, tune overall performance, and add substrate features in a single place. Basically, Envoy Proxy is a service mesh tool that helps organizations build a fault-tolerant system for production environments. +当基础设施中的所有服务流量都经过一个Envoy网格时,很容易就可以通过连贯的监测来可视化问题域,调整整体性能,并在单个位置添加基础功能。基本上,Envoy代理是一个可帮助组织为生产环境构建容错系统的服务网格工具。 There are numerous alternatives for service mesh applications, such as Uber’s [Linkerd][24] (discussed below) and [Istio][25]. Istio extends Envoy Proxy by deploying as a [Sidecar][26] and leveraging the [Mixer][27] configuration model. Notable Envoy features are: @@ -172,9 +174,18 @@ There are numerous alternatives for service mesh applications, such as Uber’s * It’s API-driven and supports dynamic configuration and hot reloads * Has a strong focus on metric collection, tracing, and overall observability +服务网格应用程序有很多替代方案,例如Uber的[Linkerd][24](下面会讨论)和[Istio][25]。 Istio通过将其部署为[Sidecar][26]并利用了[Mixer][27]的配置模型,实现了对Envoy的扩展。 Envoy的显著特性有: + + *所有的“桌面赌注”特性(与控制平面(例如Istio)配对时) + *带载运行时的低延时, 延迟率低至99% + *将L3/L4过滤器作为核心,许多L7过滤器被考虑在外 + *支持gRPC和HTTP / 2(上行/下行) +   *由API驱动,并支持动态配置和热重载 + *重点关注指标收集,跟踪和整体可监测性 Understanding Envoy, proving its capabilities, and realizing its full benefits require extensive experience with running production-level environments. You can learn more in its [detailed documentation][28] and by accessing its [GitHub][11] repository. +要想了解Envoy,证实其能力并意识到其全部优势,需要丰富的在生产级环境运行的经验。 您可以在[详细文档][28]或访问其[GitHub][11]仓库了解更多信息。 ## Incubating projects From f152ae25f55b749c8f0a01871cee6288f1359067 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Apr 2020 01:09:35 +0800 Subject: [PATCH 0214/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200410=20How?= =?UTF-8?q?=20to=20Go=20Full=20Dark=20Mode=20in=20Ubuntu=2020.04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md --- ...ow to Go Full Dark Mode in Ubuntu 20.04.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md diff --git a/sources/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md b/sources/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md new file mode 100644 index 0000000000..bf90b3ea4f --- /dev/null +++ b/sources/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Go Full Dark Mode in Ubuntu 20.04) +[#]: via: (https://itsfoss.com/dark-mode-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Go Full Dark Mode in Ubuntu 20.04 +====== + +One of the most talked about [new features in Ubuntu 20.04][1] is the dark mode. You can [install dark theme in any Ubuntu version][2] to give it a dark look but the new Ubuntu 20.04 makes it a lot easier. + +You don’t need to install themes on your own. You can find three variants of the default theme (called Yaru) and you can enable the dark mode from the settings. + +It still leaves a few thing to I am going to show you some tips on giving complete dark mode to your Ubuntu system. + +### Enable dark mode in Ubuntu 20.04 + +[Subscribe to our YouTube channel for more Linux videos][3] + +The steps are performed on the GNOME desktop. If you are [using some other desktop environment][4], the screenshots may look different. + +Press the super key (Windows key) and start typing settings to search for the Settings application. + +![Search for Settings][5] + +In the Settings application, go to Apperance section and you should see three variants of the theme: Light, Standard and Dark. No prizes for guessing that you need to select Dark if you want to use the dark mode. + +![Enable Dark Theme in Ubuntu][6] + +Not all but applications using GTK3 should automatically comply with the dark theme. In other words, you’ll notice that most of the applications like text editor, terminal, LibreOffice etc on your system automatically switch to dark mode. + +But it still leaves a few thing in the light mode. Let me show you a couple of tips to ‘go to the darker side’. + +### Tweaks to go full dark mode in Ubuntu 20.04 + +You’ll notice that the shell theme is still light. The message tray, system tray (in the top panel) are still not using dark mode. + +![No Dark Shell by default in Ubuntu][7] + +You’ll have to [use a GNOME extension][8] here that will let you install Yaru dark shell theme. Install the browser extension first by using this command in terminal ([use Ctrl+Alt+T keyboard shortcut for terminal in Ubuntu][9]). + +``` +sudo apt install chrome-gnome-shell +``` + +Now [go to the extension’s webpage][10] and enable the extension by switching it on: + +![Enable User Themes GNOME Extension][11] + +You need to [install GNOME Tweaks tool][12] by using this command: + +``` +sudo apt install gnome-tweaks +``` + +Open the GNOME Tweaks tool and go to Appearance. You’ll see the option to change the shell theme. You don’t need to install this Yaru dark shell theme. It’s already there. You just have to enable it. + +![Enable Yaru Dark Shell Theme in Ubuntu][13] + +Now, you can see that even the shell features like desktop notifications, message tray, system tray are also in dark mode. + +![Yaru Dark Shell Theme in Ubuntu][14] + +Looks better, isn’t it? There is one more thing you could do to further enjoy dark mode in Ubuntu. You’ll notice that the websites you visit still have white background. You cannot expect all the websites to provide a dark mode. + +This is where you can use a browser extension like [Dark Reader][15]. John has already discussed it in the tutorial on [enabling dark mode in Firefox][16]. It’s not a complicated task. If you use Firefox, Chrome or [Chromium in Ubuntu][17], you can install the browser extension listed on the [Dark Reader website][15]. + +Once you have installed Dark Reader, all the websites you visit should be in dark mode automatically. + +![It’s FOSS Homepage in Dark Mode with Dark Reader][18] + +You may still find a few external third party applications using light theme. You may have to manually enable dark theme, if they have such an option available. + +Dark mode is getting popular these days even among the non-coders. With these tips, you can satisfy your craving of dark mode in Ubuntu. + +I hope you like it. Enjoy the dark mode. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/dark-mode-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-20-04-release-features/ +[2]: https://itsfoss.com/install-themes-ubuntu/ +[3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[4]: https://itsfoss.com/find-desktop-environment/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/settings-search-ubuntu-20-04.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-dark-theme-ubuntu.png?ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/no-dark-shell-ubuntu.jpg?ssl=1 +[8]: https://itsfoss.com/gnome-shell-extensions/ +[9]: https://itsfoss.com/ubuntu-shortcuts/ +[10]: https://extensions.gnome.org/extension/19/user-themes/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-user-themes-gnome.jpg?ssl=1 +[12]: https://itsfoss.com/gnome-tweak-tool/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-yaru-dark-shell-theme.jpeg?ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/yaru-dark-shell-theme-ubuntu.jpg?ssl=1 +[15]: https://darkreader.org/ +[16]: https://itsfoss.com/firefox-dark-mode/ +[17]: https://itsfoss.com/install-chromium-ubuntu/ +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/itsfoss_dark_mode.jpg?ssl=1 From b575da60045a3905bac3f23123f67e7f1db1f665 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Apr 2020 01:10:34 +0800 Subject: [PATCH 0215/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200409=20Prin?= =?UTF-8?q?t=20double-sided=20documents=20at=20home=20with=20this=20simple?= =?UTF-8?q?=20Bash=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200409 Print double-sided documents at home with this simple Bash script.md --- ...ts at home with this simple Bash script.md | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 sources/tech/20200409 Print double-sided documents at home with this simple Bash script.md diff --git a/sources/tech/20200409 Print double-sided documents at home with this simple Bash script.md b/sources/tech/20200409 Print double-sided documents at home with this simple Bash script.md new file mode 100644 index 0000000000..daacfa8365 --- /dev/null +++ b/sources/tech/20200409 Print double-sided documents at home with this simple Bash script.md @@ -0,0 +1,152 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Print double-sided documents at home with this simple Bash script) +[#]: via: (https://opensource.com/article/20/4/print-duplex-bash-script) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) + +Print double-sided documents at home with this simple Bash script +====== +Use this script and save yourself the hassle and wasted paper of trying +to manually load and print double-sided documents. +![bash logo on green background][1] + +We have a laser printer at home. This Hewlett Packard LaserJet Pro CP1525nw Color Printer is an older model, but it has been a great workhorse that prints reliably and in color. I [put it on our home network][2] a few years ago using our [Raspberry Pi][3] as a print server. + +The LaserJet has been a great addition to my home office. Since [I launched my company][4] last year, I have relied on this little laser printer to print handouts and other materials for client meetings, workshops, and training sessions. + +My only gripe with this printer is that it prints single-sided only. If you want to print double-sided, you need to set up a custom print job to do it yourself. That's inconvenient and requires manual steps. In LibreOffice, I need to specifically set up the print job to print the odd-numbered pages first, then reload the paper before printing the even-numbered pages on the other side—but in reverse order. + +![LibreOffice print dialog][5] + +If I need to print a PDF that someone has sent me, the process is the same. For a four-page document, I first need to print pages 1 and 3, then reload the paper and print pages 2 and 4 in reverse order. In the GNOME print dialog, you need to select "Page Setup" to print odd pages or even pages. + +![Gnome print dialog][6] + +![Gnome page setup][7] + +Regardless of how I print, the overall process is to print the odd-numbered pages, reload the stack of printed pages into the paper tray, then print the even-numbered pages in reverse order. If I'm printing a four-page document, printing the even-numbered pages in reverse order means page 4 prints on the back of page 3 and page 2 prints on the back of page 1. Imagine my frustration in those few instances when I forgot to select the option to print in reverse order when printing the even-numbered pages and ruined a long print job. + +Similarly, it's easy to forget how to deal with documents that have an odd number of pages. In a five-page document, you first print pages 1, 3, and 5. But when you reload the printed pages into the printer, you don't want page 5. Instead, you only want to load pages 1 and 3. Otherwise, page 4 will print on the back of page 5, page 2 will print on the back of page 3, and nothing gets printed on the back of page 1. + +To make things easier and more reliable, I wrote a simple Bash script that automates printing duplex. This is basically a wrapper to print odd-numbered pages, remind me to reload the pages (and remove the last page if needed), then print the even-numbered pages. + +Whenever I need to print a document as duplex, I first convert the document to PDF. This is very easy to do. In LibreOffice, there's a toolbar icon to export directly as PDF. You can also navigate under **File— Export As—Export as PDF** to do the same. Or in any other application, there's usually a **Save to PDF** feature. When in doubt, GNOME supports printing to a PDF file instead of a printer. + +![Libre Office toolbar][8] + +![Export as PDF][9] + +### How it works + +Once I've saved to PDF, I let my Bash script do the rest. This really just automates the **lpr** commands to make printing easier. It prints odd pages first, prompts me to reload the paper, then prints the even pages. If the document has an odd number of pages, it also reminds me to remove the last page when I reload the printed pages. It's pretty simple. + +The only "programming" part of the script is determining the page count, and figuring out if that's an even or odd number. Both of those are easy to do. + +To determine the page count, I use the **pdfinfo** command. This generates useful info about a PDF document. Here's some sample output: + + +``` +$ pdfinfo All\ training\ -\ catalog.pdf +Creator:        Writer +Producer:       LibreOffice 6.3 +CreationDate:   Fri Oct 18 16:06:07 2019 CDT +Tagged:         no +UserProperties: no +Suspects:       no +Form:           none +JavaScript:     no +Pages:          11 +Encrypted:      no +Page size:      612 x 792 pts (letter) +Page rot:       0 +File size:      65623 bytes +Optimized:      no +PDF version:    1.5 +``` + +That output is very easy to parse. To get the page count, I use an AWK one-line script to look for **Pages:** and print the second field. + + +``` +`pages=$( pdfinfo "$1" | awk '/^Pages:/ {print $2}' )` +``` + +To figure out if this is an odd or even number, I use the modulo (**%**) arithmetic operator to divide by two and tell me the remainder. The modulo of two will always be zero for an even number, and one for an odd number. I use this simple test to determine if the document has an odd number of pages, so I'll need to remove the last page before printing the rest of the document: + + +``` +`if [ $(( $pages % 2 )) -ne 0 ] ; then` +``` + +With that, writing the **print-duplex.sh** Bash script is a simple matter of calling **lpr** with the correct options to send output to my printer (**lpr -P "HP_LaserJet_CP1525nw"**), to print odd-numbered pages (**-o page-set=odd**) or even-numbered pages (**-o page-set=even**), and to print in reverse order (**-o outputorder=reverse**). + +### Bash script + + +``` +#!/bin/sh +# print-duplex.sh +# simple wrapper to print duplex + +cat<<EOF +$1 ($pages pages) +\------------------------------------------------------------------------------- +Printing odd pages first +Please wait for job to finish printing... +\------------------------------------------------------------------------------- +EOF + +lpr -P "HP_LaserJet_CP1525nw" -o page-set=odd "$1" +sleep $pages + +cat<<EOF +=============================================================================== +Put paper back into the printer in EXACT OUTPUT ORDER (face down in tray) +then press ENTER +=============================================================================== +EOF + +pages=$( pdfinfo "$1" | awk '/^Pages:/ {print $2}' ) + +if [ $(( $pages % 2 )) -ne 0 ] ; then +  echo '!! Remove the last page - this document has an odd number of pages' +fi + +echo -n '>' +read x + +cat<<EOF +\------------------------------------------------------------------------------- +Printing even pages +Please wait for job to finish printing... +\------------------------------------------------------------------------------- +EOF + +lpr -P "HP_LaserJet_CP1525nw" -o page-set=even -o outputorder=reverse "$1" +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/print-duplex-bash-script + +作者:[Jim Hall][a] +选题:[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/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: https://opensource.com/article/18/3/print-server-raspberry-pi +[3]: https://opensource.com/resources/raspberry-pi +[4]: https://opensource.com/article/19/9/business-creators-open-source-tools +[5]: https://opensource.com/sites/default/files/uploads/print_dialog_-_libreoffice_0.png (LibreOffice print dialog) +[6]: https://opensource.com/sites/default/files/uploads/print_dialog_-_gnome_0.png (Gnome print dialog) +[7]: https://opensource.com/sites/default/files/uploads/print_dialog_-_gnome_-_page_setup.png (Gnome page setup) +[8]: https://opensource.com/sites/default/files/uploads/toolbar_-_export_as_pdf_-_libreoffice.png (Libre Office toolbar) +[9]: https://opensource.com/sites/default/files/uploads/file_-_export_as_pdf_-_libreoffice.png (Export as PDF) From 31523065808f7cd400e1179cfa053c7371b157be Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Apr 2020 01:11:33 +0800 Subject: [PATCH 0216/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200409=20How?= =?UTF-8?q?=20to=20set=20up=20a=20remote=20school=20environment=20for=20ki?= =?UTF-8?q?ds=20with=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200409 How to set up a remote school environment for kids with Linux.md --- ... school environment for kids with Linux.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20200409 How to set up a remote school environment for kids with Linux.md diff --git a/sources/tech/20200409 How to set up a remote school environment for kids with Linux.md b/sources/tech/20200409 How to set up a remote school environment for kids with Linux.md new file mode 100644 index 0000000000..327af54c79 --- /dev/null +++ b/sources/tech/20200409 How to set up a remote school environment for kids with Linux.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to set up a remote school environment for kids with Linux) +[#]: via: (https://opensource.com/article/20/4/school-home-linux) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +How to set up a remote school environment for kids with Linux +====== +Repurpose an old computer to support the new home-schooler in your life. +![Image by Alan Formy-Duvall][1] + +COVID-19 has suddenly thrown all of us into a new and challenging situation. Many of us are now working full-time from home, and for a lot of us (especially people who aren't used to working remotely), this is taking some getting used to. + +Another group that is similarly challenged is our kids. They can't go to school or participate in their regular after-school activities. My daughter's elementary school closed its classrooms and is teaching through an online, web-based learning portal instead. And one of her favorite extracurricular activities—a coding school where she has been learning Scratch and just recently "graduated" to WoofJS–has also gone to an online-only format. + +We are fortunate that so many of our children's activities can be done online now, as this is the only way they will be able to learn, share, and socialize for at least the next several months. + +### Setting up a temporary homeschool environment + +When our daughter's school went to an online-only format, we realized she needed a place and some tools to do her work. So we cleaned off her desk and cleared the toys from the floor around it to make an "office" for her. We also realized she would need a computer. While I could have shopped online and ordered a new computer (and spent at least several hundred dollars—if not more than $1,000—in the process), I chose an alternative and put an old, unused laptop back to work. + +If you have an unused computer sitting around and are willing to do a bit of tech work, you, too, can set something up to get your kids online. Here's how I did it. + +### The hardware + +While my daughter already has her own small IT department (as I like to say), it consists of some gaming systems, a tablet, and a Chromebook. Even her Chromebook has just an 11.6" screen and a small keyboard, so none of her devices are really quite adequate for full-time school duty. + +So we found ourselves in a pinch. She really needed a desktop-capable computer system with a decent-sized screen, a full keyboard, a good-quality microphone, a set of speakers, and a headphone jack. And having an external video connector helps if you decide one screen isn't enough. + +I didn't have a spare desktop, but I did have a laptop: a Lenovo G550 with a Pentium Dual-Core T4500 2.3GHz processor and 4GB RAM. I replaced its aging 5400RPM spindle hard drive with a 240GB solid-state drive. The laptop has a 15.6" screen, which is much easier to view than the small screens on her other devices, and a comfortable, full-size keyboard. Its CPU scores a bit better in PassMark's benchmarks (913 vs. 674) than the 1.6GHz Intel Celeron N3060 Dual-Core in the Chromebook. + +However, it is 10 years old, certainly on the edge of usability by today's standards. But, thanks to the efficiency of the Linux operating system, it gets the job done. I installed the latest version (v31) of [Fedora Workstation][2], but many other distributions will work just fine. If you really want to eke out every drop of performance, you could use one of the [lightweight Linux distributions][3]. The only area that required a little extra effort with Fedora was the wireless; I had to install the driver for the Broadcom WiFi hardware. But really, this was only a few extra steps and a restart, and it was good to go. + +Linux supports all of the other hardware in the laptop. My daughter prefers a full-sized mouse over the touchpad, so I attached one. She likes the keyboard on this laptop, but if she wants an external keyboard, there are enough USB ports to hook one up. + +It has a traditional 3.5mm audio jack, so she can use headphones. I recommend giving children decibel-limited headphones to protect their hearing. + +Even though this laptop has a 15.6" widescreen display, I think having a second monitor gives the best experience. I have a spare that I might hook up to the external VGA connector. + +### The software + +My daughter's school set up an online learning portal. The benefit is that students just need a supported web browser to log on and get to work, and I thank the school for its efforts and choice of a vendor-agnostic solution. Most Linux distributions include the Mozilla Firefox web browser installed by default, and Linux provides a full operating system, so I can install any applications she might need. Fedora is also updated regularly (unlike the old Windows Vista that came with the laptop and is no longer supported). + +![][4] + +Scratch running on Fedora + +Her extracurricular coding school is using the Zoom client. I'm happy to report that it was an easy [install with RPM][5] and works great on Fedora 31. + +### Success! + +My daughter has no trouble using her new laptop. She likes the [GNOME desktop][6], particularly the fact that it "Looks like Dad's!" This is turning out to be a great experiment in practical (and under-pressure) use of a Linux desktop. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/school-home-linux + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/homeschool.jpg?itok=vYEd9NON (Image by Alan Formy-Duvall) +[2]: https://getfedora.org/en/workstation/ +[3]: https://opensource.com/article/19/6/linux-distros-to-try +[4]: https://opensource.com/sites/default/files/scratch.jpg +[5]: https://zoom.us/download?os=linux +[6]: https://www.gnome.org/ From 53fe54704526e28576dd34710ff108a70fd25bdf Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Apr 2020 01:13:53 +0800 Subject: [PATCH 0217/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200409=20Use?= =?UTF-8?q?=20Emacs=20Org=20mode=20to=20easily=20create=20LaTeX=20document?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200409 Use Emacs Org mode to easily create LaTeX documents.md --- ...g mode to easily create LaTeX documents.md | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 sources/tech/20200409 Use Emacs Org mode to easily create LaTeX documents.md diff --git a/sources/tech/20200409 Use Emacs Org mode to easily create LaTeX documents.md b/sources/tech/20200409 Use Emacs Org mode to easily create LaTeX documents.md new file mode 100644 index 0000000000..461c52a8a5 --- /dev/null +++ b/sources/tech/20200409 Use Emacs Org mode to easily create LaTeX documents.md @@ -0,0 +1,142 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Emacs Org mode to easily create LaTeX documents) +[#]: via: (https://opensource.com/article/20/4/emacs-org-mode) +[#]: author: (Peter Prevos https://opensource.com/users/danderzei) + +Use Emacs Org mode to easily create LaTeX documents +====== +You can use LaTeX for scientific and technical documents without all of +the confusing commands and syntax you would normally need. +![Filing cabinet for organization][1] + +LaTeX is a powerful system, especially for writing scientific and technical documents. But writing documents in LaTeX can be confusing because you need to know a lot of commands, and your text is littered with backslashes, curly braces, and other syntax distractions. But being productive as a writer requires that you focus on the text's content instead of how it looks. Fortunately, the [GNU Emacs][2] Org mode extension makes it easy to write plain-text documents and seamlessly export them to LaTeX and PDF. + +[Org mode][3] is a built-in Emacs extension that helps you keep notes, maintain to-do lists, manage projects, and author documents with a fast and effective plain-text system. Emacs also comes with [AUCTeX][4], an extensible package for writing TeX files in Emacs. AUCTeX has a preview module that shows the results of what you type, but I find it distracting because it draws my attention away from the document's content to its design. Writing text in Org mode is my preferred option because the source remains a plain-text file with minimal typesetting elements. The text is independent of its result because Org mode can export it to multiple formats, including LaTeX and PDF. + +Emacs is known for being difficult to use with a steep learning curve. But Emacs is only difficult when you want to fine-tune the default settings. By following a minimalist approach to using the vanilla GNU Emacs, this article will get you quickly and easily on your way to writing beautiful documents without any complex configuration. + +### First steps + +Before you begin, [install Emacs][5] and a fully functioning version of [LaTeX][6] on your computer. + +Next, you need to learn some conventions. In Emacs lingo, the abbreviation **C-c** means to enter **Ctrl+C** on your keyboard. The abbreviation **M-x** means **Alt+X**. The M stands for the mod key, which no longer exists in modern systems. The **S** prefix indicates the **Shift** key. + +The **find-file** function, which you start with the **C-x C-f** keystroke combination, creates a new document or opens an existing document. Entering this function opens a dialog in the mini-buffer at the bottom of the screen, which is where Emacs communicates with the user. Type the name of the file you want to create or open into the mini-buffer. Emacs is sensitive to file extensions, so make sure that the name of your document ends in **.org**. + +In Emacs speak, opening or creating a file is called ["visiting" a file][7]. Visiting a file means reading its contents into an Emacs buffer so that it is available for editing. Emacs generates a new buffer for each file you visit. + +### Writing prose with Org mode + +Once you're visiting a file, you can start typing your text the same way you would in any text editor or word processor. Some conventions: Begin the file with **#+TITLE:** to denote the title of the document and **#+AUTHOR** for your name. These options are used when exporting the file. Org mode recognizes a range of [export settings][8] to configure the output. For example, to suppress the table of contents, enter **#+OPTIONS: toc:nil**. + +Org mode has its own Markdown-like conventions to format your document. [Headlines][9] start with one or more asterisks. Org mode can [collapse a headline][10] to render parts of it invisible with the **TAB** or **S-TAB** keys. You can make words ***bold***, **/italic/**, **_underlined_**, or **=verbatim=**. The Org manual describes the many options for [rich text][11]. + +One minor issue with plain-vanilla Emacs that you will quickly notice is it does not wrap lines at the end of the visible screen. Emacs has several line-wrapping functions, and [Visual Line mode][12] is the most useful for writing long-form text. To activate this mode, use **M-x** and enter **visual-line-mode** in the mini-buffer at the bottom of the screen. The **M-x** keyboard shortcut enables executing functions for which there is no direct keyboard shortcut. + +Adding [images][13] is as easy as adding a link to the image file within double square brackets: + + +``` +`[[file:path_to_image.png]]` +``` + +Org has a great system for [formatting tables][14] in plain ASCII. Any line with **|** is considered part of a table. The vertical line is also the column separator. A line starting with **|-** is rendered as a horizontal rule, and rows before the first horizontal rule are header lines. A table might look like this in the source file: + + +``` +| Name  |   id | Age | +|-------+------+-----| +| Peter | 1234 |  50 | +| Sue   | 4321 |  54 | +``` + +Both images and tables are preceded with **#+CAPTION:** to add a [caption][15]. Advanced options are also available to control float placement and size of figures. + +Emacs has extensive [editing functions][16] to make you more efficient when typing text. Spell checking, thesaurus, auto-completion, and an undo tree are just some of the tools that help you write efficiently. + +### Adding LaTeX snippets to Org + +In addition to the text itself, Org mode-text can include simple LaTeX commands, such as **\newpage**, within the text. Equations in standard LaTeX syntax are placed between dollar signs **$e^{i\pi} + 1 = 0$**. The **org-latex-preview** function (**C-c C-x C-l**) shows a [preview][17] of any LaTeX equations within the text buffer. Last, you can also add complete LaTeX snippets to insert complex content. The code has to be placed in an export block: + + +``` +#+BEGIN_EXPORT latex +\setlength{\unitlength}{1cm} +\thicklines +\begin{picture}(10,6) +\put(2,2.2){\line(1,0){6}} +\put(2,2.2){\circle{2}} +\put(6,2.2){\oval(4,2)[r]} +\end{picture} +#+END_EXPORT +``` + +### Exporting to LaTeX + +Org mode includes a powerful export module to convert your files to many formats using the powerful [Pandoc][18] software. Start the export module with the **org-export-dispatch** function, which you can run with the **C-c C-e** keyboard shortcut. The dispatch will split your screen and provide a range of options. + +First, Pandoc converts the Org mode file to a LaTeX file. Then you can choose to open the LaTeX file in a new buffer or save it as a file. Org mode can also directly render a PDF file, which you can view within Emacs or save to disk. + +![Emacs with Org mode source and PDF preview][19] + +### Advanced use + +This article provides a first taste of writing prose in Org mode and LaTeX. Org mode has numerous configuration options to fine-tune your document or to change default settings. + +By default, Org mode uses the article style to export documents, but you can change this with export settings. These settings can also be used to add commands to the document header, for example: + + +``` +#+LATEX_CLASS: report +#+LATEX_CLASS_OPTIONS: [a4paper] +#+LATEX_HEADER: \usepackage{times} +``` + +If you write scientific documents, the [org-ref][20] package by John Kitchin provides Org-mode modules for citations, cross-references, and bibliographies in Org mode and useful BibTeX tools to go with it. + +The Org mode manual's [LaTex export][21] section provides a detailed discussion of the functionality available. + +### Conclusion + +Org mode is a perfect editor for writing LaTeX. The main advantage is that you lose the clutter of LaTeX syntax and can focus on the text. This comes at no cost because you can still add LaTeX code as much as you need, and you get access to the powerful editing functions in Emacs. + +Using Org to write books and articles allows you to focus on the text as you combine two of the oldest and most powerful pieces of open source software. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/emacs-org-mode + +作者:[Peter Prevos][a] +选题:[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/danderzei +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_organize_letter.png?itok=GTtiiabr (Filing cabinet for organization) +[2]: https://opensource.com/article/20/3/getting-started-emacs +[3]: https://orgmode.org +[4]: https://www.gnu.org/software/auctex/ +[5]: https://www.gnu.org/software/emacs/ +[6]: https://www.latex-project.org/get/ +[7]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Visiting.html +[8]: https://orgmode.org/manual/Export-Settings.html +[9]: https://orgmode.org/manual/Headlines.html#Headlines +[10]: https://orgmode.org/manual/Global-and-local-cycling.html#Global-and-local-cycling +[11]: https://orgmode.org/manual/Markup-for-Rich-Contents.html#Markup-for-Rich-Contents +[12]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Visual-Line-Mode.html +[13]: https://orgmode.org/manual/Images.html +[14]: https://orgmode.org/manual/Built_002din-Table-Editor.html#Built_002din-Table-Editor +[15]: https://orgmode.org/manual/Captions.html#Captions +[16]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic.html#Basic +[17]: https://orgmode.org/manual/Previewing-LaTeX-fragments.html +[18]: https://pandoc.org/ +[19]: https://opensource.com/sites/default/files/uploads/org-mode-latex-screenshot.png (Emacs with Org mode source and PDF preview.) +[20]: https://github.com/jkitchin/org-ref +[21]: https://orgmode.org/manual/LaTeX-Export.html#LaTeX-Export From 41eed4a789cae84562df3d1a6105acc522cedf10 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 10 Apr 2020 08:37:01 +0800 Subject: [PATCH 0218/1809] translated --- ...ver with a Raspberry Pi and Rocket.Chat.md | 102 ------------------ ...ver with a Raspberry Pi and Rocket.Chat.md | 100 +++++++++++++++++ 2 files changed, 100 insertions(+), 102 deletions(-) delete mode 100644 sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md create mode 100644 translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md diff --git a/sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md b/sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md deleted file mode 100644 index 8c7b49e7c3..0000000000 --- a/sources/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md +++ /dev/null @@ -1,102 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Build a private chat server with a Raspberry Pi and Rocket.Chat) -[#]: via: (https://opensource.com/article/20/3/raspberry-pi-rocketchat) -[#]: author: (Giuseppe Cassibba https://opensource.com/users/peppe8o) - -Build a private chat server with a Raspberry Pi and Rocket.Chat -====== -Create your own truly private chat and messaging solution with these -simple, cost-effective open source tools. -![Chat via email][1] - -The internet offers plenty of free messaging services. Applications like WhatsApp and Viber are part of our daily life and are the most common way we communicate with relatives and friends. But security awareness is increasing the demand for a truly private chat solution. Furthermore, messaging apps take up a lot of space in our devices, so an alternative chat channel could be useful to share media, info, and contacts with our friends. - -Today we are going to see how to install a private chat and messaging server with a [Raspberry Pi][2] and Rocket.Chat. - -### What is Rocket.Chat? - -[Rocket.Chat][3] is an open source solution that provides an enhanced chat service. It includes collaboration tools like media sharing, screen sharing, and video/audio calling support. - -It can be used both via browser or from apps available in all the main app stores (Google Play, App Store, etc.). - -In addition to the community version, Rocket.Chat also offers Enterprise and Professional versions, including support and additional features. - -### What we need - -For this project, I’m going to use a cheaper Raspberry Pi 3 model A+. RPI 3 models B and B+, and RPI 4 model B should also work in the same way. - -I also suggest a performing SD card, because Rocket.Chat can put a heavy workload on our Raspberry Pi. As discussed in other articles, a performing SD card strongly improves Raspbian OS performance. - -We’ll use a lite version of Raspbian with pre-configured WiFi access and SSH service, so ![][4] there will no need for keyboards or HDMI cables. - -### Step-by-step procedure - -Start by [installing the last version of Raspbian Buster Lite][5]. - -We’ll simplify Rocket.Chat installation by using [Snap][6]. Login via SSH and type from the terminal: - - -``` -sudo apt-get update -sudo apt-get upgrade -``` - -Install Snap: - - -``` -`sudo apt-get install snapd` -``` - -For Snap installation, we need a system reboot to make it work: - - -``` -`sudo reboot` -``` - -Login again via SSH and install the Rocket.Chat server with the simple command: - - -``` -`sudo snap install rocketchat-server` -``` - -After installing from the terminal, please wait a while for Rocket.Chat to initialize its database and services. Have a cup of tea, and after a few minutes you should be able to reach with your browser the address http://<<YOUR_RPI_IP_ADDRESS>>:3000 and you should see the following: - -![Rocket Chat setup wizard][7] - -Complete the required forms, and everything should go fine. After four simple setup windows, you should reach the Rocket.Chat home page: - -![Rocket Chat home page][8] - -Enjoy! - -_This article originally posted on [peppe8o.com][9], reposted with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/raspberry-pi-rocketchat - -作者:[Giuseppe Cassibba][a] -选题:[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/peppe8o -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_chat_communication_message.png?itok=LKjiLnQu (Chat via email) -[2]: https://opensource.com/resources/raspberry-pi -[3]: https://rocket.chat/ -[4]: https://ir-na.amazon-adsystem.com/e/ir?t=peppe8o0b-20&l=am2&o=1&a=B07KKBCXLY -[5]: https://peppe8o.com/2019/07/install-raspbian-buster-lite-in-your-raspberry-pi/ -[6]: https://snapcraft.io/ -[7]: https://opensource.com/sites/default/files/uploads/rocket-chat-setup-wizard.jpg (Rocket Chat setup wizard) -[8]: https://opensource.com/sites/default/files/uploads/rocket-chat-home.jpg (Rocket Chat home page) -[9]: https://peppe8o.com/private-chat-and-messaging-server-with-raspberry-pi-and-rocket-chat/ diff --git a/translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md b/translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md new file mode 100644 index 0000000000..9a7af28493 --- /dev/null +++ b/translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Build a private chat server with a Raspberry Pi and Rocket.Chat) +[#]: via: (https://opensource.com/article/20/3/raspberry-pi-rocketchat) +[#]: author: (Giuseppe Cassibba https://opensource.com/users/peppe8o) + +使用树莓派和 Rocket.Chat 构建一个私人聊天服务器 +====== +使用这些简单、经济高效的开源工具创建你自己的真正私人聊天和消息解决方案。 +![Chat via email][1] + +互联网提供大量免费的消息服务。WhatsApp 和 Viber 等应用是我们日常生活的一部分,也是我们与亲朋好友沟通的最常见方式。但是,安全意识正在增加对真正私人聊天解决方案的需求。此外,消息应用在我们的设备中占用了大量空间,因此备用聊天渠道可用于与朋友共享媒体、信息和联系人。 + +今天,我们将了解如何使用[树莓派][2]和 Rocket.Chat 安装一个私人聊天和消息服务器。 + +### 什么是 Rocket.Chat? + +[Rocket.Chat][3] 是一个开源解决方案,它提供增强的聊天服务。它包括媒体共享、屏幕共享和视频/音频呼叫支持等协作工具。 + +它可以通过浏览器或从所有主要应用商店(Google Play、App Store 等)下载使用。 + +除了社区版本外,Rocket.Chat 还提供企业版和专业版,包括支持和其他功能。 + +### 我们需要什么 + +对于这个项目,我将使用更便宜的树莓派 3 model A+。树莓派 3 model B 和 B+ 以及树莓派 4 model B 工作应该一样。 + +我也建议使用高性能 SD 卡,因为 Rocket.Chat 会给树莓派大量的负载。如其他文章中所述,高性能 SD 卡可显著提高 Raspbian 操作系统的性能。 + +我们将使用 Raspbian 的精简版本,拥有预配置的 WiFi 访问和 SSH 服务,因此不需要键盘或 HDMI 线缆。 + +### 分步过程 + +从[安装最新版本的 Raspbian Buster Lite][5] 开始 + +我们将使用 [Snap][6] 简化 Rocket.Chat 安装。通过 SSH 登录并从终端输入: + + +``` +sudo apt-get update +sudo apt-get upgrade +``` + +安装 Snap: + + +``` +`sudo apt-get install snapd` +``` + +安装 Snap 后,我们需要重启系统使其正常工作: + + +``` +`sudo reboot` +``` + +再次通过 SSH 登录,并用以下简单的命令安装 Rocket.Chat: + + +``` +`sudo snap install rocketchat-server` +``` + +从终端安装后,请等待一段时间,等待 Rocket.Chat 初始化数据库和服务。休息一下,几分钟后,你应该能够在浏览器中访问 http://<<YOUR_RPI_IP_ADDRESS>>:3000,你应该看到以下内容: + +![Rocket Chat setup wizard][7] + +填写所需的表格就可以了。四个简单的设置窗口后,你应该会进入 Rocket.Chat 主页: + +![Rocket Chat home page][8] + +享受吧! + +_本文最初发表在 [peppe8o.com][9],并或许重新发布。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/raspberry-pi-rocketchat + +作者:[Giuseppe Cassibba][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/peppe8o +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_chat_communication_message.png?itok=LKjiLnQu (Chat via email) +[2]: https://opensource.com/resources/raspberry-pi +[3]: https://rocket.chat/ +[5]: https://peppe8o.com/2019/07/install-raspbian-buster-lite-in-your-raspberry-pi/ +[6]: https://snapcraft.io/ +[7]: https://opensource.com/sites/default/files/uploads/rocket-chat-setup-wizard.jpg (Rocket Chat setup wizard) +[8]: https://opensource.com/sites/default/files/uploads/rocket-chat-home.jpg (Rocket Chat home page) +[9]: https://peppe8o.com/private-chat-and-messaging-server-with-raspberry-pi-and-rocket-chat/ From e154021b1961dff7406861973965c2c44f582e48 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 10 Apr 2020 08:53:42 +0800 Subject: [PATCH 0219/1809] Update 20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md --- ...a private chat server with a Raspberry Pi and Rocket.Chat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md b/translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md index 9a7af28493..dd59fe627f 100644 --- a/translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md +++ b/translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md @@ -75,7 +75,7 @@ sudo apt-get upgrade 享受吧! -_本文最初发表在 [peppe8o.com][9],并或许重新发布。_ +_本文最初发表在 [peppe8o.com][9],并获许重新发布。_ -------------------------------------------------------------------------------- From 3b103482c77504c713fc45768bba8cae8ca6ee6d Mon Sep 17 00:00:00 2001 From: Hank Chow <280630620@qq.com> Date: Fri, 10 Apr 2020 13:26:09 +0800 Subject: [PATCH 0220/1809] hankchow translating --- .../tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md b/sources/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md index bf90b3ea4f..e668ac6d00 100644 --- a/sources/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md +++ b/sources/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 912a18282068f59473ee03731ba3738c3861492b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Apr 2020 17:45:21 +0800 Subject: [PATCH 0221/1809] PRF @MFGJT --- .../20190116 Best Audio Editors For Linux.md | 84 ++++++++----------- 1 file changed, 35 insertions(+), 49 deletions(-) diff --git a/translated/tech/20190116 Best Audio Editors For Linux.md b/translated/tech/20190116 Best Audio Editors For Linux.md index 7c72129b8d..0cf01bc796 100644 --- a/translated/tech/20190116 Best Audio Editors For Linux.md +++ b/translated/tech/20190116 Best Audio Editors For Linux.md @@ -1,20 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (MFGJT) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Best Audio Editors For Linux) [#]: via: (https://itsfoss.com/best-audio-editors-linux) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -Linux 上最好的音频编辑工具 +Linux 上的最佳音频编辑工具推荐 ====== 在 Linux 上,有很多种音频编辑器可供你选用。不论你是一个专业的音乐制作人,还是只想学学怎么做出超棒的音乐的爱好者,这些强大的音频编辑器都是很有用的工具。 -对于专业级的使用,我总是建议使用 [DAW][1](数码音频工作站)。但并不是所有人都需要全部的功能,所以你也应该了解一些最简单的音频编辑器。 +对于专业级的使用,我总是建议使用 [DAW][1](数码音频工作站)。但并不是每个人都需要全部的功能,所以你也应该了解一些最简单的音频编辑器。 -在本文中,我们将讨论几个 DAW 和基础的音频编辑器,而且它们都是在 Linux 和(很有可能)其它操作系统上可以使用的**免费并开源**的音频编辑方案。 +在本文中,我们将讨论几款 DAW 和基础的音频编辑器,而且它们都是在 Linux 和(可能)其它操作系统上可以使用的**自由开源**的解决方案。 ### Linux 上的最佳音频编辑器 @@ -22,115 +22,101 @@ Linux 上最好的音频编辑工具 我们不会关注 DAW 提供的所有功能,而只是关注基本的音频编辑功能。不过,你仍然可以把以下内容看作是 Linux 的最佳 DAW 名单。 -**安装说明:** -你可以在 AppCenter 或 Software center 中找到所有提到的音频编辑器或daw。如果你在这两个地方没有找到它们,请前往它们的官方网站获取更多信息。 +**安装说明:**你可以在 AppCenter 或软件中心中找到所有提到的音频编辑器或 DAW。如果你在这两个地方没有找到它们,请前往它们的官方网站获取更多信息。 -#### 1\. Audacity +#### 1、Audacity ![Audacity audio editor][3] -Audacity 是 Linux 中最基本音频编辑器之一,但是它也很强大。它是一个免费的开源跨平台工具。肯定已经有很多人了解这个软件了。 +[Audacity](https://www.audacityteam.org/) 是 Linux 中最基本音频编辑器之一,但是它也很强大。它是一个自由开源的跨平台工具。肯定已经有很多人了解这个软件了。 -现在的它相比它最初流行的时候有了很大的改进。我记得我以前试着通过从音频中去除人声来制作卡拉OK伴奏。现在有些时候,你仍然可以这么做。 +现在的它相比它最初流行的时候有了很大的改进。我记得我以前试着通过从音频中去除人声来制作卡拉 OK 伴奏。现在有些时候,你仍然可以这么做。 **特性:** -它还支持包含 VST 效果的插件。当然,你不应该期望它支持 VST 设备。 +它还支持包含 VST 效果的插件。当然,你不应该期望它支持 VST 乐器。 * 通过麦克风或混音器进行现场录制 - * 支持同时从多种音频格式的文件中批量导出/导入内容 - * 支持 LADSPA,LV2,Nyquist,VST 和 Audio Unit 的效果插件 + * 支持同时从多种音频格式的多个文件中批量导出/导入内容 + * 支持 LADSPA、LV2、Nyquist、VST 和 Audio Unit 的效果插件 * 使用简单,带有剪切、粘贴、删除和拷贝的功能 * 可观测声音频率的频谱模式 - - -#### 2\. LMMS +#### 2、LMMS ![LMMS audio editor][4] -LMMS 是一个免费的开源(跨平台)数码音频工作站。它包括所有基本的音频编辑功能以及许多高级功能。 +[LMMS](https://lmms.io/) 是一个自由开源的(跨平台)数码音频工作站。它包括所有基本的音频编辑功能以及许多高级功能。 -你可以混音,组合音频,或使用 VST 设备创造音频。 LMMS 支持这些功能。此外,它还自带一些样本音频,预设,VST 设备和特效来帮助你起步。创建音频。此外,你还可以得到一个频谱分析仪,以便进行高级的音频编辑工作。 +你可以混音、组合音频,或使用 VST 设备创造音频。LMMS 支持这些功能。此外,它还自带一些样本音频、预设、VST 设备和特效来帮助你起步。此外,你还可以得到一个频谱分析仪,以便进行高级的音频编辑工作。 **特性:** * 基于 MIDI 的音符回放 * 支持 VST 设备 - * 支持多样本 - * 内置压缩器,限制器,延迟功能,混响功能,失真功能和低音增强器 + * 原生支持多采样 + * 内置压缩器、限制器、延迟功能、混响功能、失真功能和低音增强器 - - -#### 3\. Ardour +#### 3、Ardour ![Ardour audio editor][5] -Ardour 是另一个免费和开源的数码音频工作站。只要你有音频接口,Ardour 就支持它的使用。当然,你也可以无限地添加多通道音轨。这些多通道音轨也可以被指派到不同的混音带,以方便编辑和录音。 +[Ardour](https://ardour.org/) 是另一个自由开源的数码音频工作站。只要你有音频接口,Ardour 就支持它的使用。当然,你也可以无限地添加多声道音轨。这些多声道音轨也可以被指派到不同的混音带,以方便编辑和录音。 -你也可以导入一个视频,编辑其中的音频,然后导出新的视频和音频。它提供了许多内置插件,并且支持 VST 插件。 +你也可以导入一个视频,编辑其中的音频,然后导出新的视频。它提供了许多内置插件,并且支持 VST 插件。 **特性:** * 非线性编辑 - * 垂直窗口堆叠,简单的页面导航 - * 静默消除功能(strip silence),推拉修剪功能(push-pull trimming),和用以短暂片段或基于基于音符开始的编辑的 Rhythm Ferret。 + * 垂直窗口堆叠,便于导航 + * 静默消除功能strip silence推拉修剪功能push-pull trimming,和用以短暂片段或基于基于音符开始的编辑的 Rhythm Ferret。 - - -#### 4\. Cecilia +#### 4、Cecilia ![Cecilia audio editor][6] -Cecilia 不是一个普通的音频编辑器。它的使用者一般是音效设计师或者正在努力成为音效设计师的人。 Cecilia 实际上是一个音频信号处理环境。它可以让你的作品余音绕梁。 +[Cecilia](http://ajaxsoundstudio.com/software/cecilia/) 不是一个普通的音频编辑器。它的使用者一般是音效设计师或者正在努力成为音效设计师的人。 Cecilia 实际上是一个音频信号处理环境。它可以让你的作品余音绕梁。 -你还可以得到内置的音效与合成模组和插件。 Cecilia 为一个明确的目的而生:如果你正在找音效设计工具,这是你的不二之选! +你还可以得到内置的音效与合成模组和插件。Cecilia 为一个明确的目的而生:如果你正在找音效设计工具,这是你的不二之选! **特性:** - * 利用模块来完成更多工作(UltimateGrainer——最先进的颗粒化处理工具,RandomAccumulator——记录变量速度的累加器,UpDistoRes——通过上采样和谐振低通滤波器创造失真效果的工具) + * 利用模块来完成更多工作(UltimateGrainer —— 最先进的颗粒化处理工具,RandomAccumulator —— 记录变量速度的累加器,UpDistoRes——通过上采样和谐振低通滤波器创造失真效果的工具) * 自动保存调制设定 - - -#### 5\. Mixxx +#### 5、Mixxx ![Mixxx audio DJ][7] -如果你想要在混合和录制一些东西的同时能够有一个虚拟的 DJ 工具,[Mixxx][8] 将是完美的工具。你可以用到 BPM,key,并使用主同步功能来匹配歌曲的节奏和节拍。另外,不要忘记它也是一个 Linux 的免费并开源的软件。 +如果你想要在混合和录制一些东西的同时能够有一个虚拟的 DJ 工具,[Mixxx](https://www.mixxx.org/) 将是完美的工具。你可以用到 BPM、音调,并使用主同步功能来匹配歌曲的节奏和节拍。另外,不要忘记它也是一个 Linux 的自由开源的软件。 -它还支持自定义 DJ 设备。所以,如果你有 DJ 设备或着 MIDI,你可以用这个工具录制你的现场混音。 +它还支持自定义 DJ 设备。所以,如果你有 DJ 设备或者 MIDI,你可以用这个工具录制你的现场混音。 **特性:** * 播送和录制你的歌曲的 DJ 混音 * 可以连接到你的设备并且现场演奏 - * Key 检测和 BPM 检测 + * 音调检测和 BPM 检测 - - -#### 6\. Rosegarden +#### 6、Rosegarden ![Rosegarden audio editor][9] -Rosegarden 是另一个令人赞叹的 Linux 的免费并开源的音频编辑器。它既不是一个功能齐全的 DAW,也不是一个基本的音频编辑工具。它是两者的混合体,并带有一些缩减的功能。 +[Rosegarden](https://www.rosegardenmusic.com/) 是另一个令人赞叹的 Linux 的自由开源的音频编辑器。它既不是一个功能齐全的 DAW,也不是一个基本的音频编辑工具。它是两者的混合体,并带有一些缩减的功能。 我不会向专业人士推荐这款软件,但如果你经营家庭音乐工作室或只是想体验一下,这将是 Linux 上可以安装的最好的音频编辑器之一。 **特性:** * 乐谱编辑 - * 记录、混合以及样本功能 + * 录音、混音以及采样 +### 小结 - -#### 小结 - -这些是你可以找到的 Linux 上的最棒的一些音频编辑器了。不论你是需要 DAW,一个剪切/粘贴的编辑工具,或者仅仅想要一个拥有基础混音和录音功能的音频编辑工具,上述软件都能够满足你的需求。 +这些是你可以找到的 Linux 上的最棒的一些音频编辑器了。不论你是需要 DAW,一个剪切/粘贴的编辑工具,或者仅仅想要一个拥有基础的混音和录音功能的音频编辑工具,上述软件都能够满足你的需求。 如果在这篇文章中我们遗漏了你最喜欢的一些音频工具,可以在原文下方评论中回复告诉我们。 - -------------------------------------------------------------------------------- via: https://itsfoss.com/best-audio-editors-linux @@ -138,7 +124,7 @@ via: https://itsfoss.com/best-audio-editors-linux 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[MFGJT](https://github.com/MFGJT) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1b8d3c34983c489c607b13d5d4feff837aec9127 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Apr 2020 17:46:09 +0800 Subject: [PATCH 0222/1809] PUB @MFGJT https://linux.cn/article-12095-1.html --- .../20190116 Best Audio Editors For Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190116 Best Audio Editors For Linux.md (99%) diff --git a/translated/tech/20190116 Best Audio Editors For Linux.md b/published/20190116 Best Audio Editors For Linux.md similarity index 99% rename from translated/tech/20190116 Best Audio Editors For Linux.md rename to published/20190116 Best Audio Editors For Linux.md index 0cf01bc796..a6977b7d73 100644 --- a/translated/tech/20190116 Best Audio Editors For Linux.md +++ b/published/20190116 Best Audio Editors For Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MFGJT) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12095-1.html) [#]: subject: (Best Audio Editors For Linux) [#]: via: (https://itsfoss.com/best-audio-editors-linux) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 559e9c6cad4ddb80f5a68450f86957cb8d761ad9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Apr 2020 20:40:29 +0800 Subject: [PATCH 0223/1809] =?UTF-8?q?=E5=9B=9E=E6=94=B6=E6=96=B0=E9=97=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...buntu- UBports is Renaming it to Lomiri.md | 91 ----------------- ... mobile OSes, and more open source news.md | 82 ---------------- ...ert inclusion, and more industry trends.md | 60 ------------ ... Largest Software Registry in the World.md | 78 --------------- ...an-based Games Capture Feature and More.md | 98 ------------------- ...in Kubernetes, and more industry trends.md | 70 ------------- 6 files changed, 479 deletions(-) delete mode 100644 sources/news/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md delete mode 100644 sources/news/20200314 Linux Foundation prepares for disaster, new anti-tracking data set, Mozilla goes back to mobile OSes, and more open source news.md delete mode 100644 sources/news/20200319 Tools for monitoring, introvert inclusion, and more industry trends.md delete mode 100644 sources/news/20200319 With npm Acquisition, Microsoft is Set to Own the Largest Software Registry in the World.md delete mode 100644 sources/news/20200322 OBS Studio 25.0 is Here With Vulkan-based Games Capture Feature and More.md delete mode 100644 sources/news/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md diff --git a/sources/news/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md b/sources/news/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md deleted file mode 100644 index 7badbfc8a2..0000000000 --- a/sources/news/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Remember Unity8 from Ubuntu? UBports is Renaming it to Lomiri) -[#]: via: (https://itsfoss.com/unity8-lomiri/) -[#]: author: (John Paul https://itsfoss.com/author/john/) - -Remember Unity8 from Ubuntu? UBports is Renaming it to Lomiri -====== - -Ever since Ubuntu abandoned the Unity project, UBports continued the maintenance and development of Unity. On February 27th 2020, [UBports][1] announced that they are giving Unity8 a new branding in the form of Lomiri. - -### Unity8 is now Lomiri - -![Unity8 in action | Image Credit: UBports][2] - -[UBports announced][3] that the Unity8 desktop environment would be renamed as Lomiri. They gave three reasons for this fairly drastic announcement. - -First, they want to avoid confusion with the [Unity game engine][4]. Quite a few people confused the two. UBports noted that they are frequently receiving questions regarding “how to import 3D models and meshes into our shell”. When you search “Unity” in your favorite search engine, most of the top links are for the game engine. - -The second reason for the name change has to do with the new effort to package Unity8 for Debian. Unfortunately, many of the Unity8’s dependencies have Ubuntu in the name, for example, _**ubuntu-ui-toolkit**_. Debian packagers warned that packages that have Ubuntu in the name may not be accepted into [Debian][5]. - -Finally, UBports said the name change would improve verbal communications. Saying Unity8 repeatedly can be a mouthful. People would not have to worry about confusing “users of Ubuntu Unity and Unity (the game engine)”. - -UBports went on to stress that the name change was not “triggered by any action from Canonical or the Ubuntu community, legal or otherwise”. - -They noted that this name change was the perfect time for them to switch to [GitHub alternative GitLab][6] for their development. - -Interestingly, the announcement did not explain how they picked Lomiri as the new name. All they said is that “We went through many different names before settling on Lomiri. All of them had problems with pronunciation, availability, or other related issues.” - -UBports noted that most Ubuntu Touch users would be unaffected by the name change. Developers and power users might notice some changes, but UBports “will strive to maintain backwards compatibility within Ubuntu Touch for the foreseeable future”. - -### What Exactly is Being Renamed? - -![][7] - -According to the announcement, packages that have either Ubuntu or Unity in the title will be affected. For example, - - * **unity8**, containing the shell, will become **lomiri** - * **ubuntu-ui-toolkit** will become **lomiri-ui-toolkit** - * **ubuntu-download-manager** will become **lomiri-download-manager** - - - -On top of this, interfaces call will change, as well. “For example, the **Ubuntu.Components** QML import will change to **Lomiri.Components**.” For the sake of backwards compatibility, Ubuntu Touch images will not change too much. “Developers will only need to update to the new API when they’d like to package their apps for other distributions.” - -### What Will Stay the Same? - -Since renaming packages can cause quite a few cascading problems, UBports wants to limit the number of packages they change. They don’t expect the following things to change. - - * Packages that don’t use the “Ubuntu” or “Unity” names - * Ubuntu Touch will remain the same - * Any components which are already used by other projects and accepted into other distributions - - - -### Final Thoughts - -![][8] - -Overall, I think this change will be good for Ubuntu Touch in the long run. I understand why [Canonical][9] picked the Unity name for their convergence desktop, but I think the desktop environment was overshadowed by the game engine from the beginning. This will give them room to breathe and also free up valuable coding time. The less time spent replying to questions about 3D models the more time that can be spent creating a convergent desktop. - -If you have any further questions or concerns about the name change, you visit the [UBports forms][10]. They have set up a thread specifically for this topic. - -Don’t hesitate to share our views on it in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/unity8-lomiri/ - -作者:[John Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/john/ -[b]: https://github.com/lujun9972 -[1]: https://ubports.com/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/unity8_ubports.png?ssl=1 -[3]: https://ubports.com/blog/ubports-blog-1/post/lomiri-new-name-same-great-unity8-265 -[4]: https://en.wikipedia.org/wiki/Unity_(game_engine) -[5]: https://www.debian.org/ -[6]: https://itsfoss.com/github-alternatives/ -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/Unity8-lomiri.png?ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/ubports.jpeg?ssl=1 -[9]: https://canonical.com/ -[10]: https://forums.ubports.com/topic/3874/unity8-is-now-lomiri diff --git a/sources/news/20200314 Linux Foundation prepares for disaster, new anti-tracking data set, Mozilla goes back to mobile OSes, and more open source news.md b/sources/news/20200314 Linux Foundation prepares for disaster, new anti-tracking data set, Mozilla goes back to mobile OSes, and more open source news.md deleted file mode 100644 index 0f3aa9a0a3..0000000000 --- a/sources/news/20200314 Linux Foundation prepares for disaster, new anti-tracking data set, Mozilla goes back to mobile OSes, and more open source news.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Linux Foundation prepares for disaster, new anti-tracking data set, Mozilla goes back to mobile OSes, and more open source news) -[#]: via: (https://opensource.com/article/20/3/news-march-14) -[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) - -Linux Foundation prepares for disaster, new anti-tracking data set, Mozilla goes back to mobile OSes, and more open source news -====== -Catch up on the biggest open source headlines from the past two weeks. -![][1] - -In this edition of our open source news roundup, we take a look at the Linux Foundation's disaster relief project, DuckDuckGo's anti-tracking tool, open textbooks, and more! - -### Linux Foundation unveils Project OWL - -When a disaster happens, it's vital to keep communications links up and running. One way to do that is with [mesh networks][2]. The Linux Foundation [has unveiled][3] Project OWL to "help build mesh network nodes for global emergency communications networks." - -Short for _Organisation, Whereabouts, and Logistics_, OWL is firmware for Internet of Things (IoT) devices that "can quickly turn a cheap wireless device into a ‘DuckLink’, a mesh network node". Those devices can connect to other, similar devices around them. OWL also provides an analytics tool that responders can use for "coordinating resources, learning about weather patterns, and communicating with civilians who would otherwise be cut off." - -### New open source tool to block web trackers - -It's no secret that sites all over the web track their visitors. Often, it's shocking how much of that goes on and what a threat to your privacy that is. To help web browser developers better protect their users, the team behind search engine DuckDuckGo is "[sharing data it's collected about online trackers with other companies so they can also protect your privacy][4]." - -That dataset is called Tracker Radar and it "details 5,326 internet domains used by 1,727 companies and organizations that track you online". Browser Radar is different from other tracker databases in that it "annotates data with other information, like whether blocking a tracker is likely to break a website, so anyone using it can pick the best balance of privacy and convenience." - -Tracker Radar's dataset is [available on GitHub][5]. The repository also links to the code for the [crawler][6] and [detector][7] that work with the data. - -### Oregon Tech embracing open textbooks - -With the cost of textbooks taking an increasingly large bite out of the budgets of university students, more and more schools are turning to open textbooks to cut those costs. By embracing open textbooks, the Oregon Institute of Technology has [save students $400,000][8] over the last two years. - -The school offers open textbooks for 26 courses, ranging "from chemistry and biology, to respiratory care, sociology and engineering." Although the textbooks are free, university librarian John Schoppert points out that the materials are of a high quality and that faculty members have been "developing lab manuals and open-licensed textbooks where they hadn’t existed before and improved on others’ materials." - -### Mozilla to help update feature phone OS - -A few years ago, Mozilla tried to break into the world of mobile operating systems with Firefox OS. While that effort didn't pan out, Firefox OS found new life powering low-cost feature phones under the name KaiOS. Mozilla's [jumping back into the game][9] by helping "modernize the browser engine that's core to the software." - -KaiOS is built upon a four-year-old version of Mozilla's Gecko browser engine. Updating Gecko will "improve security, make apps run faster and more smoothly, and open [KaiOS to] more-sophisticated apps and WebGL 2.0 for better games graphics." Mozilla said its collaboration will include "Mozilla's help with test engineering and adding new low-level Gecko abilities." - -#### In other news - - * [CERN adopts Mattermost, an open source messaging app][10] - * [Open-source software analyzes economics of biofuels, bioproducts][11] - * [Netflix releases Dispatch for crisis management orchestration][12] - * [FreeNAS and TrueNAS are merging][13] - * [Smithsonian 3D Scans NASA Space Shuttle Discovery And Makes It Open Source][14] - - - -Thanks, as always, to Opensource.com staff members and [Correspondents][15] for their help this week. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/news-march-14 - -作者:[Scott Nesbitt][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/scottnesbitt -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/weekly_news_roundup_tv.png?itok=tibLvjBd -[2]: https://en.wikipedia.org/wiki/Mesh_networking -[3]: https://www.smartcitiesworld.net/news/news/linux-announces-open-source-project-to-aid-disaster-relief-5102 -[4]: https://www.cnet.com/news/privacy-focused-duckduckgo-launches-new-effort-to-block-online-tracking/ -[5]: https://github.com/duckduckgo/tracker-radar -[6]: https://github.com/duckduckgo/tracker-radar-collector -[7]: https://github.com/duckduckgo/tracker-radar-detector -[8]: https://www.heraldandnews.com/news/local_news/oregon-tech-turns-to-open-source-materials-to-save-students/article_ba641e79-3034-5b9a-a8f7-b5872ddc998e.html -[9]: https://www.cnet.com/news/mozilla-helps-modernize-feature-phones-powered-by-firefox-tech/ -[10]: https://joinup.ec.europa.eu/collection/open-source-observatory-osor/news/cern-uses-mattermost -[11]: http://www.biomassmagazine.com/articles/16848/open-source-software-analyzes-economics-of-biofuels-bioproducts -[12]: https://jaxenter.com/netflix-dispatch-crisis-management-orchestration-169381.html -[13]: https://liliputing.com/2020/03/freenas-and-turenas-are-merging-open-source-operating-systems-for-network-attached-storage.html -[14]: https://www.forbes.com/sites/tjmccue/2020/03/04/smithsonian-3d-scans-the-nasa-space-shuttle-discovery-and-makes-it-open-source/#39aa0f243ecd -[15]: https://opensource.com/correspondent-program diff --git a/sources/news/20200319 Tools for monitoring, introvert inclusion, and more industry trends.md b/sources/news/20200319 Tools for monitoring, introvert inclusion, and more industry trends.md deleted file mode 100644 index 838a4e2c23..0000000000 --- a/sources/news/20200319 Tools for monitoring, introvert inclusion, and more industry trends.md +++ /dev/null @@ -1,60 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Tools for monitoring, introvert inclusion, and more industry trends) -[#]: via: (https://opensource.com/article/20/3/monitoring-introvert-industry-trends) -[#]: author: (Tim Hildred https://opensource.com/users/thildred) - -Tools for monitoring, introvert inclusion, and more industry trends -====== -A weekly look at open source community and industry trends. -![Person standing in front of a giant computer screen with numbers, data][1] - -As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. - -## [Top six open source tools for monitoring][2] - -> These tools are widely used in the tech industry, and they all have their benefits. Most of these solutions, however, require skilled implementation and ongoing manual maintenance that can be a burden for DevOps teams and a distraction from the business. There’s no one solution that can cater to all of your requirements, since each tool focuses on one or two specific aspects of observability and analysis. By mixing these tools together, you can derive a unique solution for your individual business needs.  - -**The impact**: If a container falls over in the cluster and there is no open source monitoring tool to see it, did it really happen? - -## [Introvert environment: What can we do?][3] - -> An example is its inclusive team dynamics programme, which consists of both information and guidance on everyday practices. Each team is required to appoint an inclusion champion, who ensures all members are given the space to contribute to discussions. Leaders are also encouraged not to speak first during meetings. - -**The impact**: If it is hard for you not to speak for a while in a meeting, that probably indicates you should be doing it more often. Will new WFH policies make this harder, or easier? Only time will tell. - -## [The difference between API Gateways and service mesh][4] - -> The service connectivity capabilities that service mesh provides are conflicting with the API connectivity features that an API gateway provides. However, because the ones provided by service mesh are more inclusive (L4 + L7, all TCP traffic, not just HTTP and not just limited to APIs but to every service), they are in a way more complete. But as we can see from the diagram above, there are also use cases that service mesh does not provide, and that is the “API as a product” use case as well as the full API management lifecycle, which still belong to the API gateway pattern. - -**The impact**: Another way of saying this is you can't make money from your service mesh directly, unlike your APIs. - -## [Open Policy Agent’s mission to secure the cloud][5] - -> While the cost of implementing OPA is a little high today, the technology pays for itself by providing more control and helping to secure systems. As OPA continues to be refined, we can expect implementation costs to fall, making an investment in OPA easier to justify. - -**The impact**: Compliance is expensive; large investments in it only make sense if non-compliance is even more so. - -_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/monitoring-introvert-industry-trends - -作者:[Tim Hildred][a] -选题:[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/thildred -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) -[2]: https://devops.com/top-six-open-source-tools-for-monitoring-kubernetes-and-docker/ -[3]: https://www.raconteur.net/hr/introverts-workplace -[4]: https://www.cncf.io/blog/2020/03/06/the-difference-between-api-gateways-and-service-mesh/ -[5]: https://thenewstack.io/open-policy-agents-mission-to-secure-the-cloud/ diff --git a/sources/news/20200319 With npm Acquisition, Microsoft is Set to Own the Largest Software Registry in the World.md b/sources/news/20200319 With npm Acquisition, Microsoft is Set to Own the Largest Software Registry in the World.md deleted file mode 100644 index 7e2d898bfe..0000000000 --- a/sources/news/20200319 With npm Acquisition, Microsoft is Set to Own the Largest Software Registry in the World.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (With npm Acquisition, Microsoft is Set to Own the Largest Software Registry in the World) -[#]: via: (https://itsfoss.com/microsoft-npm-acquisition/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -With npm Acquisition, Microsoft is Set to Own the Largest Software Registry in the World -====== - -Microsoft has been betting big on open source for past few years. Apart from open sourcing a few things here and there, Microsoft is contributing a lot to Linux kernel (for its Azure cloud platform). - -To further strengthen its position in the open source world, [Microsoft acquired the popular open source code hosting platform GitHub for $7.5 billion][1]. - -Now Microsoft owned GitHub [has acquired][2] [npm][3] ( short for Node Package Manager). npm is the [world’s largest software registry][4] with [more than 1.3 million packages that have 75 billion downloads a month][5]. - -![][6] - -If you are not familiar, npm is a package manager for JavaScript programming language, primarily the hugely popular open source [Node.js][7]. - -Though npm has scope of private repository for enterprises, most of the 1.3 million packages are open source and/or used in various open source projects. - -Both node.js and npm are used by big software and IT companies like IBM, Yahoo and big corporations like Netflix and PayPal. - -In case you are wondering, the acquisition amount has not been disclosed by either party. - -### Microsoft’s proposed plan for npm - -![][8] - -GitHub CEO Nat Friedman assured that Microsoft intends to keep the npm registry available as open-source and free to developers. - -Once the acquisition is complete, Microsoft is going to invest in the registry infrastructure and platform. It plans to improve the core experience of npm by adding new features like Workspaces, as well as bringing improvements to publishing and multi-factor authentication. - -Microsoft also intends to integrate GitHub and npm so that developers could trace a change from a GitHub pull request to the npm package version that fixed it. - -### Part of a larger plan - -First, [Microsoft bought GitHub][1], the platform that had the largest open source repositories and now npm, the largest software registry. Clearly, Microsoft is tightening its grip around open source projects. This could allow Microsoft to dictate the policies around these open source projects in future. - -When Microsoft acquired GitHub, several open source developers moved to [alternate platforms like GitLab][9] but GitHub remained the first choice for the developers. Microsoft did introduce some innovative features like security advisories, [package registry][10], [sponsorship][11] etc. Microsoft is expanding GitHub by forming communities around it specially in developing countries. Recently, [GitHub announced its Indian subsidiary][12] to specially attract young developers to its platform. - -So now Microsoft owns the professional social network [LinkedIn][13], developer oriented GitHub and npm. This indicates that Microsoft will continue its shopping spree and will acquire more open source related projects that have substantial developer population. - -What could be next then? WordPress because it is the [most popular open source CMS][14] and [runs 33% of the websites][15] on the internet? - -While we wait and watch for Microsoft’s next move, why not share your views on this development? Comment section is all yours. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/microsoft-npm-acquisition/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/microsoft-github/ -[2]: https://github.blog/2020-03-16-npm-is-joining-github/ -[3]: https://www.npmjs.com/ -[4]: https://www.linux.com/news/state-union-npm/ -[5]: https://www.zdnet.com/article/microsoft-buys-javascript-developer-platform-npm-plans-to-integrate-it-with-github/ -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/microsoft-github-npm.jpg?ssl=1 -[7]: https://nodejs.org/en/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/github-npm.jpg?ssl=1 -[9]: https://itsfoss.com/github-alternatives/ -[10]: https://github.blog/2019-05-10-introducing-github-package-registry/ -[11]: https://itsfoss.com/github-sponsors-program/ -[12]: https://github.blog/2020-02-12-announcing-github-india/ -[13]: https://www.linkedin.com/ -[14]: https://itsfoss.com/open-source-cms/ -[15]: https://wordpress.org/news/2019/03/one-third-of-the-web/ diff --git a/sources/news/20200322 OBS Studio 25.0 is Here With Vulkan-based Games Capture Feature and More.md b/sources/news/20200322 OBS Studio 25.0 is Here With Vulkan-based Games Capture Feature and More.md deleted file mode 100644 index afd9891678..0000000000 --- a/sources/news/20200322 OBS Studio 25.0 is Here With Vulkan-based Games Capture Feature and More.md +++ /dev/null @@ -1,98 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (OBS Studio 25.0 is Here With Vulkan-based Games Capture Feature and More) -[#]: via: (https://itsfoss.com/obs-studio-25-release/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -OBS Studio 25.0 is Here With Vulkan-based Games Capture Feature and More -====== - -_**Brief: Open source screen recording and streaming software OBS Studio 25.0 has just been released and it brings the ability to capture Vulkan-based games with game capture among other new features.**_ - -![][1] - -If you are into recording your desktop or streaming it, you might have heard of [OBS][2] (Open Broadcaster Software) Studio. It’s one of the [best screen recorder tools on Linux][3] and other operating systems. - -But OBS is more than just a simple screen recorder. It also provides all the stuff you need for streaming your recordings. - -### New features in OBS Studio 25.0 - -![OBS 25.0][4] - -OBS Studio has released it’s latest version 25.0 with plenty of new features to make your recording and streaming experience better. Let’s take a look at some of the main new features: - - * Capture Vulkan-based games with game capture - * New capture method to window capture which allows capturing browsers, browser-based windows, and UWP programs - * Advanced scene collection importing allows you to import from other common streaming programs - * Media source hotkeys to allow control of playback - * Ability to drag and drop URLs to create browser sources - * Support for the [SRT protocol][5] - * Ability to lock volume values of audio sources in the mixer - * Support for certain devices that can automatically rotate their camera output such as the Logitech StreamCam - * System tray icon to show when the recording is paused - * Help icons when an property has a tooltip associated with it - - - -Apart from there, there are plenty of bug features and minor changes that you may follow in the [release notes][6]. - -### Install OBS Studio 25.0 on Linux - -OBS Studio is a cross-platform software and is also available for Windows and macOS in addition to Linux. You can download it from its official website. - -[Download OBS Studio 25.0][7] - -For Linux, you can grab the source code and build it your self. I know that’s not very convenient for everyone. The good news is that you can install the latest OBS version using Snap or Flatpak packages. - -On Ubuntu or any other [Linux distribution with Snap support][8], you can use the following command: - -``` -sudo snap install obs-studio -``` - -If your distribution supports Fltapak packages, you can get it from Flathub website: - -[OBS Studio on Flathub][9] - -For Ubuntu users, there is also the official PPA for easily installing it. In a terminal, you can enter the following command one by one: - -``` -sudo add-apt-repository ppa:obsproject/obs-studio -sudo apt update -sudo apt install obs-studio -``` - -You can [learn about deleting PPA here][10]. - -Personally, I haven’t used OBS much though I have heard great stuff about it. I don’t live stream but I do record my desktop to create tutorial and information Linux videos on I[t’s FOSS YouTube channel][11] (you should subscribe to it if you haven’t already). For that, I [use Kazam][12] which I find simpler to use. - -Do you use OBS Studio? Which features you like the most? Do share your views. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/obs-studio-25-release/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/obs_logo_icon_small.png?resize=150%2C150&ssl=1 -[2]: https://obsproject.com/ -[3]: https://itsfoss.com/best-linux-screen-recorders/ -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/obs-25-ubuntu.png?ssl=1 -[5]: https://en.wikipedia.org/wiki/Secure_Reliable_Transport -[6]: https://github.com/obsproject/obs-studio/releases/tag/25.0.0 -[7]: https://obsproject.com/download -[8]: https://itsfoss.com/install-snap-linux/ -[9]: https://flathub.org/apps/details/com.obsproject.Studio -[10]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/ -[11]: https://www.youtube.com/channel/UCEU9D6KIShdLeTRyH3IdSvw -[12]: https://itsfoss.com/kazam-screen-recorder/ diff --git a/sources/news/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md b/sources/news/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md deleted file mode 100644 index 3a7671da2c..0000000000 --- a/sources/news/20200325 npm joins GitHub, building operators in Kubernetes, and more industry trends.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (npm joins GitHub, building operators in Kubernetes, and more industry trends) -[#]: via: (https://opensource.com/article/20/3/npm-github-operators-kubernetes-industry-trends) -[#]: author: (Tim Hildred https://opensource.com/users/thildred) - -npm joins GitHub, building operators in Kubernetes, and more industry trends -====== -A weekly look at open source community and industry trends. -![Person standing in front of a giant computer screen with numbers, data][1] - -As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. - -## [npm is joining GitHub][2] - -> Looking further ahead, we’ll integrate GitHub and npm to improve the security of the open source software supply chain, and enable you to trace a change from a GitHub pull request to the npm package version that fixed it. Open source security is an important global issue, and with the recent launch of the [GitHub Security Lab][3] and GitHub’s built-in [security advisories][4], we are well-positioned to make a difference. In addition, [GitHub Sponsors][5] has already paid out millions of dollars to open source contributors, and we’re excited to explore tasteful ways to extend it to the npm ecosystem. - -**The impact**: Open source supply chain security is a big problem that probably needs a lot more resources thrown at it. - -## [Why and how to build operators in Kubernetes][6] - -> For cluster administrators managing large clusters, this proliferation of development methodologies and management interfaces can be problematic. The class of applications that Operators were developed to manage are almost always part of a larger application stack, with dependencies between them. If we have a lot of Operators written in different ways running on our clusters, how can we ensure they will interoperate with each other, and how do we validate and test them? - -**The impact**: This illustrates two cool things about open source. First, the alternating waves of innovation and consolidation. Second, the empowering of affected parties to address their own challenges. - -## [Automation for improved security frameworks][7] - -> In recent years we’ve seen the posts of CIO and CTO elevated to boardroom level, with senior figures in IT now influencing corporate strategy. Due to a heightened awareness of cybersecurity, it won’t be long before the board looks to CSO and CISO executives for strategic direction. - -**The impact**: This statement has gotten truer over the last several weeks. More activity is being pushed online than ever before; keeping that activity secure is integral to making it all profitable. Security people need to be able to say "no" at the highest possible level. - -## [Interoperability of open source tools: The emergence of interfaces][8] - -> Being non-opinionated about the adoption of specific technologies and the methodologies of distributing its primitive resources, were the main axes of Kubernetes evolution. Additionally, the proliferation of solutions from multiple vendors played an instrumental role in the emergence of interfaces and it served as the engine for further development and innovation. - -**The impact**: Kubernetes may be the only large-scale open source project where competition is hot. Even still, competitors need to be able to work together and interfaces are the points that separate collaboration and competition. - -## [Do you operate OpenStack? Take this survey.][9] - -> Direct feedback from the individuals and organizations operating OpenStack helps the upstream development community know what features to prioritize and which bugs to fix first, among other important learnings on how the software is being used. Each of the official project teams has the opportunity to add a question to the survey as well as review anonymized data and trends to further influence their roadmaps. - -**The impact**: Not every community participant can or will provide feedback on bug reports or feature requests. In that case, it is important to provide multiple ways to get feedback and meet users where they are. - -_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/npm-github-operators-kubernetes-industry-trends - -作者:[Tim Hildred][a] -选题:[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/thildred -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) -[2]: https://github.blog/2020-03-16-npm-is-joining-github/ -[3]: https://securitylab.github.com -[4]: https://help.github.com/en/github/managing-security-vulnerabilities/creating-a-security-advisory -[5]: https://github.com/sponsors -[6]: https://devops.com/day-2-for-the-operator-ecosystem/ -[7]: https://www.infosecurity-magazine.com/opinions/automation-governance-culture/ -[8]: https://medium.com/@kgamanji/interoperability-of-open-source-tools-the-emergence-of-interfaces-f3b7a90891e4 -[9]: https://superuser.openstack.org/articles/operate-openstack-take-the-survey-heres-why-it-matters/ From 6574f187f5b36e6f5b52671692865622def3dd25 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Apr 2020 21:02:06 +0800 Subject: [PATCH 0224/1809] APL --- ...ssociation Launches an Open Source Collaboration Platform.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md b/sources/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md index 9a6eadffad..d3010bed2d 100644 --- a/sources/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md +++ b/sources/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f8d1047052c3a5587897492820fd208f6e24664c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Apr 2020 21:53:03 +0800 Subject: [PATCH 0225/1809] TSL&PRF --- ...s an Open Source Collaboration Platform.md | 93 ------------------- ...s an Open Source Collaboration Platform.md | 91 ++++++++++++++++++ 2 files changed, 91 insertions(+), 93 deletions(-) delete mode 100644 sources/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md create mode 100644 translated/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md diff --git a/sources/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md b/sources/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md deleted file mode 100644 index d3010bed2d..0000000000 --- a/sources/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (IEEE Standards Association Launches an Open Source Collaboration Platform) -[#]: via: (https://itsfoss.com/ieee-open-source-collaboration-platform/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -IEEE Standards Association Launches an Open Source Collaboration Platform -====== - -_**Brief: IEEE Standards Association has announced a GitLab-based open source collaboration platform. Read how is it different and what advantages it has.**_ - -[IEEE][1] is the world’s largest technical professional organization dedicated to advancing technology. The IEEE Standards Association (IEEE SA) is an organization within IEEE that develops global standards in a broad range of industries. - -The IEEE Standards Association (SA) has come up with an open-source collaboration platform i.e [IEEE SA Open][2]. - -It is technically a self-hosted GitLab instance combined with [Mattermost][3] (a [slack alternative][4]) and [GitLab Pages][5]. To describe it further, the [official blog post][6] mentioned: - -> The platform enables independent software developers, startups, industry, academic institutions, and others to create, test, manage, and deploy innovative projects in a collaborative, safe, and responsible environment. - -### How is it different or useful? - -The main key attraction for this platform would be IEEE’s members’ network, technical expertise, and resources. - -IEEE President, [Robert Fish][7], also mentions in brief (during an interview with Radio Kan) how it’s different and why IEEE wanted to go with it: - -> Today, much of the world’s infrastructure is run by software, and that software needs to comply with standards in communications networking, electrical grids, agriculture, and the like. - -It makes sense – if we want to improve standardizing technologies, it highly depends on the software. So, this definitely sounds like something to standardize innovative open-source projects to gear them up for potential capital opportunities as well. - -IEEE also clarified that: - -> As software becomes increasingly prevalent in the world today, ethical alignment, reliability, transparency, and democratic governance become must-haves. IEEE is uniquely positioned to endow open-source projects with these attributes. - -While this sounds good, what exactly the open-source platform by the IEEE offer? Let’s take a look at that: - -### IEEE SA Open: Quick overview - -![][8] - -To start with, it is open to all and completely free to use. You just need to create an [IEEE account][9] and then [sign in to the open-source platform][10] to get started. - -Along with the benefits associated with IEEE’s extensive network of Members, you can also expect guidance support from their open-source community managers or community members. - -![Ieee Gitlab][11] - -The platform presents use cases for both standard and non-standard projects, so you can give it a try. - -For its choice to go with GitLab combined with Mattermost and Pages, you get a couple of useful features, they are: - - * Project planning and management features - * Source code management - * Testing, code quality, and continuous integration features - * Docker container registry and Kubernetes integration - * Application release and delivery features - * Integrated Mattermost chat forum w/slash commands; (Android and iPhone apps are fully supported) - * Capable of bridging the gap between Standards development and open source communities to allow for the advancement of nimble and creative technical solutions at a faster pace - * A safe open space with an enforced code of conduct - - - -### Wrapping Up - -It’s obviously a good thing to have more platforms to potentially amplify the exposure of open-source projects – hence, IEEE’s initiative sounds promising to start with. - -What do you think about it? Let me know your thoughts! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ieee-open-source-collaboration-platform/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://www.ieee.org/about/index.html -[2]: https://standards.ieee.org/content/ieee-standards/en/initiatives/opensource/ -[3]: https://mattermost.com/ -[4]: https://itsfoss.com/open-source-slack-alternative/ -[5]: https://docs.gitlab.com/ee/user/project/pages/ -[6]: https://spectrum.ieee.org/the-institute/ieee-products-services/ieee-standards-association-launches-a-platform-for-open-source-collaboration -[7]: https://www.linkedin.com/in/robertsfish/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/ieee-opensource.jpg?ssl=1 -[9]: https://www.ieee.org/profile/public/createwebaccount/showRegister.html -[10]: https://opensource.ieee.org/ -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/ieee-gitlab.jpg?ssl=1 diff --git a/translated/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md b/translated/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md new file mode 100644 index 0000000000..bb64b0e9df --- /dev/null +++ b/translated/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IEEE Standards Association Launches an Open Source Collaboration Platform) +[#]: via: (https://itsfoss.com/ieee-open-source-collaboration-platform/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +IEEE 标准协会推出开源协作平台 +====== + +> IEEE 标准协会宣布了一个基于 GitLab 的开源协作平台。 + +[IEEE][1] 是世界上最大的技术专业组织,致力于推动技术的发展。IEEE 标准协会the IEEE Standards Association(IEEE SA)是 IEEE 内部的一个组织,负责制定全球各行业的标准。 + +IEEE 标准协会(SA)提出了一个开源协作平台,即 [IEEE SA Open][2]。 + +技术上来说,它是一个自托管的 GitLab 实例,结合了 [Mattermost][3](一个 [Slack 的替代品][4])和 [GitLab Pages][5]。[其官方博文][6]对此进一步解释道: + +> 该平台使独立软件开发者、初创企业、业界、学术机构等能够在一个协作、安全、负责任的环境中创建、测试、管理和部署创新项目。 + +### 它有什么不同或有用的地方? + +这个平台最主要的吸引力应该是 IEEE 的会员网络、技术专长和资源。 + +IEEE 主席 [Robert Fish][7],也曾(在接受 Radio Kan 的采访时)简单地提到它有什么不同之处,以及为什么 IEEE 想要使用它。 + +> 如今,世界上大部分的基础设施都是由软件运行的,而这些软件需要符合通信网络、电网、农业等方面的标准。 + +这是有道理的 —— 如果我们想提高标准化技术,这在很大程度上取决于软件。所以,这听起来肯定是要对创新的开源项目进行标准化,让它们也能为潜在的资本机会做好准备。 + +IEEE 还澄清说: + +> 随着软件在当今世界越来越普遍,道德规范、可靠性、透明度和民主治理成为必须具备的条件。IEEE 在赋予开源项目这些属性方面有着得天独厚的优势。 + +虽然听起来很好,但 IEEE 的开源平台究竟能提供什么?让我们一起来看看这个问题。 + +### IEEE SA Open 概览 + +![][8] + +首先,它对所有人开放并且完全免费使用。你只需要创建一个 [IEEE 帐户][9],然后[登录到这个开源平台][10]就可以开始。 + +除了与 IEEE 广泛的会员网络相关的好处之外,你还可以期望其开源社区经理或社区成员提供指导性支持。 + +![Ieee Gitlab][11] + +该平台提供了标准和非标准项目的用例,你可以尝试一下。 + +因为选择将 GitLab 与 Mattermost 和 Pages 结合起来,你可以获得一些有用的功能,它们是: + + * 项目规划和管理功能 + * 源代码管理 + * 测试、代码质量和持续集成功能 + * Docker 容器注册库和 Kubernetes 集成 + * 应用程序的发布和交付功能 + * 集成了 Mattermost 聊天论坛的斜线命令(完全支持 Android 和 iPhone 应用程序) + * 能够弥合标准制定和开源社区之间的差距,以便以更快的速度推进灵活和创造性的技术解决方案 + * 安全的开放空间,并有严格的行为准则。 + +### 小结 + +显然,有更多的平台来潜在地放大开源项目的曝光率是一件好事 —— 因此,IEEE 的举措听起来很有希望。 + +你对此有何看法?让我知道你的想法吧! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ieee-open-source-collaboration-platform/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.ieee.org/about/index.html +[2]: https://standards.ieee.org/content/ieee-standards/en/initiatives/opensource/ +[3]: https://mattermost.com/ +[4]: https://itsfoss.com/open-source-slack-alternative/ +[5]: https://docs.gitlab.com/ee/user/project/pages/ +[6]: https://spectrum.ieee.org/the-institute/ieee-products-services/ieee-standards-association-launches-a-platform-for-open-source-collaboration +[7]: https://www.linkedin.com/in/robertsfish/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/ieee-opensource.jpg?ssl=1 +[9]: https://www.ieee.org/profile/public/createwebaccount/showRegister.html +[10]: https://opensource.ieee.org/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/ieee-gitlab.jpg?ssl=1 From a757d8cb078e646abdd98194606708288c4ec948 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Apr 2020 22:29:54 +0800 Subject: [PATCH 0226/1809] PUB @wxy https://linux.cn/article-12096-1.html --- ...tion Launches an Open Source Collaboration Platform.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename {translated/news => published}/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md (96%) diff --git a/translated/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md b/published/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md similarity index 96% rename from translated/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md rename to published/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md index bb64b0e9df..891edf7bdb 100644 --- a/translated/news/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md +++ b/published/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12096-1.html) [#]: subject: (IEEE Standards Association Launches an Open Source Collaboration Platform) [#]: via: (https://itsfoss.com/ieee-open-source-collaboration-platform/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) @@ -12,6 +12,8 @@ IEEE 标准协会推出开源协作平台 > IEEE 标准协会宣布了一个基于 GitLab 的开源协作平台。 +![](https://img.linux.net.cn/data/attachment/album/202004/10/222910vjpiqd6lqqm6riqp.jpg) + [IEEE][1] 是世界上最大的技术专业组织,致力于推动技术的发展。IEEE 标准协会the IEEE Standards Association(IEEE SA)是 IEEE 内部的一个组织,负责制定全球各行业的标准。 IEEE 标准协会(SA)提出了一个开源协作平台,即 [IEEE SA Open][2]。 From 8644fda421837db548933a91ca861d2ca3009106 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Fri, 10 Apr 2020 22:46:43 +0800 Subject: [PATCH 0227/1809] hankchow translated --- ...ow to Go Full Dark Mode in Ubuntu 20.04.md | 111 ------------------ ...ow to Go Full Dark Mode in Ubuntu 20.04.md | 108 +++++++++++++++++ 2 files changed, 108 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md create mode 100644 translated/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md diff --git a/sources/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md b/sources/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md deleted file mode 100644 index e668ac6d00..0000000000 --- a/sources/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md +++ /dev/null @@ -1,111 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Go Full Dark Mode in Ubuntu 20.04) -[#]: via: (https://itsfoss.com/dark-mode-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Go Full Dark Mode in Ubuntu 20.04 -====== - -One of the most talked about [new features in Ubuntu 20.04][1] is the dark mode. You can [install dark theme in any Ubuntu version][2] to give it a dark look but the new Ubuntu 20.04 makes it a lot easier. - -You don’t need to install themes on your own. You can find three variants of the default theme (called Yaru) and you can enable the dark mode from the settings. - -It still leaves a few thing to I am going to show you some tips on giving complete dark mode to your Ubuntu system. - -### Enable dark mode in Ubuntu 20.04 - -[Subscribe to our YouTube channel for more Linux videos][3] - -The steps are performed on the GNOME desktop. If you are [using some other desktop environment][4], the screenshots may look different. - -Press the super key (Windows key) and start typing settings to search for the Settings application. - -![Search for Settings][5] - -In the Settings application, go to Apperance section and you should see three variants of the theme: Light, Standard and Dark. No prizes for guessing that you need to select Dark if you want to use the dark mode. - -![Enable Dark Theme in Ubuntu][6] - -Not all but applications using GTK3 should automatically comply with the dark theme. In other words, you’ll notice that most of the applications like text editor, terminal, LibreOffice etc on your system automatically switch to dark mode. - -But it still leaves a few thing in the light mode. Let me show you a couple of tips to ‘go to the darker side’. - -### Tweaks to go full dark mode in Ubuntu 20.04 - -You’ll notice that the shell theme is still light. The message tray, system tray (in the top panel) are still not using dark mode. - -![No Dark Shell by default in Ubuntu][7] - -You’ll have to [use a GNOME extension][8] here that will let you install Yaru dark shell theme. Install the browser extension first by using this command in terminal ([use Ctrl+Alt+T keyboard shortcut for terminal in Ubuntu][9]). - -``` -sudo apt install chrome-gnome-shell -``` - -Now [go to the extension’s webpage][10] and enable the extension by switching it on: - -![Enable User Themes GNOME Extension][11] - -You need to [install GNOME Tweaks tool][12] by using this command: - -``` -sudo apt install gnome-tweaks -``` - -Open the GNOME Tweaks tool and go to Appearance. You’ll see the option to change the shell theme. You don’t need to install this Yaru dark shell theme. It’s already there. You just have to enable it. - -![Enable Yaru Dark Shell Theme in Ubuntu][13] - -Now, you can see that even the shell features like desktop notifications, message tray, system tray are also in dark mode. - -![Yaru Dark Shell Theme in Ubuntu][14] - -Looks better, isn’t it? There is one more thing you could do to further enjoy dark mode in Ubuntu. You’ll notice that the websites you visit still have white background. You cannot expect all the websites to provide a dark mode. - -This is where you can use a browser extension like [Dark Reader][15]. John has already discussed it in the tutorial on [enabling dark mode in Firefox][16]. It’s not a complicated task. If you use Firefox, Chrome or [Chromium in Ubuntu][17], you can install the browser extension listed on the [Dark Reader website][15]. - -Once you have installed Dark Reader, all the websites you visit should be in dark mode automatically. - -![It’s FOSS Homepage in Dark Mode with Dark Reader][18] - -You may still find a few external third party applications using light theme. You may have to manually enable dark theme, if they have such an option available. - -Dark mode is getting popular these days even among the non-coders. With these tips, you can satisfy your craving of dark mode in Ubuntu. - -I hope you like it. Enjoy the dark mode. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/dark-mode-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/ubuntu-20-04-release-features/ -[2]: https://itsfoss.com/install-themes-ubuntu/ -[3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[4]: https://itsfoss.com/find-desktop-environment/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/settings-search-ubuntu-20-04.jpg?ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-dark-theme-ubuntu.png?ssl=1 -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/no-dark-shell-ubuntu.jpg?ssl=1 -[8]: https://itsfoss.com/gnome-shell-extensions/ -[9]: https://itsfoss.com/ubuntu-shortcuts/ -[10]: https://extensions.gnome.org/extension/19/user-themes/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-user-themes-gnome.jpg?ssl=1 -[12]: https://itsfoss.com/gnome-tweak-tool/ -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-yaru-dark-shell-theme.jpeg?ssl=1 -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/yaru-dark-shell-theme-ubuntu.jpg?ssl=1 -[15]: https://darkreader.org/ -[16]: https://itsfoss.com/firefox-dark-mode/ -[17]: https://itsfoss.com/install-chromium-ubuntu/ -[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/itsfoss_dark_mode.jpg?ssl=1 diff --git a/translated/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md b/translated/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md new file mode 100644 index 0000000000..9d0223efa8 --- /dev/null +++ b/translated/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Go Full Dark Mode in Ubuntu 20.04) +[#]: via: (https://itsfoss.com/dark-mode-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +在 Ubuntu 20.04 中完全进入深色模式 +====== + +> 深色模式是 Ubuntu 20.04 最受瞩目的[新功能][1]之一了。任何版本的 Ubuntu 都可以通过[安装深色主题][2]让用户界面拥有一个深色的外观,但在 Ubuntu 20.04 中,这个过程变得更简单。 + +在 Ubuntu 20.04 中,无需额外安装主题,默认主题(称为 Yaru)本身就带有三种模式,其中就包括深色模式。 + +下面我会展示如何将 Ubuntu 系统完全设置为深色模式。 + +### 在 Ubuntu 20.04 打开深色模式 + +这个步骤将会在 GNOME 桌面上完成,如果你[使用的是其它桌面][4],你看到的可能会和下面的截图不一样。 + +按下 super 键(或 Windows 键),然后输入“settings”,就可以找到系统设置。 + +![Search for Settings][5] + +在系统设置中,进入“外观Appearance”部分,就可以看到浅色light标准standard深色dark三个选项。既然要使用深色模式,那自然而然要选择“深色”这个选项了。 + +![Enable Dark Theme in Ubuntu][6] + +完成设置以后,使用了 GTK3 的应用程序都可以跟随深色模式。因此你会看到系统中包括文本编辑器、终端、LibreOffice 等在内的大多数应用程序都已经切换成深色了。但未使用 GTK3 的应用程序可能并没有跟随进入深色模式,下面我会展示如何更完整地进入深色模式。 + +### 继续调整,进入完整深色模式 + +这个时候你会发现,shell 主题、屏幕顶部面板中的消息托盘和系统托盘还仍然保持在原有的模式当中。 + +![No Dark Shell by default in Ubuntu][7] + +现在就需要使用 [GNOME 扩展][8]安装 Yaru 深色 shell 主题了。[在 Ubuntu 中通过 Ctrl+Alt+T 打开终端][9],然后执行以下这个命令安装浏览器扩展: + +``` +sudo apt install chrome-gnome-shell +``` + +进入[扩展页面][10]启用这个扩展: + +![Enable User Themes GNOME Extension][11] + +执行以下命令安装 [GNOME 调整工具][12]: + +``` +sudo apt install gnome-tweaks +``` + +打开 GNOME 调整工具,进入“外观Appearance”部分,就可以看到 shell 主题的选项,现在只需要把它启用就可以了。 + +![Enable Yaru Dark Shell Theme in Ubuntu][13] + +设置完之后再观察一下,桌面通知、消息托盘、系统托盘等等都已经进入深色模式了。 + +![Yaru Dark Shell Theme in Ubuntu][14] + +现在感觉好多了。但你可能还会注意到,在使用浏览器访问网站的时候,很多网站都使用了白色的背景色。如果期望网站方提供深色模式,那是很不现实的,但我们可以自己实现这一件事。 + +你需要用到的东西就是诸如 [Dark Reader][15] 这样的浏览器扩展。《[在 Firefox 中启用深色模式][16]》这篇文章中也有讨论过这个浏览器扩展,它的使用过程并不复杂,如果你使用的浏览器是 Firefox、Chrome 或 [Ubuntu 下的 Chromium][17],就可以直接安装[其官方网站][15]上列出的扩展。 + +Dark Reader 安装完成后,就会以深色模式打开网站了。 + +![It’s FOSS Homepage in Dark Mode with Dark Reader][18] + +当然,有些外部的第三方应用程序可能仍然是浅色状态。如果它们自己附带了深色模式的选项,就需要手动启用它们的深色模式。 + +如今,深色模式在非开发者人群中也越来越流行了。按照以上的步骤,你就可以轻松进入深色模式。 + +请享受深色模式。 + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/dark-mode-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-20-04-release-features/ +[2]: https://itsfoss.com/install-themes-ubuntu/ +[3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[4]: https://itsfoss.com/find-desktop-environment/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/settings-search-ubuntu-20-04.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-dark-theme-ubuntu.png?ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/no-dark-shell-ubuntu.jpg?ssl=1 +[8]: https://itsfoss.com/gnome-shell-extensions/ +[9]: https://itsfoss.com/ubuntu-shortcuts/ +[10]: https://extensions.gnome.org/extension/19/user-themes/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-user-themes-gnome.jpg?ssl=1 +[12]: https://itsfoss.com/gnome-tweak-tool/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-yaru-dark-shell-theme.jpeg?ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/yaru-dark-shell-theme-ubuntu.jpg?ssl=1 +[15]: https://darkreader.org/ +[16]: https://itsfoss.com/firefox-dark-mode/ +[17]: https://itsfoss.com/install-chromium-ubuntu/ +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/itsfoss_dark_mode.jpg?ssl=1 From 138e53ed1e58bd5bb846c85107a1c82b9fb763cd Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sat, 11 Apr 2020 00:05:05 +0800 Subject: [PATCH 0228/1809] Update 20190814 9 open source cloud native projects to consider.md --- ...ource cloud native projects to consider.md | 41 +++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/sources/tech/20190814 9 open source cloud native projects to consider.md b/sources/tech/20190814 9 open source cloud native projects to consider.md index 551c8df7d1..7e844d2605 100644 --- a/sources/tech/20190814 9 open source cloud native projects to consider.md +++ b/sources/tech/20190814 9 open source cloud native projects to consider.md @@ -160,7 +160,7 @@ The best way to get started with Prometheus is to check out its [GitHub repo][10 ### Envoy Envoy (or Envoy Proxy) is an open source edge and service proxy designed for cloud-native applications. Created at Lyft, Envoy is a high-performance, C++, distributed proxy designed for single services and applications, as well as a communications bus and a universal data plane designed for large microservice service mesh architectures. Built on the learnings of solutions such as Nginx, HAProxy, hardware load balancers, and cloud load balancers, Envoy runs alongside every application and abstracts the network by providing common features in a platform-agnostic manner. -Envoy(或Envoy代理)是专为云原生应用设计的开源的边缘和服务代理。 由Lyft创建的Envoy是为单一服务和应用而设计的高性能的C++分布式代理,同时也是为由大量微服务组成的服务网格架构而设计的通信总线和通用数据平面。 基于对Nginx,HAProxy,硬件负载均衡器和云负载均衡器等方案了解的基础上,Envoy与每个应用相伴运行,并对网络进行了高度抽象,最终以平台无关的方式来提供通用功能。 +Envoy(或Envoy代理)是专为云原生应用设计的开源的边缘代理和服务代理。 由Lyft创建的Envoy是为单一服务和应用而设计的高性能的C++分布式代理,同时也是为由大量微服务组成的服务网格架构而设计的通信总线和通用数据平面。 基于对Nginx,HAProxy,硬件负载均衡器和云负载均衡器等方案了解的基础上,Envoy与每个应用相伴(并行)运行,并对网络进行了高度抽象,最终以平台无关的方式来提供通用功能。 When all service traffic in an infrastructure flows through an Envoy mesh, it becomes easy to visualize problem areas via consistent observability, tune overall performance, and add substrate features in a single place. Basically, Envoy Proxy is a service mesh tool that helps organizations build a fault-tolerant system for production environments. 当基础设施中的所有服务流量都经过一个Envoy网格时,很容易就可以通过连贯的监测来可视化问题域,调整整体性能,并在单个位置添加基础功能。基本上,Envoy代理是一个可帮助组织为生产环境构建容错系统的服务网格工具。 @@ -176,9 +176,9 @@ There are numerous alternatives for service mesh applications, such as Uber’s 服务网格应用程序有很多替代方案,例如Uber的[Linkerd][24](下面会讨论)和[Istio][25]。 Istio通过将其部署为[Sidecar][26]并利用了[Mixer][27]的配置模型,实现了对Envoy的扩展。 Envoy的显著特性有: - *所有的“桌面赌注”特性(与控制平面(例如Istio)配对时) - *带载运行时的低延时, 延迟率低至99% - *将L3/L4过滤器作为核心,许多L7过滤器被考虑在外 + *所有的“table stakes(入场筹码,引申为基础必备特性)”特性(与控制平面(例如Istio)组合时) + *带载运行时99%数据可达到低延时 + *将L3/L4过滤器作为核心,支持额外的L7过滤器 *支持gRPC和HTTP / 2(上行/下行)    *由API驱动,并支持动态配置和热重载 *重点关注指标收集,跟踪和整体可监测性 @@ -187,29 +187,34 @@ There are numerous alternatives for service mesh applications, such as Uber’s Understanding Envoy, proving its capabilities, and realizing its full benefits require extensive experience with running production-level environments. You can learn more in its [detailed documentation][28] and by accessing its [GitHub][11] repository. 要想了解Envoy,证实其能力并意识到其全部优势,需要丰富的在生产级环境运行的经验。 您可以在[详细文档][28]或访问其[GitHub][11]仓库了解更多信息。 -## Incubating projects +## Incubating projects 孵化项目 -Following are six of the most popular open source CNCF Incubating projects. +Following are six of the most popular open source CNCF Incubating projects. +下面是最流行的开源的CNCF孵化项目中的六个。 ### rkt rkt, pronounced "rocket," is a pod-native container engine. It has a command-line interface (CLI) for running containers on Linux. In a sense, it is similar to other containers, like [Podman][29], Docker, and CRI-O. +rkt, 拼为"rocket", 是一个pod原生的容器引擎。它有一个命令行接口用来在Linux上运行容器。从某种意义上讲,它和其他容器如[Podman][29], Docker和CRI-O相似。 rkt was originally developed by CoreOS (later acquired by Red Hat), and you can find detailed [documentation][30] on its website and access the source code on [GitHub][12]. +rkt最初由CoreOS开发(后来被Red Hat收购),您可以在其网站上找到详细的[文档][30],以及在[GitHub][12]上访问其源代码。 -### Jaeger +### Jaeger Jaeger is an open source, end-to-end distributed tracing system for cloud-native applications. In one way, it is a monitoring solution like Prometheus. Yet it is different because its use cases extend into: +Jaeger是面向云原生应用的开源的端到端的分布式跟踪系统。 在某种程度上,它是像Prometheus这样的监控解决方案。但它有所不同,因为其使用场景有所扩展: - * Distributed transaction monitoring - * Performance and latency optimization - * Root-cause analysis - * Service dependency analysis - * Distributed context propagation + * Distributed transaction monitoring 分布式事务监控 + * Performance and latency optimization 性能和延时优化 + * Root-cause analysis 根因分析 + * Service dependency analysis 服务的依赖分析 + * Distributed context propagation 分布式上下文传播 Jaeger is an open source technology built by Uber. You can find [detailed documentation][31] on its website and its [source code][13] on GitHub. +Jaeger是Uber建立的开源的技术。 您可以在其网站上找到[详细文档][31],以及在GitHub上找到其[源码][13]。 ### Linkerd @@ -221,9 +226,17 @@ However, there are some subtle differences between the two. While Envoy and Link * Built-in service discovery abstractions to unite multiple systems * Support for gRPC, HTTP/2, and HTTP/1.x requests plus all TCP traffic +像创建Envoy代理的Lyft一样,Uber开发了Linkerd开源解决方案用于生产级别上的服务维护。 在某些方面,Linkerd就像Envoy一样,因为两者都是服务网格工具,旨在提供平台级的可观测性,可靠性和安全性,而无需进行配置或代码更改。 + +但是,两者之间存在一些细微的差异。 尽管Envoy和Linkerd充当代理并可以通过所连接的服务进行上报,但是Envoy并不像Linkerd那样被设计为Kubernetes Ingress控制器。 Linkerd的显著功能包括: + + *支持多种平台(Docker,Kubernetes,DC / OS,Amazon ECS或单机) + *内置服务发现抽象将多个系统集成在一起 + *支持gRPC,HTTP / 2和HTTP / 1.x请求和所有的TCP流量 You can read more about it on [Linkerd’s website][32] and access its source code on [GitHub][14]. +您可以在[Linkerd网站][32]上阅读有关它的更多信息,并在[GitHub][14]上访问其源码。 ### Helm @@ -231,6 +244,10 @@ Helm is basically the package manager for Kubernetes. If you’ve used Apache Ma You can try Helm by following the [quickstart guide][34] in its documentation or its [GitHub guide][15]. +Helm基本上是Kubernetes的软件包管理器。 如果您使用过Apache Maven,Maven Nexus或类似的服务,您就会理解Helm的作用。 Helm可帮助您管理Kubernetes应用程序。 它使用“Helm图”来定义,安装和升级最复杂的Kubernetes应用程序。 Helm并不是实现此功能的唯一方法; 另一个流行的概念是[Kubernetes Operators][33],它被Red Hat OpenShift 4所使用。 + +您可以按照其文档中的[快速开始指南][34]或[GitHub指南][15]来试用Helm。 + ### Etcd Etcd is a distributed, reliable key-value store for the most critical data in a distributed system. Its key features are: From 883c5a55841c40858c8f9329ae43835aff82cbfb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 11 Apr 2020 01:03:37 +0800 Subject: [PATCH 0229/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200410=20How?= =?UTF-8?q?=20I'm=20using=20AI=20to=20translate=20'wash=20your=20hands'=20?= =?UTF-8?q?in=20500=20languages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md --- ...late -wash your hands- in 500 languages.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sources/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md diff --git a/sources/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md b/sources/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md new file mode 100644 index 0000000000..a18d557337 --- /dev/null +++ b/sources/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md @@ -0,0 +1,136 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I'm using AI to translate 'wash your hands' in 500 languages) +[#]: via: (https://opensource.com/article/20/4/ai-translation) +[#]: author: (Daniel Whitenack https://opensource.com/users/datadan) + +How I'm using AI to translate 'wash your hands' in 500 languages +====== +By using both human and machine-generated translations, key health +phrases can be translated into local languages spoken all over the +world. +![Two diverse hands holding a globe][1] + +You might not know, but there are currently [7,117 languages spoken in the world][2]. Not dialects, but living languages! However, much of the world's digital media is available in only a couple dozen languages, and translation platforms like Google Translate only support around 100 languages. This reality means that there are billions of people around the world that are marginalized due to a lack of timely access to information. The current coronavirus (COVID-19) pandemic has made this painfully clear, and it has stressed the need for immediate, rapid translation of health-related phrases (like "wash your hands" or "keep your distance") into the long tail of languages. + +To this end, I applied state-of-the-art AI techniques to construct something close to the phrase "wash your hands" in 544 languages and counting (my GPUs are still running). Multilingual Unsupervised and Supervised Embeddings (MUSE) methods are used to train cross-lingual word embeddings between each of 544 languages and English. These embeddings then allow for the extraction of a phrase similar to the target phrase from existing documents. + +I performed this work in collaboration with my colleagues at SIL International, who have gathered even more human translations of the phrase. The combination of these human translations and some of my machine translations can be searched on [this Ethnologue guide page][3] (machine-generated phrases are indicated with a little robot icon), and more translations will be added as they are generated/gathered. + +### Leveraging existing corpora + +SIL International has done linguistic work in over 2000 languages and is currently managing over 1600 language projects. Thus, as I approached this particular problem, I knew that we had likely already translated the phrase "wash your hands" and/or similar phrases many times into hundreds of languages, and that guess paid off in spades. I was able to quickly gather documents (mostly completed shell book templates, educational materials, and Bibles) from our archives in over 900 languages. Each of these documents has an English parallel, which necessarily includes the phrase "wash your hands" and/or similar phrases like "wash your face." Moreover, each of these documents is very high quality and translated and checked in cooperation with the local language communities. + +That is quite the multilingual data set. However, there are two problems to overcome. First, this data included thousands of samples for most languages, which is in contrast to the millions used to train machine translation models. Second, even if the documents include the phrase "wash your hands" in the target language, we don't know the exact location of the phrase within the surrounding text. + +We could certainly exploit some of the latest tricks in [machine translation for low resource languages][4], but it would take some time to tune automated methods for rapidly adapting translation models in each language pair. Moreover, many of the languages we are targeting have no existing baseline with which we could compare evaluation metrics, e.g., [BLEU score][5]. Given the pressing concerns about the Coronavirus pandemic, we wanted to move a bit faster than that (although we plan to return to this problem in the future). + +I opted to try and construct the phrase "wash your hands" by finding the phrase itself or components of the phrase (like "wash your" or "your hands") in existing documents. To find these, I trained cross-lingual embedding for each {English, Target Language} pair using [Multilingual Unsupervised and Supervised Embedding (MUSE)][6] from Facebook Research. MUSE takes monolingual word embeddings as input (I used [_fasttext_][7] to generate these) and learns a mapping from the English to the target embedding space using adversarial methods. The output of this process is cross-lingual word embeddings. + +![Using fasttext along with MUSE to perform cross-language embedding][8] + +Once the cross-lingual embeddings are generated, we can get to finding the phrase components in the target language documents. As it turns out, the phrase "wash your face" was most clearly used throughout the documents along with instances of "hands," "wash your," etc. in isolation. For each of the languages, I search through n-grams in areas where I expected the phrase to appear (based on its usage in the English parallel). N-grams were vectorized using the cross-lingual embedding and compared with vectorized versions of the English phrases using various distance metrics. The n-grams that were "closest" to the English phrases in the embedding space were determined to be the target language matches. + +Finally, component phrases matching their English counterparts were combined to generate the phrase "wash your hands" in the target language. This combination utilizes the cross-lingual embedding again to make sure that the components are combined in an appropriate manner. For example, if we matched the phrase "wash your feet" in the target language, the n-gram corresponding to "feet" must be replaced with the n-gram corresponding to "hands." Here's an example for Belize Kriol English: + +![][9] + +There were, of course, some assumptions that were made during this matching process, and it is entirely possible that this procedure does not produce grammatically correct predictions. For example, I assumed that in most languages, the word for "hands" and the word for "feet" are both one token long (with tokens being separated by spaces and punctuation). This is certainly not always the case. This could create a bad word salad something like "and wash the and hand you" or similar. Hopefully, we can overcome some of these limitations and extend the system in the future, but, for now, we chose to reinforce the idea with graphics. + +We adapted the World Health Organization's hand washing instructions into a template PNG image. We then took our translated and generated phrases and rendered them into the hand washing image using a combination of Bash and Go scripts. In this way, the idea of proper hand washing is emphasized in both text and imagery (just in case our generated translations are awkward). + +![][10] + +### Results + +Thus far, I've been able to train cross-lingual embeddings for 544 languages. I used the above-discussed method to try and construct "wash your hands" for all of these languages. Because I don't have aligned data for many of the language pairs, I used separate holdout documents also containing components of "wash your hands" to help validate the tokens in the constructed phrase. This gives us some confidence in the translations that we publicly release (at least that they contain information indicating washing and/or hands). In addition, I compared the method with language pairs that are also supported by Google Translate and/or have available human translations. Here's a sample of the translations with language stats from [the Ethnologue][11]: + +#### Language: Italian [ita] + +Location: Italy +Population: 68,000,000 +Our system: "làvati la mani" +Google Translate: "Lavati le mani" + +#### Language: Bulgarian [bul] + +Location: Bulgaria +Population: 8,000,000 +Our system: "умий ръцете" +Google Translate: "Измий си ръцете" + +#### Language: Dutch [nld] + +Location: Netherlands +Population: 24,000,000 +Our system: "wast uw handen" +Google Translate: "Was je handen" + +#### Language: Pijin [pis] + +Location: Solomon Islands +Population: 550,000 +Our system: "wasim han" +Google Translate: Not supported + +#### Language: Tikar [tik] + +Location: Cameroon +Population: 110,000 +Our system: "ɓɔsi fyàʼ" +Google Translate: Not supported + +#### Language: Waffa [waj] + +Location: Papua New Guinea +Population: 1,300 +Our system: "yaakuuvaitana nnikiiyauvaa fini" +Google Translate: Not supported + +The constructed phrases are similar to reference translations or appear to be alternative ways of saying "wash your hands." For example, in Bulgarian, I predict "умий ръцете," and Google Translate predicts "Измий си ръцете." However, if I back-translate my prediction using Google Translate, I still get "wash your hands." There is some uncertainty where I can't compare to reference translations (e.g., Pijin [pis] from the Solomon Islands) or human-annotated spans, but I can still validate that the word for wash (wasim) and the word for hands (han) are used in other reference documents that are necessarily talking about washing, or hands, respectively. About 15% of the translations could be validated using this method, and I hope to validate more as I gather reference dictionaries. + +Note, I used at most about 7,000 sentences in each language to get the above translations, even for high-resource languages like Italian. I also did not rely on aligned sentences between the language pairs. Despite this very data-scarce, unsupervised scenario, I was still able to obtain phrases similar to that of Google Translate for languages supported by both systems. This demonstrates the potential utility of this sort of "hybrid" approach (unsupervised alignment of word embeddings + rule-based matching) for translating short phrases into languages where very little data exists. + +Note—I'm definitely not saying that this is a solution to the problem of information spread about Coronavirus and other health-related issues. There are still a lot of things to explore and formally evaluate here, and we are working on that. In many cases, this approach won't be able to help construct important informational material in hundreds of languages. However, I think that we should all be trying to develop creative solutions to problems related to the current crisis. Maybe this is one piece of a very large puzzle. + +You can view the complete list of validated translations plus human translations on [this Ethnologue guide page][3]. In addition, a more thorough description and analysis of the system in paper form is forthcoming. We welcome feedback from the public on the translations to help fine-tune the system and, most of all, to make sure that health information gets out to marginalized language communities around the world. + +### Create your own hand washing posters + +We have open sourced [the code used to render complex scripts and generate the hand washing posters][12]. This methodology should be able to handle almost all languages and scripts. You can add your own translation of "wash your hands" to a poster to help spread the word or tailor the translations for your own local context. Be sure to share your generated posters on social media with the hashtag #WashYourHands. + +### Develop your AI skills + +There are so many exciting AI problems out there that can make a huge impact in the world. If you want to solve problems like the one above with AI or if you think your business might need to start leveraging AI for other things (supply chain optimization, recommendation, customer service automation, etc.), don't miss the [_AI Classroom_ training event this May][13]. _AI Classroom_ is an immersive, three-day virtual training event for anyone with at least some programming experience and foundational understanding of mathematics. The training provides a practical baseline for realistic AI development using Python and open source frameworks like TensorFlow and PyTorch. After completing the course, participants will have the confidence to start developing and deploying their own AI solutions. + +_This article was republished with permission from _ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/ai-translation + +作者:[Daniel Whitenack][a] +选题:[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/datadan +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE (Two diverse hands holding a globe) +[2]: https://www.ethnologue.com/guides/how-many-languages +[3]: https://www.ethnologue.com/guides/health +[4]: https://datadan.io/blog/resources-for-low-resource-machine-translation +[5]: https://en.wikipedia.org/wiki/BLEU +[6]: https://github.com/facebookresearch/MUSE +[7]: https://fasttext.cc/ +[8]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom.gif (Using fasttext along with MUSE to perform cross-language embedding) +[9]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom2.gif +[10]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom3.gif +[11]: https://www.ethnologue.com/ +[12]: https://github.com/sil-ai/wash-your-hands +[13]: https://datadan.io/ From 2356858e1e1a22ff850577a83e55c643b96dab21 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 11 Apr 2020 01:09:18 +0800 Subject: [PATCH 0230/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200410=20Get?= =?UTF-8?q?=20started=20with=20Bash=20programming?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200410 Get started with Bash programming.md --- ...00410 Get started with Bash programming.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 sources/tech/20200410 Get started with Bash programming.md diff --git a/sources/tech/20200410 Get started with Bash programming.md b/sources/tech/20200410 Get started with Bash programming.md new file mode 100644 index 0000000000..875adb9876 --- /dev/null +++ b/sources/tech/20200410 Get started with Bash programming.md @@ -0,0 +1,157 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get started with Bash programming) +[#]: via: (https://opensource.com/article/20/4/bash-programming-guide) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Get started with Bash programming +====== +Learn how to write custom programs in Bash to automate your repetitive +tasks. Download our new eBook to get started. +![Command line prompt][1] + +One of the original hopes for Unix was that it would empower everyday computer users to fine-tune their computers to match their unique working style. The expectations around computer customization have diminished over the decades, and many users consider their collection of apps and websites to be their "custom environment." One reason for that is that the components of many operating systems are not open, so their source code isn't available to normal users. + +But for Linux users, custom programs are within reach because the entire system is based around commands available through the terminal. The terminal isn't just an interface for quick commands or in-depth troubleshooting; it's a scripting environment that can reduce your workload by taking care of mundane tasks for you. + +### How to learn programming + +If you've never done any programming before, it might help to think of it in terms of two different challenges: one is to understand how code is written, and the other is to understand what code to write. You can learn _syntax_—but you won't get far without knowing what words are available to you in the _language_. In practice, you start learning both concepts all at once because you can't learn syntax without words to arrange, so initially, you write simple tasks using basic commands and basic programming structures. Once you feel comfortable with the basics, you can explore more of the language so you can make your programs do more and more significant things. + +In [Bash][2], most of the _words_ you use are Linux commands. The _syntax_ is Bash. If you already use Bash on a frequent basis, then the transition to Bash programming is relatively easy. But if you don't use Bash, you'll be pleased to learn that it's a simple language built for clarity and simplicity. + +### Interactive design + +Sometimes, the hardest thing to figure out when learning to program is what a computer can do for you. Obviously, if a computer on its own could do everything you do with it, then you wouldn't have to ever touch a computer again. But the reality is that humans are important. The key to finding something your computer can help you with is to take notice of tasks you repeatedly do throughout the week. Computers handle repetition particularly well. + +But for you to be able to tell your computer to do something, you must know how to do it. This is an area Bash excels in: interactive programming. As you perform an action in the terminal, you are also learning how to script it. + +For instance, I was once tasked with converting a large number of PDF books to versions that would be low-ink and printer-friendly. One way to do this is to open the PDF in a PDF editor, select each one of the hundreds of images—page backgrounds and textures counted as images—delete them, and then save it to a new PDF. Just one book would take half a day this way. + +My first thought was to learn how to script a PDF editor, but after days of research, I could not find a PDF editing application that could be scripted (outside of very ugly mouse-automation hacks). So I turned my attention to finding out to accomplish the task from within a terminal. This resulted in several new discoveries, including GhostScript, the open source version of PostScript (the printer language PDF is based on). By using GhostScript for the task for a few days, I confirmed that it was the solution to my problem. + +Formulating a basic script to run the command was merely a matter of copying the command and options I used to remove images from a PDF and pasting them into a text file. Running the file as a script would, presumably, produce the same results. + +### Passing arguments to a Bash script + +The difference between running a command in a terminal and running a command in a shell script is that the former is interactive. In a terminal, you can adjust things as you go. For instance, if I just processed **example_1.pdf** and am ready to process the next document, to adapt my command, I only need to change the filename. + +A shell script isn't interactive, though. In fact, the only reason a shell _script_ exists is so that you don't have to attend to it. This is why commands (and the shell scripts that run them) accept arguments. + +In a shell script, there are a few predefined variables that reflect how a script starts. The initial variable is **$0**, and it represents the command issued to start the script. The next variable is **$1**, which represents the first "argument" passed to the shell script. For example, in the command **echo hello**, the command **echo** is **$0,** and the word **hello** is **$1**. In the command **echo hello world**, the command **echo** is **$0**, **hello** is **$1**, and **world** is **$2**. + +In an interactive shell: + + +``` +$ echo hello world +hello world +``` + +In a non-interactive shell script, you _could_ do the same thing in a very literal way. Type this text into a text file and save it as **hello.sh**: + + +``` +`echo hello world` +``` + +Now run the script: + + +``` +$ bash hello.sh +hello world +``` + +That works, but it doesn't take advantage of the fact that a script can take input. Change **hello.sh** to this: + + +``` +`echo $1` +``` + +Run the script with two arguments grouped together as one with quotation marks: + + +``` +$ bash hello.sh "hello bash" +hello bash +``` + +For my PDF reduction project, I had a real need for this kind of non-interactivity, because each PDF took several minutes to condense. But by creating a script that accepted input from me, I could feed the script several PDF files all at once. The script processed each one sequentially, which could take half an hour or more, but it was a half-hour I could use for other tasks. + +### Flow control + +It's perfectly acceptable to create Bash scripts that are, essentially, transcripts of the exact process you took to achieve the task you need to be repeated. However, scripts can be made more powerful by controlling how information flows through them. Common methods of managing a script's response to data are: + + * if/then + * for loops + * while loops + * case statements + + + +Computers aren't intelligent, but they are good at comparing and parsing data. Scripts can feel a lot more intelligent if you build some data analysis into them. For example, the basic **hello.sh** script runs whether or not there's anything to echo: + + +``` +$ bash hello.sh foo +foo +$ bash hello.sh + +$ +``` + +It would be more user-friendly if it provided a help message when it receives no input. That's an if/then statement, and if you're using Bash in a basic way, you probably wouldn't know that such a statement existed in Bash. But part of programming is learning the language, and with a little research you'd learn about if/then statements: + + +``` +if [ "$1" = "" ]; then +        echo "syntax: $0 WORD" +        echo "If you provide more than one word, enclose them in quotes." +else +        echo "$1" +fi +``` + +Running this new version of **hello.sh** results in: + + +``` +$ bash hello.sh +syntax: hello.sh WORD +If you provide more than one word, enclose them in quotes. +$ bash hello.sh "hello world" +hello world +``` + +### Working your way through a script + +Whether you're looking for something to remove images from PDF files, or something to manage your cluttered Downloads folder, or something to create and provision Kubernetes images, learning to script Bash is a matter of using Bash and then learning ways to take those scripts from just a list of commands to something that responds to input. It's usually a process of discovery: you're bound to find new Linux commands that perform tasks you never imagined could be performed with text commands, and you'll find new functions of Bash to make your scripts adaptable to all the different ways you want them to run. + +One way to learn these tricks is to read other people's scripts. Get a feel for how people are automating rote commands on their systems. See what looks familiar to you, and look for more information about the things that are unfamiliar. + +Another way is to download our [introduction to programming with Bash][3] eBook. It introduces you to programming concepts specific to Bash, and with the constructs you learn, you can start to build your own commands. And of course, it's free to download and licensed under a [Creative Commons][4] license, so grab your copy today. + +### [Download our introduction to programming with Bash eBook!][3] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/bash-programming-guide + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://opensource.com/resources/what-bash +[3]: https://opensource.com/downloads/bash-programming-guide +[4]: https://opensource.com/article/20/1/what-creative-commons From 0459777beeaf2b620a7a99e22c868a857d6c7a92 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 11 Apr 2020 01:11:50 +0800 Subject: [PATCH 0231/1809] add done: 20200410 Get started with Bash programming.md --- ...Kubernetes saved my desktop application.md | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 sources/tech/20200410 How Kubernetes saved my desktop application.md diff --git a/sources/tech/20200410 How Kubernetes saved my desktop application.md b/sources/tech/20200410 How Kubernetes saved my desktop application.md new file mode 100644 index 0000000000..ecbd6ee273 --- /dev/null +++ b/sources/tech/20200410 How Kubernetes saved my desktop application.md @@ -0,0 +1,55 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Kubernetes saved my desktop application) +[#]: via: (https://opensource.com/article/20/4/kubernetes-desktop-application) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) + +How Kubernetes saved my desktop application +====== +Keep this fix in mind if you have a broken Java desktop application but +aren't a crypto expert. +![Puzzle pieces coming together to form a computer screen][1] + +Recently, fellow Opensource.com scribe James Farrell wrote a wonderful article entitled _[How Ansible brought peace to my home][2]_. In addition to the great article, I really liked the title, one of those unexpected phrases that I’m sure brought a smile to many faces. + +I recently had a weird but positive experience of my own that begs a similar sort of unexpected label. I’ve been grappling with a difficult problem that arose when upgrading some server and networking infrastructure that broke a Java application I’ve been supporting since the early 2000s. Strangely enough, I found the solution in what appears to be a very informative and excellent article on Kubernetes, of all things. + +Without further ado, here is my problem: + +![][3] + +I’m guessing that most readers will look at that message and think things like, "I hope there’s more info in the log file," or "I’m really glad I’ve never received a message like that." + +Unfortunately, there isn’t a lot of info in the log file, just the same message, in fact. In an effort to debug this, I did three things: + + 1. I searched online for the message. Interestingly, or perhaps ominously, there were only 200 or so hits on this string, [one of which suggested][4] [turn][4][ing][4] [on more debugging output][4], which involved adding the setting + + +``` +**-Djavax.net.debug=ssl:handshake:verbose**[/code] to the **java** command running the application. + + 2. I tried that suggestion, which resulted in a lot of output (good), most of which only vaguely made sense to me as I’m no kind of expert in the underlying bits of stuff like SSL. But one thing I did notice is that there was no information regarding a response from the server in the midst of all of that output; + + 3. So I searched some more. + + + + +Another interesting part of this problem is that the code ran fine when executed by the Java command bundled in the OpenJDK, but failed with this error when using a customized runtime [created from the same OpenJDK in this way][5]. So the relatively modest number of apparently similar problems turned up from search #1 above were actually not all that relevant since they all seemed to be dealing mostly with bad SSL certificates on the server in conjunction with the PostgreSQL JDBC’s ability to check the server’s credentials. + +I should also mention that it took me quite some time to realize that the problem was introduced by using the custom Java runtime, as I managed to check many other possibilities along the way (and indeed, I did fix a few minor bugs while I was at it). My efforts included things like getting the latest OpenJDK, checking and re-checking all the URLs in case one had a typo, and so forth. + +As often happens, after putting the problem aside for a few hours, an idea occurred to me—perhaps I was missing some module in the customized Java runtime. While I didn’t receive any errors directly suggesting that problem, the observable fact that the standard OpenJDK environment worked while the custom one failed seemed to hint at that possibility. I took a quick look in the **jmods/** folder in the OpenJDK installation, but there are some 70 modules there and nothing jumped out at me. + +But again, what seemed odd was, with debugging turned on (see #1 above), there was no indication of what the server would accept, just what the client mostly couldn’t offer, many lines like this: +``` +`Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA` +``` +So I was at least thinking by this time that maybe what was missing was the module that offered those kinds of cipher suites. So I started searching with strings like "jdbc crypto," and in the midst of that, the most unlikely article showed up: [Optimizing Kubernetes Services—Part 2: Spring Web][6], written by [Juan Medina][7]. Midway down the article, I spotted the following: + +![][8] + +Huh! Imagine that, his script is creating a custom Java runtime, just like mine. But he says he needs to add in manually the module **jdk.crypto.ec** in order t \ No newline at end of file From 8af3b1b135a837d87fb3bad89e8f5c607c7ed2be Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Apr 2020 20:09:14 +0800 Subject: [PATCH 0232/1809] PRF @HankChow --- ...00410 How to Go Full Dark Mode in Ubuntu 20.04.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/translated/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md b/translated/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md index 9d0223efa8..2c10a487fc 100644 --- a/translated/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md +++ b/translated/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Go Full Dark Mode in Ubuntu 20.04) @@ -12,15 +12,19 @@ > 深色模式是 Ubuntu 20.04 最受瞩目的[新功能][1]之一了。任何版本的 Ubuntu 都可以通过[安装深色主题][2]让用户界面拥有一个深色的外观,但在 Ubuntu 20.04 中,这个过程变得更简单。 +![](https://img.linux.net.cn/data/attachment/album/202004/11/200841gvvaja25jaz5z7hv.jpg) + 在 Ubuntu 20.04 中,无需额外安装主题,默认主题(称为 Yaru)本身就带有三种模式,其中就包括深色模式。 下面我会展示如何将 Ubuntu 系统完全设置为深色模式。 ### 在 Ubuntu 20.04 打开深色模式 -这个步骤将会在 GNOME 桌面上完成,如果你[使用的是其它桌面][4],你看到的可能会和下面的截图不一样。 +- [video](https://player.vimeo.com/video/405726943) -按下 super 键(或 Windows 键),然后输入“settings”,就可以找到系统设置。 +这个步骤是在 GNOME 桌面上进行的,如果你[使用的是其它桌面][4],你看到的可能会和下面的截图不一样。 + +按下 super 键(或 Windows 键),然后输入 “settings”,就可以找到系统设置。 ![Search for Settings][5] @@ -82,7 +86,7 @@ via: https://itsfoss.com/dark-mode-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0d9662a4978f752a4382efc380e23de2eef29429 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Apr 2020 20:10:44 +0800 Subject: [PATCH 0233/1809] PUB @HankChow https://linux.cn/article-12098-1.html --- .../20200410 How to Go Full Dark Mode in Ubuntu 20.04.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md (98%) diff --git a/translated/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md b/published/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md similarity index 98% rename from translated/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md rename to published/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md index 2c10a487fc..5ff72f17b5 100644 --- a/translated/tech/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md +++ b/published/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12098-1.html) [#]: subject: (How to Go Full Dark Mode in Ubuntu 20.04) [#]: via: (https://itsfoss.com/dark-mode-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 38d5d0e41075da1876714b62360c38009e1f174e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Apr 2020 21:19:14 +0800 Subject: [PATCH 0234/1809] APL --- .../20200408 Create web tutorials with Reveal.js and Git.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200408 Create web tutorials with Reveal.js and Git.md b/sources/tech/20200408 Create web tutorials with Reveal.js and Git.md index 52e34b34e1..05393b87e2 100644 --- a/sources/tech/20200408 Create web tutorials with Reveal.js and Git.md +++ b/sources/tech/20200408 Create web tutorials with Reveal.js and Git.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b8be7d43683d0dfc5a439c370b153abbb18fce97 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 11 Apr 2020 23:07:59 +0800 Subject: [PATCH 0235/1809] Translating by MjSeven --- ... to use pyenv to run multiple versions of Python on a Mac.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md b/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md index 4d15072b90..a77ff4ede5 100644 --- a/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md +++ b/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 50a15b8c1702c3db8b64b57e770e241353d6038c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Apr 2020 23:14:40 +0800 Subject: [PATCH 0236/1809] TSL --- ...te web tutorials with Reveal.js and Git.md | 221 ------------------ ...te web tutorials with Reveal.js and Git.md | 204 ++++++++++++++++ 2 files changed, 204 insertions(+), 221 deletions(-) delete mode 100644 sources/tech/20200408 Create web tutorials with Reveal.js and Git.md create mode 100644 translated/tech/20200408 Create web tutorials with Reveal.js and Git.md diff --git a/sources/tech/20200408 Create web tutorials with Reveal.js and Git.md b/sources/tech/20200408 Create web tutorials with Reveal.js and Git.md deleted file mode 100644 index 05393b87e2..0000000000 --- a/sources/tech/20200408 Create web tutorials with Reveal.js and Git.md +++ /dev/null @@ -1,221 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Create web tutorials with Reveal.js and Git) -[#]: via: (https://opensource.com/article/20/4/create-web-tutorial-git) -[#]: author: (Eric D. Schabell https://opensource.com/users/eschabell) - -Create web tutorials with Reveal.js and Git -====== -Workshop slides can be viewed consistently on any browser, device, and -platform with this easy workflow. -![Person reading a book and digital copy][1] - -Whether you're a learner or a teacher, you probably recognize the value of online workshops set up like slideshows for communicating knowledge. If you've ever stumbled upon one of these well-organized tutorials that are set up page by page, chapter by chapter, you may have wondered how hard it was to create such a website. - -Well, I'm here to show you how easy it is to generate this type of workshop using a fully automated process. - -### Introduction - -When I started putting my learning content online, it was not a nice, seamless experience. So, I wanted something repeatable and consistent that was also easy to maintain, since my content changes as the technology I teach progresses. - -I tried many delivery models, from low-level code generators, such as [Asciidoctor][2], to laying out a workshop in a single PDF file. All failed to satisfy me. When I deliver live, onsite workshops, I like using slideshows, so I wondered if I could do the same thing for my online, self-paced workshop experiences. - -After some digging, I built a foundation for creating painless workshop websites. It helped that I was already using a presentation-generation framework that resulted in a website-friendly format (HTML). - -### Setting it up - -Here the basic components you need for this project: - - * Workshop idea (this is your problem, can't help you here) - * Reveal.js for the workshop slides - * GitLab project repository - * Your favorite HTML code editor - * Web browser - * Git installed on your machine - - - -If this list looks intimidating, there's a quick way to get started that doesn't involve pulling all the pieces together one by one: You can use my template project to give you a kickstart with the slides and project setup. - -This article assumes you're familiar with Git and projects hosted on a Git platform like GitLab. If you need a refresher or tutorial, check out our [introductory Git series][3]. - -Start by cloning the template project to your local machine: - - -``` -`$ git clone https://gitlab.com/eschabell/beginners-guide-automated-workshops.git` -``` - -Set up a new GitLab project for this and import the template project as the initial import. - -There are a number of important files for the workshop website. In the **root** directory, you'll find a file called **.gitlab-ci.yml**, which is used as a trigger when you commit changes to the master branch (i.e., merge pull requests to **master**). It triggers a copy of the complete contents of the **slides** directory into the GitLab project's **website** folder. - -I have this hosted as a project called **beginners-guide-automated-workshops** in my GitLab account. When it deploys, you can view the contents of the **slides** directory in your browser by navigating to: - - -``` -`https://eschabell.gitlab.io/beginners-guide-automated-workshops` -``` - -For your user account and project, the URL would look like: - - -``` -`https://[YOUR_USERNAME].gitlab.io/[YOUR_PROJECT_NAME]` -``` - -These are the basic materials you need to start creating your website content. When you push changes, they will automatically generate your updated workshop website. Note that the default template contains several example slides, which will be your first workshop website after you complete the full check-in to your repository. - -The workshop template results in a [reveal.js][4] slideshow that can run in any browser, with automatic resizing that allows it to be viewed by almost anyone, anywhere, on any device. - -How's that for creating handy and accessible workshops? - -### How it works - -With this background in place, you're ready to explore the workshop materials and start putting your content together. Everything you need can be found in the project's **slides** directory; this is where all of the magic happens with reveal.js to create the workshop slideshow in a browser. - -The files and directories you'll be working with to craft your workshop are: - - * The **default.css** file - * The **images** directory - * The **index.html** file - - - -Open each one in your favorite HTML/CSS editor and make the changes described below. It does not matter which editor you use; I prefer [RubyMine IDE][5] because it offers a page preview in the local browser. This helps when I'm testing out content before pushing it online to the workshop website. - -#### Default.css file - -The file **css/theme/default.css** is the base file where you will set important global settings for your workshop slides. The two main items of interest are the default font and background image for all slides. - -In **default.css**, look at the section labeled **GLOBAL STYLES**. The current default font is listed in the line: - - -``` -`font-family: "Red Hat Display", "Overpass", san-serif;` -``` - -If you're using a non-standard font type, you must import it (as was done for the Overpass font type) in the line: - - -``` -`@import url('SOME_URL');` -``` - -The **background** is the default image for every slide you create. It is stored in the **images** directory (see below) and set in the line below (focus on the image path): - - -``` -`background: url("…/…/images/backgrounds/basic.png")` -``` - -To set a default background, just point this line to the image you want to use. - -#### Images directory - -As its name implies, the **images** directory is used for storing the images you want to use on your workshop slides. For example, I usually put screenshots that demonstrate the progress of the workshop topic on my individual slides. - -For now, just know that you need to store the background images in a subdirectory (**backgrounds**) and the images you plan to use in your slides in the **Images** directory. - -#### Index.html file - -Now that you have those two files sorted out, you'll spend the rest of your time creating slides in the HTML files, starting with **index.html**. For your workshop website to start taking shape, pay attention to the following three sections in this file: - - * The **head** section, where you set the title, author, and description - * The **body** section, where you find the individual slides to design - * Each **section**, where you define the contents of individual slides - - - -Start with the **head** section, since it's at the top. The template project has three placeholder lines for you to update: - - -``` -<title>INSERT-YOUR-TITLE-HERE</title> -<meta name="description" content="YOUR DESCIPTION HERE."> -<meta name="author" content="YOUR NAME"> -``` - -The **title** tag contains the text that appears in the browser tab when the file is open. Change it to something relevant to the title of your workshop (or maybe a section of your workshop), but remember to keep it short since tab title space is limited. The **description** meta tag contains a short description of your workshop, and the **author** meta tag is where you should put your name (or the workshop creator's name, if you're doing this for someone else). - -Now move on to the **body** section. You'll notice that it's divided into a number of **section** tags. The opening of the **body** contains a comment that explains that you're creating slides for each open and closing tag labeled **section**: - - -``` -<body> -        <div class="reveal"> - -        <!-- Any section element inside of this container is displayed as a slide --> -        <div class="slides"> -``` - -Next, create your individual slides, with each slide enclosed in **section** tags. The template includes a few slides to help you get started. For example, here's the first slide: - - -``` -<section> -      <div style="width: 1056px; height: 300px"> -            <h1>Beginners guide</h1> -            <h2>to automated workshops</h2> -      </div> -      <div style="width: 1056px; height: 200px; text-align: left"> -            Brought to you by,<br/> -            YOUR-NAME<br/> -      </div> -      <aside class="notes">Here are notes: Welcome to the workshop!</aside> -</section> -``` - -This slide has two areas divided with **div** tags. Spacing separates the title and the author. - -Assuming you have some knowledge of using HTML, try various things to develop your workshop. It's really handy to use a browser as you go to preview the results. Some IDEs provide local viewing of changes, but you can also open the **index.html** file and view your changes before pushing them to the repository. - -Once you're satisfied with your workshop, push your changes, and wait for them to pass through the continuous integration pipeline. They'll be hosted like the template project at . - -### Learn more - -To learn more about what you can do with this workflow, check out the following example workshops and sites that host workshop collections. All of these are based on the workflow described in this article. - -Workshop examples: - - * [Red Hat Process Automation Manage workshop][6] - * [JBoss Travel Agency BPM Suite online workshop][7] - - - -Workshop collections: - - * [Rule the world: Practical decisions & process automation development workshops][8] - * [Application development in the cloud workshop][9] - * [Portfolio architecture: Workshops for creating impactful architectural diagrams][10] - - - -I hope this beginner's guide and the template workshop project show you easy and painless it can be to develop and maintain workshop websites in a consistent manner. I also hope this workflow gives your workshop audiences full access to your content on almost any device so they can learn from the knowledge you're sharing. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/create-web-tutorial-git - -作者:[Eric D. Schabell][a] -选题:[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/eschabell -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/read_book_guide_tutorial_teacher_student_apaper.png?itok=_GOufk6N (Person reading a book and digital copy) -[2]: https://asciidoctor.org/ -[3]: https://opensource.com/resources/what-is-git -[4]: https://revealjs.com/#/ -[5]: https://www.jetbrains.com/ruby/ -[6]: https://gitlab.com/bpmworkshop/rhpam-devops-workshop -[7]: https://gitlab.com/bpmworkshop/presentation-bpmworkshop-travel-agency -[8]: https://bpmworkshop.gitlab.io/ -[9]: https://appdevcloudworkshop.gitlab.io/ -[10]: https://redhatdemocentral.gitlab.io/portfolio-architecture-workshops diff --git a/translated/tech/20200408 Create web tutorials with Reveal.js and Git.md b/translated/tech/20200408 Create web tutorials with Reveal.js and Git.md new file mode 100644 index 0000000000..5466f55d81 --- /dev/null +++ b/translated/tech/20200408 Create web tutorials with Reveal.js and Git.md @@ -0,0 +1,204 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create web tutorials with Reveal.js and Git) +[#]: via: (https://opensource.com/article/20/4/create-web-tutorial-git) +[#]: author: (Eric D. Schabell https://opensource.com/users/eschabell) + +使用 Reveal.js 和 Git 创建网页教程 +====== + +> 通过这个简单的工作流程创建的研讨会幻灯片,可以在任何浏览器、设备和平台上一致地查看。 + +![Person reading a book and digital copy][1] + +无论你是学习者还是教师,你可能都会认识到采用幻灯片放映来传播知识的在线研讨会workshop的价值。如果你曾经偶然看到过这样一个逐页、逐章设置的井井有条的教程,你可能会想知道创建这样的一个网站有多难。 + +好吧,让我在这里向你展示,使用全自动化的流程来生成这样的教程是多么容易。 + +### 介绍 + +当我开始将学习内容放到网上置时,体验并不是很好。我想要的是一种可重复的、一致的、易于维护的东西,因为我的内容会随着我的教学技术而进步。 + +我尝试了许多交付模型,从 [Asciidoctor][2] 这样的低级代码生成器到在单个 PDF 文件中放置教程。全都不能让我满意。当我举办现场的在座研讨会时,我喜欢使用幻灯片放映,因此我想知道我是否可以为自己的在线的,自定进度的研讨会体验做同样的事情。 + +经过一番挖掘,我为创建无痛的研讨会网站打下了基础。当时我已经在使用一个演示文稿生成框架,这对我来说是很有帮助的,因为这个框架可以产生对网站友好的格式(HTML)。 + +### 设置 + +这里是这个项目所需要的基本组件。 + + * 研讨会的想法(这是你的问题,我帮不了你) + * 用于研讨会幻灯片的 Reveal.js + * GitLab 项目仓库 + * 你最喜欢的 HTML 代码编辑器 + * Web 浏览器 + * 在你的机器上安装好 Git + +如果这个列表看起来令人望而生畏,那么有一个快速入门的方法,不需要把所有的东西一个个都拉到一起。你可以用我的模板项目来给你提供幻灯片和项目设置的入门教程。 + +本文假设你熟悉 Git 和托管在 Git 平台(如 GitLab)上的项目。如果你需要指导或教程,请查看我们的[Git 入门系列][3]。 + +首先,将模板项目克隆到本地机器上。 + +``` +$ git clone https://gitlab.com/eschabell/beginners-guide-automated-workshops.git +``` + +为此设置一个新的 GitLab 项目,导入模板项目作为初始导入。 + +研讨会网站有一些重要的文件。在**根目录**下,你会发现一个名为 `.gitlab-ci.yml` 的文件,当你向主分支提交修改时(即合并拉取请求到 `master` 分支),这个文件会作为触发器。它可以触发将 `slides` 目录的全部内容复制到 GitLab 项目的 `website` 文件夹中。 + +我把它托管在我的 GitLab 账户中,名为 `beginners-guide-automated-workshops`。当它部署完毕后,你可以在浏览器中通过导航到下列地址查看 `slides` 目录的内容: + +``` +https://eschabell.gitlab.io/beginners-guide-automated-workshops +``` + +对于你的用户帐户和项目,URL 如下所示: + +``` +https://[YOUR_USERNAME].gitlab.io/[YOUR_PROJECT_NAME] +``` + +这些是你开始创建网站内容所需要的基本素材。当你推送修改后,它们会自动生成更新过的研讨会网站。请注意,默认模板包含了几个示例幻灯片,这将是你完成对存储库的完整签入后的第一个研讨会网站。 + +研讨会模板生成的结果是一个 [receive.js][4] 幻灯片,可以在任何浏览器中运行,并可以自动调整大小,几乎可以让任何人在任何地方、任何设备上观看。 + +这样创建一个方便、易访问的研讨会怎么样? + +### 它是如何工作的 + +有了这些背景信息,你就可以开始探索研讨会的这些素材,并开始把你的内容放在一起了。你需要的一切都可以在项目的 `slides` 目录中找到;这里是使用 reveal.js 在浏览器中创建研讨会幻灯片的地方。 + +你将用来制作研讨会的文件和目录是: + + * `default.css`文件 + * `images` 目录 + * `index.html`文件 + +在你喜欢的 HTML/CSS 编辑器中打开每一个文件,然后进行下面描述的修改。你用哪个编辑器并不重要,我更喜欢 [RubyMine IDE][5],因为它能在本地浏览器中提供页面预览。这对我在将内容推送到研讨会网站之前测试内容时很有帮助。 + +#### default.css 文件 + +文件 `css/theme/default.css` 是一个基础文件,你将在这里为你的研讨会幻灯片设置重要的全局设置。其中值得注意的两个主要的项目是所有幻灯片的默认字体和背景图片。 + +在 `default.css` 中,看一下标有 `GLOBAL STYLES` 的部分。当前的默认字体在这一行中列出了。 + +``` +font-family: "Red Hat Display", "Overpass", san-serif; +``` + +如果你使用的是非标准字体类型,则必须在以下行中将其导入(与 Overpass 字体类型相同): + +``` +@import url('SOME_URL'); +``` + +`background` 是你创建的每张幻灯片的默认图像。它存储在 `images` 目录下(见下面),并在下面这一行中设置(重点是图像路径)。 + +``` +background: url("…/…/images/backgrounds/basic.png") +``` + +要设置一个默认背景,只需将这一行指向你要使用的图片。 + +#### images 目录 + +顾名思义,`images` 目录是用来存储你想在研讨会幻灯片上使用的图片。例如,我通常会把展示研讨会主题进展的截图放在我的个人幻灯片上。 + +现在,你只需要知道你需要将背景图片存储在一个子目录(`backgrounds`)中,并将你计划在幻灯片中使用的图片存储在 `images` 目录中。 + +#### index.html 文件 + +现在你已经把这两个文件整理好了,剩下的时间你就可以在 HTML 文件中创建幻灯片了,从 `index.html` 开始。为了让你的研讨会网站开始成形,请注意这个文件中的以下三个部分。 + + * `head `部分,在这里你可以设置标题、作者和描述。 + * `body` 部分,你可以在这里找到要设计的单个幻灯片。 + * 你可以在每个 `section` 中定义各个幻灯片的内容。 + +从 `head` 部分开始,因为它在顶部。模板项目有三个占位符行供你更新。 + +``` +INSERT-YOUR-TITLE-HERE + + +``` + +`title` 标签包含文件打开时显示在浏览器选项卡中的文字。请将其改为与你的研讨会的标题相关的内容(或研讨会的某个部分),但记得要简短,因为标签页的标题空间有限。`description` 元标签包含了对你的工作坊的简短描述,而 `author` 元标签是你应该把你的名字(如果你是为别人写的,则是工作坊创建者的名字)。 + +现在继续到 `body` 部分。你会注意到它被分成了许多 `section` 标签。`body` 的开头包含了一个注释,说明你正在为每个标有 `section` 的打开和关闭的标签创建幻灯片。 + + +``` + +
+ + +
+``` + +接下来,创建你的各个幻灯片,每张幻灯片都用 `section` 标签封装起来。这个模板包括了一些幻灯片来帮助你开始制作。例如,这里是第一张幻灯片。 + +``` +
+
+

Beginners guide

+

to automated workshops

+
+
+ Brought to you by,
+ YOUR-NAME
+
+ +
+``` + +这张幻灯片有两个区域,用 `div` 标签划分。用空格隔开了标题和作者。 + +如果你有一定的 HTML 使用知识,可以尝试各种东西来开发你的研讨会。你使用浏览器预览结果的时候真的很方便。有些 IDE 提供了本地查看修改,但你也可以打开 `index.html` 文件查看你的修改,然后再推送到资源库中。 + +一旦你对你的研讨会感到满意,推送你的修改,然后等待它们通过持续集成管道。它们将像模板项目一样被托管在 。 + +### 了解更多 + +要了解更多关于这个工作流程可以做什么,请查看下面的示例研讨会和托管了研讨会集合的网站。所有这些都是基于本文中描述的工作流程。 + +研讨会的例子: + + * [Red Hat Process Automation Manage workshop][6] + * [JBoss Travel Agency BPM Suite online workshop][7] + +研讨会集合: + + * [Rule the world: Practical decisions & process automation development workshops][8] + * [Application development in the cloud workshop][9] + * [Portfolio architecture: Workshops for creating impactful architectural diagrams][10] + +我希望这本新手指南和模板研讨会项目能让你看到,在开发和维护工作室网站的过程中,可以轻松、无痛地完成。我也希望这个工作流程能让你的研讨会受众几乎在任何设备上都能完全访问你的内容,这样他们就能从你分享的知识中学习到你的知识。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/create-web-tutorial-git + +作者:[Eric D. Schabell][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/eschabell +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/read_book_guide_tutorial_teacher_student_apaper.png?itok=_GOufk6N (Person reading a book and digital copy) +[2]: https://asciidoctor.org/ +[3]: https://opensource.com/resources/what-is-git +[4]: https://revealjs.com/#/ +[5]: https://www.jetbrains.com/ruby/ +[6]: https://gitlab.com/bpmworkshop/rhpam-devops-workshop +[7]: https://gitlab.com/bpmworkshop/presentation-bpmworkshop-travel-agency +[8]: https://bpmworkshop.gitlab.io/ +[9]: https://appdevcloudworkshop.gitlab.io/ +[10]: https://redhatdemocentral.gitlab.io/portfolio-architecture-workshops From 922028b9965298a064c4d789014727487ba34ed0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 12 Apr 2020 00:54:36 +0800 Subject: [PATCH 0237/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200411=20New?= =?UTF-8?q?=20Linux=20integrity=20checker=20from=20Microsoft,=20Raspberry?= =?UTF-8?q?=20Pi=C2=A0smart=20TV=20replacement=20from=20KDE,=20and=20more?= =?UTF-8?q?=20open=20source=20news?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md --- ...ent from KDE, and more open source news.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md diff --git a/sources/tech/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md b/sources/tech/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md new file mode 100644 index 0000000000..bdff5b8ce2 --- /dev/null +++ b/sources/tech/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (New Linux integrity checker from Microsoft, Raspberry Pi smart TV replacement from KDE, and more open source news) +[#]: via: (https://opensource.com/article/20/4/news-april-11) +[#]: author: (Ben Cotton https://opensource.com/users/bcotton) + +New Linux integrity checker from Microsoft, Raspberry Pi smart TV replacement from KDE, and more open source news +====== +Catch up on the biggest open source headlines from the past two weeks. +![][1] + +In this edition of our open source news roundup, we take a look at GNOME Foundation's new contributor program, a new Linux integrity checker from Microsoft, a free software alternative to smart TVs, and more! + +### GNOME Foundation launches a new contributor program + +A key part of keeping open source communities vibrant and healthy is bringing in new contributors. To help promote this, the GNOME Foundation and Endless teamed up to launch the inaugural [Community Engagement Challenge][2]. Phase one launched this week by opening the call for submitting project applications. Candidate projects should be aimed at bringing beginners into open source and encouraging ongoing participation in open source communities. Projects don’t have to be coding, they can also be games, videos, written materials, and so on. + +A panel of judges will select 20 projects to participate in phase two, where ideas will be turned into proofs of concept. At each phase, cash prizes will be awarded. [Proposals][3] are due July 1, 2020. + +### Microsoft announces code integrity checker for Linux + +When you run a program, you want it to be the one you think you’re running. This week, Microsoft announced [Integrity Policy Enforcement][4] (IPE), a Linux Security Model released under the GPLv2. + +IPE is targeted toward specific-purpose devices like network firewalls, not for general-purpose computing. It provides runtime verification that the code being executed matches the desired version. This allows administrators to detect and block altered binaries. + +IPE is currently in the Request for Comments stage on the [linux-security-module][5] mailing list. + +### KDE announces Plasma Bigscreen + +I recently bought a new TV and, if you haven’t been in the market lately, it’s hard to find “dumb” televisions. I didn’t want a smart TV because I worry about the manufacturer abandoning the software and what the device might do with my data. So KDE’s recent [Plasma Bigscreen][6] announcement caught my eye. + +Plasma Bigscreen takes the KDE Plasma interface I use every day and combines it with [Mycroft AI][7] to turn single-board computers into a smart TV. The beta, released last month, includes support for the Raspberry Pi 4 (Model B). + +### In other news + + * [IVPN for Android is now available on F-Droid][8] + * [IBM gives Outreachy $50,000 grant][9] + * [Warren For President Tech Team open source many of their projects][10] + * [Firefox 75.0 is released with a redesigned address bar and distribution via Flatpak][11] + * [LineageOS releases version 17.1 based on Android 10][12] + * [Linux kernel 5.6 released][13] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/news-april-11 + +作者:[Ben Cotton][a] +选题:[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/bcotton +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/weekly_news_roundup_tv.png?itok=tibLvjBd +[2]: https://www.gnome.org/challenge +[3]: https://surveys.gnome.org/index.php/986379?lang=en +[4]: https://microsoft.github.io/ipe/ +[5]: https://lore.kernel.org/linux-security-module/20200406181045.1024164-1-deven.desai@linux.microsoft.com/T/#m297116cd00666428c2ae3e627ff39653ebb691fb +[6]: https://dot.kde.org/2020/03/26/plasma-tv-presenting-plasma-bigscreen +[7]: https://mycroft.ai/ +[8]: https://www.ivpn.net/blog/ivpn-for-android-is-now-available-on-f-droid +[9]: https://developer.ibm.com/blogs/ibm-second-open-source-community-grant-outreachy/ +[10]: https://medium.com/@teamwarren/open-source-tools-from-the-warren-for-president-tech-team-f1f27d2c7551 +[11]: https://www.mozilla.org/en-US/firefox/75.0/releasenotes/ +[12]: https://lineageos.org/Changelog-24/ +[13]: https://lore.kernel.org/lkml/CAHk-=wi9ZT7Stg-uSpX0UWQzam6OP9Jzz6Xu1CkYu1cicpD5OA@mail.gmail.com/ From 214660e8f4ad1d48c22fe5e9045ccb5e5700084f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 12 Apr 2020 00:56:13 +0800 Subject: [PATCH 0238/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200411=205=20?= =?UTF-8?q?open=20source=20activities=20while=20you=20work=20from=20home?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200411 5 open source activities while you work from home.md --- ...rce activities while you work from home.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20200411 5 open source activities while you work from home.md diff --git a/sources/tech/20200411 5 open source activities while you work from home.md b/sources/tech/20200411 5 open source activities while you work from home.md new file mode 100644 index 0000000000..c52818f909 --- /dev/null +++ b/sources/tech/20200411 5 open source activities while you work from home.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 open source activities while you work from home) +[#]: via: (https://opensource.com/article/20/4/open-source-activities) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +5 open source activities while you work from home +====== +Work-life balance is important whether you're working from home +temporarily or it's your usual mode of earning a living. +![Person in a field of dandelions][1] + +The mythos of the remote home office or the exciting archetype of the digital nomad are as appealing as they are dangerous. It's great to be able to avoid a commute, to be able to stay comfortable at home while getting lots of work done, and to be master of your own schedule. But along with those liberties, you inherit the responsibility of remembering to be a normal, functioning human being. Believe it or not, the two aren't mutually exclusive. You can do both, but you have to work at it. Here are some ideas on how. + +### Plant something + +![Seeeduino in the garden][2] + +You may have an abundance of little ones to care for during the day, and if you do, you should read our [article][3] about fun open source projects for kids and parents. If you don't, or if you're just keen to try caring for something that's quiet, then you might find it satisfying to plant something. + +I used to think gardening was something you did as a way to establish a routine: each morning, you wake up and tend to your plants before you start your day, each evening you might pull weeds, and so on. Now that I have a garden, I realize that it's more like a low-stress puzzle. Learning to tend to plants is a little like learning to program. You learn the basics first, you learn to debug (literally, in the case of aphids), and then you learn how to optimize growth and maybe even [how to automate plant care][4]. + +If you're not attracted to gardening, there are plenty of other [outdoor projects][5] that are useful in getting you outdoors with a purpose and encouraging you to go back out for more. + +### Go for a walk + +![Walking][6] + +The phrases "go for a walk" or "get some fresh air" are so common that they seem trite, but that doesn't make the result any less valid. Getting outside your usual workspace is vital for clarity and drive, but sometimes going outside feels a little pointless. You can only walk around the block so many times before the journey loses excitement. + +If you need a goal for ambling around your neighborhood, you can download a handy app called [StreetComplete][7]. It's a quest-based app that presents you with points of interest in your area with incomplete [Open Street Map][8] data. You can help crowdsource better open source maps by verifying and providing information through the app. Suddenly, that aimless meandering you don't really want to do is a fun quest for you and your family. + +### Diversify + +![Mini stapler][9] + +Being in an office can present exciting challenges, whether it's because you're in a dynamic industry or in a petty fight with a colleague over ownership of a stapler. When you work from home, your daily routine can get pretty, well, routine. If that's the case, it might be time to diversify. + +If you've been meaning to [get involved with open source][10], now's a great time for it. + +If you suspect you might be artistic (or even if you're convinced you're not, but you have something you want to express), then maybe it's time to finally learn how to create some [digital imagery][11]. + +Or maybe you're curious about programming. It might be easier than you think and given enough free time, you might even end up with [your own game written in Python][12]. + +### Make some music + +![Music keyboardas][13] + +Artistic expression is important, whether you're working from home or living with someone who's bored at home. The great thing about music is that you don't need to be _musical_ to [make some really cool noise][14]. In fact, you can make some [wild sounds on a Raspberry Pi][15], if you have one lying around. + +If you happen to be musical, though, you can have a go at a digital audio workstation like [Qtractor][16] or [Rosegarden][17]. For inspiration, read about a [professional composer][18] and the music festival he created. + +### Refurbish + +![Old computers][19] + +I don't like it when good things go to waste, especially computers. Read about [refurbishing old computers][20] and [really old computers][21], and then rummage around in your attic to find one for your own experiments. + +### Meet the challenge + +Being stuck at home for long periods of time, whether it's for a few weeks or the better part of your career, can be challenging. However, open source is a vast landscape of opportunity. Explore and find the parts of it that appeal to you. You can build a hobby, and maybe even a career, out of all the fun things you can do with other people's toys. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/open-source-activities + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_dandelion_520x292.png?itok=-xhFQvUj (Person in a field of dandelions) +[2]: https://opensource.com/sites/default/files/uploads/diversions_seeeduino.jpg (Seeeduino in the garden) +[3]: https://opensource.com/article/19/12/kids-students-education +[4]: https://opensource.com/article/17/3/arduino-garden-projects +[5]: https://opensource.com/article/19/5/hardware-outdoors +[6]: https://opensource.com/sites/default/files/uploads/diversions_walk.jpg (Walking) +[7]: https://opensource.com/article/20/1/streetcomplete-crowdsource-maps +[8]: https://opensource.com/article/17/8/openstreetmap +[9]: https://opensource.com/sites/default/files/uploads/diversions_stapler.jpg (Mini stapler) +[10]: https://opensource.com/article/17/10/open-source-cats +[11]: https://opensource.com/life/12/6/design-without-debt-five-tools-for-designers +[12]: https://opensource.com/article/17/10/python-101 +[13]: https://opensource.com/sites/default/files/uploads/diversions_keyboards.jpg (Music keyboards) +[14]: https://opensource.com/life/16/2/linux-multimedia-studio +[15]: https://opensource.com/article/20/3/sonic-pi +[16]: https://opensource.com/article/17/6/qtractor-audio +[17]: https://opensource.com/article/18/3/make-sweet-music-digital-audio-workstation-rosegarden +[18]: https://opensource.com/article/20/2/linux-open-source-music +[19]: https://opensource.com/sites/default/files/uploads/diversions_old-computers.jpg (Old computers) +[20]: https://opensource.com/article/19/7/how-make-old-computer-useful-again +[21]: https://opensource.com/article/20/2/restore-old-computer-linux From 6c049aa4788b428aaf306ae0b23bef4e7d7ddd3c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 Apr 2020 09:14:09 +0800 Subject: [PATCH 0239/1809] Rename sources/tech/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md to sources/news/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md --- ...Pi-smart TV replacement from KDE, and more open source news.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md (100%) diff --git a/sources/tech/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md b/sources/news/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md similarity index 100% rename from sources/tech/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md rename to sources/news/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md From 4c9e392b2cb4396cf114c06071f5545d8a5efc0f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 Apr 2020 09:14:56 +0800 Subject: [PATCH 0240/1809] Rename sources/tech/20200411 5 open source activities while you work from home.md to sources/talk/20200411 5 open source activities while you work from home.md --- .../20200411 5 open source activities while you work from home.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200411 5 open source activities while you work from home.md (100%) diff --git a/sources/tech/20200411 5 open source activities while you work from home.md b/sources/talk/20200411 5 open source activities while you work from home.md similarity index 100% rename from sources/tech/20200411 5 open source activities while you work from home.md rename to sources/talk/20200411 5 open source activities while you work from home.md From 2b4f0b373fe060082219a38dfc6328d659ad2975 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Apr 2020 09:35:28 +0800 Subject: [PATCH 0241/1809] PRF @geekpi --- ...from spreadsheets in Fedora with Python.md | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/translated/tech/20200330 Using data from spreadsheets in Fedora with Python.md b/translated/tech/20200330 Using data from spreadsheets in Fedora with Python.md index abd3f63cf8..864c42c760 100644 --- a/translated/tech/20200330 Using data from spreadsheets in Fedora with Python.md +++ b/translated/tech/20200330 Using data from spreadsheets in Fedora with Python.md @@ -1,22 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using data from spreadsheets in Fedora with Python) [#]: via: (https://fedoramagazine.org/using-data-from-spreadsheets-in-fedora-with-python/) [#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) -在 Fedora 中使用 Python 读取电子表格中的数据 +使用 Python 读取电子表格中的数据 ====== ![][1] -[Python][2] 是最流行、功能最强大的编程语言之一。由于它是免费和开源的,因此每个人都可以使用。大多数 Fedora 系统都已安装了该语言。Python 可用于多种任务,其中包括处理逗号分隔值(**CSV**)数据。CSV 文件通常作为表格启动。本文介绍了如何在 Python 3 中处理 CSV 数据。 +[Python][2] 是最流行、功能最强大的编程语言之一。由于它是自由开源的,因此每个人都可以使用。大多数 Fedora 系统都已安装了该语言。Python 可用于多种任务,其中包括处理逗号分隔值(CSV)数据。CSV文件一开始往往是以表格或电子表格的形式出现。本文介绍了如何在 Python 3 中处理 CSV 数据。 -CSV 数据正是它听起来的样子。CSV 文件一次包含一行数据,数值之间用逗号分隔。每行由相同的_字段_定义。简短的 CSV 文件通常易于阅读和理解。但是较长的数据或具有更多字段的数据文件可能很难用肉眼解析,因此在这种情况下计算机做得更好。 +CSV 数据正如其名。CSV 文件按行放置数据,数值之间用逗号分隔。每行由相同的*字段*定义。简短的 CSV 文件通常易于阅读和理解。但是较长的数据文件或具有更多字段的数据文件可能很难用肉眼解析,因此在这种情况下计算机做得更好。 -这是一个简单的示例,其中的字段是 _Name _、_ Email_ 和 _Country_。在此例中,CSV 数据将字段定义作为第一行,尽管并非总是如此。 +这是一个简单的示例,其中的字段是 `Name`、`Email` 和 `Country`。在此例中,CSV 数据将字段定义作为第一行,尽管并非总是如此。 ``` Name,Email,Country @@ -27,9 +27,9 @@ Bernard Jones,bjones@example.com,UK ### 从电子表格读取 CSV -Python 包含了一个 _csv_ 模块,它可读取和写入 CSV 数据。大多数电子表格应用,无论是原生(例如 Excel 或 Numbers)还是基于 Web 的(例如 Google Sheet),都可以导出 CSV 数据。实际上,许多其他可发布表格报告的服务也将导出为 CSV(例如,PayPal)。 +Python 包含了一个 `csv` 模块,它可读取和写入 CSV 数据。大多数电子表格应用,无论是原生(例如 Excel 或 Numbers)还是基于 Web 的(例如 Google Sheet),都可以导出 CSV 数据。实际上,许多其他可发布表格报告的服务也可以导出为 CSV(例如,PayPal)。 -Python _csv_ 模块有一个名为 _DictReader_ 的内置读取器方法,它可以将每个数据行作为有序字典 (OrderedDict) 处理。它需要一个文件对象访问 CSV 数据。因此,如果上面的文件在当前目录中为 _example.csv_,那么以下代码段是获取此数据的一种方法: +Python `csv` 模块有一个名为 `DictReader` 的内置读取器方法,它可以将每个数据行作为有序字典 (`OrderedDict`) 处理。它需要一个文件对象访问 CSV 数据。因此,如果上面的文件在当前目录中为 `example.csv`,那么以下代码段是获取此数据的一种方法: ``` f = open('example.csv', 'r') @@ -40,7 +40,7 @@ for row in d: data.append(row) ``` -现在,内存中的 _data_ 对象是 OrderedDict 对象的列表: +现在,内存中的 `data` 对象是 `OrderedDict` 对象的列表: ``` [OrderedDict([('Name', 'John Q. Smith'), @@ -63,7 +63,7 @@ USA bjones@example.com ``` -顺便说一句,如果你需要处理没有字段名标题行的 CSV 文件,那么 _DictReader_ 类可以让你定义它们。在上面的示例中,添加 _fieldnames_ 参数并传递一系列名称: +顺便说一句,如果你需要处理没有字段名标题行的 CSV 文件,那么 `DictReader` 类可以让你定义它们。在上面的示例中,添加 `fieldnames` 参数并传递一系列名称: ``` d = DictReader(f, fieldnames=['Name', 'Email', 'Country']) @@ -71,9 +71,9 @@ d = DictReader(f, fieldnames=['Name', 'Email', 'Country']) ### 真实例子 -我最近想从一长串人中随机选择一名赢家。我从电子表格中提取的 CSV 数据是一个简单的名称和邮件地址列表。 +我最近想从一长串人员名单中随机选择一个中奖者。我从电子表格中提取的 CSV 数据是一个简单的名字和邮件地址列表。 -幸运的是,Python 有一个有用的 _random_ 模块,可以很好地生成随机值。该模块 _Random_ 类中的 _randrange_ 函数正是我需要的。你可以给它一个常规的数字范围(例如整数),以及它们之间的步长值。然后,该函数会生成一个随机结果,这意味着我可以在数据的总行数范围内获得一个随机整数(或行号!)。 +幸运的是,Python 有一个有用的 `random` 模块,可以很好地生成随机值。该模块 `Random` 类中的 `randrange` 函数正是我需要的。你可以给它一个常规的数字范围(例如整数),以及它们之间的步长值。然后,该函数会生成一个随机结果,这意味着我可以在数据的总行数范围内获得一个随机整数(或者说是行号)。 这个小程序运行良好: @@ -94,9 +94,7 @@ print('Email address:', winner['Email']) 显然,这个例子非常简单。电子表格本身包含了复杂的分析数据的方法。但是,如果你想在电子表格应用之外做某事,Python 或许是一种技巧! -* * * - -_由 [Isaac Smith][3] 拍摄,发表于 [U​​nsplash][4]。_ +题图由 [Isaac Smith][3] 拍摄,发表于 [U​​nsplash][4]。 -------------------------------------------------------------------------------- @@ -105,7 +103,7 @@ via: https://fedoramagazine.org/using-data-from-spreadsheets-in-fedora-with-pyth 作者:[Paul W. Frields][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 059aac98dd2c9230035ad63892a068ae77f55c21 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Apr 2020 09:35:58 +0800 Subject: [PATCH 0242/1809] PUB @geekpi https://linux.cn/article-12099-1.html --- ...0330 Using data from spreadsheets in Fedora with Python.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200330 Using data from spreadsheets in Fedora with Python.md (98%) diff --git a/translated/tech/20200330 Using data from spreadsheets in Fedora with Python.md b/published/20200330 Using data from spreadsheets in Fedora with Python.md similarity index 98% rename from translated/tech/20200330 Using data from spreadsheets in Fedora with Python.md rename to published/20200330 Using data from spreadsheets in Fedora with Python.md index 864c42c760..9cff11bd8f 100644 --- a/translated/tech/20200330 Using data from spreadsheets in Fedora with Python.md +++ b/published/20200330 Using data from spreadsheets in Fedora with Python.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12099-1.html) [#]: subject: (Using data from spreadsheets in Fedora with Python) [#]: via: (https://fedoramagazine.org/using-data-from-spreadsheets-in-fedora-with-python/) [#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) From c93cc62cf6f0010bafbdc325cf5dc8442243a05c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Apr 2020 11:15:29 +0800 Subject: [PATCH 0243/1809] APL --- sources/tech/20200211 Navigating man pages in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200211 Navigating man pages in Linux.md b/sources/tech/20200211 Navigating man pages in Linux.md index 662a1d48af..0d90822c52 100644 --- a/sources/tech/20200211 Navigating man pages in Linux.md +++ b/sources/tech/20200211 Navigating man pages in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 37b694ee849170a91c72aeacbed15599e50da453 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Apr 2020 11:59:48 +0800 Subject: [PATCH 0244/1809] TSL --- .../20200211 Navigating man pages in Linux.md | 179 ------------------ .../20200211 Navigating man pages in Linux.md | 172 +++++++++++++++++ 2 files changed, 172 insertions(+), 179 deletions(-) delete mode 100644 sources/tech/20200211 Navigating man pages in Linux.md create mode 100644 translated/tech/20200211 Navigating man pages in Linux.md diff --git a/sources/tech/20200211 Navigating man pages in Linux.md b/sources/tech/20200211 Navigating man pages in Linux.md deleted file mode 100644 index 0d90822c52..0000000000 --- a/sources/tech/20200211 Navigating man pages in Linux.md +++ /dev/null @@ -1,179 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Navigating man pages in Linux) -[#]: via: (https://www.networkworld.com/article/3519853/navigating-man-pages-in-linux.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -Navigating man pages in Linux -====== -The man pages on a Linux system can do more than provide information on particular commands. They can help discover commands you didn't realize were available. -[Hello I'm Nik][1] [(CC0)][2] - -Man pages provide essential information on Linux commands and many users refer to them often, but there’s a lot more to the man pages than many of us realize. - -You can always type a command like “man who” and get a nice description of how the man command works, but exploring commands that you might not know could be even more illuminating. For example, you can use the man command to help identify commands to handle some unusually challenging task or to show options that can help you use a command you already know in new and better ways. - -Let’s navigate through some options and see where we end up. - -[MORE ON NETWORK WORLD: Linux: Best desktop distros for newbies][3] - -### Using man to identify commands - -The man command can help you find commands by topic. If you’re looking for a command to count the lines in a file, for example, you can provide a keyword. In the example below, we’ve put the keyword in quotes and added blanks so that we don’t get commands that deal with “accounts” or “accounting” along with those that do some counting for us. - -``` -$ man -k ' count ' -anvil (8postfix) - Postfix session count and request rate control -cksum (1) - checksum and count the bytes in a file -sum (1) - checksum and count the blocks in a file -timer_getoverrun (2) - get overrun count for a POSIX per-process timer -``` - -To show commands that relate to new user accounts, we might try a command like this: - -``` -$ man -k "new user" -newusers (8) - update and create new users in batch -useradd (8) - create a new user or update default new user information -zshroadmap (1) - informal introduction to the zsh manual The Zsh Manual, … -``` - -Just to be clear, the third item in the list above makes a reference to “new users” liking the material and is not a command for setting up, removing or configuring user accounts. The man command is simply matching words in the command description, acting very much like the apropos command. Notice the numbers in parentheses after each command listed above. These relate to the man page sections that contain the commands. - -### Identifying the manual sections - -The man command sections divide the commands into categories. To list these categories, type “man man” and look for descriptions like those below. You very likely won’t have Section 9 commands on your system. - -[][4] - -``` -1 Executable programs or shell commands -2 System calls (functions provided by the kernel) -3 Library calls (functions within program libraries) -4 Special files (usually found in /dev) -5 File formats and conventions eg /etc/passwd -6 Games -7 Miscellaneous (including macro packages and conventions), e.g. - man(7), groff(7) -8 System administration commands (usually only for root) -9 Kernel routines [Non standard] -``` - -Man pages cover more than what we typically think of as “commands”. As you can see from the above descriptions, they cover system calls, library calls, special files and more. - -The listing below shows where man pages are actually stored on Linux systems. The dates on these directories will vary because, with updates, some of these sections will get new content while others will not. - -``` -$ ls -ld /usr/share/man/man? -drwxr-xr-x 2 root root 98304 Feb 5 16:27 /usr/share/man/man1 -drwxr-xr-x 2 root root 65536 Oct 23 17:39 /usr/share/man/man2 -drwxr-xr-x 2 root root 270336 Nov 15 06:28 /usr/share/man/man3 -drwxr-xr-x 2 root root 4096 Feb 4 10:16 /usr/share/man/man4 -drwxr-xr-x 2 root root 28672 Feb 5 16:25 /usr/share/man/man5 -drwxr-xr-x 2 root root 4096 Oct 23 17:40 /usr/share/man/man6 -drwxr-xr-x 2 root root 20480 Feb 5 16:25 /usr/share/man/man7 -drwxr-xr-x 2 root root 57344 Feb 5 16:25 /usr/share/man/man8 -``` - -Note that the man page files are generally **gzipped** to save space. The man command unzips them as needed whenever you use the man command. - -``` -$ ls -l /usr/share/man/man1 | head -10 -total 12632 -lrwxrwxrwx 1 root root 9 Sep 5 06:38 [.1.gz -> test.1.gz --rw-r--r-- 1 root root 563 Nov 7 05:07 2to3-2.7.1.gz --rw-r--r-- 1 root root 592 Apr 23 2016 411toppm.1.gz --rw-r--r-- 1 root root 2866 Aug 14 10:36 a2query.1.gz --rw-r--r-- 1 root root 2361 Sep 9 15:13 aa-enabled.1.gz --rw-r--r-- 1 root root 2675 Sep 9 15:13 aa-exec.1.gz --rw-r--r-- 1 root root 1142 Apr 3 2018 aaflip.1.gz --rw-r--r-- 1 root root 3847 Aug 14 10:36 ab.1.gz --rw-r--r-- 1 root root 2378 Aug 23 2018 ac.1.gz -``` - -### Listing man pages by section - -Even just looking at the first 10 man pages in Section 1 (as shown above), you are likely to see some commands that are new to you – maybe **a2query** or **aaflip** (shown above). - -An even better strategy for exploring commands is to list commands by section without looking at the files themselves but, instead, using a man command that shows you the commands and provides a brief description of each. - -In the command below, the **-s 1** instructs man to display information on commands in section 1. The **-k .** makes the command work for all commands rather than specifying a particular keyword; without this, the man command would come back and ask “What manual page do you want?” So, use a keyword to select a group of related commands or a dot to show all commands in a section. - -``` -$ man -s 1 -k . -2to3-2.7 (1) - Python2 to Python3 converter -411toppm (1) - convert Sony Mavica .411 image to ppm -as (1) - the portable GNU assembler. -baobab (1) - A graphical tool to analyze disk usage -busybox (1) - The Swiss Army Knife of Embedded Linux -cmatrix (1) - simulates the display from "The Matrix" -expect_dislocate (1) - disconnect and reconnect processes -red (1) - line-oriented text editor -enchant (1) - a spellchecker -… -``` - -### How many man pages are there? - -If you’re curious about how many man pages there are in each section, you can count them by section with a command like this: - -``` -$ for num in {1..8} -> do -> man -s $num -k . | wc -l -> done -2382 -493 -2935 -53 -441 -11 -245 -919 -``` - -The exact number may vary, but most Linux systems will have a similar number of commands. If we use a command that adds these numbers together, we can see that the system that this command is running on has nearly 7,500 man pages. That’s a lot of commands, system calls, etc. - -``` -$ for num in {1..8} -> do -> num=`man -s $num -k . | wc -l` -> tot=`expr $num + $tot` -> echo $tot -> done -2382 -2875 -5810 -5863 -6304 -6315 -6560 -7479 <=== total -``` - -There’s a lot you can learn by reading man pages, but exploring them in other ways can help you become aware of commands you may not have known were available on your system. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3519853/navigating-man-pages-in-linux.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ -[b]: https://github.com/lujun9972 -[1]: https://unsplash.com/photos/YiRQIglwYig -[2]: https://creativecommons.org/publicdomain/zero/1.0/ -[3]: https://www.networkworld.com/slideshow/153439/linux-best-desktop-distros-for-newbies.html#tk.nww-infsb -[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20200211 Navigating man pages in Linux.md b/translated/tech/20200211 Navigating man pages in Linux.md new file mode 100644 index 0000000000..5a160269e9 --- /dev/null +++ b/translated/tech/20200211 Navigating man pages in Linux.md @@ -0,0 +1,172 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Navigating man pages in Linux) +[#]: via: (https://www.networkworld.com/article/3519853/navigating-man-pages-in-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +在 Linux 中遨游手册页的海洋 +====== + +> Linux 系统上的手册页可以做的不仅仅是提供特定命令的信息。它们可以帮助你发现你没有意识到的命令。 + +[Hello I'm Nik][1] [(CC0)][2] + +手册页提供了关于 Linux 命令的基本信息,很多用户经常参考它,但手册页的内容比我们很多人意识到的要多得多。 + +你总是可以输入一个像 `man who` 这样的命令,然后得到 `who` 命令的工作原理的漂亮描述,但是探索你可能不知道的命令可能会更有启发。例如,你可以使用 `man` 命令来帮助确定处理一些非常具有挑战性的任务的命令,或者显示一些选项,这些选项可以帮助你以新的更好的方式使用你已经知道的命令。 + +让我们来浏览一些选项,看看最终的结果是什么。 + +### 用 man 去识别命令 + +`man` 命令可以帮助你按主题查找命令。例如,如果你要找一个计算文件中的行数的命令,你可以提供一个关键字。在下面的例子中,我们把关键字 “count” 放在了引号中,并添加了空格,这样我们就不会得到与 “accounts” 或 “accounting” 相关的命令,而是得到那些可以为我们做一些计算的命令。 + +``` +$ man -k ' count ' +anvil (8postfix) - Postfix session count and request rate control +cksum (1) - checksum and count the bytes in a file +sum (1) - checksum and count the blocks in a file +timer_getoverrun (2) - get overrun count for a POSIX per-process timer +``` + +为了显示与新用户账户相关的命令,我们可以尝试使用这样的命令。 + +``` +$ man -k "new user" +newusers (8) - update and create new users in batch +useradd (8) - create a new user or update default new user information +zshroadmap (1) - informal introduction to the zsh manual The Zsh Manual, … +``` + +需要说明的是,上面的第三项只是提到 “new users” 类似的内容,并不是设置、删除或配置用户账号的命令。`man` 命令只是在命令描述中匹配了一些词,作用很像 `apropos` 命令。注意上面列出的每个命令后面的括号中的数字。这些数字与包含这些命令的手册页的部分有关。 + +### 确定手册页的部分 + +`man` 命令部分将命令划分为不同的类别。要列出这些类别,请键入 `man man`,并查看类似下面的描述。你的系统中很可能没有第 9 部分的命令。 + +- `1`:可执行程序或 shell 命令 +- `2`:系统调用(内核提供的函数) +- `3`:库调用(程序库内的函数) +- `4`:特殊文件(通常在可以 `/dev` 中找到) +- `5`:文件格式和惯例,例如 `/etc/passwd` +- `6`:游戏 +- `7`:杂项(包括宏包和约定),例如 `man`(7)、`groff`(7) +- `8`:系统管理命令(通常只由 root 用户使用) +- `9`:内核例程(非标准) + +手册页涵盖了比我们通常认为的“命令”更多的内容。从上面的描述中可以看到,它们涵盖了系统调用、库调用、特殊文件等等。 + +下面的列表显示了 Linux 系统中的手册页的实际存储位置。这些目录上的日期会有所不同,因为随着更新,其中一些部分会有新的内容,而另一些则不会。 + +``` +$ ls -ld /usr/share/man/man? +drwxr-xr-x 2 root root 98304 Feb 5 16:27 /usr/share/man/man1 +drwxr-xr-x 2 root root 65536 Oct 23 17:39 /usr/share/man/man2 +drwxr-xr-x 2 root root 270336 Nov 15 06:28 /usr/share/man/man3 +drwxr-xr-x 2 root root 4096 Feb 4 10:16 /usr/share/man/man4 +drwxr-xr-x 2 root root 28672 Feb 5 16:25 /usr/share/man/man5 +drwxr-xr-x 2 root root 4096 Oct 23 17:40 /usr/share/man/man6 +drwxr-xr-x 2 root root 20480 Feb 5 16:25 /usr/share/man/man7 +drwxr-xr-x 2 root root 57344 Feb 5 16:25 /usr/share/man/man8 +``` + +注意,为了节省空间,手册页文件一般都是 gzip 压缩的。每当你使用 `man` 命令时,`man` 命令会根据需要解压。 + +``` +$ ls -l /usr/share/man/man1 | head -10 +total 12632 +lrwxrwxrwx 1 root root 9 Sep 5 06:38 [.1.gz -> test.1.gz +-rw-r--r-- 1 root root 563 Nov 7 05:07 2to3-2.7.1.gz +-rw-r--r-- 1 root root 592 Apr 23 2016 411toppm.1.gz +-rw-r--r-- 1 root root 2866 Aug 14 10:36 a2query.1.gz +-rw-r--r-- 1 root root 2361 Sep 9 15:13 aa-enabled.1.gz +-rw-r--r-- 1 root root 2675 Sep 9 15:13 aa-exec.1.gz +-rw-r--r-- 1 root root 1142 Apr 3 2018 aaflip.1.gz +-rw-r--r-- 1 root root 3847 Aug 14 10:36 ab.1.gz +-rw-r--r-- 1 root root 2378 Aug 23 2018 ac.1.gz +``` + +### 按部分列出的手册页 + +即使只看第 1 部分的前 10 个手册页(如上所示),你也可能会看到一些新的命令 —— 也许是 `a2query` 或 `aaflip`(如上所示)。 + +探索命令的更好策略是按节列出命令,不查看文件本身,而是使用 `man` 命令向你显示命令并提供每个命令的简要说明。 + +在下面的命令中,`-s 1` 指示 `man` 显示第 1 部分中的命令信息。`-k .` 使该命令对所有命令都有效,而不是指定一个特定的关键字;如果没有这个,`man` 命令就会回过头来问:“你想要什么手册页?”所以,使用关键字来选择一组相关的命令,或者使用点来显示一个部分中的所有命令。 + +``` +$ man -s 1 -k . +2to3-2.7 (1) - Python2 to Python3 converter +411toppm (1) - convert Sony Mavica .411 image to ppm +as (1) - the portable GNU assembler. +baobab (1) - A graphical tool to analyze disk usage +busybox (1) - The Swiss Army Knife of Embedded Linux +cmatrix (1) - simulates the display from "The Matrix" +expect_dislocate (1) - disconnect and reconnect processes +red (1) - line-oriented text editor +enchant (1) - a spellchecker +… +``` + +### 有几本手册页? + +如果你对每个部分中有多少手册页感到好奇,可以使用以下命令按部分对它们进行计数: + +``` +$ for num in {1..8} +> do +> man -s $num -k . | wc -l +> done +2382 +493 +2935 +53 +441 +11 +245 +919 +``` + +确切的数量可能有所不同,但是大多数 Linux 系统的命令数量差不多。如果我们使用命令将这些数字加在一起,我们可以看到运行该命令的系统上有将近 7500 个手册页。有很多命令,系统调用等。 + +``` +$ for num in {1..8} +> do +> num=`man -s $num -k . | wc -l` +> tot=`expr $num + $tot` +> echo $tot +> done +2382 +2875 +5810 +5863 +6304 +6315 +6560 +7479 <=== total +``` + +阅读手册页可以学到很多东西,但是以其他方式浏览手册页可以帮助你了解系统上可能不知道的命令。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3519853/navigating-man-pages-in-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://unsplash.com/photos/YiRQIglwYig +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/slideshow/153439/linux-best-desktop-distros-for-newbies.html#tk.nww-infsb +[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 15a4fb2a6e1e2d42a75143f627597d62f8703001 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Apr 2020 12:30:46 +0800 Subject: [PATCH 0245/1809] PRF @tinyeyeser --- ...ontrol the firewall at the command line.md | 54 +++++++++---------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/translated/tech/20200320 Control the firewall at the command line.md b/translated/tech/20200320 Control the firewall at the command line.md index d496e169a1..e9b0699347 100644 --- a/translated/tech/20200320 Control the firewall at the command line.md +++ b/translated/tech/20200320 Control the firewall at the command line.md @@ -1,47 +1,47 @@ [#]: collector: "lujun9972" -[#]: translator: "tinyeyeser " -[#]: reviewer: " " +[#]: translator: "tinyeyeser" +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "Control the firewall at the command line" [#]: via: "https://fedoramagazine.org/control-the-firewall-at-the-command-line/" [#]: author: "Paul W. Frields https://fedoramagazine.org/author/pfrields/" -命令行下玩转防火墙(Fedora) +在 Fedora 命令行下玩转防火墙 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202004/12/123040ghxuicphyhsoppch.jpg) 网络防火墙,顾名思义:为了阻止不需要的网络连接而设置的防护性屏障。在与外界建立连接或是提供网络服务时常常会用到。例如,在学校或是咖啡厅里使用笔记本电脑时,你一定不想某个陌生人窥探你的电脑。 -每个 Fedora 系统都内置了一款防火墙。这是 Linux 内核网络功能的一部分。本文介绍如何通过 *firewall-cmd* 命令修改防火墙的配置。 +每个 Fedora 系统都内置了一款防火墙。这是 Linux 内核网络功能的一部分。本文介绍如何通过 `firewall-cmd` 命令修改防火墙的配置。 ### 网络基础 本文并不教授计算机网络的[所有知识][2],但还是会简单介绍一些网络基础。 -网络中的所有计算机都有一个 *IP 地址*,可以把它想象成一个邮箱地址,有了邮箱地址,邮件才知道发往何处。每台计算机还会拥有一组*端口*,端口号范围从0到65535。同样的,你可以把这些端口想象成用来连接邮箱地址的连接点。 +网络中的所有计算机都有一个 *IP 地址*,可以把它想象成一个邮箱地址,有了邮箱地址,邮件才知道发往何处。每台计算机还会拥有一组*端口*,端口号范围从 0 到 65535。同样的,你可以把这些端口想象成用来连接邮箱地址的连接点。 -通常情况下,端口会是一个标准端口号或是根据应用程序的应答要求选定的一个端口范围。例如,一台 web server 通常会保留 80 端口用于 HTTP 通信,443 端口用于 HTTPS。小于1024的端口主要用于系统或常见用途,1024-49151端口用于注册,49152及以上端口多为临时使用(只短时间启用)。 +通常情况下,端口会是一个标准端口号或是根据应用程序的应答要求选定的一个端口范围。例如,一台 Web 服务器通常会保留 80 端口用于 HTTP 通信,443 端口用于 HTTPS。小于 1024 的端口主要用于系统或常见用途,1024-49151 端口是已经注册的,49152 及以上端口多为临时使用(只限短时间使用)。 -互联网传输中最常见的两个协议,[TCP][4] 和 [UDP][5]。当要传输的数据很重要,不能有丢包时,就使用TCP协议,如果数据包没有按顺序到达,还需要重组为正确的顺序。UDP协议则更多用于对时间敏感的服务,为了保证时效性,有时允许丢失部分数据。 +互联网传输中最常见的两个协议,[TCP][4] 和 [UDP][5]。当要传输的数据很重要,不能有丢包时,就使用 TCP 协议,如果数据包没有按顺序到达,还需要重组为正确的顺序。UDP 协议则更多用于对时间敏感的服务,为了保证时效性,有时允许丢失部分数据。 -系统中运行的应用,例如 web server,会保留一些端口(例如上文提到的80和443)。在网络传输过程中,主机会为传输的两端建立一个链接,一端是源地址和源端口,另一端是目的地址和目的端口。 +系统中运行的应用,例如 Web 服务器,会保留一些端口(例如上文提到的 80 和 443)。在网络传输过程中,主机会为传输的两端建立一个链接,一端是源地址和源端口,另一端是目的地址和目的端口。 -网络防火墙就是基于地址、端口及其他标准的一组规则集,来对网络数据的传输进行屏蔽或阻断的。通过 *fire-cmd* 命令,我们就可以查看或修改防火墙的工作配置。 +网络防火墙就是基于地址、端口及其他标准的一组规则集,来对网络数据的传输进行屏蔽或阻断的。通过 `firewall-cmd` 命令,我们就可以查看或修改防火墙的工作配置。 ### 防火墙域(zone) -为了验证防火墙是否开启,使用 *firewall-cmd* 命令,输入时要加上[sudo](https://fedoramagazine.org/howto-use-sudo/)。(通常,在运行了[PolicyKit](https://en.wikipedia.org/wiki/Polkit)的环境中,你也可以不加 *sudo*) +为了验证防火墙是否开启,使用 `firewall-cmd` 命令,输入时要加上 [sudo](https://fedoramagazine.org/howto-use-sudo/)。(通常,在运行了 [PolicyKit](https://en.wikipedia.org/wiki/Polkit) 的环境中,你也可以不加 `sudo`) ``` $ sudo firewall-cmd --state running ``` -firewalld 服务支持任意数量的域。每个域都可以拥有独立的配置和防护规则。一台 Fedora 工作站的外部接口(例如 WIFI 或有线网卡)其默认域为 *FedoraWorkstation*。 +firewalld 服务支持任意数量的域。每个域都可以拥有独立的配置和防护规则。一台 Fedora 工作站的外部接口(例如 WIFI 或有线网卡)其默认域为 `FedoraWorkstation`。 -要看有哪些域是激活状态,可以使用 *–get-active-zones* 选项。在本示例中,有两个网卡,有线以太网卡 *wlp2s0* 和虚拟( libvirt )桥接网卡 *virbr0* : +要看有哪些域是激活状态,可以使用 `-–get-active-zones` 选项。在本示例中,有两个网卡,有线以太网卡 `wlp2s0` 和虚拟(libvirt)桥接网卡 `virbr0`: ``` $ sudo firewall-cmd --get-active-zones @@ -60,58 +60,54 @@ $ sudo firewall-cmd --get-zones FedoraServer FedoraWorkstation block dmz drop external home internal libvirt public trusted work ``` -查询默认域中防火墙放行了哪些系统,使用 *–list-services* 选项。下例给出了一个定制系统的查询结果,你可以看到与常见的结果有些不同。 +查询默认域中防火墙放行了哪些系统,使用 `-–list-services` 选项。下例给出了一个定制系统的查询结果,你可以看到与常见的结果有些不同。 ``` $ sudo firewall-cmd --list-services dhcpv6-client mdns samba-client ssh ``` -该系统对外开启了四个服务。每个服务都对应一个常见端口。例如 *ssh* 服务对应 22 端口。 +该系统对外开启了四个服务。每个服务都对应一个常见端口。例如 `ssh` 服务对应 22 端口。 -如果要查看当前域中防火墙还开启了哪些端口,可以使用 *list-ports* 选项。当然,你也可以随时对其他域进行查询: +如果要查看当前域中防火墙还开启了哪些端口,可以使用 `--list-ports` 选项。当然,你也可以随时对其他域进行查询: ``` $ sudo firewall-cmd --list-ports --zone=FedoraWorkstation 1025-65535/udp 1025-65535/tcp ``` -结果表明,从 1025 到 65535 端口(包含UDP和TCP)默认都是开启的。 +结果表明,从 1025 到 65535 端口(包含 UDP 和 TCP)默认都是开启的。 ### 修改域、端口及服务 -以上的配置都是预先设计好的防火墙策略(design decision*)。是为了确保新手用户安装的应用都能够正常访问网络。如果你确定自己心里有数,想要一个保护性更强的策略,可以将接口放入 _FedoraServer_ 域,明确禁止所有端口的访问。_(**警告**:如果你的服务器之前是联网状态,这么做可能会导致连接中断,那你就得到机房里去修改更多的配置项!)_ +以上的配置都是预先设计好的防火墙策略。是为了确保新手用户安装的应用都能够正常访问网络。如果你确定自己心里有数,想要一个保护性更强的策略,可以将接口放入 `FedoraServer` 域,明确禁止所有端口的访问。(**警告**:如果你的服务器之前是联网状态,这么做可能会导致连接中断,那你就得到机房里去修改更多的配置项!) ``` $ sudo firewall-cmd --change-interface= --zone=FedoraServer success ``` -* _*本文并不讨论如何制定防火墙策略,Fedora社区里已经有很多讨论了。你大可以按照自身需要来修改配置。_ +**本文并不讨论如何制定防火墙策略,Fedora 社区里已经有很多讨论了。你大可以按照自身需要来修改配置。** -如果你想要开放某个服务的常见端口,可以将该服务加入默认域(或使用 _-zone_ 指定一个不同的域)。还可以一次性将其加入多个域。下例开放了 HTTP 和 HTTPS 的常见端口80、443: +如果你想要开放某个服务的常见端口,可以将该服务加入默认域(或使用 `--zone` 指定一个不同的域)。还可以一次性将其加入多个域。下例开放了 HTTP 和 HTTPS 的常见端口 80、443: ``` $ sudo firewall-cmd --add-service=http --add-service=https success ``` -并非所有的服务都有默认端口,不过大部分都是有的。使用 _–get-services_ 选项可以查看完整列表。 +并非所有的服务都有默认端口,不过大部分都是有的。使用 `-–get-services` 选项可以查看完整列表。 -如果你想指定某个特定端口号,可以直接用数字和协议进行配置。(多数情况下,_–add-service_ 和 _–add-port_ 这两个选项是合在一起使用的)下例开启的是UDP协议的网络启动服务: +如果你想指定某个特定端口号,可以直接用数字和协议进行配置。(多数情况下,`-–add-service` 和 `-–add-port` 这两个选项是合在一起使用的)下例开启的是 UDP 协议的网络启动服务: ``` $ sudo firewall-cmd --add-port=67/udp success ``` -**重要**:如果想要在系统重启或是 firewalld 服务重启后,配置仍然生效,**必须**在命令中加上 _–permanent_ 选项。本文中的例子只是临时修改了配置,下次遇到系统重启或是 firewalld 服务重启,这些配置就失效了。 +**重要**:如果想要在系统重启或是 firewalld 服务重启后,配置仍然生效,**必须**在命令中加上 `-–permanent` 选项。本文中的例子只是临时修改了配置,下次遇到系统重启或是 firewalld 服务重启,这些配置就失效了。 -以上只是 _firewall-cmd_ 和 firewalld 服务诸多功能中的一小部分。firewalld 项目的[主页][8]还有更多信息值得你去探索和尝试。 - -* * * - -_Photo by [Jakob Braun][9] on [Unsplash][10]._ +以上只是 `firewall-cmd` 和 firewalld 服务诸多功能中的一小部分。firewalld 项目的[主页][8]还有更多信息值得你去探索和尝试。 -------------------------------------------------------------------------------- @@ -120,7 +116,7 @@ via: https://fedoramagazine.org/control-the-firewall-at-the-command-line/ 作者:[Paul W. Frields][a] 选题:[lujun9972][b] 译者:[tinyeyeser](https://github.com/tinyeyeser) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a9fb67ea1394d254a1deb9fa503a223aa956c0e2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Apr 2020 12:31:20 +0800 Subject: [PATCH 0246/1809] PUB @tinyeyeser https://linux.cn/article-12103-1.html --- .../20200320 Control the firewall at the command line.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200320 Control the firewall at the command line.md (99%) diff --git a/translated/tech/20200320 Control the firewall at the command line.md b/published/20200320 Control the firewall at the command line.md similarity index 99% rename from translated/tech/20200320 Control the firewall at the command line.md rename to published/20200320 Control the firewall at the command line.md index e9b0699347..4cf7283963 100644 --- a/translated/tech/20200320 Control the firewall at the command line.md +++ b/published/20200320 Control the firewall at the command line.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "tinyeyeser" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-12103-1.html" [#]: subject: "Control the firewall at the command line" [#]: via: "https://fedoramagazine.org/control-the-firewall-at-the-command-line/" [#]: author: "Paul W. Frields https://fedoramagazine.org/author/pfrields/" From ff81e894c258a510c3ef11ed4aff836cb191881b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Apr 2020 21:09:07 +0800 Subject: [PATCH 0247/1809] APL --- ...5 years of Git- How to get started or learn something new.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20200407 15 years of Git- How to get started or learn something new.md b/sources/talk/20200407 15 years of Git- How to get started or learn something new.md index e4db52398b..2518866c9b 100644 --- a/sources/talk/20200407 15 years of Git- How to get started or learn something new.md +++ b/sources/talk/20200407 15 years of Git- How to get started or learn something new.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 92aa6de737d649b1880bec44059ac17dc667db65 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Apr 2020 22:42:43 +0800 Subject: [PATCH 0248/1809] TSL --- ...w to get started or learn something new.md | 74 ------------------- ...w to get started or learn something new.md | 74 +++++++++++++++++++ 2 files changed, 74 insertions(+), 74 deletions(-) delete mode 100644 sources/talk/20200407 15 years of Git- How to get started or learn something new.md create mode 100644 translated/talk/20200407 15 years of Git- How to get started or learn something new.md diff --git a/sources/talk/20200407 15 years of Git- How to get started or learn something new.md b/sources/talk/20200407 15 years of Git- How to get started or learn something new.md deleted file mode 100644 index 2518866c9b..0000000000 --- a/sources/talk/20200407 15 years of Git- How to get started or learn something new.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (15 years of Git: How to get started or learn something new) -[#]: via: (https://opensource.com/article/20/4/get-started-git) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -15 years of Git: How to get started or learn something new -====== -On Git's 15th anniversary, learn why it is a major component in keeping -the software industry running. -![Scissors cutting open access to files][1] - -If there's anything that's changed software in the past two decades, [Git][2] is at the top of the list. - -If you don't use Git personally, you might think it's just a tech fad, an incidental darling among developers just because it was created by the same person who started the [Linux][3] project itself. There may be some truth to that, but Git does manage to achieve some feats that no other industry has managed. With Git, developers spread all over the world are able to work on the same code, literally at the same time, with a history of every change made, and then merge all the work together to result in a finished product. The complexity is enormous, and so the tool itself can get complex, but in the end, it's a major component in keeping the software industry running. - -Whether you know Git or not, you'll very likely encounter it should you dig deep enough into open source software or enter into computer science. Whether you use Git to just download an installer package or whether you interface with it daily to manage code, learning more about it is elucidating and empowering. - -### Git terminology - -As with any specialized tool, there's a lot of jargon in Git. Terms like "clone" and "merge" and "rebase" are mysterious at best, and at worst can feel almost exclusionary. Trying to understand what all of these terms mean can be overwhelming, but not if you take a little guidance from Matthew Broberg's excellent [Git Terminology 101][4] article. In just one quick read, you'll be able to listen in on conversations about Git with real comprehension. - -### Getting started with Git - -If you need to know how to use Git, then my own [introductory article series about using Git][5] is a great place to start. The articles are several years old now, but as with so many Linux and UNIX technologies, the interface hasn't changed significantly, so the articles are as relevant today as they were when I wrote them. The series introduces you to the most basic concepts of Git, and steps you through the process of creating a repository, committing files, restoring files, merging branches, and much more. - -### Common Git services - -One of the most common uses of Git is a public Git hosting service, such as GitLab and GitHub. In his [How to clone, modify, add, and delete files in Git][6] article, Kedar Vijay Kulkarni demonstrates the everyday tasks most developers perform with Git. This isn't required reading for non-developers, but it's a must for anyone who wants to contribute to a project on a public Git hosting service. This article addresses Github specifically because it's one of the most common platforms today, but the principles apply to any web front-end for Git, including popular open source frameworks like [GitLab][7], [Gogs][8], and [Gitea][9]. - -### Try this Git walkthrough - -Do you prefer a guided tour to aimless exploration? Sometimes the easiest way to learn something is to mimic someone else's exact steps. You know the end result is a guaranteed success, so you have confidence while performing the exercise, and your brain and fingers get the benefit of repetition, which builds memory. If that's your learning style, then follow along with Alan Formy-Duvall's [practical learning exercise for Git][10] and find out what a successful Git session feels like. - -### Git apps - -Believe it or not, Git has more interfaces than text you type into a terminal. Obviously there are the web interfaces of Git hosts online, but you can use Git clients on your computer, too. For just a light layer of assistance, read Jesse Duffield's article about [Lazygit][11] or Olaf Anders' article about [Tig][12]. For the full graphical application experience, read my article about [Git-cola][13], [Sparkleshare][14], and [still others][15]. And yes, there are even [interfaces for your mobile devices][16]! - -### Learn more about Git - -Knowledge is power, so don't let Git be a mystery to you. Whether you use it directly or you only know it by name or you'd never heard of it before, now's a great time to learn about Git. There are great resources out there to help you understand how it works, why it works, and why people love it so much.  Dive in, take it at your own pace, and learn to love Git! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/get-started-git - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2 (Scissors cutting open access to files) -[2]: https://en.wikipedia.org/wiki/Git -[3]: https://opensource.com/resources/linux -[4]: https://opensource.com/article/19/2/git-terminology -[5]: https://opensource.com/life/16/7/stumbling-git -[6]: https://opensource.com/article/18/2/how-clone-modify-add-delete-git-files -[7]: https://about.gitlab.com/install/ -[8]: https://gogs.io/ -[9]: https://gitea.io/en-us/ -[10]: https://opensource.com/article/19/5/practical-learning-exercise-git -[11]: https://opensource.com/article/20/3/lazygit -[12]: https://opensource.com/article/19/6/what-tig -[13]: https://opensource.com/article/20/3/git-cola -[14]: https://opensource.com/article/19/4/file-sharing-git -[15]: https://opensource.com/life/16/8/graphical-tools-git -[16]: https://opensource.com/article/19/4/calendar-git#mobile diff --git a/translated/talk/20200407 15 years of Git- How to get started or learn something new.md b/translated/talk/20200407 15 years of Git- How to get started or learn something new.md new file mode 100644 index 0000000000..0c68509dd5 --- /dev/null +++ b/translated/talk/20200407 15 years of Git- How to get started or learn something new.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (15 years of Git: How to get started or learn something new) +[#]: via: (https://opensource.com/article/20/4/get-started-git) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +15 岁的 Git:如何入门或学习点新东西 +====== +> 在 Git 15 周年之际,了解为什么 Git 是保持软件行业运行的重要组成部分。 + +![Scissors cutting open access to files][1] + +如果说过去二十年来有什么东西改变了软件,那么 [Git][2] 位列榜首。 + +如果你没有亲自使用过 Git,你可能会认为它只是一种技术时尚,只是因为它是由 [Linux][3] 项目的创始人创建的,所以在开发者中只是一个偶然的宠儿。这或许有一定的道理,但 Git 确实取得了一些其他行业所没有的成就。有了 Git,分布在世界各地的开发者们可以在同一时间对同一段代码进行工作,并记录下每一次修改的历史,然后将所有的工作合并到一起,形成一个成品。由于这件事情非常复杂,所以这个工具本身也会变得很复杂,但归根结底,它是维持软件行业运行的重要组成部分。 + +无论你是否了解 Git,如果你足够深入的研究开源软件,或者进入计算机科学领域,都有可能遇到它。无论你使用 Git 只是为了下载一个安装包,还是每天与它交互来管理代码,了解更多关于它的知识,都会对你有很大的启发和帮助。 + +### Git 术语 + +与任何专业工具一样,Git 中也有很多行话。像“克隆clone”、“合并merge”和“变基rebase”这样的术语,充其量是神秘的,而最坏的情况下,会让人感觉到几乎是排斥性的。试图理解这些术语的含义可能会让人不知所措,但如果你从 Matthew Broberg 的优秀文章《[Git 术语基础][4]》中得到一点指导,就不会这样了。只需快速阅读一下,你就能真正理解地听懂关于 Git 的对话。 + +### Git 入门 + +如果你需要知道如何使用 Git,那么我自己的[关于使用 Git 的入门文章系列][5]是一个很好的开始。这些文章已经有几年的历史了,但就像许多 Linux 和 UNIX 技术一样,它的界面并没有发生很大的变化,所以这些文章和我写这些文章那时一样,在今天还是很有意义的。这一系列文章向你介绍了 Git 最基本的概念,并带领你完成创建仓库、提交文件、恢复文件、合并分支等过程。 + +### 常见的Git服务 + +Git 最常见的用途之一是公共的 Git 托管服务,比如 GitLab 和 GitHub。Kedar Vijay Kulkarni 在他的《[如何在 Git 中克隆、修改、添加和删除文件][6]》一文中,演示了大多数开发者使用 Git 执行的日常任务。这不是非开发者的必读书目,但对于任何想在公共 Git 托管服务上为项目做贡献的人来说,这篇文章是必读的。这篇文章专门针对的是 Github,因为它是当今最常见的平台之一,但其原理也适用于任何 Git 的 Web 前端,包括 [GitLab][7]、[Gogs][8] 和 [Gitea][9] 等流行的开源框架。 + +### 试试这个 Git 演练 + +与其漫无目的的探索,你是不是更喜欢在导游的带领下学习?有时候,学习一件事最简单的方法就是模仿别人的准确步骤。你知道最终的结果是成功的保证,所以你在进行练习的时候会有信心,而你的大脑和手指也会得到重复的好处,从而建立起记忆。如果这是你的学习风格,那就跟着 Alan Formy-Duvall 的《[Git 的实用学习练习][10]》,找出成功的 Git 课程的感觉。 + +### Git 应用程序 + +信不信由你,Git 的界面比你在终端输入的文字更多。显然,在线托管的 Git 有 Web 界面,但是你也可以在计算机上使用 Git 客户端。如果想获得更多的帮助,请阅读 Jesse Duffield 关于 [Lazygit][11] 的文章或 Olaf Anders 关于 [Tig][12] 的文章。要获得完整的图形应用程序体验,请阅读我有关 [Git-cola][13]、[Sparkleshare][14] 以及[其它应用][15]的文章。是的,甚至还有[用于你的移动设备的界面][16]! + +### 了解更多关于 Git 的信息 + +知识就是力量,所以不要让 Git 对你来说是个谜。无论你是直接使用它,还是只知道它的名字,或者你以前从未听说过它,现在都是了解 Git 的好时机。这里有很多资源可以帮助你了解它的工作原理、工作原理以及人们为什么这么喜欢它。潜入其中,按照自己的节奏来学习,并学会爱上 Git 吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/get-started-git + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2 (Scissors cutting open access to files) +[2]: https://en.wikipedia.org/wiki/Git +[3]: https://opensource.com/resources/linux +[4]: https://opensource.com/article/19/2/git-terminology +[5]: https://opensource.com/life/16/7/stumbling-git +[6]: https://opensource.com/article/18/2/how-clone-modify-add-delete-git-files +[7]: https://about.gitlab.com/install/ +[8]: https://gogs.io/ +[9]: https://gitea.io/en-us/ +[10]: https://opensource.com/article/19/5/practical-learning-exercise-git +[11]: https://opensource.com/article/20/3/lazygit +[12]: https://opensource.com/article/19/6/what-tig +[13]: https://opensource.com/article/20/3/git-cola +[14]: https://opensource.com/article/19/4/file-sharing-git +[15]: https://opensource.com/life/16/8/graphical-tools-git +[16]: https://opensource.com/article/19/4/calendar-git#mobile From 2df2462f5089120a37e90c459d047821f5449f93 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sun, 12 Apr 2020 22:50:39 +0800 Subject: [PATCH 0249/1809] Update 20190814 9 open source cloud native projects to consider.md --- ... source cloud native projects to consider.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190814 9 open source cloud native projects to consider.md b/sources/tech/20190814 9 open source cloud native projects to consider.md index 7e844d2605..5a0ea56b9e 100644 --- a/sources/tech/20190814 9 open source cloud native projects to consider.md +++ b/sources/tech/20190814 9 open source cloud native projects to consider.md @@ -257,11 +257,18 @@ Etcd is a distributed, reliable key-value store for the most critical data in a * Speed (benchmarked at 10,000 writes per second) * Reliability (distributed using Raft) +Etcd是用于分布式系统中最关键数据的分布式的,可靠的键值存储。 其主要特性有: + *定义明确的,面向用户的API(gRPC) + *客户端证书验证可选的自动TLS + *速度(可达每秒10,000次写入) + *可靠性(使用Raft实现分布式) Etcd is used as a built-in default data storage for Kubernetes and many other technologies. That said, it is rarely run independently or as a separate service; instead, it utilizes the one integrated into Kubernetes, OKD/OpenShift, or another service. There is also an [etcd Operator][35] to manage its lifecycle and unlock its API management capabilities: +Etcd是Kubernetes和许多其他技术的默认的内置数据存储方案。也就是说,它很少独立运行或作为单独的服务运行; 相反,它利用了集成到Kubernetes,OKD / OpenShift或其他服务中的一个。 还有[etcd Operator][35]来管理其生命周期并解锁其API管理功能: You can learn more in [etcd’s documentation][36] and access its [source code][16] on GitHub. +您可以在[etcd文档][36]中了解更多信息,并在GitHub上访问其[源码][16]。 ### CRI-O @@ -272,21 +279,27 @@ CRI-O is an Open Container Initiative (OCI)-compliant implementation of the Kube * Storage and management of image layers using containers/storage * Networking support through the Container Network Interface (CNI) +CRI-O是Kubernetes运行时接口的兼容开放容器倡议(OCI)实现。 CRI-O用于各种功能,包括: + *使用runc(或遵从OCI运行时规范的任何实现)和OCI运行时工具运行 + *使用容器/镜像进行镜像管理 + *使用容器/存储来存储和管理镜像层 + *通过容器网络接口(CNI)来提供网络支持 CRI-O provides plenty of [documentation][37], including guides, tutorials, articles, and even podcasts, and you can also access its [GitHub page][17]. +CRI-O提供了大量的[文档][37],包括指南,教程,文章,甚至播客,您还可以访问其[GitHub页面][17]。 * * * Did I miss an interesting open source cloud-native project? Please let me know in the comments. - +我错过了其他有趣且开源的云原生项目吗? 请在评论中提醒我。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/8/cloud-native-projects 作者:[Bryant Son][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[messon007](https://github.com/messon007) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 89e7c33235403407b11c5bc31e4499ca32100dd0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 13 Apr 2020 00:59:35 +0800 Subject: [PATCH 0250/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200413=20How?= =?UTF-8?q?=20to=20Add=20Multiple=20Time=20Zones=20in=20Ubuntu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md --- ...ow to Add Multiple Time Zones in Ubuntu.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md diff --git a/sources/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md b/sources/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md new file mode 100644 index 0000000000..3dc42a5247 --- /dev/null +++ b/sources/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add Multiple Time Zones in Ubuntu) +[#]: via: (https://itsfoss.com/add-multiple-time-zones-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Add Multiple Time Zones in Ubuntu +====== + +_**This quick tutorial shows the steps for adding additional clocks for multiple time zones in Ubuntu and other distributions using GNOME desktop environment.**_ + +If you have family members or colleagues in another country or if you live in a country with multiple time zones, keeping a track of the time difference becomes important. After all, you don’t want to disturb someone by calling at 4’o clock in the morning. + +Some Linux users also keep a tab on the [UTC time][1] because an overwhelming majority of servers use UTC. + +Situations like these can be managed better if you have multiple clocks. You can set one clock to your local time and sync other clock(s) to other time zone(s). It makes keep an eye on the different times easier. + +In this quick tutorial, I’ll show you how to add additional clocks in Ubuntu and other Linux distributions that use GNOME desktop environment. + +### Adding multiple time zone clocks in Ubuntu (and other Linux using GNOME) + +Please [check which desktop environment you are using][2]. This tutorial is suitable for GNOME desktop only. + +To add additional clocks, you can use a nifty little app unsurprisingly called [GNOME Clocks][3]. + +GNOME Clocks is a simple application that shows the time and date in multiple locations. You can also use it to set alarms or timers. Stopwatch feature is also included. + +GNOME Clocks is available in the universe repository in Ubuntu. So please make sure to [enable universe repository][4] first. + +You can search for GNOME Clocks in Software Center and install it from there. + +![Gnome Clocks Ubuntu Software Center][5] + +Alternatively, you can open a terminal and use the following command to install GNOME Clocks: + +``` +sudo apt install gnome-clocks +``` + +If you are using some other Linux distribution, please use your distribution’s software center or package manager to install this application. + +Once you have installed it, search for it by pressing the super key (Windows key) and typing clocks: + +![Gnome Clocks App Search Ubuntu][6] + +Start the application and you should see an interface that provides you a few options like adding world clock, setting alarms, use stopwatch and timer. + +Click on the + sign in the top left corner it will give you an option to search for a geographical location. Search it, select it and add it. + +![Adding additional clocks][7] + +Once you have added the required time zone(s) via its geographical location, you can see that this new clock is now added in the message try. It also shows the time difference between your local time and other time zones. + +![Multiple clocks for multiple time zones][8] + +You can use Super + M keys to quickly open the message tray. There are some more [useful Ubuntu shortcuts][9] you may master and save your time. + +If you want to remove the additional clocks, you can do that from the GNOME Clocks application interface: + +![Remove Additional Clocks][10] + +You cannot delete your current time zone and set it to something else. There are other ways [to change your current time zone in Linux][11]. + +I hope you liked this quick tip. Questions and suggestions are always welcome. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/add-multiple-time-zones-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Coordinated_Universal_Time +[2]: https://itsfoss.com/find-desktop-environment/ +[3]: https://wiki.gnome.org/Apps/Clocks +[4]: https://itsfoss.com/ubuntu-repositories/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/gnome-clocks-ubuntu-software-center.jpg?ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/gnome-clocks-app-search-ubuntu.jpg?ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/add-multiple-time-zones-gnome.jpg?ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/multiple-clocks-ubuntu.jpg?ssl=1 +[9]: https://itsfoss.com/ubuntu-shortcuts/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/remove-additional-clocks-ubuntu.jpg?ssl=1 +[11]: https://itsfoss.com/change-timezone-ubuntu/ From a01d8a0b4bf2ea624ab088afe0f5bc8b2ab6c935 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 13 Apr 2020 01:01:31 +0800 Subject: [PATCH 0251/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200412=20Use?= =?UTF-8?q?=20this=20helpful=20Bash=20script=20when=20stargazing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200412 Use this helpful Bash script when stargazing.md --- ...his helpful Bash script when stargazing.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20200412 Use this helpful Bash script when stargazing.md diff --git a/sources/tech/20200412 Use this helpful Bash script when stargazing.md b/sources/tech/20200412 Use this helpful Bash script when stargazing.md new file mode 100644 index 0000000000..f9e39e5632 --- /dev/null +++ b/sources/tech/20200412 Use this helpful Bash script when stargazing.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use this helpful Bash script when stargazing) +[#]: via: (https://opensource.com/article/20/4/linux-astronomy) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +Use this helpful Bash script when stargazing +====== +Keep your eyes on the stars by putting your Linux machine in night +vision mode with xcalib. +![Computer laptop in space][1] + +We often talk about [Linux][2] being used on servers and by developers, but it is used in many other fields too, including astronomy. There are a lot of astronomy tools available for Linux, such as sky maps, star charts, and interfaces to telescope drive systems for controlling your telescope. But one challenge for astronomers is using a computer while keeping their eyes working in the dark. + +When working out in the field at night, astronomers need to preserve their night vision. It can take up to 30 minutes for the human eye to fully dilate and adjust to low light levels, and doing things like checking a phone or laptop at the regular color and brightness levels can cause the eyes to lose their adjustment. This reduces the ability to see in the dark. An example anyone can understand: if you're reading something on your phone in bed at night and get up to go to the bathroom, you know how difficult it can be to see any obstacles that might be in your way. + +### A solution + +I'd like to present a nifty little script to help the astronomer in your family keep "their eyes" in the dark. It relies on a utility called [xcalib][3], a "tiny monitor calibration loader for X.org." It can be installed easily using your Linux package manager. + +On Fedora, for example: + + +``` +$ sudo dnf info xcalib +$ sudo dnf install xcalib +``` + +Or Ubuntu: + + +``` +`$ sudo apt-get install xcalib` +``` + +The xcalib application works only with X11, so it is not functional on Wayland systems. But Wayland has this functionality built-in, so you can get the same results through GNOME Settings. If you're using X11, xcalib is an easy way to change the color temperature of your display. + +### The script + +I discovered [Redscreen][4], a night vision filter script written by Jeff Jahr in 2014. The original script is written for the C shell, but Bash is the common default these days. In fact, the C shell is not installed by default on my current Fedora Linux workstation. So, I decided to write an updated version of the Redscreen script aimed at the newest Bash syntax, but I made one major change: utilizing a case statement. + + +``` +#!/usr/bin/bash +# redscreen.sh Fri Feb 28 11:36 EST 2020 Alan Formy-Duval +# Turn screen red - Useful to Astronomers +# Inspired by redscreen.csh created by Jeff Jahr 2014 +# () + +# This program is free software: you can redistribute it +# and/or modify it under the terms of the GNU General +# Public License as published by the Free Software Foundation, +# either version 3 of the License, or (at your option) any +# later version. + +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE.  See the GNU General Public License for +# more details. + +# You should have received a copy of the GNU General Public +# License along with this program.   +# If not, see <[http://www.gnu.org/licenses/\>][5]. + +case $1 in +            on) +            # adjust color, gamma, brightness, contrast +            xcalib -green .1 0 1 -blue .1 0 1 -red 0.5 1 40 -alter +            exit 1 +        ;; +        off) +                xcalib -clear +            exit 1 +            ;; +        inv) +            # Invert screen +                xcalib -i -a +                    exit 1 +        ;; +        dim) +            # Make the screen darker +                xcalib -clear +            xcalib -co 30 -alter +            exit 1       +        ;; +        *) +                echo "$0 [on | dim | inv | off]" +                    exit 1 +        ;; +esac +``` + +![Skychart for Linux Version 4.2.1 on Fedora workstation][6] + +A lot of astronomy programs include a "night-mode" function, but not all do. Also, this script provides a way to affect the entire screen, not just a specific application. This allows you to use your Linux system out in the field at night for other things than just stargazing—such as checking email or reading Opensource.com—without ruining your night vision. + +Whether you are an astronomer or just an amateur stargazer, you can spend all night admiring the heavens using Linux and open source! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/linux-astronomy + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_space_graphic_cosmic.png?itok=wu493YbB (Computer laptop in space) +[2]: https://opensource.com/resources/linux +[3]: http://xcalib.sourceforge.net/ +[4]: http://www.jeffrika.com/~malakai/redscreen/index.html +[5]: http://www.gnu.org/licenses/\> +[6]: https://opensource.com/sites/default/files/uploads/starchart_in_red.png (A star chart displayed in red screen mode) From af4f9e85c3ff671907b2f57a119ddfe0ef80ed84 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 13 Apr 2020 03:50:16 +0800 Subject: [PATCH 0252/1809] =?UTF-8?q?Revert=20"=E7=94=B3=E9=A2=86=E6=96=87?= =?UTF-8?q?=E7=AB=A0"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3c8e24aa2c82750fdf5a754e2c4f7b452c69923d. --- .../talk/20200306 How I learned about burnout the hard way.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20200306 How I learned about burnout the hard way.md b/sources/talk/20200306 How I learned about burnout the hard way.md index cce3324e7e..ce9af6fb52 100644 --- a/sources/talk/20200306 How I learned about burnout the hard way.md +++ b/sources/talk/20200306 How I learned about burnout the hard way.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (chuan-325) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 78cf93465826fccafb0f59a885a80dfd3ef95fc5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 13 Apr 2020 08:34:46 +0800 Subject: [PATCH 0253/1809] translated --- ...- A Free - Open Source Password Manager.md | 114 ----------------- ...- A Free - Open Source Password Manager.md | 115 ++++++++++++++++++ 2 files changed, 115 insertions(+), 114 deletions(-) delete mode 100644 sources/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md create mode 100644 translated/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md diff --git a/sources/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md b/sources/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md deleted file mode 100644 index bac49804f7..0000000000 --- a/sources/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Bitwarden: A Free & Open Source Password Manager) -[#]: via: (https://itsfoss.com/bitwarden/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Bitwarden: A Free & Open Source Password Manager -====== - -_**Brief:** Bitwarden is a popular open-source password manager. Here, we take a look at what it has to offer._ - -![][1] - -[Bitwarden][2] is a free and open-source password manager. You might remember that earlier we listed it as one of the [best password managers available for Linux][3]. - -Personally, I’ve been using Bitwarden as my password manager across multiple devices for several months now. So, in this article, I’ll be mentioning the features it offers along with my experience with it. - -**Note:** _In case you have questions about how secure the service is, check out their official security [FAQ page][4] to explore about it._ - -### Features of Bitwarden password manager - -![][5] - -[Bitwarden][2] is an impressive alternative to a lot of other convenient password managers out there. - -Here’s a breakdown of the features: - - * Free & Paid options available - * Available for Teams (Enterprise) and Individuals - * Open source - * Self-hosting support - * Ability to use it as an authenticator app (like Google Authenticator) - * Cross-platform support (Android, iOS, Linux, Windows, & macOS) - * Browser extensions available (Firefox, Chrome, Opera, Edge, Safari) - * Offers command-line tools - * Offers a Web Vault - * Ability to Import/Export Passwords - * [Password Generator][6] - * Auto-fill password - * Two-step authentication - - - -Technically, Bitwarden is completely free to use – however, it also offers some paid plans (Personal pricing plans & Business plans). - -With the premium plans, you get the ability to share the passwords with more users, get API access (business use), and more such premium perks. - -Here’s how the pricing looks like (at the time of writing this article): - -![][7] - -For most individuals, the premium personal plan of **$10/year** shouldn’t be an issue considering the fact that you will be supporting an open-source project. Of course, you can also choose to use it for free with no essential restrictions. - -### Installing Bitwarden on Linux - -![][8] - -It’s quite easy to get Bitwarden installed on your Linux system because it offers an .**AppImage** file. You can refer to our guide on [how to use AppImage][9] files, if you didn’t know it already. - -If you don’t prefer using AppImage – you can opt for the [snap package][10] or simply download the **.deb** or **.rpm** file available on their [official download page][11]. You can also check out their [GitHub page][12] for more information. - -[Download Bitwarden][2] - -You can also utilize the browser extensions if you’re not interested in using the desktop app. - -### My experience with Bitwarden - -Before Bitwarden, I was using [LastPass][13] as my password manager. Even though that’s not a bad option – it’s not an open-source software. - -So, I decided to switch to Bitwarden as soon as I found out about it. - -To start with, I simply exported my data from LastPass and imported it to Bitwarden without any hiccups. I didn’t lose any data in the process. - -In addition to the desktop app, I’ve been using Bitwarden the Firefox add-on, and the Android app. I haven’t had any issues with it after over six months of usage. So, I’d definitely give it thumbs up from my side if you’re willing to try it out! - -### Wrapping Up - -I’d say that Bitwarden is a complete solution for Linux users who want a password manager that works everywhere and syncs easily across multiple devices. - -You can get started for free but if you can, please go for the premium plan of **$10/year** to support this open-source project. - -You may also check our list of [top 5 password managers for Linux][3] should come in handy if you’re looking for more options. - -Have you tried Bitwarden yet? If not, give it a try! Also, what is your favorite password manager? Let me know in the comments below! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/bitwarden/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-screenshot.jpg?ssl=1 -[2]: https://bitwarden.com/ -[3]: https://itsfoss.com/password-managers-linux/ -[4]: https://help.bitwarden.com/security/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-dark-mode.jpg?ssl=1 -[6]: https://itsfoss.com/password-generators-linux/ -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-pricing.jpg?ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-settings.png?ssl=1 -[9]: https://itsfoss.com/use-appimage-linux/ -[10]: https://snapcraft.io/bitwarden -[11]: https://bitwarden.com/#download -[12]: https://github.com/bitwarden -[13]: https://www.lastpass.com/ diff --git a/translated/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md b/translated/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md new file mode 100644 index 0000000000..d14a896277 --- /dev/null +++ b/translated/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Bitwarden: A Free & Open Source Password Manager) +[#]: via: (https://itsfoss.com/bitwarden/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Bitwarden:一个免费的开源密码管理器 +====== + +_ **简述:** Bitwarden 是流行的开源密码管理器。 在这里,我们来看看它提供了什么。 + +![][1] + +[Bitwarden][2] 是一个免费的开源密码管理器。 你可能还记得,我们之前将它列为 [Linux 中的最佳密码管理器][3]之一。 + +就个人而言,几个月来我一直在多个设备上使用 Bitwarden 作为我的密码管理器。 因此,在本文中,我将说明它提供的功能以及我的使用经验。 + +**注意:** _ 如果你对服务的安全性有疑问,请查看其官方安全性[常见问题页面][4]。 + +### Bitwarden 密码管理器的特性 + +![][5] + +[Bitwarden][2] 是许多其他方便的密码管理器的不错替代品。 + +以下是它的特性: + + * 提供免费和付费选择 + * 适用于团队(企业)和个人 + * 开源 + * 支持自托管 + * 能够作为身份验证器应用(像 Google 身份验证器) + * 跨平台支持(安卓、iOS、Linux、Windows 和 macOS) + * 提供浏览器扩展(Firefox,、Chrome、Opera、Edge、Safari) + * 提供命令行工具 + * 提供网页保管库 + * 能够导入/导出密码 + * [密码生成器][6] + * 自动填充密码 + * 两步身份验证 + + + + +从技术上讲,Bitwarden 使用完全免费。然而,它也提供了一些付费计划(个人付费和商务付费计划)。 + +通过高级计划,你可以与更多用户共享密码、获取 API 访问权限(业务使用)以及更多此类高级功能。 + +以下是定价(在编写本文时): + +![][7] + +对于大多数个人来说,考虑到支持开源项目,10 美元/年的高级个人计划不应成为问题。当然,你也可以选择没有限制地免费使用。 + +### 在 Linux 上安装 Bitwarden + +![][8] + +很容易将 Bitwarden 安装到你的 Linux 系统上,因为它提供了一个 .**AppImage** 文件。如果你还不知道[如何使用 AppImage][9] 文件,你可以参考我们的指南。 + +如果你不喜欢使用 AppImage , 你可以选择 [snap 包][10]或在其[官方下载页面][11]上下载 **.deb** 或者 **.rpm** 文件。你还可以查看其 [GitHub 页面][12]了解更多信息。 + +[Download Bitwarden][2] + +如果你对使用桌面应用不感兴趣,也可以使用浏览器扩展。 + +### 我使用 Bitwarden 的体验 + +在 Bitwarden 之前,我使用 [LastPass][13] 作为密码管理器。尽管这不是一个糟糕的选择,但它不是开源软件。 + +所以,在我发现 Bitwarden 后就决定使用它。 + +首先,我从 LastPass 导出我的数据,并导入到 Bitwarden 没有困难。在此过程中我没有丢失任何数据。 + +除了桌面应用,我一直在使用 Bitwarden 的火狐插件,和 Android 应用。使用六个多月后,我没有遇到任何问题。所以,如果你愿意试试看,我一定会给它好评! + +### 总结 + +我想说,对于那些想要一个可以到处工作,并且跨设备轻松同步的密码管理器的用户而言,Bitwarden 是一个完整的解决方案。 + +你可以免费入门,但如果可以,请购买 **10 美元/年**的高级计划来支持这个开源项目。 + +如果你正在寻找更多选择,你也可以查看我们的 [Linux 中 5 个最佳密码管理器][5]。 + +你试过 Bitwarden 了吗?如果没有,请试试看!此外,你最喜欢的密码管理器是什么?让我在下面的评论中知道! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/bitwarden/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-screenshot.jpg?ssl=1 +[2]: https://bitwarden.com/ +[3]: https://itsfoss.com/password-managers-linux/ +[4]: https://help.bitwarden.com/security/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-dark-mode.jpg?ssl=1 +[6]: https://itsfoss.com/password-generators-linux/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-pricing.jpg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-settings.png?ssl=1 +[9]: https://itsfoss.com/use-appimage-linux/ +[10]: https://snapcraft.io/bitwarden +[11]: https://bitwarden.com/#download +[12]: https://github.com/bitwarden +[13]: https://www.lastpass.com/ From e52ec8d120490e48871cf45594962723042743ae Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 13 Apr 2020 08:39:18 +0800 Subject: [PATCH 0254/1809] translating --- ...s How to Find Out Which Desktop Environment You are Using.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md b/sources/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md index 3a8576fc49..0cedfc9709 100644 --- a/sources/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md +++ b/sources/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8161e4f651efc0f03bc6e14264d6f5dfb2d09560 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Apr 2020 09:14:39 +0800 Subject: [PATCH 0255/1809] PRF @wxy --- ...w to get started or learn something new.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/translated/talk/20200407 15 years of Git- How to get started or learn something new.md b/translated/talk/20200407 15 years of Git- How to get started or learn something new.md index 0c68509dd5..231fd609d0 100644 --- a/translated/talk/20200407 15 years of Git- How to get started or learn something new.md +++ b/translated/talk/20200407 15 years of Git- How to get started or learn something new.md @@ -1,19 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (15 years of Git: How to get started or learn something new) [#]: via: (https://opensource.com/article/20/4/get-started-git) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -15 岁的 Git:如何入门或学习点新东西 +Git 都 15 岁了,如何入门或学习点新东西 ====== + > 在 Git 15 周年之际,了解为什么 Git 是保持软件行业运行的重要组成部分。 -![Scissors cutting open access to files][1] +![](https://img.linux.net.cn/data/attachment/album/202004/13/091410k80er3mttrznc22e.jpg) -如果说过去二十年来有什么东西改变了软件,那么 [Git][2] 位列榜首。 +如果说过去二十年来有什么东西改变了软件,那么 [Git][2] 肯定位列榜首。 如果你没有亲自使用过 Git,你可能会认为它只是一种技术时尚,只是因为它是由 [Linux][3] 项目的创始人创建的,所以在开发者中只是一个偶然的宠儿。这或许有一定的道理,但 Git 确实取得了一些其他行业所没有的成就。有了 Git,分布在世界各地的开发者们可以在同一时间对同一段代码进行工作,并记录下每一次修改的历史,然后将所有的工作合并到一起,形成一个成品。由于这件事情非常复杂,所以这个工具本身也会变得很复杂,但归根结底,它是维持软件行业运行的重要组成部分。 @@ -21,19 +22,19 @@ ### Git 术语 -与任何专业工具一样,Git 中也有很多行话。像“克隆clone”、“合并merge”和“变基rebase”这样的术语,充其量是神秘的,而最坏的情况下,会让人感觉到几乎是排斥性的。试图理解这些术语的含义可能会让人不知所措,但如果你从 Matthew Broberg 的优秀文章《[Git 术语基础][4]》中得到一点指导,就不会这样了。只需快速阅读一下,你就能真正理解地听懂关于 Git 的对话。 +与任何专业工具一样,Git 中也有很多行话。像“克隆clone”、“合并merge”和“变基rebase”这样的术语,最起码也是神秘的,而更糟的情况下会令人感到排斥。试图理解这些术语的含义可能会让人不知所措,但如果你从 Matthew Broberg 的优秀文章《[Git 术语基础][4]》中得到一点指导,就不会这样了。只需快速阅读一下,你就能真正理解地听懂关于 Git 的对话。 ### Git 入门 如果你需要知道如何使用 Git,那么我自己的[关于使用 Git 的入门文章系列][5]是一个很好的开始。这些文章已经有几年的历史了,但就像许多 Linux 和 UNIX 技术一样,它的界面并没有发生很大的变化,所以这些文章和我写这些文章那时一样,在今天还是很有意义的。这一系列文章向你介绍了 Git 最基本的概念,并带领你完成创建仓库、提交文件、恢复文件、合并分支等过程。 -### 常见的Git服务 +### 常见的 Git 服务 -Git 最常见的用途之一是公共的 Git 托管服务,比如 GitLab 和 GitHub。Kedar Vijay Kulkarni 在他的《[如何在 Git 中克隆、修改、添加和删除文件][6]》一文中,演示了大多数开发者使用 Git 执行的日常任务。这不是非开发者的必读书目,但对于任何想在公共 Git 托管服务上为项目做贡献的人来说,这篇文章是必读的。这篇文章专门针对的是 Github,因为它是当今最常见的平台之一,但其原理也适用于任何 Git 的 Web 前端,包括 [GitLab][7]、[Gogs][8] 和 [Gitea][9] 等流行的开源框架。 +Git 最常见的用途之一是公共的 Git 托管服务,比如 GitLab 和 GitHub。Kedar Vijay Kulkarni 在他的《[如何在 Git 中克隆、修改、添加和删除文件][6]》一文中,演示了大多数开发者使用 Git 执行的日常任务。这不是非开发者的必读书目,但对于任何想在公共 Git 托管服务上为项目做贡献的人来说,这篇文章是必读的。这篇文章专门针对的是 Github,因为它是当今最常见的平台之一,但其原理也适用于任何 Git 服务的 Web 前端,包括 [GitLab][7]、[Gogs][8] 和 [Gitea][9] 等流行的开源框架。 ### 试试这个 Git 演练 -与其漫无目的的探索,你是不是更喜欢在导游的带领下学习?有时候,学习一件事最简单的方法就是模仿别人的准确步骤。你知道最终的结果是成功的保证,所以你在进行练习的时候会有信心,而你的大脑和手指也会得到重复的好处,从而建立起记忆。如果这是你的学习风格,那就跟着 Alan Formy-Duvall 的《[Git 的实用学习练习][10]》,找出成功的 Git 课程的感觉。 +与其漫无目的的探索,你是不是更喜欢在导游的带领下学习?有时候,学习一件事最简单的方法就是模仿别人的准确步骤。你知道最终的结果是肯定成功的,所以你在进行练习的时候会有信心,而你的大脑和手指也会得到重复的好处,从而建立起记忆。如果这是你的学习风格,那就跟着 Alan Formy-Duvall 的《[Git 的实用学习练习][10]》,找出成功的 Git 课程的感觉。 ### Git 应用程序 @@ -41,7 +42,7 @@ Git 最常见的用途之一是公共的 Git 托管服务,比如 GitLab 和 Gi ### 了解更多关于 Git 的信息 -知识就是力量,所以不要让 Git 对你来说是个谜。无论你是直接使用它,还是只知道它的名字,或者你以前从未听说过它,现在都是了解 Git 的好时机。这里有很多资源可以帮助你了解它的工作原理、工作原理以及人们为什么这么喜欢它。潜入其中,按照自己的节奏来学习,并学会爱上 Git 吧! +知识就是力量,所以不要让 Git 对你来说像个谜。无论你是直接使用它,还是只知道它的名字,或者你以前从未听说过它,现在都是了解 Git 的好时机。这里有很多资源可以帮助你了解它的工作原理、工作原理以及人们为什么这么喜欢它。潜入其中,按照自己的节奏来学习,并学会爱上 Git 吧! -------------------------------------------------------------------------------- @@ -50,7 +51,7 @@ via: https://opensource.com/article/20/4/get-started-git 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a23816006df1c0c7a3d538ab6e910059fe6d2a21 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Apr 2020 09:15:08 +0800 Subject: [PATCH 0256/1809] PUB @wxy https://linux.cn/article-12104-1.html --- ...years of Git- How to get started or learn something new.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20200407 15 years of Git- How to get started or learn something new.md (98%) diff --git a/translated/talk/20200407 15 years of Git- How to get started or learn something new.md b/published/20200407 15 years of Git- How to get started or learn something new.md similarity index 98% rename from translated/talk/20200407 15 years of Git- How to get started or learn something new.md rename to published/20200407 15 years of Git- How to get started or learn something new.md index 231fd609d0..d08342b3e7 100644 --- a/translated/talk/20200407 15 years of Git- How to get started or learn something new.md +++ b/published/20200407 15 years of Git- How to get started or learn something new.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12104-1.html) [#]: subject: (15 years of Git: How to get started or learn something new) [#]: via: (https://opensource.com/article/20/4/get-started-git) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 9cf014af0a57ed174df403f6f186bfab7b0a539a Mon Sep 17 00:00:00 2001 From: Ping Date: Mon, 13 Apr 2020 14:59:39 +0800 Subject: [PATCH 0257/1809] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20190107 Different Ways To Update Linux Kernel For Ubuntu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md b/sources/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md index 32a6a7dd3e..65b9911601 100644 --- a/sources/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md +++ b/sources/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mr-ping) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From dc0da89287555b166e76aa59194b6519acde9447 Mon Sep 17 00:00:00 2001 From: Ping Date: Mon, 13 Apr 2020 15:01:13 +0800 Subject: [PATCH 0258/1809] Complete tranlation of 20190107 Different Ways To Update Linux Kernel For Ubuntu.md --- ... Ways To Update Linux Kernel For Ubuntu.md | 161 +++++++++--------- 1 file changed, 79 insertions(+), 82 deletions(-) diff --git a/sources/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md b/sources/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md index 65b9911601..fbc0c67658 100644 --- a/sources/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md +++ b/sources/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md @@ -1,69 +1,68 @@ -[#]: collector: (lujun9972) -[#]: translator: (mr-ping) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Different Ways To Update Linux Kernel For Ubuntu) -[#]: via: (https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/) -[#]: author: (SK https://www.ostechnix.com/author/sk/) +[#]: collector: "lujun9972" +[#]: translator: "mr-ping" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Different Ways To Update Linux Kernel For Ubuntu" +[#]: via: "https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/" +[#]: author: "SK https://www.ostechnix.com/author/sk/" -Different Ways To Update Linux Kernel For Ubuntu + +升级Ubuntu Linux核心的几种不同方法 ====== ![](https://www.ostechnix.com/wp-content/uploads/2019/01/ubuntu-linux-kernel-720x340.png) -In this guide, we have given 7 different ways to update Linux kernel for Ubuntu. Among the 7 methods, five methods requires system reboot to apply the new Kernel and two methods don’t. Before updating Linux Kernel, it is **highly recommended to backup your important data!** All methods mentioned here are tested on Ubuntu OS only. We are not sure if they will work on other Ubuntu flavors (Eg. Xubuntu) and Ubuntu derivatives (Eg. Linux Mint). +这个指南里介绍了7种为Ubuntu升级Linux核心的不同方法。这7种方法里,有5种需要重启系统来使新核心生效,其他两种则不用。升级之前,**强烈建议您将重要数据进行备份!** 这里提到的所有方法只在Ubuntu中测试过。我们并不确定这些方法是不是也能适用于其他Ubuntu的特色发行版(如:Xubuntu)和衍生发行版(如:Linux Mint)。 -### Part A – Kernel Updates with reboot +### 第一部分: 需要重启的核心升级 -The following methods requires you to reboot your system to apply the new Linux Kernel. All of the following methods are recommended for personal or testing systems. Again, please backup your important data, configuration files and any other important stuff from your Ubuntu system. +以下方法需要您重启系统以便新的核心生效。所有方法都建议在个人系统或测试系统中进行。重要的事儿再说一遍,请备份好您Ubuntu中的重要数据、配置文件和其他重要的东西。 -#### Method 1 – Update the Linux Kernel with dpkg (The manual way) +### 方法1 - 使用dpkg升级Linux核心(手动方式) -This method helps you to manually download and install the latest available Linux kernel from **[kernel.ubuntu.com][1]** website. If you want to install most recent version (either stable or release candidate), this method will help. Download the Linux kernel version from the above link. As of writing this guide, the latest available version was **5.0-rc1** and latest stable version was **v4.20**. +这个方法里会帮助你手动从**[kernel.ubuntu.com][1]**网站下载可用的最新Linux核心。如果你打算安装最新版(而不是稳定版或者正式发布版),那这种方法对你会很有用。从以上链接下载Linux核心版本。编写这个指南的时候,最新的可用版本是**5.0-rc1**,最新的稳定版是**v4.20**. ![][3] -Click on the Linux Kernel version link of your choice and find the section for your architecture (‘Build for XXX’). In that section, download the two files with these patterns (where X.Y.Z is the highest version): +基于你的选择,点击相应的Linux核心版本链接,找到你对应的架构(‘Build for XXX’)的那部分。然后下载符合以下格式的两个文件(其中 X.Y.Z 是最高版本号): 1. linux-image-*X.Y.Z*-generic-*.deb 2. linux-modules-X.Y.Z*-generic-*.deb - - -In a terminal, change directory to where the files are and run this command to manually install the kernel: +在终端中修改文件所在的目录,然后执行命令,手动安装核心: ``` $ sudo dpkg --install *.deb ``` -Reboot to use the new kernel: +重启系统,使用新核心: ``` $ sudo reboot ``` -Check the kernel is as expected: +检查是否如你所愿: ``` $ uname -r ``` -For step by step instructions, please check the section titled under “Install Linux Kernel 4.15 LTS On DEB based systems” in the following guide. +对于分步的说明,请查看以下名为“Install Linux Kernel 4.15 LTS On DEB based systems”的文章。 + [Install Linux Kernel 4.15 In RPM And DEB Based Systems](https://www.ostechnix.com/install-linux-kernel-4-15-rpm-deb-based-systems/) -The above guide is specifically written for 4.15 version. However, all the steps are same for installing latest versions too. +以上的指南是针对的是4.15版本,不过安装最新版本的所有的步骤都是一样的。 -**Pros:** No internet needed (You can download the Linux Kernel from any system). +**优势:** 不必联网(你可以从任何系统中下载Linux核心来使用) -**Cons:** Manual update. Reboot necessary. +**缺点:** 手动更新,需要重启系统。 -#### Method 2 – Update the Linux Kernel with apt-get (The recommended method) +#### 方法2 - 用apt-get来升级Linux核心(推荐方法) -This is the recommended way to install latest Linux kernel on Ubuntu-like systems. Unlike the previous method, this method will download and install latest Kernel version from Ubuntu official repositories instead of **kernel.ubuntu.com** website.. +这是在类Ubuntu系统中升级Linux核心的推荐方法。不同于上一个方法,这种方法会从Ubuntu官方仓库下载、安装核心版本而不是从 **kernel.ubuntu.com**网站。 -To update the whole system including the Kernel, just do: +要升级包括核心的整个系统,只需要执行: ``` $ sudo apt-get update @@ -71,87 +70,84 @@ $ sudo apt-get update $ sudo apt-get upgrade ``` -If you want to update the Kernel only, run: +如果只希望升级核心,运行: ``` $ sudo apt-get upgrade linux-image-generic ``` -**Pros:** Simple. Recommended method. +**优势:** 简单。推荐方法。 -**Cons:** Internet necessary. Reboot necessary. +**缺点:** 需要联网,需要重启。 -Updating Kernel from official repositories will mostly work out of the box without any problems. If it is the production system, this is the recommended way to update the Kernel. +从官方库中升级核心是最接近开箱即用的方法,并且不会出什么问题。如果是生产环境的系统,这是最为推荐的升级Linux核心的方法。 -Method 1 and 2 requires user intervention to update Linux Kernels. The following methods (3, 4 & 5) are mostly automated. +方法1和方法2都需要用户去介入到升级Linux核心的过程中。而下边的方法(3、 4、 5)则几乎是全自动的。 -#### Method 3 – Update the Linux Kernel with Ukuu +#### 方法3 - 使用Ukuu升级Linux核心 -**Ukuu** is a Gtk GUI and command line tool that downloads the latest main line Linux kernel from **kernel.ubuntu.com** , and install it automatically in your Ubuntu desktop and server editions. Ukku is not only simplifies the process of manually downloading and installing new Kernels, but also helps you to safely remove the old and unnecessary Kernels. For more details, refer the following guide. +**Ukuu**是一个用于从**kernel.ubuntu.com**下载Linux核心,并且将其自动安装到Ubuntu桌面系统和服务器系统中的Gtk图形化界面和命令行工具。Ukku并不是单单简化了手动下载、安装新核心的过程,同时也会帮助你移除旧的和不再需要的核心。更多细节可以参照以下指南。 + [Ukuu – An Easy Way To Install And Upgrade Linux Kernel In Ubuntu-based Systems](https://www.ostechnix.com/ukuu-an-easy-way-to-install-and-upgrade-linux-kernel-in-ubuntu-based-systems/) -**Pros:** Easy to install and use. Automatically installs main line Kernel. +**优势:** 易于安装使用。自动安装主线核心。 -**Cons:** Internet necessary. Reboot necessary. +**缺点:** 需要联网,需要重启。 -#### Method 4 – Update the Linux Kernel with UKTools +#### 方法4 - 使用UKTools升级Linux核心 -Just like Ukuu, the **UKTools** also fetches the latest stable Kernel from from **kernel.ubuntu.com** site and installs it automatically on Ubuntu and its derivatives like Linux Mint. More details about UKTools can be found in the link given below. +跟Ukuu差不多,**UKTools**也会从**kernel.ubuntu.com**网站获取最新的核心并且自动安装到Ubuntu以及类似于Linux Mint的延伸发行版中。 + [UKTools – Upgrade Latest Linux Kernel In Ubuntu And Derivatives](https://www.ostechnix.com/uktools-upgrade-latest-linux-kernel-in-ubuntu-and-derivatives/) -**Pros:** Simple. Automated. +**优势:** 简单,自动 -**Cons:** Internet necessary. Reboot necessary. +**缺点:** 需要联网,需要重启。 -#### Method 5 – Update the Linux Kernel with Linux Kernel Utilities +#### 方法5 - 使用Linux核心工具集(Linux Kernel Utilities)安装Linux核心 -**Linux Kernel Utilities** is yet another program that makes the process of updating Linux kernel easy in Ubuntu-like systems. It is actually a set of BASH shell scripts used to compile and/or update latest Linux kernels for Debian and derivatives. It consists of three utilities, one for manually compiling and installing Kernel from source from [**http://www.kernel.org**][4] website, another for downloading and installing pre-compiled Kernels from from **** website. and third script is for removing the old kernels. For more details, please have a look at the following link. +**Linux Kernel Utilities**是目前另一个用于升级类Ubuntu系统Linux核心的程序。实质上,它是一个由一系列Bash脚本构成的合集,用于编译并且可以选择性地为Debian(译者注:Ubuntu的上游发行版)及其衍生发行版升级核心。它包含三个工具集,一个用于手动编译、安装来自于 [**http://www.kernel.org**][4] 网站的源码核心,另一个用于安装来自****网站的事先编译好的核心,第三个脚本用于移除旧核心。更多细节请浏览以下链接。 + [Linux Kernel Utilities – Scripts To Compile And Update Latest Linux Kernel For Debian And Derivatives](https://www.ostechnix.com/linux-kernel-utilities-scripts-compile-update-latest-linux-kernel-debian-derivatives/) -**Pros:** Simple. Automated. +**优势:** 简单,自动 -**Cons:** Internet necessary. Reboot necessary. +**缺点:** 需要联网,需要重启。 +### 第二部分 – Kernel Updates without reboot -### Part B – Kernel Updates without reboot +我之前说过,上边所有的方法都需要你去重启服务器(译者注:也可以是桌面版)来启用新核心。如果是个人系统或者测试系统,可以这么办。但对于无法停机的生产环境系统该怎么办呢?一点问题没有,这时候**实时补丁(livepatching)**就派上用场了。 -As I already said, all of above methods need you to reboot the server before the new kernel is active. If they are personal systems or testing machines, you could simply reboot and start using the new Kernel. But, what if they are production systems that requires zero downtime? No problem. This is where **Livepatching** comes in handy! +**实时补丁**(或者叫热补丁)允许你在不需要重启的情况下安装Linux升级或补丁来保证你的服务器处于最新的安全等级之下。这对web主机、游戏服务器这类需要不间断在线的服务器来说是很有价值的。事实上,任何情况下,服务器都应该保持在不间断运行的状态下。由于Linux供应商只会在出于修复安全漏洞的目的下维护补丁,所以如果安全性是你的点,这种方式再适合不过了。 -The **livepatching** (or hot patching) allows you to install Linux updates or patches without rebooting, keeping your server at the latest security level, without any downtime. This is attractive for ‘always-on’ servers, such as web hosts, gaming servers, in fact, any situation where the server needs to stay on all the time. Linux vendors maintain patches only for security fixes, so this approach is best when security is your main concern. +以下两种方法可以在不需要重启的情况下为生产环境和执行关键任务的Ubuntu服务器更新Linux核心。 -The following two methods doesn’t require system reboot and useful for updating Linux Kernel on production and mission-critical Ubuntu servers. - -#### Method 6 – Update the Linux Kernel Canonical Livepatch Service +#### 方法6 – 使用Canonical实时补丁服务(Canonical Livepatch Service)来更新Linux核心 ![][5] -[**Canonical Livepatch Service**][6] applies Kernel updates, patches and security hotfixes automatically without rebooting the Ubuntu systems. It reduces the Ubuntu systems downtime and keep them secure. Canonical Livepatch Service can be set up either during or after installation. If you are using desktop Ubuntu, the Software Updater will automatically check for kernel patches and notify you. In a console-based system, it is up to you to run apt-get update regularly. It will install kernel security patches only when you run the command “apt-get upgrade”, hence is semi-automatic. +[**Canonical Livepatch Service**][6] 可以在不需要重启Ubuntu系统的情况下执行核心升级、补丁和安全的热修复等操作,在减少服务器宕机的情况下保障其安全。Canonical Livepatch Service 可以在安装过程当中或安装之后尽心设置. 如果你使用的是Ubuntu桌面版,软件更新器会自动检查核心补丁的更新,并且通知你。在基于控制台的系统中,则需要你主动运行apt-get update命令来进行升级。由于需要你手动运行“apt-get upgrade”命令它才会安装核心的安全补丁,所以算是半自动的。 -Livepatch is free for three systems. If you have more than three, you need to upgrade to enterprise support solution named **Ubuntu Advantage** suite. This suite includes **Kernel Livepatching** and other services such as, +Livepatch对三个及以下系统免费,如果多于三个,你需要升级成名为**Ubuntu Advantage**的企业支持方案套件。这个套件包括**Kernel Livepatching**及以下服务: - * Extended Security Maintenance – critical security updates after Ubuntu end-of-life. - * Landscape – the systems management tool for using Ubuntu at scale. - * Knowledge Base – A private collection of articles and tutorials written by Ubuntu experts. - * Phone and web-based support. + * Extended Security Maintenance – Ubuntu生命周期后的重要安全更新 + * Landscape – 针对大规模使用Ubuntu的系统管理工具 + * Knowledge Base – 由Ubuntu专家撰写的私人文章和教程 + * 电话和网站支持 +**价格** +Ubuntu Advantage包含三种付费计划, 必备(Essential), 标准(Standard)和 高级(Advanced).最基础的计划(Essential 计划)从 **单物理节点 225 美元/年**和**单VPS 75美元/年**开始计价。看上去应该不支持针对Ubuntu服务器版和桌面版的按月订阅。你可以在 [**此处**][7]浏览所有计划的细节信息。 -**Cost** +**优势:** 简单。半自动化。无需重启。支持三个免费系统。 -Ubuntu Advantage includes three paid plans namely, Essential, Standard and Advanced. The basic plan (Essential plan) starts from **225 USD per year for one physical node** and **75 USD per year for one VPS**. It seems there is no monthly subscription for Ubuntu servers and desktops. You can view detailed information on all plans [**here**][7]. +**缺点:** 4个以上主机的话非常昂贵. 没有补丁回滚。 -**Pros:** Simple. Semi-automatic. No reboot necessary. Free for 3 systems. +**开启 Canonical Livepatch Service** -**Cons:** Expensive for 4 or more hosts. No patch rollback. +如果你想在安装后设置实时补丁服务,依照以下方法逐步执行: -**Enable Canonical Livepatch Service** - -If you want to setup Livepatch service after installation, just do the following steps. - -Get a key at [**https://auth.livepatch.canonical.com/**][8]. +从 [**https://auth.livepatch.canonical.com/**][8] 获取一个秘钥. ``` $ sudo snap install canonical-livepatch @@ -159,29 +155,29 @@ $ sudo snap install canonical-livepatch $ sudo canonical-livepatch enable your-key ``` -#### Method 7 – Update the Linux Kernel with KernelCare +#### 方法7- 使用KernelCare升级Linux内核 ![][9] -[**KernelCare**][10] is the newest of all the live patching solutions. It is the product of [CloudLinux][11]. KernelCare runs on Ubuntu and other flavors of Linux. It checks for patch releases every 4 hours and will install them without confirmation. Patches can be rolled back if there are problems. +[**KernelCare**][10] 是所有实时补丁方案中最新的一个. 它是 [CloudLinux][11]推出的产品. KernelCare 可以运行在Ubuntu和其他的Linux特殊发行版中. 它每四个小时检查一遍补丁的发布,并在无需确认的情况下安装它们. 如果更新后存在问题,可以将补丁进行回滚。 -**Cost** +**价格** -Fees, per server: **4 USD per month** , **45 USD per year**. +费用,每台服务器:**4 美元/月** , **45 美元/年**. -Compared to Ubuntu Livepatch, kernelCare seems very cheap and affordable. Good thing is **monthly subscriptions are also available**. Another notable feature is it supports other Linux distributions, such as Red Hat, CentOS, Debian, Oracle Linux, Amazon Linux and virtualization platforms like OpenVZ, Proxmox etc. +跟Ubuntu Livepatch相比,kernelCare看起来非常便宜、实惠。好的方面在于**也可以按月订阅**。另一个前者不具备的功能是支持如Red Hat, CentOS, Debian, Oracle Linux, Amazon Linux 以及 OpenVZ, Proxmox 这种虚拟平台等等的其他Linux发行版。 -You can read all the features and benefits of KernelCare [**here**][12] and check all available plan details [**here**][13]. +你可以在 [**此处**][12] 了解KernelCare的所有特性和简介,以及所有的付费计划的细节。 -**Pros:** Simple. Fully automated. Wide OS coverage. Patch rollback. No reboot necessary. Free license for non-profit organizations. Low cost. +**优势:** 简单。全自动化。范围更广的操作系统覆盖。补丁回滚。无需重启。对非盈利组织提供免费许可。价格低廉。 -**Cons:** Not free (except for 30 day trial). +**缺点:** 除了30天试用外无免费计划。 -**Enable KernelCare Service** +**开启 KernelCare Service** -Get a 30-day trial key at [**https://cloudlinux.com/kernelcare-free-trial5**][14]. +此处 [**https://cloudlinux.com/kernelcare-free-trial5**][14] 获取30天免费试用秘钥。 -Run the following commands to enable KernelCare and register the key. +执行以下命令开启KernelCare并注册秘钥。 ``` $ sudo wget -qq -O - https://repo.cloudlinux.com/kernelcare/kernelcare_install.sh | bash @@ -189,15 +185,16 @@ $ sudo wget -qq -O - https://repo.cloudlinux.com/kernelcare/kernelcare_install.s $ sudo /usr/bin/kcarectl --register KEY ``` -If you’re looking for an affordable and reliable commercial service to keep the Linux Kernel updated on your Linux servers, KernelCare is good to go. +如果你的目标是价格实惠,并且通过可靠的社区服务来保障你的Linux服务器核心的更新,那KernelCare是个不错的选择。 -*with inputs from **Paul A. Jacobs** , a Technical Evangelist and Content Writer from Cloud Linux.* -**Suggested read:** +*由来自Cloud Linux的技术撰稿人和内容作者**Paul A. Jacobs**撰写。* -And, that’s all for now. Hope this was useful. If you believe any other tools/methods should include in this list, feel free to let us know in the comment section below. I will check and update this guide accordingly. +**推荐阅读:** -More good stuffs to come. Stay tuned! +到此,希望这边文章能对你有所帮助。如果你觉得还有其他的工具和方法需要列在这里,可以在留言区给我们留言。我会根据反馈检查和更新这篇指南的。 + +接下来会有更多好东西给大家呈现,敬请期待。 Cheers! @@ -209,7 +206,7 @@ via: https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/ 作者:[SK][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[mr-ping](https://github.com/mr-ping) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6beae407f522c37b864c1d461c8f8610991634fb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Apr 2020 15:32:44 +0800 Subject: [PATCH 0259/1809] PRF @wxy --- .../20200312 Make SSL certs easy with k3s.md | 74 +++++++++---------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/translated/tech/20200312 Make SSL certs easy with k3s.md b/translated/tech/20200312 Make SSL certs easy with k3s.md index 241f8891f5..230476352e 100644 --- a/translated/tech/20200312 Make SSL certs easy with k3s.md +++ b/translated/tech/20200312 Make SSL certs easy with k3s.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Make SSL certs easy with k3s) @@ -12,31 +12,31 @@ > 如何在树莓派上使用 k3s 和 Let's Encrypt 来加密你的网站。 -![Files in a folder][1] +![](https://img.linux.net.cn/data/attachment/album/202004/13/153032ncp8q55pjwdj8ppj.jpg) -在[上一篇文章][2]中,我们在 k3s 集群上部署了几个简单的网站。那些是未加密的网站。很好,它们可以工作,但是未加密的网站有点太过时了!如今,大多数网站都是加密的。在本文中,我们将安装 [cert-manager][3] 并将其用于在集群上以部署采用 TLS 加密的网站。这些网站不仅会被加密,而且还会使用有效的公共证书,这些证书会从 [Let's Encrypt][4] 自动获取和更新!让我们开始吧! +在[上一篇文章][2]中,我们在 k3s 集群上部署了几个简单的网站。那些是未加密的网站。不错,它们可以工作,但是未加密的网站有点太过时了!如今,大多数网站都是加密的。在本文中,我们将安装 [cert-manager][3] 并将其用于在集群上以部署采用 TLS 加密的网站。这些网站不仅会被加密,而且还会使用有效的公共证书,这些证书会从 [Let's Encrypt][4] 自动获取和更新!让我们开始吧! -### 所需材料 +### 准备 -要继续阅读本文,你将需要我们在上一篇文章中构建的 [k3s 树莓派集群][5]。另外,你需要拥有一个公用静态 IP 地址,并有一个可以为其创建 DNS 记录的域名。如果你有一个动态 DNS 提供程序为你提供域名,可能也行。但是,在本文中,我们将使用静态 IP 和 [CloudFlare][6] 来手动创建 DNS 的 A 记录。 +要继续阅读本文,你将需要我们在上一篇文章中构建的 [k3s 树莓派集群][5]。另外,你需要拥有一个公用静态 IP 地址,并有一个可以为其创建 DNS 记录的域名。如果你有一个动态 DNS 提供程序为你提供域名,可能也行。但是,在本文中,我们使用静态 IP 和 [CloudFlare][6] 来手动创建 DNS 的 A 记录。 我们在本文中创建配置文件时,如果你不想键入它们,则可以在[此处][7]进行下载。 ### 我们为什么使用 cert-manager? -Traefik(预先捆绑了 k3s)实际上具有内置的 Let's Encrypt 支持,因此你可能想知道为什么我们要安装第三方软件包来做同样的事情。在撰写本文时,Traefik 中的 Let's Encrypt 支持检索证书并将其存储在文件中。cert-manager 会检索证书并将其存储在 Kubernetes 的 “机密信息secrets” 中。我认为,“机密信息”可以简单地按名称引用,因此更易于使用。这就是我们在本文中使用 cert-manager 的主要原因。 +Traefik(在 k3s 预先捆绑了)实际上具有内置的 Let's Encrypt 支持,因此你可能想知道为什么我们要安装第三方软件包来做同样的事情。在撰写本文时,Traefik 中的 Let's Encrypt 支持检索证书并将其存储在文件中。而 cert-manager 会检索证书并将其存储在 Kubernetes 的 “机密信息secret” 中。我认为,“机密信息”可以简单地按名称引用,因此更易于使用。这就是我们在本文中使用 cert-manager 的主要原因。 ### 安装 cert-manager 通常,我们只是遵循 cert-manager 的[文档][8]在 Kubernetes 上进行安装。但是,由于我们使用的是 ARM 体系结构,因此我们需要进行一些更改,以便我们可以完成这个操作。 -第一步是创建 cert-manager 命名空间。命名空间有助于将 cert-manager 的吊舱Pod排除在我们的默认命名空间之外,因此当我们使用自己的“吊舱”执行 `kubectl get pods` 之类的操作时,我们不必看到它们。创建名称空间很简单: +第一步是创建 cert-manager 命名空间。命名空间有助于将 cert-manager 的 Pod 排除在我们的默认命名空间之外,因此当我们使用自己的 Pod 执行 `kubectl get pods` 之类的操作时,我们不必看到它们。创建名称空间很简单: ``` kubectl create namespace cert-manager ``` -这份安装说明会告诉你下载 cert-manager 的 YAML 配置文件并将其一步全部应用到你的集群。我们需要将其分为两个步骤,以便为基于 ARM 的树莓派修改文件。我们将下载文件并一步一步进行转换: +安装说明会让你下载 cert-manager 的 YAML 配置文件并将其一步全部应用到你的集群。我们需要将其分为两个步骤,以便为基于 ARM 的树莓派修改文件。我们将下载文件并一步一步进行转换: ``` curl -sL \ @@ -44,8 +44,7 @@ https://github.com/jetstack/cert-manager/releases/download/v0.11.0/cert-manager. sed -r 's/(image:.*):(v.*)$/\1-arm:\2/g' > cert-manager-arm.yaml ``` -这会下载配置文件,并将所有包含的 docker 镜像更新为 ARM 版本。来检查一下它做了什么: - +这会下载配置文件,并将包含的所有 docker 镜像更新为 ARM 版本。来检查一下它做了什么: ``` $ grep image: cert-manager-arm.yaml @@ -54,23 +53,23 @@ $ grep image: cert-manager-arm.yaml           image: "quay.io/jetstack/cert-manager-webhook-arm:v0.11.0" ``` -如我们所见,三个镜像现在在镜像名称上添加了 `-arm`。现在我们有了正确的文件,我们只需将其应用于集群: +如我们所见,三个镜像现在在镜像名称上添加了 `-arm`。现在我们有了正确的文件,我们只需将其应用于集群: ``` kubectl apply -f cert-manager-arm.yaml ``` -这将安装所有的 cert-manager。我们可以通过 `kubectl --namespace cert-manager get pods` 来检查安装何时完成,直到所有“吊舱”都处于 `Running` 状态。 +这将安装 cert-manager 的全部。我们可以通过 `kubectl --namespace cert-manager get pods` 来检查安装何时完成,直到所有 Pod 都处于 `Running` 状态。 -这实际上就完成了 cert-manager 的安装! +这就完成了 cert-manager 的安装! ### Let's Encrypt 概述 -Let's Encrypt 的好处是,它们免费为我们提供了经过公共验证的 TLS 证书!这意味着我们可以拥有一个完全有效的、可供任何人访问的 TLS 加密网站,这些家庭或业余的爱好活动挣不到钱,也无需自己掏腰包购买 TLS 证书!以及,当通过 cert-manager 使用 Let's Encrypt 的证书时,获得证书的整个过程是自动化的,证书的续订也是自动的! +Let's Encrypt 的好处是,它免费为我们提供了经过公共验证的 TLS 证书!这意味着我们可以拥有一个完全有效的、可供任何人访问的 TLS 加密网站,这些家庭或业余的爱好活动挣不到钱,也无需自己掏腰包购买 TLS 证书!以及,当通过 cert-manager 使用 Let's Encrypt 的证书时,获得证书的整个过程是自动化的,证书的续订也是自动的! -但它是如何工作的?下面是该过程的简化说明。我们(或代表我们的 cert-manager)向 Let's Encrypt 发出我们拥有的域名的证书请求。Let's Encrypt 通过使用 ACME DNS 或 HTTP 验证机制来验证我们是否拥有该域。如果验证成功,则 Let's Encrypt 将向我们提供证书,这些证书将由 cert-manager 安装在我们的网站(或其他 TLS 加密的终结点)中。在需要重复此过程之前,这些证书可以使用 90 天。但是,cert-manager 会自动为我们更新证书。 +但它是如何工作的?下面是该过程的简化说明。我们(或代表我们的 cert-manager)向 Let's Encrypt 发出我们拥有的域名的证书请求。Let's Encrypt 通过使用 ACME DNS 或 HTTP 验证机制来验证我们是否拥有该域。如果验证成功,则 Let's Encrypt 将向我们提供证书,这些证书将由 cert-manager 安装在我们的网站(或其他 TLS 加密的端点)中。在需要重复此过程之前,这些证书可以使用 90 天。但是,cert-manager 会自动为我们更新证书。 -在本文中,我们将使用 HTTP 验证方法,因为它更易于设置并且适用于大多数情况。以下是幕后将发生的基本过程。cert-manager 将向 Let's Encrypt 发出证书请求。作为回应,Let's Encrypt 将发出所有权验证的质询challenges。这个质询是将一个 HTTP 资源放在请求证书的域名下的一个特定 URL 上。从理论上讲,如果我们可以将该资源放在该 URL 上,并且让 Let's Encrypt 可以远程获取它,那么我们实际上必须是该域的所有者。否则,要么我们无法将资源放置在正确的位置,要么我们无法操纵 DNS 以使 Let's Encrypt 访问它。在这种情况下,cert-manager 会将资源放在正确的位置,并自动创建一个临时的 `Ingress` 记录,以将流量路由到正确的位置。如果 Let's Encrypt 可以读到该质询要求的资源并正确无误,它将把证书发回给 cert-manager。然后,cert-manager 将证书存储为“机密信息”,然后我们的网站(或其他任何网站)将使用这些证书通过 TLS 保护我们的流量。 +在本文中,我们将使用 HTTP 验证方法,因为它更易于设置并且适用于大多数情况。以下是幕后发生的基本过程。cert-manager 向 Let's Encrypt 发出证书请求。作为回应,Let's Encrypt 发出所有权验证的质询challenges。这个质询是将一个 HTTP 资源放在请求证书的域名下的一个特定 URL 上。从理论上讲,如果我们可以将该资源放在该 URL 上,并且让 Let's Encrypt 可以远程获取它,那么我们实际上必须是该域的所有者。否则,要么我们无法将资源放置在正确的位置,要么我们无法操纵 DNS 以使 Let's Encrypt 访问它。在这种情况下,cert-manager 会将资源放在正确的位置,并自动创建一个临时的 `Ingress` 记录,以将流量路由到正确的位置。如果 Let's Encrypt 可以读到该质询要求的资源并正确无误,它将把证书发回给 cert-manager。cert-manager 将证书存储为“机密信息”,然后我们的网站(或其他任何网站)将使用这些证书通过 TLS 保护我们的流量。 ### 为该质询设置网络 @@ -78,11 +77,11 @@ Let's Encrypt 的好处是,它们免费为我们提供了经过公共验证的 为了使质询过程正常运行,我们需要一个我们要申请证书的域名,以将其路由到端口 80 上的 k3s 集群。为此,我们需要告诉世界上的 DNS 系统它的位置。因此,我们需要将域名映射到我们的公共 IP 地址。如果你不知道你的公共 IP 地址是什么,可以访问 [WhatsMyIP][9] 之类的地方,它会告诉你。接下来,我们需要输入 DNS 的 A 记录,该记录将我们的域名映射到我们的公共 IP 地址。为了使此功能可靠地工作,你需要一个静态的公共 IP 地址,或者你可以使用动态 DNS 提供商。一些动态 DNS 提供商会向你颁发一个域名,你可以按照以下说明使用它。我没有尝试过,所以不能肯定地说它适用于所有提供商。 -对于本文,我们将假设有一个静态公共 IP 并使用 CloudFlare 来设置 DNS 的 A 记录。如果愿意,可以使用自己的 DNS 提供程序。重要的是你可以设置 A 记录。 +对于本文,我们假设有一个静态公共 IP,并使用 CloudFlare 来设置 DNS 的 A 记录。如果愿意,可以使用自己的 DNS 服务器。重要的是你可以设置 A 记录。 -在本文的其余部分中,我将使用 [k3s.carpie.net][10] 作为示例域,因为这是我拥有的域。你显然会用自己拥有的任何域替换它。 +在本文的其余部分中,我将使用 [k3s.carpie.net][10] 作为示例域名,因为这是我拥有的域。你显然会用自己拥有的任何域名替换它。 -为示例起见,假设我们的公共 IP 地址是 198.51.100.42。我们将转到我们的 DNS 提供商的 DNS 记录部分,并添加一个名为 [k3s.carpie.net][10] 的类型为 `A` 的记录(CloudFlare 已经假定了域的部分,因此我们只需输入 `k3s`),然后输入 `198.51.100.42` 作为 IPv4 地址。 +为示例起见,假设我们的公共 IP 地址是 198.51.100.42。我们转到我们的 DNS 提供商的 DNS 记录部分,并添加一个名为 [k3s.carpie.net][10] 的类型为 `A` 的记录(CloudFlare 已经假定了域的部分,因此我们只需输入 `k3s`),然后输入 `198.51.100.42` 作为 IPv4 地址。 ![][11] @@ -95,17 +94,17 @@ $ dig +short k3s.carpie.net 198.51.100.42 ``` -继续运行以上命令,直到可以返回 IP 才行。关于 CloudFlare 有个小注释:ClouldFlare 提供了通过代理流量来隐藏你的实际 IP 的服务。在这种情况下,我们取回的是 CloudFlare 的 IP,而不是我们的 IP。 但对于我们的目的,这应该可以正常工作。 +继续运行以上命令,直到可以返回 IP 才行。关于 CloudFlare 有个小注释:ClouldFlare 提供了通过代理流量来隐藏你的实际 IP 的服务。在这种情况下,我们取回的是 CloudFlare 的 IP,而不是我们的 IP。但对于我们的目的,这应该可以正常工作。 网络配置的最后一步是配置路由器,以将端口 80 和 443 上的传入流量路由到我们的 k3s 集群。可悲的是,路由器配置页面的差异很大,因此我无法确切地说明你的外观是什么样子。大多数时候,我们需要的管理页面位于“端口转发”或类似内容下。我甚至看到过它列在“游戏”之下(显然是端口转发主要用于的游戏)!让我们看看我的路由器的配置如何。 ![][12] -如果你和我的设置一样,则转到 192.168.0.1 登录到路由器管理应用程序。对于此路由器,它位于 “ NAT / QoS” -> “端口转发”。在这里,我们将端口 80/TCP 协议设置为转发到 192.168.0.50(主节点 `kmaster` 的 IP)的端口 80。我们还将端口 443 设置为也映射到 `kmaster`。从技术上讲,这对于质询来说并不是必需的,但是在本文的结尾,我们将部署一个启用 TLS 的网站,并且需要映射 443 来进行访问。因此,现在进行映射很方便。我们保存并应用更改,应该一切顺利! +如果你和我的环境一样,则转到 192.168.0.1 登录到路由器管理应用程序。对于此路由器,它位于 “ NAT/QoS” -> “端口转发”。在这里,我们将端口 80/TCP 协议设置为转发到 192.168.0.50(主节点 `kmaster` 的 IP)的端口 80。我们还设置端口 443 也映射到 `kmaster`。从技术上讲,这对于质询来说并不是必需的,但是在本文的结尾,我们将部署一个启用 TLS 的网站,并且需要映射 443 来进行访问。因此,现在进行映射很方便。我们保存并应用更改,应该一切顺利! ### 配置 cert-manager 来使用 Let's Encrypt(暂存环境) -现在,我们需要配置 cert-manager 来通过 Let's Encrypt 颁发证书。Let's Encrypt 为我们提供了一个暂存(例如用于测试)环境,以便审视我们的配置。这样它更能容忍错误和请求的频率。如果我们对生产环境做了错误的操作,我们很快就好发现自己被暂时禁止访问了!因此,我们将使用暂存环境手动测试请求。 +现在,我们需要配置 cert-manager 来通过 Let's Encrypt 颁发证书。Let's Encrypt 为我们提供了一个暂存(例如用于测试)环境,以便审视我们的配置。这样它更能容忍错误和请求的频率。如果我们对生产环境做了错误的操作,我们很快就会发现自己被暂时禁止访问了!因此,我们将使用暂存环境手动测试请求。 创建一个文件 `letsencrypt-issuer-staging.yaml`,内容如下: @@ -132,7 +131,7 @@ spec: 请确保将电子邮件地址更新为你的地址。如果出现问题或我们弄坏了一些东西,这就是 Let's Encrypt 与我们联系的方式! -现在,我们使用以下方法创建发行者: +现在,我们使用以下方法创建发行者issuer: ``` kubectl apply -f letsencrypt-issuer-staging.yaml @@ -150,7 +149,6 @@ kubectl get clusterissuers 创建一个包含以下内容的证书请求文件 `le-test-certificate.yaml`: - ``` apiVersion: cert-manager.io/v1alpha2 kind: Certificate @@ -167,7 +165,7 @@ spec: - k3s.carpie.net ``` -该记录仅表示我们要使用名为 `letsencrypt-staging`(我们在上一步中创建的)的 `ClusterIssuer` 来请求域 [k3s.carpie.net][10] 的证书,并在 Kubernetes 的机密信息中名为 `k3s-carpie-net-tls` 文件中存储该证书。 +该记录仅表示我们要使用名为 `letsencrypt-staging`(我们在上一步中创建的)的 `ClusterIssuer` 来请求域 [k3s.carpie.net][10] 的证书,并在 Kubernetes 的机密信息中名为 `k3s-carpie-net-tls` 的文件中存储该证书。 像平常一样应用它: @@ -188,11 +186,11 @@ NAME                    READY   SECRET                  AGE k3s-carpie-net          True    k3s-carpie-net-tls      30s ``` -我们走在幸福之路!(这里的关键是`READY` 是 `True`)。 +我们走在幸福之路!(这里的关键是 `READY` 应该是 `True`)。 ### 解决证书颁发问题 -上面是幸福的道路。如果 `READY` 为 `False`,我们可以等等它,然后再次花点时间检查状态。如果它一直是 `False`,那么我们就有一个需要解决的问题。此时,我们可以遍历 Kubernetes 资源链,直到找到一条告诉我们问题的状态消息。 +上面是幸福的道路。如果 `READY` 为 `False`,我们可以等等它,然后再次花点时间检查状态。如果它一直是 `False`,那么我们就有需要解决的问题。此时,我们可以遍历 Kubernetes 资源链,直到找到一条告诉我们问题的状态消息。 假设我们执行了上面的请求,而 `READY` 为 `False`。我们可以从以下方面开始故障排除: @@ -200,7 +198,7 @@ k3s-carpie-net          True    k3s-carpie-net-tls      30s kubectl describe certificates k3s-carpie-net ``` -这将返回很多信息。通常,有用的内容位于 `Events:` 部分,该部分通常位于底部。假设最后一个事件是 `Created new CertificateRequest resource "k3s-carpie-net-1256631848`。然后我们描述 describe一些该请求: +这将返回很多信息。通常,有用的内容位于 `Events:` 部分,该部分通常位于底部。假设最后一个事件是 `Created new CertificateRequest resource "k3s-carpie-net-1256631848`。然后我们描述describe一下该请求: ``` kubectl describe certificaterequest k3s-carpie-net-1256631848 @@ -211,7 +209,7 @@ kubectl describe certificaterequest k3s-carpie-net-1256631848 那么,我们可以描述该顺序: ``` -`kubectl describe orders default/k3s-carpie-net-1256631848-2342473830` +kubectl describe orders default/k3s-carpie-net-1256631848-2342473830 ``` 假设有一个事件,事件为 `Created Challenge resource "k3s-carpie-net-1256631848-2342473830-1892150396" for domain "k3s.carpie.net"`。让我们描述一下该质询: @@ -220,7 +218,7 @@ kubectl describe certificaterequest k3s-carpie-net-1256631848 kubectl describe challenges k3s-carpie-net-1256631848-2342473830-1892150396 ``` -从这里返回的最后一个事件是 `Presented challenge using http-01 challenge mechanism`。看起来没问题,因此我们浏览一下描述的输出,并看到一条消息 `Waiting for http-01 challenge propagation: failed to perform self check GET request … no such host`。终于!我们发现了问题!在这种情况下,`no such host` 意味着 DNS 查找失败,因此我们需要返回并手动检查我们的 DNS 设置,正确解析域的 DNS,并进行所需的任何更改。 +从这里返回的最后一个事件是 `Presented challenge using http-01 challenge mechanism`。看起来没问题,因此我们浏览一下描述的输出,并看到一条消息 `Waiting for http-01 challenge propagation: failed to perform self check GET request ... no such host`。终于!我们发现了问题!在这种情况下,`no such host` 意味着 DNS 查找失败,因此我们需要返回并手动检查我们的 DNS 设置,正确解析域的 DNS,并进行所需的任何更改。 ### 清理我们的测试证书 @@ -231,9 +229,9 @@ kubectl delete certificates k3s-carpie-net kubectl delete secrets k3s-carpie-net-tls ``` -### 配置 cert-manager 以使用 Let's Encrypt(生产环境) +### 配置 cert-manager 以使用 Let's Encrypt(生产环境) -现在我们已经有了测试证书,是时候移动到生产环境了。就像我们在 Let's Encrypt 暂存环境中配置 cert-manager 一样,我们现在也需要对生产环境进行同样的操作。创建一个名为 `letsencrypt-issuer-production.yaml` 的文件(如果需要,可以复制和修改暂存环境的文件),其内容如下: +现在我们已经有了测试证书,是时候移动到生产环境了。就像我们在 Let's Encrypt 暂存环境中配置 cert-manager 一样,我们现在也需要对生产环境进行同样的操作。创建一个名为 `letsencrypt-issuer-production.yaml` 的文件(如果需要,可以复制和修改暂存环境的文件),其内容如下: ``` apiVersion: cert-manager.io/v1alpha2 @@ -266,7 +264,7 @@ kubectl apply -f letsencrypt-issuer-production.yaml ### 申请我们网站的证书 -重要的是要注意,我们到目前为止完成的所有步骤都是一次性设置的!对于将来的任何其他申请,我们可以从这个说明开始! +重要的是需要注意,我们到目前为止完成的所有步骤都只需要进行一次!而对于将来的任何其他申请,我们可以从这个说明开始! 让我们部署在[上一篇文章][13]中部署的同样站点。(如果仍然可用,则可以修改 YAML 文件。如果没有,则可能需要重新创建并重新部署它)。 @@ -296,7 +294,7 @@ spec: secretName: k3s-carpie-net-tls ``` -请注意,上面仅显示了 `mysite.yaml` 的 `Ingress` 部分。所做的更改是添加了注释 `cert-manager.io/cluster-issuer: letsencrypt-prod`。这告诉 traefik 创建证书时使用哪个发行者。 唯一的其他增加是 `tls:` 块。这告诉 traefik 我们希望在主机 [k3s.carpie.net][10] 上具有 TLS 功能,并且我们希望 TLS 证书文件存储在机密信息 `k3s-carpie-net-tls` 中。 +请注意,上面仅显示了 `mysite.yaml` 的 `Ingress` 部分。所做的更改是添加了注解 `cert-manager.io/cluster-issuer: letsencrypt-prod`。这告诉 traefik 创建证书时使用哪个发行者。 其他唯一增加的是 `tls:` 块。这告诉 traefik 我们希望在主机 [k3s.carpie.net][10] 上具有 TLS 功能,并且我们希望 TLS 证书文件存储在机密信息 `k3s-carpie-net-tls` 中。 请记住,我们没有创建这些证书!(好吧,我们创建了名称相似的测试证书,但我们删除了这些证书。)Traefik 将读取这些配置并继续寻找机密信息。当找不到时,它会看到注释说我们想使用 `letsencrypt-prod` 发行者来获取它。由此,它将提出请求并为我们安装证书到机密信息之中! @@ -311,17 +309,17 @@ via: https://opensource.com/article/20/3/ssl-letsencrypt-k3s 作者:[Lee Carpenter][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/carpie [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder) -[2]: https://carpie.net/articles/ingressing-with-k3s +[2]: https://linux.cn/article-12081-1.html [3]: https://cert-manager.io/ [4]: https://letsencrypt.org/ -[5]: https://opensource.com/article/20/3/kubernetes-raspberry-pi-k3s +[5]: https://linux.cn/article-12049-1.html [6]: https://cloudflare.com/ [7]: https://gitlab.com/carpie/k3s_using_certmanager/-/archive/master/k3s_using_certmanager-master.zip [8]: https://cert-manager.io/docs/installation/kubernetes/ @@ -329,5 +327,5 @@ via: https://opensource.com/article/20/3/ssl-letsencrypt-k3s [10]: http://k3s.carpie.net [11]: https://opensource.com/sites/default/files/uploads/ep011_dns_example.png [12]: https://opensource.com/sites/default/files/uploads/ep011_router.png -[13]: https://carpie.net/articles/ingressing-with-k3s#deploying-a-simple-website +[13]:https://linux.cn/article-12081-1.html [14]: http://cert-manager.io/cluster-issuer From 746c5223003983228d464f6024a142b6b82b03f7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Apr 2020 15:33:11 +0800 Subject: [PATCH 0260/1809] PUB @wxy https://linux.cn/article-12106-1.html --- .../20200312 Make SSL certs easy with k3s.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200312 Make SSL certs easy with k3s.md (99%) diff --git a/translated/tech/20200312 Make SSL certs easy with k3s.md b/published/20200312 Make SSL certs easy with k3s.md similarity index 99% rename from translated/tech/20200312 Make SSL certs easy with k3s.md rename to published/20200312 Make SSL certs easy with k3s.md index 230476352e..657d88123f 100644 --- a/translated/tech/20200312 Make SSL certs easy with k3s.md +++ b/published/20200312 Make SSL certs easy with k3s.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12106-1.html) [#]: subject: (Make SSL certs easy with k3s) [#]: via: (https://opensource.com/article/20/3/ssl-letsencrypt-k3s) [#]: author: (Lee Carpenter https://opensource.com/users/carpie) From ee52bbfabbe2620e6e68802ec699c58544ca8fc9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 Apr 2020 15:42:51 +0800 Subject: [PATCH 0261/1809] Rename sources/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md to translated/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md --- .../20190107 Different Ways To Update Linux Kernel For Ubuntu.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md (100%) diff --git a/sources/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md b/translated/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md similarity index 100% rename from sources/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md rename to translated/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md From 4835064a97994bd2ec46166b1f8bedaaf1cc4838 Mon Sep 17 00:00:00 2001 From: Ping Date: Mon, 13 Apr 2020 16:36:09 +0800 Subject: [PATCH 0262/1809] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91:?= =?UTF-8?q?=2020200410=20Get=20started=20with=20Bash=20programming.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20200410 Get started with Bash programming.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200410 Get started with Bash programming.md b/sources/tech/20200410 Get started with Bash programming.md index 875adb9876..cadcef4c71 100644 --- a/sources/tech/20200410 Get started with Bash programming.md +++ b/sources/tech/20200410 Get started with Bash programming.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mr-ping) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 458f5144f31e0f211d74c41131e0edf4afc90b18 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Apr 2020 20:23:47 +0800 Subject: [PATCH 0263/1809] PRF @geekpi --- ...ow to Use AUR on Arch and Manjaro Linux.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/translated/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md b/translated/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md index 5a44bc4fef..6a56e84993 100644 --- a/translated/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md +++ b/translated/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md @@ -1,13 +1,13 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What is Arch User Repository (AUR)? How to Use AUR on Arch and Manjaro Linux?) [#]: via: (https://itsfoss.com/aur-arch-linux/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) -什么是 Arch 用户仓库(AUR)?如何在 Arch 和 Manjaro Linux 上使用 AUR? +什么是 Arch 用户仓库(AUR)以及如何使用? ====== 如果你一直在使用 [Arch Linux][1] 或其他基于 Arch 的发行版,如 Manjaro,那么可能会遇到 AUR。你尝试安装新软件,有人建议从 AUR 中安装它。这让你感到困惑。 @@ -18,15 +18,15 @@ ![][2] -AUR 表示 Arch 用户仓库 (Arch User Repository)。它是针对基于 Arch 的 Linux 发行版用户的社区驱动的仓库。它包含名为 [PKGBUILDs][3] 的包描述,它可让你使用 [makepkg][4] 从源代码编译软件包,然后通过 [pacman][5](Arch Linux 中的软件包管理器)安装。 +AUR 表示Arch 用户仓库Arch User Repository。它是针对基于 Arch 的 Linux 发行版用户的社区驱动的仓库。它包含名为 [PKGBUILD][3] 的包描述,它可让你使用 [makepkg][4] 从源代码编译软件包,然后通过 [pacman][5](Arch Linux 中的软件包管理器)安装。 创建 AUR 的目的是组织和共享社区中的新软件包,并帮助加速将流行的软件包纳入[社区仓库][6]。 进入官方仓库的大量新软件包都从 AUR 开始。在 AUR 中,用户可以贡献自己的软件包构建(PKGBUILD 和相关文件)。 -AUR 社区可以对 AUR 中的软件包进行投票。如果一个软件包变得足够流行(假设它具有兼容的许可证和良好的打包技术),那么可以将其加入 pacman 直接访问的社区仓库中。 +AUR 社区可以对 AUR 中的软件包进行投票。如果一个软件包变得足够流行(假设它具有兼容的许可证和良好的打包技术),那么可以将其加入 `pacman` 直接访问的社区仓库中。 -简而言之,AUR 是开发人员在 Arch 仓库中正式包含新软件之前向 Arch Linux 用户提供新软件的一种方式。 +> 简而言之,AUR 是开发人员在 Arch 仓库中正式包含新软件之前向 Arch Linux 用户提供新软件的一种方式。 ### 你应该使用 AUR 吗?有什么风险? @@ -34,21 +34,21 @@ AUR 社区可以对 AUR 中的软件包进行投票。如果一个软件包变 如果你刚接触 Linux,建议你在建立有关 Arch/Manjaro 和 Linux 的基础知识之前不要使用 AUR。 -的确,任何人都可以将软件包上传到 AUR,但[受信任用户][7] (TU) 负责监视上传的内容。尽管 TU 对上传的软件包执行质量控制,但不能保证 AUR 中的软件包格式正确或没有恶意。 +的确,任何人都可以将软件包上传到 AUR,但[受信任用户][7](TU)负责监视上传的内容。尽管 TU 对上传的软件包执行质量控制,但不能保证 AUR 中的软件包格式正确或没有恶意。 -在实践中,AUR 似乎很安全,但理论上讲它可以造成一定程度的损害,但前提是你不小心。从 AUR 构建软件包时,聪明的 Arch 用户**总是**检查 PKGBUILD 和 *.install 文件。 +在实践中,AUR 似乎很安全,但理论上讲它可以造成一定程度的损害,但前提是你不小心。从 AUR 构建软件包时,聪明的 Arch 用户**总是**检查 `PKGBUILD` 和 `*.install` 文件。 -此外,TU(受信任用户)还删除了 AUR 中包含在 core/extra/community 中的软件包,因此它们之间不应存在命名冲突。AUR 通常会包含软件包的开发版本 (cvs/svn/git 等),但它们的名称会被修改,例如 foo-git。 +此外,TU(受信任用户)还会删除 AUR 中包含在 core/extra/community 中的软件包,因此它们之间不应存在命名冲突。AUR 通常会包含软件包的开发版本(cvs/svn/git 等),但它们的名称会被修改,例如 foo-git。 -对于 AUR软 件包,pacman 会处理依赖关系并检测文件冲突,因此,除非你默认使用 “–force” 选项,否则你不必担心用另一个包中的文件会覆盖另一个包的文件。如果这么做了,你可能会遇到比文件冲突更严重的问题。 +对于 AUR 软件包,`pacman` 会处理依赖关系并检测文件冲突,因此,除非你默认使用 `–force` 选项,否则你不必担心用另一个包中的文件会覆盖另一个包的文件。如果这么做了,你可能会遇到比文件冲突更严重的问题。 ### 如何使用 AUR? -使用 AUR 的最简单方法是通过 AUR helper。 [AUR helper][8] 是一个命令行工具(有些还有 GUI),可让你搜索在 AUR 上发布的软件包并安装。 +使用 AUR 的最简单方法是通过 AUR 助手。 [AUR 助手][8] 是一个命令行工具(有些还有 GUI),可让你搜索在 AUR 上发布的软件包并安装。 -##### 在 Arch Linux 上安装 AUR helper +#### 在 Arch Linux 上安装 AUR 助手 -假设你要使用 [Yay AUR helper][9]。确保在 Linux 上安装了 git。然后克隆仓库,进入目录并构建软件包。 +假设你要使用 [Yay AUR 助手][9]。确保在 Linux 上安装了 git。然后克隆仓库,进入目录并构建软件包。 依次使用以下命令: @@ -59,17 +59,17 @@ cd yay makepkg -si ``` -安装后,你可以使用 yay 命令来安装软件包: +安装后,你可以使用 `yay` 命令来安装软件包: ``` yay -S package_name ``` -并非必须使用 AUR helper 来从 AUR 安装软件包。从以下文章解如何在没有 AUR helper 的情况下使用 AUR。 +并非必须使用 AUR 助手来从 AUR 安装软件包。从以下文章解如何在没有 AUR 助手的情况下使用 AUR。 -##### 不使用 AUR helper 安装 AUR 软件包 +#### 不使用 AUR 助手安装 AUR 软件包 -如果你不想使用 AUR helper,那么也可以自行从 AUR 安装软件包。 +如果你不想使用 AUR 助手,那么也可以自行从 AUR 安装软件包。 在 [AUR 页面][10]上找到要安装的软件包后,建议确认“许可证”、“流行程度”、“最新更新”、“依赖项”等,作为额外的质量控制步骤。 @@ -89,17 +89,17 @@ makepkg -si #### 在 Manjaro Linux 中启用 AUR 支持 -它默认情况下未启用 AUR,你必须通过 pamac 启用它。我的笔记本电脑运行 [Manjaro][12] Cinnamon,但是所有 Manjaro 变种的步骤都相同。 +它默认情况下未启用 AUR,你必须通过 `pamac` 启用它。我的笔记本电脑运行 [Manjaro][12] Cinnamon,但是所有 Manjaro 变种的步骤都相同。 -打开 Pamac(列为 “Add/Remove Software”): +打开 Pamac(显示为 “Add/Remove Software”): ![][13] -进入 pamac 后,请进入如下所示的首选项。 +进入 Pamac 后,请进入如下所示的首选项preferences。 ![][14] -在首选项对话框中,进入 AUR 选项卡,启用 AUR 支持,启用检查更新并关闭对话框。 +在首选项对话框中,进入 “AUR” 选项卡,启用 AUR 支持,启用检查更新,并关闭对话框。 ![][15] @@ -116,7 +116,7 @@ via: https://itsfoss.com/aur-arch-linux/ 作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f9f6a48a67fb3be30f342c534df53d804dc89827 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Apr 2020 20:29:37 +0800 Subject: [PATCH 0264/1809] PUB @geekpi https://linux.cn/article-12107-1.html --- ...ository (AUR)- How to Use AUR on Arch and Manjaro Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md (98%) diff --git a/translated/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md b/published/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md similarity index 98% rename from translated/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md rename to published/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md index 6a56e84993..df0074259a 100644 --- a/translated/tech/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md +++ b/published/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12107-1.html) [#]: subject: (What is Arch User Repository (AUR)? How to Use AUR on Arch and Manjaro Linux?) [#]: via: (https://itsfoss.com/aur-arch-linux/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) From e232ab3c4a5bd21ecb30897c3b92cd0da768abf6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Apr 2020 20:58:14 +0800 Subject: [PATCH 0265/1809] APL --- ... using AI to translate -wash your hands- in 500 languages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md b/sources/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md index a18d557337..562ea35c72 100644 --- a/sources/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md +++ b/sources/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c2e05718dd93795a51b3dad22e679ccc5526b076 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Apr 2020 23:53:20 +0800 Subject: [PATCH 0266/1809] TSL --- ...late -wash your hands- in 500 languages.md | 136 ----------------- ...late -wash your hands- in 500 languages.md | 137 ++++++++++++++++++ 2 files changed, 137 insertions(+), 136 deletions(-) delete mode 100644 sources/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md create mode 100644 translated/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md diff --git a/sources/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md b/sources/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md deleted file mode 100644 index 562ea35c72..0000000000 --- a/sources/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md +++ /dev/null @@ -1,136 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How I'm using AI to translate 'wash your hands' in 500 languages) -[#]: via: (https://opensource.com/article/20/4/ai-translation) -[#]: author: (Daniel Whitenack https://opensource.com/users/datadan) - -How I'm using AI to translate 'wash your hands' in 500 languages -====== -By using both human and machine-generated translations, key health -phrases can be translated into local languages spoken all over the -world. -![Two diverse hands holding a globe][1] - -You might not know, but there are currently [7,117 languages spoken in the world][2]. Not dialects, but living languages! However, much of the world's digital media is available in only a couple dozen languages, and translation platforms like Google Translate only support around 100 languages. This reality means that there are billions of people around the world that are marginalized due to a lack of timely access to information. The current coronavirus (COVID-19) pandemic has made this painfully clear, and it has stressed the need for immediate, rapid translation of health-related phrases (like "wash your hands" or "keep your distance") into the long tail of languages. - -To this end, I applied state-of-the-art AI techniques to construct something close to the phrase "wash your hands" in 544 languages and counting (my GPUs are still running). Multilingual Unsupervised and Supervised Embeddings (MUSE) methods are used to train cross-lingual word embeddings between each of 544 languages and English. These embeddings then allow for the extraction of a phrase similar to the target phrase from existing documents. - -I performed this work in collaboration with my colleagues at SIL International, who have gathered even more human translations of the phrase. The combination of these human translations and some of my machine translations can be searched on [this Ethnologue guide page][3] (machine-generated phrases are indicated with a little robot icon), and more translations will be added as they are generated/gathered. - -### Leveraging existing corpora - -SIL International has done linguistic work in over 2000 languages and is currently managing over 1600 language projects. Thus, as I approached this particular problem, I knew that we had likely already translated the phrase "wash your hands" and/or similar phrases many times into hundreds of languages, and that guess paid off in spades. I was able to quickly gather documents (mostly completed shell book templates, educational materials, and Bibles) from our archives in over 900 languages. Each of these documents has an English parallel, which necessarily includes the phrase "wash your hands" and/or similar phrases like "wash your face." Moreover, each of these documents is very high quality and translated and checked in cooperation with the local language communities. - -That is quite the multilingual data set. However, there are two problems to overcome. First, this data included thousands of samples for most languages, which is in contrast to the millions used to train machine translation models. Second, even if the documents include the phrase "wash your hands" in the target language, we don't know the exact location of the phrase within the surrounding text. - -We could certainly exploit some of the latest tricks in [machine translation for low resource languages][4], but it would take some time to tune automated methods for rapidly adapting translation models in each language pair. Moreover, many of the languages we are targeting have no existing baseline with which we could compare evaluation metrics, e.g., [BLEU score][5]. Given the pressing concerns about the Coronavirus pandemic, we wanted to move a bit faster than that (although we plan to return to this problem in the future). - -I opted to try and construct the phrase "wash your hands" by finding the phrase itself or components of the phrase (like "wash your" or "your hands") in existing documents. To find these, I trained cross-lingual embedding for each {English, Target Language} pair using [Multilingual Unsupervised and Supervised Embedding (MUSE)][6] from Facebook Research. MUSE takes monolingual word embeddings as input (I used [_fasttext_][7] to generate these) and learns a mapping from the English to the target embedding space using adversarial methods. The output of this process is cross-lingual word embeddings. - -![Using fasttext along with MUSE to perform cross-language embedding][8] - -Once the cross-lingual embeddings are generated, we can get to finding the phrase components in the target language documents. As it turns out, the phrase "wash your face" was most clearly used throughout the documents along with instances of "hands," "wash your," etc. in isolation. For each of the languages, I search through n-grams in areas where I expected the phrase to appear (based on its usage in the English parallel). N-grams were vectorized using the cross-lingual embedding and compared with vectorized versions of the English phrases using various distance metrics. The n-grams that were "closest" to the English phrases in the embedding space were determined to be the target language matches. - -Finally, component phrases matching their English counterparts were combined to generate the phrase "wash your hands" in the target language. This combination utilizes the cross-lingual embedding again to make sure that the components are combined in an appropriate manner. For example, if we matched the phrase "wash your feet" in the target language, the n-gram corresponding to "feet" must be replaced with the n-gram corresponding to "hands." Here's an example for Belize Kriol English: - -![][9] - -There were, of course, some assumptions that were made during this matching process, and it is entirely possible that this procedure does not produce grammatically correct predictions. For example, I assumed that in most languages, the word for "hands" and the word for "feet" are both one token long (with tokens being separated by spaces and punctuation). This is certainly not always the case. This could create a bad word salad something like "and wash the and hand you" or similar. Hopefully, we can overcome some of these limitations and extend the system in the future, but, for now, we chose to reinforce the idea with graphics. - -We adapted the World Health Organization's hand washing instructions into a template PNG image. We then took our translated and generated phrases and rendered them into the hand washing image using a combination of Bash and Go scripts. In this way, the idea of proper hand washing is emphasized in both text and imagery (just in case our generated translations are awkward). - -![][10] - -### Results - -Thus far, I've been able to train cross-lingual embeddings for 544 languages. I used the above-discussed method to try and construct "wash your hands" for all of these languages. Because I don't have aligned data for many of the language pairs, I used separate holdout documents also containing components of "wash your hands" to help validate the tokens in the constructed phrase. This gives us some confidence in the translations that we publicly release (at least that they contain information indicating washing and/or hands). In addition, I compared the method with language pairs that are also supported by Google Translate and/or have available human translations. Here's a sample of the translations with language stats from [the Ethnologue][11]: - -#### Language: Italian [ita] - -Location: Italy -Population: 68,000,000 -Our system: "làvati la mani" -Google Translate: "Lavati le mani" - -#### Language: Bulgarian [bul] - -Location: Bulgaria -Population: 8,000,000 -Our system: "умий ръцете" -Google Translate: "Измий си ръцете" - -#### Language: Dutch [nld] - -Location: Netherlands -Population: 24,000,000 -Our system: "wast uw handen" -Google Translate: "Was je handen" - -#### Language: Pijin [pis] - -Location: Solomon Islands -Population: 550,000 -Our system: "wasim han" -Google Translate: Not supported - -#### Language: Tikar [tik] - -Location: Cameroon -Population: 110,000 -Our system: "ɓɔsi fyàʼ" -Google Translate: Not supported - -#### Language: Waffa [waj] - -Location: Papua New Guinea -Population: 1,300 -Our system: "yaakuuvaitana nnikiiyauvaa fini" -Google Translate: Not supported - -The constructed phrases are similar to reference translations or appear to be alternative ways of saying "wash your hands." For example, in Bulgarian, I predict "умий ръцете," and Google Translate predicts "Измий си ръцете." However, if I back-translate my prediction using Google Translate, I still get "wash your hands." There is some uncertainty where I can't compare to reference translations (e.g., Pijin [pis] from the Solomon Islands) or human-annotated spans, but I can still validate that the word for wash (wasim) and the word for hands (han) are used in other reference documents that are necessarily talking about washing, or hands, respectively. About 15% of the translations could be validated using this method, and I hope to validate more as I gather reference dictionaries. - -Note, I used at most about 7,000 sentences in each language to get the above translations, even for high-resource languages like Italian. I also did not rely on aligned sentences between the language pairs. Despite this very data-scarce, unsupervised scenario, I was still able to obtain phrases similar to that of Google Translate for languages supported by both systems. This demonstrates the potential utility of this sort of "hybrid" approach (unsupervised alignment of word embeddings + rule-based matching) for translating short phrases into languages where very little data exists. - -Note—I'm definitely not saying that this is a solution to the problem of information spread about Coronavirus and other health-related issues. There are still a lot of things to explore and formally evaluate here, and we are working on that. In many cases, this approach won't be able to help construct important informational material in hundreds of languages. However, I think that we should all be trying to develop creative solutions to problems related to the current crisis. Maybe this is one piece of a very large puzzle. - -You can view the complete list of validated translations plus human translations on [this Ethnologue guide page][3]. In addition, a more thorough description and analysis of the system in paper form is forthcoming. We welcome feedback from the public on the translations to help fine-tune the system and, most of all, to make sure that health information gets out to marginalized language communities around the world. - -### Create your own hand washing posters - -We have open sourced [the code used to render complex scripts and generate the hand washing posters][12]. This methodology should be able to handle almost all languages and scripts. You can add your own translation of "wash your hands" to a poster to help spread the word or tailor the translations for your own local context. Be sure to share your generated posters on social media with the hashtag #WashYourHands. - -### Develop your AI skills - -There are so many exciting AI problems out there that can make a huge impact in the world. If you want to solve problems like the one above with AI or if you think your business might need to start leveraging AI for other things (supply chain optimization, recommendation, customer service automation, etc.), don't miss the [_AI Classroom_ training event this May][13]. _AI Classroom_ is an immersive, three-day virtual training event for anyone with at least some programming experience and foundational understanding of mathematics. The training provides a practical baseline for realistic AI development using Python and open source frameworks like TensorFlow and PyTorch. After completing the course, participants will have the confidence to start developing and deploying their own AI solutions. - -_This article was republished with permission from _ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/ai-translation - -作者:[Daniel Whitenack][a] -选题:[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/datadan -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE (Two diverse hands holding a globe) -[2]: https://www.ethnologue.com/guides/how-many-languages -[3]: https://www.ethnologue.com/guides/health -[4]: https://datadan.io/blog/resources-for-low-resource-machine-translation -[5]: https://en.wikipedia.org/wiki/BLEU -[6]: https://github.com/facebookresearch/MUSE -[7]: https://fasttext.cc/ -[8]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom.gif (Using fasttext along with MUSE to perform cross-language embedding) -[9]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom2.gif -[10]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom3.gif -[11]: https://www.ethnologue.com/ -[12]: https://github.com/sil-ai/wash-your-hands -[13]: https://datadan.io/ diff --git a/translated/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md b/translated/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md new file mode 100644 index 0000000000..28669c6c39 --- /dev/null +++ b/translated/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md @@ -0,0 +1,137 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I'm using AI to translate 'wash your hands' in 500 languages) +[#]: via: (https://opensource.com/article/20/4/ai-translation) +[#]: author: (Daniel Whitenack https://opensource.com/users/datadan) + +我是如何用 AI 把 “请洗手”翻译成 500 种语言的? +====== + +> 通过使用人类和机器生成的翻译,可以将关键的健康短语翻译成世界各地的当地语言。 + +![Two diverse hands holding a globe][1] + +你可能不知道,目前世界上有 [7117 种语言][2],不是方言,而是在用的语言! 然而,世界上大部分的数字媒体只采用几十种语言,而像谷歌翻译这样的翻译平台只支持 100 种左右的语言。这样的现实意味着,由于缺乏及时获取信息的机会,全世界有数十亿人被边缘化。当前的冠状病毒(COVID-19)大流行已经让人痛苦地意识到了这一点,凸显了将健康相关的短语(如“请洗手wash your hands”或“保持距离”等)即时、快速翻译成小众语言的必要性。 + +为此,我应用了最先进的AI技术,用 544 种语言构建出了与“请洗手”相近的短语并进行了统计(我的 GPU 还在运行)。多语言无监督和监督嵌入Multilingual Unsupervised and Supervised Embeddings(MUSE)方法被用来训练这 544 种语言和英语之间的跨语言单词嵌入。然后,这些嵌入方法可以从现有文档中提取出与目标短语相似的短语。 + +我与 SIL 国际公司的同事们合作完成了这项工作,他们收集了该短语的更多的人工翻译结果。这些人工翻译结果和我的一些机器翻译结果的组合可以在[这个民族语指南页面][3]上搜索到(机器生成的短语用一个小的机器人图标表示),更多的翻译将在生成/收集到的时候加入。 + +### 利用现有的语料库 + +SIL 国际公司已经完成了 2000 多种语言的语言工作,目前管理着 1600 多个语言项目。因此,当我解决这个特殊的问题时,我知道我们很可能已经多次将“请洗手”和/或类似的短语翻译成了数百种语言,而这一猜测得到了回报。我很快就从我们的档案库中收集到了超过 900 种语言的文件(主要是完成的贝壳书模板、教材和圣经)。这些文件中的每一份文件都有一个英文的对应语,其中必然包括“请洗手”和/或类似“请洗脸”这样的短语。此外,这些文件的质量都很高,并与当地语言社区合作进行了翻译和检查。 + +这是相当多语言的数据集。然而,有两个问题需要克服。首先,这个数据包含了大多数语言的数千种样本,这与训练机器翻译模型所使用的数百万个样本形成了鲜明对比。其次,即使文档中包含目标语言中的“请洗手”这个短语,我们也不知道这个短语在周围文本中的确切位置。 + +我们当然可以利用[低资源语言的机器翻译][4]中的一些最新技巧,但要在每一对语言中快速调整翻译模型的自动化方法,还需要一些时间。此外,我们所针对的许多语言都没有现成的可以与之比较评估指标的基线,例如[BLEU 评分][5]。考虑到对冠状病毒大流行的迫切担忧,我们希望比这更快一点(尽管我们计划在将来再来解决这个问题)。 + +我选择通过在现有的文档中寻找短语本身或短语的组件(如“请洗”或“你的手”)来尝试构建“请洗手”这个短语。为了找到这些成分,我使用 Facebook Research 的 [多语言无监督和监督嵌入(MUSE)][6]对每个 {英语、目标语言} 对进行跨语言cross-lingual嵌入训练。MUSE 以单语言monolingual的单词嵌入作为输入(我使用 [fasttext][7] 来生成这些词),并使用对抗性方法学习从英语到目标嵌入空间的映射。这个过程的输出是跨语言cross-lingual的单词嵌入。 + +![Using fasttext along with MUSE to perform cross-language embedding][8] + +一旦产生了跨语言嵌入,我们就可以开始在目标语言文档中寻找短语成分。结果发现,整个文档中清楚地使用了“请洗脸”这个短语以及单独的“手”、“请洗”等词。对于每一种语言,我都通过 n-grams 搜索我预期该短语会出现的地方(根据其在英语平行语中的用法)。使用跨语言嵌入法对 n-grams 进行了矢量化,并使用各种距离指标与英语短语的矢量化版本进行了比较。在嵌入空间中,与英文短语“最接近”的 n-grams 被确定为目标语言匹配。 + +最后,将与英语对应的成分短语进行组合,生成目标语言中的“请洗手”短语。这种组合方式再次利用跨语言嵌入,确保组件短语的组合方式合适。例如,如果我们在目标语言中匹配“请洗脚”这个短语,就必须将“脚”对应的 n-gram 替换成“手”对应的 n-gram。下面是伯利兹·克里奥尔Belize Kriol英语的一个例子: + +![][9] + +当然,在这个匹配过程中,有一些假设,这个过程完全有可能不能产生语法上正确的预测。例如,我假设在大多数语言中,“手”的单词和“脚”的单词都是一个字元长的(字元由空格和标点符号隔开)。当然,情况肯定不一定是这样。这可能会造成类似于“和洗的和手你”或类似的不好的词条。希望我们可以克服其中的一些局限性,并在未来扩展这个系统,但是,现在,我们选择用图形来强化这个想法。 + +我们将世界卫生组织的洗手说明改编成了一个 PNG 图片模板。然后,我们把我们翻译和生成的短语,用 Bash 和 Go 脚本的组合将其渲染到洗手图像中。这样,在文字和图像中都强调了正确洗手的理念(只是为了防止我们生成的翻译有问题)。 + + +![][10] + +### 结果 + +到目前为止,我已经能够训练出 544 种语言的跨语言嵌入。我使用上述讨论过的方法尝试为所有这些语言构建“请洗手”这个短语。因为我没有许多语言对的对齐数据,所以我使用了同样包含“请洗手”成分的单独的保留文档来帮助验证构造短语中的字元。这让我们对公开发布的翻译版本有了一些信心(至少它们包含了表示“洗”和/或“手”的信息)。此外,我还将该方法与谷歌翻译支持的和/或有可用的人工翻译的语言对进行了比较。以下是来自 [Ethnologue][11] 带有语言统计的翻译样本。 + +**语言:意大利语 [Ita]** + +- 地点:意大利 +- 人口: 68,000,000 +- 我们的系统: làvati la mani +- 谷歌翻译: Lavati le mani + +**语言:保加利亚语 [bul]** + +- 地点:保加利亚 +- 人口:8,000,000 +- 我们的系统:умий ръцете +- 谷歌翻译:Измий си ръцете + +**语言: 荷兰语 [nld]** + +- 地点:荷兰 +- 人口:24,000,000,000 +- 我们的系统:wast uw handen +- 谷歌翻译:Was je handen + +**语言: Pijin [pis]** + +- 地点:所罗门群岛 +- 人口: 550,000 +- 我们的系统:wasim han +- 谷歌翻译:不支持 + +**语言:Tikar [tik]** + +- 地点:喀麦隆 +- 人口:110,000 +- 我们的系统:ɓɔsi fyàʼ +- 谷歌翻译:不支持 + +**语言:Waffa [waj]** + +- 地点:巴布亚新几内亚 +- 人口:1,300 +- 我们的系统:yaakuuvaitana nnikiiyauvaa fini +- 谷歌翻译:不支持 + +构建的短语类似于参考翻译,或者似乎是“请洗手”的另一种说法。例如,在保加利亚语中,我预测为“умий ръцете”,而谷歌翻译预测为“Измий си ръцете”。然而,如果我用谷歌翻译回译我的预测,我还是会得到“请洗手”。有一些不确定的地方,我无法与参考译文(例如,所罗门群岛的 Pijin [pis])或人类注释的跨度进行比较,但我仍然可以验证“洗”(wasim)和“手”(han)分别用在其他必定是谈论洗或手的参考文件中。大约有 15% 的译文可以用这个方法验证,我希望在收集参考文献字典的过程中,能验证更多的译文。 + +请注意,我最多使用了每种语言中大约 7000 个句子来得到上述译文,即使是意大利语这样的高资源语言也是如此。我也没有依赖语言对之间的对齐句子。尽管在这种数据非常稀缺、无监督的情况下,但对于两个系统都支持的语言,我仍然能够获得类似于谷歌翻译的短语。这证明了这种“混合”方法(无监督的单词嵌入+基于规则的匹配)在将短语翻译成数据非常少的语言中的潜在用途。 + +注意:我绝对不是说这是解决冠状病毒和其他健康相关的信息传播问题的解决方案。这里仍有很多东西需要探索和正式评估,我们正在为此努力。在很多情况下,这种方法无法帮助构建数百种语言的重要信息资料。但是,我认为,我们都应该尝试着为当前危机的相关问题制定创造性的解决方案。也许这只是一个非常大的拼图中的一块。 + +你可以在[这个民族语言指南][3]上查看经过验证的译文加上人工翻译的完整列表。此外,我们即将以论文的形式对这一系统进行更深入的描述和分析。我们欢迎公众对翻译进行反馈,以帮助系统进行微调,最重要的是,确保将健康信息传递给世界各地的边缘化语言社区。 + +### 制作自己的洗手海报 + +我们已经开源了[用于渲染复合的脚本和生成洗手海报的代码][12]。这种方法应该能够处理几乎所有的语言和脚本。你可以在海报中添加你自己的“请洗手”的翻译,以帮助传播,或者根据自己的本地语境进行翻译。请务必在社交媒体上以 #WashYourHands 为标签分享你生成的海报。 + +### 培养你的 AI 技能 + +有很多令人兴奋的 AI 问题,可以给世界带来巨大的影响。如果你想用人工智能解决像上面提到的问题,或者你认为你的企业可能需要开始利用人工智能来做其他事情(供应链优化、推荐、客户服务自动化等),那么不要错过今年 5 月的[AI 课堂培训活动][13]。*AI 课堂*是一个沉浸式的、为期三天的虚拟培训活动,适合至少有一定编程经验和数学基础知识的人参加。该培训提供了使用 Python 和开源框架(如 TensorFlow 和 PyTorch)进行现实的 AI 开发的实用基础知识。完成课程后,学员将有信心开始开发和部署自己的 AI 解决方案。 + +本文经许可转载自 https://datadan.io/blog/wash-your-hands + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/ai-translation + +作者:[Daniel Whitenack][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/datadan +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE (Two diverse hands holding a globe) +[2]: https://www.ethnologue.com/guides/how-many-languages +[3]: https://www.ethnologue.com/guides/health +[4]: https://datadan.io/blog/resources-for-low-resource-machine-translation +[5]: https://en.wikipedia.org/wiki/BLEU +[6]: https://github.com/facebookresearch/MUSE +[7]: https://fasttext.cc/ +[8]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom.gif (Using fasttext along with MUSE to perform cross-language embedding) +[9]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom2.gif +[10]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom3.gif +[11]: https://www.ethnologue.com/ +[12]: https://github.com/sil-ai/wash-your-hands +[13]: https://datadan.io/ From f0740a0c68ea58a4e265f4d4239e5c5b96566e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 14 Apr 2020 08:35:09 +0800 Subject: [PATCH 0267/1809] Translated --- ...ux on VirtualBox- Quickest - Safest Way.md | 146 ------------------ ...ux on VirtualBox- Quickest - Safest Way.md | 146 ++++++++++++++++++ 2 files changed, 146 insertions(+), 146 deletions(-) delete mode 100644 sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md create mode 100644 translated/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md diff --git a/sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md b/sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md deleted file mode 100644 index 3b7629d2a6..0000000000 --- a/sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md +++ /dev/null @@ -1,146 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Installing Kali Linux on VirtualBox: Quickest & Safest Way) -[#]: via: (https://itsfoss.com/install-kali-linux-virtualbox/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Installing Kali Linux on VirtualBox: Quickest & Safest Way -====== - -_**This tutorial shows you how to install Kali Linux on Virtual Box in Windows and Linux in the quickest way possible.**_ - -[Kali Linux][1] is one of the [best Linux distributions for hacking][2] and security enthusiasts. - -Since it deals with a sensitive topic like hacking, it’s like a double-edged sword. We have discussed it in the detailed Kali Linux review in the past so I am not going to bore you with the same stuff again. - -While you can install Kali Linux by replacing the existing operating system, using it via a virtual machine would be a better and safer option. - -With Virtual Box, you can use Kali Linux as a regular application in your Windows/Linux system. It’s almost the same as running VLC or a game in your system. - -Using Kali Linux in a virtual machine is also safe. Whatever you do inside Kali Linux will NOT impact your ‘host system’ (i.e. your original Windows or Linux operating system). Your actual operating system will be untouched and your data in the host system will be safe. - -![][3] - -### How to install Kali Linux on VirtualBox - -I’ll be using [VirtualBox][4] here. It is a wonderful open source virtualization solution for just about anyone (professional or personal use). It’s available free of cost. - -In this tutorial, we will talk about Kali Linux in particular but you can install almost any other OS whose ISO file exists or a pre-built virtual machine save file is available. - -**Note:** _The same steps apply for Windows/Linux running VirtualBox._ - -As I already mentioned, you can have either Windows or Linux installed as your host. But, in this case, I have Windows 10 installed (don’t hate me!) where I try to install Kali Linux in VirtualBox step by step. - -And, the best part is – even if you happen to use a Linux distro as your primary OS, the same steps will be applicable! - -Wondering, how? Let’s see… - -[Subscribe to Our YouTube Channel for More Linux Videos][5] - -### Step by Step Guide to install Kali Linux on VirtualBox - -_We are going to use a custom Kali Linux image made for VirtualBox specifically. You can also download the ISO file for Kali Linux and create a new virtual machine – but why do that when you have an easy alternative?_ - -#### 1\. Download and install VirtualBox - -The first thing you need to do is to download and install VirtualBox from Oracle’s official website. - -[Download VirtualBox][6] - -Once you download the installer, just double click on it to install VirtualBox. It’s the same for [installing VirtualBox on Ubuntu][7]/Fedora Linux as well. - -#### 2\. Download ready-to-use virtual image of Kali Linux - -After installing it successfully, head to [Offensive Security’s download page][8] to download the VM image for VirtualBox. If you change your mind to utilize [VMware][9], that is available too. - -![][10] - -As you can see the file size is well over 3 GB, you should either use the torrent option or download it using a [download manager][11]. - -[Kali Linux Virtual Image][8] - -#### 3\. Install Kali Linux on Virtual Box - -Once you have installed VirtualBox and downloaded the Kali Linux image, you just need to import it to VirtualBox in order to make it work. - -Here’s how to import the VirtualBox image for Kali Linux: - -**Step 1** : Launch VirtualBox. You will notice an **Import** button – click on it - -![Click on Import button][12] - -**Step 2:** Next, browse the file you just downloaded and choose it to be imported (as you can see in the image below). The file name should start with ‘kali linux‘ and end with . **ova** extension. - -![Importing Kali Linux image][13] - -**S** Once selected, proceed by clicking on **Next**. - -**Step 3** : Now, you will be shown the settings for the virtual machine you are about to import. So, you can customize them or not – that is your choice. It is okay if you go with the default settings. - -You need to select a path where you have sufficient storage available. I would never recommend the **C:** drive on Windows. - -![Import hard drives as VDI][14] - -Here, the hard drives as VDI refer to virtually mount the hard drives by allocating the storage space set. - -After you are done with the settings, hit **Import** and wait for a while. - -**Step 4:** You will now see it listed. So, just hit **Start** to launch it. - -You might get an error at first for USB port 2.0 controller support, you can disable it to resolve it or just follow the on-screen instruction of installing an additional package to fix it. And, you are done! - -![Kali Linux running in VirtualBox][15] - -The default username in Kali Linux is root and the default password is toor. You should be able to login to the system with it. - -Do note that you should [update Kali Linux][16] before trying to install a new applications or trying to hack your neighbor’s WiFi. - -I hope this guide helps you easily install Kali Linux on Virtual Box. Of course, Kali Linux has a lot of useful tools in it for penetration testing – good luck with that! - -**Tip** : Both Kali Linux and Ubuntu are Debian-based. If you face any issues or error with Kali Linux, you may follow the tutorials intended for Ubuntu or Debian on the internet. - -### Bonus: Free Kali Linux Guide Book - -If you are just starting with Kali Linux, it will be a good idea to know how to use Kali Linux. - -Offensive Security, the company behind Kali Linux, has created a guide book that explains the basics of Linux, basics of Kali Linux, configuration, setups. It also has a few chapters on penetration testing and security tools. - -Basically, it has everything you need to get started with Kali Linux. And the best thing is that the book is available to download for free. - -[Download Kali Linux Revealed for FREE][17] - -Let us know in the comments below if you face an issue or simply share your experience with Kali Linux on VirtualBox. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-kali-linux-virtualbox/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://www.kali.org/ -[2]: https://itsfoss.com/linux-hacking-penetration-testing/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/kali-linux-virtual-box.png?resize=800%2C450&ssl=1 -[4]: https://www.virtualbox.org/ -[5]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[6]: https://www.virtualbox.org/wiki/Downloads -[7]: https://itsfoss.com/install-virtualbox-ubuntu/ -[8]: https://www.offensive-security.com/kali-linux-vm-vmware-virtualbox-image-download/ -[9]: https://itsfoss.com/install-vmware-player-ubuntu-1310/ -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/kali-linux-virtual-box-image.jpg?resize=800%2C347&ssl=1 -[11]: https://itsfoss.com/4-best-download-managers-for-linux/ -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/vmbox-import-kali-linux.jpg?ssl=1 -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/vmbox-linux-next.jpg?ssl=1 -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/vmbox-kali-linux-settings.jpg?ssl=1 -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/kali-linux-on-windows-virtualbox.jpg?resize=800%2C429&ssl=1 -[16]: https://linuxhandbook.com/update-kali-linux/ -[17]: https://kali.training/downloads/Kali-Linux-Revealed-1st-edition.pdf diff --git a/translated/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md b/translated/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md new file mode 100644 index 0000000000..100d2ec246 --- /dev/null +++ b/translated/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Installing Kali Linux on VirtualBox: Quickest & Safest Way) +[#]: via: (https://itsfoss.com/install-kali-linux-virtualbox/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +在 VirtualBox 上安装 Kali Linux : 最快速和最安全的方法 +====== + +_**这篇教程向你展示如何以最快的方式在 Windows 和 Linux 中的 Virtual Box 虚拟机上安装 Kali Linux 。**_ + +[Kali Linux][1] 是 [最适合黑客攻击和安全爱好者的 Linux 发行版][2] 之一。 + +因为它涉及一个像黑客之类的敏感话题,就像一把双刃剑。我们过去在详细的 Kali Linux 评论中讨论过,所以我不会使用同样的东西来烦你。 + +尽管你可以通过以替换现有的操作系统的形式安装 Kali Linux 。但是通过一台虚拟机来使用它可能会是更好更安全的选择。 + +使用 Virtual Box ,你可以在 Windows/Linux 系统中将 Kail Linux 作为常规应用程序使用。它几乎与在系统中运行 VLC 或游戏是一样的。 + +在一台虚拟机中使用 Kali Linux 是安全的。不管你在 Kali Linux 做什么都不会影响你的 ‘宿主系统’ (例如,你的原始的 Windows 或 Linux 操作系统)。你的实际操作系统将不会受到影响,并且在你的宿主系统中数据也将是安全的。 + +![][3] + +### 如何在 VirtualBox 中安装 Kali Linux + +在这里我将使用 [VirtualBox][4] 。它是一个非常好的开源虚拟化解决方案,几乎适合于任何人(专业使用或个人使用)。它是免费提供的。 + +在这篇文章中,我们将特别讨论 Kali Linux ,但是你也可以安装其它任何存在的 ISO 文件,或者一个可用的预先构建的虚拟机保存文件。 + +**注意:** _同样的步骤也适用于运行 VirtualBox 的 Windows/Linux 。_ + +如上所述,你可以安装 Windows 或 Linux 作为你的宿主系统。但是,在我已安装 Windows 10 的情况下(别仇恨我!),我将尝试在 VirtualBox 中一步一步地安装 Kali Linux 。 + +并且,最好的部分是,– 即使你碰巧使用一个 Linux 发行版作为你的主要操作系统,也将使用同样的步骤! + +很疑惑,如何做?让我们来看看… + +[更多 Linux 视频,订阅我们的 YouTube 频道][5] + +### 图解在 VirtualBox 上安装 Kali Linux + +_我们将使用专门为 VirtualBox 定制的 Kali Linux 镜像。你也可以下载 Kali Linux 的 ISO 文件,并创建一个新的虚拟机 – 但是为什么当你有一个简单的选择时还这样做呢?_ + +#### 1\. 下载和安装 VirtualBox + +第一件要做的事是从甲骨文的官方网站下载和安装 VirtualBox 。 + +[下载VirtualBox][6] + +在你下载安装器后,只需要双击它来安装 VirtualBox 。在 [Ubuntu][7] / Fedora Linux 安装 VirtualBox 也是一样的。 + +#### 2\. 下载 Kali Linux 的即时可用的虚拟镜像 + +在安装成功后,前往 [攻击性安全的下载页面][8] 来下载适用于 VirtualBox 的虚拟机镜像。如果您改变主意使用 [VMware][9] ,那也是可行的。 + +![][10] + +如你所见,文件大小大约 3 GB ,你应该使用一个 torrent 选项,或者使用一个 [下载管理器][11] 来下载它。 + +[Kali Linux 虚拟镜像][8] + +#### 3\. 在 Virtual Box 上安装 Kali Linux + +在你安装 VirtualBox 和下载 Kali Linux 镜像后,你只需要导入它到 VirtualBox 中以便使它工作。 + +这里是如何导入 Kali Linux 的 VirtualBox 镜像: + +**步骤 1** : 启动 VirtualBox 。你将注意到一个 **导入** 按钮 – 在它上面鼠标左键单击 + +![在 导入 按钮上鼠标左键单击][12] + +**步骤 2:** 接下来,浏览到你更改下载的文件,并选择它来导入 (如你在下面的图像中所见)。文件名称一个以 'kali linux' 开始并以 . **ova** 拓展名结束。 + +![导入 Kali Linux 镜像][13] + + 在选择后,通过在 **接下来** 上鼠标左键单击以继续。 + +**步骤 3** : 现在,将向你显示将要导入虚拟机的设置。所以,你可以自定义它们或者不自定义它们 – 这取决于你的选择。如果你使用默认设置也是可以的。 + +你需要选择一个有足够可用存储空间的路径。在 Windows 上,我从不建议使用 **C:** 盘。 + +![导入硬盘驱动器为 VDI][14] + +在这里,硬盘驱动器如同 VDI 一样通过分配存储器空间集来虚拟挂载硬盘驱动器。 + +在你完成设置后,单击 **导入** 并等待一段时间。 + +**步骤 4:** 你现在将看到它的列表。所以,只需点击 **开始** 来启动它。 + +在最开始的时候,你可能会得到一个 USB 2.0 端口控制器的错误,你可以禁用它来解决问题,或者只需按照屏幕上的指南来安装一个附加软件包修复问题。与此同时,你完成所有工作! + +![Kali Linux 运行在 VirtualBox 中][15] + +在 Kali Linux 中默认用户名是 root ,默认密码是 toor 。你可以使用用户名和密码来登录到系统中。 + +请注意,在尝试安装一个新的应用程序或尝试侵入你邻居家的 WiFi 之前,你应该 [更新Kali Linux][16] 。 + +我希望这篇指南能帮助您在 Virtual Box 上很容易地安装 Kali Linux 。当然,Kali Linux 有很多有用的渗透测试工具 – 祝你好运! + +**提示** : Kali Linux 和 Ubuntu 都是基于 Debian 的,如果你在使用 Kali Linux 时遇到一些问题或错误,你可以按照互联网上的 Ubuntu 和 Debian 的教程解决。 + +### 额外的好处: 免费的 Kali Linux 指南书 + +如果你刚刚开始使用 Kali Linux, 那么知晓如何使用Kali Linux 将是一个好主意。 + +Kali Linux 背后的公司 Offensive Security 创建了一本解释 Linux 基础知识,Kali Linux 基础知识,配置和设置的指南书,也有一些关于渗透测试和安全工具的章节。 + +基本上,它拥有你开始使用 Kali Linux 所需的一切东西。最好的事情是这本书可以免费下载。 + +[免费下载 Kali Linux 解密][17] + +如果你遇到问题或只是想分项在 VirtualBox 使用 Kali Linux 的经验,请在下面的评论中告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-kali-linux-virtualbox/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.kali.org/ +[2]: https://itsfoss.com/linux-hacking-penetration-testing/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/kali-linux-virtual-box.png?resize=800%2C450&ssl=1 +[4]: https://www.virtualbox.org/ +[5]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[6]: https://www.virtualbox.org/wiki/Downloads +[7]: https://itsfoss.com/install-virtualbox-ubuntu/ +[8]: https://www.offensive-security.com/kali-linux-vm-vmware-virtualbox-image-download/ +[9]: https://itsfoss.com/install-vmware-player-ubuntu-1310/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/kali-linux-virtual-box-image.jpg?resize=800%2C347&ssl=1 +[11]: https://itsfoss.com/4-best-download-managers-for-linux/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/vmbox-import-kali-linux.jpg?ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/vmbox-linux-next.jpg?ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/vmbox-kali-linux-settings.jpg?ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/kali-linux-on-windows-virtualbox.jpg?resize=800%2C429&ssl=1 +[16]: https://linuxhandbook.com/update-kali-linux/ +[17]: https://kali.training/downloads/Kali-Linux-Revealed-1st-edition.pdf From b6a0458f9dcde9c4e1d9f17ce88ff190aeeacc9e Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 14 Apr 2020 08:43:30 +0800 Subject: [PATCH 0268/1809] translated --- ... The Beautiful Deepin Desktop to Ubuntu.md | 84 ------------------- ... The Beautiful Deepin Desktop to Ubuntu.md | 84 +++++++++++++++++++ 2 files changed, 84 insertions(+), 84 deletions(-) delete mode 100644 sources/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md create mode 100644 translated/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md diff --git a/sources/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md b/sources/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md deleted file mode 100644 index b540f8995d..0000000000 --- a/sources/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu) -[#]: via: (https://itsfoss.com/ubuntudde/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu -====== - -Deepin is a beautiful desktop environment with an intuitive UI. UbuntuDDE project combines the power of Ubuntu and the beauty of Deepin. - -[Deepin Desktop Environment][1] (DDE) is a beautiful desktop environment created by the developers of [Deepin Linux][2]. Initially, Deepin Linux was based on [Ubuntu][3] but later they switched to [Debian][4]. - -![Deepin Desktop Environment in Ubuntu][5] - -One major problem with Deepin Linux is its slow servers. A regular system takes hours to download for the fact that they have all their servers in China and these servers are unfortunately extremely slow. - -If you want to use Deepin desktop, nothing stops you from installing it on your regular Ubuntu system. [UbuntuDDE][6] is trying to make it simpler by providing you an out of the box Deepin desktop experience on top of Ubuntu. This saves you time and effort in installing and configuring Deepin on Ubuntu. - -![Screenshot of UbuntuDDE][7] - -### Ubuntu DDE: Power of Ubuntu and beauty of Deepin desktop - -Please note that UbuntuDDE is not an official flavor of Ubuntu. UbuntuDDE developers are not associated with the Ubuntu team. UbuntuDDE is currently a Remix distribution and is aiming for getting recognized as Ubuntu’s official flavor in future releases. - -UbuntuDDE developers are helped by Alan Pope of Ubuntu’s Snapcraft team and teams of Ubuntu Budgie and [Ubuntu Cinnamon][8] and a few other developers. - -In a conversation with It’s FOSS, its lead developer Arun highlighted that the important aspect of this project is to regularly maintain the DDE packages for Ubuntu and help users enjoy the full taste of DDE (Deepin Desktop Environment). - -![Ubuntu Deepin Edition login screen][9] - -Arun also mentioned that this Ubuntu Deepin remix project started first by maintaining and packaging the packages to the latest release from the upstream i.e. Deepin Repository. Then, it eventually got spin with Ubuntu 20.04 focal resulting in an image file that everyone can install without the hassle to install regular Ubuntu first and then the Deepin Desktop. UbuntuDDE is not just the combo of DDE and Ubuntu but also the fusion of selective packages and design changes by the UbuntuDDE Team. - -![UbuntuDDE screenshot][10] - -Unlike Deepin Linux, UbuntuDDE doesn’t use Deepin Appstore. It uses Ubuntu Software Center instead. This should be a good news if you are spooked by the [spyware labeling of Wuhan-based Deepin Linux][11]. - -### Download UbuntuDDE 20.04 Beta - -UbuntuDDE is aiming to release its first official stable release with Ubuntu 20.04. Like [other Ubuntu flavors][12], UbuntuDDE 20.04 beta is also available for you to download and try. - -Warning! - -A word of warning. UbuntuDDE is a novice project under development. Please don’t use it on your main system. If you want to try it, use it in virtual machine or on a spare system. - -[Download Ubuntu 20.04 DDE Beta][13] - -![Installing UbuntuDDE][14] - -Since it is essentially Ubuntu, installing UbuntuDDE is the same as installing Ubuntu. You may refer to this tutorial showing [how to install Ubuntu inside VirtualBox][15]. - -I know you may think ‘not another Ubuntu’ or ‘it’s just Deepin on Ubuntu that anyone can do’ and you do have a point. But I also know there is a small segment of users who like projects like UbuntuDDE that makes thing easier for them. I mean that’s how many Ubuntu flavor came into existence. What do you think? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntudde/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://www.deepin.org/en/dde/ -[2]: https://www.deepin.org/en/ -[3]: https://ubuntu.com/ -[4]: https://www.debian.org/ -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot.jpg?ssl=1 -[6]: https://ubuntudde.com/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot-1.jpg?ssl=1 -[8]: https://itsfoss.com/ubuntu-cinnamon/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot-5.jpg?ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot-2.jpg?ssl=1 -[11]: https://www.deepin.org/en/2018/04/14/linux-deepin-is-not-spyware/ -[12]: https://itsfoss.com/which-ubuntu-install/ -[13]: https://ubuntudde.com/download/ -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot-4.jpg?ssl=1 -[15]: https://itsfoss.com/install-linux-in-virtualbox/ diff --git a/translated/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md b/translated/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md new file mode 100644 index 0000000000..254e3e09eb --- /dev/null +++ b/translated/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu) +[#]: via: (https://itsfoss.com/ubuntudde/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +新的 Linux 发行版 UbuntuDDE 将漂亮的 Deepin 桌面带到 Ubuntu +====== + +Deepin 是有直观 UI 的漂亮桌面环境。UbuntuDDE 项目结合了 Ubuntu 的强大和 Deepin 之美。 + +[Deepin 桌面环境][1](DDE)是由 [Deepin Linux][2] 的开发人员创建的漂亮桌面环境。最初,Deepin Linux 基于 [Ubuntu][3],但后来他们切换到了 [Debian][4]。 + +![Deepin Desktop Environment in Ubuntu][5] + +Deepin Linux 的一个主要问题是服务器速度较慢。常规系统需要花几个小时才能下载,因为它们的所有服务器都在中国,而且这些服务器非常慢。 + +如果你想使用 Deepin 桌面,那没有什么可以阻止你将其安装在常规 Ubuntu 系统上。[UbuntuDDE][6] 试图通过在 Ubuntu 之上为你提供开箱即用的 Deepin 桌面体验来使其更简单。这样可以节省你在 Ubuntu 上安装和配置 Deepin 的时间和精力。 + +![Screenshot of UbuntuDDE][7] + +### Ubuntu DDE:Ubuntu 的强大和 Deepin 桌面的漂亮 + +请注意,UbuntuDDE 不是 Ubuntu 的官方变种。UbuntuDDE 的开发人员与 Ubuntu 团队无关。UbuntuDDE 目前一个混合发行版,其目标是在未来的发行版中被公认为 Ubuntu 的官方变种。 + +UbuntuDDE 开发人员得到了 Ubuntu Snapcraft 团队的 Alan Pope 以及 Ubuntu Budgie 团队和 [Ubuntu Cinnamon][8] 团队以及其他开发者的帮助。 + +在与 FOSS 的对话中,其主要开发人员 Arun 强调说,该项目的重要方面是定期维护 Ubuntu 的 DDE 软件包,并帮助用户享受 DDE(深度桌面环境)的全部乐趣。 + +![Ubuntu Deepin Edition login screen][9] + +Arun 还提到,这个 Ubuntu Deepin 混合项目首先是维护和打包来自上游(即 Deepin 仓库)的最新版本。然后,它最终与 Ubuntu 20.04 focal 结合,生成了一个镜像文件,每个人都可以安装,而不必麻烦地先安装常规的 Ubuntu,然后再安装 Deepin Desktop。UbuntuDDE 不仅是 DDE 和 Ubuntu 的组合,而且还是 UbuntuDDE 团队软件包选择和设计变更的融合。 + +![UbuntuDDE screenshot][10] + +与 Deepin Linux 不同,UbuntuDDE 不使用 Deepin Appstore。它改用 Ubuntu 软件中心。如果你对[基于武汉的 Deepin Linux 的间谍软件标签][11]感到不满意,这将是一个好消息。 + +### 下载 UbuntuDDE 20.04 Beta + +UbuntuDDE 的目标是与 Ubuntu 20.04 一起发布第一个正式的稳定版本。像[其他 Ubuntu 变种][12]一样,UbuntuDDE 20.04 beta 也可供你下载并尝试。 + +警告! + +一句话警告。 UbuntuDDE 是正在开发的新手项目。请不要在你的主系统上使用它。如果要尝试,请在虚拟机或备用系统中使用它。 + +[Download Ubuntu 20.04 DDE Beta][13] + +![Installing UbuntuDDE][14] + +由于本质上是 Ubuntu,因此安装 UbuntuDDE 与安装 Ubuntu 相同。你可以参考本教程,其中展示了[如何在 VirtualBox 内安装 Ubuntu][15]。 + +我知道你可能会认为这“不是另一个 Ubuntu” 或者“只是 Ubuntu 上的 Deepin,任何人都可以做”。但是我也知道有一小部分用户喜欢像 UbuntuDDE 这样的项目,这对他们来说使事情变得容易。我的意思是有许多 Ubuntu 变种出现了。你怎么看? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntudde/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.deepin.org/en/dde/ +[2]: https://www.deepin.org/en/ +[3]: https://ubuntu.com/ +[4]: https://www.debian.org/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot.jpg?ssl=1 +[6]: https://ubuntudde.com/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot-1.jpg?ssl=1 +[8]: https://itsfoss.com/ubuntu-cinnamon/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot-5.jpg?ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot-2.jpg?ssl=1 +[11]: https://www.deepin.org/en/2018/04/14/linux-deepin-is-not-spyware/ +[12]: https://itsfoss.com/which-ubuntu-install/ +[13]: https://ubuntudde.com/download/ +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-deepin-edition-screenshot-4.jpg?ssl=1 +[15]: https://itsfoss.com/install-linux-in-virtualbox/ From b55da20ffdec6213f6f385e126ddc6fdaf9b81b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 14 Apr 2020 08:47:22 +0800 Subject: [PATCH 0269/1809] Translating --- .../20191014 How to make a Halloween lantern with Inkscape.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191014 How to make a Halloween lantern with Inkscape.md b/sources/tech/20191014 How to make a Halloween lantern with Inkscape.md index 0f15fae6e6..25324f030e 100644 --- a/sources/tech/20191014 How to make a Halloween lantern with Inkscape.md +++ b/sources/tech/20191014 How to make a Halloween lantern with Inkscape.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f980bc84c8d6d40f02e6e63c0c233fa9265d4caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 14 Apr 2020 08:48:31 +0800 Subject: [PATCH 0270/1809] Translating --- ...915 How to Configure SFTP Server with Chroot in Debian 10.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md b/sources/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md index 877845b87a..9d57192270 100644 --- a/sources/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md +++ b/sources/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 851f5e93a2411b45e49ab071fbf759b0b4f76b69 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 14 Apr 2020 08:48:38 +0800 Subject: [PATCH 0271/1809] translating --- .../tech/20200413 How to Add Multiple Time Zones in Ubuntu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md b/sources/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md index 3dc42a5247..f0d353455d 100644 --- a/sources/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md +++ b/sources/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d3f8a3daa4173a8346747cb74b137fcf554b3a53 Mon Sep 17 00:00:00 2001 From: bingzxy Date: Tue, 14 Apr 2020 10:09:48 +0800 Subject: [PATCH 0272/1809] request translation --- ...8 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md b/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md index 569981ebea..b777bbe74e 100644 --- a/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md +++ b/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (bingzxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -7,6 +7,7 @@ [#]: via: (https://opensource.com/article/20/4/linux-story) [#]: author: (James Farrell https://opensource.com/users/jamesf) +bingzxy is translating My Linux Story: From 8-bit enthusiast to Unix sysadmin ====== How my early interest in computers got me hooked on a career as a From 213ac9d52f0075603388eb9ee9d3484172fc2e31 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 14 Apr 2020 18:36:28 +0800 Subject: [PATCH 0273/1809] PRF @wxy --- ...03 Take back your dotfiles with Chezmoi.md | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/translated/tech/20200403 Take back your dotfiles with Chezmoi.md b/translated/tech/20200403 Take back your dotfiles with Chezmoi.md index 100193493d..a4901c08a3 100644 --- a/translated/tech/20200403 Take back your dotfiles with Chezmoi.md +++ b/translated/tech/20200403 Take back your dotfiles with Chezmoi.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Take back your dotfiles with Chezmoi) @@ -10,19 +10,19 @@ 用 Chezmoi 取回你的点文件 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202004/14/183618dwkhe4ehx1kthxvw.jpg) -在 Linux 中,点文件是隐藏的文本文件,用于存储从 Bash、Git 到 i3 或 VSCode 等更复杂的许多应用程序的配置设置。 +在 Linux 中,点文件是隐藏的文本文件,从 Bash、Git 到 i3 或 VSCode 等更复杂的许多应用程序,都用它存储配置设置。 -这些文件大多数都放在 `~/.config` 目录中或用户主目录中。编辑这些文件使你可以自定义也许没有提供设置菜单的应用程序,并且它们可以跨设备甚至是跨其他 Linux 发行版移植。但是,Linux 发烧友社区中讨论的一个话题是如何管理这些点文件以及如何共享它们。 +这些文件大多数都放在 `~/.config` 目录中或用户主目录中。编辑这些文件使你可以自定义也许没有提供设置菜单的应用程序,并且它们可以跨设备甚至是跨其它 Linux 发行版移植。但是,整个 Linux 发烧友社区的讨论焦点是如何管理这些点文件以及如何共享它们。 -我们将展示一个名为 [Chezmoi][2] 的工具,该工具与其他工具略有不同。 +我们将展示一个名为 [Chezmoi][2] 的工具,该工具与其它工具略有不同。 ### 点文件管理的历史 -如果你在 [GitHub 上搜索“dotfile”][3],那么你将看到有超过 10 万个存储库在解决一个目标:将人们的点文件存储在可共享且可重复的领地中。但是,除了都在使用 Git 之外,它们存储文件的方式各有不同。 +如果你在 [GitHub 上搜索“dotfiles”][3],那么你将看到有超过 10 万个存储库在解决一个目标:将人们的点文件存储在可共享且可重复的领地中。但是,除了都在使用 Git 之外,它们存储文件的方式各有不同。 -虽然 Git 解决了代码管理问题,也将其转换为配置文件管理,但它并没有解决如何区分发行版、角色(例如家用计算机与工作计算机)、机密管理以及按设备配置的问题。 +虽然 Git 解决了代码管理问题,也将其转换为配置文件管理,但它并没有解决如何区分发行版、角色(例如家用计算机与工作计算机)、机密信息管理以及按设备配置的问题。 因此,许多用户决定制定自己的解决方案,多年来,社区已经做出了许多成果。本文将简要介绍已有的一些解决方案。 @@ -38,27 +38,27 @@ $ podman run --rm -it fedora #### 安装问题 -如果将点文件存储在 Git 存储库中,你肯定希望可以使更改轻松地自动应用到主目录之中,乍一看,最简单的方法是使用符号链接,例如 `ln -s ~/.dotfies/bashrc ~/.bashrc`。这将使你的更改在更新存储库时立即就绪。 +如果将点文件存储在 Git 存储库中,你肯定希望可以让更改轻松地自动应用到主目录之中,乍一看,最简单的方法是使用符号链接,例如 `ln -s ~/.dotfies/bashrc ~/.bashrc`。这可以使你的更改在更新存储库时立即就绪。 -符号链接的问题在于管理符号链接可能很麻烦。Stow 和 [RCM(在 Fedora 杂志上介绍过)][4]可以帮助你管理这些,但是这些并不是非常舒服的解决方案。下载后,需要对私有文件进行适当的修改和设置访问模式。如果你在一个系统上修改了点文件,然后将存储库下载到另一个系统,则可能会发生冲突并需要进行故障排除。 +符号链接的问题在于管理符号链接可能很麻烦。Stow 和 [RCM][4](在 Fedora 杂志上介绍过)可以帮助你管理这些,但是这些并不是非常舒服的解决方案。下载后,需要对私有文件进行适当的修改和设置访问模式。如果你在一个系统上修改了点文件,然后将存储库下载到另一个系统,则可能会发生冲突并需要进行故障排除。 -解决此问题的另一种方法是编写自己的安装脚本。这是最灵活的选项,但要权衡需要花费更多时间来构建自定义解决方案是否值得。 +解决此问题的另一种方法是编写自己的安装脚本。这是最灵活的选项,但要权衡花费更多时间来构建自定义解决方案是否值得。 -#### 机密问题 +#### 机密信息问题 -Git 旨在跟踪更改。如果你在 Git 存储库中存储密码或 API 密钥之类的机密信息,则会比较麻烦,并且需要重写 Git 历史记录以删除该机密信息。如果你的存储库是公开的,那么如果其他人下载了你的存储库,你的机密信息将不再保密。仅这个问题就会阻止许多人与公共世界共享其 dotfile。 +Git 旨在跟踪更改。如果你在 Git 存储库中存储密码或 API 密钥之类的机密信息,则会比较麻烦,并且需要重写 Git 历史记录以删除该机密信息。如果你的存储库是公开的,那么如果其他人下载了你的存储库,你的机密信息将不再保密。仅这个问题就会阻止许多人与公共世界共享其点文件。 #### 多设备配置问题 -问题不在于将配置拉到多个设备,而是当你有多个需要不同配置的设备时的问题。大多数人通过使用不同的文件夹或使用不同的复刻来处理此问题。这使得难以在不同设备和角色集之间共享配置。 +问题不在于如何将配置拉到多个设备,而是当你有多个需要不同配置的设备的问题。大多数人通过使用不同的文件夹或使用不同的复刻fork来处理此问题。这使得难以在不同设备和角色集之间共享配置。 ### Chezmoi 是如何干的 -Chezmoi 是一种考虑了以上问题的用于管理点文件的工具,它不会盲目地从存储库复制或符号链接文件。 Chezmoi 更像是模板引擎,可以根据系统变量、模板、机密管理器和 Chezmoi 自己的配置文件来生成你的点文件。 +Chezmoi 是一种考虑了以上问题的用于管理点文件的工具,它不会盲目地从存储库复制或符号链接文件。 Chezmoi 更像是模板引擎,可以根据系统变量、模板、机密信息管理器和 Chezmoi 自己的配置文件来生成你的点文件。 #### Chezmoi 入门 -目前,Chezmoi 不在 Fedora 的默认软件库中。你可以使用以下命令下载 Chezmoi 的当前版本。 +目前,Chezmoi 并不在 Fedora 的默认软件库中。你可以使用以下命令下载 Chezmoi 的当前版本。 ``` $ sudo dnf install https://github.com/twpayne/chezmoi/releases/download/v1.7.17/chezmoi-1.7.17-x86_64.rpm @@ -72,7 +72,7 @@ $ sudo dnf install https://github.com/twpayne/chezmoi/releases/download/v1.7.17/ $ chezmoi init ``` -它将在 `~/.local/share/chezmoi/` 中创建你的新存储库。你可以使用以下命令轻松地切换该目录: +它将在 `~/.local/share/chezmoi/` 中创建你的新存储库。你可以使用以下命令轻松地切换到该目录: ``` $ chezmoi cd @@ -86,7 +86,7 @@ chezmoi add ~/.bashrc 这将你的 `.bashrc` 文件添加到 chezmoi 存储库。 -注意:如果你的 `.bashrc` 文件实际上是一个符号链接,则需要添加 `-f` 标志以跟随它并读取实际文件的内容。 +注意:如果你的 `.bashrc` 文件实际上是一个符号链接,则需要添加 `-f` 标志以跟随它来读取实际文件的内容。 现在,你可以使用以下命令编辑该文件: @@ -106,7 +106,7 @@ Chezmoi 使用特殊的前缀来跟踪隐藏文件和私有文件,以解决 Gi $ chezmoi cd ``` -**请注意,标记为私有的文件实际上并不是私有的,它们仍会以纯文本格式保存在你的 Git 存储库中。稍后会解释更多。** +**请注意,标记为私有的文件实际上并不是私有的,它们仍会以纯文本格式保存在你的 Git 存储库中。稍后会进一步解释。** 你可以使用以下方法应用任何更改: @@ -144,7 +144,7 @@ $ chezmoi edit-config name = "Fedora Mcdora" ``` -保存文件,然后再次运行 `chezmoi data`。你将在底部看到你的电子邮件和姓名现已添加。现在,你可以将这些与 Chezmoi 的模板一起使用。运行: +保存文件,然后再次运行 `chezmoi data`。你将在底部看到你的电子邮件和姓名已经添加成功。现在,你可以将这些与 Chezmoi 的模板一起使用。运行: ``` $ chezmoi add -T --autotemplate ~/.gitconfig @@ -166,7 +166,7 @@ $ chezmoi add -T --autotemplate ~/.gitconfig $ chezmoi edit ~/.gitconfig ``` -然后使用 +然后使用: ``` $ chezmoi cat ~/.gitconfig @@ -176,17 +176,17 @@ $ chezmoi cat ~/.gitconfig ``` [root@a6e273a8d010 ~]# chezmoi cat ~/.gitconfig - [user] - email = "fedorauser@example.com" - name = "Fedora Mcdora" - [root@a6e273a8d010 ~]# +[user] + email = "fedorauser@example.com" + name = "Fedora Mcdora" +[root@a6e273a8d010 ~]# ``` 它将在我们的 Chezmoi 配置中生成一个充满变量的文件。你也可以使用变量执行简单的逻辑语句。一个例子是: ``` {{- if eq .chezmoi.hostname "fsteel" }} -# this will only be included if the host name is equal to "fsteel" +# 如果主机名为 "fsteel" 才包括此部分 {{- end }} ``` @@ -224,7 +224,7 @@ $ chezmoi doctor [root@a6e273a8d010 ~]# ``` -您可以使用这些客户端,也可以使用[通用客户端][6],也可以使用系统的[密钥环][7]。 +你可以使用这些客户端,也可以使用[通用客户端][6],也可以使用系统的[密钥环][7]。 对于 GPG,你需要使用以下命令将以下内容添加到配置中: @@ -243,9 +243,9 @@ $ chezmoi edit-config $ chezmoi add --encrypt ``` -来添加任何文件,这些文件将在你的源存储库中加密,并且不会以纯文本格式公开。Chezmoi 会在申请时自动将其解密。 +来添加任何文件,这些文件将在你的源存储库中加密,并且不会以纯文本格式公开。Chezmoi 会在应用时自动将其解密。 -我们也可以在模板中使用它们。例如,存储在 [Pass(已在 Fedora 杂志上介绍)][8]中的机密令牌。继续,生成你的机密信息。 +我们也可以在模板中使用它们。例如,存储在 [Pass][8](已在 Fedora 杂志上介绍)中的机密令牌。继续,生成你的机密信息。 在此示例中,它称为 `githubtoken`: @@ -291,7 +291,7 @@ via: https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/ 作者:[Ryan Walter][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ec32104a69b8bc9d6be7a7b84bfa1a723b234937 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 14 Apr 2020 18:37:07 +0800 Subject: [PATCH 0274/1809] PUB @wxy https://linux.cn/article-12109-1.html --- .../20200403 Take back your dotfiles with Chezmoi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200403 Take back your dotfiles with Chezmoi.md (99%) diff --git a/translated/tech/20200403 Take back your dotfiles with Chezmoi.md b/published/20200403 Take back your dotfiles with Chezmoi.md similarity index 99% rename from translated/tech/20200403 Take back your dotfiles with Chezmoi.md rename to published/20200403 Take back your dotfiles with Chezmoi.md index a4901c08a3..caded6c08c 100644 --- a/translated/tech/20200403 Take back your dotfiles with Chezmoi.md +++ b/published/20200403 Take back your dotfiles with Chezmoi.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12109-1.html) [#]: subject: (Take back your dotfiles with Chezmoi) [#]: via: (https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/) [#]: author: (Ryan Walter https://fedoramagazine.org/author/rwaltr/) From 73184c5e3ec294b901320578eb0c159d7ac0127b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 14 Apr 2020 22:57:45 +0800 Subject: [PATCH 0275/1809] PRF @geekpi --- ...- A Free - Open Source Password Manager.md | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/translated/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md b/translated/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md index d14a896277..53d7b21dff 100644 --- a/translated/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md +++ b/translated/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md @@ -1,24 +1,24 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Bitwarden: A Free & Open Source Password Manager) [#]: via: (https://itsfoss.com/bitwarden/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -Bitwarden:一个免费的开源密码管理器 +Bitwarden:一个自由开源的密码管理器 ====== -_ **简述:** Bitwarden 是流行的开源密码管理器。 在这里,我们来看看它提供了什么。 +> Bitwarden 是流行的开源密码管理器。在这里,我们来看看它提供了什么。 ![][1] -[Bitwarden][2] 是一个免费的开源密码管理器。 你可能还记得,我们之前将它列为 [Linux 中的最佳密码管理器][3]之一。 +[Bitwarden][2] 是一个自由开源的密码管理器。你可能还记得,我们之前将它列为 [Linux 中的最佳密码管理器][3]之一。 -就个人而言,几个月来我一直在多个设备上使用 Bitwarden 作为我的密码管理器。 因此,在本文中,我将说明它提供的功能以及我的使用经验。 +就个人而言,几个月来我一直在多个设备上使用 Bitwarden 作为我的密码管理器。因此,在本文中,我将说明它提供的功能以及我的使用经验。 -**注意:** _ 如果你对服务的安全性有疑问,请查看其官方安全性[常见问题页面][4]。 +**注意:** 如果你对服务的安全性有疑问,请查看其官方安全性[常见问题页面][4]。 ### Bitwarden 密码管理器的特性 @@ -32,7 +32,7 @@ _ **简述:** Bitwarden 是流行的开源密码管理器。 在这里,我 * 适用于团队(企业)和个人 * 开源 * 支持自托管 - * 能够作为身份验证器应用(像 Google 身份验证器) + * 能够作为身份验证器应用(如 Google 身份验证器) * 跨平台支持(安卓、iOS、Linux、Windows 和 macOS) * 提供浏览器扩展(Firefox,、Chrome、Opera、Edge、Safari) * 提供命令行工具 @@ -42,12 +42,9 @@ _ **简述:** Bitwarden 是流行的开源密码管理器。 在这里,我 * 自动填充密码 * 两步身份验证 - - - 从技术上讲,Bitwarden 使用完全免费。然而,它也提供了一些付费计划(个人付费和商务付费计划)。 -通过高级计划,你可以与更多用户共享密码、获取 API 访问权限(业务使用)以及更多此类高级功能。 +通过付费计划,你可以与更多用户共享密码、获取 API 访问权限(业务使用)以及更多此类高级功能。 以下是定价(在编写本文时): @@ -59,11 +56,11 @@ _ **简述:** Bitwarden 是流行的开源密码管理器。 在这里,我 ![][8] -很容易将 Bitwarden 安装到你的 Linux 系统上,因为它提供了一个 .**AppImage** 文件。如果你还不知道[如何使用 AppImage][9] 文件,你可以参考我们的指南。 +很容易将 Bitwarden 安装到你的 Linux 系统上,因为它提供了一个 .AppImage 文件。如果你还不知道[如何使用 AppImage][9] 文件,你可以参考我们的指南。 -如果你不喜欢使用 AppImage , 你可以选择 [snap 包][10]或在其[官方下载页面][11]上下载 **.deb** 或者 **.rpm** 文件。你还可以查看其 [GitHub 页面][12]了解更多信息。 +如果你不喜欢使用 AppImage,你可以选择 [snap 包][10]或在其[官方下载页面][11]上下载 .deb 或者 .rpm 文件。你还可以查看其 [GitHub 页面][12]了解更多信息。 -[Download Bitwarden][2] +- [下载 Bitwarden][2] 如果你对使用桌面应用不感兴趣,也可以使用浏览器扩展。 @@ -73,9 +70,9 @@ _ **简述:** Bitwarden 是流行的开源密码管理器。 在这里,我 所以,在我发现 Bitwarden 后就决定使用它。 -首先,我从 LastPass 导出我的数据,并导入到 Bitwarden 没有困难。在此过程中我没有丢失任何数据。 +首先,我从 LastPass 导出我的数据,并导入到 Bitwarden 没有遇到困难。在此过程中我没有丢失任何数据。 -除了桌面应用,我一直在使用 Bitwarden 的火狐插件,和 Android 应用。使用六个多月后,我没有遇到任何问题。所以,如果你愿意试试看,我一定会给它好评! +除了桌面应用,我一直在使用 Bitwarden 的火狐插件和 Android 应用。使用六个多月后,我没有遇到任何问题。所以,如果你愿意试试看,我一定会给它好评! ### 总结 @@ -83,7 +80,7 @@ _ **简述:** Bitwarden 是流行的开源密码管理器。 在这里,我 你可以免费入门,但如果可以,请购买 **10 美元/年**的高级计划来支持这个开源项目。 -如果你正在寻找更多选择,你也可以查看我们的 [Linux 中 5 个最佳密码管理器][5]。 +如果你正在寻找更多选择,你也可以查看我们的 [Linux 中 5 个最佳密码管理器][3]。 你试过 Bitwarden 了吗?如果没有,请试试看!此外,你最喜欢的密码管理器是什么?让我在下面的评论中知道! @@ -94,7 +91,7 @@ via: https://itsfoss.com/bitwarden/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -102,7 +99,7 @@ via: https://itsfoss.com/bitwarden/ [b]: https://github.com/lujun9972 [1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-screenshot.jpg?ssl=1 [2]: https://bitwarden.com/ -[3]: https://itsfoss.com/password-managers-linux/ +[3]: https://linux.cn/article-11531-1.html [4]: https://help.bitwarden.com/security/ [5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/bitwarden-dark-mode.jpg?ssl=1 [6]: https://itsfoss.com/password-generators-linux/ From 221af56fbbe57db895ce7b8d6c6548128deee128 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 14 Apr 2020 22:58:29 +0800 Subject: [PATCH 0276/1809] PUB @geekpi https://linux.cn/article-12111-1.html --- ...200407 Bitwarden- A Free - Open Source Password Manager.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200407 Bitwarden- A Free - Open Source Password Manager.md (98%) diff --git a/translated/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md b/published/20200407 Bitwarden- A Free - Open Source Password Manager.md similarity index 98% rename from translated/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md rename to published/20200407 Bitwarden- A Free - Open Source Password Manager.md index 53d7b21dff..5341efed3d 100644 --- a/translated/tech/20200407 Bitwarden- A Free - Open Source Password Manager.md +++ b/published/20200407 Bitwarden- A Free - Open Source Password Manager.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12111-1.html) [#]: subject: (Bitwarden: A Free & Open Source Password Manager) [#]: via: (https://itsfoss.com/bitwarden/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 142c2170130be96ef43df958300352abd1ce58a0 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Wed, 15 Apr 2020 00:31:57 +0800 Subject: [PATCH 0277/1809] translating by lxbwolf --- ...200320 Build a private social network with a Raspberry Pi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200320 Build a private social network with a Raspberry Pi.md b/sources/tech/20200320 Build a private social network with a Raspberry Pi.md index 7917add925..f95096bff7 100644 --- a/sources/tech/20200320 Build a private social network with a Raspberry Pi.md +++ b/sources/tech/20200320 Build a private social network with a Raspberry Pi.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4472cd8902dc1f80253b29fc66c87a061b676f6d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Apr 2020 01:04:42 +0800 Subject: [PATCH 0278/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200415=20How?= =?UTF-8?q?=20to=20Open=20Files=20and=20Folders=20as=20Administrator=20in?= =?UTF-8?q?=20Nautilus=20File=20Manager=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md --- ...rator in Nautilus File Manager in Linux.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md diff --git a/sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md b/sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md new file mode 100644 index 0000000000..d8a9211b64 --- /dev/null +++ b/sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Open Files and Folders as Administrator in Nautilus File Manager in Linux) +[#]: via: (https://itsfoss.com/open-nautilus-as-administrator/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Open Files and Folders as Administrator in Nautilus File Manager in Linux +====== + +_**Learn to add an “Open as Administrator” option in the right click context menu in Nautilus file manager in Ubuntu and other Linux distributions.**_ + +If you want to open or edit a file as root, you can always do that in the terminal. I know a few people don’t feel too comfortable with the command line. + +The desktop Linux often provides ways to avoid the command line for terminal-fearing people. + +If you are in a situation where you have to access a folder as root or edit a file with root privilege, you can do that graphically in [Nautilus file manager][1]. + +A neat Nautilus hack allows you to open a files and folders as administrator i.e. root. Let me show you how. + +**Recommended Read:** + +![][2] + +#### [Root User in Ubuntu: Important Things You Should Know][3] + +Root user is essential to any Linux distribution. Learn why Ubuntu locks the root user and how can you use it in this Ubuntu beginner series. + +### Add ‘open as administrator’ option in right click context menu in Nautilus file manager + +_**A word of warning! Please don’t go around opening and editing random files as root as you might mess up with wrong files and end up with a broken system. Use it only in the cases where it is required.**_ + +I am showing the installation steps for Ubuntu. You can change it as per your distribution’s package manager. + +You’ll have to use terminal (even if you don’t like it) for installing the Nautilus plugin. Please [make sure that you have the universe repository enabled][4]: + +``` +sudo apt install nautilus-admin +``` + +Close and open Nautilus file manager again to see the changes in effect. + +![Right clock to see the “Open as Administrator” option][5] + +You can also edit files as root the same way. Just select the file, right click on it and choose the “Edit as Administrator” option. + +![Edit Files As Root Ubuntu][6] + +In both cases, you’ll be prompted to enter your account’s password: + +![You need to enter your password, of course][7] + +That’s pretty much it. You can enjoy the comfort of GUI. + +In case you don’t want to run Nautilus as root anymore, you can remove this plugin. It’s always good to remove additional things you installed but you don’t use anymore. + +In the terminal (yes, again), use the following command to remove the Nautilus plugin. + +``` +sudo apt remove nautilus-admin +``` + +By the way, if you are using [Ubuntu MATE][8], you can use caja-admin, instead of nautilus-admin. Other file managers may or may not provide such a feature. + +I hope you find this quick tip helpful. Questions and suggestions are always welcome. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/open-nautilus-as-administrator/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://wiki.gnome.org/Apps/Files +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/root_user_ubuntu.png?fit=800%2C450&ssl=1 +[3]: https://itsfoss.com/root-user-ubuntu/ +[4]: https://itsfoss.com/ubuntu-repositories/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/open-folder-as-administrator-ubuntu.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/edit-files-as-root-ubuntu.jpg?ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/authentication-pop-up-ubuntu.png?ssl=1 +[8]: https://ubuntu-mate.org/ From f8da93b28b5e58cc4cda59b87fb98eb68082c0e5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Apr 2020 01:37:22 +0800 Subject: [PATCH 0279/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200414=20How?= =?UTF-8?q?=20young=20people=20can=20help=20fight=20COVID-19=20with=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200414 How young people can help fight COVID-19 with code.md --- ...eople can help fight COVID-19 with code.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20200414 How young people can help fight COVID-19 with code.md diff --git a/sources/tech/20200414 How young people can help fight COVID-19 with code.md b/sources/tech/20200414 How young people can help fight COVID-19 with code.md new file mode 100644 index 0000000000..73705b5a62 --- /dev/null +++ b/sources/tech/20200414 How young people can help fight COVID-19 with code.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How young people can help fight COVID-19 with code) +[#]: via: (https://opensource.com/article/20/4/covid19-hackathon) +[#]: author: (Melissa Sasi https://opensource.com/users/mesassi) + +How young people can help fight COVID-19 with code +====== +Youth developers are invited to submit ideas by April 15 to counter the +educational, informational, social, and health challenges uncovered by +the COVID-19 pandemic. +![woman on laptop sitting at the window][1] + +More than 91% of students around the world are impacted by school closures due to COVID-19, and most governments have temporarily closed academic institutions. That's nearly [1.6 billion young people in 188 countries][2]. Also, most of the learning platforms available online today aren't practical, engaging, or interactive, and lack true virtual collaboration. + +This big and wicked challenge got me thinking about how these circumstances are impacting my children, their friends, and my passions of empowering youth, fostering tech entrepreneurship, and inspiring under-represented communities to find their purpose through building digital skills. These all came together in [CodeTheCurve][3], "a global, virtual hackathon for students, educators, teachers, and the research community to build tech skills, entrepreneurial spirit, and professional competencies to build digital creativity and cooperation to mobilize the world." + +We hope you'll want to participate, but you need to act fast: the deadline to submit proposals is April 15. + +### My story + +The passions mentioned above stem from a deeply personal journey: My children and I are victims of parental kidnapping, and access to the internet and digital literacy are my pathways to being a mother from afar. My children, Zahra (age 13), Zahran (15), and Youmna (18), are safe and healthy, and we are frequently connected. They're living the same life youth all over the world are living these days, trying to social distance and remain in good health while figuring out this school thing (or lack thereof)—only one of my children has access to formal virtual learning during to COVID-19 school closures. The other two, without school-driven online learning options, tend to stay up all night playing Fortnight and making TikTok videos. + +I have always been passionate about digital inclusion and empowering the world through computer science, and the effects of COVID-19 have increased my desire to make a difference. About four years ago, I created a non-profit organization, [MentorNations][4], to inspire youth and the world via technology. My non-profit has taught tens of thousands of young people in 12 countries to code. In my work at IBM as a developer advocate, I focus on empowering early-stage entrepreneurs, developers, and students with access to tech skills, professional development, and entrepreneurial thinking. My major focus areas include inspiring students to discover their career potential in enterprise computing while recognizing that we are all ANDs and not ORs. + +Teaching the next generation about the power of collaboration, teamwork, problem-solving, and critical thinking that happen through open source code and principles empowers them to be creators and innovators who focus on solving relevant and real-world problems. + +Looking through the lens of my children, my non-profit work, my roles within a variety of United Nations Task Forces, and my position as IEEE Chair over the Digital Skills Working Group, I wondered, _**what can I do to make a difference with open source technology?**_ So I reached out to my network, and the world responded in a much bigger way than I had ever imagined. + +### CodeTheCurve + +In response, we launched UNESCO's [CodeTheCurve][3] hackathon in collaboration with 14 partners, including UN EQUALS, SAP, iHackOnline, Angel Hack, Internet Society, and YPO. Participants are invited to bring their open source ideas to combat the current and future environment and challenges relating to COVID-19. This initiative is centered around youth empowerment, gender inclusion, and making the world a better place for our communities, including for people we may not directly encounter daily. + +CodeTheCurve is for anyone above the age of 16. To ensure gender, age, and experience diversity, teams must include a developer or data scientist (early-stage chops are fine); at least one person under the age of 25; and at least one male and one female. The 40 teams selected to participate in CodeTheCurve will have access to more than 80 business and technical mentors (experts!) from around the world to help turn their ideas into reality. + +My vision for this hackathon is to train young talent; enable them with free, online resources and access to real people with real answers; and encourage the creation of real-world problem solving in real-time. The results of the hackathon, I hope, will be open source utilities and information that can be used, in some way, to combat COVID-19. + +#### Week-long learning, bootcamp, and hacking experience + +CodeTheCurve is a three-day virtual hackathon experience guided by expert business and technical mentors. Before the hackathon proper, participants begin with two days of self-paced, online learning from content curated by CodeTheCurve collaborators, followed by a two-day, instructor-led learning journey where the 40 selected teams will collaborate in virtual breakout rooms with activity kits, hands-on computing resources in machine learning, and expert-guided plenary sessions. + +#### CodeTheCurve hackathon themes + +CodeTheCurve includes three themes: + + * Education + * Information and data management + * Current and post-COVID-19 health and social issues + + + +#### Professional development, entrepreneurship, and hands-on open source skills + +The 40 teams will be empowered with expert-guided, engaging activities, including the following skill-building opportunities: + + * **Hand-on tech skills** + * Using Jupyter Notebooks for data science + * Data protection, privacy, security, and encryption + * Machine learning and artificial intelligence + * Architectural diagrams and frameworks + * Technical roadmaps + * **Professional development** + * Design thinking + * Personal branding + * Communication skills + * How not to feel like an imposter + * Conflict resolution + * Working in global, virtual teams + * Media literacy + * Ethics in machine learning and artificial intelligence + * **Entrepreneurship** + * Problem statements + * Mission and vision statements + * Value propositions + * Audience and target markets + * Business model canvassing + * Pitch decks + * Pitch practice + + + +### April 15: CodeTheCurve deadline + +Did I mention that the initial application deadline is April 15? Here's the full timeline: + + * Video submission deadline: **April 15** + * 40 selected teams announced: **April 20** + * Learning resources for pre-collaboration: **April 20-21** + * Instructor-led learning: **April 22-23** + * Hacking: **April 24-26** + * CodeTheCurve winners announced: **April 30** + + + +#### Prizes. Prizes. Prizes. + +Prizes include free access to [IBM LinuxONE Community Cloud][5] for one year, free training courses from SAP, four pitch opportunities at IBM and SAP events, free access to enterprise-grade IBM Z and its machine learning suite for six months, and one-on-one technical and business mentorship for a full year with industry experts. + +### How to apply + +Interested in applying? Know someone who should apply? Simply [submit a video][6] of your **amazing** open source idea, the problem you're trying to solve, and who you expect to reach. + +If you'd like to learn more, here are some other articles about CodeTheCurve: + + * [UN News CodeTheCurve article][7] + * [UNESCO CodeTheCurve blog][8] + * [Forbes CodeTheCurve article][9] + * [IBM CodeTheCurve blog][10] + + + +I cannot wait to see all the amazing open source ideas the world brings our way! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/covid19-hackathon + +作者:[Melissa Sasi][a] +选题:[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/mesassi +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: https://en.unesco.org/covid19/educationresponse +[3]: https://www.codethecurve.org/ +[4]: https://mentornations.org/ +[5]: https://developer.ibm.com/linuxone/ +[6]: http://ibm.biz/codethecurve-apply +[7]: https://news.un.org/en/story/2020/04/1061142 +[8]: http://ibm.biz/unesco-pr +[9]: https://www.forbes.com/sites/danielnewman/2020/04/10/digital-transformation-for-good-shines-as-we-fight-covid-19/#78d51a4c4946 +[10]: http://ibm.biz/codethecurve From 364dcaf390904a1740967f8bccfd8cca56c5d7ac Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Apr 2020 01:38:00 +0800 Subject: [PATCH 0280/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200414=20How?= =?UTF-8?q?=20I=20containerize=20a=20build=20system?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200414 How I containerize a build system.md --- ...00414 How I containerize a build system.md | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 sources/tech/20200414 How I containerize a build system.md diff --git a/sources/tech/20200414 How I containerize a build system.md b/sources/tech/20200414 How I containerize a build system.md new file mode 100644 index 0000000000..b45168c55f --- /dev/null +++ b/sources/tech/20200414 How I containerize a build system.md @@ -0,0 +1,166 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I containerize a build system) +[#]: via: (https://opensource.com/article/20/4/how-containerize-build-system) +[#]: author: (Ravi Chandran https://opensource.com/users/ravichandran) + +How I containerize a build system +====== +Building a repeatable structure to deliver applications as containers +can be complicated. Here is one way to do it effectively. +![Containers on a ship on the ocean][1] + +A build system is comprised of the tools and processes used to transition from source code to a running application. This transition also involves changing the code's audience from the software developer to the end user, whether the end user is a colleague in operations or a deployment system. + +After creating a few build systems using containers, I think I have a decent, repeatable approach that's worth sharing. These build systems were used for generating loadable software images for embedded hardware and compiling machine learning algorithms, but the approach is abstract enough to be used in any container-based build system. + +This approach is about creating or organizing the build system in a way that makes it easy to use and maintain. It's not about the tricks needed to deal with containerizing any particular software compilers or tools. It applies to the common use case of software developers building software to hand off a maintainable image to other technical users (whether they are sysadmins, DevOps engineers, or some other title). The build system is abstracted away from the end users so that they can focus on the software. + +### Why containerize a build system? + +Creating a repeatable, container-based build system can provide a number of benefits to a software team: + + * **Focus:** I want to focus on writing my application. When I call a tool to "build," I want the toolset to deliver a ready-to-use binary. I don't want to spend time troubleshooting the build system. In fact, I'd rather not know or care about the build system. + * **Identical build behavior:** Whatever the use case, I want to ensure that the entire team uses the same versions of the toolset and gets the same results when building. Otherwise, I am constantly dealing with the case of "it works on my PC but not yours." Using the same toolset version and getting identical output for a given input source file set is critical in a team project. + * **Easy setup and future migration:** Even if a detailed set of instructions is given to everyone to install a toolset for a project, chances are someone will get it wrong. Or there could be issues due to how each person has customized their Linux environment. This can be further compounded by the use of different Linux distributions across the team (or other operating systems). The issues can get uglier quickly when it comes time for moving to the next version of the toolset. Using containers and the guidelines in this article will make migration to newer versions much easier. + + + +Containerizing the build systems that I use on my projects has certainly been valuable in my experience, as it has alleviated the problems above. I tend to use Docker for my container tooling, but there can still be issues due to the installation and network configuration being unique environment to environment, especially if you work in a corporate environment involving some complex proxy settings. But at least now I have fewer build system problems to deal with. + +### Walking through a containerized build system + +I created a [tutorial repository][2] you can clone and examine at a later time or follow along through this article. I'll be walking through all the files in the repository. The build system is deliberately trivial (it runs **gcc**) to keep the focus on the build system architecture. + +### Build system requirements + +Two key aspects that I think are desirable in a build system are: + + * **Standard build invocation:** I want to be able to build code by pointing to some work directory whose path is **/path/to/workdir**. I want to invoke the build as: [code]`./build.sh /path/to/workdir`[/code] To keep the example architecture simple (for the sake of explanation), I'll assume that the output is also generated somewhere within **/path/to/workdir**. (Otherwise, it would increase the number of volumes exposed to the container, which is not difficult, but more cumbersome to explain.) + * **Custom build invocation via shell:** Sometimes, the toolset needs to be used in unforeseen ways. In addition to the standard **build.sh** to invoke the toolset, some of these could be added as options to **build.sh**, if needed. But I always want to be able to get to a shell where I can invoke toolset commands directly. In this trivial example, say I sometimes want to try out different **gcc** optimization options to see the effects. To achieve this, I want to invoke: [code]`./shell.sh /path/to/workdir`[/code] This should get me to a Bash shell inside the container with access to the toolset and to my **workdir**, so I can experiment as I please with the toolset. + + + +### Build system architecture + +To comply with the basic requirements above, here is how I architect the build system: + +![Container build system architecture][3] + +At the bottom, the **workdir** represents any software source code that needs to be built by the software developer end users. Typically, this **workdir** will be a source-code repository. The end users can manipulate this source code repository in any way they want before invoking a build. For example, if they're using **git** for version control, they could **git checkout** the feature branch they are working on and add or modify files. This keeps the build system independent of the **workdir**. + +The three blocks at the top collectively represent the containerized build system. The left-most (yellow) block at the top represents the scripts (**build.sh** and **shell.sh**) that the end user will use to interact with the build system. + +In the middle (the red block) is the Dockerfile and the associated script **build_docker_image.sh**. The development operations people (me, in this case) will typically execute this script and generate the container image. (In fact, I'll execute this many, many times until I get everything working right, but that's another story.) And then I would distribute the image to the end users, such as through a container trusted registry. The end users will need this image. In addition, they will clone the build system repository (i.e., one that is equivalent to the [tutorial repository][2]). + +The **run_build.sh** script on the right is executed inside the container when the end user invokes either **build.sh** or **shell.sh**. I'll explain these scripts in detail next. The key here is that the end user does not need to know anything about the red or blue blocks or how a container works in order to use any of this. + +### Build system details + +The tutorial repository's file structure maps to this architecture. I've used this prototype structure for relatively complex build systems, so its simplicity is not a limitation in any way. Below, I've listed the tree structure of the relevant files from the repository. The **dockerize-tutorial** folder could be replaced with any other name corresponding to a build system. From within this folder, I invoke either **build.sh** or **shell.sh** with the one argument that is the path to the **workdir**. + + +``` +dockerize-tutorial/ +├── build.sh +├── shell.sh +└── swbuilder +    ├── build_docker_image.sh +    ├── install_swbuilder.dockerfile +    └── scripts +        └── run_build.sh +``` + +Note that I've deliberately excluded the **example_workdir** above, which you'll find in the tutorial repository. Actual source code would typically reside in a separate repository and not be part of the build tool repository; I included it in this repository, so I didn't have to deal with two repositories in the tutorial. + +Doing the tutorial is not necessary if you're only interested in the concepts, as I'll explain all the files. But if you want to follow along (and have Docker installed), first build the container image **swbuilder:v1** with: + + +``` +cd dockerize-tutorial/swbuilder/ +./build_docker_image.sh +docker image ls  # resulting image will be swbuilder:v1 +``` + +Then invoke **build.sh** as: + + +``` +cd dockerize-tutorial +./build.sh ~/repos/dockerize-tutorial/example_workdir +``` + +The code for [build.sh][4] is below. This script instantiates a container from the container image **swbuilder:v1**. It performs two volume mappings: one from the **example_workdir** folder to a volume inside the container at path **/workdir**, and the second from **dockerize-tutorial/swbuilder/scripts** outside the container to **/scripts** inside the container. + + +``` +docker container run                              \ +    --volume $(pwd)/swbuilder/scripts:/scripts    \ +    --volume $1:/workdir                          \ +    --user $(id -u ${USER}):$(id -g ${USER})      \ +    --rm -it --name build_swbuilder swbuilder:v1  \ +    build +``` + +In addition, the **build.sh** also invokes the container to run with your username (and group, which the tutorial assumes to be the same) so that you will not have issues with file permissions when accessing the generated build output. + +Note that [**shell.sh**][5] is identical except for two things: **build.sh** creates a container named **build_swbuilder** while **shell.sh** creates one named **shell_swbuilder**. This is so that there are no conflicts if either script is invoked while the other one is running. + +The other key difference between the two scripts is the last argument: **build.sh** passes in the argument **build** while **shell.sh** passes in the argument **shell**. If you look at the [Dockerfile][6] that is used to create the container image, the last line contains the following **ENTRYPOINT**. This means that the **docker container run** invocation above will result in executing the **run_build.sh** script with either **build** or **shell** as the sole input argument. + + +``` +# run bash script and process the input command +ENTRYPOINT [ "/bin/bash", "/scripts/run_build.sh"] +``` + +[**run_build.sh**][7] uses this input argument to either start the Bash shell or invoke **gcc** to perform the build of the trivial **helloworld.c** project. A real build system would typically invoke a Makefile and not run **gcc** directly. + + +``` +cd /workdir + +if [ $1 = "shell" ]; then     +    echo "Starting Bash Shell" +    /bin/bash +elif [ $1 = "build" ]; then +    echo "Performing SW Build" +    gcc helloworld.c -o helloworld -Wall +fi +``` + +You could certainly pass more than one argument if your use case demands it. For the build systems I've dealt with, the build is usually for a given project with a specific **make** invocation. In the case of a build system where the build invocation is complex, you can have **run_build.sh** call a specific script inside **workdir** that the end user has to write. + +### A note about the scripts folder + +You may be wondering why the **scripts** folder is located deep in the tree structure rather than at the top level of the repository. Either approach would work, but I didn't want to encourage the end user to poke around and change things there. Placing it deeper is a way to make it more difficult to poke around. Also, I could have added a **.dockerignore** file to ignore the **scripts** folder, as it doesn't need to be part of the container context. But since it's tiny, I didn't bother. + +### Simple yet flexible + +While the approach is simple, I've used it for a few rather different build systems and found it to be quite flexible. The aspects that are going to be relatively stable (e.g., a given toolset that changes only a few times a year) are fixed inside the container image. The aspects that are more fluid are kept outside the container image as scripts. This allows me to easily modify how the toolset is invoked by updating the script and pushing the changes to the build system repository. All the user needs to do is to pull the changes to their local build system repository, which is typically quite fast (unlike updating a Docker image). The structure lends itself to having as many volumes and scripts as are needed while abstracting the complexity away from the end user. + +How will you need to modify your application to optimize it for a containerized environment? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/how-containerize-build-system + +作者:[Ravi Chandran][a] +选题:[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/ravichandran +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_2015-3-osdc-lead.png?itok=O6aivM_W (Containers on a ship on the ocean) +[2]: https://github.com/ravi-chandran/dockerize-tutorial +[3]: https://opensource.com/sites/default/files/uploads/build_sys_arch.jpg (Container build system architecture) +[4]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/build.sh +[5]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/shell.sh +[6]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/swbuilder/install_swbuilder.dockerfile +[7]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/swbuilder/scripts/run_build.sh From cc791915cc223b21e5739fa545ee6ae90ce293b8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Apr 2020 01:38:31 +0800 Subject: [PATCH 0281/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200414=20Try?= =?UTF-8?q?=20this=20Kubernetes=20HTTP=20router=20and=20reverse=20proxy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200414 Try this Kubernetes HTTP router and reverse proxy.md --- ...ubernetes HTTP router and reverse proxy.md | 196 ++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 sources/tech/20200414 Try this Kubernetes HTTP router and reverse proxy.md diff --git a/sources/tech/20200414 Try this Kubernetes HTTP router and reverse proxy.md b/sources/tech/20200414 Try this Kubernetes HTTP router and reverse proxy.md new file mode 100644 index 0000000000..fc78ee9bce --- /dev/null +++ b/sources/tech/20200414 Try this Kubernetes HTTP router and reverse proxy.md @@ -0,0 +1,196 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Try this Kubernetes HTTP router and reverse proxy) +[#]: via: (https://opensource.com/article/20/4/http-kubernetes-skipper) +[#]: author: (Sandor Szücs https://opensource.com/users/sszuecs) + +Try this Kubernetes HTTP router and reverse proxy +====== +Skipper is designed to handle large numbers of HTTP route definitions, +beyond what you would want to manage in Nginx or Apache. +![Traffic circle with arrows pointing which way to go][1] + +Skipper is an open source HTTP router and reverse proxy for service composition. As its [GitHub page][2] states, it's designed to handle large amounts of dynamically configured HTTP route definitions (>600,000 routes) with detailed lookup conditions and flexible augmentation of the request flow with filters. It can be used out of the box or extended with custom lookup, filter logic, and configuration sources. + +### Proxies + +When some people think of a proxy, they imagine a webpage that serves as a gateway to an intranet or a suspicious-looking webpage designed to unblock social media sites on a school or work network. A forward proxy is one that operators of desktop infrastructure use to save internet bandwidth, enforce parental controls, or limit social media access. Another kind of proxy is one in which an individual user navigates to a page, provides credentials, and is then forwarded to a protected intranet resource. The inverse of that kind of proxy is the reverse proxy, which accepts all traffic and forwards it to a specific resource, like a server or container. That's the kind of work Skipper does for infrastructure. + +When I read [Matt Klein's post][3] on modern network load balancing and proxying, I realized that we, as [Skipper][4] maintainers, should explain more features and details about why and how you can leverage HTTP proxies. In this article, I will treat the terminology "HTTP (reverse) proxy" and "HTTP router" as the same. + +### HTTP routing + +According to [Wikipedia][5]: "Routing is the process of selecting a path for traffic in a network." This definition refers to routing at [OSI layer 3][6], most commonly based on [IP][7] with routing protocols like [BGP][8] or [OSPF][9]. Since this article isn't about one of those, I will try to explain what HTTP routers are about. But first, I want to introduce Skipper, an [OSI layer 7][10] HTTP router library written in [Go][11] and a core component of retailer [Zalando][12]'s e-commerce shop and the [Kubernetes][13] Ingress infrastructure. + +At Zalando, we use Skipper as a [Kubernetes Ingress][14] controller to support our users with visibility, reliability, security, and additional features to offload common applications. + +Any organization running HTTP services, often in a microservice architecture, needs to route HTTP requests to the right applications. HTTP routers route based on information provided by the HTTP request. For example, the following shows an HTTP/1.1 request. + + +``` +GET /details HTTP/1.1 +Host: [www.zalando.de][15] +User-Agent: curl/7.49.0 +Accept: */* +Authorization: Bearer <token> +... +``` + +We can route based on the method **GET**, the path **/details**, the **Host** header [**www.zalando.de**][16], or any arbitrary part of the request. + +One common problem an application owner faces is splitting an API into multiple applications, so you need to split the responsibility of a component into subcomponents. Another common task is to support refactoring; maybe you have rewritten one part of your app, and you want to deploy it separately now. + +For example, imagine you you have a store that has a list of products and their details, and you need to split it into _shop_ and _product_ backend applications. At **/**, your shop shows the list of products, and at **/details**, it shows product details, such as color, size, sustainability, and price. + +![Figure 1: shop][17] + +You need to split the responsibility of the product detail into its own application, such that **/** stays in the _shop_ application and **/details** is refactored to the _product_ application. + +![Figure 2: product and shop][18] + +To make sure an HTTP proxy finds the right backend for an incoming request, it uses a routing table to check the destination to make sure it's correct. + +### Routing tables + +In Skipper, the routing table is created by pulling information generated by [dataclients][19] from different sources. One source can be a [routes file][20], similar to what you may see in more popular HTTP servers, like Apache or Nginx. + +Depending on the size of your organization—or better, the number of backend applications—the routing table can grow quite large. Skipper implements the routing table as a tree that can scale beyond 600,000 routes (far more than you'd want to manage in an Nginx or Apache config). + +Following along with the example application above, Table 1 shows the routing table from [Figure 2][21]. The store **/** should be routed to **shop,** and the **/detail** routed to the **product** application. + +path | app +---|--- +/ | shop +/detail | product + +Table 1: Routing table + +The available dataclients in Skipper fetch routes from different sources and what a route consists of. + +### Dataclient + +The routing configuration in Skipper's routes file [dataclient][22] is similar to what you might know from HTTP proxies in Nginx or Apache. In Skipper, a routes file specifies all routes in [eskip][23] syntax, as shown in Figure 3. + + +``` +r1: P1() && P2() && .. && PN() +    -> f1() +    -> f2() +    ... +    -> fN() +    -> <backend>; +r2: ... +... +``` + +Figure 3: Routes file in eskip + +In the above: + + * **r1, r2, ...** are unique routeIDs. + * **P1, P2,..,PN** are predicates that define the matching. + * **f1, f2,..,fN** are filters that are applied after the route was selected. Filters can change the request and response. + * Finally, the Skipper backend is defined. This can be a single URL, a list of load-balanced URLs, and others for special cases such as [direct response][24]. + + + +The [routes string][25] is another dataclient that is handy for tests. For example, if you need a pseudo backend for your demo that replies a green background with HTML, you could use: + + +``` +$ skipper -routes-string='* +-> inlineContent( +      "<html><body style=\"background-color: green;\"></body></html>" +   )' +``` + +Skipper's most popular dataclient, by far, is the Kubernetes dataclient, which is used to fetch information from a [Kubernetes API server][26] and create a routing table from [Skipper Ingress][27] resources and the [RouteGroup][28] custom resource definition (CRD). + +To summarize the above, dataclients fetch information from different providers to build Skipper's routing table. Table 1 shows a routing table for the shop/description example, and Skipper uses predicates to select the route to process the request. + +### Predicates + +In Skipper, an incoming request is matched to [predicates][29] of all the routes to find the best matching route for an incoming request. Predicates are functions that match based on the incoming request. In the example from Figure 2 and Table 1, Skipper would have a routing table similar to Figure 4: + + +``` +shop: Path("/") +    -> ""; +product: Path("/detail") +    -> ""; +``` + +Figure 4: Skipper routing table + +This means HTTP requests with a path **/** would be matched by the **Path("/")** predicate, such that Skipper will execute the shop route. Requests with a path **/detail** would be matched by **Path("/detail")** and routed to the product application. + +In general, routing behavior can be changed by predicates. There are a lot of predicates you can choose from. For example, **Method("POST")** will be true only if a POST request would be passed. A route with more predicates is considered more specific. Also, a route with more predicates has more weight in the route selection than one that has less. + +Special cases are **Path()** and **PathSubtree()**, which is matched first in a tree and reduces the number of routes, which are scanned as a list. For example, the tree structure shown in Figure 5 helps to scale the number of routes to more than 600,000 in one of Zalando's production setups. + +![Skipper tree example][30] + +### Filters + +After a route is selected, the request [filters][31] are applied. Filters work on request or response; they can change the incoming request to the backend, and they can change the response to the client. + +For example, **setRequestHeader("Foo", "bar")** sets the HTTP header **"Foo"** to the value **"bar"**, such that the backend sees this header in the request. + +The response filter **responseCookie("keks", "val", 3600)** sets a Cookie named **"keks"** in the response to the caller, which might be a browser in this case. The cookie would have the value **"val"** and is valid for one hour. + +One filter that works on request and response is **enableAccessLog(40, 5)**. This would do access logs for all responses from the backend with status codes 40x or 5xx. + +As you can see from the examples, filters can change the request or the response or just do some work based on it. Another filter example is **auth filters** or **ratelimits**. These would stop requests from passing to the backend if the request should not be allowed to pass. For example, to serve static content from a directory called **/var/www**, you can use the filter **static("/var/www")**. + +### Learn more + +This article provided a basic overview of Skipper and its capabilities. For more information, consult [Skipper's documentation][32], and please share your questions or feedback in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/http-kubernetes-skipper + +作者:[Sandor Szücs][a] +选题:[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/sszuecs +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LAW-patent_reform_520x292_10136657_1012_dc.png?itok=Cd2PmDWf (Traffic circle with arrows pointing which way to go) +[2]: https://github.com/zalando/skipper +[3]: https://blog.envoyproxy.io/introduction-to-modern-network-load-balancing-and-proxying-a57f6ff80236 +[4]: https://opensource.zalando.com/skipper +[5]: https://en.wikipedia.org/wiki/Routing +[6]: https://en.wikipedia.org/wiki/OSI_model#Layer_3:_Network_Layer +[7]: https://en.wikipedia.org/wiki/Internet_Protocol +[8]: https://en.wikipedia.org/wiki/Border_Gateway_Protocol +[9]: https://en.wikipedia.org/wiki/Open_Shortest_Path_First +[10]: https://en.wikipedia.org/wiki/OSI_model#Layer_7:_Application_Layer +[11]: https://golang.org/ +[12]: https://en.zalando.de/ +[13]: https://kubernetes.io +[14]: https://kubernetes.io/docs/concepts/services-networking/ingress/ +[15]: http://www.zalando.de +[16]: https://en.zalando.de/?_rfl=de +[17]: https://opensource.com/sites/default/files/uploads/skipper_1_shop.png (Figure 1: shop) +[18]: https://opensource.com/sites/default/files/uploads/skipper_2_product-shop.png (Figure 2: product and shop) +[19]: https://opensource.zalando.com/skipper/reference/backends/ +[20]: https://opensource.zalando.com/skipper/data-clients/eskip-file/ +[21]: tmp.ftM58r5YpM#fig2 +[22]: https://opensource.zalando.com/skipper/tutorials/development/#dataclients +[23]: https://godoc.org/github.com/zalando/skipper/eskip +[24]: https://opensource.zalando.com/skipper/reference/backends/#shunt-backend +[25]: https://opensource.zalando.com/skipper/data-clients/route-string/ +[26]: https://kubernetes.io/docs/concepts/overview/components/#kube-apiserver +[27]: https://opensource.zalando.com/skipper/kubernetes/ingress-usage/ +[28]: https://opensource.zalando.com/skipper/kubernetes/routegroups/ +[29]: https://opensource.zalando.com/skipper/reference/predicates/ +[30]: https://opensource.com/sites/default/files/uploads/skipper_5_tree.png (Skipper tree example) +[31]: https://opensource.zalando.com/skipper/reference/filters/ +[32]: https://opensource.zalando.com/skipper/ From c3832709e6919eb7614a12418849cc7b0dbf36f8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Apr 2020 01:39:12 +0800 Subject: [PATCH 0282/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200414=20How?= =?UTF-8?q?=20World=20of=20Warcraft=20introduced=20me=20to=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200414 How World of Warcraft introduced me to Linux.md --- ...orld of Warcraft introduced me to Linux.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/tech/20200414 How World of Warcraft introduced me to Linux.md diff --git a/sources/tech/20200414 How World of Warcraft introduced me to Linux.md b/sources/tech/20200414 How World of Warcraft introduced me to Linux.md new file mode 100644 index 0000000000..b1836ccb43 --- /dev/null +++ b/sources/tech/20200414 How World of Warcraft introduced me to Linux.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How World of Warcraft introduced me to Linux) +[#]: via: (https://opensource.com/article/20/4/wow-linux) +[#]: author: (Luke Rawlins, RHCE https://opensource.com/users/sudoluke) + +How World of Warcraft introduced me to Linux +====== +One Linux sysadmin traces his journey from video-gaming car mechanic to +a new career in IT. +![Gaming with penguin pawns][1] + +The story behind my career with [Linux][2] is a bit unusual. It starts back in 2005; I was working as an auto mechanic at a Nissan dealership in Toledo, Ohio. I had never used a computer for anything other than checking email, browsing the web, and playing World of Warcraft. + +I had never heard of Linux, I didn't know the term "open source," I probably couldn't even have walked you through how to copy a file from one place to another, and I certainly never thought that I would eventually find myself working in IT or running a website. + +### The "Blue Screen of Death" that changed my life + +I mentioned that I liked to play World of Warcraft (I still do, you can find me on my Mage "Elodinn—Twisting Nether" most of the time). This game was a huge hit in the early 2000s, and it consumed an enormous amount of my time (truth be told, probably a little too much of my time). + +You can imagine my horror one evening when I boot up my PC to be greeted by a blue screen with lots of cryptic messages, including "A problem has been detected…" Hmm weird, maybe I'll just unplug it and plug it back in—that works around the shop sometimes. No such luck, the same message comes up. Over and over, to no avail. + +### How do you fix this? + +So I called a friend and explained the problem. [Big blue screen][3]. Lots of little white letters. I'm going to miss the raid! + +He wasn't sure but said something about drivers, or maybe a hardware problem. I ended up calling around to a few computer repair shops to see if they could fix it. They all said the same thing after I read the message on the screen, and explained the problem to them. "I really can't be sure over the phone, but it sounds like the motherboard is bad. It's going to be $95 for diagnostics and I should be able to get it back to you in about a week." + +There was no way I was going to pay $95 for a diagnostic on an old crappy computer just to be told that either I needed a new one, or that the repair was going to be even more money on top of the diagnostic fee. So I thought to myself, if I can fix a car, then I can definitely fix this little computer. It was broken anyway; what was the worst that could happen? I end up breaking it more and need a new one? I was already in that situation. + +So I spent the next couple of days at work doing some research on computer parts, in between cars. I found out that replacing the motherboard meant that I was probably going to need a new processor. I found a motherboard/processor combo on Newegg for a decent price that I was fairly confident would work on my computer. Great! + +I ordered the parts, and a few days later, after printing out a few instructions, I had swapped out the motherboard and replaced it with my new hardware from Newegg. I was incredibly proud of my new found skills and naturally assumed that I was some kind of elite hacker. That is, until I started the computer up. + +I don't know if you know this, but Windows XP didn't like it when you replaced a lot of parts in your computer. I didn't know it at the time either, but now I had spent probably $150 because I didn't want to pay $95 for a diagnostic, and my computer was still broken. + +### The deep dark web has all the answers + +The next day, once again, I'm using all my breaks to research what went wrong. Pretty quickly I realized that my problem was tied to the fact that I needed a new Windows license. I also realized that there was no way I was going to purchase the software. I'd get a new computer before I purchased a new Windows license. But I wasn't quite ready to give up yet. + +One click leads to another, and I end up on a computer repair forum with someone complaining about a similar problem. All the replies are basically the same—buy a Windows license or buy a new PC—but one. Near the bottom of the forum, some unknown hero of the internet says, "You can always give Ubuntu a try." and leaves it at that. + +"What's Ubuntu?" I said to myself, "and how on earth do you even pronounce that word?" + +Anyway, after some more intensive searching, I found out that Ubuntu is a free operating system that is widely considered to be one of the most user-friendly Linux distributions (whatever that is) that you can get. What's more, I found a book that included an installation CD available at the Barnes and Noble bookstore that I passed on my way home from work. Why not give Ubuntu a try? After all, the computer was already broken, and the book was only $18.99. + +### This story is already too long + +I wish I still had that book. I think I sold it with a box full of old books at a garage sale when we moved a few years ago. I wanted to share my Linux story because it's different than many of the other stories I read about. I was not a college graduate at the time, I didn't learn to code as a child, and I am not an exceptionally intelligent person. I was, at best, an average student, a recently separated Marine, and I assumed that fixing computers couldn't be much different from fixing cars. At the end of the day, you're still just swapping out different parts, right? Different tools, different parts, same job—no problem. + +Along the way I ran into a lot of problems, the first one was the discovery that after all that work, I still couldn't play World of Warcraft. Eventually, I discovered WineHQ and Open Office, and all the incredible things that have come out of the open-source world. That mysterious blue screen and my World of Warcraft obsession redirected the course of my entire working life, for the better. That's an odd thing to admit, but it's probably true. + +### How does the story end? + +Well, it's not over, and I still have a lot to learn. After some frustrating trial and error, I did eventually learn how to install World of Warcraft using Wine. I missed a few weeks in the game, but I didn't lose my raid spot in the guild, and all things considered, I was no worse for the wear. At the time, I was playing a Druid, and everyone always had room for a healer when it came time to battle Ragnaros, the Fire Lord! + +Up to this point, however, my little computer repair project has turned into a wonderful career as a Linux systems administrator, a bachelor's degree, a whole bunch of IT certifications, including the Red Hat Certified Engineer certification, and a [blog][4] that I use as my way of giving back to the community that has given me so much. + +So, if you are like me, a person who is at best moderately intelligent, persistent, incredibly cheap, and not afraid to break a few things, go ahead and try out Linux the next time your computer breaks. + +I'm excited. I mean really excited. Excited to the point that I can hardly think. I'm talking six-... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/wow-linux + +作者:[Luke Rawlins, RHCE][a] +选题:[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/sudoluke +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gaming_grid_penguin.png?itok=7Fv83mHR (Gaming with penguin pawns) +[2]: https://opensource.com/resources/linux +[3]: https://en.wikipedia.org/wiki/Blue_screen_of_death +[4]: https://sudoedit.com From f5ec3a7fd37bbb7f6ad44d4af316101f1aa6e8a8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Apr 2020 01:40:16 +0800 Subject: [PATCH 0283/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200413=209=20?= =?UTF-8?q?open=20source=20CSS=20frameworks=20for=20frontend=20web=20devel?= =?UTF-8?q?opment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200413 9 open source CSS frameworks for frontend web development.md --- ...frameworks for frontend web development.md | 254 ++++++++++++++++++ 1 file changed, 254 insertions(+) create mode 100644 sources/tech/20200413 9 open source CSS frameworks for frontend web development.md diff --git a/sources/tech/20200413 9 open source CSS frameworks for frontend web development.md b/sources/tech/20200413 9 open source CSS frameworks for frontend web development.md new file mode 100644 index 0000000000..0d2bd7ddc1 --- /dev/null +++ b/sources/tech/20200413 9 open source CSS frameworks for frontend web development.md @@ -0,0 +1,254 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 open source CSS frameworks for frontend web development) +[#]: via: (https://opensource.com/article/20/4/open-source-css-frameworks) +[#]: author: (Bryant Son https://opensource.com/users/brson) + +9 open source CSS frameworks for frontend web development +====== +Explore open source CSS frameworks and find the right one for your +project. +![Digital creative of a browser on the internet][1] + +When most people think about web development, HTML or JavaScript usually come to mind. They usually forget about the technology that has far more impact on the ability to enjoy a website: [cascading style sheets (CSS)][2]. CSS is both one of the most important and the most often forgotten parts of any webpage, even though it's one of the three cornerstone technologies of the World Wide Web, according to Wikipedia. + +This article explores nine popular, powerful, and open source frameworks that make CSS development straightforward for building beautiful website frontends. + +Name | What It Is | License +---|---|--- +[Bootstrap][3] | The most popular CSS framework; by Twitter | MIT +[PatternFly][4] | Open source framework; by Red Hat | MIT +[Material Components for the web][5] | Open source framework; by Google | MIT +[Pure][6] | Open source framework; by Yahoo | BSD +[Foundation][7] | Frontend framework; by Zurb Foundation | MIT +[Bulma][8] | Modern CSS framework based on Flexbox | MIT +[Skeleton][9] | Lightweight CSS framework | MIT +[Materialize][10] | CSS framework based on Material Design | MIT +[Bootflat][11] | Open source Flat UI kit based on Bootstrap 3.3.0 | MIT + +  + +If you prefer to follow along as I explore this live, you can watch my video. + +### Bootstrap + +[Bootstrap][12] is easily the most popular CSS framework, and it is the one that started all frontend web design. Developed by Twitter, Bootstrap offers usability, functionality, and extensibility. + +![Bootstrap homepage][13] + +Bootstrap also offers plenty of [examples][14] to get you started. + +![Bootstrap examples][15] + +With Bootstrap, you can stitch together different components and layouts to create an interesting page design. It also offers plenty of detailed documentation. + +![Bootstrap documentation][16] + +Bootstrap's [GitHub][3] repository lists more than 19,000 commits and 1,100 contributors. It is based on the MIT License, so (as with all of the frameworks on this list) you can jump in and contribute as well. + +![Bootstrap GitHub][17] + +### PatternFly + +[PatternFly][18] is an open source (under the MIT License) CSS framework by Red Hat. PatternFly takes a different approach than Bootstrap: While Bootstrap is meant for anyone interested in creating a beautiful website, PatternFly is primarily focused on enterprise application developers and provides components, such as bars, charts, and navigations, that are very appealing for creating powerful, metrics-driven dashboards. In fact, Red Hat uses this CSS framework for the design of its products, such as OpenShift. + +![PatternFly homepage][19] + +In addition to static HTML, PatternFly also supports the ReactJS framework, a popular JavaScript framework developed by Facebook. + +![PatternFly ReactJS support][20] + +PatternFly has many advanced components, such as bars, charts, [modals][21], and layouts, that are suitable for enterprise-level applications. + +![PatternFly chart component][22] + +PatternFly's [GitHub][4] page lists more than 1,050 commits and 44 contributors. PatternFly is getting a lot of attention, and you are more than welcome to contribute. + +![PatternFly GitHub][23] + +### Material Components for the web + +With its highly successful Android platform, Google set its own standard design guidelines with a concept called [Material Design][24]. The Material Design standards are intended to be reflected across all Google products, and they are also available to the general public and open source under the MIT License. + +![Material Design homepage][25] + +Material Design has a number of [Components][26], "interactive building blocks for creating a user interface." These buttons, cards, backdrops, and more can be used to create any type of user interface for a website or mobile application. + +![Material Components webpage][27] + +The maintainers provide thorough documentation for different platforms. + +![Material Design documentation][28] + +There are also step-by-step tutorials with exercises for accomplishing different goals. + +![Material Design tutorial][29] + +The Material Components GitHub page hosts repos for different platforms, including [Material Components for the web (MDC Web)][5] for website development. MDC Web has more than 5,700 commits and 349 contributors. + +![MDC Web GitHub][30] + +### Pure + +Bootstrap, Patternfly, and MDC Web are very powerful CSS frameworks, yet they can be quite heavy and complex. If you want a lightweight CSS framework that it is closer to coding CSS yourself yet helps you build a nice web page, try [Pure.css][31]. Pure is a lightweight CSS framework with a minimal footprint. It was developed by Yahoo and is open source under the BSD License. + +![Pure.css homepage][32] + +Despite its small size, Pure offers plenty of the components necessary to build a good-looking webpage. + +![Pure.css components][33] + +Pure's [GitHub][6] page shows more than 565 commits and 59 contributors. + +![Pure.css GitHub][34] + +### Foundation + +[Foundation][35] claims to be the most advanced responsive frontend framework in the world. It provides advanced features and tutorials for building professional websites. + +![Foundation homepage][36] + +The framework is [used][37] by many companies, organizations, and even politicians, and it has plenty of documentation available. + +![Foundation documentation][38] + +Foundation's [GitHub][7] page shows nearly 17,000 commits and 1,000 contributors. Like most of the other frameworks on this list, it's available under the MIT License. + +![Foundation GitHub][39] + +### Bulma + +[Bulma][40] is an open source framework based on Flexbox and available under the MIT License. Bulma is a pretty lightweight framework, as it requires only one CSS file. + +![Bulma homepage][41] + +Bulma has clean and simple docs that make it easy to choose the topics you want to explore. It also has a number of web components you can just pick up and use in your design. + +![Bulma documentation][42] + +Bulma's [GitHub][8] page lists more than 1,400 commits and 300 contributors. + +![Bulma GitHub][43] + +### Skeleton + +If even Pure is too heavy for you, there is an even lighter-weight framework called [Skeleton][44]. The Skeleton library is only about 400 lines long, and the framework provides only the essential components to start your CSS framework journey. + +![Skeleton homepage][45] + +Despite its simplicity, Skeleton offers detailed docs to help you get started right away. + +![Skeleton documentation][46] + +Skeleton's [GitHub][9] lists 167 commits and 22 contributors. However, it's not the most active project; its last update was in 2014, so it may need some maintenance before using it. Since it is released under the MIT License, feel free to do that yourself. + +![Skeleton GitHub][47] + +### Materialize + +[Materialize][48] is a responsive frontend framework based on Google's Material Design with additional themes and components developed by Materialize's contributors. + +![Materialize homepage][49] + +Materialize's documentation page is comprehensive and pretty easy to follow. Its components page includes buttons, cards, navigations, and more. + +![Materialize documentation][50] + +Materialize is an open source project under the MIT License, and its [GitHub][10] lists more than 3,800 commits and 250 contributors. + +![Materialize GitHub][51] + +### Bootflat + +[Bootflat][52] is an open source CSS framework derived from Twitter's Bootstrap. Compared to Bootstrap, Bootflat is simpler, with lighter-weight framework components. + +![Bootflat homepage][53] + +Bootflat's [documentation][54] almost seems inspired by IKEA—it shows an image of each component without much text. + +![Bootflat docs][55] + +Bootflat is available under the MIT License, and its [GitHub][11] page includes 159 commits and eight contributors, as of this writing. + +![Bootflat GitHub][56] + +### Which CSS framework should you choose? + +You have many options for open source CSS frameworks, depending on how feature-rich or simple you want the tooling to be. Like all technology decisions, there is no single right answer for everything or everyone; there is only the right choice for the given time and the given project. + +Give a few of these a spin and see which one you want to use in your next project. Also, did I miss any interesting open source CSS frameworks? Please share your feedback and ideas in the comments below. + +Which frontend framework should you pick for your next web app? Pam Selle will address this... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/open-source-css-frameworks + +作者:[Bryant Son][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/brson +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://en.wikipedia.org/wiki/Cascading_Style_Sheets +[3]: https://github.com/twbs/bootstrap +[4]: https://github.com/patternfly/patternfly +[5]: https://github.com/material-components/material-components-web +[6]: https://github.com/pure-css/pure +[7]: https://github.com/foundation/foundation-sites +[8]: https://github.com/jgthms/bulma +[9]: https://github.com/dhg/Skeleton +[10]: https://github.com/Dogfalo/materialize +[11]: https://github.com/bootflat/bootflat.github.io +[12]: https://getbootstrap.com +[13]: https://opensource.com/sites/default/files/uploads/2_bootstrapscreenshot.jpg (Bootstrap homepage) +[14]: https://getbootstrap.com/docs/4.4/examples/ +[15]: https://opensource.com/sites/default/files/uploads/3_bootstrapsamples.jpg (Bootstrap examples) +[16]: https://opensource.com/sites/default/files/uploads/4_bootstrapdocs.jpg (Bootstrap documentation) +[17]: https://opensource.com/sites/default/files/uploads/5_bootstrapgithub.jpg (Bootstrap GitHub) +[18]: https://www.patternfly.org +[19]: https://opensource.com/sites/default/files/uploads/6_patternflyhomepage.jpg (PatternFly homepage) +[20]: https://opensource.com/sites/default/files/uploads/7_patternflyreactjs.jpg (PatternFly ReactJS support) +[21]: https://en.wikipedia.org/wiki/Modal_window +[22]: https://opensource.com/sites/default/files/uploads/8_patternflycomponents.jpg (PatternFly chart component) +[23]: https://opensource.com/sites/default/files/uploads/9_patternflygithub.jpg (PatternFly GitHub) +[24]: https://material.io +[25]: https://opensource.com/sites/default/files/uploads/10_materialhome.jpg (Material Design homepage) +[26]: https://material.io/components/ +[27]: https://opensource.com/sites/default/files/uploads/11_materialcomponents.jpg (Material Components webpage) +[28]: https://opensource.com/sites/default/files/uploads/12_materialdocs.jpg (Material Design documentation) +[29]: https://opensource.com/sites/default/files/uploads/13_materialtutorial.jpg (Material Design tutorial) +[30]: https://opensource.com/sites/default/files/uploads/15_materialgithub.jpg (MDC Web GitHub) +[31]: https://purecss.io +[32]: https://opensource.com/sites/default/files/uploads/16_purehome.jpg (Pure.css homepage) +[33]: https://opensource.com/sites/default/files/uploads/17_purecomponents.jpg (Pure.css components) +[34]: https://opensource.com/sites/default/files/uploads/18_puregithub.jpg (Pure.css GitHub) +[35]: https://get.foundation +[36]: https://opensource.com/sites/default/files/uploads/19_foundationhome.jpg (Foundation homepage) +[37]: https://zurb.com/responsive +[38]: https://opensource.com/sites/default/files/uploads/21_foundationdocs.jpg (Foundation documentation) +[39]: https://opensource.com/sites/default/files/uploads/22_foundationgithub.jpg (Foundation GitHub) +[40]: https://bulma.io +[41]: https://opensource.com/sites/default/files/uploads/23_bulmahome.jpg (Bulma homepage) +[42]: https://opensource.com/sites/default/files/uploads/24_bulmadoc.jpg (Bulma documentation) +[43]: https://opensource.com/sites/default/files/uploads/25_bulmagithub.jpg (Bulma GitHub) +[44]: http://getskeleton.com +[45]: https://opensource.com/sites/default/files/uploads/26_skeletonhome.jpg (Skeleton homepage) +[46]: https://opensource.com/sites/default/files/uploads/27_skeletondocs.jpg (Skeleton documentation) +[47]: https://opensource.com/sites/default/files/uploads/28_skeletongithub.jpg (Skeleton GitHub) +[48]: https://materializecss.com +[49]: https://opensource.com/sites/default/files/uploads/29_materializehome.jpg (Materialize homepage) +[50]: https://opensource.com/sites/default/files/uploads/30_materializedocs.jpg (Materialize documentation) +[51]: https://opensource.com/sites/default/files/uploads/31_materializegithub.jpg (Materialize GitHub) +[52]: http://bootflat.github.io +[53]: https://opensource.com/sites/default/files/uploads/32_bootflathome.jpg (Bootflat homepage) +[54]: http://bootflat.github.io/documentation.html +[55]: https://opensource.com/sites/default/files/uploads/33_bootflatdocs.jpg (Bootflat docs) +[56]: https://opensource.com/sites/default/files/uploads/34_bootflatgithub.jpg (Bootflat GitHub) From c364dcc33dffd38d20892b089cfd85c4c4dfb479 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Apr 2020 01:41:26 +0800 Subject: [PATCH 0284/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200413=20A=20?= =?UTF-8?q?handy=20utility=20for=20creating=20Raspberry=20Pi=20SD=20card?= =?UTF-8?q?=20images?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md --- ...or creating Raspberry Pi SD card images.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md diff --git a/sources/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md b/sources/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md new file mode 100644 index 0000000000..7d0eadb90c --- /dev/null +++ b/sources/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A handy utility for creating Raspberry Pi SD card images) +[#]: via: (https://opensource.com/article/20/4/raspberry-pi-imager-mac) +[#]: author: (James Farrell https://opensource.com/users/jamesf) + +A handy utility for creating Raspberry Pi SD card images +====== +Getting started with Raspberry Pi Imager on a Mac. +![Raspberries with pi symbol overlay][1] + +There are many ways to buy a Raspberry Pi, and depending on who you buy it from, it may or may not come with an operating system already installed on it. Getting an OS onto a Raspberry Pi is a matter of "flashing" an SD card with an OS image. To make this as easy as possible, the [Raspberry Pi Foundation][2] has introduced a Raspberry Pi Imager application, and you can download it for all major platforms. Here's a quick intro to this helpful new utility. + +### Install the Imager + +You can find the Raspberry Pi Imager over at the usual [Raspberry Pi Downloads][3] page. Versions exist for Mac, Ubuntu, and Windows. I will download and demonstrate the Mac version. + +Installation on Mac consists of the usual DMG image that mounts to your desktop, and then a typical installer window appears: + +![Raspberry Pi Imager installer][4] + +Simply drag the cute raspberry icon to the Application folder, and you are done. Invoke that from Launchpad, and you are presented with a series of simple buttons and menus to choose from. It really cannot be simpler than this: + +![Raspberry Pi Imager home screen][5] + +### Images and options available + +The default options contain a variety of images for various Raspberry Pi models. Raspbian is the top choice with two available options for smaller "Lite" and fatter "Full" versions available. The LibreELEC Kodi entertainment system is available in various model-specific builds. Ubuntu 18 and 19 have 32-bit and 64-bit builds available for different Pi models. There is an RPi 4 EEPROM recovery utility and a function to format your card using FAT32. Finally, a generic image installer option is available that I will try out a little later. Pretty handy for a simple and compact utility. + +### Install some images + +I had a 16g micro SD card that I decided to play with. I selected the default Raspbian image, chose my attached USB/SD device, and pressed WRITE. Here is a brief demo: + +![Raspberry Pi Imager demo][6] + +I didn't post the entire sequence there. I believe it downloaded the image as it was writing and took a few minutes on my wireless connection to finish. The process goes through a write and then a verify cycle before it is finished. When it was done, I ejected the device, popped the card into my RPi 3, and was treated to the usual graphical Raspbian setup wizard and desktop environment. + +That wasn't quite enough for me; I get plenty of Linux on a daily basis and was looking for a little more today. I went back to the [Raspberry Pi Downloads][3] page and pulled down the RISC OS image. This process was nearly as easy. Download the RISCOSPi.5.24.zip file, extract it, and find the ro524-1875M.img file. From the Operating System button, I selected the Use Custom option and selected the desired image file. The process was pretty much the same; the only real difference being I had to hunt around my Downloads directory and select an image. Once the file was finished writing, back into the Pi 3, and RISC OS was ready to go. + +### Gripes on USB C + +This is just a silly aside, but how many of you are a bit frustrated with the total inconvenience of USB C these days? I'm using a MacBook Pro, which only has USB C ports, and I am subject to a never-ending swap of adapters to get things done. Take a look at this: + +![USB C adapter][7] + +Yes, that is a USB C to USB A adapter, then a USB to SD card reader, and an SD to micro SD adapter inside. I probably could have found something online to simplify this, but these are the parts I had on hand to support my family's myriad Mac, Windows, and Linux hosts. Enough about that, but I hope you got a chuckle from that insanity. + +### Summary + +The new Raspberry Pi Imager is a simple and effective tool for getting off the ground quickly with Raspberry Pi images. [BalenaEtcher][8] is a similar tool for imaging your removable devices, but this new Raspberry Pi Imager makes the process of common RPi OS installations (like Raspbian) a bit easier by eliminating the steps to fetch those common images. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/raspberry-pi-imager-mac + +作者:[James Farrell][a] +选题:[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/jamesf +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-raspberrypi_0.png?itok=Kczz87J2 (Raspberries with pi symbol overlay) +[2]: https://www.raspberrypi.org/ +[3]: https://www.raspberrypi.org/downloads/ +[4]: https://opensource.com/sites/default/files/uploads/install_1.png (Raspberry Pi Imager installer) +[5]: https://opensource.com/sites/default/files/uploads/screen_2_0.png (Raspberry Pi Imager home screen) +[6]: https://opensource.com/sites/default/files/uploads/demo_3.gif (Raspberry Pi Imager demo) +[7]: https://opensource.com/sites/default/files/uploads/adapter_4.png (USB C adapter) +[8]: https://www.balena.io/etcher/ From 31ee0efa834f7be4f51d8c10c4a9492e2623f33b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Apr 2020 01:42:25 +0800 Subject: [PATCH 0285/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200413=20How?= =?UTF-8?q?=20to=20install=20Python=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200413 How to install Python on Linux.md --- ...20200413 How to install Python on Linux.md | 159 ++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 sources/tech/20200413 How to install Python on Linux.md diff --git a/sources/tech/20200413 How to install Python on Linux.md b/sources/tech/20200413 How to install Python on Linux.md new file mode 100644 index 0000000000..cc46e86ef4 --- /dev/null +++ b/sources/tech/20200413 How to install Python on Linux.md @@ -0,0 +1,159 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to install Python on Linux) +[#]: via: (https://opensource.com/article/20/4/install-python-linux) +[#]: author: (Vijay Singh Khatri https://opensource.com/users/vijaytechnicalauthor) + +How to install Python on Linux +====== +Step-by-step instructions for installing the latest Python instead of +(or alongside) an older version on Linux. +![OpenStack source code \(Python\) in VIM][1] + +[Python][2] is now the [most popular][3], most used programming language. Python's simple syntax and low learning curve make it the ultimate choice for beginners as well as professional developers. Python is also a very versatile programming language. It's used nearly everywhere—from web development to artificial intelligence—really anywhere other than mobile development. + +If you're using Python, there's a good chance you're a developer (or want to become one), and Linux is a great platform for creating software. But when you're working with Python every day, you sometimes want to stay up to date with the very latest version. You may not want to replace the default install of Python on your system just to test drive the latest one, so this article explains how to install the latest version of Python 3 on Linux without replacing the version provided by your distribution. + +Use the **python --version terminal** command to check whether Python is already installed and, if so, which version you have. If Python is not installed on your Linux system, or you want to install an updated version, follow the steps below. + +### Step-by-step installation instructions + +#### **Step 1:** First, install development packages required to build Python. + +#### On Debian: + + +``` +$ sudo apt update +$ sudo apt install build-essential zlib1g-dev \ +libncurses5-dev libgdbm-dev libnss3-dev \ +libssl-dev libreadline-dev libffi-dev curl +``` + +#### On Fedora: + + +``` +`$ sudo dnf groupinstall development` +``` + +#### Step 2: Download the stable latest release of Python 3 + +Visit the [official Python website][4] and download the latest version of Python 3. After the download is complete, you hav a **.tar.xz** archive file (a "tarball") containing the source code of Python. + +#### Step 3: Extract the tarball + +Once the download is complete, extract the tarball by either using the extractor application of your choice or the [Linux **tar** command][5], for example: + + +``` +`$ tar -xf Python-3.?.?.tar.xz` +``` + +#### Step 4: Configure the script + +Once the Python tarball has been extracted, navigate to the configure script and execute it in your Linux terminal with: + + +``` +$ cd Python-3.* +./configure +``` + +The configuration may take some time. Wait until it is successfully finishes before proceeding. + +#### Step 5: Start the build process + +If you already have a version of Python installed on your system and you want to install the new version alongside it, use this command: + + +``` +`$ sudo make altinstall` +``` + +The build process may take some time. + +If you want to replace your current version of Python with this new version, you should uninstall your current Python package using your package manager (such as **apt** or **dnf**) and then install: + + +``` +`$ sudo make install` +``` + +However, it's generally preferable to install software as a package (such as a **.deb** or **.rpm** file) so your system can track and update it for you. Because this article assumes the latest Python isn't yet packaged yet, though, you probably don't have that option. In that case, you can either install Python with **altinstall** as suggested, or rebuild an existing Python package using the latest source code. That's an advanced topic and specific to your distribution, so it's out of scope for this article. + +#### Step 6: Verify the installation + +If you haven't encountered any errors, the latest Python is now installed on your Linux system. To verify it, write one of these commands in your terminal: + + +``` +`python3 --version` +``` + +or + + +``` +`python --version` +``` + +If the output says **Python 3.x**, Python 3 has been successfully installed. + +### Create a virtual environment (optional) + +Python provides a package known as **venv** (virtual environment), which helps you isolate a program directory or package from other ones. + +To create a virtual environment, enter the following in the Python terminal (in this example, assume the version of Python you've installed is in the **3.8** series): + + +``` +`python3.8 -m venv example` +``` + +This command creates a new directory (which I've named **example**), with some subdirectories. + +To activate the virtual environment, enter: + + +``` +$ source example/bin/activate +(example) $ +``` + +Notice that your terminal prompt (**$**) is now preceeded by an environment name. + +To deactivate the virtual environment, use the **deactivate** command: + + +``` +`(example) $ deactivate` +``` + +### Conclusion + +Python is a fun language that's developed and improved frequently. Getting familiar with new features is easy, once you understand how to install the latest release without interfering with the stable version provided from your distribution. + +If you have any feedback or questions, please leave them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/install-python-linux + +作者:[Vijay Singh Khatri][a] +选题:[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/vijaytechnicalauthor +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_1.jpg?itok=lHQK5zpm (OpenStack source code (Python) in VIM) +[2]: https://www.python.org/ +[3]: http://pypl.github.io/PYPL.html +[4]: http://python.org +[5]: https://opensource.com/article/17/7/how-unzip-targz-file From 0fe304fb3c181d1b4dd66bd4da82b2ab7176a076 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 15 Apr 2020 08:52:06 +0800 Subject: [PATCH 0286/1809] translated --- ...Which Desktop Environment You are Using.md | 111 ------------------ ...Which Desktop Environment You are Using.md | 111 ++++++++++++++++++ 2 files changed, 111 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md create mode 100644 translated/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md diff --git a/sources/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md b/sources/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md deleted file mode 100644 index 0cedfc9709..0000000000 --- a/sources/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md +++ /dev/null @@ -1,111 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Here’s How to Find Out Which Desktop Environment You are Using) -[#]: via: (https://itsfoss.com/find-desktop-environment/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Here’s How to Find Out Which Desktop Environment You are Using -====== - -If you are a new Linux user and seeking help in one of the Linux forums, you may be asked this question: - -_**“Which desktop environment are you using?”**_ - -You have an idea about what a desktop environment is but how do you know which one are you using? I’ll tell you how to find it out. I’ll show the command line method first because that is applicable to [all kind of Linux distributions][1]. I’ll also show the graphical way of getting this information. - -### Check which desktop environment you are using - -![][2] - -You can [use the echo command in Linux][3] to display the value of XDG_CURRENT_DESKTOP variable in the terminal. - -Open the terminal and copy paste this command: - -``` -echo $XDG_CURRENT_DESKTOP -``` - -For example, it shows that I am using [GNOME desktop][4] in [Ubuntu 20.04][5]: - -``` -[email protected]:~$ echo $XDG_CURRENT_DESKTOP -ubuntu:GNOME -``` - -While this command quickly tells you which desktop environment is being used, it doesn’t give any other information. - -Knowing the version of desktop environment (also called DE) could be important in some cases. Each new version of a software brings new features or removes some. [GNOME 3.36][6] introduces a ‘Do Not Disturb’ option to toggle off all the desktop notifications. - -Suppose you read about this new Do Not Disturb feature. You verify that you are using GNOME and yet you don’t see this option in your GNOME desktop. If you could check the GNOME desktop version you have installed on your system, that could make things clear for you. - -I’ll show you the commands to check the desktop environment’s version first because you can use it in any Linux, running desktop environment. - -### How to get desktop environment version - -Unlike getting the name of desktop environment. getting its version number is not straightforward because there is no standard command or environment variable that could give this information. - -One way to get the desktop environment information in Linux is by using a tool like [Screenfetch][7]. This [command line tool displays the logo of your Linux distribution in ascii format][8] along with a few basic system information. Desktop environment version is one of them. - -In Ubuntu based distributions, you can install Screenfetch by [enabling Universe repository][9] and then using this command: - -``` -sudo apt install screenfetch -``` - -For other Linux distributions, please use your system’s package manager to install this program. - -Once installed, simply type screenfetch in the terminal and it should show the desktop environment version along with other system information. - -![Check Desktop Environment Version][10] - -As you can see in the above image, my system is using GNOME 3.36.1 (basically GNOME 3.36). You can also [check the Linux kernel version][11] and other details here. - -Please keep in mind that it is not necessary that Screenfetch will display the desktop environment version. I checked its source code and it has lots of if-else code to get the version information from a number of sources and parameters in various desktop environments. If it can find nothing on version, it just displays the DE name. - -### Using GUI to check desktop environment version - -Almost all desktop environments provide basic system details in their Settings-About section. - -The one major problem is that most DEs look different and thus I cannot show the exact steps for each of them. I am going to show it for GNOME and I let you discover it in your desktop. - -So, search for Settings in the menu (press Windows key and search): - -![Search for Settings application][12] - -In here, go to the bottom to find the About section. Click on it and you should have the desktop environment along with its version. - -![Check Desktop Environment in Ubuntu][13] - -As you can see, it shows that my system is using GNOME 3.36. - -I hope you find this quick beginner tip useful. If you have questions or suggestions, please leave a comment below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/find-desktop-environment/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/what-is-linux/ -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/check-desktop-environment.jpg?ssl=1 -[3]: https://linuxhandbook.com/echo-command/ -[4]: https://www.gnome.org/ -[5]: https://itsfoss.com/ubuntu-20-04-release-features/ -[6]: https://itsfoss.com/gnome-3-36-release/ -[7]: https://github.com/KittyKatt/screenFetch -[8]: https://itsfoss.com/display-linux-logo-in-ascii/ -[9]: https://itsfoss.com/ubuntu-repositories/ -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/check-desktop-environment-version.jpg?ssl=1 -[11]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/ -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/applications_menu_settings.jpg?ssl=1 -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/check-desktop-environment-ubuntu.jpg?ssl=1 diff --git a/translated/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md b/translated/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md new file mode 100644 index 0000000000..4345d5cff8 --- /dev/null +++ b/translated/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Here’s How to Find Out Which Desktop Environment You are Using) +[#]: via: (https://itsfoss.com/find-desktop-environment/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +这是找出你所使用的桌面环境的方法 +====== + +如果你是 Linux 新用户,并在一个 Linux 论坛中寻求帮助,那么你可能会被问以下问题: + +_**“你使用的是哪个桌面环境?”**_ + +你知道什么是桌面环境,但你如何知道你使用的是哪一个?我会告诉你如何找到它。我将首先展示命令行方法,因为这适用于[各种 Linux 发行版][1]。我还将展示如何通过图形方式获得。 + +### 检查你使用的是哪个桌面环境 + +![][2] + +你可以[在 Linux 中使用 echo 命令][3]在终端中显示 XDG_CURRENT_DESKTOP 变量的值。 + +打开终端并复制粘贴此命令: + +``` +echo $XDG_CURRENT_DESKTOP +``` + +例如,这表明我在 [Ubuntu 20.04][5] 中使用了 [GNOME 桌面][4]: + +``` +[email protected]:~$ echo $XDG_CURRENT_DESKTOP +ubuntu:GNOME +``` + +尽管此命令可以快速告诉你正在使用哪个桌面环境,但它不会提供任何其他信息。 + +在某些情况下,了解桌面环境版本(也称为 DE)可能很重要。软件的每个新版本都会带来新功能或删除某些功能。[GNOME 3.36][6] 引入了“请勿打扰”选项,以关闭所有桌面通知。 + +假设你了解了此新的“请勿打扰”功能。你确认自己正在使用 GNOME,但是在 GNOME 桌面上看不到此选项。如果你可以检查系统上已安装的 GNOME 桌面版本,那么这会很清楚。 + +我将先向你展示命令检查桌面环境版本,因为你可以在任何运行桌面环境的 Linux 中使用它。 + +### 如何获取桌面环境版本 + +与获取桌面环境的名称不同。获取其版本号并不直接,因为它没有标准的命令或环境变量可以提供此信息。 + +在 Linux 中获取桌面环境信息的一种方法是使用 [Screenfetch][7] 之类的工具。此[命令行工具以 ascii 格式显示 Linux 发行版的 logo][8] 以及一些基本的系统信息。桌面环境版本就是其中之一。 + +在基于 Ubuntu 的发行版中,你可以通过[启用 Universe 仓库][9]安装 Screenfetch,然后使用以下命令: + +``` +sudo apt install screenfetch +``` + +对于其他 Linux 发行版,请使用系统的软件包管理器来安装此程序。 + +安装后,只需在终端中输入 screenfetch 即可,它应该显示桌面环境版本以及其他系统信息。 + +![Check Desktop Environment Version][10] + +如上图所示,我的系统使用 GNOME 3.36.1(基本版本是 GNOME 3.36)。你也可以这样[检查 Linux 内核版本][11]和其他详细信息。 + +请记住,Screenfetch 不一定显示桌面环境版本。我查看了它的源码,它有许多 if-else 代码,可以从各种桌面环境中的许多源和参数获取版本信息。如果找不到任何版本,那么仅显示桌面环境名称。 + +### 使用 GUI 检查桌面环境版本 + +几乎所有桌面环境在其 “Settings-About” 部分中都提供了基本的系统详细信息。 + +一个主要问题是,大多数桌面环境看起来都不同,因此我无法展示每个桌面环境的确切步骤。我将展示 GNOME 的,让你在桌面上发现它。 + +在菜单中搜索 “Settings”(按 Windows 键并搜索): + +![Search for Settings application][12] + +在这里,找到底部的 “About” 部分。单击它,你应该就能看到桌面环境及其版本。 + +![Check Desktop Environment in Ubuntu][13] + +如你所见,这表明我的系统正在使用 GNOME 3.36。 + +我希望这个快速入门技巧对你有所帮助。如果你有任何疑问或建议,请在下面发表评论。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/find-desktop-environment/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/what-is-linux/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/check-desktop-environment.jpg?ssl=1 +[3]: https://linuxhandbook.com/echo-command/ +[4]: https://www.gnome.org/ +[5]: https://itsfoss.com/ubuntu-20-04-release-features/ +[6]: https://itsfoss.com/gnome-3-36-release/ +[7]: https://github.com/KittyKatt/screenFetch +[8]: https://itsfoss.com/display-linux-logo-in-ascii/ +[9]: https://itsfoss.com/ubuntu-repositories/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/check-desktop-environment-version.jpg?ssl=1 +[11]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/applications_menu_settings.jpg?ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/check-desktop-environment-ubuntu.jpg?ssl=1 From 10055a639247f422ca2fd815d1c848c8eb7091d1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 15 Apr 2020 08:56:05 +0800 Subject: [PATCH 0287/1809] translating --- ...olders as Administrator in Nautilus File Manager in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md b/sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md index d8a9211b64..5dc6cd023a 100644 --- a/sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md +++ b/sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 932f6d4ee1b790034b5f9b464cd92af92bb36a69 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 Apr 2020 09:04:41 +0800 Subject: [PATCH 0288/1809] Rename sources/tech/20200414 How World of Warcraft introduced me to Linux.md to sources/talk/20200414 How World of Warcraft introduced me to Linux.md --- .../20200414 How World of Warcraft introduced me to Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200414 How World of Warcraft introduced me to Linux.md (100%) diff --git a/sources/tech/20200414 How World of Warcraft introduced me to Linux.md b/sources/talk/20200414 How World of Warcraft introduced me to Linux.md similarity index 100% rename from sources/tech/20200414 How World of Warcraft introduced me to Linux.md rename to sources/talk/20200414 How World of Warcraft introduced me to Linux.md From 0f5d421cdff7c53e527d7ad880009fc28314091d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Apr 2020 12:46:29 +0800 Subject: [PATCH 0289/1809] PRF @robsean --- ...ux on VirtualBox- Quickest - Safest Way.md | 108 ++++++++++-------- 1 file changed, 59 insertions(+), 49 deletions(-) diff --git a/translated/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md b/translated/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md index 100d2ec246..81398484ca 100644 --- a/translated/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md +++ b/translated/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md @@ -1,118 +1,128 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Installing Kali Linux on VirtualBox: Quickest & Safest Way) [#]: via: (https://itsfoss.com/install-kali-linux-virtualbox/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -在 VirtualBox 上安装 Kali Linux : 最快速和最安全的方法 +在 VirtualBox 上安装 Kali Linux:最快速和最安全的方法 ====== -_**这篇教程向你展示如何以最快的方式在 Windows 和 Linux 中的 Virtual Box 虚拟机上安装 Kali Linux 。**_ +> 这篇教程向你展示如何在 Windows 和 Linux 中以最快的方式在 VirtualBox 上安装 Kali Linux。 -[Kali Linux][1] 是 [最适合黑客攻击和安全爱好者的 Linux 发行版][2] 之一。 +[Kali Linux][1] 是 [最适合脆弱性测试和安全爱好者的 Linux 发行版][2] 之一。 -因为它涉及一个像黑客之类的敏感话题,就像一把双刃剑。我们过去在详细的 Kali Linux 评论中讨论过,所以我不会使用同样的东西来烦你。 +因为它涉及一个像黑客之类的敏感话题,就像一把双刃剑。我们过去在详细的 Kali Linux 评论中讨论过,所以我不会再次赘述。 -尽管你可以通过以替换现有的操作系统的形式安装 Kali Linux 。但是通过一台虚拟机来使用它可能会是更好更安全的选择。 +虽然你可以通过替换现有的操作系统的形式安装 Kali Linux,但是通过虚拟机来使用它可能会是更好、更安全的选择。 -使用 Virtual Box ,你可以在 Windows/Linux 系统中将 Kail Linux 作为常规应用程序使用。它几乎与在系统中运行 VLC 或游戏是一样的。 +使用 VirtualBox,你可以在 Windows/Linux 系统中将 Kail Linux 作为常规应用程序使用。这和在系统中运行 VLC 或游戏几乎是一样的。 -在一台虚拟机中使用 Kali Linux 是安全的。不管你在 Kali Linux 做什么都不会影响你的 ‘宿主系统’ (例如,你的原始的 Windows 或 Linux 操作系统)。你的实际操作系统将不会受到影响,并且在你的宿主系统中数据也将是安全的。 +在虚拟机中使用 Kali Linux 是安全的。不管你在 Kali Linux 做什么都不会影响你的 ‘宿主系统’(即你原来的 Windows 或 Linux 操作系统)。你的实际操作系统将不会受到影响,并且在你的宿主系统中数据也是安全的。 ![][3] ### 如何在 VirtualBox 中安装 Kali Linux -在这里我将使用 [VirtualBox][4] 。它是一个非常好的开源虚拟化解决方案,几乎适合于任何人(专业使用或个人使用)。它是免费提供的。 +在这里我会使用 [VirtualBox][4]。它是一个非常好的开源虚拟化解决方案,几乎适合于任何人,无论是专业使用或个人使用。它是免费提供的。 -在这篇文章中,我们将特别讨论 Kali Linux ,但是你也可以安装其它任何存在的 ISO 文件,或者一个可用的预先构建的虚拟机保存文件。 +在这篇文章中,我们将特别讨论 Kali Linux,但你也可以安装几乎任何其他的操作系统,只要有 ISO 文件或预建的虚拟机保存文件就可以安装。 -**注意:** _同样的步骤也适用于运行 VirtualBox 的 Windows/Linux 。_ +**注意:**同样的步骤适用于运行 VirtualBox 的 Windows 或 Linux。 -如上所述,你可以安装 Windows 或 Linux 作为你的宿主系统。但是,在我已安装 Windows 10 的情况下(别仇恨我!),我将尝试在 VirtualBox 中一步一步地安装 Kali Linux 。 +如上所述 ,你可以安装 Windows 或 Linux 作为你的宿主系统。但是,在我已安装 Windows 10 的情况下(别仇恨我!),我会尝试着在其上的 VirtualBox 中一步步地安装 Kali Linux 。 -并且,最好的部分是,– 即使你碰巧使用一个 Linux 发行版作为你的主要操作系统,也将使用同样的步骤! +并且,最棒的是,即使你碰巧使用一个 Linux 发行版作为你的主要操作系统,也将使用同样的步骤! -很疑惑,如何做?让我们来看看… +想知道如何做?让我们来看看… -[更多 Linux 视频,订阅我们的 YouTube 频道][5] +- [video](https://youtu.be/TGOiAsSdADs) -### 图解在 VirtualBox 上安装 Kali Linux +### 在 VirtualBox 上安装 Kali Linux 的分步指南 -_我们将使用专门为 VirtualBox 定制的 Kali Linux 镜像。你也可以下载 Kali Linux 的 ISO 文件,并创建一个新的虚拟机 – 但是为什么当你有一个简单的选择时还这样做呢?_ +我们将使用一个专门为 VirtualBox 定制的 Kali Linux 镜像。你也可以下载 Kali Linux 的 ISO 文件,并创建一个新的虚拟机,但是当你有一个简单的选择时,为什么还这样做呢? -#### 1\. 下载和安装 VirtualBox +#### 1、下载并安装 VirtualBox -第一件要做的事是从甲骨文的官方网站下载和安装 VirtualBox 。 +第一件要做的事是从甲骨文的官方网站下载和安装 VirtualBox。 -[下载VirtualBox][6] +- [下载 VirtualBox][6] -在你下载安装器后,只需要双击它来安装 VirtualBox 。在 [Ubuntu][7] / Fedora Linux 安装 VirtualBox 也是一样的。 +在你下载了安装器之后,只需要双击它来安装 VirtualBox。在 [Ubuntu][7]/Fedora Linux 安装 VirtualBox 也是一样的方式。 -#### 2\. 下载 Kali Linux 的即时可用的虚拟镜像 +#### 2、下载即用型的 Kali Linux 虚拟镜像 -在安装成功后,前往 [攻击性安全的下载页面][8] 来下载适用于 VirtualBox 的虚拟机镜像。如果您改变主意使用 [VMware][9] ,那也是可行的。 +在安装成功后,前往 [Offensive Security 的下载页面][8] 来下载适用于 VirtualBox 的虚拟机镜像。如果你改变主意使用 [VMware][9],那里也有适用的。 ![][10] -如你所见,文件大小大约 3 GB ,你应该使用一个 torrent 选项,或者使用一个 [下载管理器][11] 来下载它。 +如你所见,文件大小大约 3 GB,你应该使用 torrent 方式,或者使用一个[下载管理器][11]来下载它。 -[Kali Linux 虚拟镜像][8] +- [下载 Kali Linux 虚拟镜像][8] -#### 3\. 在 Virtual Box 上安装 Kali Linux +#### 3、在 Virtual Box 上安装 Kali Linux -在你安装 VirtualBox 和下载 Kali Linux 镜像后,你只需要导入它到 VirtualBox 中以便使它工作。 +当你安装 VirtualBox 并下载 Kali Linux 镜像后,你只需要将其导入到 VirtualBox 中就可以使其正常工作。 这里是如何导入 Kali Linux 的 VirtualBox 镜像: -**步骤 1** : 启动 VirtualBox 。你将注意到一个 **导入** 按钮 – 在它上面鼠标左键单击 +##### 步骤 1 -![在 导入 按钮上鼠标左键单击][12] +启动 VirtualBox。你会看到一个导入Import 按钮,点击它。 -**步骤 2:** 接下来,浏览到你更改下载的文件,并选择它来导入 (如你在下面的图像中所见)。文件名称一个以 'kali linux' 开始并以 . **ova** 拓展名结束。 +![点击导入按钮][12] + +##### 步骤 2 + +接下来,浏览刚刚下载的文件,选择要导入的文件(如下图所示)。文件名应该以“kali linux”开始,以 .ova 扩展名结束。 ![导入 Kali Linux 镜像][13] - 在选择后,通过在 **接下来** 上鼠标左键单击以继续。 +选择后,单击下一步Next继续进行。 -**步骤 3** : 现在,将向你显示将要导入虚拟机的设置。所以,你可以自定义它们或者不自定义它们 – 这取决于你的选择。如果你使用默认设置也是可以的。 +##### 步骤 3 -你需要选择一个有足够可用存储空间的路径。在 Windows 上,我从不建议使用 **C:** 盘。 +现在,你会看到要导入的虚拟机的设置。所以,你可以自定义它们或者不自定义,这是你的选择。采用默认设置也是可以的。 -![导入硬盘驱动器为 VDI][14] +你需要选择一个有足够可用存储空间的路径。在 Windows 上,我绝不建议使用 C: 盘。 -在这里,硬盘驱动器如同 VDI 一样通过分配存储器空间集来虚拟挂载硬盘驱动器。 +![将硬盘驱动器导入为 VDI][14] -在你完成设置后,单击 **导入** 并等待一段时间。 +在这里,“将硬盘驱动器导入为 VDI”指的是通过分配存储器空间集来虚拟挂载硬盘驱动器。 -**步骤 4:** 你现在将看到它的列表。所以,只需点击 **开始** 来启动它。 +在你完成设置后,单击导入Import,等待一段时间。 -在最开始的时候,你可能会得到一个 USB 2.0 端口控制器的错误,你可以禁用它来解决问题,或者只需按照屏幕上的指南来安装一个附加软件包修复问题。与此同时,你完成所有工作! +##### 步骤 4 + +你现在将看到它被列在虚拟机列表中。所以,只需点击开始Start来启动它。 + +你可能会在开始时得到一个 USB 2.0 端口控制器的错误,你可以禁用它来解决问题,或者只需按照屏幕上的指示来安装一个附加软件包修复问题。然后就大功告成了! ![Kali Linux 运行在 VirtualBox 中][15] -在 Kali Linux 中默认用户名是 root ,默认密码是 toor 。你可以使用用户名和密码来登录到系统中。 +以前 Kali Linux 中的默认用户名是 root,默认密码是 toor。但从 2020 年 1 月起,Kali Linux 就不使用 root 账号了。现在,默认账号和密码都是 kali。 -请注意,在尝试安装一个新的应用程序或尝试侵入你邻居家的 WiFi 之前,你应该 [更新Kali Linux][16] 。 +你应该可以用它来登录系统了。 -我希望这篇指南能帮助您在 Virtual Box 上很容易地安装 Kali Linux 。当然,Kali Linux 有很多有用的渗透测试工具 – 祝你好运! +请注意,在尝试安装一个新的应用程序或尝试破解 WiFi 密码之前,请先[更新 Kali Linux][16] 。 -**提示** : Kali Linux 和 Ubuntu 都是基于 Debian 的,如果你在使用 Kali Linux 时遇到一些问题或错误,你可以按照互联网上的 Ubuntu 和 Debian 的教程解决。 +我希望这篇指南能帮助您在 VirtualBox 上很容易地安装 Kali Linux。当然,Kali Linux 有很多有用的渗透测试工具 – 祝你好运! -### 额外的好处: 免费的 Kali Linux 指南书 +**提示** : Kali Linux 和 Ubuntu 都是基于 Debian 的,如果你在使用 Kali Linux 时遇到任何问题或错误,你可以按照互联网上的 Ubuntu 和 Debian 的教程解决。 -如果你刚刚开始使用 Kali Linux, 那么知晓如何使用Kali Linux 将是一个好主意。 +### 奖励: 免费的 Kali Linux 指南书 -Kali Linux 背后的公司 Offensive Security 创建了一本解释 Linux 基础知识,Kali Linux 基础知识,配置和设置的指南书,也有一些关于渗透测试和安全工具的章节。 +如果你刚刚开始使用 Kali Linux, 那么了解如何使用 Kali Linux 就很有必要了。 -基本上,它拥有你开始使用 Kali Linux 所需的一切东西。最好的事情是这本书可以免费下载。 +Kali Linux 背后的公司 Offensive Security 制作了一本指南书,讲解了 Linux 的基础知识、Kali Linux 的基础知识、配置和设置,书中还有一些关于渗透测试和安全工具的章节。 -[免费下载 Kali Linux 解密][17] +基本上,它包含你上手 Kali Linux 所需要的一切东西。更重要的是,这本书可以免费下载。 -如果你遇到问题或只是想分项在 VirtualBox 使用 Kali Linux 的经验,请在下面的评论中告诉我们。 +- [免费下载《揭秘 Kali Linux》][17] + +如果你在 VirtualBox 上使用 Kali Linux 时遇到问题,请在下面的评论中告诉我们,或者直接分享你的经验。 -------------------------------------------------------------------------------- @@ -121,7 +131,7 @@ via: https://itsfoss.com/install-kali-linux-virtualbox/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 36f3ee1877fdbb141d60a9cff10302758baa8efd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Apr 2020 12:47:33 +0800 Subject: [PATCH 0290/1809] PUB @robsean https://linux.cn/article-12113-1.html --- ...talling Kali Linux on VirtualBox- Quickest - Safest Way.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md (99%) diff --git a/translated/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md b/published/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md similarity index 99% rename from translated/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md rename to published/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md index 81398484ca..31ce0c27f0 100644 --- a/translated/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md +++ b/published/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12113-1.html) [#]: subject: (Installing Kali Linux on VirtualBox: Quickest & Safest Way) [#]: via: (https://itsfoss.com/install-kali-linux-virtualbox/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 352386c4b762c15c59ea5413e8cd806f7db42c97 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Apr 2020 15:46:37 +0800 Subject: [PATCH 0291/1809] APL --- .../tech/20191216 Relive Linux history with the ROX desktop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191216 Relive Linux history with the ROX desktop.md b/sources/tech/20191216 Relive Linux history with the ROX desktop.md index 215006514f..36c94d71a8 100644 --- a/sources/tech/20191216 Relive Linux history with the ROX desktop.md +++ b/sources/tech/20191216 Relive Linux history with the ROX desktop.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From bfc9f0f1c96bd1eac9c8c9525d09393ea08394a2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Apr 2020 16:44:44 +0800 Subject: [PATCH 0292/1809] TSL --- ...live Linux history with the ROX desktop.md | 104 ------------------ ...live Linux history with the ROX desktop.md | 103 +++++++++++++++++ 2 files changed, 103 insertions(+), 104 deletions(-) delete mode 100644 sources/tech/20191216 Relive Linux history with the ROX desktop.md create mode 100644 translated/tech/20191216 Relive Linux history with the ROX desktop.md diff --git a/sources/tech/20191216 Relive Linux history with the ROX desktop.md b/sources/tech/20191216 Relive Linux history with the ROX desktop.md deleted file mode 100644 index 36c94d71a8..0000000000 --- a/sources/tech/20191216 Relive Linux history with the ROX desktop.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Relive Linux history with the ROX desktop) -[#]: via: (https://opensource.com/article/19/12/linux-rox-desktop) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Relive Linux history with the ROX desktop -====== -This article is part of a special series of 24 days of Linux desktops. -If you're looking for a fun trip back in time, the ROX desktop is well -worth a go. -![Person typing on a 1980's computer][1] - -The [ROX][2] desktop is no longer being actively developed, but its legacy resounds today, and even when it was active, it was a unique take on what a Linux desktop could be. While other desktops felt roughly similar to old Unix or Windows interfaces, ROX belongs solidly in the BeOS, AmigaOS, and [RISC OS][3] desktop camps. - -It focuses on drag-and-drop actions (which makes its accessibility non-optimal for some users), point-and-click actions, pop-up contextual menus, and a unique system of app directories for running local applications with no installation required. - -### Installing ROX - -Today, ROX is mostly abandoned and left in fragments that the user is left to sort out. Luckily, the puzzle is relatively easy to solve, but don't get confused when you find bits and pieces of the ROX desktop in your distribution's repository—but not _every_ bit of the ROX desktop. The popular parts of ROX—the file manager ([ROX-Filer][4]) and the terminal ([ROXTerm][5])—seem to have endured in most of the popular distribution repositories, and you can install (and use) them as standalone applications. However, to run the ROX desktop, you must also install ROX-Session and the libraries it depends on. - -I installed ROX on Slackware 14.2, but it should work on any Linux or BSD system. - -First, you must install [ROX-lib2][6] from its repository. True to its philosophy of minimal installs, all you have to do to install ROX-lib2 is download the tarball, [unarchive it][7], and move the **ROX-Lib** directory to **/usr/local/lib**. - -Next, you have to install [ROX-Session][8]. This probably needs to be compiled from source code, as it's not likely to be in your software repository. The compile process requires build tools, which ship by default on Slackware but are often omitted in other distributions to save space on the initial download. The names of the packages you must install to build from source code vary depending on your distro, so refer to the documentation for specifics. For example, on Debian-based distributions, you can learn about build requirements in [Debian's wiki][9], and on Fedora-based distributions, refer to [Fedora's docs][10]. Once you have the build tools installed, execute the custom ROX-Session build script: - - -``` -`$ ./AppRun` -``` - -This manages its own build and installation and prompts you for root permissions to add itself as an option on your login screen. - -If you have not installed ROX-Filer from your software repository, do that before continuing. - -Together, these components create a complete ROX desktop. To log into your new desktop, log out of your current desktop session. By default, your session manager (KDM, GDM, LightDM, or XDM, depending on your setup) will continue to log you into your previous desktop, so you must override that before logging in. - -With SDDM: - -![][11] - -With GDM: - -![][12] - -### ROX desktop features - -The ROX desktop is simple by default, with a single panel at the bottom of the screen and a shortcut icon to your home directory on the desktop. The panel contains shortcuts to common locations. That's all there is to the ROX desktop, at least as it's configured out of the box. If you want a clock or a calendar or a system tray, you need to find applications that provide them. - -![Default ROX desktop][13] - -There is no taskbar, as such, but when you minimize a window, it becomes a temporary icon on your desktop. You can click the icon to bring its window back to its former size and placement. - -The panel can be modified some, as well. You can place different shortcuts into it and even create your own applets. - -There's no application menu, either, nor are there shortcuts to applications in a contextual menu. Instead, you can navigate manually to **/usr/share/applications**, or you can add your application directory or directories to the ROX panel. - -![ROX desktop][14] - -The ROX desktop's workflow concentrates on being mouse-driven, reminiscent of Mac OS 7.5 and 8. With ROX-filer, you can manage permissions, file management, introspection, script launching, background setting, and nearly anything else you can think of, provided that you're patient enough for the point-and-click style of interaction. For power users, this seems slow, but ROX manages to make it relatively painless and very intuitive. - -### App directories, AppRun, and AppImage - -The ROX desktop has an elegant convention by which a directory containing a script named **AppRun** is executed as if it were an application. This means that in order to make a ROX app, all you have to do is compile code into a directory, place a script called **AppRun** at the root of that directory to execute the binary you've compiled, and then mark the directory executable. ROX-Filer displays a directory configured in the manner you set with a special icon and color. When you click on an app directory, ROX-Filer automatically runs the **AppRun** script inside. It looks and behaves exactly like an application that has been installed, but it's local to the user's home directory and requires no special permissions. - -This is a convenience feature, but it's one of those small features that feels great when you use it because it's so easy to implement. It's by no means essential, and it's only a few steps ahead of building an application locally, hiding the directory somewhere out of the way, and drumming up a quick **.desktop** file to act as your launcher. However, the concept of an application directory has been [cited][15] as an inspiration for the [AppImage][16] packaging system. - -### Why you should try ROX desktop - -Getting ROX set up and usable is somewhat difficult, and it appears to truly be abandoned. However, its legacy lives on in many ways today, and it's a fascinating and fun bit of Linux history. It may not become your primary desktop, but if you're looking for a fun trip back in time, then ROX is well worth a go. Explore it, customize it, and see what clever ideas it contains. There may yet be hidden gems that the open source community can benefit from. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/linux-rox-desktop - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) -[2]: http://rox.sourceforge.net/desktop/ -[3]: https://www.riscosopen.org/content/ -[4]: http://rox.sourceforge.net/desktop/ROX-Filer -[5]: http://roxterm.sourceforge.net/ -[6]: http://rox.sourceforge.net/desktop/ROX-Lib -[7]: https://opensource.com/article/17/7/how-unzip-targz-file -[8]: http://rox.sourceforge.net/desktop/ROX-Session.html -[9]: https://wiki.debian.org/BuildingTutorial -[10]: https://docs.pagure.org/docs-fedora/installing-software-from-source.html -[11]: https://opensource.com/sites/default/files/advent-kdm_0.jpg -[12]: https://opensource.com/sites/default/files/advent-gdm_1.jpg -[13]: https://opensource.com/sites/default/files/uploads/advent-rox.jpg (Default ROX desktop) -[14]: https://opensource.com/sites/default/files/uploads/advent-rox-custom.jpg (ROX desktop) -[15]: https://github.com/AppImage/AppImageKit/wiki/AppDir -[16]: https://appimage.org/ diff --git a/translated/tech/20191216 Relive Linux history with the ROX desktop.md b/translated/tech/20191216 Relive Linux history with the ROX desktop.md new file mode 100644 index 0000000000..42b9c52dde --- /dev/null +++ b/translated/tech/20191216 Relive Linux history with the ROX desktop.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Relive Linux history with the ROX desktop) +[#]: via: (https://opensource.com/article/19/12/linux-rox-desktop) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +用 ROX 桌面版重温 Linux 历史 +====== + +> 这篇文章是 Linux 桌面 24 天特别系列的一部分。如果你想来一次有趣的时光之旅,ROX 桌面非常值得一试。 + +![Person typing on a 1980's computer][1] + +[ROX][2] 桌面已经不再积极开发,而它的遗留问题至今仍然存在,即使在它活跃开发的时候,它也是一个另类的 Linux 桌面。当其他的桌面感觉与旧的 Unix 或 Windows 界面大致相似时,ROX 则属于 BeOS、AmigaOS 和 [RISC OS][3] 桌面阵营。 + +它专注于拖放式操作(这使得它的可访问性对某些用户来说并不理想)、点击式操作、弹出式上下文菜单,以及一个独特的应用程序目录系统,无需安装即可运行本地应用程序。 + +### 安装 ROX + +如今,ROX 基本上都被遗弃了,只剩下一点残渣碎片留给用户自己去收集整理。幸运的是,这个难题相对来说比较容易解决,但是当你在发行版的软件仓库中找到 ROX 桌面的碎片时,不要被迷惑了,因为那并不是 ROX 桌面所有的碎片。ROX 常用的部分 —— 文件管理器([ROX-Filer][4])和终端([ROXTerm][5]) —— 似乎在大多数流行的发行版软件仓库中都有存在,你可以将它们作为独立的应用程序安装(和使用)。然而,要运行 ROX 桌面,你必须同时安装 ROX-Session 和它所依赖的库。 + +我在 Slackware 14.2 上安装了 ROX,但它应该可以在任何 Linux 或 BSD 系统上运行。 + +首先,你必须从其版本库中安装 [ROX-lib2][6]。按照它的理念,你要安装 ROX-lib2,只需下载tarball、[解压][7],然后将 `ROX-lib` 目录移动到 `/usr/local/lib` 下。 + +接下来,你要安装 [ROX-Session][8]。这可能需要从源码中编译,因为它很可能不在你的软件仓库中。编译过程需要编译工具,这些工具在 Slackware 上是默认提供的,但在其他发行版中往往会被省略,以节省初始下载空间。根据你的发行版不同,你必须安装的包的名称也不同,所以请参考文档来了解具体内容。例如,在 Debian 发行版中,你可以在 [Debian 的 wiki][9] 中了解构建需求,而在 Fedora 发行版中,请参考 [Fedora 的文档][10]。安装了构建工具后,执行自定义的 ROX-Session 构建脚本。 + +``` +$ ./AppRun +``` + +这个脚本会自己管理构建和安装,并提示你需要 root 权限,以在你的登录屏上将其添加为一个选项。 + +如果你还没有从你的软件库中安装 ROX-Filer,请在继续之前安装。 + +这些组件共同组成了一个完整的 ROX 桌面。要登录到新桌面,请从当前桌面会话中注销。默认情况下,你的会话管理器(KDM、GDM、LightDM 或 XDM,视你的设置而定)会继续登录到您之前的桌面,所以在登录前必须覆盖。 + +使用 SDDM: + +![][11] + +使用 GDM: + +![][12] + +### ROX桌面特性 + +ROX 桌面默认情况下很简单,屏幕底部有一个面板,桌面上有一个通往主目录的快捷方式图标。面板中包含了一些常用位置的快捷方式。这就是 ROX 桌面的全部功能,至少在安装后就是这样。如果你想要时钟或日历或系统托盘,你需要找到提供这些功能的应用程序。 + +![Default ROX desktop][13] + +虽然没有任务栏,但当你将窗口最小化时,它就会成为桌面上的一个临时图标。你可以点击该图标,将其窗口恢复到以前的大小和位置。 + +面板也可以进行一些修改。你可以在其中放置不同的快捷方式,甚至可以创建自己的小程序。 + +没有应用菜单,也没有上下文菜单中的应用快捷方式。相反,你可以手动导航到 `/usr/share/applications`,或者你可以将你的应用目录或目录添加到 ROX 面板中。 + +![ROX desktop][14] + +ROX 桌面的工作流程集中在鼠标驱动上,让人联想到 Mac OS 7.5 和 8 系统。通过 ROX-filer,你可以管理权限、文件管理、内省introspection、脚本启动、后台设置,以及几乎所有你能想到的东西,只要你有足够的耐心,就可以实现点击式的交互。对于高级用户来说,这似乎很慢,但 ROX 设法让它变得相对无痛,而且非常直观。 + +### 应用程序目录、AppRun 和 AppImage + +ROX 桌面有一个优雅的惯例,在这个惯例中,包含一个名为 `AppRun` 的脚本的目录就可以像一个应用程序一样被执行。这意味着,要制作一个 ROX 应用程序,你所要做的就是将代码编译到一个目录中,将一个名为`AppRun` 的脚本放在该目录的根目录下,执行你所编译的二进制文件,然后将该目录标记为可执行。ROX-Filer 会按照你设置的方式来显示一个目录,并以特殊的图标和颜色显示一个目录。当你点击一个应用程序目录,ROX-Filer 会自动运行里面的 `AppRun` 脚本。它的外观和行为就像一个已经安装好的应用程序,但它是在用户的主目录下的本地目录,不需要特殊的权限。 + +这是一个方便的功能,但它是那些你使用时感觉很好的小功能之一,因为它很容易做到。它绝不是必要的,它只是比在本地建立一个应用程序,将目录隐藏在某个不显眼的地方,并建立一个快速的 `.desktop` 文件作为你的启动器,要领先了几步。然而,应用程序目录的概念已经当做灵感被 [AppImage][16] 打包系统所 [借鉴][15] 。 + +### 为什么应该试试 ROX 桌面 + +把 ROX 设置好并使用是有些困难的,它似乎真的被抛弃了。然而,它的遗产在今天以多种方式继续存在,它是 Linux 历史上的一段迷人而有趣的历史。它可能不会成为你的主要桌面,但如果你想来一次有趣的回溯之旅,那么 ROX 非常值得一试。探索它、定制它,看看它包含了哪些巧妙的想法。也许还有一些隐藏的宝石可以让开源社区受益。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/linux-rox-desktop + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) +[2]: http://rox.sourceforge.net/desktop/ +[3]: https://www.riscosopen.org/content/ +[4]: http://rox.sourceforge.net/desktop/ROX-Filer +[5]: http://roxterm.sourceforge.net/ +[6]: http://rox.sourceforge.net/desktop/ROX-Lib +[7]: https://opensource.com/article/17/7/how-unzip-targz-file +[8]: http://rox.sourceforge.net/desktop/ROX-Session.html +[9]: https://wiki.debian.org/BuildingTutorial +[10]: https://docs.pagure.org/docs-fedora/installing-software-from-source.html +[11]: https://opensource.com/sites/default/files/advent-kdm_0.jpg +[12]: https://opensource.com/sites/default/files/advent-gdm_1.jpg +[13]: https://opensource.com/sites/default/files/uploads/advent-rox.jpg (Default ROX desktop) +[14]: https://opensource.com/sites/default/files/uploads/advent-rox-custom.jpg (ROX desktop) +[15]: https://github.com/AppImage/AppImageKit/wiki/AppDir +[16]: https://appimage.org/ From 7233ba0593a6ecda4d34ad480df05a9ee94d5e2f Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Wed, 15 Apr 2020 16:54:31 +0800 Subject: [PATCH 0293/1809] Update 20200320 Build a private social network with a Raspberry Pi.md --- ...0 Build a private social network with a Raspberry Pi.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sources/tech/20200320 Build a private social network with a Raspberry Pi.md b/sources/tech/20200320 Build a private social network with a Raspberry Pi.md index f95096bff7..935132b29e 100644 --- a/sources/tech/20200320 Build a private social network with a Raspberry Pi.md +++ b/sources/tech/20200320 Build a private social network with a Raspberry Pi.md @@ -7,13 +7,12 @@ [#]: via: (https://opensource.com/article/20/3/raspberry-pi-open-source-social) [#]: author: (Giuseppe Cassibba https://opensource.com/users/peppe8o) -Build a private social network with a Raspberry Pi +用树莓派搭建一个私人社交网络 ====== -Step-by-step instructions on how to create your own social network with -low-cost hardware and simple setup. +手把手教你怎样以低硬件成本和简易步骤搭建自己的社交网络。 ![Team of people around the world][1] -Social networks have revolutionized people's lives in the last several years. People use social channels every day to stay connected with friends and family. But a common question remains regarding privacy and data security. Even if social networks have created complex privacy policies to protect users, maintaining your data in your own server is always the best option if you don't want to make them available to the public. +近年来,社交网络已经革新了人们的生活习惯。为了维持与朋友和加人的联系,人们每天都会使用社交频道。但是涉及到隐私和数据安全时,仍有一些普遍问题。尽管社交网络创建了复杂的隐私策略来保护用户的信息,但如果你不想自己的信息公之于众,最好的办法还是把数据保存在自己的服务器上。 Again, a Raspberry Pi—Raspbian Lite version can be very versatile to help you put a number of useful home services (see also my [Raspberry Pi projects][2] article) in place. Some addictive features can be achieved by searching for open source software and testing it with this fantastic device. An interesting example to try is installing OpenSource Social Network in your Raspberry Pi. From 8c087166c1b10b0f42cf619647a4228a5441e878 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Apr 2020 19:32:09 +0800 Subject: [PATCH 0294/1809] PRF @geekpi --- ... The Beautiful Deepin Desktop to Ubuntu.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/translated/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md b/translated/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md index 254e3e09eb..07c422b65f 100644 --- a/translated/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md +++ b/translated/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md @@ -1,58 +1,58 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu) [#]: via: (https://itsfoss.com/ubuntudde/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -新的 Linux 发行版 UbuntuDDE 将漂亮的 Deepin 桌面带到 Ubuntu +新的 Linux 发行版 UbuntuDDE 将漂亮的深度桌面带到 Ubuntu ====== -Deepin 是有直观 UI 的漂亮桌面环境。UbuntuDDE 项目结合了 Ubuntu 的强大和 Deepin 之美。 +深度是一个漂亮桌面环境,拥有直观的 UI。UbuntuDDE 项目结合了 Ubuntu 的强大和深度之美。 -[Deepin 桌面环境][1](DDE)是由 [Deepin Linux][2] 的开发人员创建的漂亮桌面环境。最初,Deepin Linux 基于 [Ubuntu][3],但后来他们切换到了 [Debian][4]。 +[深度桌面环境][1](DDE)是由[深度 Linux][2] 的开发人员创建的漂亮桌面环境。最初,深度 Linux 基于 [Ubuntu][3],但后来他们切换到了 [Debian][4]。 ![Deepin Desktop Environment in Ubuntu][5] -Deepin Linux 的一个主要问题是服务器速度较慢。常规系统需要花几个小时才能下载,因为它们的所有服务器都在中国,而且这些服务器非常慢。 +深度 Linux 的一个主要问题是它的下载服务器速度较慢。常规系统需要花几个小时才能下载,因为他们的所有服务器都在中国,而这些服务器很不幸的是速度极慢。 -如果你想使用 Deepin 桌面,那没有什么可以阻止你将其安装在常规 Ubuntu 系统上。[UbuntuDDE][6] 试图通过在 Ubuntu 之上为你提供开箱即用的 Deepin 桌面体验来使其更简单。这样可以节省你在 Ubuntu 上安装和配置 Deepin 的时间和精力。 +如果你想使用深度桌面,那没有什么可以阻止你将其安装在常规 Ubuntu 系统上。[UbuntuDDE][6] 试图通过在 Ubuntu 之上为你提供开箱即用的深度桌面体验来使其更简单。这样可以节省你在 Ubuntu 上安装和配置深度桌面的时间和精力。 ![Screenshot of UbuntuDDE][7] -### Ubuntu DDE:Ubuntu 的强大和 Deepin 桌面的漂亮 +### Ubuntu DDE:Ubuntu 的强大和深度桌面的漂亮 -请注意,UbuntuDDE 不是 Ubuntu 的官方变种。UbuntuDDE 的开发人员与 Ubuntu 团队无关。UbuntuDDE 目前一个混合发行版,其目标是在未来的发行版中被公认为 Ubuntu 的官方变种。 +请注意,UbuntuDDE 不是 Ubuntu 的官方变种。UbuntuDDE 的开发人员与 Ubuntu 团队无关。UbuntuDDE 目前一个混合发行版,其目标是在未来的发行版中被接纳为 Ubuntu 的官方变种。 -UbuntuDDE 开发人员得到了 Ubuntu Snapcraft 团队的 Alan Pope 以及 Ubuntu Budgie 团队和 [Ubuntu Cinnamon][8] 团队以及其他开发者的帮助。 +UbuntuDDE 开发人员得到了 Ubuntu Snapcraft 团队的 Alan Pope、Ubuntu Budgie 团队和 [Ubuntu Cinnamon][8] 团队,以及其他开发者,如 Hualet Wang 和 Felix Yan 的帮助。 -在与 FOSS 的对话中,其主要开发人员 Arun 强调说,该项目的重要方面是定期维护 Ubuntu 的 DDE 软件包,并帮助用户享受 DDE(深度桌面环境)的全部乐趣。 +在与 FOSS 的对话中,其主要开发人员 Arun 强调说,该项目的重点是定期维护 Ubuntu 的 DDE 软件包,并帮助用户享受 DDE(深度桌面环境)的全部乐趣。 ![Ubuntu Deepin Edition login screen][9] -Arun 还提到,这个 Ubuntu Deepin 混合项目首先是维护和打包来自上游(即 Deepin 仓库)的最新版本。然后,它最终与 Ubuntu 20.04 focal 结合,生成了一个镜像文件,每个人都可以安装,而不必麻烦地先安装常规的 Ubuntu,然后再安装 Deepin Desktop。UbuntuDDE 不仅是 DDE 和 Ubuntu 的组合,而且还是 UbuntuDDE 团队软件包选择和设计变更的融合。 +Arun 还提到,这个 Ubuntu 和深度的混合项目首先是维护和打包来自上游(即深度仓库)的最新版本。然后,它最终与 Ubuntu 20.04 focal 结合,生成了一个镜像文件,每个人都可以安装,而不必麻烦地先安装常规的 Ubuntu,然后再安装深度桌面。UbuntuDDE 不仅是 DDE 和 Ubuntu 的组合,而且还是 UbuntuDDE 团队的软件包选择和设计变更的融合。 ![UbuntuDDE screenshot][10] -与 Deepin Linux 不同,UbuntuDDE 不使用 Deepin Appstore。它改用 Ubuntu 软件中心。如果你对[基于武汉的 Deepin Linux 的间谍软件标签][11]感到不满意,这将是一个好消息。 +与 Deepin Linux 不同,UbuntuDDE 不使用深度应用商店。它改用 Ubuntu 软件中心。如果你被[这个来自武汉的深度 Linux 的间谍软件谣言][11]吓到了,这应该是一个好消息。 ### 下载 UbuntuDDE 20.04 Beta UbuntuDDE 的目标是与 Ubuntu 20.04 一起发布第一个正式的稳定版本。像[其他 Ubuntu 变种][12]一样,UbuntuDDE 20.04 beta 也可供你下载并尝试。 -警告! +> 警告! +> +> 一句话警告。 UbuntuDDE 是正在开发的新手项目。请不要在你的主用系统上使用它。如果要尝试,请在虚拟机或备用系统中使用它。 -一句话警告。 UbuntuDDE 是正在开发的新手项目。请不要在你的主系统上使用它。如果要尝试,请在虚拟机或备用系统中使用它。 - -[Download Ubuntu 20.04 DDE Beta][13] +- [下载 Ubuntu 20.04 DDE Beta][13] ![Installing UbuntuDDE][14] -由于本质上是 Ubuntu,因此安装 UbuntuDDE 与安装 Ubuntu 相同。你可以参考本教程,其中展示了[如何在 VirtualBox 内安装 Ubuntu][15]。 +由于本质上是 Ubuntu,因此安装 UbuntuDDE 与安装 Ubuntu 相同。你可以参考这篇教程,其中展示了[如何在 VirtualBox 内安装 Ubuntu][15]。 -我知道你可能会认为这“不是另一个 Ubuntu” 或者“只是 Ubuntu 上的 Deepin,任何人都可以做”。但是我也知道有一小部分用户喜欢像 UbuntuDDE 这样的项目,这对他们来说使事情变得容易。我的意思是有许多 Ubuntu 变种出现了。你怎么看? +我知道你可能会认为这“不过是另一个 Ubuntu” 或者“只是 Ubuntu 上的深度,任何人都可以做到的”。但是我也知道有一小部分用户喜欢像 UbuntuDDE 这样的项目,这对他们来说使事情变得容易。我的意思是有许多 Ubuntu 变种就是这样出现的。你怎么看? -------------------------------------------------------------------------------- @@ -61,7 +61,7 @@ via: https://itsfoss.com/ubuntudde/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e1446f5d07c8160925d91907dafd1b0514de6f3a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Apr 2020 19:32:36 +0800 Subject: [PATCH 0295/1809] PUB @geekpi https://linux.cn/article-12114-1.html --- ...UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md (98%) diff --git a/translated/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md b/published/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md similarity index 98% rename from translated/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md rename to published/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md index 07c422b65f..87410d1362 100644 --- a/translated/tech/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md +++ b/published/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12114-1.html) [#]: subject: (New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu) [#]: via: (https://itsfoss.com/ubuntudde/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 1d4165a7ce7903f9159741a917eba5898a51f7ef Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Wed, 15 Apr 2020 23:54:53 +0800 Subject: [PATCH 0296/1809] TSL 20200320 Build a private social network with a Raspberry Pi.md --- ...vate social network with a Raspberry Pi.md | 372 ++++++++++++++++++ 1 file changed, 372 insertions(+) create mode 100644 translated/tech/20200320 Build a private social network with a Raspberry Pi.md diff --git a/translated/tech/20200320 Build a private social network with a Raspberry Pi.md b/translated/tech/20200320 Build a private social network with a Raspberry Pi.md new file mode 100644 index 0000000000..f965751d90 --- /dev/null +++ b/translated/tech/20200320 Build a private social network with a Raspberry Pi.md @@ -0,0 +1,372 @@ +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Build a private social network with a Raspberry Pi" +[#]: via: "https://opensource.com/article/20/3/raspberry-pi-open-source-social" +[#]: author: "Giuseppe Cassibba https://opensource.com/users/peppe8o" + +用树莓派搭建一个私人社交网络 +====== +手把手教你怎样以低硬件成本和简易步骤搭建自己的社交网络。 +![Team of people around the world][1] + +近年来,社交网络已经革新了人们的生活习惯。为了维持与朋友和家人的联系,人们每天都会使用社交频道。但是涉及到隐私和数据安全时,仍有一些普遍问题。尽管社交网络创建了复杂的隐私策略来保护用户的信息,但如果你不想自己的信息被泄露,最好的办法还是把数据保存在自己的服务器上。 + +一个树莓派 — 多才多艺的 Raspbian Lite 版本就可以让你搭建很多有用的家庭服务(参照我的文章[树莓派项目][2])。通过搜索开源软件你就可以实现一些令人痴迷的功能,你也可以用这个神奇的设备来感受那些功能。其中一个有趣的尝试就是在你的树莓派上安装 OSSN(译注:OpenSource Social Network)。 + +### OSSN是什么? + +[OSSN][3] 是用 PHP 写的一个快速开发社交网络软件,让你可以搭建自己的社交网站。OSSN 可以用来搭建不同类型的社交应用,如: + + * 私人内部网 + * 公用/公开网络 + * 社区 + + + +OSSN 支持的功能: + + * 照片 + * 个人资料 + * 朋友圈 + * 表情 + * 搜索 + * 聊天 + + + +OSSN 运行在 LAMP 服务器上。硬件需求很简单,却能提供强大的用户界面,也友好支持移动端。 + +### 我们需要准备什么 + +这个项目很简单,而且由于我们只安装远程 web 服务,因此我们只需要一些便宜的零件就够了。我使用的是树莓派 3B+,但是用树莓派 3A+ 或其他更新的板应该也可以。 + +硬件: + + * 带有电源模块的树莓派 3B+ + * 一张 SD 卡(最好是性能好点的卡,至少 16 GB) + * 一台有 SFTP 软件(如免费的 [Filezilla][4])的桌面 PC,用来把安装包传到你的树莓派上 + + + +### 操作步骤 + +我们首先搭建一个传统的 LAMP 服务器,然后配置数据库用户和安装 OSSN。 + +#### 1\. 安装 Raspbian Buster Lite 操作系统 + +你可以直接参照我的文章[在你的树莓派上安装 Raspbian Buster Lite][5]。 + +为了确保你的系统是最新的,ssh 登录到树莓派后在终端输入下面的命令: + + +```bash +sudo apt-get update +sudo apt-get upgrade +``` + +#### 2\. 安装 LAMP 服务 + +LAMP(Linux–Apache–Mysql–Php)服务通常与 MySQL 数据库配合。在我们的项目中,我们选择 MariaDB,因为它更轻量,完美支持树莓派。 + +#### 3\. 安装 Apache 服务: + + +``` +`sudo apt-get install apache2 -y` +``` + +你可以通过在浏览器输入 `http://<>` 来检查 Apache 是否安装正确: + +![][6] + +#### 4\. 安装 PHP: + + +``` +`sudo apt-get install php -y` +``` + +#### 5\. 安装 MariaDB 服务和 PHP connector: + + +``` +`sudo apt-get install mariadb-server php-mysql -y` +``` + +#### 6\. 安装 phpMyAdmin: + +在 OSSN 中 phpMyAdmin 不是强制安装的,但我建议你安装,因为它可以简化数据库的管理。 + + +``` +`sudo apt-get install phpmyadmin` +``` + +在 phpMyAdmin 配置界面,执行以下步骤: + + * 按下空格和 OK 选择 apache(强制)。 + * 在 dbconfig-common 选择是,配置 phpMyAdmin 的数据库。 + * 输入想设置的密码,按下 OK。 + * 再次输入 phpMyAdmin 密码来确认,按下 OK。 + + + +#### 7\. 为 phpMyAdmin 用户添加数据库权限来管理数据库: + +我们用 root 用户连接 MariaDB(默认没有密码)来设置权限。 + + +``` +sudo mysql -uroot -p +grant all privileges on *.* to 'phpmyadmin'@'localhost'; +flush privileges; +quit +``` + +#### 8\. 最后,重启 Apache 服务: + + +``` +`sudo systemctl restart apache2.service` +``` + +在浏览器输入 `http://<>/phpmyadmin/` 来检查 phpMyAdmin 是否正常: + +![][7] + +默认的 phpMyAdmin 登录凭证: + + * 用户名:phpmyadmin + * 密码:在 phpMyAdmin 安装步骤中你设置的密码 + + + +### 安装 OSSN 所需的其他包和配置 PHP + +在第一次配置 OSSN 前,我们还需要在系统上安装一些所需的包: + + * PHP 版本 5.6,7.0 或 7.1 + * MYSQL 5 及以上 + * APACHE + * MOD_REWRITE + * 需要打开 PHP 扩展 cURL 和 Mcrypt + * PHP GD 扩展 + * PHP ZIP 扩展 + * 打开 PHP 设置 allow_url_fopen + * PHP JSON 支持 + * PHP XML 支持 + * PHP OpenSSL + + + +在终端输入以下命令来安装上述包: + + +``` +`sudo apt-get install php7.3-curl php7.3-gd php7.3-zip php7.3-json php7.3-xml` +``` + +#### 1\. 打开 MOD_REWRITE: + + +``` +`sudo a2enmod rewrite` +``` + +#### 2\. 修改默认的 Apache 配置,使用 mod_rewrite: + + +``` +`sudo nano /etc/apache2/sites-available/000-default.conf` +``` + +#### 3\. 在 **000-default.conf** 文件中添加下面的内容: + + +```ini + + ServerAdmin webmaster@localhost + DocumentRoot /var/www/html + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + # SECTION TO ADD -------------------------------- + + Options Indexes FollowSymLinks MultiViews + AllowOverride All + Require all granted + + # END SECTION TO ADD -------------------------------- + +``` + +#### 4\. 安装 Mcrypt: + + +```bash +sudo apt install php-dev libmcrypt-dev php-pear +sudo pecl channel-update pecl.php.net +sudo pecl install mcrypt-1.0.2 +``` + +#### 5\. 在 `/etc/php/7.3/apache2/php.ini` 文件中添加 `extension=mcrypt.so`(或取消注释)打开 Mcrypt 模块: + + +```bash +sudo nano /etc/php/7.3/apache2/php.ini +``` + +**allow_url_fopen** 应该已经在 `/etc/php/7.3/apache2/php.ini` 文件中打开了。OpenSSL 应该在 php7.3 中安装了。 + +#### 6\. 我建议的另一个设置是把 PHP 最大上传文件数修改为 16 MB: + + +``` +`sudo nano /etc/php/7.3/apache2/php.ini` +``` + +#### 7\. 搜索到 **upload_max_filesize** 所在的行,参照下面的设置: + + +``` +`upload_max_filesize = 16M` +``` + +#### 8\. 保存并退出,重启 Apache: + + +``` +`sudo systemctl restart apache2.service` +``` + +### 安装 OSSN + +#### 1\. 创建数据库,设置用户: + +回到 phpmyadmin web页面(浏览器输入 `http://<>/phpmyadmin/`)并登录: + +用户名: phpmyadmin + +密码:在 phpMyAdmin 安装步骤中你设置的密码 + +点击数据库标签页: + +![][8] + +创建一个数据库,记下数据库的名字,因为在之后的安装过程中,你要手动输入它。 + +![][9] + +现在为 OSSN 创建一个数据库用户,我使用下面的凭证: + +用户名: ossn_db_user + +密码: ossn_db_password + +在终端输入下面的命令(如果你没有修改过密码,root 密码应该仍然是空): + + +```bash +sudo mysql -uroot -p +CREATE USER 'ossn_db_user'@'localhost' IDENTIFIED BY 'ossn_db_password'; +GRANT ALL PRIVILEGES ON ossn_db.* TO 'ossn_db_user'@'localhost'; +flush privileges; +quit +``` + +#### 2\. 安装 OSSN 软件: + +在你 PC 上从 [OSSN 下载页面][10] 下载 OSSN 安装压缩文件,保存为文件 `ossn-v5.2-1577836800.zip`。 + +使用你习惯的 SFTP 软件把整个压缩文件通过 SFTP 传到树莓派的新目录 `/home/pi/download` 下。常用的(默认)SFP 连接参数是: + + * 主机:你树莓派的 IP 地址 + * 用户名:pi + * 密码:raspberry(如果没有修改过默认密码) + * 端口: 22 + + + +在终端输入: + + +```bash +cd /home/pi/download/ #Enter directory where OSSN installation files have been transferred +unzip ossn-v5.2-1577836800.zip #Extracts all files from zip +cd /var/www/html/ #Enter Apache web directory +sudo rm index.html #Removes Apache default page - we'll use OSSN one +sudo cp -R /home/pi/download/ossn-v5.2-1577836800/* ./ #Copy installation files to web directory +sudo chown -R www-data:www-data ./ +``` + +创建数据文件夹:OSSN 需要一个文件夹来存放数据。出于安全目的,OSSN 建议这个文件夹创建在公开文档根目录之外。所以,我们在 `/opt` 下创建。 + + +```bash +sudo mkdir /opt/ossn_data +sudo chown -R www-data:www-data /opt/ossn_data/ +``` + +在浏览器输入 `http://<>` 来开始安装向导。 + +![][11] + +所有项都检查完后,点击页面最下面的下一步按钮。 + +![][12] + +阅读证书验证并点击页面最下面的下一步按钮来接受证书。 + +![][13] + +输入数据库用户名,密码和你选择的数据库名字,记得也要输入 OSSN 数据文件夹名称。点击安装。 + +![][14] + +输入你的管理员账号信息,点击创建按钮。 + +![][15] + +现在所有的工作应该都完成了。点击结束,进入管理员首页。 + +![][16] + +你可以通过 URL `http://<>/administrator` 进入管理员控制面板,普通用户可以访问链接是 `http://<>`。 + +![][17] + +*本文首发在 [peppe8o.com][18]。已获得转载授权。* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/raspberry-pi-open-source-social + +作者:[Giuseppe Cassibba][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/peppe8o +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_global_people_gis_location.png?itok=Rl2IKo12 "Team of people around the world" +[2]: https://peppe8o.com/2019/04/best-raspberry-pi-projects-with-open-source-software/ +[3]: https://www.opensource-socialnetwork.org/ +[4]: https://filezilla-project.org/ +[5]: https://peppe8o.com/2019/07/install-raspbian-buster-lite-in-your-raspberry-pi/ +[6]: https://opensource.com/sites/default/files/uploads/ossn_1_0.jpg +[7]: https://opensource.com/sites/default/files/uploads/ossn_2.jpg +[8]: https://opensource.com/sites/default/files/uploads/ossn_3.jpg +[9]: https://opensource.com/sites/default/files/uploads/ossn_4.jpg +[10]: https://www.opensource-socialnetwork.org/download +[11]: https://opensource.com/sites/default/files/uploads/ossn_5.jpg +[12]: https://opensource.com/sites/default/files/uploads/ossn_6.jpg +[13]: https://opensource.com/sites/default/files/uploads/ossn_7.jpg +[14]: https://opensource.com/sites/default/files/uploads/ossn_8.jpg +[15]: https://opensource.com/sites/default/files/uploads/ossn_9.jpg +[16]: https://opensource.com/sites/default/files/uploads/ossn_10.jpg +[17]: https://opensource.com/sites/default/files/uploads/ossn_11.jpg +[18]: https://peppe8o.com/private-social-network-with-raspberry-pi-and-opensource-social-network/ \ No newline at end of file From 7c9e8536a38506d7f0b6feffa83347a1057d9c0c Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Wed, 15 Apr 2020 23:59:52 +0800 Subject: [PATCH 0297/1809] TSL 20200320 Build a private social network with a Raspberry Pi.md --- ...vate social network with a Raspberry Pi.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20200320 Build a private social network with a Raspberry Pi.md b/translated/tech/20200320 Build a private social network with a Raspberry Pi.md index f965751d90..5325d7e67f 100644 --- a/translated/tech/20200320 Build a private social network with a Raspberry Pi.md +++ b/translated/tech/20200320 Build a private social network with a Raspberry Pi.md @@ -1,11 +1,11 @@ -[#]: collector: "lujun9972" -[#]: translator: "lxbwolf" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " -[#]: subject: "Build a private social network with a Raspberry Pi" -[#]: via: "https://opensource.com/article/20/3/raspberry-pi-open-source-social" -[#]: author: "Giuseppe Cassibba https://opensource.com/users/peppe8o" +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Build a private social network with a Raspberry Pi) +[#]: via: (https://opensource.com/article/20/3/raspberry-pi-open-source-social) +[#]: author: (Giuseppe Cassibba https://opensource.com/users/peppe8o) 用树莓派搭建一个私人社交网络 ====== @@ -352,7 +352,7 @@ via: https://opensource.com/article/20/3/raspberry-pi-open-source-social [a]: https://opensource.com/users/peppe8o [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_global_people_gis_location.png?itok=Rl2IKo12 "Team of people around the world" +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_global_people_gis_location.png?itok=Rl2IKo12 (Team of people around the world) [2]: https://peppe8o.com/2019/04/best-raspberry-pi-projects-with-open-source-software/ [3]: https://www.opensource-socialnetwork.org/ [4]: https://filezilla-project.org/ @@ -369,4 +369,4 @@ via: https://opensource.com/article/20/3/raspberry-pi-open-source-social [15]: https://opensource.com/sites/default/files/uploads/ossn_9.jpg [16]: https://opensource.com/sites/default/files/uploads/ossn_10.jpg [17]: https://opensource.com/sites/default/files/uploads/ossn_11.jpg -[18]: https://peppe8o.com/private-social-network-with-raspberry-pi-and-opensource-social-network/ \ No newline at end of file +[18]: https://peppe8o.com/private-social-network-with-raspberry-pi-and-opensource-social-network/ From 05bbd40796f0eba23c812417fdedd87ebff08ca1 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Thu, 16 Apr 2020 00:08:18 +0800 Subject: [PATCH 0298/1809] TSL --- ...vate social network with a Raspberry Pi.md | 372 ------------------ 1 file changed, 372 deletions(-) delete mode 100644 sources/tech/20200320 Build a private social network with a Raspberry Pi.md diff --git a/sources/tech/20200320 Build a private social network with a Raspberry Pi.md b/sources/tech/20200320 Build a private social network with a Raspberry Pi.md deleted file mode 100644 index 935132b29e..0000000000 --- a/sources/tech/20200320 Build a private social network with a Raspberry Pi.md +++ /dev/null @@ -1,372 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Build a private social network with a Raspberry Pi) -[#]: via: (https://opensource.com/article/20/3/raspberry-pi-open-source-social) -[#]: author: (Giuseppe Cassibba https://opensource.com/users/peppe8o) - -用树莓派搭建一个私人社交网络 -====== -手把手教你怎样以低硬件成本和简易步骤搭建自己的社交网络。 -![Team of people around the world][1] - -近年来,社交网络已经革新了人们的生活习惯。为了维持与朋友和加人的联系,人们每天都会使用社交频道。但是涉及到隐私和数据安全时,仍有一些普遍问题。尽管社交网络创建了复杂的隐私策略来保护用户的信息,但如果你不想自己的信息公之于众,最好的办法还是把数据保存在自己的服务器上。 - -Again, a Raspberry Pi—Raspbian Lite version can be very versatile to help you put a number of useful home services (see also my [Raspberry Pi projects][2] article) in place. Some addictive features can be achieved by searching for open source software and testing it with this fantastic device. An interesting example to try is installing OpenSource Social Network in your Raspberry Pi. - -### What Is OpenSource Social Network? - -[OpenSource Social Network][3] (OSSN) is a rapid-development social networking software written in PHP, that essentially allows you to make a social networking website. OSSN can be used to build different types of social apps, such as: - - * Private Intranets - * Public/Open Networks - * Community - - - -OSSN supports features like: - - * Photos - * Profile - * Friends - * Smileys - * Search - * Chat - - - -OSSN runs on a LAMP server. It has very poor hardware requirements, but an amazing user interface, which is also mobile-friendly. - -### What we need - -This project is very simple and, because we're installing only remote web services, we only need a few cheap parts. I'm going to use a Raspberry Pi 3 model B+, but it should also work with Raspberry Pi 3 model A+ or newer boards. - -Hardware: - - * Raspberry Pi 3 model B+ with its power supply - * a micro SD card (better if it is a performing card, at least 16GB) - * a Desktop PC with an SFTP software (for example, the free [Filezilla][4]) to transfer installation packages into your RPI. - - - -### Step-by-step procedure - -We'll start by setting up a classic LAMP server. We'll then set up database users and install OpenSource Social Network. - -#### 1\. Install Raspbian Buster Lite OS - -For this step, you can simply follow my [Install Raspbian Buster Lite in your Raspberry Pi][5] article. - -Make sure that your system is up to date. Connect via ssh terminal and type following commands: - - -``` -sudo apt-get update -sudo apt-get upgrade -``` - -2\. Install LAMP server - -LAMP (Linux–Apache–Mysql–Php) servers usually come with the MySQL database. In our project, we'll use MariaDB instead, because it is lighter and works with Raspberry Pi.  - -#### 3\. Install Apache server: - - -``` -`sudo apt-get install apache2 -y` -``` - -You should now be able to check that Apache installation has gone correctly by browsing http://<<YouRpiIPAddress>>: - -![][6] - -#### 4\. Install PHP: - - -``` -`sudo apt-get install php -y` -``` - -5\. Install MariaDB server and PHP connector: - - -``` -`sudo apt-get install mariadb-server php-mysql -y` -``` - -6\. Install PhpMyAdmin: - -PhpMyAdmin is not mandatory in OpenSource Social Network, but I suggest that you install it because it simplifies database management. - - -``` -`sudo apt-get install phpmyadmin` -``` - -In the phpMyAdmin setup screen, take the following steps: - - * Select apache (mandatory) with space and press OK. - * Select Yes to configure the database for phpMyAdmin with dbconfig-common. - * Enter your favorite phpMyAdmin password and press OK. - * Enter your phpMyAdmin password again to confirm and press OK - - - -#### 7\. Grant phpMyAdmin user DB privileges to manage DBs: - -We'll connect to MariaDB with root user (default password is empty) to grant permissions. Remember to use semicolons at the end of each command row as shown below: - - -``` -sudo mysql -uroot -p -grant all privileges on *.* to 'phpmyadmin'@'localhost'; -flush privileges; -quit -``` - -8\. Finally, restart Apache service: - - -``` -`sudo systemctl restart apache2.service` -``` - -And check that phpMyAdmin is working by browsing http://<<YouRpiIPAddress>>/phpmyadmin/.  - -![][7] - -Default phpMyAdmin login credentials are: - - * user: phpmyadmin - * password: the one you set up in the phpMyAdmin installation step - - - -### Installing other open source social network-required packages and setting up PHP - -We need to prepare our system for OpenSource Social Network's first setup wizard. Required packages are: - - * PHP version any of 5.6, 7.0, 7.1 - * MYSQL 5 OR > - * APACHE - * MOD_REWRITE - * PHP Extensions cURL & Mcrypt should be enabled - * PHP GD Extension - * PHP ZIP Extension - * PHP settings allow_url_fopen enabled - * PHP JSON Support - * PHP XML Support - * PHP OpenSSL - - - -So we'll install them with following terminal commands: - - -``` -`sudo apt-get install php7.3-curl php7.3-gd php7.3-zip php7.3-json php7.3-xml` -``` - -#### 1\. Enable MOD_REWRITE: - - -``` -`sudo a2enmod rewrite` -``` - -2\. Edit default Apache config to use mod_rewrite: - - -``` -`sudo nano /etc/apache2/sites-available/000-default.conf` -``` - -3\. Add the section so that your **000-default.conf** file appears like the following (excluding comments): - - -``` -<VirtualHost *:80> -    ServerAdmin webmaster@localhost -    DocumentRoot /var/www/html -    ErrorLog ${APACHE_LOG_DIR}/error.log -    CustomLog ${APACHE_LOG_DIR}/access.log combined -    # SECTION TO ADD -------------------------------- -        <Directory /var/www/html> -            Options Indexes FollowSymLinks MultiViews -            AllowOverride All -            Require all granted -        </Directory> -    # END SECTION TO ADD -------------------------------- -</VirtualHost> -``` - -4\. Install Mcrypt: - - -``` -sudo apt install php-dev libmcrypt-dev php-pear -sudo pecl channel-update pecl.php.net -sudo pecl install mcrypt-1.0.2 -``` - -5\. Enable Mcrypt module by adding (or uncommenting) “extension=mcrypt.so" in "/etc/php/7.3/apache2/php.ini": - - -``` -`sudo nano /etc/php/7.3/apache2/php.ini` -``` - -**allow_url_fopen** should be already enabled in "/etc/php/7.3/apache2/php.ini". OpenSSL should be already installed in php7.3. - -#### 6\. Another setting that I suggest is editing the PHP max upload file size up to 16 MB: - - -``` -`sudo nano /etc/php/7.3/apache2/php.ini` -``` - -7\. Look for the row with the **upload_max_filesize** parameter and set it as the following: - - -``` -`upload_max_filesize = 16M` -``` - -8\. Save and exit. Restart Apache: - - -``` -`sudo systemctl restart apache2.service` -``` - -### Install OSSN - -#### 1\. Create DB and set up user: - -Go back to phpmyadmin web page (browse "http://<<YourRpiIPAddress>>/phpmyadmin/") and login: - -User: phpmyadmin - -Password: the one set up in phpmyadmin installation step - -Click on database tab: - -![][8] - -Create a database and take note of the database name, as you will be required to enter it later in the installation process. - -![][9] - -It's time to create a database user for OSSN. In this example, I'll use the following credentials: - -User: ossn_db_user - -Password: ossn_db_password - -So, terminal commands will be (root password is still empty, if not changed by you before): - - -``` -sudo mysql -uroot -p -CREATE USER 'ossn_db_user'@'localhost' IDENTIFIED BY 'ossn_db_password'; -GRANT ALL PRIVILEGES ON ossn_db.* TO 'ossn_db_user'@'localhost'; -flush privileges; -quit -``` - -2\. Install OSSN software: - -Download the OSSN installation zip file from the [OSSN download page][10] on your local PC. At the time of this writing, this file is named "ossn-v5.2-1577836800.zip." - -Using your favorite SFTP software, transfer the entire zip file via SFTP to a new folder in the path "/home/pi/download" on your Raspberry Pi. Common (default) SFP connection parameters are: - - * Host: your Raspberry Pi IP address - * User: pi - * Password: raspberry (if you didn't change the pi default password) - * Port: 22 - - - -Back to terminal: - - -``` -cd /home/pi/download/ #Enter directory where OSSN installation files have been transferred -unzip ossn-v5.2-1577836800.zip #Extracts all files from zip -cd /var/www/html/ #Enter Apache web directory -sudo rm index.html #Removes Apache default page - we'll use OSSN one -sudo cp -R /home/pi/download/ossn-v5.2-1577836800/* ./ #Copy installation files to web directory -sudo chown -R www-data:www-data ./ -``` - -Create a data folder:OSSN requires a folder to store data. OSSN suggests, for security reasons, to create this folder outside of the published document root. So, we'll create this opt-in folder and give grants: - - -``` -sudo mkdir /opt/ossn_data -sudo chown -R www-data:www-data /opt/ossn_data/ -``` - -Browse http://<<YourRpiIPAddress>> to start the installation wizard: - -![][11] - -All checks should be fine. Click the Next button at the end of the page. - -![][12] - -Read the license validation and click the Next button at the end of the page to accept. - -![][13] - -Enter the database user, password, and the DB name you chose. Remember also to enter the OSSN data folder. Press Install. - -![][14] - -Enter your admin account information and press the Create button. - -![][15] - -Everything should be fine now. Press Finish to access the administration dashboard. - -![][16] - -So, administration panel can be reached with URL "http://<<YourRpiIPAddress>>/administrator" while user link will be "http://<<YourRpiIPAddress>>". - -![][17] - -_This article was originally published at [peppe8o.com][18]. Reposted with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/raspberry-pi-open-source-social - -作者:[Giuseppe Cassibba][a] -选题:[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/peppe8o -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_global_people_gis_location.png?itok=Rl2IKo12 (Team of people around the world) -[2]: https://peppe8o.com/2019/04/best-raspberry-pi-projects-with-open-source-software/ -[3]: https://www.opensource-socialnetwork.org/ -[4]: https://filezilla-project.org/ -[5]: https://peppe8o.com/2019/07/install-raspbian-buster-lite-in-your-raspberry-pi/ -[6]: https://opensource.com/sites/default/files/uploads/ossn_1_0.jpg -[7]: https://opensource.com/sites/default/files/uploads/ossn_2.jpg -[8]: https://opensource.com/sites/default/files/uploads/ossn_3.jpg -[9]: https://opensource.com/sites/default/files/uploads/ossn_4.jpg -[10]: https://www.opensource-socialnetwork.org/download -[11]: https://opensource.com/sites/default/files/uploads/ossn_5.jpg -[12]: https://opensource.com/sites/default/files/uploads/ossn_6.jpg -[13]: https://opensource.com/sites/default/files/uploads/ossn_7.jpg -[14]: https://opensource.com/sites/default/files/uploads/ossn_8.jpg -[15]: https://opensource.com/sites/default/files/uploads/ossn_9.jpg -[16]: https://opensource.com/sites/default/files/uploads/ossn_10.jpg -[17]: https://opensource.com/sites/default/files/uploads/ossn_11.jpg -[18]: https://peppe8o.com/private-social-network-with-raspberry-pi-and-opensource-social-network/ From 4db0a315b90fa5d86a1447ad46dfc7c040e3909a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Apr 2020 00:53:30 +0800 Subject: [PATCH 0299/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200415=20Fedo?= =?UTF-8?q?ra=20Origins=20=E2=80=93=20Part=2001?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200415 Fedora Origins - Part 01.md --- .../tech/20200415 Fedora Origins - Part 01.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20200415 Fedora Origins - Part 01.md diff --git a/sources/tech/20200415 Fedora Origins - Part 01.md b/sources/tech/20200415 Fedora Origins - Part 01.md new file mode 100644 index 0000000000..43c381958e --- /dev/null +++ b/sources/tech/20200415 Fedora Origins - Part 01.md @@ -0,0 +1,126 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora Origins – Part 01) +[#]: via: (https://fedoramagazine.org/fedora-origins-part-01/) +[#]: author: (Sylvia Sánchez https://fedoramagazine.org/author/lailah/) + +Fedora Origins – Part 01 +====== + +![][1] + +_Editor’s comment:_ The format of this article is different from the usual article that Fedora Magazine has published: a Fedora origins story told from the point of view of a Fedora user. The author has chosen to tell a story, since to simply present the bare facts is akin to just reading the wiki page about it. + +### Hello World! + +Hello, I am… no, I’m not going to give my real name. Let’s say I’m female, probably shorter and older than you. I used to go by the nick of Isadora, more on that later. + +![Here you have one of the old RH boxes][2] + +Now some context. Back in the late ’90s, internet became popular and PCs started to be a thing. However, most people didn’t have either because it was very expensive and often you could do better with the traditional methods. Yes, computers were very basic back then. I used to play with these pocket games that were fascinating at the time, but totally lame now. Monochrome screens with pixelated flat animations. Not going to dive there, just giving an idea how it was. + +In the mid-90s a company named Red Hat emerged and slowly started to make a profit of its own by selling its own business-oriented distribution and software utilities. The name comes from one of its founders, Marc Ewing, who used to wear a red lacrosse in university so other students could spot him easily and ask him questions. +Of course, as it was a business-oriented distribution, and I was busy with multiple other things, I didn’t pay much attention to it. It lacked the software I needed and since I wasn’t a customer, I was nobody to ask for additions. However, it was Linux and as such Open Source. People started to package stuff for RHL and put it in repositories. I was invited to join the community project, Fedora.us. I promptly declined, misunderstanding the name. It was the second time I got invited that I asked ‘what is with the “US” there (in the name)?` Another user explained it was ‘us’ as in ‘we’ not as in the ‘United States.’ They explained a bit about how the community worked and I decided to give it a go. + +Then my studies got in the way, and I had to shelve it. + +![Login Screen in Fedora Core][3] + +### Press Return + +By the time I came back to Fedora.us it had changed its name to Fedora Project and was actively being worked on from within Red Hat. Now, I wasn’t there so my direct knowledge of how this happened is a bit foggy. Some say that Fedora existed separately and Red Hat added/invited them, some say that Fedora was completely RH’s idea, some say they existed independently and at some point met or joined. Choose the version you like, I’ll put some links down there so you can know more details and decide for yourself. As far as I’m concerned, they worked together. + +Well, as usual someone dropped some CDs with ISOs for me. If I had an euro for every ISO I’ve been offered, or had tossed at my desk, for me to try it, I would be rich. As a matter of fact, I’m not rich but I do have a big rack full of old distros. + +_Anyways_… + +Now it’s the early 2000s and things have changed dramatically. Computers’ prices have dropped and internet speed is increasing, plus a set of new technologies make it cheaper and more reliable. Computers now can do so much more than just a decade ago, and they’re smaller too. Screens are bigger, with better colors and resolution. Laptops are starting to become popular though still expensive and less powerful than desktop PCs. + +During this time, I tried both Fedora and Red Hat. Now, as has been said before, Red Hat focuses on businesses and companies. Their main concern is having exactly the software their customers need, with the features their customers need, delivered as rock solid stability and a reliable update & support cycle. A lot of customization, variety of options and many cool new features are not their main core. More software means more testing and development work and bigger chances of things failing. Yet the technology industry is constantly changing and innovating. Sticking too much to older versions or proven formulas can be fatal for a company. + +So what to do? Well, they solved it with Fedora. Fedora Project would be the innovative, looking ahead test bed, and Red Hat Enterprise Linux was the more conservative, rock solid operating system for businesses. Yes, they changed the name from Red Hat Linux to Red Hat _Enterprise_ Linux. Sounds better, doesn’t it? + +Unsurprisingly, Fedora had a fame of being difficult, unstable and for “hackers only”. Whenever I said I was using Fedora, they would give me odd looks or say something like “I want something stable” or “I’m not into _that_” (meaning they didn’t fancy programming/hacking activities). Countless individuals suggested I might want to use one of the other, beginner-friendly distributions, without themselves even giving Fedora a try! Many would disregard Linux as a whole as an amateur thing, only valid for playing but not good for serious work and companies. To each their own, I suppose. + +![Note the F and the bubble already there][4] + +### Yes, but why? + +Those early versions were called Fedora Core and had a very uncertain release pattern. The six months cycle came much later. Fedora Core got its name because there were two repositories, Core and Extras. Core had the essentials, so to speak, and was maintained by Red Hat. Extras was, well, everything else. Any software that most users would want or need was included there, and it was maintained by a wide range of contributors. + +From the beginning, one of the most powerful reasons for me to use it was the community and its core values. The _Four Foundations_ of Fedora, _Freedom, Features, First & Friends_ were lived and breathed and not just a catchy line on a website or a leaflet. Fedora Project strove (and still does) to deliver the newest features first, caring for freedom (of choice and software) and keeping a good open community, making friends as we contribute to the project. + +I also liked the fact that Fedora, as its purpose was testing for Red Hat, delivered a lot of new software and technologies; it was like opening the window to see the future today. + +The downside was its unreliable upgrade cycle. You could get a new version in a few months or next year… nobody knew, there was no agreed schedule. + +![Note how, despite being Fedora, RH’s logo and signature is omnipresent][5] + +### What was in the box + +Fedora Core kept this name up to the sixth version. From the start, it was meant to be a distribution you could use right after installing it, so it came with Gnome 2, KDE 3, OpenOffice and some browser I forgot, possibly Firefox. + +I remember it being the first to introduce SELinux and SystemD by default, and to replace LILO with GRUB. I also remember the hardware requirements were something at the time, although they now sound laughable: Pentium II 400MHz, 256MB RAM (yes, you read it right) and 2GB of space in disk. It even had an option for terminal only! This would require only 64MB RAM and Pentium II 200MHz. Amazing, isn’t it? + +It had codenames. Not publicly, but it had, and they were quite peculiar. Fedora Core 1 was code named «Yarrow» which is a medium size plant with yellow or white crown-like flowers. Core 2 was Tettnang which is a small town in Baden-Württemberg, Germany. Not sure about Core 3, I think it was Heidelberg, but maybe I’m mixing with later releases. Core 4 was Stentz, if I recall correctly (no idea what it means), Core 5 was a colour, I think Bordeaux, and Core 6 was Zod that _I think_ it was a comic character but I could be wrong. If there was a method in their madness I have no idea. I thought the names amusing but didn’t give a second thought to it as they didn’t affect anything, not even the design of each release. + +![Ah… good ol` genetic helix][6] + +### So what now? + +Well, of course, Fedora Project has evolved from where we have stopped. But that’s for later articles or this one will be too long. For now, I leave you with an extract of an interview with Matthew Miller, current Project Leader and some links in case you want to know more. + +_**Extracts to interview with Matthew Miller, Project Leader.**_ + +Matthew Miller tells about the beginnings in Eduard Lucena’s podcast (transcription [here][7]): _“Fedora started about 15 years ago, really. It actually started as a thing called Fedora.us.” Back in those days, there was Red Hat Linux.” “Meanwhile, there was this thing called Fedora.us which was basically a project to make additional software available to users of Red Hat Linux. Find things that weren’t part of Red Hat Linux, and package them up, and make them available to everybody. That was started as a community project.”_ + +_“Red Hat_ (then) _merged with this [Fedora.us][8] project to form Fedora Project that produces an upstream operating system that Red Hat Enterprise Linux is derived from but then moves on a slower pace.”_ + +_“We were then two parts, Fedora Core, which was basically inherited from the old Red Hat Linux and only Red Hat employees could do anything with and then Fedora Extras, where community could come together to add things on top of that Fedora Core. It took a little while to get off the ground but it was fairly successful”_ + +“_Around the time of Fedora Core 6, those were actually merged together into one big Fedora where all of the packages were all part of the same thing. There was no more distinction of Core and Extras, and everything was all together and, more importantly, all the community was all together._ + +_They invited the community to take ownership of the whole thing and for Red Hat to become part of the community rather than separate. That was a huge success.”_ + +_**Links of interest**_ + +**Fedora, a visual history** +[https://www.phoronix.com/scan.php?page=article&item=678&num=1][9] + +**Red Hat Videos – Fedora’s anniversary** + + +**Red Hat Videos – Default to open** + + +**Fedora’s Mission & Foundations** + + +**A short history of Fedora** + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-origins-part-01/ + +作者:[Sylvia Sánchez][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/lailah/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/fedora-origins-816x352.png +[2]: https://fedoramagazine.org/wp-content/uploads/2020/03/IMG_0554-768x1024.jpeg +[3]: https://fedoramagazine.org/wp-content/uploads/2020/04/15112-1.png +[4]: https://fedoramagazine.org/wp-content/uploads/2020/04/Fedora_Core_5.png +[5]: https://fedoramagazine.org/wp-content/uploads/2020/04/Fedora_Core_3.png +[6]: https://fedoramagazine.org/wp-content/uploads/2020/04/Artwork_FC7Themes_Fc7ThemeProposalFlyingHigh_Fc7ThemeProposalFlyingHighRhgl_rhgb-core6-1.png +[7]: https://x3mboy.fedorapeople.org/podcast/transcripts/transcriptFedoraPodcastEpisode01.html +[8]: http://fedora.us/ +[9]: https://www.phoronix.com/scan.php?page=article&item=678&num=1 From a43913e2469e4ae909a69eb960b393e2c96015f7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Apr 2020 00:58:41 +0800 Subject: [PATCH 0300/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200415=206=20?= =?UTF-8?q?open=20source=20teaching=20tools=20for=20virtual=20classrooms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200415 6 open source teaching tools for virtual classrooms.md --- ...e teaching tools for virtual classrooms.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20200415 6 open source teaching tools for virtual classrooms.md diff --git a/sources/tech/20200415 6 open source teaching tools for virtual classrooms.md b/sources/tech/20200415 6 open source teaching tools for virtual classrooms.md new file mode 100644 index 0000000000..807ebfae3d --- /dev/null +++ b/sources/tech/20200415 6 open source teaching tools for virtual classrooms.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 open source teaching tools for virtual classrooms) +[#]: via: (https://opensource.com/article/20/4/open-source-remote-teaching-tools) +[#]: author: (Mathias Hoffmann https://opensource.com/users/mhopensource) + +6 open source teaching tools for virtual classrooms +====== +Create podcasts, online lectures, tutorials, and other teaching +resources for learning at home with open source tools. +![Person reading a book and digital copy][1] + +As schools and universities are shutting down around the globe due to COVID-19, many of us in academia are wondering how we can get up to speed and establish a stable workflow to get our podcasts, online lectures, and tutorials out there for our students. + +Open source software (OSS) has a key role to play in this situation for many reasons, including: + + * **Speed:** OSS can roll out quickly and in large numbers (e.g., to an army of teaching assistants for multiple tutorial sessions in big lectures) without licensing issues and in a decentralized manner. + * **Cost:** OSS does not cost anything upfront, which is important for financially stretched schools and universities that need solutions to complex challenges on very short notice. + + + +With everything going online, we need new ways to engage with students. Here is a list of tools that I have found useful to share my own lectures.  + +### Create podcasts, videos, or live streams with OBS + +[Open Broadcast Studio (OBS)][2] is a professional, open source audio and video recording tool that allows you to record, stream instantly, and do much more. OBS is available for all major platforms (Windows, macOS, and Linux), so interoperability with your colleagues and their various devices is ensured. + +Even if you're already using online conferencing software as a recording system, OBS can be a great backup solution. Since it records locally, you're protected against any network lags or disconnections. You also have complete control over your data, so many educational institutions may find it to be a more secure solution than some other options. + +Compatibility is also an advantage: OBS stores recordings in a standard intermediate format (MKV), which can be transferred to MP4 or other formats. Also, support for Nvidia graphics cards under OBS is great, as the company is one of the main sponsors of the OBS project. This allows you to make full use of your hardware and speed up the recording process. + +### Video and sound editing + +After you record your podcast or video, you may find that it needs editing. There are many reasons you may need to edit your audio or video. For example, many university online platforms restrict the size of files you can upload, so you may have to cut long videos. Or, the sound may be too quiet, or maybe it was too noisy when you recorded it, so you need to make adjustments to the audio. + +Two of the open source apps to explore are [OpenShot][3] and [Shotcut][4]. Of the two, Shotcut is a more advanced program, which implies a slightly steeper learning curve. Both are cross-platform and have full support for hardware encoding with NVidia and other graphics cards, which will substantially lower processing time compared to CPU-only processing. + +You can also extract a soundtrack in either program (although I have found it to be much faster with Shotcut) and export it to an audio-editing program. I find [Audacity][5], another open source, cross-platform (Mac, Linux, Windows) tool, to work extremely well. + +My typical workflow looks something like this: + + * Import the recording into Shotcut + * Extract the audio, save it to an audio file + * Import it into Audacity, normalize and amplify the audio, maybe do some noise reduction + * Save the audio to a new file + * Import the new audio file into Shotcut, align it with the audio-free video, and cut appropriately + * Export into an MP4 video (this last step usually takes some time, so have a coffee…) + + + +### Electronic blackboards + +If you want to annotate your slides or develop ideas on an electronic blackboard, you need note-taking software and a device with a touchscreen or a graphics tablet. A great open source tool (developed with Swiss taxpayer funding) for blackboarding is [OpenBoard][6]. It is cross-platform; although it is officially only available for Linux on Ubuntu 16.04, you can install a [Flatpak][7] and it will work on any Linux flavor. It is really a nice tool; its only shortcoming is that annotating slides is not very good. + +My main open source annotation and electric blackboard tool is [Xournal++][8], which is available in some Linux distros repos (e.g., Linux Mint) and otherwise via [Flathub][9]. Like all the tools mentioned earlier, it is also available on Mac and Windows. If you know of any open source, cross-platform note-taking tools, please share them in the comments. + +### Built-in solutions have their limits + +You might wonder why you should bother with alternative recording software in the first place. After all, most modern operating systems have built-in screen recorders that will also capture audio. However, these built-in solutions have their limits. One key limitation is that you cannot usually capture more than one video source at a time (e.g., a webcam with your talking head and a set of slides plus a whiteboard from a graphics tablet). + +The ability to use multiple video sources is very useful, though, since it can be dull for students to just listen to your voice and see your slides for extended periods. Face-to-face interactions—even if done virtually—help keep listeners' attention and make it easier for them to cope with imperfect recording quality and background noise. In addition, many of the built-in tools do not allow you to capture selected areas of the screen, and in general, you cannot change the resolution or the number of frames per second, which can be important for keeping your podcast's memory and bandwidth usage in check. + +### Conclusion + +When planning your online teaching, you will want to use a blend of audio, video, slides, and electronic blackboards to create an immersive experience even while students are learning remotely. Open source software offers advanced, effective tools for creating such online educational experiences. + +* * * + +_This article is based on "[Open source software for online teaching in the times of corona][10]" on Mathias Hoffman's blog and is reused with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/open-source-remote-teaching-tools + +作者:[Mathias Hoffmann][a] +选题:[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/mhopensource +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/read_book_guide_tutorial_teacher_student_apaper.png?itok=_GOufk6N (Person reading a book and digital copy) +[2]: https://obsproject.com/ +[3]: http://www.openshot.org/ +[4]: http://www.shotcut.org/ +[5]: https://www.audacityteam.org/ +[6]: http://www.openboard.ch/ +[7]: http://www.flathub.org +[8]: https://github.com/xournalpp/xournalpp +[9]: https://flathub.org/apps/details/com.github.xournalpp.xournalpp +[10]: http://mathiashoffmann.net/2020/03/22/open-source-software-for-online-teaching-in-the-times-of-corona From 28d284fb8ab822e7c7c32e7b31bd067390900606 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Apr 2020 00:59:20 +0800 Subject: [PATCH 0301/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200415=20How?= =?UTF-8?q?=20to=20automate=20your=20cryptocurrency=20trades=20with=20Pyth?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200415 How to automate your cryptocurrency trades with Python.md --- ... your cryptocurrency trades with Python.md | 424 ++++++++++++++++++ 1 file changed, 424 insertions(+) create mode 100644 sources/tech/20200415 How to automate your cryptocurrency trades with Python.md diff --git a/sources/tech/20200415 How to automate your cryptocurrency trades with Python.md b/sources/tech/20200415 How to automate your cryptocurrency trades with Python.md new file mode 100644 index 0000000000..c216d22663 --- /dev/null +++ b/sources/tech/20200415 How to automate your cryptocurrency trades with Python.md @@ -0,0 +1,424 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to automate your cryptocurrency trades with Python) +[#]: via: (https://opensource.com/article/20/4/python-crypto-trading-bot) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) + +How to automate your cryptocurrency trades with Python +====== +In this tutorial, learn how to set up and use Pythonic, a graphical +programming tool that makes it easy for users to create Python +applications using ready-made function modules. +![scientific calculator][1] + +Unlike traditional stock exchanges like the New York Stock Exchange that have fixed trading hours, cryptocurrencies are traded 24/7, which makes it impossible for anyone to monitor the market on their own. + +Often in the past, I had to deal with the following questions related to my crypto trading: + + * What happened overnight? + * Why are there no log entries? + * Why was this order placed? + * Why was no order placed? + + + +The usual solution is to use a crypto trading bot that places orders for you when you are doing other things, like sleeping, being with your family, or enjoying your spare time. There are a lot of commercial solutions available, but I wanted an open source option, so I created the crypto-trading bot [Pythonic][2]. As [I wrote][3] in an introductory article last year, "Pythonic is a graphical programming tool that makes it easy for users to create Python applications using ready-made function modules." It originated as a cryptocurrency bot and has an extensive logging engine and well-tested, reusable parts such as schedulers and timers. + +### Getting started + +This hands-on tutorial teaches you how to get started with Pythonic for automated trading. It uses the example of trading [Tron][4] against [Bitcoin][5] on the [Binance][6] exchange platform. I choose these coins because of their volatility against each other, rather than any personal preference. + +The bot will make decisions based on [exponential moving averages][7] (EMAs). + +![TRX/BTC 1-hour candle chart][8] + +TRX/BTC 1-hour candle chart + +The EMA indicator is, in general, a weighted moving average that gives more weight to recent price data. Although a moving average may be a simple indicator, I've had good experiences using it. + +The purple line in the chart above shows an EMA-25 indicator (meaning the last 25 values were taken into account). + +The bot monitors the pitch between the current EMA-25 value (t0) and the previous EMA-25 value (t-1). If the pitch exceeds a certain value, it signals rising prices, and the bot will place a buy order. If the pitch falls below a certain value, the bot will place a sell order. + +The pitch will be the main indicator for making decisions about trading. For this tutorial, it will be called the _trade factor_. + +### Toolchain + +The following tools are used in this tutorial: + + * Binance expert trading view (visualizing data has been done by many others, so there's no need to reinvent the wheel by doing it yourself) + * Jupyter Notebook for  data-science tasks + * Pythonic, which is the  overall framework + * PythonicDaemon as the  pure runtime (console- and Linux-only) + + + +### Data mining + +For a crypto trading bot to make good decisions, it's essential to get open-high-low-close ([OHLC][9]) data for your asset in a reliable way. You can use Pythonic's built-in elements and extend them with your own logic. + +The general workflow is: + + 1. Synchronize with Binance time + 2. Download OHLC data + 3. Load existing OHLC data from the file into memory + 4. Compare both datasets and extend the existing dataset with the newer rows + + + +This workflow may be a bit overkill, but it makes this solution very robust against downtime and disconnections. + +To begin, you need the **Binance OHLC Query** element and a **Basic Operation** element to execute your own code. + +![Data-mining workflow][10] + +Data-mining workflow + +The OHLC query is set up to query the asset pair **TRXBTC** (Tron/Bitcoin) in one-hour intervals. + +![Configuration of the OHLC query element][11] + +Configuring the OHLC query element + +The output of this element is a [Pandas DataFrame][12]. You can access the DataFrame with the **input** variable in the **Basic Operation** element. Here, the **Basic Operation** element is set up to use Vim as the default code editor. + +![Basic Operation element set up to use Vim][13] + +Basic Operation element set up to use Vim + +Here is what the code looks like: + + +``` +import pickle, pathlib, os +import pandas as pd + +outout = None + +if isinstance(input, pd.DataFrame): +    file_name = 'TRXBTC_1h.bin' +    home_path = str(pathlib.Path.home()) +    data_path = os.path.join(home_path, file_name) + +    try: +        df = pickle.load(open(data_path, 'rb')) +        n_row_cnt = df.shape[0] +        df = pd.concat([df,input], ignore_index=True).drop_duplicates(['close_time']) +        df.reset_index(drop=True, inplace=True) +        n_new_rows = df.shape[0] - n_row_cnt +        log_txt = '{}: {} new rows written'.format(file_name, n_new_rows) +    except: +        log_txt = 'File error - writing new one: {}'.format(e) +        df = input + +    pickle.dump(df, open(data_path, "wb" )) +    output = df +``` + +First, check whether the input is the DataFrame type. Then look inside the user's home directory (**~/**) for a file named **TRXBTC_1h.bin**. If it is present, then open it, concatenate new rows (the code in the **try** section), and drop overlapping duplicates. If the file doesn't exist, trigger an _exception_ and execute the code in the **except** section, creating a new file. + +As long as the checkbox **log output** is enabled, you can follow the logging with the command-line tool **tail**: + + +``` +`$ tail -f ~/Pythonic_2020/Feb/log_2020_02_19.txt` +``` + +For development purposes, skip the synchronization with Binance time and regular scheduling for now. This will be implemented below. + +### Data preparation + +The next step is to handle the evaluation logic in a separate grid; therefore, you have to pass over the DataFrame from Grid 1 to the first element of Grid 2 with the help of the **Return element**. + +In Grid 2, extend the DataFrame by a column that contains the EMA values by passing the DataFrame through a **Basic Technical Analysis** element. + +![Technical analysis workflow in Grid 2][14] + +Technical analysis workflow in Grid 2 + +Configure the technical analysis element to calculate the EMAs over a period of 25 values. + +![Configuration of the technical analysis element][15] + +Configuring the technical analysis element + +When you run the whole setup and activate the debug output of the **Technical Analysis** element, you will realize that the values of the EMA-25 column all seem to be the same. + +![Missing decimal places in output][16] + +Decimal places are missing in the output + +This is because the EMA-25 values in the debug output include just six decimal places, even though the output retains the full precision of an 8-byte float value. + +For further processing, add a **Basic Operation** element: + +![Workflow in Grid 2][17] + +Workflow in Grid 2 + +With the **Basic Operation** element, dump the DataFrame with the additional EMA-25 column so that it can be loaded into a Jupyter Notebook; + +![Dump extended DataFrame to file][18] + +Dump extended DataFrame to file + +### Evaluation logic + +Developing the evaluation logic inside Juypter Notebook enables you to access the code in a more direct way. To load the DataFrame, you need the following lines: + +![Representation with all decimal places][19] + +Representation with all decimal places + +You can access the latest EMA-25 values by using [**iloc**][20] and the column name. This keeps all of the decimal places. + +You already know how to get the latest value. The last line of the example above shows only the value. To copy the value to a separate variable, you have to access it with the **.at** method, as shown below. + +You can also directly calculate the trade factor, which you will need in the next step. + +![Buy/sell decision][21] + +Buy/sell decision + +### Determine the trading factor + +As you can see in the code above, I chose 0.009 as the trade factor. But how do I know if 0.009 is a good trading factor for decisions? Actually, this factor is really bad, so instead, you can brute-force the best-performing trade factor. + +Assume that you will buy or sell based on the closing price. + +![Validation function][22] + +Validation function + +In this example, **buy_factor** and **sell_factor** are predefined. So extend the logic to brute-force the best performing values. + +![Nested for loops for determining the buy and sell factor][23] + +Nested _for_ loops for determining the buy and sell factor + +This has 81 loops to process (9x9), which takes a couple of minutes on my machine (a Core i7 267QM). + +![System utilization while brute forcing][24] + +System utilization while brute-forcing + +After each loop, it appends a tuple of **buy_factor**, **sell_factor**, and the resulting **profit** to the **trading_factors** list. Sort the list by profit in descending order. + +![Sort profit with related trading factors in descending order][25] + +Sort profit with related trading factors in descending order + +When you print the list, you can see that 0.002 is the most promising factor. + +![Sorted list of trading factors and profit][26] + +Sorted list of trading factors and profit + +When I wrote this in March 2020, the prices were not volatile enough to present more promising results. I got much better results in February, but even then, the best-performing trading factors were also around 0.002. + +### Split the execution path + +Start a new grid now to maintain clarity. Pass the DataFrame with the EMA-25 column from Grid 2 to element 0A of Grid 3 by using a **Return** element. + +In Grid 3, add a **Basic Operation** element to execute the evaluation logic. Here is the code of that element: + +![Implemented evaluation logic][27] + +Implemented evaluation logic + +The element outputs a **1** if you should buy or a **-1** if you should sell. An output of **0** means there's nothing to do right now. Use a **Branch** element to control the execution path. + +![Branch element: Grid 3 Position 2A][28] + +Branch element: Grid 3, Position 2A + +Due to the fact that both **0** and **-1** are processed the same way, you need an additional Branch element on the right-most execution path to decide whether or not you should sell. + +![Branch element: Grid 3 Position 3B][29] + +Branch element: Grid 3, Position 3B + +Grid 3 should now look like this: + +![Workflow on Grid 3][30] + +Workflow on Grid 3 + +### Execute orders + +Since you cannot buy twice, you must keep a persistent variable between the cycles that indicates whether you have already bought. + +You can do this with a **Stack element**. The Stack element is, as the name suggests, a representation of a file-based stack that can be filled with any Python data type. + +You need to define that the stack contains only one Boolean element, which determines if you bought (**True**) or not (**False**). As a consequence, you have to preset the stack with one **False**. You can set this up, for example, in Grid 4 by simply passing a **False** to the stack. + +![Forward a False-variable to the subsequent Stack element][31] + +Forward a **False** variable to the subsequent Stack element + +The Stack instances after the branch tree can be configured as follows: + +![Configuration of the Stack element][32] + +Configuring the Stack element + +In the Stack element configuration, set **Do this with input** to **Nothing**. Otherwise, the Boolean value will be overwritten by a 1 or 0. + +This configuration ensures that only one value is ever saved in the stack (**True** or **False**), and only one value can ever be read (for clarity). + +Right after the Stack element, you need an additional **Branch** element to evaluate the stack value before you place the **Binance Order** elements. + +![Evaluate the variable from the stack][33] + +Evaluating the variable from the stack + +Append the Binance Order element to the **True** path of the Branch element. The workflow on Grid 3 should now look like this: + +![Workflow on Grid 3][34] + +Workflow on Grid 3 + +The Binance Order element is configured as follows: + +![Configuration of the Binance Order element][35] + +Configuring the Binance Order element + +You can generate the API and Secret keys on the Binance website under your account settings. + +![Creating an API key in Binance][36] + +Creating an API key in the Binance account settings + +In this tutorial, every trade is executed as a market trade and has a volume of 10,000 TRX (~US$ 150 on March 2020). (For the purposes of this tutorial, I am demonstrating the overall process by using a Market Order. Because of that, I recommend using at least a Limit order.) + +The subsequent element is not triggered if the order was not executed properly (e.g., a connection issue, insufficient funds, or incorrect currency pair). Therefore, you can assume that if the subsequent element is triggered, the order was placed. + +Here is an example of output from a successful sell order for XMRBTC: + +![Output of a successfully placed sell order][37] + +Successful sell order output + +This behavior makes subsequent steps more comfortable: You can always assume that as long the output is proper, the order was placed. Therefore, you can append a **Basic Operation** element that simply writes the output to **True** and writes this value on the stack to indicate whether the order was placed or not. + +If something went wrong, you can find the details in the logging message (if logging is enabled). + +![Logging output of Binance Order element][38] + +Logging output from Binance Order element + +### Schedule and sync + +For regular scheduling and synchronization, prepend the entire workflow in Grid 1 with the **Binance Scheduler** element. + +![Binance Scheduler at Grid 1, Position 1A][39] + +Binance Scheduler at Grid 1, Position 1A + +The Binance Scheduler element executes only once, so split the execution path on the end of Grid 1 and force it to re-synchronize itself by passing the output back to the Binance Scheduler element. + +![Grid 1: Split execution path][40] + +Grid 1: Split execution path + +Element 5A points to Element 1A of Grid 2, and Element 5B points to Element 1A of Grid 1 (Binance Scheduler). + +### Deploy + +You can run the whole setup 24/7 on your local machine, or you could host it entirely on an inexpensive cloud system. For example, you can use a Linux/FreeBSD cloud system for about US$5 per month, but they usually don't provide a window system. If you want to take advantage of these low-cost clouds, you can use PythonicDaemon, which runs completely inside the terminal. + +![PythonicDaemon console interface][41] + +PythonicDaemon console + +PythonicDaemon is part of the basic installation. To use it, save your complete workflow, transfer it to the remote running system (e.g., by Secure Copy [SCP]), and start PythonicDaemon with the workflow file as an argument: + + +``` +`$ PythonicDaemon trading_bot_one` +``` + +To automatically start PythonicDaemon at system startup, you can add an entry to the crontab: + + +``` +`# crontab -e` +``` + +![Crontab on Ubuntu Server][42] + +Crontab on Ubuntu Server + +### Next steps + +As I wrote at the beginning, this tutorial is just a starting point into automated trading. Programming trading bots is approximately 10% programming and 90% testing. When it comes to letting your bot trade with your money, you will definitely think thrice about the code you program. So I advise you to keep your code as simple and easy to understand as you can. + +If you want to continue developing your trading bot on your own, the next things to set up are: + + * Automatic profit calculation (hopefully only positive!) + * Calculation of the prices you want to buy for + * Comparison with your order book (i.e., was the order filled completely?) + + + +You can download the whole example on [GitHub][2]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/python-crypto-trading-bot + +作者:[Stephan Avenwedde][a] +选题:[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/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calculator_money_currency_financial_tool.jpg?itok=2QMa1y8c (scientific calculator) +[2]: https://github.com/hANSIc99/Pythonic +[3]: https://opensource.com/article/19/5/graphically-programming-pythonic +[4]: https://tron.network/ +[5]: https://bitcoin.org/en/ +[6]: https://www.binance.com/ +[7]: https://www.investopedia.com/terms/e/ema.asp +[8]: https://opensource.com/sites/default/files/uploads/1_ema-25.png (TRX/BTC 1-hour candle chart) +[9]: https://en.wikipedia.org/wiki/Open-high-low-close_chart +[10]: https://opensource.com/sites/default/files/uploads/2_data-mining-workflow.png (Data-mining workflow) +[11]: https://opensource.com/sites/default/files/uploads/3_ohlc-query.png (Configuration of the OHLC query element) +[12]: https://pandas.pydata.org/pandas-docs/stable/getting_started/dsintro.html#dataframe +[13]: https://opensource.com/sites/default/files/uploads/4_edit-basic-operation.png (Basic Operation element set up to use Vim) +[14]: https://opensource.com/sites/default/files/uploads/6_grid2-workflow.png (Technical analysis workflow in Grid 2) +[15]: https://opensource.com/sites/default/files/uploads/7_technical-analysis-config.png (Configuration of the technical analysis element) +[16]: https://opensource.com/sites/default/files/uploads/8_missing-decimals.png (Missing decimal places in output) +[17]: https://opensource.com/sites/default/files/uploads/9_basic-operation-element.png (Workflow in Grid 2) +[18]: https://opensource.com/sites/default/files/uploads/10_dump-extended-dataframe.png (Dump extended DataFrame to file) +[19]: https://opensource.com/sites/default/files/uploads/11_load-dataframe-decimals.png (Representation with all decimal places) +[20]: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.iloc.html +[21]: https://opensource.com/sites/default/files/uploads/12_trade-factor-decision.png (Buy/sell decision) +[22]: https://opensource.com/sites/default/files/uploads/13_validation-function.png (Validation function) +[23]: https://opensource.com/sites/default/files/uploads/14_brute-force-tf.png (Nested for loops for determining the buy and sell factor) +[24]: https://opensource.com/sites/default/files/uploads/15_system-utilization.png (System utilization while brute forcing) +[25]: https://opensource.com/sites/default/files/uploads/16_sort-profit.png (Sort profit with related trading factors in descending order) +[26]: https://opensource.com/sites/default/files/uploads/17_sorted-trading-factors.png (Sorted list of trading factors and profit) +[27]: https://opensource.com/sites/default/files/uploads/18_implemented-evaluation-logic.png (Implemented evaluation logic) +[28]: https://opensource.com/sites/default/files/uploads/19_output.png (Branch element: Grid 3 Position 2A) +[29]: https://opensource.com/sites/default/files/uploads/20_editbranch.png (Branch element: Grid 3 Position 3B) +[30]: https://opensource.com/sites/default/files/uploads/21_grid3-workflow.png (Workflow on Grid 3) +[31]: https://opensource.com/sites/default/files/uploads/22_pass-false-to-stack.png (Forward a False-variable to the subsequent Stack element) +[32]: https://opensource.com/sites/default/files/uploads/23_stack-config.png (Configuration of the Stack element) +[33]: https://opensource.com/sites/default/files/uploads/24_evaluate-stack-value.png (Evaluate the variable from the stack) +[34]: https://opensource.com/sites/default/files/uploads/25_grid3-workflow.png (Workflow on Grid 3) +[35]: https://opensource.com/sites/default/files/uploads/26_binance-order.png (Configuration of the Binance Order element) +[36]: https://opensource.com/sites/default/files/uploads/27_api-key-binance.png (Creating an API key in Binance) +[37]: https://opensource.com/sites/default/files/uploads/28_sell-order.png (Output of a successfully placed sell order) +[38]: https://opensource.com/sites/default/files/uploads/29_binance-order-output.png (Logging output of Binance Order element) +[39]: https://opensource.com/sites/default/files/uploads/30_binance-scheduler.png (Binance Scheduler at Grid 1, Position 1A) +[40]: https://opensource.com/sites/default/files/uploads/31_split-execution-path.png (Grid 1: Split execution path) +[41]: https://opensource.com/sites/default/files/uploads/32_pythonic-daemon.png (PythonicDaemon console interface) +[42]: https://opensource.com/sites/default/files/uploads/33_crontab.png (Crontab on Ubuntu Server) From 20875e831d536407d1daf2b55608d45c0a982ebc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Apr 2020 01:00:04 +0800 Subject: [PATCH 0302/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200415=20Writ?= =?UTF-8?q?ing=20Java=20with=20Quarkus=20in=20VS=20Code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200415 Writing Java with Quarkus in VS Code.md --- ...15 Writing Java with Quarkus in VS Code.md | 239 ++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 sources/tech/20200415 Writing Java with Quarkus in VS Code.md diff --git a/sources/tech/20200415 Writing Java with Quarkus in VS Code.md b/sources/tech/20200415 Writing Java with Quarkus in VS Code.md new file mode 100644 index 0000000000..2d61db71de --- /dev/null +++ b/sources/tech/20200415 Writing Java with Quarkus in VS Code.md @@ -0,0 +1,239 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Writing Java with Quarkus in VS Code) +[#]: via: (https://opensource.com/article/20/4/java-quarkus-vs-code) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) + +Writing Java with Quarkus in VS Code +====== +In this tutorial, I'll walk you through how to rebuild, package, and +deploy cloud-native applications automatically with Quarkus. +![Person drinking a hat drink at the computer][1] + +In the previous articles in this series about cloud-native [Java][2] applications, I shared [_6 requirements of cloud-native software_][3] and [_4 things cloud-native Java must provide_][4]. But now you might want to implement these advanced Java applications in your local machine without climbing a steep learning curve. In this article, I will walk through using the open source technologies [Quarkus][5] and [Visual Studio Code][6] (VS Code) to accelerate the development of both traditional cloud-native Java stacks and also serverless, reactive applications with easier and more familiar methods. + +Quarkus is a Kubernetes-native Java stack tailored for GraalVM and OpenJDK HotSpot. It's crafted from best-of-breed Java libraries and standards with live coding, unified configuration, superfast startup, small memory footprint, and unified imperative and reactive development. VS Code is an open source integrated development environment (IDE) for editing code. + +### Generate a Quarkus project + +Begin by navigating to Quarkus' [Start coding][7] page to generate a Quarkus project that includes a RESTful endpoint. Leave all variables (i.e., Group, Artifact, Build Tool, Extensions) on the default settings, then click **Generate your application** at the top-right of the page. Note that the RESTEasy JAX-RS extension is preselected as default. + +![Quarkus Generate application button][8] + +The ZIP file will automatically download on your local machine. Extract the file with the following command: + + +``` +$ unzip code-with-quarkus.zip +Archive: code-with-quarkus.zip +    creating: code-with-quarkus/ +   inflating: code-with-quarkus/pom.xml +   ... +``` + +### Install VS Code + +Download and install VS Code in your preferred way, whether that's [from the website][9] or through your package manager (dnf, apt, brew, etc). Once that's done, open the unzipped Quarkus project using VS Code's command-line tool: + + +``` +$ cd code-with-quarkus/ +$ code . +``` + +You will see the [Apache Maven][10] project structure with: + + * **ExampleResource** exposed on **/hello** + * Associated JUnit test + * Accessible landing page via + * Dockerfiles for both [native compilation][11] and JVM HotSpot + * A unified application configuration file + + + +Add Quarkus tools to your IDE through the VS Code's extension feature. + +![Add Quarkus tools to VS Code IDE][12] + +### Start coding + +Run the application using Quarkus development mode. To run the application, you need: + + * JDK 1.8+ installed with JAVA_HOME configured appropriately + * Apache Maven 3.6.3+ + + + +Move to the **code-with-quarkus** directory then type **mvn compile quarkus:dev** in VS Code's terminal. + +![Run application][13] + +You will see that the Java application is running well with: + + * About one second to startup + * Live coding activated + * EnabledCDI and RESTEASY features + + + +When you access the endpoint via a web browser, you will see the return code, **hello**. + +!["Hello" return][14] + +Now, you're ready to change the code! Move back to VS Code, then open the **ExampleResource.java** file in **src/main/java/org/acme**. Replace the return code with "**Welcome, Cloud-Native Java with Quarkus!"** Don't forget to **Save** the file. + +![Editing the return][15] + +Go back to the web browser and reload the page. + +![New return][16] + +_It's like magic!_ Behind the scenes, Quarkus rebuilt, packaged, and deployed the application for you automatically, and it only took half a second. This is one of the essential cloud-native Java runtime features for increasing development productivity. + +![Quarkus output][17] + +Continue running your cloud-native Java application in Quarkus. + +### Integrate data transactions via Quakrus Tool + +To add an in-memory database (H2) transaction capability, press **F1** then click on **Quarkus: Add extensions to the current project**. + +![Adding extensions in Quarkus][18] + +Enter **h2** in the search bar, then double-click on **JDBC Driver - H2 Data** in the result. + +![JDBC Driver - H2 Data extension][19] + +Select the following three extensions, which will simplify your persistence code and return JSON format data: + + * Hibernate ORM with Panache Data + * JDBC Driver - H2 + * RESTEasy JSON-B Web + + + +Press **Enter** to add those dependencies. + +![Add Quarkus extensions][20] + +You should see the following in a new VS Code terminal: + +![VS Code adding extensions][21] + +You should also find the following pulled dependencies in **POM.xml**: + +![dependencies in POM.xml][22] + +### Create an Inventory entity + +With your project in place, you can get to work defining the business logic. + +The first step is to define the model (entity) of an Inventory object. Since Quarkus uses Hibernate ORM Panache, create an **Inventory.java** file in the **src.main.java.org.acme** directory, and paste the following code into it: + + +``` +package org.acme; + +import javax.persistence.Cacheable; +import javax.persistence.Entity; + +import io.quarkus.hibernate.orm.panache.PanacheEntity; + +@[Entity][23] +@Cacheable +public class Inventory extends PanacheEntity { +    +    public [String][24] itemId; +    public [String][24] location; +    public int quantity; +    public [String][24] link + +    public Inventory() { + +    } +    +} +``` + +#### Define the RESTful endpoint of Inventory + +Next, mirror the abstraction of service so that you can inject the Inventory service into various places (like a RESTful resource endpoint) in the future. Create an **InventoryResource.java** file in the **src.main.java.org.acme** directory and add this code to it: + + +``` +package org.acme; + +import java.util.List; +import javax.enterprise.context.ApplicationScoped; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; + +@Path("/services/inventory") +@ApplicationScoped +@Produces("application/json") +@Consumes("application/json") +public class InventoryResource { + +    @GET +    +    public List<Inventory> getAll() { +        return Inventory.listAll(); +    } +} +``` + +Don't forget to save these files. Go back to your web browser and access a new endpoint, . You will see: + +![Inventory endpoint][25] + +### Wrapping up + +If you have an issue or get an error when you implement this, you can find and reuse the [code in my GitHub repository][26]. + +If you want to learn more, Quarkus has some [practical and useful guides][27] that show how to develop advanced cloud-native Java applications using Quarkus extensions with event-driven programming, serverless development, and Kubernetes deployment. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/java-quarkus-vs-code + +作者:[Daniel Oh][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://opensource.com/resources/java +[3]: https://opensource.com/article/20/1/cloud-native-software +[4]: https://opensource.com/article/20/1/cloud-native-java +[5]: https://quarkus.io/ +[6]: https://code.visualstudio.com/ +[7]: https://code.quarkus.io/ +[8]: https://opensource.com/sites/default/files/uploads/quarkus_generateapplication.png (Quarkus Generate application button) +[9]: https://code.visualstudio.com/download +[10]: https://maven.apache.org/ +[11]: https://quarkus.io/guides/building-native-image +[12]: https://opensource.com/sites/default/files/uploads/add-quarkus-to-ide.png (Add Quarkus tools to VS Code IDE) +[13]: https://opensource.com/sites/default/files/uploads/run-application.png (Run application) +[14]: https://opensource.com/sites/default/files/uploads/endpoint-hello.png ("Hello" return) +[15]: https://opensource.com/sites/default/files/uploads/edit-return-code.png (Editing the return) +[16]: https://opensource.com/sites/default/files/uploads/new-return-code.png (New return) +[17]: https://opensource.com/sites/default/files/uploads/quarkus-magic.png (Quarkus output) +[18]: https://opensource.com/sites/default/files/uploads/quarkus-add-extensions.png (Adding extensions in Quarkus) +[19]: https://opensource.com/sites/default/files/uploads/jbdc-driver-h2-data.png (JDBC Driver - H2 Data extension) +[20]: https://opensource.com/sites/default/files/uploads/add-extensions.png (Add Quarkus extensions) +[21]: https://opensource.com/sites/default/files/uploads/vscode-adding-extensions.png (VS Code adding extensions) +[22]: https://opensource.com/sites/default/files/uploads/dependencies-pomxml.png (dependencies in POM.xml) +[23]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+entity +[24]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[25]: https://opensource.com/sites/default/files/uploads/inventory-endpoint.png (Inventory endpoint) +[26]: https://github.com/danieloh30/code-with-quarkus +[27]: https://quarkus.io/guides/ From d78af15a1af6742bb8ac5c8e2e74d22905964780 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Apr 2020 01:02:01 +0800 Subject: [PATCH 0303/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200415=20Twea?= =?UTF-8?q?king=20history=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200415 Tweaking history on Linux.md --- .../20200415 Tweaking history on Linux.md | 189 ++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 sources/tech/20200415 Tweaking history on Linux.md diff --git a/sources/tech/20200415 Tweaking history on Linux.md b/sources/tech/20200415 Tweaking history on Linux.md new file mode 100644 index 0000000000..b17a666a8a --- /dev/null +++ b/sources/tech/20200415 Tweaking history on Linux.md @@ -0,0 +1,189 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tweaking history on Linux) +[#]: via: (https://www.networkworld.com/article/3537214/tweaking-history-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Tweaking history on Linux +====== +The bash shell's history command in Linux makes it easy to review and reuse commands, but there's a lot you do to control how much it remembers and how much forgets. +[Claudio Testa][1] [(CC0)][2] + +The bash **history** command on Linux systems helps with remembering commands you’ve previously run and repeating those commands without having to retype them. + +You could decide, however, that you’d be just as happy to forget that you referenced a dozen man pages, listed your files every 10 minutes or viewed previously run commands by typing “history”. In this post, we’re going to look at how you can get the history command to remember just what you want it to remember and forget commands that are likely to be of little "historic value". + +### Viewing your command history + +To view previously run commands, you simply type “history”. You’ll probably see a long list of commands. The number of commands remembered depends on an environment variable called **$HISTSIZE** that is set up in your **~/.bashrc** file, but there’s nothing stopping you from changing this setting if you want to save more or fewer commands. + +To view history, use the **history** command: + +``` +$ history +209 uname -v +210 date +211 man chage +... +``` + +To see the maximum number of commands that will be displayed: + +``` +$ echo $HISTSIZE +500 +``` + +You can change **$HISTSIZE** and make the change permanent by running commands like these: + +``` +$ export HISTSIZE=1000 +$ echo “HISTSIZE=1000” >> ~/.bashrc +``` + +There’s also a difference between how much history is preserved for you and how much is displayed when you type “history”. The **$HISTSIZE** variable controls how much history is displayed while the **$HISTFILESIZE** variable controls how many commands are retained in your **.bash_history** file. + +[][3] + +``` +$ echo $HISTSIZE +1000 +$ echo $HISTFILESIZE +2000 +``` + +You can verify the second variable by counting the lines in your history file: + +``` +$ wc -l .bash_history +2000 .bash_history +``` + +One thing to keep in mind is that commands that you enter during a login session aren’t added to your **.bash_history** file until you log off, even though they show up in the **history** command output right away. + +### Using history + +There are three ways to reissue commands that you find in your history. The simplest way, especially if the command you want to reuse was run recently, is often to type a ! followed by enough of the first letters in the command's name to uniquely identify it. + +``` +$ !u +uname -v +#37-Ubuntu SMP Thu Mar 26 20:41:27 UTC 2020 +``` + +Another easy way to repeat a command is to simply press your up-arrow key until the command is displayed and then press enter. + +Alternately, if you run the history command and see the command you want to rerun listed, you can type an ! followed by the sequence number shown to the left of the command. + +``` +$ !209 +uname -v +#37-Ubuntu SMP Thu Mar 26 20:41:27 UTC 2020 +``` + +### Hiding history + +If you want to stop recording commands for some period of time, you can use this command: + +``` +$ set +o history +``` + +Commands will not show up when you type "history" nor will they be added to your **.bash_history** file when you exit the session by logging off or exiting the terminal. + +To reverse this setting, use **set -o history**. To make it permanent, you can add it to your **.bashrc** file, though failing to make use of command history altogether is generally not a good idea. + +``` +$ echo 'set +o history' >> ~/.bashrc +``` + +To temporarily clear history, so that only commands that you enter afterwards show up when you type "history", use the **history -c** (clear) command: + +``` +$ history | tail -3 +209 uname -v +210 date +211 man chage +$ history -c +$ history +1 history +``` + +NOTE: The commands entered after typing "history -c" will not be added to your .bash_history file. + +### Controlling history + +The command history settings on many systems will default to including one called **$HISTCONTROL** that ensures that, even if you run the same command seven times in a row, it will only be remembered once. It also ensures that commands that you type after first entering one or more blanks will be omitted from your command history. + +``` +$ grep HISTCONTROL .bashrc +HISTCONTROL=ignoreboth +``` + +The "ignoreboth" means "ignore both duplicate commands and command starting with blanks". For example, if you type these commands: + +``` +$ echo try this +$ date +$ date +$ date +$ pwd +$ history +``` + +your history command should report something like this: + +``` +$ history +$ echo try this +$ date +$ history +``` + +Notice that the sequential date commands were reduced to one and the indented command was omitted. + +### Overlooking history + +To ignore certain commands so that they never show up when you type "history" and are never added to your **.bash_history** file, use the **$HISTIGNORE** setting. For example: + +``` +$ export HISTIGNORE=”history:cd:exit:ls:pwd:man” +``` + +This setting will cause all **history**, **cd**, **exit**, **ls**, **pwd** and **man** commands to be omitted from your **history** output and your **.bash_history** file. + +If you want to make this setting permanent, you have to add it to your **.bashrc** file. + +``` +$ echo 'HISTIGNORE="history:cd:exit:ls:pwd:man"' >> .bashrc +``` + +This setting just means that when you look back through previously run commands, the list won’t be cluttered by commands that you're unlikely to be looking for when you are looking through your command history. + +### Remembering, ignoring and forgetting the past + +Command history is useful because it helps you remember what commands you’ve recently used and reminds you about changes you’ve recently made. It also makes it easier to rerun commands, especially those with a string of arguments that you don't necessarily want to recreate. Tailoring your history settings can make your use of command history a little easier and more efficient. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3537214/tweaking-history-on-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://unsplash.com/photos/iqeG5xA96M4 +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 8a630a5c79822a4434a22ae43a0d44e5b9cc00fe Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Apr 2020 01:03:14 +0800 Subject: [PATCH 0304/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200415=20Netw?= =?UTF-8?q?ork=20World=202020=20State=20of=20the=20Network:=20SD-WAN,=20ed?= =?UTF-8?q?ge=20networking=20and=20security=20are=20hot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200415 Network World 2020 State of the Network- SD-WAN, edge networking and security are hot.md --- ...N, edge networking and security are hot.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/talk/20200415 Network World 2020 State of the Network- SD-WAN, edge networking and security are hot.md diff --git a/sources/talk/20200415 Network World 2020 State of the Network- SD-WAN, edge networking and security are hot.md b/sources/talk/20200415 Network World 2020 State of the Network- SD-WAN, edge networking and security are hot.md new file mode 100644 index 0000000000..7e9543e099 --- /dev/null +++ b/sources/talk/20200415 Network World 2020 State of the Network- SD-WAN, edge networking and security are hot.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Network World 2020 State of the Network: SD-WAN, edge networking and security are hot) +[#]: via: (https://www.networkworld.com/article/3537559/state-of-the-network-sd-wan-edge-networking-and-security-issues-heat-things-up.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Network World 2020 State of the Network: SD-WAN, edge networking and security are hot +====== +Network World survey finds 5G, IoT, server consolidation and WAN optimization top priorities. +[orna wachman / Pixabay][1] [(CC0)][2] + +Networking trends including [SD-WAN][3], edge and [5G][4] technology dominate the plans of IT executives and management as they look to develop efficient, bulletproof enterprise communications strategies for the future. + +Those trends and others such as network security, server consolidation and WAN optimization were cited as primary IT drivers of future investment, according to Network World's 2020 State of the Network report. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][5] + +The  survey tapped 268 IT executives and management personnel with primary networking responsibilities for their organization to find out what initiatives are motivating the move to a more digital business environment. + +### SD-WAN and WAN optimization + +The survey found that 58% of respondents said SD-WAN can improve bandwidth efficiency, and 55% said it will expand connectivity options. 48% said it will encourage [hybrid cloud][6] and 41% said it would encourage multi-cloud adoption. The Network World survey found that the increased use of containers and cloud-based applications that need access from the edge is also driving the use of SD-WAN technologies. + +There are a few differences by company size: 63% of enterprises say SD-WAN will improve the bandwidth efficiency for its cloud resources compared to 55% of SMBs. Close to half (46%) of enterprises expect SD-WAN to encourage multi-cloud, while only 26% of SMBs agree, perhaps because multicloud is less prevalent in smaller organizations, the survey stated. + +The State of the Network survey found that 44% of organizations are currently piloting or using SD-WAN, and another 28% have it on their radar. Organizations expect SD-WAN to improve management and monitoring (52%), increase resiliency (51%), improve network security (50%) and prioritize business-critical traffic (46%), the survey stated. + +It will probably come as little surprise that the technologies around SD-WAN are hot. In separate recent survey reports, analyst firm IDC says that 95% of enterprises will be using [SD-WAN][7] technology within two years, and that 42% have already deployed it. IDC also says the SD-WAN infrastructure market will hit $4.5 billion by 2022, growing at a more than 40% yearly clip between now and then. + +[][8] + +“The growth of SD-WAN is a broad-based trend that is driven largely by the enterprise desire to optimize cloud connectivity for remote sites,” Rohit Mehra, vice president, network infrastructure at IDC [said recently][9]. Going forward, the addition of features such as cloud-based application insights and performance monitoring will be a key part of SD-WAN rollouts, Mehra said. + +Cisco has talked about the growth of multicloud networking motivating many businesses to re-tool their networks in favor of SD-WAN technology, Cisco wrote recently. SD-WAN is critical for businesses adopting cloud services, acting as a connective fabric between the campus, branch, [IoT][10], [data center][11] and cloud. + +While SD-WAN is popular, its predecessor, WAN optimiization, is still in heavy use. The IDG survey found that more than half of organizations (53%) are currently piloting or using WAN optimization, which was traditionally centered around a single centralized hub or data center where an organization’s applications and data are hosted. With widely disparate user communities, many enterprises are now viewing new application-centric or regionally distributed architecture as a way to replace MPLS sprawl with purpose-built regional hubs, the survey stated. + +### Edge is big + +Often associated with SD-WAN, edge computing is also a high priority for customers in the Network World study, which found that more than one-third of organizations surveyed (36%) already have edge computing tools in production or are piloting initiatives, and another 25% are actively researching the technology. + +Edge computing is driven by a number of factors. Gartner research says that by 2023, more than 50% of enterprise-generated data will be created and processed outside the [data center][11] or cloud, up from less than 10% in 2019. + +Hand-in-hand with that change is a shift in what technologies are supported at the edge of the network, and that means information processing, content collection and delivery are placed closer to the sources, repositories and consumers of this information. Edge networking tries to keep the traffic and processing local to reduce latency, exploit the capabilities of the edge and enable greater autonomy at the edge, Gartner says. + +The Network World survey stated that [edge-computing][12] adopters expect the technologies  to reduce network latency and operational expenses, allow real-time data processing and save bandwidth. It is also expected to preserve uptime and resilience by reducing the number of network failures, providing an [IoT][10] security framework and reducing the impact of data-center outages. + +Despite all of the virtues of edge computing, security concerns are still on the minds of the vast majority of respondents (77%). More than half of those surveyed believe that  edge devices were not built with security in mind (55%), that the need for middleware creates an additional attack surface (51%) and that there are many other potential attack vectors due to the heterogeneous computing environment (51%). + +The survey stated that 69% of respondents implementing edge computing said network security has already been or will be affected, and 55% said their network management will be affected. Additionally, 49% said their cloud will be affected, perhaps because edge computing has the ability to reduce the amount of data that needs to be processed in theh cloud. + +### Security is a hot spot + +The "State of the Network" survey found there are a variety of data-center security concerns. Topping the list are DDoS attacks, which are aimed at disrupting and disabling internet services, and web application attacks where attackers target vulnerable web servers and install malicious code. + +Organizations are taking a variety of actions when it comes to mitigating these security risks, according to the study. For example the survey found that for 88% of respondents, [firewalls][10] are still the front-line defense. Access-control technologies are being used by about 81% of respondents and anti-malware is being used by 70% of enterprise customers with intrusion prevention being used by 66%. + +With the increasing number and complexity of cyber threats, it’s not surprising that almost three-quarters of respondents (71%) are either piloting, currently using or upgrading network security-monitoring technology. Network security monitoring helps to identify slowdowns and problem areas as well as allows administrators to attack problems as they happen and help prevent future attacks, the survey stated. + +### 5G is on the radar + +51% of respondents say their organization is actively researching 5G, but just 11% are piloting or using it in any capacity. Uses interested organizations are considering include broadband mobile (51%), IoT connectivity (43%), [branch or remote site connectivity][13] (41%) and low-latency communications and fixed wireless access (40% each), the survey stated. + +Join the Network World communities on [Facebook][14] and [LinkedIn][15] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3537559/state-of-the-network-sd-wan-edge-networking-and-security-issues-heat-things-up.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://pixabay.com/photos/young-man-student-studying-learning-4053324/ +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[4]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[5]: https://www.networkworld.com/newsletters/signup.html +[6]: https://www.networkworld.com/article/3429258/real-world-tools-for-multi-cloud-management.html +[7]: https://www.networkworld.com/article/3489938/what-s-hot-at-the-edge-for-2020-everything.html +[8]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[9]: https://www.networkworld.com/article/3527194/multicloud-security-integration-drive-massive-sd-wan-adoption.html +[10]: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html +[11]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[12]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[13]: https://www.networkworld.com/article/3250664/sd-branch-what-it-is-and-why-youll-need-it.html +[14]: https://www.facebook.com/NetworkWorld/ +[15]: https://www.linkedin.com/company/network-world From 5bf90656cf1fcd0376d222915253187c47f451ae Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Apr 2020 01:08:32 +0800 Subject: [PATCH 0305/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200415=20IBM?= =?UTF-8?q?=20extends=20z15=20mainframe=20family,=20intensifies=20Linux=20?= =?UTF-8?q?security?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200415 IBM extends z15 mainframe family, intensifies Linux security.md --- ...rame family, intensifies Linux security.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/talk/20200415 IBM extends z15 mainframe family, intensifies Linux security.md diff --git a/sources/talk/20200415 IBM extends z15 mainframe family, intensifies Linux security.md b/sources/talk/20200415 IBM extends z15 mainframe family, intensifies Linux security.md new file mode 100644 index 0000000000..2ec127350a --- /dev/null +++ b/sources/talk/20200415 IBM extends z15 mainframe family, intensifies Linux security.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IBM extends z15 mainframe family, intensifies Linux security) +[#]: via: (https://www.networkworld.com/article/3537678/ibm-extends-z15-mainframe-family-intensifies-linux-security.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +IBM extends z15 mainframe family, intensifies Linux security +====== +IBM continued to reshape the mainframe with an eye toward further integrating it within hybrid clouds and further securing Linux-based workloads. +Kali Linux / nevarpp / Getty Images + +IBM continued to reshape the [mainframe][1] with an eye toward further integrating it within hybrid clouds and securing [Linux][2]-based workloads. + +On the hardware side, IBM rolled out two entry-level, 19” single-frame, air-cooled platforms, the  [z15 Model T02][3] and [LinuxONE III Model LT2][4]. The new machines are extensions of the IBM z15 family that [Big Blue rolled out in September][5] of last year.  + +Both can fit in cloud [data-center][6] racks and can be outfitted with a second drawer, should customers need to grow capacity.  Both feature 65 cores using commercial processors running at 4.5GHz and can be configured to support all manner of workloads.  + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][7] + +IBM said new machines support z/OS Container Extensions that enable access to an ecosystem of open-source and Linux-on-IBM Z applications that may be deployed within the native z/OS environment without requiring a separate Linux server, using Docker container skills and patterns. In addition customers can use the latest open-source tools, popular NoSQL databases, analytics frameworks and application servers, IBM said. + +The LinuxONE Model LT2 can run a number of Linux systems including [Red Hat Enterprise Linux][8], SUSE and Ubuntu, alone or side by side with IBM z/VM environments on a single physical server. The IBM LinuxONE server can run Linux workloads independently on a single server. + +Both systems support IBM’s prepackaged Cloud Paks, which include a secured Kubernetes container and containerized IBM middleware designed to let customers quickly spin-up enterprise-ready containers, the company said. IBM has standard Cloud Paks for data, application, integration, automation and multicloud management and security. The idea is to help customers develop, deploy, and manage cloud-native applications for the z15 family, IBM stated. + +Security and privacy features are key for the z15 and those have been extended with the introduction of IBM Secure Execution for Linux for the all z15 models.  In a [blog post][9] about the security extensions, IBM stated that at its core, a Secure Execution provides a KVM-based virtual machine that is fully isolated and protected from the hypervisor with encryption keys that only the IBM Z hardware and firmware have access to. + +[][10] + +“In practice, an encrypted Linux image is created using the host public key and a customer-specific key. Since the encryption keys are stored on the IBM Z hardware and firmware, the encrypted image can only be executed in a virtual machine on the host(s) it has been prepared for, and the image can’t be decrypted or tampered with outside of the designated host(s). In addition, your unencrypted virtual machine memory cannot be accessed by the host operating system either,” IBM stated. “Applications are then run inside of that virtual machine, allowing the owner of the application to focus on just disk and network data encryption, both of which can be easily handled in userland.” + +In an environment where [customers are running Kubernetes][11] across servers running on x86 and Linux on Z systems, you can deploy the Secure Execution containers specifically for the applications you want to have protected, like sensitive databases and blockchain services. In this model, Kubernetes still manages the orchestration of containers, both on x86 and IBM Z, but it has no access to the data inside the Secure Execution environment container, IBM stated.  + +With Secure Execution IBM is trying to mitigate insider threats to enterprise data. + +From 2016 to 2019, the average number of incidents involving employee or contractor negligence has increased from 10.5 to 14.5–and the average number of credential theft incidents per company has tripled over the past three years, from 1.0 to 3.2, According to the [Ponemon Institute’s 2020 Cost of an Insider Breach Report][12], IBM stated.  “IBM Secure Execution for Linux helps to mitigate these concerns by enabling clients to isolate large numbers of workloads with granularity and at scale, within a trusted execution environment.” + +The z15 family already supports what IBM calls [Data Privacy Passports][13] that promise to let customers control privacy and security by defining how all data is accessed, stored and shared. The idea is to let customers  protect and provision data and revoke access to that data at any time, not only within the z15 environment but across an enterprise's hybrid [multicloud][14] environment, IBM stated.  + +The new systems and software are expected to be available by mid-May.  z15 T02 pricing starts at $160,000 but each machine is built to order so prices vary. + +Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3537678/ibm-extends-z15-mainframe-family-intensifies-linux-security.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3446140/enterprises-find-a-new-use-for-mainframes-blockchain-and-containerized-apps.html +[2]: https://www.networkworld.com/article/3215226/what-is-linux-uses-featres-products-operating-systems.html +[3]: https://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=AN&subtype=CA&htmlfid=897/ENUS120-006&appname=USN +[4]: https://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=AN&subtype=CA&htmlfid=897/ENUS120-014&appname=USN +[5]: https://www.networkworld.com/article/3438542/ibm-z15-mainframe-amps-up-cloud-security-features.html +[6]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[7]: https://www.networkworld.com/newsletters/signup.html +[8]: https://www.redhat.com/en/blog/enterprise-linux-all-architectures-bringing-red-hat-enterprise-linux-ibm-z15-and-linuxone-iii-single-frame-systems?sc_cid=701f2000000txokAAA&utm_source=bambu&utm_medium=social&utm_campaign=Partner +[9]: https://developer.ibm.com/blogs/inside-the-new-ibm-z15-t02-and-linuxone-iii-lt2/ +[10]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[11]: https://www.networkworld.com/article/3536654/ibm-taps-new-leaders-for-hybrid-cloud-battles-ahead.html +[12]: https://www.ibm.com/downloads/cas/LQZ4RONE +[13]: https://developer.ibm.com/blogs/data-privacy-passports-for-developers/ +[14]: https://www.networkworld.com/article/3429258/real-world-tools-for-multi-cloud-management.html +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world From bb38e2c16efdab8290e5ffa630c76fd6cb4c5b96 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Apr 2020 01:11:34 +0800 Subject: [PATCH 0306/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200415=20How?= =?UTF-8?q?=20to=20dispose=20of=20IT=20hardware=20without=20hurting=20the?= =?UTF-8?q?=20environment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200415 How to dispose of IT hardware without hurting the environment.md --- ...ardware without hurting the environment.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/talk/20200415 How to dispose of IT hardware without hurting the environment.md diff --git a/sources/talk/20200415 How to dispose of IT hardware without hurting the environment.md b/sources/talk/20200415 How to dispose of IT hardware without hurting the environment.md new file mode 100644 index 0000000000..511720d7fd --- /dev/null +++ b/sources/talk/20200415 How to dispose of IT hardware without hurting the environment.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to dispose of IT hardware without hurting the environment) +[#]: via: (https://www.networkworld.com/article/3537928/how-to-dispose-of-it-hardware-without-hurting-the-environment.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +How to dispose of IT hardware without hurting the environment +====== +Find certified recyclers and disposal firms in order to know that the retirement of your old electronics gear is handled safely. +[Angelo Tsirekas][1] [(CC BY 3.0)][2] + +Many enterprises don’t think much about where their obsolete IT gear winds up, but it’s possible to be green-minded, not bust the budget, and even benefit a little from proper disposal. Here is how. + +### Go back to where you bought + +The first option to consider is returning the equipment the vendor or reseller you bought it from, says Susan Middleton, research director, financing strategies at IDC. “Every year we ask customers, ‘How do you handle end-of-lease?’ Overwhelmingly, they return to vendor or partner who are better equipped to handle recycling,” she says. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +Vendors often give a fair-market buyout for the devices that can go toward new products, Middleton says. “The big players like IBM and HPE do a great job because they can clean them up and resell them, and the facilities to do that are pretty big,” she says. + +### Vet disposal firms + +If that’s not an option,  and you have to find a disposal company – an IT Asset Disposition (ITAD) service – on your own, the first thing to check is whether it is properly certified, says Mike Satter, CEO of IT asset disposal and [data-center][4]-decommissioning provider OceanTech. Proper certification starts with a [Responsible Recycling (R2) certification][5]. + +R2s are administered by [Sustainable Electronics Recycling International][6] (SERI), a non-profit organization dedicated to the responsible reuse, repair, and recycling of electronic products. It sets the R2 standard and audits ITAD providers that carry the standard to make sure they are in compliance with the standard. Being responsible means creating a paper trail that shows the electronic waste – which contains heavy metals including arsenic, beryllium, cadmium, chromium, cobalt, indium, lead, mercury, nickel, and thallium, and are toxic in high enough doses – is reused, recovered or recycled. + +Some disposal firms dump old gear in general landfills or export them to other countries where regulations aren’t as strong.   + +“Any ITAD service provider that does not carry an R2 certification cannot fully guarantee zero landfill or zero export of materials,” says Satter. “Many recyclers will say they are compliant, but without verified certifications you’re taking a chance.” + +[][7] + +Mark Dobson, IT asset disposal security specialist with NextUse, a firm that removes and the resells second-hand IT assets, cites six disposal certifications that companies should look for: [R2][5],  [e-Stewards][8],  [NAID][9], [NAID AAA][10] (which has greater certification of regulatory compliance), [ISO 14001][11], and ISO 18001. “R2 would be the floor,” he says. + +Briefly, here’s what these certifications do. + + * **e-Stewards** is a standard set by the Basel Action Network in Sweden, which recognizes electronics recyclers that adhere to the most stringent environmentally and socially responsible practices when recovering hazardous electronic materials. In particular it is focused on making sure it was not shipped off to poor countries, where underage workers were exposed to toxic materials in careless work conditions. + * **NAID and NAID** AAA certification are set by The National Association of Information Destruction, a standards body that sets rules for the proper disposal of information devices, like hard drives. + * **ISO 14001** is a management framework for organizations to “achieve the intended outcomes of its environmental management system, which provide value for the environment, the organization itself and interested parties.” Outcomes of the framework should enhance environmental performance, fulfill compliance obligations and achieve environmental objectives. ISO is the International Organization of Standards, a global standards body. + * **ISO 18001** is the international standard for health and safety management systems. + + + +Dobson says ITAD companies that do it right are using one or more of the certification standards for data security and responsible recycling, and getting and maintaining those standard takes substantial initial and on-going investment in facilities, equipment, hardware, software, personnel, policies and procedures. + +“When those vendors charge more for their services, it is to cover those expenses, not to be excessively profitable,” he says. “Companies that do it the cheap way are skipping many if not all of those investments.” + +If an e-waste company says they will take retired equipment for free, consider that a red flag, says Satter. “Compliant e-waste companies have to hire vetted/credentialed employees, which must pass background checks to ensure compliance is delivered,” Satter says. “All of that costs money.” + +But the additional cost of using a certified company is minor. “We’re not talking hundreds of thousands of dollars,” says Dobson. “Even on the biggest job, it’s a few thousand dollars difference between the right way and the cheap way. For your average client, you’re talking thousands of dollars between the best vendors possible and totally half-assing it with the cheapest vendor that’s not operating in anyone’s best interest but their own.” + +### Penalties + +State environmental laws about illegal disposal are mainly enforced by state attorneys general. In addition, various federal agencies enforce violations of their agency's laws and regulations. + +Satter thinks enforcement needs to be tougher. “It will take the federal government to create extreme enforcement measures to ensure our e-waste is handled properly. The CEO or owner of companies should be arrested if they violate illegal e-waste dumping laws or knowingly exports e-waste to developing countries,” he says. + +In one case, two executives of a Seattle e-waste recycling company got [28 months in jail][12] for improper disposal of e-waste. In that case, it was e-Stewards that got wise to their illegal activities and turned them in to the Washington state AG. + +But that’s an exception, not the rule. Dobson says he sees very little enforcement. “The regulations are in place but spotily enforced, and penalties are not incentivizing. A lot of this is viewed as the cost of doing business. They build the fines for if they get caught into the cost of disposal,” he says. + +Fines for illegal dumping of old IT assets, are determined by the size of the violation, the clean-up cost, and the guidelines in the state or federal law. AT&T got one of the largest fines on record in 2014 for illegal disposal of e-waste, socked with a [$52 million fine][13]. Two years later, Apple got a spanking of $450,000 for its own [illegal dumping][14]. + +Middleton says first and foremost companies should ask for a paper trail to verify proper handling and disposal of assets from the moment they are picked up. “Ask about who certifies that your [disposal] partners are doing it correctly. When you don’t get a good answer, you walk away,” she says. + +But she says she thinks most firms are legit. “Anyone that’s lasted in this business isn’t shady. The majority that have been around a while are responsible,” says Middleton. + +Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3537928/how-to-dispose-of-it-hardware-without-hurting-the-environment.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Kerbside_collection#/media/File:ACT_recycling_truck.jpg +[2]: https://creativecommons.org/licenses/by/3.0/legalcode +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[5]: https://sustainableelectronics.org/r2-standard +[6]: https://sustainableelectronics.org/ +[7]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[8]: http://e-stewards.org/ +[9]: https://naidonline.org/ +[10]: https://naidonline.org/certifications/why-become-certified/ +[11]: https://www.iso.org/iso-14001-environmental-management.html +[12]: https://www.theverge.com/2019/12/4/20992240/e-waste-recycling-electronic-basel-convention-crime-total-reclaim-fraud +[13]: https://www.reuters.com/article/us-usa-at-t-california/att-to-pay-california-52-million-in-hazardous-waste-disposal-settlement-idUSKCN0J50AG20141121 +[14]: https://www.mercurynews.com/2016/12/06/apple-to-pay-450000-after-allegations-of-hazardous-waste-violations/ +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world From f4b0fc93cf3d82de9ffe8afc0c9d0d59349f5194 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 16 Apr 2020 08:35:26 +0800 Subject: [PATCH 0307/1809] translated --- ...ow to Add Multiple Time Zones in Ubuntu.md | 92 ------------------- ...ow to Add Multiple Time Zones in Ubuntu.md | 92 +++++++++++++++++++ 2 files changed, 92 insertions(+), 92 deletions(-) delete mode 100644 sources/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md create mode 100644 translated/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md diff --git a/sources/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md b/sources/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md deleted file mode 100644 index f0d353455d..0000000000 --- a/sources/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md +++ /dev/null @@ -1,92 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Add Multiple Time Zones in Ubuntu) -[#]: via: (https://itsfoss.com/add-multiple-time-zones-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Add Multiple Time Zones in Ubuntu -====== - -_**This quick tutorial shows the steps for adding additional clocks for multiple time zones in Ubuntu and other distributions using GNOME desktop environment.**_ - -If you have family members or colleagues in another country or if you live in a country with multiple time zones, keeping a track of the time difference becomes important. After all, you don’t want to disturb someone by calling at 4’o clock in the morning. - -Some Linux users also keep a tab on the [UTC time][1] because an overwhelming majority of servers use UTC. - -Situations like these can be managed better if you have multiple clocks. You can set one clock to your local time and sync other clock(s) to other time zone(s). It makes keep an eye on the different times easier. - -In this quick tutorial, I’ll show you how to add additional clocks in Ubuntu and other Linux distributions that use GNOME desktop environment. - -### Adding multiple time zone clocks in Ubuntu (and other Linux using GNOME) - -Please [check which desktop environment you are using][2]. This tutorial is suitable for GNOME desktop only. - -To add additional clocks, you can use a nifty little app unsurprisingly called [GNOME Clocks][3]. - -GNOME Clocks is a simple application that shows the time and date in multiple locations. You can also use it to set alarms or timers. Stopwatch feature is also included. - -GNOME Clocks is available in the universe repository in Ubuntu. So please make sure to [enable universe repository][4] first. - -You can search for GNOME Clocks in Software Center and install it from there. - -![Gnome Clocks Ubuntu Software Center][5] - -Alternatively, you can open a terminal and use the following command to install GNOME Clocks: - -``` -sudo apt install gnome-clocks -``` - -If you are using some other Linux distribution, please use your distribution’s software center or package manager to install this application. - -Once you have installed it, search for it by pressing the super key (Windows key) and typing clocks: - -![Gnome Clocks App Search Ubuntu][6] - -Start the application and you should see an interface that provides you a few options like adding world clock, setting alarms, use stopwatch and timer. - -Click on the + sign in the top left corner it will give you an option to search for a geographical location. Search it, select it and add it. - -![Adding additional clocks][7] - -Once you have added the required time zone(s) via its geographical location, you can see that this new clock is now added in the message try. It also shows the time difference between your local time and other time zones. - -![Multiple clocks for multiple time zones][8] - -You can use Super + M keys to quickly open the message tray. There are some more [useful Ubuntu shortcuts][9] you may master and save your time. - -If you want to remove the additional clocks, you can do that from the GNOME Clocks application interface: - -![Remove Additional Clocks][10] - -You cannot delete your current time zone and set it to something else. There are other ways [to change your current time zone in Linux][11]. - -I hope you liked this quick tip. Questions and suggestions are always welcome. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/add-multiple-time-zones-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Coordinated_Universal_Time -[2]: https://itsfoss.com/find-desktop-environment/ -[3]: https://wiki.gnome.org/Apps/Clocks -[4]: https://itsfoss.com/ubuntu-repositories/ -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/gnome-clocks-ubuntu-software-center.jpg?ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/gnome-clocks-app-search-ubuntu.jpg?ssl=1 -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/add-multiple-time-zones-gnome.jpg?ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/multiple-clocks-ubuntu.jpg?ssl=1 -[9]: https://itsfoss.com/ubuntu-shortcuts/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/remove-additional-clocks-ubuntu.jpg?ssl=1 -[11]: https://itsfoss.com/change-timezone-ubuntu/ diff --git a/translated/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md b/translated/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md new file mode 100644 index 0000000000..c3ab289f06 --- /dev/null +++ b/translated/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add Multiple Time Zones in Ubuntu) +[#]: via: (https://itsfoss.com/add-multiple-time-zones-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Ubuntu 中添加多个时区 +====== + +_**此教程展示了使用 GNOME 桌面环境在 Ubuntu 和其他发行版中为多个时区添加其他时钟的步骤。**_ + +如果你的家人或同事在另一个国家,或者你居住在一个有多个时区的国家,那么了解时差就变得很重要。毕竟,你不想在凌晨 4 点打电话打扰别人。 + +一些 Linux 用户还会加一个 [UTC 时间][1]标签,因为大多数服务器都使用 UTC。 + +如果你有多个时钟,那么可以更好地管理此类情况。你可以将一个时钟设置为本地时间,并将其他时钟同步到其他时区。这使得了解不同时间变得更加容易。 + +在本教程中,我将向你展示如何在 Ubuntu 和其他使用 GNOME 桌面环境的 Linux 发行版中添加其他时钟。 + +### 在 Ubuntu(以及其他使用 GNOME 的 Linux)中添加多个时区时钟 + +请[检查你正在使用的桌面环境][2]。本教程仅适用于 GNOME 桌面。 + +要添加其他时钟,可以使用一个叫 [GNOME Clocks][3] 的小程序。 + +GNOME Clocks 是一个简单的应用,它可以显示多个位置的时间和日期。你也可以使用它来设置闹钟或计时器。还包括秒表功能。 + +GNOME Clocks 存在于 Ubuntu 的 Universe 仓库中。因此,请确保首先[启用 Universe 仓库][4]。 + +你可以在软件中心中搜索 GNOME Clocks 并从那里安装它。 + +![Gnome Clocks Ubuntu Software Center][5] + +或者,你可以打开终端并使用以下命令来安装 GNOME Clocks: + +``` +sudo apt install gnome-clocks +``` + +如果你使用的是其他 Linux 发行版,那么请使用发行版的软件中心或软件包管理器来安装此程序。 + +安装后,请按 super 键(Windows 键)并搜索 clocks: + +![Gnome Clocks App Search Ubuntu][6] + +启动程序,你应该会看到一个提供一些选项的界面,例如添加世界时钟、设置闹钟、使用秒表和计时器。 + +单击左上角的 + 号,它将为你提供搜索地理位置的选项。搜索,选择并添加。 + +![Adding additional clocks][7] + +通过地理位置添加所需的时区后,你可以看到现在在消息托盘中添加了这个新时钟。它还显示了你当地时间与其他时区之间的时差。 + +![Multiple clocks for multiple time zones][8] + +你可以使用 Super + M 键快速打开消息托盘。你可以掌握这些[有用的 Ubuntu 快捷方式][9]来节省时间。 + +如果要删除其他时钟,你可以从 GNOME Clocks 应用界面执行以下操作: + +![Remove Additional Clocks][10] + +你无法删除当前时区并设置为其他时区。有其他方法[更改 Linux 中的当前时区][11]。 + +我希望你喜欢这个快速技巧。欢迎提出问题和建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/add-multiple-time-zones-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Coordinated_Universal_Time +[2]: https://itsfoss.com/find-desktop-environment/ +[3]: https://wiki.gnome.org/Apps/Clocks +[4]: https://itsfoss.com/ubuntu-repositories/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/gnome-clocks-ubuntu-software-center.jpg?ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/gnome-clocks-app-search-ubuntu.jpg?ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/add-multiple-time-zones-gnome.jpg?ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/multiple-clocks-ubuntu.jpg?ssl=1 +[9]: https://itsfoss.com/ubuntu-shortcuts/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/remove-additional-clocks-ubuntu.jpg?ssl=1 +[11]: https://itsfoss.com/change-timezone-ubuntu/ From e2342e3b7f125a9238682c96bed8b44b964d4e6e Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 16 Apr 2020 08:39:40 +0800 Subject: [PATCH 0308/1809] translating --- ... A handy utility for creating Raspberry Pi SD card images.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md b/sources/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md index 7d0eadb90c..133a389f91 100644 --- a/sources/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md +++ b/sources/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 59ee3e0ef79ab3521260d335db53cb4d6753922a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 16 Apr 2020 09:00:08 +0800 Subject: [PATCH 0309/1809] Rename sources/tech/20200415 Fedora Origins - Part 01.md to sources/talk/20200415 Fedora Origins - Part 01.md --- sources/{tech => talk}/20200415 Fedora Origins - Part 01.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200415 Fedora Origins - Part 01.md (100%) diff --git a/sources/tech/20200415 Fedora Origins - Part 01.md b/sources/talk/20200415 Fedora Origins - Part 01.md similarity index 100% rename from sources/tech/20200415 Fedora Origins - Part 01.md rename to sources/talk/20200415 Fedora Origins - Part 01.md From c8e2f67bbb23972d9db06c7b14b597d01b0458bb Mon Sep 17 00:00:00 2001 From: "qfzy1233@163.com" Date: Thu, 16 Apr 2020 15:23:17 +0800 Subject: [PATCH 0310/1809] Update 20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md --- ... to Save Time and Increase Productivity.md | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md b/sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md index d464f6ccd4..c4feb5a787 100644 --- a/sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md +++ b/sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md @@ -7,64 +7,65 @@ [#]: via: (https://itsfoss.com/create-templates-libreoffice/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) -How to Create Templates in LibreOffice to Save Time and Increase Productivity +如何在 LibreOffice 中创建模板以实现省时高效 ====== -Creating a template in [LibreOffice][1] can save you some time for the documents that you use often. It can be a letter, a financial spreadsheet or even a presentation. +在 [LibreOffice][1] 中为你经常使用的文档创建模板可以为你节省一些时间。它可以是信件,是财务表格抑或是简报。 -Time is one factor that a template can save and on the other hand it provides consistency where a group of people in an organization work together at the same project. +模板不仅可以为你节省时间,另一方面它可以保证在同一机构内参与统一项目的小组成员文档的一致性。 -For example, if you are a small organization that has to often issue certificates of experience, instead of copy-pasting from a saved document somewhere, you can create a template. When you need to issue a new certificate of experience, you create a new one from the template, edit it slightly and you are good to go. +举例而言,如果你是一家需要经常开具工作经验证明的企业,你可以创建一个模板,而不再需要从某个地方复制粘贴已保存的文档。当你需要开具一个新的经验证明时,你可以从模板中创建,稍微编辑一下就可以了。 -LibreOffice comes with a few templates by default but you are not restricted to use just them. You are free to create your own as per your requirements. +LibreOffice 默认情况下提供了一些模板,但并不仅仅局限于使用这些,你可以根据自己的需求自由定制。 -I think templates are one of the [essential LibreOffice tips][2] that every user should know. Let me show you how to do it. +我认为模板是每个用户都应该了解的 [LibreOffice 基础技巧之一][2]。下面我将为你演示如何使用。 -### How to create a template in LibreOffice +###如何在 LibreOffice 中创建一个模板 -First, create the document that you want to reuse with minimal editing. It could be a document, spreadsheet or presentation. I am using a word document in the example but the steps are the same for all of them. +首先,创建你希望通过最少的编辑就可以重复使用的文档。它可以是文档、电子表格或演示文稿。我在示例中使用的是 word 文档,但是所有步骤都是相同的。 -Now go to file and select Save as Template. You will be prompted to give a name and a category from the menu, the press save. +然后转到文件选项卡并选择存储为模板。你将被提示输入名称及选择类别,再单击保存。 ![Creating a new template in LibreOffice][3] -This file will be saved in the LibreOffice template folder in .ots format. You can use these .ots files on other systems that have LibreOffice installed and use the same templates on those systems as well. +此文件将以 .ots 格式保存在 LibreOffice 的模板文件夹中。你可以在其他安装了 LibreOffice 的系统上使用这些 .ots 文件,并在这些系统上使用相同的模板。 -### How to use templates in LibreOffice +### 如何在 LibreOffice 中使用模板 -To use a template, select File and then Templates. +要使用模板,请选择 “文件选项卡”,然后选择 “模板”。 -Don’t worry! Opening a template LibreOffice creates a copy without affecting the original template. You can edit the document without worrying about your template getting changed. +不要担心! LibreOffice 在打开一个模板时会在不影响原始模板的情况下创建一个副本。你可以随意编辑文档而不必担心模板发生改动。 ![Using templates][4] -Once you choose your template, click open. You can edit it as you like. +选择模板后,单击打开。你就可以随意编辑了。 -### How to change a template in LibreOffice +### 如何在LibreOffice中更改模板 -Needs may change from time to time and adjustments to your templates can be necessary. +我们需求可能会不时变化,所以需要对模板进行相应。 -To edit an existing template go to File -> Templates and then right click on the desired template and click edit. +编辑一个现有的模板,单击文件>然后右键单击所需的模板,然后单击编辑。 ![edit Template][5] -When you finish editing the template, click on save to make the changes permanent. +当您完成对模板的编辑时,单保存以使更改生效。 -**Recommended Read:** +**推荐阅读:** ![][6] -#### [7 LibreOffice Tips To Get More Out of It][2] +#### [7 个高效使用 LibreOffice 的小技巧][2] -LibreOffice is an excellent office suite. These LibreOffice tips will enable you to use it more effectively. +LibreOffice 是一个优秀的办公套件。这些 LibreOffice 技巧将帮助你使用时更为高效。 -All in all templates are great not only at reducing the workload on repetitive tasks but also for user mistake proofing. You can take advantage of your computer’s ability to handle a repetitive task but with flexibility. It increases your efficiency. +总之,模板不仅可以减少重复任务的工作量,还可以防止用户出错。你可以利用电脑优势来灵活的处理重复性的任务,并以此提高你的效率。 -Bonus Tip! +福利小贴士 -You can find tons of additional templates on the [LibreOffice website][7]. You can search for the ones you need, download them and use them. Be advised that these are from third-party, unverified users. So use them at your risk. +你可以在[LibreOffice网站][7]上找到大量的附加模板。你可以搜索你需要的,下载并使用它们。请注意,这些模板来自第三方和未经验证的用户。所以使用它们的风险需要自己承担。 + +之后我会继续分享更多这样的技巧。同时,您还可以学习如何创建模板[在GNOME的右键菜单上下文中添加“创建新文档”选项][8]。 -I’ll keep on sharing more such tips in future. Meanwhile, you may also learn about creating templates to [add the “create new document” option in the right click menu context in GNOME][8]. -------------------------------------------------------------------------------- From 3f25f85a0e5389b5b0377397fcd057007e85bd76 Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Thu, 16 Apr 2020 15:27:47 +0800 Subject: [PATCH 0311/1809] change the dir --- ...tes in LibreOffice to Save Time and Increase Productivity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {sources => translated}/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md (98%) diff --git a/sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md b/translated/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md similarity index 98% rename from sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md rename to translated/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md index c4feb5a787..e0f4ae64ea 100644 --- a/sources/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md +++ b/translated/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md @@ -73,7 +73,7 @@ via: https://itsfoss.com/create-templates-libreoffice/ 作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[qfzy1233](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f32893eaff59eb4c420916c2f55633acdf8971aa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Apr 2020 20:31:05 +0800 Subject: [PATCH 0312/1809] PRF @geekpi --- ...ver with a Raspberry Pi and Rocket.Chat.md | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md b/translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md index dd59fe627f..b8ef1b822a 100644 --- a/translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md +++ b/translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Build a private chat server with a Raspberry Pi and Rocket.Chat) @@ -9,36 +9,37 @@ 使用树莓派和 Rocket.Chat 构建一个私人聊天服务器 ====== -使用这些简单、经济高效的开源工具创建你自己的真正私人聊天和消息解决方案。 -![Chat via email][1] -互联网提供大量免费的消息服务。WhatsApp 和 Viber 等应用是我们日常生活的一部分,也是我们与亲朋好友沟通的最常见方式。但是,安全意识正在增加对真正私人聊天解决方案的需求。此外,消息应用在我们的设备中占用了大量空间,因此备用聊天渠道可用于与朋友共享媒体、信息和联系人。 +> 使用这些简单、经济高效的开源工具构建自己真正的私人聊天和消息解决方案。 + +![](https://img.linux.net.cn/data/attachment/album/202004/16/203055g5r5w7ei8eenw1ex.jpg) + +互联网提供了大量免费的消息服务。像 WhatsApp 和 Viber 这样的应用已经是我们日常生活的一部分,也是我们与亲朋好友沟通的最常见方式。但是,安全意识的提高,让人们对真正的私密聊天解决方案的需求越来越大。此外,消息类应用在我们的设备中占用了大量空间,因此一个备用聊天渠道可能对于我们与朋友分享媒体、信息和联系人很有作用。 今天,我们将了解如何使用[树莓派][2]和 Rocket.Chat 安装一个私人聊天和消息服务器。 ### 什么是 Rocket.Chat? -[Rocket.Chat][3] 是一个开源解决方案,它提供增强的聊天服务。它包括媒体共享、屏幕共享和视频/音频呼叫支持等协作工具。 +[Rocket.Chat][3] 是一个开源解决方案,它提供了一个增强的聊天服务。它包括媒体共享、屏幕共享和视频/音频呼叫支持等协作工具。 它可以通过浏览器或从所有主要应用商店(Google Play、App Store 等)下载使用。 -除了社区版本外,Rocket.Chat 还提供企业版和专业版,包括支持和其他功能。 +除了社区版本外,Rocket.Chat 还提供企业版和专业版,包括支持和其他附加功能。 ### 我们需要什么 -对于这个项目,我将使用更便宜的树莓派 3 model A+。树莓派 3 model B 和 B+ 以及树莓派 4 model B 工作应该一样。 +对于这个项目,我将使用更便宜的树莓派 3A+。树莓派 3B 和 3B+ 以及树莓派 4B 应该也可以用同样的方法。 -我也建议使用高性能 SD 卡,因为 Rocket.Chat 会给树莓派大量的负载。如其他文章中所述,高性能 SD 卡可显著提高 Raspbian 操作系统的性能。 +我也建议使用一块高性能 SD 卡,因为 Rocket.Chat 会给树莓派带来很大的负载。如其他文章中所述,高性能 SD 卡可显著提高 Raspbian 操作系统的性能。 我们将使用 Raspbian 的精简版本,拥有预配置的 WiFi 访问和 SSH 服务,因此不需要键盘或 HDMI 线缆。 ### 分步过程 -从[安装最新版本的 Raspbian Buster Lite][5] 开始 +从[安装最新版本的 Raspbian Buster Lite][5] 开始。 我们将使用 [Snap][6] 简化 Rocket.Chat 安装。通过 SSH 登录并从终端输入: - ``` sudo apt-get update sudo apt-get upgrade @@ -46,36 +47,33 @@ sudo apt-get upgrade 安装 Snap: - ``` -`sudo apt-get install snapd` +sudo apt-get install snapd ``` 安装 Snap 后,我们需要重启系统使其正常工作: - ``` -`sudo reboot` +sudo reboot ``` 再次通过 SSH 登录,并用以下简单的命令安装 Rocket.Chat: - ``` -`sudo snap install rocketchat-server` +sudo snap install rocketchat-server ``` -从终端安装后,请等待一段时间,等待 Rocket.Chat 初始化数据库和服务。休息一下,几分钟后,你应该能够在浏览器中访问 http://<<YOUR_RPI_IP_ADDRESS>>:3000,你应该看到以下内容: +从终端安装后,请等待一段时间,让 Rocket.Chat 初始化数据库和服务。休息一下,几分钟后,你应该能够在浏览器中访问 `http://<>:3000`,你应该看到以下内容: ![Rocket Chat setup wizard][7] -填写所需的表格就可以了。四个简单的设置窗口后,你应该会进入 Rocket.Chat 主页: +填写所需的表单就可以了。经过四个简单的设置窗口后,你应该会进入 Rocket.Chat 主页: ![Rocket Chat home page][8] 享受吧! -_本文最初发表在 [peppe8o.com][9],并获许重新发布。_ +本文最初发表在 [peppe8o.com][9],并获许重新发布。 -------------------------------------------------------------------------------- @@ -84,7 +82,7 @@ via: https://opensource.com/article/20/3/raspberry-pi-rocketchat 作者:[Giuseppe Cassibba][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8c16926b5f9ffc7ec02938df291de4554989ad99 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Apr 2020 20:31:55 +0800 Subject: [PATCH 0313/1809] PUB @geekpi https://linux.cn/article-12116-1.html --- ...private chat server with a Raspberry Pi and Rocket.Chat.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md (98%) diff --git a/translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md b/published/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md similarity index 98% rename from translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md rename to published/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md index b8ef1b822a..25a4581dd7 100644 --- a/translated/tech/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md +++ b/published/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12116-1.html) [#]: subject: (Build a private chat server with a Raspberry Pi and Rocket.Chat) [#]: via: (https://opensource.com/article/20/3/raspberry-pi-rocketchat) [#]: author: (Giuseppe Cassibba https://opensource.com/users/peppe8o) From c23dc4891a1aaee4bb4e496568c1a8703e3e80f8 Mon Sep 17 00:00:00 2001 From: cycoe Date: Thu, 16 Apr 2020 21:21:59 +0800 Subject: [PATCH 0314/1809] Translated by Cycoe --- ...u need to know about variables in Emacs.md | 239 ++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 translated/tech/20200311 What you need to know about variables in Emacs.md diff --git a/translated/tech/20200311 What you need to know about variables in Emacs.md b/translated/tech/20200311 What you need to know about variables in Emacs.md new file mode 100644 index 0000000000..635f7d6249 --- /dev/null +++ b/translated/tech/20200311 What you need to know about variables in Emacs.md @@ -0,0 +1,239 @@ +[#]: collector: (lujun9972) +[#]: translator: (cycoe) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What you need to know about variables in Emacs) +[#]: via: (https://opensource.com/article/20/3/variables-emacs) +[#]: author: (Clemens Radermacher https://opensource.com/users/clemera) + +关于 Emacs 中的变量你需要知道的事情 +====== +学习 Elisp 是如何处理变量的,以及如何在你的脚本与配置中使用它们。 +![编程键盘][1] + +GNU Emacs 是由 C 和 Emacs Lisp(Elisp,Lisp 编程语言的一种方言)写成,它是一个编辑器的同时,又碰巧是 Elisp 的沙盒。因此,理解 Elisp 中的一些基本编程概念会对你有一些帮助。 + +如果你是 [Emacs][2] 新手,请先访问 Sacha Chua 的[《给 Emacs 新手的资源》][3]精品帖。本篇文章假定你熟悉常见的 Emacs 术语,并且能够阅读 Elisp 代码的简单片段并对其进行求值。最好你也听说过变量作用域的概念,知道它在其它编程语言中的作用。本篇文章中的示例假定你使用的是相对较新的 Emacs 版本([v.25 之后的版本][4])。 + +[Elisp 手册][5] 包含了 Elisp 的方方面面,但它是写给那些有明确查找目标的人们的,并且它在这方面也做得相当棒。但是很多人希望这些资源能够在更高的层次上解释 Elisp 的概念,同时将信息压缩成最精华的部分。本篇文章也正是我回应这种呼声的一次尝试,为读者描绘基础的大体轮廓。使他们能在配置中用上这些技巧,也让他们在手册中查询细节变得更容易。 + +### 全局变量 + +用 `defcustom` 定义的用户设置和用 `defvar` 或 `defconst` 定义的变量是全局的。使用 `defcustom` 或 `defvar` 声明变量的一个非常重要的原因是,当一个变量已经被绑定bind,对它们进行重新求值不会覆盖掉已有的值。举个栗子,如果你在初始化文件中对 `my-var` 进行如下绑定: + + +``` +`(setq my-var nil)` +``` + +对如下表达式求值不会将变量覆盖为 `t`: + + +``` +`(defvar my-var t)` +``` + +注意此处有_一个例外_:如果你用 `C-M-x` 快捷键对上述声明求值,它将调用 `eval-defun` 函数,并将变量覆盖为 `t`。通过此方式,你可以按需将变量强制覆盖。这种行为是刻意而为之的:你可能知道,Emacs 中的许多特性是按需加载的,也可以称为自动加载。如果那些文件中的声明将变量覆盖为它们的默认值,那它也就覆盖了你初始化文件中的设置。 + +### 用户选项 + +用户选项就是使用 `defcustom` 声明的全局变量。与使用 `defvar` 声明的变量不同,这些变量可以用 `M-x customize` 界面来配置。据我所知,大部分人因为觉得它开销较大而不经常使用。一旦你知道如何在你的初始化文件中设置变量,也就没有理由一定要去使用它了。许多用户没有意识到的一个细节是,通过 **customize** 的方式设置用户选项能够执行代码,有的时间可用来运行一些附加的配置说明: + + +``` +(defcustom my-option t +  "我的用户选项" +  :set (lambda (sym val) +         (set-default sym val) +         (message "Set %s to %s" sym val))) +``` + +若你对这段代码求值,并键入 `M-x customize-option RET my-option RET` 运行 **customize** 界面,lambda 匿名函数就会被调用,回显区域就会显示出该选项的符号名与值。 + +如果你在初始化文件中使用 `setq` 改变该选项的值,那么匿名函数不会运行。要想在 Elisp 中正确设置一个选项,你需要使用函数 `customize-set-variable`。或者,人们在他们的配置文件中使用了各种版本的 `csetq` 宏来自动处理(如你所愿,你可以通过 GitHub 的代码搜索发现更复杂的变体)。 + + +``` +(defmacro csetq (sym val) +  `(funcall (or (get ',sym 'custom-set) 'set-default) ',sym ,val)) +``` + +若你正在使用 [use-package][6] 宏,`:custom` 关键字会替你处理好以上这些。 + +在你将以上代码放入到你的初始化文件中之后,你便可以使用 `csetq` 宏在设置变量的同时运行任何现存的 `setter` 函数。要证明这点,你可以使用此宏来改变上面定义的选项,并观察回显区域的消息输出。 + + +``` +`(csetq my-option nil)` +``` + +### 动态绑定与词法绑定 + +当你在使用其它编程语言时,你可能不会意识到动态绑定与词法绑定的区别。当今的大部分编程语言使用词法绑定,并且在学习变量作用域与变量查找时也没有必要去了解它们之间的区别。 + +如此看来,Emacs Lisp 比较特殊因为动态绑定是默认选项,词法绑定需要显式启用。这里有一些历史遗留原因,但在实际使用中,你应该_时刻_启用词法绑定,因为它更快并且不容易出错。要启用词法绑定,只需将如下的注释行作为你的 Emacs Lisp 文件的第一行: + + +``` +`;;; -*- lexical-binding: t; -*-` +``` + +另一种方式,你可以调用 `add-file-local-variable-prop-line`,在你选择将变量 `lexical-binding` 置为 `t` 后,会自动插入如上的注释行。 + +在加载包含如上特殊格式行的文件时,Emacs 会相应地设置变量,这意味着该缓冲区中的代码加载时启用了词法绑定。若要采用交互式的方式,你可以调用 `M-x eval-buffer` 命令,它会将词法绑定考虑在内。 + +既然你已经知道了如何启用词法绑定,那么了解这些术语的含义就很明智了。对于动态绑定,在程序执行期间建立的最后一个绑定将用于变量查找。你可以通过将以下代码放入空缓冲区并执行 `M-x eval buffer`,以对此进行测试: + +``` +(defun a-exists-only-in-my-body (a) +  (other-function)) + +(defun other-function () +  (message "I see `a', its value is %s" a)) + +(a-exists-only-in-my-body t) +``` + +你可能会很惊讶地发现,在 `other-function` 中查找变量 `a` 竟然成功了。 + +若你在顶部添加了特殊的词法绑定注释后,重新运行前面的示例,这段代码将抛出 `variable is void` 错误,因为 `other-functioin` 无法识别变量 `a`。如果你使用的是其它编程语言,这才是你所期望的行为。 + +启用词法绑定后,作用域会由周围的代码所定义。这并不单单是性能原因,时间也已经表明了词法绑定才是更受喜爱的。 + +### 特殊变量与动态绑定 + +如你所知,`let` 用于临时建立局部绑定: + + +``` +(let ((a "I'm a") +      (b "I'm b")) +  (message "Hello, %s. Hello %s" a b)) +``` + +接下来有趣的是——使用 `defcustom`、`defvar` 以及 `defconst` 定义的变量被称为_特殊变量_,不论词法绑定是否启用,它们都将使用动态绑定: + + +``` +;;; -*- lexical-binding: t; -*- + +(defun some-other-function () +  (message "I see `c', its value is: %s" c)) + +(defvar c t) + +(let ((a "I'm lexically bound") +      (c "I'm special and therefore dynamically bound")) +  (some-other-function) +  (message "I see `a', its values is: %s" a)) +``` + +通过 `C-h e` 切换至 `Messages` 缓冲区,查看上述示例输出的消息。 + +使用 `let` 或者函数参数绑定的局部变量会遵循由 `lexical-binding` 变量定义的查找规则,但使用 `defvar`、`defconst` 或 `defcustom` 定义的全局变量,能够沿着调用栈在 `let` 表达式中被修改。 + +这种技巧允许方便地进行特殊定制,并且经常在 Emacs 中被使用。这并不奇怪,毕竟 Emacs Lisp 最开始只提供动态绑定作为唯一选择。下面是一个常见的示例,说明如何向只读缓冲区临时写入数据: + +``` +(let ((inhibit-read-only t)) +  (insert ...)) +``` + +这是另一个常见的示例,如何进行大小写敏感的搜索: + + +``` +(let ((case-fold-search nil)) +  (some-function-which-uses-search ...)) +``` + +动态绑定允许你采用作者未曾预料的方式对函数进行修改。对于像 Emacs 这样设计使用的程序来说,这是个强大的工具与特性。 + +有一点需要注意:你可能会意外地使用局部变量名,该变量在其他地方被声明为特殊变量。防止这种冲突的一个技巧是避免在局部变量名中使用下划线。在我当前的 Emacs 会话中,以下代码只留下少数潜在冲突的候选: + +``` +(let ((vars ())) +  (mapatoms +   (lambda (cand) +     (when (and (boundp cand) +                (not (keywordp cand)) +                (special-variable-p cand) +                (not (string-match "-" +                                   (symbol-name cand)))) +       (push cand vars)))) +  vars) ;; => (t obarray noninteractive debugger nil) +``` + +### 缓冲区局部变量 + +每个缓冲区都能够拥有变量的一个局部绑定。这就意味着对于任何变量,都会首先在当前缓冲区中查找缓冲区局部变量取代默认值。局部变量是 Emacs 中一个非常重要的特性,比如它们被主模式用来建立缓冲区范围内的行为与设置。 + +事实上你已经在本文中见过_缓冲区局部变量_——也就是将 `lexical-binding` 在缓冲区范围内设置为 `t` 的特殊注释行。在 Emacs 中,在特殊注释行中定义的缓冲区局部变量也被称为`文件局部变量`。 + +任何的全局变量都可以用缓冲区局部变量来遮掩,比如上面定义的变量 `my-var`,你可用如下方式设置局部变量: + + +``` +(setq-local my-var t) +;; or (set (make-local-variable 'my-var) t) +``` + +此时 `my-var` 对于你在对上述代码进行求值时对应的缓冲区来说就是局部变量。若你对它调用 `describe-variable`,文档会同时告诉你局部与全局的值。从编程的角度来讲,你可以分别用 `buffer-local-value` 获取局部值,用 `default-value` 获取全局值。若要移除局部值,你可以调用 `kill-local-variable`。 + +另一个需要注意的重要性质就是,一旦一个变量成为缓冲区局部变量,后续在该缓冲区中使用的 `setq` 都将只能设置局部的值。要想设置默认值,你需要使用 `setq-default`。 + +因为局部变量意味着对缓冲区的定制,它们也就经常被用于模式钩子中。一个典型的例子如下所示: + + +``` +(add-hook 'go-mode-hook +          (defun go-setup+ () +            (setq-local compile-command +              (if (string-suffix-p "_test.go" buffer-file-name) +                  "go test -v" +                (format "go run %s" +                        (shell-quote-argument +                         (file-name-nondirectory buffer-file-name))))))) +``` + +这将设置 `go-mode` 缓冲区中 `M-x compile` 使用的编译命令。 + +另一个重要的方面就是一些变量会_自动_成为缓冲区局部变量。这也就意味着当你使用 `setq` 设置这样一个变量时,它会针对当前缓冲区设置局部绑定。这个特性不应该被经常使用,因为这种隐式的行为并不好。不过如果你想的话,你可以使用如下方法创建自动局部变量: + + +``` +(defvar-local my-automatical-local-var t) +;; or (make-variable-buffer-local 'my-automatical-local-var) +``` + +变量 `indent-tabs-mode` 就是 Emacs 内建的一个例子。如果你在初始化文件中使用 `setq` 改变变量的值,根本不会影响默认值。只有在你加载初始化文件时正处在当前的缓冲区的局部值会被改变。因此,你需要使用 `setq-default` 来改变 `indent-tabs-mode` 的默认值。 + +### 结语 + +Emacs 是一个强大的编辑器,并且随着你的定制它将变得更加强大。现在,你知道了 Elisp 是如何处理变量的,以及你应如何在你自己的脚本与配置中使用它们。 + +* * * + +_本篇文章此前采用 CC BY-NC-SA 4.0 许可证发布在 [With-Emacs][7] 上,经过修改(带有合并请求)并在作者允许的情况下重新发布。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/variables-emacs + +作者:[Clemens Radermacher][a] +选题:[lujun9972][b] +译者:[cycoe](https://github.com/cycoe) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clemera +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A (Programming keyboard.) +[2]: https://www.gnu.org/software/emacs/ +[3]: http://sachachua.com/blog/p/27144 +[4]: https://www.gnu.org/software/emacs/download.html +[5]: https://www.gnu.org/software/emacs/manual/html_node/elisp/ +[6]: https://github.com/jwiegley/use-package#customizing-variables +[7]: https://with-emacs.com/posts/tutorials/almost-all-you-need-to-know-about-variables/ From ea59e2a6ccb76ba53bac6609def4a07a80059e33 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Apr 2020 21:44:03 +0800 Subject: [PATCH 0315/1809] PRF @qfzy1223 --- ... to Save Time and Increase Productivity.md | 36 ++++++++----------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/translated/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md b/translated/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md index e0f4ae64ea..23520b1feb 100644 --- a/translated/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md +++ b/translated/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) -[#]: translator: (qfzy1233 ) -[#]: reviewer: ( ) +[#]: translator: (qfzy1233) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Create Templates in LibreOffice to Save Time and Increase Productivity) @@ -10,7 +10,9 @@ 如何在 LibreOffice 中创建模板以实现省时高效 ====== -在 [LibreOffice][1] 中为你经常使用的文档创建模板可以为你节省一些时间。它可以是信件,是财务表格抑或是简报。 +![](https://img.linux.net.cn/data/attachment/album/202004/16/214314y17oww0ymfylyn1m.jpg) + +在 [LibreOffice][1] 中为你经常使用的文档创建模板可以为你节省一些时间。它可以是信件、财务表格抑或是简报。 模板不仅可以为你节省时间,另一方面它可以保证在同一机构内参与统一项目的小组成员文档的一致性。 @@ -20,11 +22,11 @@ LibreOffice 默认情况下提供了一些模板,但并不仅仅局限于使 我认为模板是每个用户都应该了解的 [LibreOffice 基础技巧之一][2]。下面我将为你演示如何使用。 -###如何在 LibreOffice 中创建一个模板 +### 如何在 LibreOffice 中创建一个模板 首先,创建你希望通过最少的编辑就可以重复使用的文档。它可以是文档、电子表格或演示文稿。我在示例中使用的是 word 文档,但是所有步骤都是相同的。 -然后转到文件选项卡并选择存储为模板。你将被提示输入名称及选择类别,再单击保存。 +然后转到“文件”选项卡并选择“存储为模板”。你将被提示输入“名称”及选择“类别”,再单击“保存”。 ![Creating a new template in LibreOffice][3] @@ -40,31 +42,23 @@ LibreOffice 默认情况下提供了一些模板,但并不仅仅局限于使 选择模板后,单击打开。你就可以随意编辑了。 -### 如何在LibreOffice中更改模板 +### 如何在 LibreOffice 中更改模板 我们需求可能会不时变化,所以需要对模板进行相应。 -编辑一个现有的模板,单击文件>然后右键单击所需的模板,然后单击编辑。 +编辑一个现有的模板,单击“文件” -> “模板”,然后右键单击所需的模板,然后单击“编辑”。 ![edit Template][5] -当您完成对模板的编辑时,单保存以使更改生效。 - -**推荐阅读:** - -![][6] - -#### [7 个高效使用 LibreOffice 的小技巧][2] - -LibreOffice 是一个优秀的办公套件。这些 LibreOffice 技巧将帮助你使用时更为高效。 +当你完成对模板的编辑时,单击“保存”以使更改生效。 总之,模板不仅可以减少重复任务的工作量,还可以防止用户出错。你可以利用电脑优势来灵活的处理重复性的任务,并以此提高你的效率。 -福利小贴士 +> 福利小贴士 -你可以在[LibreOffice网站][7]上找到大量的附加模板。你可以搜索你需要的,下载并使用它们。请注意,这些模板来自第三方和未经验证的用户。所以使用它们的风险需要自己承担。 +你可以在 [LibreOffice 网站][7]上找到大量的附加模板。你可以搜索你需要的,下载并使用它们。请注意,这些模板来自第三方和未经验证的用户。所以使用它们的风险需要自己承担。 -之后我会继续分享更多这样的技巧。同时,您还可以学习如何创建模板[在GNOME的右键菜单上下文中添加“创建新文档”选项][8]。 +之后我会继续分享更多这样的技巧。同时,你还可以学习一下如何创建模板[在 GNOME 的右键菜单上下文中添加“创建新文档”选项][8]。 -------------------------------------------------------------------------------- @@ -73,8 +67,8 @@ via: https://itsfoss.com/create-templates-libreoffice/ 作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] -译者:[qfzy1233](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[qfzy1233](https://github.com/qfzy1233) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b3392045c71678a38f4291fe9f149cdc100d5330 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Apr 2020 21:44:36 +0800 Subject: [PATCH 0316/1809] PUB @qfzy1223 https://linux.cn/article-12118-1.html --- ...s in LibreOffice to Save Time and Increase Productivity.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md (98%) diff --git a/translated/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md b/published/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md similarity index 98% rename from translated/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md rename to published/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md index 23520b1feb..1377f03523 100644 --- a/translated/tech/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md +++ b/published/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (qfzy1233) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12118-1.html) [#]: subject: (How to Create Templates in LibreOffice to Save Time and Increase Productivity) [#]: via: (https://itsfoss.com/create-templates-libreoffice/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) From d3899a9e2b239ff54cef1e577d34933c0c3d153a Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Thu, 16 Apr 2020 22:46:57 +0800 Subject: [PATCH 0317/1809] Update 20190814 9 open source cloud native projects to consider.md --- ...ource cloud native projects to consider.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/sources/tech/20190814 9 open source cloud native projects to consider.md b/sources/tech/20190814 9 open source cloud native projects to consider.md index 5a0ea56b9e..09304a737b 100644 --- a/sources/tech/20190814 9 open source cloud native projects to consider.md +++ b/sources/tech/20190814 9 open source cloud native projects to consider.md @@ -11,18 +11,18 @@ ====== Work with containers? Get familiar with these projects from the Cloud Native Computing Foundation -工作中使用了容器?熟悉来自云原生计算基金会的这些项目 +工作中用了容器?熟悉这些出自云原生计算基金会的项目? ![clouds in the sky with blue pattern][1] As the practice of developing applications with containers is getting more popular, [cloud-native applications][2] are also on the rise. By [definition][3]: -随着通过容器开发应用的实践变得流行,[云原生应用][2]也在上升。其定义: -云原生技术被用于开发应用程序,这些程序通过将服务打包在容器中来完成构建,部署为微服务,通过敏捷的DevOps流程和持续集成工作流在弹性基础设施上管理。 +随着用容器来开发应用的实践变得流行,[云原生应用][2]也在增长。云原生应用的定义为: +> "云原生技术被用于开发应用程序,这些应用通过将服务打包在容器中来完成构建,被部署为微服务,并通过敏捷的DevOps流程和持续集成工作流在弹性基础设施上管理。" > "Cloud-native technologies are used to develop applications built with services packaged in containers, deployed as microservices, and managed on elastic infrastructure through agile DevOps processes and continuous delivery workflows." This description includes four elements that are integral to cloud-native applications: -这个描述包括构成云原生应用的4个元素: +这个定义提到了构成云原生应用的4个元素: 1. Container 容器 2. Microservice 微服务 @@ -32,7 +32,7 @@ This description includes four elements that are integral to cloud-native applic Although these technologies have very distinct histories, they complement each other well and have led to surprisingly exponential growth of cloud-native applications and toolsets in a short time. This [Cloud Native Computing Foundation][4] (CNCF) infographic shows the size and breadth of the cloud-native application ecosystem today. -尽管这些技术有非常独特的历史,它们互相补充,共同导致了短时间内的云原生应用和工具的惊人的指数级增长。这个[云原生计算基金会][4]信息图现实了今天的云原生应用生态的规模和广度。 +尽管这些技术各有各自独特的历史,但它们相互补充,共同导致了云原生应用和工具在短时间内惊人的指数级增长。这个[云原生计算基金会][4]信息图呈现了当今云原生应用生态的规模和广度。 ![Cloud-Native Computing Foundation applications ecosystem][5] @@ -40,23 +40,23 @@ Cloud-Native Computing Foundation projects 云原生计算基金会项目 I mean, just look at that! And this is just a start. Just as NodeJS’s creation sparked the explosion of endless JavaScript tools, the popularity of container technology started the exponential growth of cloud-native applications. -我的意思是,留意吧!这仅仅是一个开始。 正如NodeJS的出现引发了无休止的JavaScript工具的爆炸式增长一样,容器技术的普及也推动了云原生应用程序的指数增长。 +我想说,瞧着吧!这仅仅是一个开始。正如NodeJS的出现引发了无休止的JavaScript工具的爆炸式增长一样,容器技术的普及也推动了云原生应用的指数增长。 The good news is that there are several organizations that oversee and connect these dots together. One is the [**Open Containers Initiative (OCI)**][6], which is a lightweight, open governance structure (or project), "formed under the auspices of the Linux Foundation for the express purpose of creating open industry standards around container formats and runtime." The other is the **CNCF**, "an open source software foundation dedicated to making cloud native computing universal and sustainable." -好消息是,有几个组织负责监管这些技术并将它们融合在一起。 其中之一是[** Open Containers Initiative(OCI)**][6],它是一种轻量级的,开放的治理结构(或项目),“是在Linux基金会的主持下形成的,其明确目的是创建开放的行业标准容器格式和运行时。” 另一个是** CNCF **,“致力于使云原生计算具有通用性和可持续性的开源软件基金会”。 +好消息是,有几个组织负责监管这些技术并将它们融合在一起。 其中之一是[** Open Containers Initiative(OCI)**][6],它是一个轻量级的,开放的治理机构(或项目),“它是在Linux基金会的主持下形成的,其明确目的是创建开放的行业标准的容器格式和运行时。” 另一个是** CNCF **,“它是一个致力于使云原生计算具有通用性和可持续性的开源软件基金会”。 In addition to building a community around cloud-native applications generally, CNCF also helps projects set up structured governance around their cloud-native applications. CNCF created the concept of maturity levels—Sandbox, Incubating, or Graduated—which correspond to the Innovators, Early Adopters, and Early Majority tiers on the diagram below. -除了通常围绕云原生应用建立社区之外,CNCF还帮助项目围绕其云原生应用建立结构化的管理。CNCF创建了成熟度级别的概念(沙箱,孵化或毕业),与下图中的“创新者”,“早期采用者”和“早期多数”层相对应。 +除了常见的围绕云原生应用建立社区之外,CNCF还帮助项目基于其云原生应用建立结构化的管理。CNCF创建了成熟等级的概念(沙箱级,孵化级或毕业级),分别与下图中的“创新者”,“早期采用者”和“早期大量应用”相对应。 ![CNCF project maturity levels][7] -CNCF project maturity levels CNCF项目成熟度级别 +CNCF project maturity levels CNCF项目成熟等级 The CNCF has detailed [criteria][8] for each maturity level (included below for readers’ convenience). A two-thirds supermajority of the Technical Oversight Committee (TOC) is required for a project to be Incubating or Graduated. -CNCF为每个成熟度级别制定了详细的[标准][8](为方便读者而列在下面)。 获得技术监督委员会(TOC)的三分之二的同意才能转为孵化或毕业项目。 +CNCF为每个成熟等级制定了详细的[标准][8](为方便读者而列在下面)。 获得技术监督委员会(TOC)三分之二的同意才能转为孵化或毕业级。 ### Sandbox stage 沙箱级 -> To be accepted in the sandbox, a project must have at least two TOC sponsors. See the CNCF Sandbox Guidelines v1.0 for the detailed process. 要成为沙箱级,一个项目必须至少有两个TOC赞助商。 有关详细过程,请参见《 CNCF沙箱指南v1.0》。 +> To be accepted in the sandbox, a project must have at least two TOC sponsors. See the CNCF Sandbox Guidelines v1.0 for the detailed process. 要想成为沙箱级,一个项目必须至少有两个TOC赞助商。 有关详细过程,请参见《 CNCF沙箱指南v1.0》。 ### Incubating stage 孵化级 @@ -93,7 +93,7 @@ CNCF为每个成熟度级别制定了详细的[标准][8](为方便读者而 > * Have a public list of project adopters for at least the primary repo (e.g., ADOPTERS.md or logos on the project website). > * Receive a supermajority vote from the TOC to move to graduation stage. Projects can attempt to move directly from sandbox to graduation, if they can demonstrate sufficient maturity. Projects can remain in an incubating state indefinitely, but they are normally expected to graduate within two years. > ->要从沙箱或孵化状态毕业,或者要使一个新项目作为已毕业项目加入,项目除了必须满足孵化阶段标准外还要满足: +>要从沙箱或孵化级毕业,或者要使一个新项目作为已毕业项目加入,项目除了必须满足孵化级的标准外还要满足: > > *至少有两个组织的提交者。 > *已获得并维护了“核心基础设施计划最佳实践徽章”。 @@ -106,7 +106,7 @@ CNCF为每个成熟度级别制定了详细的[标准][8](为方便读者而 ## 9 projects to consider 值得考虑的9个项目 While it’s impossible to cover all of the CNCF projects in this article, I’ll describe are nine of most interesting Graduated and Incubating open source projects. -本文不可能涵盖所有的CNCF项目,我将介绍最有趣的9个“毕业和孵化中”的开源项目。 +本文不可能涵盖所有的CNCF项目,我将介绍最有趣的9个“已毕业和孵化中”的开源项目。 Name | License | What It Is 名称|授权类型|简要描述 @@ -122,14 +122,14 @@ Name | License | What It Is [CRI-O][17] | Apache 2.0 | Lightweight runtime for Kubernetes 专门用于K8s的轻量级运行时环境 I also created this video tutorial to walk through these projects. -我也创建了这个视频材料来介绍这些项目。 +我也创建了视频材料来介绍这些项目。 ## Graduated projects 毕业项目 Graduated projects are considered mature—adopted by many organizations—and must adhere to the CNCF’s guidelines. Following are three of the most popular open source CNCF Graduated projects. (Note that some of these descriptions are adapted and reused from the projects' websites.) 已毕业的项目被认为是成熟的,已被许多组织采用的,并且严格遵守了CNCF的准则。 以下是三个最受欢迎的开源CNCF毕业项目。 (请注意,其中一些描述来源于项目的网站并被做了改编。) -### Kubernetes K8S +### Kubernetes Ah, Kubernetes. How can we talk about cloud-native applications without mentioning Kubernetes? Invented by Google, Kubernetes is undoubtedly the most famous container-orchestration platform for container-based applications, and it is also an open source tool. Kubernetes。我们如何在不提及Kubernetes的情况下谈论云原生应用程序? Google发明的Kubernetes无疑是最著名的基于容器的应用程序的容器编排平台,而且它还是一个开源工具。 @@ -174,7 +174,7 @@ There are numerous alternatives for service mesh applications, such as Uber’s * It’s API-driven and supports dynamic configuration and hot reloads * Has a strong focus on metric collection, tracing, and overall observability -服务网格应用程序有很多替代方案,例如Uber的[Linkerd][24](下面会讨论)和[Istio][25]。 Istio通过将其部署为[Sidecar][26]并利用了[Mixer][27]的配置模型,实现了对Envoy的扩展。 Envoy的显著特性有: +服务网格应用有很多替代方案,例如Uber的[Linkerd][24](下面会讨论)和[Istio][25]。 Istio通过将其部署为[Sidecar][26]并利用了[Mixer][27]的配置模型,实现了对Envoy的扩展。 Envoy的显著特性有: *所有的“table stakes(入场筹码,引申为基础必备特性)”特性(与控制平面(例如Istio)组合时) *带载运行时99%数据可达到低延时 @@ -226,7 +226,7 @@ However, there are some subtle differences between the two. While Envoy and Link * Built-in service discovery abstractions to unite multiple systems * Support for gRPC, HTTP/2, and HTTP/1.x requests plus all TCP traffic -像创建Envoy代理的Lyft一样,Uber开发了Linkerd开源解决方案用于生产级别上的服务维护。 在某些方面,Linkerd就像Envoy一样,因为两者都是服务网格工具,旨在提供平台级的可观测性,可靠性和安全性,而无需进行配置或代码更改。 +像创建Envoy代理的Lyft一样,Uber开发了Linkerd开源解决方案用于生产级的服务维护。在某些方面,Linkerd就像Envoy一样,因为两者都是服务网格工具,旨在提供平台级的可观测性,可靠性和安全性,而无需进行配置或代码更改。 但是,两者之间存在一些细微的差异。 尽管Envoy和Linkerd充当代理并可以通过所连接的服务进行上报,但是Envoy并不像Linkerd那样被设计为Kubernetes Ingress控制器。 Linkerd的显著功能包括: @@ -279,7 +279,7 @@ CRI-O is an Open Container Initiative (OCI)-compliant implementation of the Kube * Storage and management of image layers using containers/storage * Networking support through the Container Network Interface (CNI) -CRI-O是Kubernetes运行时接口的兼容开放容器倡议(OCI)实现。 CRI-O用于各种功能,包括: +CRI-O是Kubernetes运行时接口的OCI兼容实现。CRI-O用于各种功能,包括: *使用runc(或遵从OCI运行时规范的任何实现)和OCI运行时工具运行 *使用容器/镜像进行镜像管理 From 5e45ea6c6e2ee67d0c81040bbc646e7a5f89acf5 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Thu, 16 Apr 2020 22:54:27 +0800 Subject: [PATCH 0318/1809] Remove origin and left chinese --- ...ource cloud native projects to consider.md | 152 ++++-------------- 1 file changed, 31 insertions(+), 121 deletions(-) diff --git a/sources/tech/20190814 9 open source cloud native projects to consider.md b/sources/tech/20190814 9 open source cloud native projects to consider.md index 09304a737b..14ca76e0b5 100644 --- a/sources/tech/20190814 9 open source cloud native projects to consider.md +++ b/sources/tech/20190814 9 open source cloud native projects to consider.md @@ -7,69 +7,47 @@ [#]: via: (https://opensource.com/article/19/8/cloud-native-projects) [#]: author: (Bryant Son https://opensource.com/users/brsonhttps://opensource.com/users/marcobravo) -9 open source cloud native projects to consider 值得考虑的9个开源的云原生项目 +值得考虑的9个开源的云原生项目 ====== -Work with containers? Get familiar with these projects from the Cloud -Native Computing Foundation 工作中用了容器?熟悉这些出自云原生计算基金会的项目? ![clouds in the sky with blue pattern][1] -As the practice of developing applications with containers is getting more popular, [cloud-native applications][2] are also on the rise. By [definition][3]: 随着用容器来开发应用的实践变得流行,[云原生应用][2]也在增长。云原生应用的定义为: > "云原生技术被用于开发应用程序,这些应用通过将服务打包在容器中来完成构建,被部署为微服务,并通过敏捷的DevOps流程和持续集成工作流在弹性基础设施上管理。" -> "Cloud-native technologies are used to develop applications built with services packaged in containers, deployed as microservices, and managed on elastic infrastructure through agile DevOps processes and continuous delivery workflows." - -This description includes four elements that are integral to cloud-native applications: 这个定义提到了构成云原生应用的4个元素: - 1. Container 容器 - 2. Microservice 微服务 - 3. DevOps DevOps - 4. Continuous integration and continuous delivery (CI/CD) 持续集成和持续交付 + 1. 容器 + 2. 微服务 + 3. DevOps + 4. 持续集成和持续交付 (CI/CD) - -Although these technologies have very distinct histories, they complement each other well and have led to surprisingly exponential growth of cloud-native applications and toolsets in a short time. This [Cloud Native Computing Foundation][4] (CNCF) infographic shows the size and breadth of the cloud-native application ecosystem today. 尽管这些技术各有各自独特的历史,但它们相互补充,共同导致了云原生应用和工具在短时间内惊人的指数级增长。这个[云原生计算基金会][4]信息图呈现了当今云原生应用生态的规模和广度。 ![Cloud-Native Computing Foundation applications ecosystem][5] -Cloud-Native Computing Foundation projects 云原生计算基金会项目 -I mean, just look at that! And this is just a start. Just as NodeJS’s creation sparked the explosion of endless JavaScript tools, the popularity of container technology started the exponential growth of cloud-native applications. 我想说,瞧着吧!这仅仅是一个开始。正如NodeJS的出现引发了无休止的JavaScript工具的爆炸式增长一样,容器技术的普及也推动了云原生应用的指数增长。 -The good news is that there are several organizations that oversee and connect these dots together. One is the [**Open Containers Initiative (OCI)**][6], which is a lightweight, open governance structure (or project), "formed under the auspices of the Linux Foundation for the express purpose of creating open industry standards around container formats and runtime." The other is the **CNCF**, "an open source software foundation dedicated to making cloud native computing universal and sustainable." 好消息是,有几个组织负责监管这些技术并将它们融合在一起。 其中之一是[** Open Containers Initiative(OCI)**][6],它是一个轻量级的,开放的治理机构(或项目),“它是在Linux基金会的主持下形成的,其明确目的是创建开放的行业标准的容器格式和运行时。” 另一个是** CNCF **,“它是一个致力于使云原生计算具有通用性和可持续性的开源软件基金会”。 -In addition to building a community around cloud-native applications generally, CNCF also helps projects set up structured governance around their cloud-native applications. CNCF created the concept of maturity levels—Sandbox, Incubating, or Graduated—which correspond to the Innovators, Early Adopters, and Early Majority tiers on the diagram below. 除了常见的围绕云原生应用建立社区之外,CNCF还帮助项目基于其云原生应用建立结构化的管理。CNCF创建了成熟等级的概念(沙箱级,孵化级或毕业级),分别与下图中的“创新者”,“早期采用者”和“早期大量应用”相对应。 ![CNCF project maturity levels][7] -CNCF project maturity levels CNCF项目成熟等级 +CNCF项目成熟等级 -The CNCF has detailed [criteria][8] for each maturity level (included below for readers’ convenience). A two-thirds supermajority of the Technical Oversight Committee (TOC) is required for a project to be Incubating or Graduated. CNCF为每个成熟等级制定了详细的[标准][8](为方便读者而列在下面)。 获得技术监督委员会(TOC)三分之二的同意才能转为孵化或毕业级。 -### Sandbox stage 沙箱级 +### 沙箱级 -> To be accepted in the sandbox, a project must have at least two TOC sponsors. See the CNCF Sandbox Guidelines v1.0 for the detailed process. 要想成为沙箱级,一个项目必须至少有两个TOC赞助商。 有关详细过程,请参见《 CNCF沙箱指南v1.0》。 +> 要想成为沙箱级,一个项目必须至少有两个TOC赞助商。 有关详细过程,请参见《 CNCF沙箱指南v1.0》。 -### Incubating stage 孵化级 +### 孵化级 -> Note: The incubation level is the point at which we expect to perform full due diligence on projects. -> -> To be accepted to incubating stage, a project must meet the sandbox stage requirements plus: -> -> * Document that it is being used successfully in production by at least three independent end users which, in the TOC’s judgement, are of adequate quality and scope. -> * Have a healthy number of committers. A committer is defined as someone with the commit bit; i.e., someone who can accept contributions to some or all of the project. -> * Demonstrate a substantial ongoing flow of commits and merged contributions. -> * Since these metrics can vary significantly depending on the type, scope, and size of a project, the TOC has final judgement over the level of activity that is adequate to meet these criteria -> >注意:孵化级是我们期望对项目进行全面尽职调查的起点。 > >要进入孵化阶段,项目除了满足沙箱阶段的要求之外还要满足: @@ -81,18 +59,8 @@ CNCF为每个成熟等级制定了详细的[标准][8](为方便读者而列 -### Graduated stage 毕业级 +### 毕业级 -> To graduate from sandbox or incubating status, or for a new project to join as a graduated project, a project must meet the incubating stage criteria plus: -> -> * Have committers from at least two organizations. -> * Have achieved and maintained a Core Infrastructure Initiative Best Practices Badge. -> * Have completed an independent and third party security audit with results published of similar scope and quality as the following example (including critical vulnerabilities addressed): and all critical vulnerabilities need to be addressed before graduation. -> * Adopt the CNCF Code of Conduct. -> * Explicitly define a project governance and committer process. This preferably is laid out in a GOVERNANCE.md file and references an OWNERS.md file showing the current and emeritus committers. -> * Have a public list of project adopters for at least the primary repo (e.g., ADOPTERS.md or logos on the project website). -> * Receive a supermajority vote from the TOC to move to graduation stage. Projects can attempt to move directly from sandbox to graduation, if they can demonstrate sufficient maturity. Projects can remain in an incubating state indefinitely, but they are normally expected to graduate within two years. -> >要从沙箱或孵化级毕业,或者要使一个新项目作为已毕业项目加入,项目除了必须满足孵化级的标准外还要满足: > > *至少有两个组织的提交者。 @@ -103,77 +71,56 @@ CNCF为每个成熟等级制定了详细的[标准][8](为方便读者而列 > *至少有主仓的项目采用者的公开列表(例如,ADOPTERS.md或项目网站上的徽标)。 > *获得TOC的多数票,进入毕业阶段。如果项目能够证明足够的成熟度,则可以尝试直接从沙箱过渡到毕业。项目可以无限期保持孵化状态,但是通常预计它们会在两年内毕业。 -## 9 projects to consider 值得考虑的9个项目 +## 值得考虑的9个项目 -While it’s impossible to cover all of the CNCF projects in this article, I’ll describe are nine of most interesting Graduated and Incubating open source projects. 本文不可能涵盖所有的CNCF项目,我将介绍最有趣的9个“已毕业和孵化中”的开源项目。 -Name | License | What It Is 名称|授权类型|简要描述 ---|---|--- -[Kubernetes][9] | Apache 2.0 | Orchestration platform for containers 容器编排平台 -[Prometheus][10] | Apache 2.0 | Systems and service monitoring tool 系统和服务监控工具 -[Envoy][11] | Apache 2.0 | Edge and service proxy 边缘和服务代理 -[rkt][12] | Apache 2.0 | Pod-native container engine Pod原生的容器引擎 -[Jaeger][13] | Apache 2.0 | Distributed tracing system 分布式跟踪系统 -[Linkerd][14] | Apache 2.0 | Transparent service mesh 无感服务网格 -[Helm][15] | Apache 2.0 | Kubernetes package manager K8s包管理器 -[Etcd][16] | Apache 2.0 | Distributed key-value store 分布式键值存储 -[CRI-O][17] | Apache 2.0 | Lightweight runtime for Kubernetes 专门用于K8s的轻量级运行时环境 +[Kubernetes][9] | Apache 2.0 | 容器编排平台 +[Prometheus][10] | Apache 2.0 | 系统和服务监控工具 +[Envoy][11] | Apache 2.0 | 边缘和服务代理 +[rkt][12] | Apache 2.0 | Pod原生的容器引擎 +[Jaeger][13] | Apache 2.0 | 分布式跟踪系统 +[Linkerd][14] | Apache 2.0 | 无感服务网格 +[Helm][15] | Apache 2.0 | Kubernetes包管理器 +[Etcd][16] | Apache 2.0 | 分布式键值存储 +[CRI-O][17] | Apache 2.0 | 专门用于Kubernetes的轻量级运行时环境 -I also created this video tutorial to walk through these projects. 我也创建了视频材料来介绍这些项目。 -## Graduated projects 毕业项目 +## 毕业项目 -Graduated projects are considered mature—adopted by many organizations—and must adhere to the CNCF’s guidelines. Following are three of the most popular open source CNCF Graduated projects. (Note that some of these descriptions are adapted and reused from the projects' websites.) 已毕业的项目被认为是成熟的,已被许多组织采用的,并且严格遵守了CNCF的准则。 以下是三个最受欢迎的开源CNCF毕业项目。 (请注意,其中一些描述来源于项目的网站并被做了改编。) ### Kubernetes -Ah, Kubernetes. How can we talk about cloud-native applications without mentioning Kubernetes? Invented by Google, Kubernetes is undoubtedly the most famous container-orchestration platform for container-based applications, and it is also an open source tool. -Kubernetes。我们如何在不提及Kubernetes的情况下谈论云原生应用程序? Google发明的Kubernetes无疑是最著名的基于容器的应用程序的容器编排平台,而且它还是一个开源工具。 +Kubernetes! 我们如何在不提及Kubernetes的情况下谈论云原生应用程序? Google发明的Kubernetes无疑是最著名的基于容器的应用程序的容器编排平台,而且它还是一个开源工具。 -What is a container orchestration platform? Basically, a container engine on its own may be okay for managing a few containers. However, when you are talking about thousands of containers and hundreds of services, managing those containers becomes super complicated. This is where the container engine comes in. The container-orchestration engine helps scale containers by automating the deployment, management, networking, and availability of containers. 什么是容器编排平台? 通常,一个容器引擎本身可以管理几个容器。 但是,当您谈论数千个容器和数百个服务时,管理这些容器变得非常复杂。 这就是容器编排引擎的用武之地。容器编排引擎通过自动化容器的部署,管理,网络和可用性来帮助管理大量的容器。 -Docker Swarm and Mesosphere Marathon are other container-orchestration engines, but it is safe to say that Kubernetes has won the race (at least for now). Kubernetes also gave birth to Container-as-a-Service (CaaS) platforms like [OKD][18], the Origin community distribution of Kubernetes that powers [Red Hat OpenShift][19]. Docker Swarm和Mesosphere Marathon也是容器编排引擎,但是可以肯定地说Kubernetes在竞争中胜出(至少现在是这样)。Kubernetes还诞生了容器即服务(CaaS)平台如[OKD][18],它是Origin社区针对Kubernetes的发行版,并成了[Red Hat OpenShift][19]的一部分。 -To get started, visit the [Kubernetes GitHub repository][9], and access its documentation and learning resources from the [Kubernetes documentation][20] page. 想开始学习请访问[Kubernetes GitHub仓库][9],并从[Kubernetes文档][20]页面访问其文档和学习资源。 ### Prometheus -Prometheus is an open source system monitoring and alerting toolkit built at SoundCloud in 2012. Since then, many companies and organizations have adopted Prometheus, and the project has a very active developer and user community. It is now a standalone open source project that is maintained independently of the company. Prometheus是2012年在SoundCloud上构建的一个开源系统监控和告警工具。之后,许多公司和组织都使用了Prometheus,并且该项目拥有非常活跃的开发者和用户群体。 现在,它是一个独立于公司的独立维护的开源项目。 ![Prometheus’ architecture][21] -Prometheus’ architecture Prometheus的架构 +Prometheus的架构 -The easiest way to think about Prometheus is to visualize a production system that needs to be up 24 hours a day and 365 days a year. No system is perfect, and there are techniques to reduce failures (called fault-tolerant systems). However, if an issue occurs, the most important thing is to identify it as soon as possible. That is where a monitoring tool like Prometheus comes in handy. Prometheus is more than a container-monitoring tool, but it is most popular among cloud-native application companies. In addition, other open source monitoring tools, including [Grafana][22], leverage Prometheus. 理解Prometheus的最简单方法是可视化一个生产系统,该系统需要24(小时)x365天都可以正常运行。 没有哪个系统是完美的,也有减少故障的技术(称为容错系统)。 但是,如果出现问题,最重要的是尽快识别它。 这就是像Prometheus这样的监控工具的用武之地。Prometheus不仅是容器监控工具,它在云原生应用公司中也最受欢迎。 此外,其他开源监视工具,包括[Grafana][22],都借鉴了Prometheus。 -The best way to get started with Prometheus is to check out its [GitHub repo][10]. Running Prometheus locally is easy, but you need to have a container engine installed. You can access detailed documentation on [Prometheus’ website][23]. + 开始使用Prometheus的最佳方法是下载其[GitHub仓库][10]。 在本地运行Prometheus很容易,但是您需要安装一个容器引擎。 您可以在[Prometheus网站][23]上查看详细的文档。 ### Envoy -Envoy (or Envoy Proxy) is an open source edge and service proxy designed for cloud-native applications. Created at Lyft, Envoy is a high-performance, C++, distributed proxy designed for single services and applications, as well as a communications bus and a universal data plane designed for large microservice service mesh architectures. Built on the learnings of solutions such as Nginx, HAProxy, hardware load balancers, and cloud load balancers, Envoy runs alongside every application and abstracts the network by providing common features in a platform-agnostic manner. Envoy(或Envoy代理)是专为云原生应用设计的开源的边缘代理和服务代理。 由Lyft创建的Envoy是为单一服务和应用而设计的高性能的C++分布式代理,同时也是为由大量微服务组成的服务网格架构而设计的通信总线和通用数据平面。 基于对Nginx,HAProxy,硬件负载均衡器和云负载均衡器等方案了解的基础上,Envoy与每个应用相伴(并行)运行,并对网络进行了高度抽象,最终以平台无关的方式来提供通用功能。 -When all service traffic in an infrastructure flows through an Envoy mesh, it becomes easy to visualize problem areas via consistent observability, tune overall performance, and add substrate features in a single place. Basically, Envoy Proxy is a service mesh tool that helps organizations build a fault-tolerant system for production environments. 当基础设施中的所有服务流量都经过一个Envoy网格时,很容易就可以通过连贯的监测来可视化问题域,调整整体性能,并在单个位置添加基础功能。基本上,Envoy代理是一个可帮助组织为生产环境构建容错系统的服务网格工具。 -There are numerous alternatives for service mesh applications, such as Uber’s [Linkerd][24] (discussed below) and [Istio][25]. Istio extends Envoy Proxy by deploying as a [Sidecar][26] and leveraging the [Mixer][27] configuration model. Notable Envoy features are: - - * All the "table stakes" features (when paired with a control plane, like Istio) are included - * Low, 99th percentile latencies at scale when running under load - * Acts as an L3/L4 filter at its core with many L7 filters provided out of the box - * Support for gRPC and HTTP/2 (upstream/downstream) - * It’s API-driven and supports dynamic configuration and hot reloads - * Has a strong focus on metric collection, tracing, and overall observability - 服务网格应用有很多替代方案,例如Uber的[Linkerd][24](下面会讨论)和[Istio][25]。 Istio通过将其部署为[Sidecar][26]并利用了[Mixer][27]的配置模型,实现了对Envoy的扩展。 Envoy的显著特性有: *所有的“table stakes(入场筹码,引申为基础必备特性)”特性(与控制平面(例如Istio)组合时) @@ -184,48 +131,34 @@ There are numerous alternatives for service mesh applications, such as Uber’s *重点关注指标收集,跟踪和整体可监测性 -Understanding Envoy, proving its capabilities, and realizing its full benefits require extensive experience with running production-level environments. You can learn more in its [detailed documentation][28] and by accessing its [GitHub][11] repository. 要想了解Envoy,证实其能力并意识到其全部优势,需要丰富的在生产级环境运行的经验。 您可以在[详细文档][28]或访问其[GitHub][11]仓库了解更多信息。 -## Incubating projects 孵化项目 +## 孵化项目 -Following are six of the most popular open source CNCF Incubating projects. 下面是最流行的开源的CNCF孵化项目中的六个。 ### rkt -rkt, pronounced "rocket," is a pod-native container engine. It has a command-line interface (CLI) for running containers on Linux. In a sense, it is similar to other containers, like [Podman][29], Docker, and CRI-O. rkt, 拼为"rocket", 是一个pod原生的容器引擎。它有一个命令行接口用来在Linux上运行容器。从某种意义上讲,它和其他容器如[Podman][29], Docker和CRI-O相似。 -rkt was originally developed by CoreOS (later acquired by Red Hat), and you can find detailed [documentation][30] on its website and access the source code on [GitHub][12]. rkt最初由CoreOS开发(后来被Red Hat收购),您可以在其网站上找到详细的[文档][30],以及在[GitHub][12]上访问其源代码。 ### Jaeger -Jaeger is an open source, end-to-end distributed tracing system for cloud-native applications. In one way, it is a monitoring solution like Prometheus. Yet it is different because its use cases extend into: Jaeger是面向云原生应用的开源的端到端的分布式跟踪系统。 在某种程度上,它是像Prometheus这样的监控解决方案。但它有所不同,因为其使用场景有所扩展: - * Distributed transaction monitoring 分布式事务监控 - * Performance and latency optimization 性能和延时优化 - * Root-cause analysis 根因分析 - * Service dependency analysis 服务的依赖分析 - * Distributed context propagation 分布式上下文传播 + * 分布式事务监控 + * 性能和延时优化 + * 根因分析 + * 服务的依赖分析 + * 分布式上下文传播 -Jaeger is an open source technology built by Uber. You can find [detailed documentation][31] on its website and its [source code][13] on GitHub. Jaeger是Uber建立的开源的技术。 您可以在其网站上找到[详细文档][31],以及在GitHub上找到其[源码][13]。 ### Linkerd -Like Lyft with Envoy Proxy, Uber developed Linkerd as an open source solution to maintain its service at the production level. In some ways, Linkerd is just like Envoy, as both are service mesh tools designed to give platform-wide observability, reliability, and security without requiring configuration or code changes. - -However, there are some subtle differences between the two. While Envoy and Linkerd function as proxies and can report over services that are connected, Envoy isn’t designed to be a Kubernetes Ingress controller, as Linkerd is. Notable features of Linkerd include: - - * Support for multiple platforms (Docker, Kubernetes, DC/OS, Amazon ECS, or any stand-alone machine) - * Built-in service discovery abstractions to unite multiple systems - * Support for gRPC, HTTP/2, and HTTP/1.x requests plus all TCP traffic - 像创建Envoy代理的Lyft一样,Uber开发了Linkerd开源解决方案用于生产级的服务维护。在某些方面,Linkerd就像Envoy一样,因为两者都是服务网格工具,旨在提供平台级的可观测性,可靠性和安全性,而无需进行配置或代码更改。 但是,两者之间存在一些细微的差异。 尽管Envoy和Linkerd充当代理并可以通过所连接的服务进行上报,但是Envoy并不像Linkerd那样被设计为Kubernetes Ingress控制器。 Linkerd的显著功能包括: @@ -235,28 +168,16 @@ However, there are some subtle differences between the two. While Envoy and Link *支持gRPC,HTTP / 2和HTTP / 1.x请求和所有的TCP流量 -You can read more about it on [Linkerd’s website][32] and access its source code on [GitHub][14]. 您可以在[Linkerd网站][32]上阅读有关它的更多信息,并在[GitHub][14]上访问其源码。 ### Helm -Helm is basically the package manager for Kubernetes. If you’ve used Apache Maven, Maven Nexus, or a similar service, you will understand Helm’s purpose. Helm helps you manage your Kubernetes application. It uses "Helm Charts" to define, install, and upgrade even the most complex Kubernetes applications. Helm isn’t the only method for this; another concept becoming popular is [Kubernetes Operators][33], which are used by Red Hat OpenShift 4. - -You can try Helm by following the [quickstart guide][34] in its documentation or its [GitHub guide][15]. - Helm基本上是Kubernetes的软件包管理器。 如果您使用过Apache Maven,Maven Nexus或类似的服务,您就会理解Helm的作用。 Helm可帮助您管理Kubernetes应用程序。 它使用“Helm图”来定义,安装和升级最复杂的Kubernetes应用程序。 Helm并不是实现此功能的唯一方法; 另一个流行的概念是[Kubernetes Operators][33],它被Red Hat OpenShift 4所使用。 您可以按照其文档中的[快速开始指南][34]或[GitHub指南][15]来试用Helm。 ### Etcd -Etcd is a distributed, reliable key-value store for the most critical data in a distributed system. Its key features are: - - * Well-defined, user-facing API (gRPC) - * Automatic TLS with optional client certificate authentication - * Speed (benchmarked at 10,000 writes per second) - * Reliability (distributed using Raft) - Etcd是用于分布式系统中最关键数据的分布式的,可靠的键值存储。 其主要特性有: *定义明确的,面向用户的API(gRPC) @@ -264,21 +185,12 @@ Etcd是用于分布式系统中最关键数据的分布式的,可靠的键值 *速度(可达每秒10,000次写入) *可靠性(使用Raft实现分布式) -Etcd is used as a built-in default data storage for Kubernetes and many other technologies. That said, it is rarely run independently or as a separate service; instead, it utilizes the one integrated into Kubernetes, OKD/OpenShift, or another service. There is also an [etcd Operator][35] to manage its lifecycle and unlock its API management capabilities: - Etcd是Kubernetes和许多其他技术的默认的内置数据存储方案。也就是说,它很少独立运行或作为单独的服务运行; 相反,它利用了集成到Kubernetes,OKD / OpenShift或其他服务中的一个。 还有[etcd Operator][35]来管理其生命周期并解锁其API管理功能: -You can learn more in [etcd’s documentation][36] and access its [source code][16] on GitHub. + 您可以在[etcd文档][36]中了解更多信息,并在GitHub上访问其[源码][16]。 ### CRI-O -CRI-O is an Open Container Initiative (OCI)-compliant implementation of the Kubernetes runtime interface. CRI-O is used for various functions including: - - * Runtime using runc (or any OCI runtime-spec implementation) and OCI runtime tools - * Image management using containers/image - * Storage and management of image layers using containers/storage - * Networking support through the Container Network Interface (CNI) - CRI-O是Kubernetes运行时接口的OCI兼容实现。CRI-O用于各种功能,包括: *使用runc(或遵从OCI运行时规范的任何实现)和OCI运行时工具运行 @@ -286,12 +198,10 @@ CRI-O是Kubernetes运行时接口的OCI兼容实现。CRI-O用于各种功能, *使用容器/存储来存储和管理镜像层 *通过容器网络接口(CNI)来提供网络支持 -CRI-O provides plenty of [documentation][37], including guides, tutorials, articles, and even podcasts, and you can also access its [GitHub page][17]. CRI-O提供了大量的[文档][37],包括指南,教程,文章,甚至播客,您还可以访问其[GitHub页面][17]。 * * * -Did I miss an interesting open source cloud-native project? Please let me know in the comments. 我错过了其他有趣且开源的云原生项目吗? 请在评论中提醒我。 -------------------------------------------------------------------------------- From dcbc94795967d3d057f9c968297237edfabb0928 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Thu, 16 Apr 2020 23:02:36 +0800 Subject: [PATCH 0319/1809] move to translated --- .../20190814 9 open source cloud native projects to consider.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {sources => translated/sources}/tech/20190814 9 open source cloud native projects to consider.md (97%) diff --git a/sources/tech/20190814 9 open source cloud native projects to consider.md b/translated/sources/tech/20190814 9 open source cloud native projects to consider.md similarity index 97% rename from sources/tech/20190814 9 open source cloud native projects to consider.md rename to translated/sources/tech/20190814 9 open source cloud native projects to consider.md index 14ca76e0b5..9ccb1fc0ab 100644 --- a/sources/tech/20190814 9 open source cloud native projects to consider.md +++ b/translated/sources/tech/20190814 9 open source cloud native projects to consider.md @@ -32,7 +32,7 @@ 我想说,瞧着吧!这仅仅是一个开始。正如NodeJS的出现引发了无休止的JavaScript工具的爆炸式增长一样,容器技术的普及也推动了云原生应用的指数增长。 -好消息是,有几个组织负责监管这些技术并将它们融合在一起。 其中之一是[** Open Containers Initiative(OCI)**][6],它是一个轻量级的,开放的治理机构(或项目),“它是在Linux基金会的主持下形成的,其明确目的是创建开放的行业标准的容器格式和运行时。” 另一个是** CNCF **,“它是一个致力于使云原生计算具有通用性和可持续性的开源软件基金会”。 +好消息是,有几个组织负责监管这些技术并将它们融合在一起。 其中之一是[**Open Containers Initiative(OCI)**][6],它是一个轻量级的,开放的治理机构(或项目),“它是在Linux基金会的主持下形成的,其明确目的是创建开放的行业标准的容器格式和运行时。” 另一个是** CNCF **,“它是一个致力于使云原生计算具有通用性和可持续性的开源软件基金会”。 除了常见的围绕云原生应用建立社区之外,CNCF还帮助项目基于其云原生应用建立结构化的管理。CNCF创建了成熟等级的概念(沙箱级,孵化级或毕业级),分别与下图中的“创新者”,“早期采用者”和“早期大量应用”相对应。 ![CNCF project maturity levels][7] From 050c0208456f2b657f86edb427d835200ddc07ca Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Apr 2020 01:11:22 +0800 Subject: [PATCH 0320/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200417=2012?= =?UTF-8?q?=20Linux=20Commands=20to=20Have=20Some=20Fun=20in=20the=20Termi?= =?UTF-8?q?nal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md --- ...mmands to Have Some Fun in the Terminal.md | 343 ++++++++++++++++++ 1 file changed, 343 insertions(+) create mode 100644 sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md diff --git a/sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md b/sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md new file mode 100644 index 0000000000..9c7843ea59 --- /dev/null +++ b/sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md @@ -0,0 +1,343 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (12 Linux Commands to Have Some Fun in the Terminal) +[#]: via: (https://itsfoss.com/funny-linux-commands/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +12 Linux Commands to Have Some Fun in the Terminal +====== + +_**So, you think Linux terminal is all work and no fun? These funny Linux commands will prove you wrong.**_ + +The Linux terminal is the place to get serious work done. We have plenty of useful [linux command tips and tricks][1] to help you with that. + +But, did you know that you can have a lot of fun using the terminal? Well, if you did not, then you are not alone. Most Linux users see the terminal as an interface that is designed and built for system management and development tasks. + +However, you will be surprised to know that there are tons of [terminal based games][2] and [ASCII games][3] that you can play in the terminal. + +And, in this article, I’m going to explore some interesting, some funny and some ridiculous commands that you can type into the terminal on Linux and have fun! + +### Have some fun in Linux terminal with these commands + +![][4] + +You’ll find a lot of these commands ridiculous or useless but some of them could actually be put to some good use. + +I have added installation instructions for Ubuntu/Debian. If you are using Ubuntu-based distribution, please make sure to [enable universe repository][5] as most of these commands are not in the main repository. + +If you are using Arch, Fedora, SUSE, Solus or any other non-Ubuntu distributions, please use your distribution’s package manager to install these funny Linux commands. + +#### 1\. Run a train in the terminal + +Let’s take a ride in the locomotive and begin our auspicious journey. And I mean it literally! + +The sl command allows you to run a train in your terminal. + +![][6] + +Here’s how to install the command: + +``` +sudo apt install sl +``` + +Once done, you can simply type in the following in the terminal to get started: + +``` +sl +``` + +Impressive, isn’t it? But, hold on. We are not done yet! Apparently, you can fly your locomotive. Just add the option -F, Mr. Potter: + +``` +sl -F +``` + +****This should make the locomotive get wings to fly off from the terminal window! + +#### 2\. Add the Matrix effect to your Linux terminal + +Remember the iconic sci-fi movie [The Matrix][7]? The green text falling down on the terminal became an identity of Matrix. + +You can have this Matrix digital rain on your Linux box as well! You just need to install **cmatrix** and type it in the terminal. + +![][8] + +Installing cmatrix on Debian/Ubuntu Linux: + +``` +sudo apt install cmatrix +``` + +Now, all you have to do is type the following to get the matrix screen on terminal: + +``` +cmatrix +``` + +Press Ctrl+C to stop it, Mr. Anderson. + +**Recommended Read:** + +![][9] + +#### [Watch Star Wars In Linux Terminal via Telnet][10] + +Watch Star Wars in ASCII art Linux terminal. + +#### 3\. Let there be fire + +Keep your fire extinguisher handy because now you are going to start a fire in your terminal! + +![][11] + +To get it installed, here’s what you have to type: + +``` +sudo apt install libaa-bin +``` + +Once done start a fire in your terminal by entering: + +``` +aafire +``` + +Press Ctrl+C to stop it. + +#### 4\. Fortune ~~Cookie~~ Command + +Want to know your fortune but there are no fortune cookies around you? + +Not to worry, you just need to type “fortune” on your terminal and press enter. The terminal will display a random sentence just like you usually get in fortune cookies. + +![][12] + +Install it with: + +``` +sudo apt install fortune +``` + +Once done, simply type in the command below to know your fortune: + +``` +fortune +``` + +Now this is one of the commands here that you could actually use. You can use it as message of the day so that in a multi-user environment, all the users will see a random fortune cookie when they login. + +You may also add it to your bashrc file so that it shows you a random message as soon as you log in to the terminal. + +#### 5\. Pet lover? This is for you + +Oneko is a little fun command that will change your regular cursor into a mouse and creates a curious little cat who will chase your cursor once you move it. It’s not limited to just the terminal. You can keep on working while the cat chases the cursor. + +Now, that’s something fun to do specially if you have kids at home. + +![][13] + +Install Oneko with this command: + +``` +sudo apt install oneko +``` + +Run it with this command: + +``` +oneko +``` + +In case you want a dog instead of a cat, type: + +``` +oneko -dog +``` + +There are a few more types of cats available. You can get that information by using oneko –help. To stop it, use Ctrl+C. + +#### 6\. Little brother is watching you + +Xeyes is a tiny gui program that let the user draws a pair of ever watching eyes! It will follow your mouse cursor constantly. Run the command and see it yourself! + +![][14] + +You can install it using this command: + +``` +sudo apt install xeyes +``` + +And then use it with this: + +``` +xeyes +``` + +Press Ctrl+C to stop it. + +#### Let the terminal speak for you + +To try out this command, make sure you have turned on your speakers. [eSpeak][15] is a fun command that gives your terminal a voice. Yes, you heard that right. + +Install the package first: + +``` +sudo apt install espeak +``` + +Next, you need to simply type in the command along with a text that you want to listen as audio: + +``` +espeak "Type what your computer says" +``` + +Whatever you place in the double quotes, your computer is obligated to say! It’s like [echo command in Linux][16]. But instead of printing, it speaks. + +#### Toilet (but it has nothing to do with a washroom) + +This sounds weird, yes. But, it’s just a command that transforms a text into large ASCII characters. + +![][17] + +Install toilet with this command: + +``` +sudo apt install toilet +``` + +Once done, you just need to type in: + +``` +toilet sample text you want +``` + +I don’t know why this little program is called toilet. + +#### What does the ~~fox~~ cow say? + +Cowsay is a command that displays a cow using ASCII characters in the terminal. And by using this command you can instruct the cow to say anything you want. + +Not to be confused with any audio – it will just display a text (like you usually see in a comic book). + +![Cowsay Cowthink][18] + +Install ****cowsay: + +``` +sudo apt install cowsay +``` + +Once you have it installed, you just need to type in: + +``` +cowsay "your text" +``` + +Whatever you place in the double quotes, your cow is obligated to say! I have seen a few sysadmins using it to display the message of the day. Maybe you can do the same. You may even combine it with fortune command. + +#### Banner Command + +The banner command works just like the toilet command but it is limited to print only 10 characters at most. + +![][19] + +You can install banner command like this: + +``` +sudo apt install sysvbanner +``` + +Then use it in the following way: + +``` +banner "Welcome" +``` + +Replace content in the double quotes and you shall have your desired text displayed. + +#### Yes command + +![][20] + +The “yes” command helps you to loop an automated response until you terminate the command. This command will print the exact same thing indefinitely. If you want to produce huge amounts of junk text fast, then this command will work like a charm. + +You may also use it to provide a yes to a command (if it prompts for it). For example, the apt upgrade command asks for your confirmation, you can use it like this: + +``` +yes | sudo apt upgrade +``` + +You don’t need to install any package for it. Yes command is already available. + +Terminate the yes command loop, simply press **CTRL + C**. + +#### Get a new identity, well, sort of + +Want to generate a random fake identity? I give you the command “rig”. Once you place this in the terminal, it will generate a fake identity. + +![][21] + +Install rig with this command: + +``` +sudo apt install rig +``` + +Then simply type this: + +``` +rig +``` + +It may be used in scripts or web-apps that displays random information but I haven’t done anything of that sort on my own. + +**Wrapping Up** + +I hope you liked this list of fun Linux commands. Which command do you like the most here? Do you know some other such amusing commands? Do share it with us in the comment section. + +![][22] + +### Srimanta Koley + +A passionate writer, a distrohopper and an open source enthusiast, Srimanta is extremely fond of everything related to technology. He loves to read books and has an unhealthy addiction to the 90s! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/funny-linux-commands/ + +作者:[Community][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-command-tricks/ +[2]: https://itsfoss.com/best-command-line-games-linux/ +[3]: https://itsfoss.com/best-ascii-games/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fun-linux-commands.png?ssl=1 +[5]: https://itsfoss.com/ubuntu-repositories/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/sl-command.jpg?ssl=1 +[7]: https://en.wikipedia.org/wiki/The_Matrix +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/matrix-screen-command.png?ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png?fit=732%2C462&ssl=1 +[10]: https://itsfoss.com/star-wars-linux/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fire-command.png?ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fortune-command.jpg?ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/oneko-command.jpg?ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/xeyes-command.jpg?ssl=1 +[15]: https://itsfoss.com/espeak-text-speech-linux/ +[16]: https://linuxhandbook.com/echo-command/ +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/toilet-command.jpg?ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/cowsay-cowthink.jpg?ssl=1 +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/banner-command.jpg?ssl=1 +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/yes-yourtext.jpg?ssl=1 +[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/rig-command.jpg?ssl=1 +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/srimanta.jpg?ssl=1 From 279fbcac788246a9eef75e3724995b743d7c6dd0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Apr 2020 01:12:54 +0800 Subject: [PATCH 0321/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200416=20Stat?= =?UTF-8?q?e=20of=20software=20engineering,=20JavaScript=20is=20the=20futu?= =?UTF-8?q?re,=20and=20more=20industry=20trends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200416 State of software engineering, JavaScript is the future, and more industry trends.md --- ...is the future, and more industry trends.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 sources/tech/20200416 State of software engineering, JavaScript is the future, and more industry trends.md diff --git a/sources/tech/20200416 State of software engineering, JavaScript is the future, and more industry trends.md b/sources/tech/20200416 State of software engineering, JavaScript is the future, and more industry trends.md new file mode 100644 index 0000000000..201d0242e8 --- /dev/null +++ b/sources/tech/20200416 State of software engineering, JavaScript is the future, and more industry trends.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (State of software engineering, JavaScript is the future, and more industry trends) +[#]: via: (https://opensource.com/article/20/4/state-software-engineering-javascript-and-more-industry-trends) +[#]: author: (Tim Hildred https://opensource.com/users/thildred) + +State of software engineering, JavaScript is the future, and more industry trends +====== +A weekly look at open source community and industry trends. +![Person standing in front of a giant computer screen with numbers, data][1] + +As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. + +## [State of Software Engineering in 2020][2] + +> Software is moving fast, and it is fusing into all other areas of industry. As it is a growing field, learning to program and improving your skills in software engineering can have get you great returns in the future. Moreover, identifying the fastest growing areas of software and investing your time into them can get you to even better places. Keep learning and try to find opportunities that you can capitalize on or products that can serve a niche in a growing field of software. When that niche becomes mainstream, you can end up with a successful product in your hands, which can become your future success. If it fails, it will be an immense experience on the path to becoming a product person. + +**The impact**: Learn COBOL, see the world! + +## [Why JavaScript is the programming language of the future][3] + +> JavaScript has one of the most mature – if not THE most mature – ecosystems a programming language could ever have. The community for JavaScript is vast, and the entry barrier is extremely low. + +**The impact**: The only knowledge I have of the veracity of this statement comes from the JavaScript people I follow on Twitter. If you can indeed extrapolate from them, then JavaScript has a pretty good shot. + +## [Why Linux containers are a CIO's best friend][4] + +> "A big take-away for CIOs is that fit enterprises increasingly view IT as a point of leverage for the business. Having a clear and consistent overall business strategy ranks as one of the most distinctive traits of fit enterprises," said Gartner VP and Distinguished Analyst Andy Roswell-Jones, in Gartner's report on the survey. "In such organizations, digital technology will drive that strategy." + +**The impact**: Point of leverage meaning that if the IT an organization is selected in reference to and in support of that organization's overall strategy there will be an outsized lift on execution against that strategy. The corollary is that without a clear and consistent business strategy no technology can save your enterprise. + +_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/state-software-engineering-javascript-and-more-industry-trends + +作者:[Tim Hildred][a] +选题:[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/thildred +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) +[2]: https://quanticdev.com/articles/software-engineering-in-2020/ +[3]: https://www.freecodecamp.org/news/future-of-javascript/ +[4]: https://www.ciodive.com/news/linux-containers-kubernetes/575506/ From 29818d3a952bd11be4c63c86ae159a2c126b860d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Apr 2020 01:13:58 +0800 Subject: [PATCH 0322/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200416=20Lear?= =?UTF-8?q?ning=20to=20love=20systemd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200416 Learning to love systemd.md --- .../tech/20200416 Learning to love systemd.md | 328 ++++++++++++++++++ 1 file changed, 328 insertions(+) create mode 100644 sources/tech/20200416 Learning to love systemd.md diff --git a/sources/tech/20200416 Learning to love systemd.md b/sources/tech/20200416 Learning to love systemd.md new file mode 100644 index 0000000000..0aa8609ee7 --- /dev/null +++ b/sources/tech/20200416 Learning to love systemd.md @@ -0,0 +1,328 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learning to love systemd) +[#]: via: (https://opensource.com/article/20/4/systemd) +[#]: author: (David Both https://opensource.com/users/dboth) + +Learning to love systemd +====== +systemd is the mother of all processes, responsible for bringing the +Linux host up to a state where productive work can be done. +![Penguin driving a car with a yellow background][1] + +systemd—yes, all lower-case, even at the beginning of a sentence—is the modern replacement for init and SystemV init scripts. It is also much more. + +Like most sysadmins, when I think of the init program and SystemV, I think of Linux startup and shutdown and not really much else, like managing services once they are up and running. Like init, systemd is the mother of all processes, and it is responsible for bringing the Linux host up to a state in which productive work can be done. Some of the functions assumed by systemd, which is far more extensive than the old init program, are to manage many aspects of a running Linux host, including mounting filesystems, managing hardware, handling timers, and starting and managing the system services that are required to have a productive Linux host. + +This series of articles, which is based in part on excerpts from my three-volume Linux training course, [_Using and administering Linux: zero to sysadmin_][2], explores systemd's functions both at startup and beginning after startup finishes. + +### Linux boot + +The complete process that takes a Linux host from an off state to a running state is complex, but it is open and knowable. Before getting into the details, I'll give a quick overview from when the host hardware is turned on until the system is ready for a user to log in. Most of the time, "the boot process" is discussed as a single entity, but that is not accurate. There are, in fact, three major parts to the full boot and startup process: + + * **Hardware boot:** Initializes the system hardware + * **Linux boot:** Loads the Linux kernel and then systemd + * **Linux startup:** Where systemd prepares the host for productive work + + + +The Linux startup sequence begins after the kernel has loaded either init or systemd, depending upon whether the distribution uses the old or new startup, respectively. The init and systemd programs start and manage all the other processes and are both known as the "mother of all processes" on their respective systems. + +It is important to separate the hardware boot from the Linux boot from the Linux startup and to explicitly define the demarcation points between them. Understanding these differences and what part each plays in getting a Linux system to a state where it can be productive makes it possible to manage these processes and better determine where a problem is occurring during what most people refer to as "boot." + +The startup process follows the three-step boot process and brings the Linux computer up to an operational state in which it is usable for productive work. The startup process begins when the kernel transfers control of the host to systemd. + +### systemd controversy + +systemd can evoke a wide range of reactions from sysadmins and others responsible for keeping Linux systems up and running. The fact that systemd is taking over so many tasks in many Linux systems has engendered pushback and discord among certain groups of developers and sysadmins. + +SystemV and systemd are two different methods of performing the Linux startup sequence. SystemV start scripts and the init program are the old methods, and systemd using targets is the new method. Although most modern Linux distributions use the newer systemd for startup, shutdown, and process management, there are still some that do not. One reason is that some distribution maintainers and some sysadmins prefer the older SystemV method over the newer systemd. + +I think both have advantages. + +#### Why I prefer SystemV + +I prefer SystemV because it is more open. Startup is accomplished using Bash scripts. After the kernel starts the init program, which is a compiled binary, init launches the **rc.sysinit** script, which performs many system initialization tasks. After **rc.sysinit** completes, init launches the **/etc/rc.d/rc** script, which in turn starts the various services defined by the SystemV start scripts in the **/etc/rc.d/rcX.d**, where "X" is the number of the runlevel being started. + +Except for the init program itself, all these programs are open and easily knowable scripts. It is possible to read through these scripts and learn exactly what is taking place during the entire startup process, but I don't think many sysadmins actually do that. Each start script is numbered so that it starts its intended service in a specific sequence. Services are started serially, and only one service starts at a time. + +systemd, developed by Red Hat's Lennart Poettering and Kay Sievers, is a complex system of large, compiled binary executables that are not understandable without access to the source code. It is open source, so "access to the source code" isn't hard, just less convenient. systemd appears to represent a significant refutation of multiple tenets of the Linux philosophy. As a binary, systemd is not directly open for the sysadmin to view or make easy changes. systemd tries to do everything, such as managing running services, while providing significantly more status information than SystemV. It also manages hardware, processes, and groups of processes, filesystem mounts, and much more. systemd is present in almost every aspect of the modern Linux host, making it the one-stop tool for system management. All of this is a clear violation of the tenets that programs should be small and that each program should do one thing and do it well. + +#### Why I prefer systemd + +I prefer systemd as my startup mechanism because it starts as many services as possible in parallel, depending upon the current stage in the startup process. This speeds the overall startup and gets the host system to a login screen faster than SystemV. + +systemd manages almost every aspect of a running Linux system. It can manage running services while providing significantly more status information than SystemV. It also manages hardware, processes and groups of processes, filesystem mounts, and much more. systemd is present in almost every aspect of the modern Linux operating system, making it the one-stop tool for system management. (Does this sound familiar?) + +The systemd tools are compiled binaries, but the tool suite is open because all the configuration files are ASCII text files. Startup configuration can be modified through various GUI and command-line tools, as well as adding or modifying various configuration files to suit the needs of the specific local computing environment. + +#### The real issue + +Did you think I could not like both startup systems? I do, and I can work with either one. + +In my opinion, the real issue and the root cause of most of the controversy between SystemV and systemd is that there is [no choice][3] on the sysadmin level. The choice of whether to use SystemV or systemd has already been made by the developers, maintainers, and packagers of the various distributions—but with good reason. Scooping out and replacing an init system, by its extreme, invasive nature, has a lot of consequences that would be hard to tackle outside the distribution design process. + +Despite the fact that this choice is made for me, my Linux hosts boot up and work, which is what I usually care the most about. As an end user and even as a sysadmin, my primary concern is whether I can get my work done, work such as writing my books and this article, installing updates, and writing scripts to automate everything. So long as I can do my work, I don't really care about the start sequence used on my distro. + +I do care when there is a problem during startup or service management. Regardless of which startup system is used on a host, I know enough to follow the sequence of events to find the failure and fix it. + +#### Replacing SystemV + +There have been previous attempts at replacing SystemV with something a bit more modern. For about two releases, Fedora used a thing called Upstart to replace the aging SystemV, but it did not replace init and provided no changes that I noticed. Because Upstart provided no significant changes to the issues surrounding SystemV, efforts in this direction were quickly dropped in favor of systemd. + +Despite the fact that most Linux developers agree that replacing the old SystemV startup is a good idea, many developers and sysadmins dislike systemd for that. Rather than rehash all the so-called issues that people have—or had—with systemd, I will refer you to two good, if somewhat old, articles that should cover most everything. Linus Torvalds, the creator of the Linux kernel, seems disinterested. In a 2014 ZDNet article, _[Linus Torvalds and others on Linux's systemd][4]_, Linus is clear about his feelings. + +> "I don't actually have any particularly strong opinions on systemd itself. I've had issues with some of the core developers that I think are much too cavalier about bugs and compatibility, and I think some of the design details are insane (I dislike the binary logs, for example), but those are details, not big issues." + +In case you don't know much about Linus, I can tell you that if he does not like something, he is very outspoken, explicit, and quite clear about that dislike. He has become more socially acceptable in his manner of addressing his dislike about things. + +In 2013, Poettering wrote a long blog post in which he debunks the [myths about systemd][5] while providing insight into some of the reasons for creating it. This is a very good read, and I highly recommend it. + +### systemd tasks + +Depending upon the options used during the compile process (which are not considered in this series), systemd can have as many as 69 binary executables that perform the following tasks, among others: + + * The systemd program runs as PID 1 and provides system startup of as many services in parallel as possible, which, as a side effect, speeds overall startup times. It also manages the shutdown sequence. + * The systemctl program provides a user interface for service management. + * Support for SystemV and LSB start scripts is offered for backward compatibility. + * Service management and reporting provide more service status data than SystemV. + * It includes tools for basic system configuration, such as hostname, date, locale, lists of logged-in users, running containers and virtual machines, system accounts, runtime directories and settings, daemons to manage simple network configuration, network time synchronization, log forwarding, and name resolution. + * It offers socket management. + * systemd timers provide advanced cron-like capabilities to include running a script at times relative to system boot, systemd startup, the last time the timer was started, and more. + * It provides a tool to analyze dates and times used in timer specifications. + * Mounting and unmounting of filesystems with hierarchical awareness allows safer cascading of mounted filesystems. + * It enables the positive creation and management of temporary files, including deletion. + * An interface to D-Bus provides the ability to run scripts when devices are plugged in or removed. This allows all devices, whether pluggable or not, to be treated as plug-and-play, which considerably simplifies device handling. + * Its tool to analyze the startup sequence can be used to locate the services that take the most time. + * It includes journals for storing system log messages and tools for managing the journals. + + + +### Architecture + +Those tasks and more are supported by a number of daemons, control programs, and configuration files. Figure 1 shows many of the components that belong to systemd. This is a simplified diagram designed to provide a high-level overview, so it does not include all of the individual programs or files. Nor does it provide any insight into data flow, which is so complex that it would be a useless exercise in the context of this series of articles. + +![systemd architecture][6] + +A full exposition of systemd would take a book on its own. You do not need to understand the details of how the systemd components in Figure 1 fit together; it's enough to know about the programs and components that enable managing various Linux services and deal with log files and journals. But it's clear that systemd is not the monolithic monstrosity it is purported to be by some of its critics. + +### systemd as PID 1 + +systemd is PID 1. Some of its functions, which are far more extensive than the old SystemV3 init program, are to manage many aspects of a running Linux host, including mounting filesystems and starting and managing system services required to have a productive Linux host. Any of systemd's tasks that are not related to the startup sequence are outside the scope of this article (but some will be explored later in this series). + +First, systemd mounts the filesystems defined by **/etc/fstab**, including any swap files or partitions. At this point, it can access the configuration files located in **/etc**, including its own. It uses its configuration link, **/etc/systemd/system/default.target**, to determine which state or target it should boot the host into. The **default.target** file is a symbolic link to the true target file. For a desktop workstation, this is typically going to be the **graphical.target**, which is equivalent to runlevel 5 in SystemV. For a server, the default is more likely to be the **multi-user.target**, which is like runlevel 3 in SystemV. The **emergency.target** is similar to single-user mode. Targets and services are systemd units. + +The table below (Figure 2) compares the systemd targets with the old SystemV startup runlevels. systemd provides the systemd target aliases for backward compatibility. The target aliases allow scripts—and many sysadmins—to use SystemV commands like **init 3** to change runlevels. Of course, the SystemV commands are forwarded to systemd for interpretation and execution. + +**systemd targets** | **SystemV runlevel** | **target aliases** | **Description** +---|---|---|--- +default.target | | | This target is always aliased with a symbolic link to either **multi-user.target** or **graphical.target**. systemd always uses the **default.target** to start the system. The **default.target** should never be aliased to **halt.target**, **poweroff.target**, or **reboot.target**. +graphical.target | 5 | runlevel5.target | **Multi-user.target** with a GUI +| 4 | runlevel4.target | Unused. Runlevel 4 was identical to runlevel 3 in the SystemV world. This target could be created and customized to start local services without changing the default **multi-user.target**. +multi-user.target | 3 | runlevel3.target | All services running, but command-line interface (CLI) only +| 2 | runlevel2.target | Multi-user, without NFS, but all other non-GUI services running +rescue.target | 1 | runlevel1.target | A basic system, including mounting the filesystems with only the most basic services running and a rescue shell on the main console +emergency.target | S | | Single-user mode—no services are running; filesystems are not mounted. This is the most basic level of operation with only an emergency shell running on the main console for the user to interact with the system. +halt.target | | | Halts the system without powering it down +reboot.target | 6 | runlevel6.target | Reboot +poweroff.target | 0 | runlevel0.target | Halts the system and turns the power off + +Each target has a set of dependencies described in its configuration file. systemd starts the required dependencies, which are the services required to run the Linux host at a specific level of functionality. When all the dependencies listed in the target configuration files are loaded and running, the system is running at that target level. In Figure 2, the targets with the most functionality are at the top of the table, with functionality declining towards the bottom of the table. + +systemd also looks at the legacy SystemV init directories to see if any startup files exist there. If so, systemd uses them as configuration files to start the services described by the files. The deprecated network service is a good example of one that still uses SystemV startup files in Fedora. + +Figure 3 (below) is copied directly from the bootup man page. It shows a map of the general sequence of events during systemd startup and the basic ordering requirements to ensure a successful startup. + + +``` +                                         cryptsetup-pre.target +                                                   | + (various low-level                                v +     API VFS mounts:                 (various cryptsetup devices...) +  mqueue, configfs,                                |    | +  debugfs, ...)                                    v    | +  |                                  cryptsetup.target  | +  |  (various swap                                 |    |    remote-fs-pre.target +  |   devices...)                                  |    |     |        | +  |    |                                           |    |     |        v +  |    v                       local-fs-pre.target |    |     |  (network file systems) +  |  swap.target                       |           |    v     v                 | +  |    |                               v           |  remote-cryptsetup.target  | +  |    |  (various low-level  (various mounts and  |             |              | +  |    |   services: udevd,    fsck services...)   |             |    remote-fs.target +  |    |   tmpfiles, random            |           |             |             / +  |    |   seed, sysctl, ...)          v           |             |            / +  |    |      |                 local-fs.target    |             |           / +  |    |      |                        |           |             |          / +  \\____|______|_______________   ______|___________/             |         / +                              \ /                                |        / +                               v                                 |       / +                        sysinit.target                           |      / +                               |                                 |     / +        ______________________/|\\_____________________           |    / +       /              |        |      |               \          |   / +       |              |        |      |               |          |  / +       v              v        |      v               |          | / +  (various       (various      |  (various            |          |/ +   timers...)      paths...)   |   sockets...)        |          | +       |              |        |      |               |          | +       v              v        |      v               |          | + timers.target  paths.target   |  sockets.target      |          | +       |              |        |      |               v          | +       v              \\_______ | _____/         rescue.service   | +                              \|/                     |          | +                               v                      v          | +                           basic.target         rescue.target    | +                               |                                 | +                       ________v____________________             | +                      /              |              \            | +                      |              |              |            | +                      v              v              v            | +                  display-    (various system   (various system  | +              manager.service     services        services)      | +                      |         required for        |            | +                      |        graphical UIs)       v            v +                      |              |            multi-user.target + emergency.service    |              |              | +         |            \\_____________ | _____________/ +         v                          \|/ + emergency.target                    v +                              graphical.target +``` + +The **sysinit.target** and **basic.target** targets can be considered checkpoints in the startup process. Although one of systemd's design goals is to start system services in parallel, certain services and functional targets must be started before other services and targets can start. These checkpoints cannot be passed until all of the services and targets required by that checkpoint are fulfilled. + +The **sysinit.target** is reached when all of the units it depends on are completed. All of those units, mounting filesystems, setting up swap files, starting udev, setting the random generator seed, initiating low-level services, and setting up cryptographic services (if one or more filesystems are encrypted), must be completed but, within the **sysinit.target**, those tasks can be performed in parallel. + +The **sysinit.target** starts up all of the low-level services and units required for the system to be marginally functional and that are required to enable moving onto the **basic.target**. + +After the **sysinit.target** is fulfilled, systemd then starts all the units required to fulfill the next target. The basic target provides some additional functionality by starting units that are required for all of the next targets. These include setting up things like paths to various executable directories, communication sockets, and timers. + +Finally, the user-level targets, **multi-user.target** or **graphical.target**, can be initialized. The **multi-user.target** must be reached before the graphical target dependencies can be met. The underlined targets in Figure 3 are the usual startup targets. When one of these targets is reached, startup has completed. If the **multi-user.target** is the default, then you should see a text-mode login on the console. If **graphical.target** is the default, then you should see a graphical login; the specific GUI login screen you see depends on your default display manager. + +The bootup man page also describes and provides maps of the boot into the initial RAM disk and the systemd shutdown process. + +systemd also provides a tool that lists dependencies of a complete startup or for a specified unit. A unit is a controllable systemd resource entity that can range from a specific service, such as httpd or sshd, to timers, mounts, sockets, and more. Try the following command and scroll through the results. + + +``` +`systemctl list-dependencies graphical.target` +``` + +Notice that this fully expands the top-level target units list required to bring the system up to the graphical target run mode. Use the **\--all** option to expand all of the other units as well. + + +``` +`systemctl list-dependencies --all graphical.target` +``` + +You can search for strings such as "target," "slice," and "socket" using the search tools of the **less** command. + +So now, try the following. + + +``` +`systemctl list-dependencies multi-user.target` +``` + +and + + +``` +`systemctl list-dependencies rescue.target` +``` + +and + + +``` +`systemctl list-dependencies local-fs.target` +``` + +and + + +``` +`systemctl list-dependencies dbus.service` +``` + +This tool helps me visualize the specifics of the startup dependencies for the host I am working on. Go ahead and spend some time exploring the startup tree for one or more of your Linux hosts. But be careful because the systemctl man page contains this note: + +> _"Note that this command only lists units currently loaded into memory by the service manager. In particular, this command is not suitable to get a comprehensive list at all reverse dependencies on a specific unit, as it won't list the dependencies declared by units currently not loaded."_ + +### Final thoughts + +Even before getting very deep into systemd, it's obvious that it is both powerful and complex. It is also apparent that systemd is not a single, huge, monolithic, and unknowable binary file. Rather, it is composed of a number of smaller components and subcommands that are designed to perform specific tasks. + +The next article in this series will explore systemd startup in more detail, as well as systemd configuration files, changing the default target, and how to create a simple service unit. + +### Resources + +There is a great deal of information about systemd available on the internet, but much is terse, obtuse, or even misleading. In addition to the resources mentioned in this article, the following webpages offer more detailed and reliable information about systemd startup. + + * The Fedora Project has a good, practical [guide][7] [to systemd][7]. It has pretty much everything you need to know in order to configure, manage, and maintain a Fedora computer using systemd. + * The Fedora Project also has a good [cheat sheet][8] that cross-references the old SystemV commands to comparable systemd ones. + * For detailed technical information about systemd and the reasons for creating it, check out [Freedesktop.org][9]'s [description of systemd][10]. + * [Linux.com][11]'s "More systemd fun" offers more advanced systemd [information and tips][12]. + + + +There is also a series of deeply technical articles for Linux sysadmins by Lennart Poettering, the designer and primary developer of systemd. These articles were written between April 2010 and September 2011, but they are just as relevant now as they were then. Much of everything else good that has been written about systemd and its ecosystem is based on these papers. + + * [Rethinking PID 1][13] + * [systemd for Administrators, Part I][14] + * [systemd for Administrators, Part II][15] + * [systemd for Administrators, Part III][16] + * [systemd for Administrators, Part IV][17] + * [systemd for Administrators, Part V][18] + * [systemd for Administrators, Part VI][19] + * [systemd for Administrators, Part VII][20] + * [systemd for Administrators, Part VIII][21] + * [systemd for Administrators, Part IX][22] + * [systemd for Administrators, Part X][23] + * [systemd for Administrators, Part XI][24] + + + +Alison Chiaken, a Linux kernel and systems programmer at Mentor Graphics, offers a preview of her... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/systemd + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) +[2]: http://www.both.org/?page_id=1183 +[3]: http://www.osnews.com/story/28026/Editorial_Thoughts_on_Systemd_and_the_Freedom_to_Choose +[4]: https://www.zdnet.com/article/linus-torvalds-and-others-on-linuxs-systemd/ +[5]: http://0pointer.de/blog/projects/the-biggest-myths.html +[6]: https://opensource.com/sites/default/files/uploads/systemd-architecture.png (systemd architecture) +[7]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html +[8]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet +[9]: http://Freedesktop.org +[10]: http://www.freedesktop.org/wiki/Software/systemd +[11]: http://Linux.com +[12]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ +[13]: http://0pointer.de/blog/projects/systemd.html +[14]: http://0pointer.de/blog/projects/systemd-for-admins-1.html +[15]: http://0pointer.de/blog/projects/systemd-for-admins-2.html +[16]: http://0pointer.de/blog/projects/systemd-for-admins-3.html +[17]: http://0pointer.de/blog/projects/systemd-for-admins-4.html +[18]: http://0pointer.de/blog/projects/three-levels-of-off.html +[19]: http://0pointer.de/blog/projects/changing-roots +[20]: http://0pointer.de/blog/projects/blame-game.html +[21]: http://0pointer.de/blog/projects/the-new-configuration-files.html +[22]: http://0pointer.de/blog/projects/on-etc-sysinit.html +[23]: http://0pointer.de/blog/projects/instances.html +[24]: http://0pointer.de/blog/projects/inetd.html From 1b48e650b8c40af6524808fe2e1608825cf7aec5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Apr 2020 01:14:44 +0800 Subject: [PATCH 0323/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200416=20How?= =?UTF-8?q?=20I've=20adjusted=20my=20work-from-home=20habits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200416 How I-ve adjusted my work-from-home habits.md --- ... I-ve adjusted my work-from-home habits.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20200416 How I-ve adjusted my work-from-home habits.md diff --git a/sources/tech/20200416 How I-ve adjusted my work-from-home habits.md b/sources/tech/20200416 How I-ve adjusted my work-from-home habits.md new file mode 100644 index 0000000000..251e9a7b9e --- /dev/null +++ b/sources/tech/20200416 How I-ve adjusted my work-from-home habits.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I've adjusted my work-from-home habits) +[#]: via: (https://opensource.com/article/20/4/healthy-remote-work-habits) +[#]: author: (Will Kelly https://opensource.com/users/willkelly) + +How I've adjusted my work-from-home habits +====== +WFH newbs and veterans alike have to adjust to self-quarantine; here's +how to maintain some balance. +![Oatmeal and a laptop.][1] + +I've been a remote worker during various chapters in my career, and have tried to carry those lessons into each new remote work experience. At the end of last year, I switched to a job that lets me work from home. Fast forward to the COVID-19 outbreak; even though I was no WFH novice, I found myself having to adapt just like the many other workers who've been suddenly thrust into remote work. + +In hopes of easing that transition, here are some healthy remote work habits to adapt during a pandemic. + +### Keep exercising even if your gym is closed + +I watched the crowd in my gym dwindle the week before my state government issued its stay at home orders. Whether I've been working in an office or at home, going to the gym helps me vent stress, plus it acts as a logical break in my daily routine because I put down my phone and keyboard to clear my head. + +Fortunately, my gym put some training activities online that I plan to use. I already have a stability ball and Bosu ball in my home office that I began using on day three after the pandemic closed all the offices, schools, and later gyms in my local area. As I write this article, I'm entering week 4 of COVID-19-mandated remote work, and I'm still trying to get back to the exercise dedication and momentum I had before this all happened. + +### Dress (and groom) yourself for work + +I've worked from home on and off during my career. When I started my new job, I decided not to repeat some mistakes I made during the last time I worked from home. One mistake I made was not shaving every day. I also stopped getting dressed for work. + +When you dress and groom yourself for work every day, it can help put you in focus for work. You don't have to be too strict; it is a pandemic after all. I'm still debating on sweatpants Fridays during this crisis. + +### Eat meals away from your desk + +It's too easy to just eat meals at your desk when you work at home. Many even do it at the office. I recommend as you get through your COVID-19-enforced remote working that you use eating as a natural break in the ebbs and flows of your day. For example, unless a deadline was calling, I would go out to lunch to break up my remote working days. These days I get up from my desk, walk outside to get a breath of fresh air and have lunch in my living room. + +### Keep a schedule and track your progress + +It's easy to sleep in when you don't have to go to the office. I recommend trying to keep to your regular schedule as much as possible. It's admittedly easy for me to say that because I live alone. If you're home with children, work with your employer to time-shift your schedule to accommodate the added responsibilities and other challenges you're facing right now. It may take a few iterations to get the right schedule, but you'll appreciate the consistency. + +Another word about keeping a schedule—you might add important work meetings to your personal calendar or as reminders on your mobile device, so you have another reminder as you adjust to the new normal of COVID-19. + +The open source community has a lot of great scheduling and project management tools that you can use to track your own time and progress. There are [project management tools][2] for agile development teams. You can also find open source alternatives to [Googl][3][e Calendar][3] available on Android. + +### Put backup communications channels in place + +Even companies with robust telework programs may see some communications outages. It may not even be their CIO's fault, such as the Microsoft Teams outage that happened in Europe early on during the COVID-19 pandemic. + +Having problems dialing into a conference bridge or your employer's group chat having sporadic issues will surprise nobody right now; most understand that workers are in a period of transition, and not everything will run smoothly. However, you still need to have backup channels in place to make that communication happen, even if it's just coworkers exchanging cell numbers so they can text or call each other as needed. + +There are some fully-featured open source [Slack alternatives][4] available that are worth exploring if your organization is lacking in chat applications or if you want to give your team a backup channel to your official corporate application. (Whether you do it with the approval of your corporate IT department is up to you). + +You should also consider installing implementing [MediaWiki][5] or [Twiki][6] to improve collaboration or to give your team an accessible document repository. + +### Pivot on communications when needed + +Every company where I've been an employee or contractor has had its own communications style. Remote working at scale during the COVID-19 epidemic will challenge those communication styles. + +Be prepared to shake up your communication style, whether you're a newb or long term remote worker. That could mean writing more detailed emails instead of the terse ones you normally send to becoming more of a power user with your company's group chat tool. There are also the open source wikis I mentioned earlier that can provide you a centralized platform for any long-form writing you need to do to help communicate project requirements and changes. + +I also extend this advice to your personal communications during the workday. For example, a friend and I video conference during the day. We never did that pre-COVID-19. + +### Final thoughts + +Lots of people will evolve and rethink their remote work habits. It's only healthy that you prepare yourself for adjusting your own remote working habits. What worked for me pre-COVID-19 doesn't necessarily work right now, so I'm adjusting my remote work habits weekly as I see fit so I can maximize my productivity during the current crisis. + +How are you adjusting your remote work habits during self-quarantine? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/healthy-remote-work-habits + +作者:[Will Kelly][a] +选题:[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/willkelly +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/oatmeal-and-fedora.jpg?itok=NBFUH9eF (Oatmeal and a laptop.) +[2]: https://opensource.com/article/18/2/agile-project-management-tools +[3]: https://www.androidpolice.com/2019/12/30/the-best-free-and-open-source-alternatives-to-google-calendar-on-android/ +[4]: https://opensource.com/alternatives/slack +[5]: http://www.mediawiki.org/ +[6]: http://www.twiki.org/ From b44c6d4d305caf20295ee449f807dba2d686adec Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Apr 2020 01:15:32 +0800 Subject: [PATCH 0324/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200416=20How?= =?UTF-8?q?=20to=20package=20Python=20applications=20for=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200416 How to package Python applications for Linux.md --- ...o package Python applications for Linux.md | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 sources/tech/20200416 How to package Python applications for Linux.md diff --git a/sources/tech/20200416 How to package Python applications for Linux.md b/sources/tech/20200416 How to package Python applications for Linux.md new file mode 100644 index 0000000000..24e8343038 --- /dev/null +++ b/sources/tech/20200416 How to package Python applications for Linux.md @@ -0,0 +1,179 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to package Python applications for Linux) +[#]: via: (https://opensource.com/article/20/4/package-python-applications-linux) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +How to package Python applications for Linux +====== +Learn how to use dh_virtualenv to make your Python applications +installable as .deb packages. +![Python in a tree][1] + +One way to make Python applications installable on Debian-based operating systems (such as Debian or [Elementary OS][2]) is by using the [dh_virtualenv][3] tool. It builds a **.deb** package that wraps a Python virtual environment around an application and deploys it upon installing. + +In this article, I will explain how to use it with the example of building a package containing the [HTTPie][4] tool to test HTTP APIs from the command line without having to activate a virtual environment. + +### Packaging with dh_virtualenv + +First, you need to install the tools that dh_virtualenv needs. dh_virtualenv's [documentation][5] provides all of the installation options. On my Debian-based system, I entered: + + +``` +`apt-get install dh-virtualenv devscripts` +``` + +While the [devscripts][6] package is not required, it will simplify doing the subsequent operations. + +Now, create a directory to keep the sources. Since this is a local, unofficial, packaging of HTTPie, I called it **myhttp**. Next, let's create some files inside **myhttp** to provide metadata to the Debian build system. + +First, create the **debian/control** file: + + +``` +Source: myhttp +Section: python +Priority: extra +Maintainer: Jan Doe <[jandoe@example.org][7]> +Build-Depends: debhelper (>= 9), python3.7, dh-virtualenv (>= 0.8) +Standards-Version: 3.9.5 + +Package: myhttp +Architecture: any +Pre-Depends: dpkg (>= 1.16.1), python3.7, ${misc:Pre-Depends} +Depends: ${misc:Depends} +Description: http client + Useful for doing stuff +``` + +So what is all this information about? As the [Debian documentation][8] puts it: + +> "Lines 1–7 are the control information for the source package. Lines 9–13 are the control information for the binary package." + +Here's my take: + + * the **section** value is mostly meaningless for our case, but needs to be there. It's meaningful to provide information to the guided UI installer, which is not relevant for this package. + * The extra **Priority** value is the right priority for 3rd party packages like this one. + * It is highly recommended to put real contact details in the **Maintainer** field. It does not have to be your personal e-mail, though -- "Infrastructure Team <[infra-team-list@company.example.com][9]>", for example, if the package is maintained by the team and you would like issues to be sent to the team's mail alias. + * The **build-depends** field indicates that you need debhelper, python, and dh-virtualenv to build the package: the package build process will make sure those dependencies are installed at package build time. + * The **standards version** is mostly for human consumption. It indicates which guide you are following. This guide is based on the official documentation of dh-virtualenv, which is based on the 3.9.5 guide from Debian. It is almost always the best choice to name the binary package and the source package the same. + * The **Architecture** field should be **Any** because a virtual environment might include some architecture-specific files: otherwise, the field would be better chosen as **all**. + * Keep the **pre-depends** list as-is: pre-depends is a pretty strict form of dependencies, and it is rare that you need anything more than the minimum suggested here. The dependencies are usually calculated accurately by the build system, so there is no reason to specify them manually. + * If your package is mostly for internal use, then the **Description** might only specify minimal information and a link to the company wiki; otherwise, more details might be useful. + + + +Then create the **debian/compat** file, which [exists mostly for historical purposes][10]: + + +``` +`$ echo "9" > debian/compat` +``` + +Next, create the changelog to tell package users what has changed since the last release. The easiest way is to use **dch --create** to create a template and then fill in the values. + +Filled in, it looks like: + + +``` +myhttp (2.0.0-1) stable; urgency=medium + +  * Initial release. + + -- Jan Doe <[jandoe@example.org][7]>  Fri, 27 Mar 2020 01:09:22 +0000 +``` + +Now you need to tell the tool to install HTTPie, but which version? + +Create a **requirements.in** file that has loose versions: + + +``` +`httpie` +``` + +In general, the loose requirements file will only contain direct dependencies of your project and will specify minimum versions if needed. It is not always necessary to specify the minimum versions: the tools are usually biased towards tightening the dependencies towards "latest version possible". In the case where your Debian package corresponds to one internal Python package, a common case in internal applications, the loose requirements file will look similar: just one line with the name of the package. + +Then use **pip-compile** (which is available by installing the PyPI package **pip-tools**): + + +``` +`$ pip-compile requirements.in > requirements.txt` +``` + +This will produce a strict dependency file called **requirements.txt**: + + +``` +# +# This file is autogenerated by pip-compile +# To update, run: +# +#    pip-compile requirements.in +# +certifi==2019.11.28       # via requests +chardet==3.0.4            # via requests +httpie==2.0.0             # via -r requirements.in +idna==2.9                 # via requests +pygments==2.6.1           # via httpie +requests==2.23.0          # via httpie +urllib3==1.25.8           # via requests +``` + +Finally, write a **debian/rules** file for creating the package. Since dh_virtualenv does all the hard work, the rules file is simple: + + +``` +#!/usr/bin/make -f + +%: +        dh $@ --with python-virtualenv --python /usr/bin/python3.7 +``` + +Be sure to specify the Python interpreter. By default, it will use the interpreter in **/usr/bin/python**, which is Python 2, but you should use a [supported version of Python][11]. + +The writing is finished; all that's left is to build the package: + + +``` +`$ debuild -b -us -uc` +``` + +This will produce a file in the parent directory with a name like **myhttp_2.0.0-1_amd64.deb**. This file can be installed on any compatible operating system. + +In general, it's best to build Debian packages that are intended for a specific platform, such as Debian 10.0, on the same platform. + +You can store this Debian package in a repository and install it on all relevant systems with, for example, [Ansible][12]. + +### Conclusion + +Packaging applications for Debian-based operating systems is a multi-step process. Using dh_virtualenv will make the process straightforward. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/package-python-applications-linux + +作者:[Moshe Zadka][a] +选题:[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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-python.jpg?itok=F2PYP2wT (Python in a tree) +[2]: https://opensource.com/article/19/12/pantheon-linux-desktop +[3]: https://dh-virtualenv.readthedocs.io/en/latest/ +[4]: https://opensource.com/article/19/8/getting-started-httpie +[5]: https://dh-virtualenv.readthedocs.io/en/1.1/tutorial.html +[6]: http://man.he.net/man1/devscripts +[7]: mailto:jandoe@example.org +[8]: https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#control +[9]: mailto:infra-team-list@company.example.com +[10]: https://www.debian.org/doc/manuals/maint-guide/dother.en.html#compat +[11]: https://opensource.com/article/19/11/end-of-life-python-2 +[12]: https://opensource.com/resources/what-ansible From eb70a1c2af4f89bf8b518ea7511d6162409d4562 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Apr 2020 01:18:33 +0800 Subject: [PATCH 0325/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200416=20Cont?= =?UTF-8?q?act=20tracing=20via=20Bluetooth=20could=20help=20track=20COVID-?= =?UTF-8?q?19=20transmission?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200416 Contact tracing via Bluetooth could help track COVID-19 transmission.md --- ... could help track COVID-19 transmission.md | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 sources/talk/20200416 Contact tracing via Bluetooth could help track COVID-19 transmission.md diff --git a/sources/talk/20200416 Contact tracing via Bluetooth could help track COVID-19 transmission.md b/sources/talk/20200416 Contact tracing via Bluetooth could help track COVID-19 transmission.md new file mode 100644 index 0000000000..86fa318f1c --- /dev/null +++ b/sources/talk/20200416 Contact tracing via Bluetooth could help track COVID-19 transmission.md @@ -0,0 +1,55 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Contact tracing via Bluetooth could help track COVID-19 transmission) +[#]: via: (https://www.networkworld.com/article/3538333/contact-tracing-via-bluetooth-could-help-track-covid-19-transmission.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Contact tracing via Bluetooth could help track COVID-19 transmission +====== + +Thinkstock + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] + +A team of researchers from MIT has developed a novel method of tracking COVID-19 transmission among the population, using Bluetooth “chirps” that could automatically trace COVID-positive contacts and warn those who have potentially become infected, without violating their privacy. + +The system is called PACT, or Private Automated Contact Tracing. It works by sending random strings of numbers via low-power Bluetooth from a user’s smartphone to other nearby devices using the system, creating a coded list of smartphones that a given user has been close to in the past 14 days. + +If the user subsequently tests positive for COVID, he or she can upload that list of “chirps” to the database, so that other users can run a check to determine whether they might have exposed. + +MIT said that the system uses advanced privacy protection methods to ensure the privacy of both COVID sufferers and those checking to see whether they’ve been exposed. People would need to opt in, and researchers specifically highlighted that PACT does not use any GPS, wireless location or phone ID information. + +“For these broadcasts, we’re using cryptographic techniques to generate random, rotating numbers that are not just anonymous, but pseudonymous, constantly changing their ‘ID,’ and that can’t be traced back to an individual,” said MIT institute professor Ron Rivest, who led the project. (Rivest knows a  thing or two about cryptography: he’s the R in RSA, the first publicly available public-key cryptosystem.) + +The idea behind PACT is to make sure that the system isn’t tracking any individuals specifically. Rather, it’s meant to be a yes/no resource for those wondering whether they may have been in proximity to someone with COVID. It’s currently at the proof-of-concept stage – the team recently overcame the hurdle of getting Androids and iPhones to speak to each other – and overtures have been made to smartphone makers, Apple, Google and Microsoft to try and get the system into the public’s hands as quickly as possible. + +“The aim of the prototype is to prove to these developers that this is feasible for them to implement,” said Rivest. + +**[ [Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][2] ]** + +The team hopes that if PACT comes into widespread use it would enable a much more selective approach to quarantine and give communities the ability to return to normalcy more quickly. Tracking the spread of a disease like COVID with more speed and precision could let public health authorities suggest testing to specific groups of people if they notice a pattern emerging. + +MIT also said that the team has demonstrated PACT to various government agencies, and coordinating similar efforts elsewhere in the U.S., as well as in Europe. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3538333/contact-tracing-via-bluetooth-could-help-track-covid-19-transmission.html + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From f40ab383de3a0a6bda60e6c8275bb098eaeb14d5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Apr 2020 01:19:53 +0800 Subject: [PATCH 0326/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200416=20Harv?= =?UTF-8?q?esting=20ambient=20energy=20will=20power=20IoT,=20scientists=20?= =?UTF-8?q?say?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200416 Harvesting ambient energy will power IoT, scientists say.md --- ...t energy will power IoT, scientists say.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/talk/20200416 Harvesting ambient energy will power IoT, scientists say.md diff --git a/sources/talk/20200416 Harvesting ambient energy will power IoT, scientists say.md b/sources/talk/20200416 Harvesting ambient energy will power IoT, scientists say.md new file mode 100644 index 0000000000..8831fcbfbe --- /dev/null +++ b/sources/talk/20200416 Harvesting ambient energy will power IoT, scientists say.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Harvesting ambient energy will power IoT, scientists say) +[#]: via: (https://www.networkworld.com/article/3536697/harvesting-ambient-energy-will-power-iot-scientists-say.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Harvesting ambient energy will power IoT, scientists say +====== +Magnetic fields found naturally around electrical devices could be diverted and converted into electricity to power the IoT. +Thinkstock + +Stray, ambient magnetic fields that are naturally created from electricity usage should be captured, diverted, and converted into power for Internet of Things sensors, researchers say. + +"Just like sunlight is a free source of energy we try to harvest, so are magnetic fields," said Shashank Priya, professor of materials science and engineering and associate vice president for research at Penn State, in a statement published [on the university's web site][1]. "We have this ubiquitous energy present in our homes, office spaces, work spaces and cars. It's everywhere, and we have an opportunity to harvest this background noise and convert it to useable electricity." + +Electricity produces tiny magnetic fields around common power cables, computers and lighting found in factories, homes and offices. That energy, if harnessed, could power sensors and small data-sending radios, the academics think. Penn State is attempting to design ambient power receptors for IoT. + +### Materials science + +The group at Penn State has been having some success getting it to work. Experimental devices that are thin and about 1.5 inches long are being tested. Placing the capture-device around or on common appliances does produce electricity, the researchers claim. The key is to put the device where the magnetic field is the strongest. In one experiment, the researchers were able to generate enough power to run 180 LED lighting arrays with a device placed about 4 inches from a space heater. At 8 inches, the device produced enough electricity to operate a clock. + +"These results provide significant advancements toward sustainable power for integrated sensors and wireless communication systems," said Min Gyu Kang, an assistant research professor at Penn State and joint lead author of the study. + +Electricity and magnetism have always gone hand in hand. Magnetism is created by a moving electric charge. It's that movement which creates the magnetic field. That's why low-level magnetism is manifested in electrical wires generally, for example—the electricity is moving along the cable. + +In this case, the scientists are converting the magnetic field, which is caused by the moving electricity, into a separate electrical current. They're doing it with materials science by combining two materials. One of the materials is a magnetostrictor – it converts the magnetic field into stress-generating vibrations. The another material is piezoelectric, which grabs the vibrations and translates that energy into electricity. + +[][2] + +### How to power sensors + +Producing usable power from stray magnetic fields is just one stab at powering the IoT. Just how one goes about producing power for the millions, and possibly billions, of environmental, factory process and other sensors that are expected to come on stream as IoT takes off is up for grabs. + +Batteries have limitations—they need to be changed or charged, for example. Ambient humidity is one possibility I [wrote about recently][3]. In that case, bio-electronics have been proven to capture half-a-volt from ambient air, scientists claim. That's enough to operate rudimentary sensors. Waste heat, too, is another possible source: Researchers are [exploring ways to convert excess heat][4], such as is found in data centers, into light, and then turn that light into electricity. + +Other angles include simply reducing energy consumption through more efficient chips or streamlined wireless communications hardware. Other parasitic techniques are being tried. They include [turning existing wireless noise into a data carrier][5]. It's efficient because one doesn't have to make so much power for radio transceivers—the carrier already exists. + +In the case of the Penn State work, less obvious benefits might exist, too. + +"In buildings, it's known that if you automate a lot of functions, you could actually improve the energy efficiency very significantly," Priya said. “Buildings are one of the largest consumers of electricity in the United States. So even a few percent drop in energy consumption could represent or translate into megawatts of savings. Sensors are what will make it possible to automate these controls, and this technology is a realistic way to power those sensors." + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3536697/harvesting-ambient-energy-will-power-iot-scientists-say.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://news.psu.edu/story/613154/2020/03/31/research/scientists-tap-unused-energy-source-power-smart-sensor-networks +[2]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[3]: https://www.networkworld.com/article/3529893/seawater-humidity-inspire-new-ways-to-generate-power.html +[4]: https://www.networkworld.com/article/3410578/data-centers-may-soon-recycle-heat-into-electricity.html +[5]: https://www.networkworld.com/article/3449819/wireless-noise-protocol-can-extend-iot-range.html +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From ff7fd94747bd53bfd63516238e1cee9459a43135 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 17 Apr 2020 07:54:19 +0800 Subject: [PATCH 0327/1809] Rename translated/sources/tech/20190814 9 open source cloud native projects to consider.md to translated/tech/20190814 9 open source cloud native projects to consider.md --- .../20190814 9 open source cloud native projects to consider.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/{sources => }/tech/20190814 9 open source cloud native projects to consider.md (100%) diff --git a/translated/sources/tech/20190814 9 open source cloud native projects to consider.md b/translated/tech/20190814 9 open source cloud native projects to consider.md similarity index 100% rename from translated/sources/tech/20190814 9 open source cloud native projects to consider.md rename to translated/tech/20190814 9 open source cloud native projects to consider.md From 9f3173643a309265d6cc87671e885d173e939395 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 17 Apr 2020 08:56:32 +0800 Subject: [PATCH 0328/1809] translated --- ...rator in Nautilus File Manager in Linux.md | 89 ------------------- ...rator in Nautilus File Manager in Linux.md | 84 +++++++++++++++++ 2 files changed, 84 insertions(+), 89 deletions(-) delete mode 100644 sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md create mode 100644 translated/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md diff --git a/sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md b/sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md deleted file mode 100644 index 5dc6cd023a..0000000000 --- a/sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Open Files and Folders as Administrator in Nautilus File Manager in Linux) -[#]: via: (https://itsfoss.com/open-nautilus-as-administrator/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Open Files and Folders as Administrator in Nautilus File Manager in Linux -====== - -_**Learn to add an “Open as Administrator” option in the right click context menu in Nautilus file manager in Ubuntu and other Linux distributions.**_ - -If you want to open or edit a file as root, you can always do that in the terminal. I know a few people don’t feel too comfortable with the command line. - -The desktop Linux often provides ways to avoid the command line for terminal-fearing people. - -If you are in a situation where you have to access a folder as root or edit a file with root privilege, you can do that graphically in [Nautilus file manager][1]. - -A neat Nautilus hack allows you to open a files and folders as administrator i.e. root. Let me show you how. - -**Recommended Read:** - -![][2] - -#### [Root User in Ubuntu: Important Things You Should Know][3] - -Root user is essential to any Linux distribution. Learn why Ubuntu locks the root user and how can you use it in this Ubuntu beginner series. - -### Add ‘open as administrator’ option in right click context menu in Nautilus file manager - -_**A word of warning! Please don’t go around opening and editing random files as root as you might mess up with wrong files and end up with a broken system. Use it only in the cases where it is required.**_ - -I am showing the installation steps for Ubuntu. You can change it as per your distribution’s package manager. - -You’ll have to use terminal (even if you don’t like it) for installing the Nautilus plugin. Please [make sure that you have the universe repository enabled][4]: - -``` -sudo apt install nautilus-admin -``` - -Close and open Nautilus file manager again to see the changes in effect. - -![Right clock to see the “Open as Administrator” option][5] - -You can also edit files as root the same way. Just select the file, right click on it and choose the “Edit as Administrator” option. - -![Edit Files As Root Ubuntu][6] - -In both cases, you’ll be prompted to enter your account’s password: - -![You need to enter your password, of course][7] - -That’s pretty much it. You can enjoy the comfort of GUI. - -In case you don’t want to run Nautilus as root anymore, you can remove this plugin. It’s always good to remove additional things you installed but you don’t use anymore. - -In the terminal (yes, again), use the following command to remove the Nautilus plugin. - -``` -sudo apt remove nautilus-admin -``` - -By the way, if you are using [Ubuntu MATE][8], you can use caja-admin, instead of nautilus-admin. Other file managers may or may not provide such a feature. - -I hope you find this quick tip helpful. Questions and suggestions are always welcome. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/open-nautilus-as-administrator/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://wiki.gnome.org/Apps/Files -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/root_user_ubuntu.png?fit=800%2C450&ssl=1 -[3]: https://itsfoss.com/root-user-ubuntu/ -[4]: https://itsfoss.com/ubuntu-repositories/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/open-folder-as-administrator-ubuntu.jpg?ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/edit-files-as-root-ubuntu.jpg?ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/authentication-pop-up-ubuntu.png?ssl=1 -[8]: https://ubuntu-mate.org/ diff --git a/translated/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md b/translated/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md new file mode 100644 index 0000000000..3355744d64 --- /dev/null +++ b/translated/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Open Files and Folders as Administrator in Nautilus File Manager in Linux) +[#]: via: (https://itsfoss.com/open-nautilus-as-administrator/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Linux 的 Nautilus 文件管理器中以管理员身份打开文件和文件夹 +====== + +_**了解如何在 Ubuntu 和其他 Linux 发行版的 Nautilus 文件管理器的右键菜单中添加“以管理员身份打开”选项。**_ + +如果要以根用户身份打开或编辑文件,你总是可以在终端中执行此操作。但我知道有些人对命令行不适应。 + +桌面 Linux 通常为那些害怕终端的人提供方法避免命令行。 + +如果你必须以 root 用户身份访问文件夹或以 root 用户权限编辑文件,那你可以在 [Nautilus 文件管理器][1]中以图形方式进行操作。 + +一个干净的 Nautilus hack 方式能让你以管理员也就是 root 打开文件和文件夹。让我向你展示如何做。 + +#### [Ubuntu 的 root 用户:你应该知道的重要事项][3] + +根用户对于任何 Linux 发行版都是必不可少的。在本 Ubuntu 初学者系列文章中了解 Ubuntu 为何锁定 root 用户以及如何使用它。 + +### 在 Nautilus 文件管理器的右键菜单中添加“以管理员身份打开”选项 + +_**警告!请不要以 root 用户身份打开和编辑随机文件,因为这样可能会弄乱文件并导致系统损坏。仅在需要时使用它。**_ + +我展示的是 Ubuntu 的步骤。你可以根据你的发行版的软件包管理器进行更改。 + +你必须使用终端(即使你不喜欢它)来安装 Nautilus 插件。请[确保已启用 Universe 仓库][4]: + +``` +sudo apt install nautilus-admin +``` + +关闭并再次打开 Nautilus 文件管理器以查看更改生效。 + +![Right clock to see the “Open as Administrator” option][5] + +你也可以用 root 用户身份编辑文件。只需选择文件,右键单击它,然后选择“以管理员身份编辑”选项。 + +![Edit Files As Root Ubuntu][6] + +这两种情况下,系统都会提示你输入帐户密码: + +![You need to enter your password, of course][7] + +差不多了。你可以享受 GUI 的舒适了。 + +如果你不想再以 root 用户身份运行 Nautilus,那么可以删除此插件。删除已安装但不再使用的其他东西总是没错的。 + +在终端中(没错,再一次在终端),使用以下命令删除 Nautilus 插件。 + +``` +sudo apt remove nautilus-admin +``` + +顺便说一句,如果你在使用 [Ubuntu MATE][8],你可以使用 caja-admin 代替 nautilus-admin。其他文件管理器可能会或可能不会提供此类功能。 + +我希望这个快速技巧对你有所帮助。随时欢迎提出问题和建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/open-nautilus-as-administrator/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://wiki.gnome.org/Apps/Files +[3]: https://itsfoss.com/root-user-ubuntu/ +[4]: https://itsfoss.com/ubuntu-repositories/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/open-folder-as-administrator-ubuntu.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/edit-files-as-root-ubuntu.jpg?ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/authentication-pop-up-ubuntu.png?ssl=1 +[8]: https://ubuntu-mate.org/ From f3e7d30a6cf1948091891b23b9ca7a250a99cddf Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 17 Apr 2020 09:17:47 +0800 Subject: [PATCH 0329/1809] translated --- sources/tech/20200413 How to install Python on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200413 How to install Python on Linux.md b/sources/tech/20200413 How to install Python on Linux.md index cc46e86ef4..07d4aa4087 100644 --- a/sources/tech/20200413 How to install Python on Linux.md +++ b/sources/tech/20200413 How to install Python on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7842d84ec90f7f9b24a23f52187d5296795d1f83 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 17 Apr 2020 09:21:21 +0800 Subject: [PATCH 0330/1809] Rename sources/tech/20200416 State of software engineering, JavaScript is the future, and more industry trends.md to sources/news/20200416 State of software engineering, JavaScript is the future, and more industry trends.md --- ...neering, JavaScript is the future, and more industry trends.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200416 State of software engineering, JavaScript is the future, and more industry trends.md (100%) diff --git a/sources/tech/20200416 State of software engineering, JavaScript is the future, and more industry trends.md b/sources/news/20200416 State of software engineering, JavaScript is the future, and more industry trends.md similarity index 100% rename from sources/tech/20200416 State of software engineering, JavaScript is the future, and more industry trends.md rename to sources/news/20200416 State of software engineering, JavaScript is the future, and more industry trends.md From ab22dd0feb65623d9811e9698bfa21abc0a6bde8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 17 Apr 2020 09:27:20 +0800 Subject: [PATCH 0331/1809] Rename sources/tech/20200416 How I-ve adjusted my work-from-home habits.md to sources/talk/20200416 How I-ve adjusted my work-from-home habits.md --- .../20200416 How I-ve adjusted my work-from-home habits.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200416 How I-ve adjusted my work-from-home habits.md (100%) diff --git a/sources/tech/20200416 How I-ve adjusted my work-from-home habits.md b/sources/talk/20200416 How I-ve adjusted my work-from-home habits.md similarity index 100% rename from sources/tech/20200416 How I-ve adjusted my work-from-home habits.md rename to sources/talk/20200416 How I-ve adjusted my work-from-home habits.md From d896ad68a865f9651db46f24b5b3bc4775c3c871 Mon Sep 17 00:00:00 2001 From: cycoe Date: Fri, 17 Apr 2020 10:15:12 +0800 Subject: [PATCH 0332/1809] Delete the original article in source --- ...u need to know about variables in Emacs.md | 243 ------------------ 1 file changed, 243 deletions(-) delete mode 100644 sources/tech/20200311 What you need to know about variables in Emacs.md diff --git a/sources/tech/20200311 What you need to know about variables in Emacs.md b/sources/tech/20200311 What you need to know about variables in Emacs.md deleted file mode 100644 index fdbeffe90d..0000000000 --- a/sources/tech/20200311 What you need to know about variables in Emacs.md +++ /dev/null @@ -1,243 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (cycoe) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What you need to know about variables in Emacs) -[#]: via: (https://opensource.com/article/20/3/variables-emacs) -[#]: author: (Clemens Radermacher https://opensource.com/users/clemera) - -What you need to know about variables in Emacs -====== -Learn how Elisp deals with variables and to use them in your scripts and -configurations. -![Programming keyboard.][1] - -GNU Emacs is written in C and Emacs Lisp (Elisp), a dialect of the Lisp programming language. Because it's a text editor that happens to be an Elisp sandbox, it is helpful to understand how basic programming concepts work in Elisp. - -If you're new to [Emacs][2], visit Sacha Chua's excellent list of [resources for Emacs beginners][3]. This article assumes you're familiar with common Emacs terminology and that you know how to read and evaluate basic snippets of Elisp code. Ideally, you should also have heard of variable scope and how it works in another programming language. The examples also assume you use a fairly recent Emacs version ([v.25 or later][4]). - -The [Elisp manual][5] includes everything there is to know, but it is written for people who already know what they are looking for (and it is really great for that). But many people want resources that explain Elisp concepts at a higher level and reduce the amount of information to the most useful bits. This article is my attempt to respond to that—to give readers a good grasp of the basics so they can use them for their configuration and make it easier for people to look up some detail in the manual. - -### Global variables - -User options defined with **defcustom** and variables defined with **defvar** or **defconst** are global. One important aspect of variables declared by **defcustom** or **defvar** is that reevaluating them won't reset a variable if it is already bound. For example, if you establish a binding for **my-var** in your init file like this: - - -``` -`(setq my-var nil)` -``` - -evaluating the following form won't reset the variable to **t**: - - -``` -`(defvar my-var t)` -``` - -Note that there is _one exception_: If you evaluate the declaration above with **C-M-x** that calls **eval-defun**, the value will be reset to **t**. This way, you can enforce setting the value if you need to. This behavior is intentional: As you might know, many features in Emacs load only on demand (i.e., they are autoloaded). If the declarations in those files reset variables to their default value, this would override any settings in your init. - -### User options - -A user option is simply a global variable that is declared with **defcustom**. Unlike variables declared with **defvar**, such a variable is configurable with the  **M-x customize** interface. As far as I know, most people don't use it much because it feels clunky. Once you know how to set variables in your init file, there's no compelling reason to use it. One detail many users aren't aware of is that setting user options with **customize** might execute code, and this is sometimes used to run additional setup instructions: - - -``` -(defcustom my-option t -  "My user option." -  :set (lambda (sym val) -         (set-default sym val) -         (message "Set %s to %s" sym val))) -``` - -If you evaluate this code and change the value using the **customize** interface with **M-x customize-option RET my-option RET **the lambda will be called, and the message in the echo area will tell you the symbol and value of the option. - -If you use **setq** in your init file, to change the value of such an option, the setter function will _not_ run. To set such an option correctly with Elisp, you need to use the function **customize-set-variable**. Alternatively, people use various versions of **csetq** macros in their configs to automatically take care of this (you can use GitHub code search to discover more sophisticated variants if you like): - - -``` -(defmacro csetq (sym val) -  `(funcall (or (get ',sym 'custom-set) 'set-default) ',sym ,val)) -``` - -If you are using the [use-package][6] macro, the **:custom** keyword will handle this for you. - -After putting the code above into your init file, you can use **csetq** to set variables in a way that respects any existing setter functions. You can prove this by watching the message in the echo area when using this macro to change the option defined above: - - -``` -`(csetq my-option nil)` -``` - -### Dynamic binding and lexical binding - -If you use other programming languages, you may not be aware of the differences between dynamic and lexical binding. Most programming languages today use lexical binding, and there is no need to know the difference when you learn about variable scope/lookup. - -Emacs Lisp is special in this regard because dynamic binding is the default, and lexical binding must be enabled explicitly. There are historical reasons for this, and in practice, you should _always_ enable lexical binding because it is faster and less error-prone. To enable it, simply put the following comment line as the first line in your Emacs Lisp file: - - -``` -`;;; -*- lexical-binding: t; -*-` -``` - -Alternatively, you can call M-x **add-file-local-variable-prop-line**, which will insert the comment line above when you choose the variable **lexical-binding** with value **t**. - -When a file with such a specially formatted line is loaded, Emacs sets the variable accordingly, which means the code in that buffer is loaded with lexical binding enabled. Interactively, you can use **M-x eval-buffer**, which takes the lexical binding setting into account. - -Now that you know how to enable lexical binding, it's smart to learn what the terms mean. With dynamic binding, the last binding established during program execution is used for variable lookup. You can test this by putting the following code in an empty buffer and executing **M-x eval-buffer**: - - -``` -(defun a-exists-only-in-my-body (a) -  (other-function)) - -(defun other-function () -  (message "I see `a', its value is %s" a)) - -(a-exists-only-in-my-body t) -``` - -You may be surprised to see that the lookup of variable **a** in the **other-function** is successful. - -If you retry the preceding example with the special lexical-binding comment at the top, the code will throw a "variable is void" error because **other-function** does not know about the **a** variable. If you're coming from another programming language, this is the behavior you would expect. - -With lexical binding, the scope is defined by the surrounding source code. This is not only for performance reasons—experience and time have shown that this behavior is preferred. - -### Special variables and dynamic binding - -As you may know, **let** is used to temporary establish local bindings: - - -``` -(let ((a "I'm a") -      (b "I'm b")) -  (message "Hello, %s. Hello %s" a b)) -``` - -Here is the thing: Variables declared with **defcustom**, **defvar**, or **defconst** are called _special variables_, and they continue to use dynamic binding regardless of whether lexical binding is enabled: - - -``` -;;; -*- lexical-binding: t; -*- - -(defun some-other-function () -  (message "I see `c', its value is: %s" c)) - -(defvar c t) - -(let ((a "I'm lexically bound") -      (c "I'm special and therefore dynamically bound")) -  (some-other-function) -  (message "I see `a', its values is: %s" a)) -``` - -To see both messages in the example above, switch to the ***Messages*** buffer using **C-h e**. - -Local variables bound with **let** or function arguments follow the lookup rules defined by the **lexical-binding** variable, but global variables defined with **defvar**, **defconst**, or **defcustom** can be changed deep down in the call stack for the duration of the **let** body. - -This behavior allows for convenient ad-hoc customizations and is often used in Emacs, which isn't surprising given that Emacs Lisp started out with dynamic binding being the only option. Here is a common example showing how you can temporarily write to a read-only buffer: - - -``` -(let ((inhibit-read-only t)) -  (insert ...)) -``` - -Here is another often-seen example for performing case-sensitive searches: - - -``` -(let ((case-fold-search nil)) -  (some-function-which-uses-search ...)) -``` - -Dynamic binding allows you to change the behavior of functions in ways the authors of those functions may have never anticipated. It's a powerful tool and a great feature for a program that is designed and used like Emacs. - -There is one caveat to be aware of: You might accidentally use a local variable name that is declared as a special variable elsewhere. One trick to prevent such conflicts is to avoid dashes in local variables' names. In my current Emacs session, this leaves only a handful of potential conflicting candidates: - - -``` -(let ((vars ())) -  (mapatoms -   (lambda (cand) -     (when (and (boundp cand) -                (not (keywordp cand)) -                (special-variable-p cand) -                (not (string-match "-" -                                   (symbol-name cand)))) -       (push cand vars)))) -  vars) ;; => (t obarray noninteractive debugger nil) -``` - -### Buffer-local variables - -Each buffer can have a local binding for a variable. This means any variable lookup made while this buffer is current will reveal the buffer's local value of that variable instead of the default value. Local variables are an important feature in Emacs; for example, they are used by major modes to establish their buffer-local behavior and settings. - -You have already seen a buffer-local variable in this article: the special comment line for **lexical-binding** that binds the buffer locally to **t**. In Emacs, such buffer-local variables defined in special comment lines are also called _file-local variables_. - -Any global variable can be shadowed by a buffer-local variable. Take, for example, the **my-var** variable defined above, which you can set locally like this: - - -``` -(setq-local my-var t) -;; or (set (make-local-variable 'my-var) t) -``` - -**my-var** is local to the buffer, which is current when you evaluate the code above. If you call **describe-variable** on it, the documentation tells you both the local value and the global one. Programmatically, you can check the local value using **buffer-local-value** and the default value with **default-value**. To remove the local version, you could invoke  **M-x kill-local-variable**. - -Another important property to be aware of is that once a variable is buffer-local, any further use of **setq** (while this buffer is current) will continue to set the local value. To set the default value, you would need to use **setq-default**. - -Because local variables are meant for buffer customization, they're used most often in mode hooks. A typical example would be something like this: - - -``` -(add-hook 'go-mode-hook -          (defun go-setup+ () -            (setq-local compile-command -              (if (string-suffix-p "_test.go" buffer-file-name) -                  "go test -v" -                (format "go run %s" -                        (shell-quote-argument -                         (file-name-nondirectory buffer-file-name))))))) -``` - -This sets the compile command used by **M-x compile** for go-mode buffers. - -Another important aspect is that some variables are _automatically_ buffer-local. This means as soon as you **setq** such a variable, it sets a local binding for the current buffer. This feature shouldn't be used often (because this implicit behavior isn't nice), but if you want, you can create such automatically local variables like this: - - -``` -(defvar-local my-automatical-local-var t) -;; or (make-variable-buffer-local 'my-automatical-local-var) -``` - -The variable **indent-tabs-mode** is a built-in example of this. If you use **setq** in your init file to change the value of this variable, it won't affect the default value at all. Only the value for the buffer that is current while loading your init file will be changed. Therefore, you need to use **setq-default** to change the default value of **indent-tabs-mode**. - -### Closing words - -Emacs is a powerful editor, and it only gets more powerful the more you change it to suit your needs. Now you know how Elisp deals with variables and how you can use them in your own scripts and configurations. - -* * * - -_This previously appeared on [With-Emacs][7] under a CC BY-NC-SA 4.0 license and has been adapted (with a merge request) and republished with the author's permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/variables-emacs - -作者:[Clemens Radermacher][a] -选题:[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/clemera -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A (Programming keyboard.) -[2]: https://www.gnu.org/software/emacs/ -[3]: http://sachachua.com/blog/p/27144 -[4]: https://www.gnu.org/software/emacs/download.html -[5]: https://www.gnu.org/software/emacs/manual/html_node/elisp/ -[6]: https://github.com/jwiegley/use-package#customizing-variables -[7]: https://with-emacs.com/posts/tutorials/almost-all-you-need-to-know-about-variables/ From c65dac764f60bf8a71fe6544f0124b90e45cf80e Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Fri, 17 Apr 2020 15:08:36 +0800 Subject: [PATCH 0333/1809] Translating --- ...hi Linux 5.1 Review- Slightly Different Lightweight Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md b/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md index d4892ffbcc..6b8be0c8bd 100644 --- a/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md +++ b/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qfzy1233) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8eb1dd3a8279562d228f72a2e33ce747cc7cca03 Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Fri, 17 Apr 2020 17:06:56 +0800 Subject: [PATCH 0334/1809] Translating. --- sources/tech/20200414 How I containerize a build system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200414 How I containerize a build system.md b/sources/tech/20200414 How I containerize a build system.md index b45168c55f..1271aa27af 100644 --- a/sources/tech/20200414 How I containerize a build system.md +++ b/sources/tech/20200414 How I containerize a build system.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (LazyWolfLin) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c998684dee0ea788c0ec42152352c169516c4762 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 17 Apr 2020 21:02:42 +0800 Subject: [PATCH 0335/1809] PRF @lxbwolf --- ...vate social network with a Raspberry Pi.md | 157 +++++++----------- 1 file changed, 63 insertions(+), 94 deletions(-) diff --git a/translated/tech/20200320 Build a private social network with a Raspberry Pi.md b/translated/tech/20200320 Build a private social network with a Raspberry Pi.md index 5325d7e67f..9d7e8e7fea 100644 --- a/translated/tech/20200320 Build a private social network with a Raspberry Pi.md +++ b/translated/tech/20200320 Build a private social network with a Raspberry Pi.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Build a private social network with a Raspberry Pi) @@ -9,23 +9,23 @@ 用树莓派搭建一个私人社交网络 ====== -手把手教你怎样以低硬件成本和简易步骤搭建自己的社交网络。 + +> 手把手教你怎样以低成本的硬件和简易步骤搭建自己的社交网络。 + ![Team of people around the world][1] -近年来,社交网络已经革新了人们的生活习惯。为了维持与朋友和家人的联系,人们每天都会使用社交频道。但是涉及到隐私和数据安全时,仍有一些普遍问题。尽管社交网络创建了复杂的隐私策略来保护用户的信息,但如果你不想自己的信息被泄露,最好的办法还是把数据保存在自己的服务器上。 +近年来,社交网络已经革新了人们的生活习惯。人们每天都会使用社交频道与朋友和家人联系。但是涉及到隐私和数据安全时,仍有一些共同的问题。尽管社交网络创建了复杂的隐私策略来保护用户的信息,但如果你不想自己的信息被泄露,最好的办法还是把数据保存在自己的服务器上。 -一个树莓派 — 多才多艺的 Raspbian Lite 版本就可以让你搭建很多有用的家庭服务(参照我的文章[树莓派项目][2])。通过搜索开源软件你就可以实现一些令人痴迷的功能,你也可以用这个神奇的设备来感受那些功能。其中一个有趣的尝试就是在你的树莓派上安装 OSSN(译注:OpenSource Social Network)。 +一个树莓派 — 多才多艺的 Raspbian Lite 版本就可以让你搭建很多有用的家庭服务(参照我的文章[树莓派项目][2])。通过搜索开源软件你就可以实现一些令人痴迷的功能,你也可以用这个神奇的设备来感受那些功能。其中一个有趣的尝试就是在你的树莓派上安装 OSSN。 -### OSSN是什么? +### OSSN 是什么? -[OSSN][3] 是用 PHP 写的一个快速开发社交网络软件,让你可以搭建自己的社交网站。OSSN 可以用来搭建不同类型的社交应用,如: +[开源社交网络][3]OpenSource Social Network(OSSN)是用 PHP 写的一个快速开发社交网络软件,让你可以搭建自己的社交网站。OSSN 可以用来搭建不同类型的社交应用,如: * 私人内部网 * 公用/公开网络 * 社区 - - OSSN 支持的功能: * 照片 @@ -35,13 +35,11 @@ OSSN 支持的功能: * 搜索 * 聊天 - - OSSN 运行在 LAMP 服务器上。硬件需求很简单,却能提供强大的用户界面,也友好支持移动端。 ### 我们需要准备什么 -这个项目很简单,而且由于我们只安装远程 web 服务,因此我们只需要一些便宜的零件就够了。我使用的是树莓派 3B+,但是用树莓派 3A+ 或其他更新的板应该也可以。 +这个项目很简单,而且由于我们只安装远程 Web 服务,因此我们只需要一些便宜的零件就够了。我使用的是树莓派 3B+,但是用树莓派 3A+ 或其他更新的板应该也可以。 硬件: @@ -49,76 +47,66 @@ OSSN 运行在 LAMP 服务器上。硬件需求很简单,却能提供强大的 * 一张 SD 卡(最好是性能好点的卡,至少 16 GB) * 一台有 SFTP 软件(如免费的 [Filezilla][4])的桌面 PC,用来把安装包传到你的树莓派上 - - ### 操作步骤 我们首先搭建一个传统的 LAMP 服务器,然后配置数据库用户和安装 OSSN。 -#### 1\. 安装 Raspbian Buster Lite 操作系统 +#### 1、安装 Raspbian Buster Lite 操作系统 你可以直接参照我的文章[在你的树莓派上安装 Raspbian Buster Lite][5]。 为了确保你的系统是最新的,ssh 登录到树莓派后在终端输入下面的命令: - ```bash sudo apt-get update sudo apt-get upgrade ``` -#### 2\. 安装 LAMP 服务 +#### 2、安装 LAMP 服务 LAMP(Linux–Apache–Mysql–Php)服务通常与 MySQL 数据库配合。在我们的项目中,我们选择 MariaDB,因为它更轻量,完美支持树莓派。 -#### 3\. 安装 Apache 服务: - +安装 Apache 服务: ``` -`sudo apt-get install apache2 -y` +sudo apt-get install apache2 -y ``` 你可以通过在浏览器输入 `http://<>` 来检查 Apache 是否安装正确: ![][6] -#### 4\. 安装 PHP: - +安装 PHP: ``` -`sudo apt-get install php -y` +sudo apt-get install php -y ``` -#### 5\. 安装 MariaDB 服务和 PHP connector: - +安装 MariaDB 服务和 PHP connector: ``` -`sudo apt-get install mariadb-server php-mysql -y` +sudo apt-get install mariadb-server php-mysql -y ``` -#### 6\. 安装 phpMyAdmin: +安装 phpMyAdmin: 在 OSSN 中 phpMyAdmin 不是强制安装的,但我建议你安装,因为它可以简化数据库的管理。 - ``` -`sudo apt-get install phpmyadmin` +sudo apt-get install phpmyadmin ``` 在 phpMyAdmin 配置界面,执行以下步骤: - * 按下空格和 OK 选择 apache(强制)。 - * 在 dbconfig-common 选择是,配置 phpMyAdmin 的数据库。 - * 输入想设置的密码,按下 OK。 - * 再次输入 phpMyAdmin 密码来确认,按下 OK。 + * 按下空格和 “OK” 选择 apache(强制)。 + * 在 dbconfig-common 选择“Yes”,配置 phpMyAdmin 的数据库。 + * 输入想设置的密码,按下 “OK”。 + * 再次输入 phpMyAdmin 密码来确认,按下 “OK”。 - - -#### 7\. 为 phpMyAdmin 用户添加数据库权限来管理数据库: +为 phpMyAdmin 用户添加数据库权限来管理数据库: 我们用 root 用户连接 MariaDB(默认没有密码)来设置权限。 - ``` sudo mysql -uroot -p grant all privileges on *.* to 'phpmyadmin'@'localhost'; @@ -126,11 +114,10 @@ flush privileges; quit ``` -#### 8\. 最后,重启 Apache 服务: - +最后,重启 Apache 服务: ``` -`sudo systemctl restart apache2.service` +sudo systemctl restart apache2.service ``` 在浏览器输入 `http://<>/phpmyadmin/` 来检查 phpMyAdmin 是否正常: @@ -139,52 +126,44 @@ quit 默认的 phpMyAdmin 登录凭证: - * 用户名:phpmyadmin + * 用户名:`phpmyadmin` * 密码:在 phpMyAdmin 安装步骤中你设置的密码 - - -### 安装 OSSN 所需的其他包和配置 PHP +#### 3、安装 OSSN 所需的其他包和配置 PHP 在第一次配置 OSSN 前,我们还需要在系统上安装一些所需的包: - * PHP 版本 5.6,7.0 或 7.1 + * PHP 版本 5.6、7.0 或 7.1 * MYSQL 5 及以上 * APACHE * MOD_REWRITE * 需要打开 PHP 扩展 cURL 和 Mcrypt * PHP GD 扩展 * PHP ZIP 扩展 - * 打开 PHP 设置 allow_url_fopen + * 打开 PHP 设置 `allow_url_fopen` * PHP JSON 支持 * PHP XML 支持 * PHP OpenSSL - - 在终端输入以下命令来安装上述包: - ``` -`sudo apt-get install php7.3-curl php7.3-gd php7.3-zip php7.3-json php7.3-xml` +sudo apt-get install php7.3-curl php7.3-gd php7.3-zip php7.3-json php7.3-xml ``` -#### 1\. 打开 MOD_REWRITE: - +打开 mod_rewrite: ``` -`sudo a2enmod rewrite` +sudo a2enmod rewrite ``` -#### 2\. 修改默认的 Apache 配置,使用 mod_rewrite: - +修改默认的 Apache 配置,使用 mod_rewrite: ``` -`sudo nano /etc/apache2/sites-available/000-default.conf` +sudo nano /etc/apache2/sites-available/000-default.conf ``` -#### 3\. 在 **000-default.conf** 文件中添加下面的内容: - +在 `000-default.conf` 文件中添加下面的内容: ```ini @@ -192,18 +171,17 @@ quit DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined - # SECTION TO ADD -------------------------------- + # 需要添加的部分开始 -------------------------------- Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted - # END SECTION TO ADD -------------------------------- + # 需要添加的部分结束 -------------------------------- ``` -#### 4\. 安装 Mcrypt: - +安装 Mcrypt: ```bash sudo apt install php-dev libmcrypt-dev php-pear @@ -211,45 +189,42 @@ sudo pecl channel-update pecl.php.net sudo pecl install mcrypt-1.0.2 ``` -#### 5\. 在 `/etc/php/7.3/apache2/php.ini` 文件中添加 `extension=mcrypt.so`(或取消注释)打开 Mcrypt 模块: +打开 Mcrypt 模块: +在 `/etc/php/7.3/apache2/php.ini` 文件中 `extension=mcrypt.so`(或取消注释): ```bash sudo nano /etc/php/7.3/apache2/php.ini ``` -**allow_url_fopen** 应该已经在 `/etc/php/7.3/apache2/php.ini` 文件中打开了。OpenSSL 应该在 php7.3 中安装了。 - -#### 6\. 我建议的另一个设置是把 PHP 最大上传文件数修改为 16 MB: +`allow_url_fopen` 应该已经在 `/etc/php/7.3/apache2/php.ini` 文件中打开了。OpenSSL 应该在 php7.3 中安装了。 +我建议的另一个设置是把 PHP 最大上传文件数修改为 16 MB: ``` -`sudo nano /etc/php/7.3/apache2/php.ini` +sudo nano /etc/php/7.3/apache2/php.ini ``` -#### 7\. 搜索到 **upload_max_filesize** 所在的行,参照下面的设置: - +搜索到 `upload_max_filesize` 所在的行,参照下面的设置: ``` -`upload_max_filesize = 16M` +upload_max_filesize = 16M ``` -#### 8\. 保存并退出,重启 Apache: - +保存并退出,重启 Apache: ``` -`sudo systemctl restart apache2.service` +sudo systemctl restart apache2.service ``` -### 安装 OSSN +#### 4、安装 OSSN -#### 1\. 创建数据库,设置用户: +##### 创建数据库,设置用户 -回到 phpmyadmin web页面(浏览器输入 `http://<>/phpmyadmin/`)并登录: +回到 phpmyadmin web 页面(浏览器输入 `http://<>/phpmyadmin/`)并登录: -用户名: phpmyadmin - -密码:在 phpMyAdmin 安装步骤中你设置的密码 +- 用户名: `phpmyadmin` +- 密码:在 phpMyAdmin 安装步骤中你设置的密码 点击数据库标签页: @@ -261,13 +236,11 @@ sudo nano /etc/php/7.3/apache2/php.ini 现在为 OSSN 创建一个数据库用户,我使用下面的凭证: -用户名: ossn_db_user - -密码: ossn_db_password +- 用户名: `ossn_db_user` +- 密码: `ossn_db_password` 在终端输入下面的命令(如果你没有修改过密码,root 密码应该仍然是空): - ```bash sudo mysql -uroot -p CREATE USER 'ossn_db_user'@'localhost' IDENTIFIED BY 'ossn_db_password'; @@ -276,34 +249,30 @@ flush privileges; quit ``` -#### 2\. 安装 OSSN 软件: +##### 安装 OSSN 软件 在你 PC 上从 [OSSN 下载页面][10] 下载 OSSN 安装压缩文件,保存为文件 `ossn-v5.2-1577836800.zip`。 使用你习惯的 SFTP 软件把整个压缩文件通过 SFTP 传到树莓派的新目录 `/home/pi/download` 下。常用的(默认)SFP 连接参数是: * 主机:你树莓派的 IP 地址 - * 用户名:pi + * 用户名:`pi` * 密码:raspberry(如果没有修改过默认密码) * 端口: 22 - - 在终端输入: - ```bash -cd /home/pi/download/ #Enter directory where OSSN installation files have been transferred -unzip ossn-v5.2-1577836800.zip #Extracts all files from zip -cd /var/www/html/ #Enter Apache web directory -sudo rm index.html #Removes Apache default page - we'll use OSSN one +cd /home/pi/download/ # 进入上传的 OSSN 安装文件的目录。 +unzip ossn-v5.2-1577836800.zip # 从压缩包中提取所有文件 +cd /var/www/html/ # 进入 Apache Web 目录 +sudo rm index.html # 删除 Apache 默认页面 - 我们将使用 OSSN sudo cp -R /home/pi/download/ossn-v5.2-1577836800/* ./ #Copy installation files to web directory sudo chown -R www-data:www-data ./ ``` 创建数据文件夹:OSSN 需要一个文件夹来存放数据。出于安全目的,OSSN 建议这个文件夹创建在公开文档根目录之外。所以,我们在 `/opt` 下创建。 - ```bash sudo mkdir /opt/ossn_data sudo chown -R www-data:www-data /opt/ossn_data/ @@ -337,7 +306,7 @@ sudo chown -R www-data:www-data /opt/ossn_data/ ![][17] -*本文首发在 [peppe8o.com][18]。已获得转载授权。* +本文首发在 [peppe8o.com][18]。已获得转载授权。 -------------------------------------------------------------------------------- @@ -346,7 +315,7 @@ via: https://opensource.com/article/20/3/raspberry-pi-open-source-social 作者:[Giuseppe Cassibba][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 49ddbdbd5aed606a4cf2c7720a1dc9a5b59b9cc5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 17 Apr 2020 21:06:56 +0800 Subject: [PATCH 0336/1809] PUB @lxbwolf https://linux.cn/article-12120-1.html --- ...0320 Build a private social network with a Raspberry Pi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200320 Build a private social network with a Raspberry Pi.md (99%) diff --git a/translated/tech/20200320 Build a private social network with a Raspberry Pi.md b/published/20200320 Build a private social network with a Raspberry Pi.md similarity index 99% rename from translated/tech/20200320 Build a private social network with a Raspberry Pi.md rename to published/20200320 Build a private social network with a Raspberry Pi.md index 9d7e8e7fea..8e9faaa8cc 100644 --- a/translated/tech/20200320 Build a private social network with a Raspberry Pi.md +++ b/published/20200320 Build a private social network with a Raspberry Pi.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12120-1.html) [#]: subject: (Build a private social network with a Raspberry Pi) [#]: via: (https://opensource.com/article/20/3/raspberry-pi-open-source-social) [#]: author: (Giuseppe Cassibba https://opensource.com/users/peppe8o) From 98a631f4581f602c5a8c67c0110320f1d7e4dc71 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Sat, 18 Apr 2020 00:06:32 +0800 Subject: [PATCH 0337/1809] APL --- sources/tech/20200228 Getting started with Linux firewalls.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200228 Getting started with Linux firewalls.md b/sources/tech/20200228 Getting started with Linux firewalls.md index c77d60b618..7c2cefc682 100644 --- a/sources/tech/20200228 Getting started with Linux firewalls.md +++ b/sources/tech/20200228 Getting started with Linux firewalls.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d0197dfda253664c62d690d9c8d386d00e90887f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Apr 2020 01:49:18 +0800 Subject: [PATCH 0338/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200417=20Face?= =?UTF-8?q?-to-face=20collaboration=20for=20community=20to=20become=20more?= =?UTF-8?q?=20impactful=20=E2=80=93=20Chip=20Childers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200417 Face-to-face collaboration for community to become more impactful - Chip Childers.md --- ...o become more impactful - Chip Childers.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 sources/tech/20200417 Face-to-face collaboration for community to become more impactful - Chip Childers.md diff --git a/sources/tech/20200417 Face-to-face collaboration for community to become more impactful - Chip Childers.md b/sources/tech/20200417 Face-to-face collaboration for community to become more impactful - Chip Childers.md new file mode 100644 index 0000000000..ccc63dc914 --- /dev/null +++ b/sources/tech/20200417 Face-to-face collaboration for community to become more impactful - Chip Childers.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Face-to-face collaboration for community to become more impactful – Chip Childers) +[#]: via: (https://www.linux.com/articles/face-to-face-collaboration-for-community-to-become-more-impactful-chip-childers/) +[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) + +Face-to-face collaboration for community to become more impactful – Chip Childers +====== + +“Anytime there’s a crisis, there’s also an opportunity for open source communities to find ways to be helpful,” affirms Chip Childers, the Executive Director of Cloud Foundry Foundation. He believes the remarkable work the Cloud Foundry community has done over the years to enhance enterprise developer productivity will now help those who have adopted the platform to combat COVID-19.; + +“It (the platform) allows them to move quickly to respond to changing conditions, whether those are market conditions, or in this case, a global pandemic. We’re actually pretty proud of a lot of the end-users and how they’re able to use the software more efficiently now,” he says. + +Prior to becoming the Executive Director, Childers served as the CTO for a little over five years. He feels “it’s a very exciting time to be stepping into the role,” and has already chalked out a robust strategy to take the Foundation to the next level. + +For starters, Google has upped its membership of Cloud Foundry and is now at the technical tier. “We were quite happy to have them decide to upgrade and we appreciate their support on that,” says Childers. + +He is also happy with how Kubernetes and Cloud Foundry are coming together. + +“Cloud Foundry and Kubernetes are now becoming complementary. The Cloud Foundry developer platform should run on the Kube infrastructure platform. Both communities have reached the point where they’re ready to see this get blended,” says Childers. + +**Unswerving Support** +VMware ranks among the largest contributors to communities. Last year, it acquired Pivotal, which is one of the biggest stakeholders in the Cloud Foundry project. So, what are the implications on Cloud Foundry of a player that has stakes in both Kubernetes and Cloud Foundry? + +“It’s a clear indication the teams that used to work for Pivotal are being intermixed with the teams that were at VMware, and through some of their other acquisitions like Heptio, they’re all working together on the shared vision of creating the Tanzu platform. This happens to align well with the vision that other Cloud Foundry distributions have — like the way SUSE builds Kubernetes-based infrastructure layers Cloud Foundry on top for developer productivity,” explains Childers. + +Childers believes Paul Fazzone’s promotion to Chairman of the Board will provide an additional boost to Cloud Foundry. + +“Paul heads R&D for VMware’s modern applications business unit. He’s been on our board for a long time. So it’s great that we’re going to continue to see the investment in the open source community not just at the business level from VMware, but also in terms of supporting the contributors, be it developers, product managers, project management support, or marketing support. They’re not wavering in their commitment to open source across the board and Cloud Foundry is one of those communities that will benefit from that,” he states. + +**A Three-Pronged Strategy** +The core mission of the Foundation is to bring a world-class enterprise developer experience to as many enterprise developers as possible. Childers, therefore, considers “enterprise developer productivity for Kubernetes infrastructure our new north star” and has devised a three-pronged strategy to align with it. + +“The first thing is that we will focus on working with the contributing community — the Foundation staff, key member contacts and participants — to improve their experience. + +Next is to build upon the inclusivity and diversity work that the Foundation has done over the years. “We’ve always had a number of different audiences to whom we’ve tried to describe the work of the project: line of business leaders, CIOs, IT operations, and enterprise developers. It is important to make a little bit of a dent in the broader technology industry,” avers Childers. + +The third and final prong of Childers strategy is to encourage developers or companies participating in Cloud Foundry efforts to also participate in Istio (an open platform that connects, manages, and secures microservices), Kubernetes, and the various scenes within the community. + +“There’s a massive overlap, which I think will be very beneficial to everyone. The learnings that developers helping to code Kubernetes or Istio learn during that process should flow in such a way that the CF community builds the developer experience on top of those systems. From this perspective, cross-pollination is really, really important,” says Childers. + +Childers is also planning a tectonic shift in the way Foundation contributors work. “While now it’s going to become a little bit harder as we deal with some of the challenges around the pandemic, I’m very excited about spending a lot of our effort focused on increasing the impact of the face-to-face collaboration time that we’re able to create for the community,” adds Childers. +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/face-to-face-collaboration-for-community-to-become-more-impactful-chip-childers/ + +作者:[Swapnil Bhartiya][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/author/swapnil/ +[b]: https://github.com/lujun9972 From 6c7bef0840a68e5fa7bdf6aec9ef207647622cf6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Apr 2020 01:59:49 +0800 Subject: [PATCH 0339/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200417=20Crea?= =?UTF-8?q?te=20a=20SDN=20on=20Linux=20with=20open=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200417 Create a SDN on Linux with open source.md --- ... Create a SDN on Linux with open source.md | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 sources/tech/20200417 Create a SDN on Linux with open source.md diff --git a/sources/tech/20200417 Create a SDN on Linux with open source.md b/sources/tech/20200417 Create a SDN on Linux with open source.md new file mode 100644 index 0000000000..2e144abb26 --- /dev/null +++ b/sources/tech/20200417 Create a SDN on Linux with open source.md @@ -0,0 +1,194 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create a SDN on Linux with open source) +[#]: via: (https://opensource.com/article/20/4/quagga-linux) +[#]: author: (M Umer https://opensource.com/users/noisybotnet) + +Create a SDN on Linux with open source +====== +Make your Linux system act like a router with the open source routing +stack Quagga. +![Coding on a computer][1] + +Network routing protocols fall into two main categories: interior gateway protocols and exterior gateway protocols. Interior gateway protocols are used by routers to share information within a single autonomous system. If you are running Linux, you can make your system behave as a router through the open source (GPLv2) routing stack [Quagga][2]. + +### What is Quagga? + +Quagga is a [routing software suite][3] and a fork of [GNU Zebra][4]. It provides implementations of all major routing protocols such as Open Shortest Path First (OSPF), Routing Information Protocol (RIP), Border Gateway Protocol (BGP), and Intermediate System to Intermediate System (IS-IS) for Unix-like platforms. + +Although Quagga implements the routing protocols for both IPv4 and IPv6, it doesn't act as a complete router. A true router not only implements all the routing protocols but also has the ability to forward network traffic. Quagga only implements the routing stack, and the job of forwarding network traffic is handled by the Linux kernel. + +### Architecture + +Quagga implements the different routing protocols through protocol-specific daemons. The daemon name is the same as the routing protocol followed by the letter "d." Zebra is the core and a protocol-independent daemon that provides an [abstraction layer][5] to the kernel and presents the Zserv API over TCP sockets to Quagga clients. Each protocol-specific daemon is responsible for running the relevant protocol and building the routing table based on the information exchanged. + +![Quagga architecture][6] + +### Setup + +This tutorial implements the OSPF protocol to configure dynamic routing using Quagga. The setup includes two CentOS 7.7 hosts, named Alpha and Beta. Both hosts share access to the **192.168.122.0/24** network. + +**Host Alpha:** + +IP: 192.168.122.100/24 +Gateway: 192.168.122.1 + +**Host Beta:** + +IP: 192.168.122.50/24 +Gateway: 192.168.122.1 + +### Install the package + +First, install the Quagga package on both hosts. It is available in the CentOS base repo: + + +``` +`yum install quagga -y` +``` + +### Enable IP forwarding + +Next, enable IP forwarding on both hosts since that will performed by the Linux kernel: + + +``` +sysctl -w net.ipv4.ip_forward = 1 +sysctl -p +``` + +### Configuration + +Now, go into the **/etc/quagga** directory and create the configuration files for your setup. You need three files: + + * **zebra.conf**: Quagga's daemon configuration file, which is where you'll define the interfaces and their IP addresses and IP forwarding + * **ospfd.conf**: The protocol configuration file, which is where you'll define the networks that will be offered through the OSPF protocol + * **daemons**: Where you'll specify the relevant protocol daemons that are required to run + + + +On host Alpha, + + +``` + [root@alpha]# cat /etc/quagga/zebra.conf +interface eth0 + ip address 192.168.122.100/24 + ipv6 nd suppress-ra +interface eth1 + ip address 10.12.13.1/24 + ipv6 nd suppress-ra +interface lo +ip forwarding +line vty + +[root@alpha]# cat /etc/quagga/ospfd.conf +interface eth0 +interface eth1 +interface lo +router ospf + network 192.168.122.0/24 area 0.0.0.0 + network 10.12.13.0/24 area 0.0.0.0 +line vty + +[root@alphaa ~]# cat /etc/quagga/daemons +zebra=yes +ospfd=yes +``` + +On host Beta, + + +``` +[root@beta quagga]# cat zebra.conf +interface eth0 + ip address 192.168.122.50/24 + ipv6 nd suppress-ra +interface eth1 + ip address 10.10.10.1/24 + ipv6 nd suppress-ra +interface lo +ip forwarding +line vty + +[root@beta quagga]# cat ospfd.conf +interface eth0 +interface eth1 +interface lo +router ospf + network 192.168.122.0/24 area 0.0.0.0 + network 10.10.10.0/24 area 0.0.0.0 +line vty + +[root@beta ~]# cat /etc/quagga/daemons +zebra=yes +ospfd=yes +``` + +### Configure the firewall + +To use the OSPF protocol, you must allow it in the firewall: + + +``` +firewall-cmd --add-protocol=ospf –permanent + +firewall-cmd –reload +``` + +Now, start the zebra and ospfd daemons. + + +``` +# systemctl start zebra +# systemctl start ospfd +``` + +Look at the route table on both hosts using: + + +``` +[root@alpha ~]# ip route show   +default via 192.168.122.1 dev eth0 proto static metric 100 +10.10.10.0/24 via 192.168.122.50 dev eth0 proto zebra metric 20 +10.12.13.0/24 dev eth1 proto kernel scope link src 10.12.13.1 +192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.100 metric 100 +``` + +You can see that the routing table on Alpha contains an entry of **10.10.10.0/24** via **192.168.122.50** offered through protocol **zebra**. Similarly, on host Beta, the table contains an entry of network **10.12.13.0/24** via **192.168.122.100**. + + +``` +[root@beta ~]# ip route show +default via 192.168.122.1 dev eth0 proto static metric 100 +10.10.10.0/24 dev eth1 proto kernel scope link src 10.10.10.1 +10.12.13.0/24 via 192.168.122.100 dev eth0 proto zebra metric 20 +192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.50 metric 100 +``` + +### Conclusion + +As you can see, the setup and configuration are relatively simple. To add complexity, you can add more network interfaces to the router to provide routing for more networks. You can also implement BGP and RIP protocols using the same method. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/quagga-linux + +作者:[M Umer][a] +选题:[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/noisybotnet +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) +[2]: https://www.quagga.net/ +[3]: https://en.wikipedia.org/wiki/Quagga_(software) +[4]: https://www.gnu.org/software/zebra/ +[5]: https://en.wikipedia.org/wiki/Abstraction_layer +[6]: https://opensource.com/sites/default/files/uploads/quagga_arch.png (Quagga architecture) From a4d6f4e9086eb04b0bea25450eb78275093dbd07 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Apr 2020 02:00:21 +0800 Subject: [PATCH 0340/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200417=20How?= =?UTF-8?q?=20to=20set=20up=20and=20run=20WordPress=20for=20your=20classro?= =?UTF-8?q?om?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200417 How to set up and run WordPress for your classroom.md --- ...up and run WordPress for your classroom.md | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 sources/tech/20200417 How to set up and run WordPress for your classroom.md diff --git a/sources/tech/20200417 How to set up and run WordPress for your classroom.md b/sources/tech/20200417 How to set up and run WordPress for your classroom.md new file mode 100644 index 0000000000..bb8b87d560 --- /dev/null +++ b/sources/tech/20200417 How to set up and run WordPress for your classroom.md @@ -0,0 +1,164 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to set up and run WordPress for your classroom) +[#]: via: (https://opensource.com/article/20/4/wordpress-virtual-machine) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +How to set up and run WordPress for your classroom +====== +Follow these simple steps to customize WordPress for use in the +classroom using free open source software. +![Painting art on a computer screen][1] + +There are many good reasons to set up WordPress for your classroom. As more schools switch to online classes, WordPress can become the go-to content management system. Teachers using WordPress can provide a number of different educational choices to differentiate instruction for their students. Blogging is an accessible way to create content that energizes student learning. Teachers can write short stories, poems, and provide picture galleries that function as story starters. Students can comment and those comments can be moderated by their teacher. + +There are free options like [WordPress.com][2] and [Edublogs][3]. However, these free versions are limited, and you may want to explore all your options. You can install [Virtualbox][4] on any Windows, macOS, or Linux computer. You can use your own computer or an extra you happen to have access to in a virtual environment. + +On Linux, you can install Virtualbox from your package manager. For instance, on Debian, Elementary OS, or Ubuntu: + + +``` +`$ sudo apt install virtualbox` +``` + +On Fedora: + + +``` +`$ sudo dnf install virtualbox` +``` + +### Download a Wordpress image + +Wordpress is easy to install, but server configuration and management can be difficult for the uninitiated. That's why there's [Turnkey Linux][5], a project dedicated to creating virtual machine images and containers of popular server software, preconfigured and ready to run. With Turnkey Linux, you just download a disk image containing the operating system and the software you want to run, and then import that image into Virtualbox. + +To get started with Wordpress, download the **VM** virtual machine image from [turnkeylinux.org/wordpress][6] (in the **Builds** section). Make sure you download the image labeled **VM**, because that's the only format meant for Virtualbox. + +### Import the image into Virtualbox + +After installing Virtualbox, launch the application and import the virtual machine image into Virtualbox. + +![][7] + +Networking on the imported image is set to NAT by default. You will want to change the network settings to "bridged." + +![Virtualbox menu][8] + +After restarting the virtual machine, you are prompted to add passwords for MySQL, Adminer, and the WordPress **admin** user. + +Then you see the network configuration console for the installation. Launch a web browser and navigate to the **web** address provided (in this example, it's 192.168.86.149). + +![Console][9] + +In a web browser, you see a login screen for your Wordpress installation. Click on the **Login** link. + +![Wordpress welcome][10] + +Enter **admin** as the username, followed by the password you created earlier. Click the **Login** link. On this first login as **admin**, you can choose a new password. Be sure to remember it! + +![Login screen][11] + +After logging in, you're presented with the WordPress Dashboard. The software will likely notify you, in the upper left corner of the window, that a new version of Wordpress exists. Update to the latest versions as prompted so your site is secure. + +It's important to note that your Wordpress blog isn't visible by anyone on the Internet yet. It only exists in your local network: only people in your building who are connected to the same router or wifi access point as you can see your Wordpress site right now. The worldwide Internet can't get to it because you're behind a firewall (embedded in your router, and possible also in your computer). + +![Wordpress dashboard][12] + +Following the upgrade, the application restarts, and you're ready to begin configuring WordPress to your liking. + +![Wordpress configuration][13] + +On the far left, there is a button to **Customize Your Site**. + +There, you can choose the name of your site. You can accept the default theme, which is "Twenty Nineteen," or choose another. My favorite is "Twenty Ten," but browse through the themes available to find your personal favorite. WordPress comes with five free themes installed. You can download other free themes from the [WordPress][14][.org][15] site or choose to purchase a premium theme. + +When you click the **Customize Your Site** button, you're presented with new menu options. Select **Site Identity** and change the name of your site. You might use the name of your school or classroom. There's also room to choose a byline (the credit given to the author of a blog post). You can choose the colors for your site and where you will place menus and widgets. WordPress widgets and content and features to the sidebars for your site. Homepage settings are important, as they allow you to choose between a static page that might have a description of your school or classroom or having your blog entries displayed prominently. You can add additional CSS. + +![Turnkey theme][16] + +You can edit your front page, add additional pages like "About," or add a blog post. You can also manage widgets, manage menus, turn comments on or off, or add a link to learn more about WordPress. + +Customizing your site allows you to configure a number of options quickly and easily. + +WordPress has dozens of widgets that you can place in different areas of your page. Widgets are independent sections of content that can be placed into specific areas provided by your theme. These areas are called sidebars. + +### Adding content + +After you have WordPress configured to your liking, you probably want to get busy creating content. The best way to do that is to head back to the WordPress Dashboard. + +On the left side, near the top of the page, you see **Posts**. Select that link and a dropdown appears. Choose **Add New** to create your very first blog post. + +![Add post dropdown][17] + +Fill in your title in the top block and then move down to the body. It's like using a word processor. WordPress has all the tools you need to write. You can set the font size from _small_ to _huge_. You can start a paragraph with dropped capitals. The text and background color can be changed. Your posts can include quote blocks and embedded content. A wide variety of embedded content is supported so you can make your posts a dynamic multimedia experience. + +![Wordpress classroom blog][18] + +### Going online + +So far, your Wordpress blog only exists on your local network. Anyone using the same router as you (your housemates or classroom) can see your Wordpress site by navigating to 192.168.86.149, but once you're away from that router, the site becomes inaccessible. + +If you want to go online with your custom Wordpress site, you have to allow traffic through your router, and then direct that traffic to the computer running Virtualbox. If you've installed Virtualbox on a laptop, then your website would disappear any time you closed your laptop, which is why servers that never get shutdown exist. But if this is just a fun lesson on how to run a Wordpress site, then having a website that's only available during class hours is fine. + +If you have access to your router, then you can log into it and make the adjustments yourself. If you don't own or control your router, then you must talk to your systems administrator for access. + +A _router_ is the box you got from your internet service provider. You might also call it your _modem_. + +Every device is different, so there's no way for me to definitively tell you what you need to click on to adjust your settings. Generally, you access your home router through a web browser. Your router's address is often printed on the bottom of the router and begins with either 192.168 or 10. + +Navigate to the router address and log in with the credentials you were provided when you got your internet service. It's often as simple as `admin` with a numeric password (sometimes this password is printed on the router, too). If you don't know the login, call your internet provider and ask for details. + +Different routers use different terms for the same thing; keywords to look for are **Port forwarding**, **Virtual server**, and **Firewall**. Whatever your router calls it, you want to accept traffic coming to port 80 of your router and forward that traffic to the same port of your virtual machines's IP address (in this example, that is 192.168.86.149, but it could be different for you). + +![Example router setting screen][19] + +Now you're allowing traffic through the web port of your router's firewall. To view your Wordpress site over the Internet, get your worldwide IP address. You can get your global IP by going to the site [icanhazip.com][20]. Then go to a different computer, open a browser, and navigate to that IP address. As long as Virtualbox is running, you'll see your Wordpress site on the Internet. You can do this from anywhere in the world, because your site is on the Internet now. + +Most websites use a domain name so you don't have to remember global IP addresses. You can purchase a domain name from services like [webhosting.coop][21] or [gandi.net][22], or a temporary one from [freenom.com][23]. Mapping that to your Wordpress site, however, is out of scope for this article. + +### Wordpress for everyone + +[WordPress][24] is open source and is licensed under the [GNU Public License][25]. You are welcome to contribute to WordPress as either a [developer][26] or enthusiast. WordPress is committed to being inclusive and accessible as possible. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/wordpress-virtual-machine + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/painting_computer_screen_art_design_creative.png?itok=LVAeQx3_ (Painting art on a computer screen) +[2]: https://wordpress.com/ +[3]: https://edublogs.org/ +[4]: https://www.virtualbox.org/ +[5]: https://www.turnkeylinux.org +[6]: https://www.turnkeylinux.org/wordpress +[7]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_1.png +[8]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_2.png (Virtualbox menu) +[9]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_3.png (Console) +[10]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_4.png (Wordpress welcome) +[11]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_5.png (Login screen) +[12]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_6.png (Wordpress dashboard) +[13]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_7.png (Wordpress configuration) +[14]: http://Wordpress.org +[15]: http://WordPress.org +[16]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_8.png (Turnkey theme) +[17]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_12.png (Add post dropdown) +[18]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_13.png (Wordpress classroom blog) +[19]: https://opensource.com/sites/default/files/router-web.jpg (Example router setting screen) +[20]: http://icanhazip.com/ +[21]: https://webhosting.coop/domain-names +[22]: https://www.gandi.net +[23]: http://freenom.com/ +[24]: https://wordpress.org/ +[25]: https://github.com/WordPress/WordPress/blob/master/license.txt +[26]: https://wordpress.org/five-for-the-future/ From 6441c100a9e34a6a69825856e97217f1a25758c3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Apr 2020 02:01:09 +0800 Subject: [PATCH 0341/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200417=20Is?= =?UTF-8?q?=20reporting=20100%=20of=20code=20coverage=20reasonable=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200417 Is reporting 100- of code coverage reasonable.md --- ...orting 100- of code coverage reasonable.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 sources/tech/20200417 Is reporting 100- of code coverage reasonable.md diff --git a/sources/tech/20200417 Is reporting 100- of code coverage reasonable.md b/sources/tech/20200417 Is reporting 100- of code coverage reasonable.md new file mode 100644 index 0000000000..6d57fb30f8 --- /dev/null +++ b/sources/tech/20200417 Is reporting 100- of code coverage reasonable.md @@ -0,0 +1,174 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Is reporting 100% of code coverage reasonable?) +[#]: via: (https://opensource.com/article/20/4/testing-code-coverage) +[#]: author: (Eric Herman https://opensource.com/users/ericherman) + +Is reporting 100% of code coverage reasonable? +====== +The time required to reach reporting 100% of code coverage is +considerably less than what I would have estimated before this +exploration. +![Code going into a computer.][1] + +The [Foundation for Public Code][2] works to enable open and collaborative public-purpose software for public organizations (like local governments) internationally. We do this by supporting software at the codebase level through codebase stewardship. We also publish the [Standard for Public Code][3] (draft version 0.1.4 at the time of this writing), which helps open source codebase communities build solutions that can be reused successfully by other organizations. It includes guidance for policymakers, managers, developers, designers, and vendors. + +Among other things, the standard addresses [code coverage][4], or how much of the code is executed when an automated test suite runs. It's one way to measure the likelihood that the code contains undetected software bugs. In the standard's ["Use continuous integration" requirements][5], it says, "source code test and documentation coverage **should** be monitored." Additionally, the [guidance to check][6] this requirement states, "code coverage tools check whether coverage is at 100% of the code." + +Over my software development career, which spans more than two decades, I have worked on codebases large and small and some with very high percentages of code coverage. Yet none of the non-trivial codebases I have contributed to have reported 100% test coverage. This made me question whether the "_check whether coverage is at 100%_" guidance would be followed. + +When I think about the nature of the test coverage gaps in the codebases I have worked on, they typically have been around system states that are very difficult (and in some cases, impossible) to create. For instance, in earlier versions of Java, I recall we were required to write catch blocks for exceptions that could never be thrown. + +Previously, I reasoned that 100% test coverage is something to aspire to, but it is probably not worth the cost on most codebases and may not be realistic in a few. + +Coverage tools have been getting smarter and more tunable over time. Languages have been getting lighter, and libraries have been getting easier to mock and test. So how unreasonable is 100% coverage of functionality today? + +### Resource exhaustion + +The high-quality but low test-coverage codebases I contribute to happen to be written in C or C++. A quick glance at these codebases shows that there is a class of common low-coverage situations that I'll lump together under the umbrella of resource exhaustion: out of memory, out of disk space, etc. + +Here is a simple example of code that does not check for resource exhaustion; in this case, memory allocation failure: + + +``` +char *buf = malloc(80); +sprintf(buf, "hello, world"); +``` + +This example code needs to allocate a small buffer, so it calls **malloc(80)**, and **malloc** usually returns a pointer to 80 bytes of memory … but that can fail. In the (unlikely) case that **malloc** returns **NULL**, the code above will proceed to call **sprintf** with a **NULL** pointer which causes a crash. It is typical in C code to do something more like this: + + +``` +char *buf = malloc(80); +if (buf == NULL) { +    fprintf(stderr, "malloc returned NULL for 80 bytes?\n"); +    return NULL; +} +sprintf(buf, "hello, world"); +``` + +This code guards against **malloc** returning **NULL**, which is better. However, creating tests for correct behavior in the face of this kind of resource exhaustion can be really hard. It's not impossible, of course, and there are multiple approaches. Many approaches result in fragile tests, which require a lot of maintenance over time, and these tests can be very time-consuming to build in the first place. + +### Exploration + +Pondering this, I decided to run a little experiment to see if I could learn something about the costs and consequences of this strict, 100% criterion. + +Since I do some embedded-systems development, I have a few C libraries that I've developed and reused over the years in my embedded projects. I decided to look at some of these libraries and see just how hard it would be to bring them up to 100% code coverage. In the process, I paid attention to the impact on code clarity, code structure, and performance. + +#### A library with preexisting dependency injection + +Step one is measuring by adding code coverage to a codebase. Since this is C, **gcc** provides quite a lot by default with the **\--coverage** option, and **lcov** (with **genhtml**) does a good job of making reports; thus, this step was easy. I expected the starting coverage to be pretty good—it was, but it had a few untested branches, as well as the predicted gaps around error conditions and error reporting. + +I made error reporting pluggable, so it was easier to capture and make assertions around error messages in previously untested branches. + +Since this code already allowed for pluggable implementations of **malloc** and **free**, it was straightforward to write little malloc and free wrappers that I could inject memory allocation failures into. Within an hour or two, that was covered. + +In the process, I realized that there was one condition where, from the perspective of the calling client code, it was impossible to distinguish between the situation where an error occurs and one where **NULL** is a valid return value. For you C programmers, it was essentially similar to the following: + + +``` +/* stashes a copy of the value + * returns the previously stashed value */ +char *foo_stash(foo_s *context, +                char *stash_me, +                size_t stash_me_len) +{ +    char *copy = malloc(stash_me_len); +    if (copy == NULL) { +        return NULL; +    } +    memcpy(copy, stash_me, stash_me_len); +    char *previous = context->stash; +    context->stash = copy; +    /* previous may be NULL */ +    return previous; +} +``` + +I adjusted the API to allow the error information to be explicitly available. If you are a C developer, you know there are various ways this can be accomplished. I chose an approach similar to this: + + +``` +/* stashes a copy of the value + * returns the previously stashed value + * on error, the 'err' pointer is set to 1 */ +char *foo_stash2(foo_s *context, +                char *stash_me, +                size_t stash_me_len, +                int *err) +{ +    char *copy = malloc(stash_me_len); +    if (copy == NULL) { +        *err = 1; +        return NULL; +    } +    memcpy(copy, stash_me, stash_me_len); +    char *previous = context->stash; +    context->stash = copy; +    /* previous may be NULL */ +    return previous; +} +``` + +Without testing for resource exhaustion, it may have taken a long time for me to notice this (now obvious) shortcoming of the API. + +To get **lcov** to report 100% test coverage, I had to tell the compiler to [not inline any code][7], something I learned it does even at optimization level zero. + +When embedded in actual firmware, the compiler optimized away the unused indirection; therefore, the added indirection in the source code imposed no real-world performance penalty in the compiled firmware. + +Of course, this was the easy library. + +#### A more typical library + +Once I established a method of injecting memory allocation failures in tests, I decided to move onto another library, but one for which malloc and free were not already pluggable. I had questions. How invasive will this be to the codebase? Will it clutter the code, making it less clear? How time-consuming will it be? + +While I don't always record coverage metrics, I am a big believer in testing: more than 20 years ago, I learned that my code improves if I write the tests and client code [before][8] the implementation code, and I have worked that way ever since. (In [_Test-Driven Development: By Example_][9], you can find my name in the acknowledgments.) Yet, when I added code coverage reporting to the second library, I was surprised to see that (at some point in the past) I had added a pair of functions to the library without adding tests for them. The other untested areas were, unsurprisingly, code to handle memory-allocation failure. + +Writing tests for the pair of untested functions was, of course, quick and easy. The coverage tools also revealed that I had a function with an untested code branch that, given only a quick glance, contained a bug. The fix was trivial, yet I was surprised to find a bug, given the different projects where I use this library. Nonetheless, there it was, a humbling reminder that, all too often, bugs lurk in untested code. + +Next up was the more challenging stuff: testing for resource exhaustion. I started by introducing some global variables for the malloc/free function pointers, as well as a variable to hold a memory-tracking object. Once that was working, I moved those variables from global scope into a context argument that was already present. Refactoring the code to allow for the necessary indirection took only a couple of hours (less time than I expected), and the complexity added was negligible. + +### Reflections + +My conclusion from the first library was that it was well worth the time. The code is now more flexible, the API is now more complete for the caller, and writing the failure injection harness was pretty easy. + +From the second library, I was reminded that even less-pluggable code could be made testable without adding undue levels of complexity. The code improved, I fixed a bug, and I can be more confident in the code. Also, the additional modularity of being able to plug in an alternative memory allocator is a feature that may prove more valuable in the future. + +Exclusion comments are a feature of **lcov** to cause coverage reporting to ignore a block of code. Interestingly, I didn't feel the need to use exclusion comments in either library. + +I am more certain than ever that even very good code is improved by investing in test coverage. + +Both of these codebases are small, had some modularity already, began from a point of good testing, are single-threaded, and contain no graphical UI code. If I were to try to tackle this on one of the larger, more monolithic codebases I contribute to, it would be harder and require a larger time investment. There would likely be some sections of code where I might still conclude that the best thing to do would be to "cheat" by tuning the tooling to not report on some section of code. + +That said, I estimate that the time required to reach reporting 100% of code coverage is considerably less than what I would have estimated before this exploration. + +If you happen to be a C coder and want to see a running example of this, including **gcov** / **lcov** usage, I extracted the out-of-memory injecting code and put it in an [example repository][10]. + +Have you pushed a codebase to 100% coverage by tests, or tried to? What was your experience? Please share it in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/testing-code-coverage + +作者:[Eric Herman][a] +选题:[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/ericherman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 (Code going into a computer.) +[2]: https://publiccode.net/ +[3]: https://standard.publiccode.net +[4]: https://en.wikipedia.org/wiki/Code_coverage +[5]: https://standard.publiccode.net/criteria/continuous-integration.html#requirements +[6]: https://standard.publiccode.net/criteria/continuous-integration.html#how-to-test +[7]: https://twitter.com/Eric_Herman/status/1224983465784938496 +[8]: https://opensource.com/article/20/2/automate-unit-tests +[9]: https://www.oreilly.com/library/view/test-driven-development/0321146530/ +[10]: https://github.com/ericherman/context-alloc From ce62c7a4db39611ce612b03a50161eba592a5cb4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Apr 2020 02:03:07 +0800 Subject: [PATCH 0342/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200418=20Ethe?= =?UTF-8?q?rnet=20consortium=20announces=20completion=20of=20800GbE=20spec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200418 Ethernet consortium announces completion of 800GbE spec.md --- ...ium announces completion of 800GbE spec.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sources/talk/20200418 Ethernet consortium announces completion of 800GbE spec.md diff --git a/sources/talk/20200418 Ethernet consortium announces completion of 800GbE spec.md b/sources/talk/20200418 Ethernet consortium announces completion of 800GbE spec.md new file mode 100644 index 0000000000..a7a6bf1c1a --- /dev/null +++ b/sources/talk/20200418 Ethernet consortium announces completion of 800GbE spec.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ethernet consortium announces completion of 800GbE spec) +[#]: via: (https://www.networkworld.com/article/3538529/ethernet-consortium-announces-completion-of-800gbe-spec.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Ethernet consortium announces completion of 800GbE spec +====== +The specification for 800GbE doubles the maximum speed of the current Ethernet standard, but also tweaks other aspects including latency. +Martyn Williams/IDGNS + +The industry-backed Ethernet Technology Consortium has announced the completion of a specification for 800 Gigabit Ethernet technology. + +Based on many of the technologies used in the current top-end 400 Gigabit Ethernet protocol, the new spec is formally known as 800GBASE-R. The consortium that designed it (then known as the 25 Gigabit Ethernet Consortium) was also instrumental in developing the 25, 50, and 100 Gigabit Ethernet protocols and includes Broadcom, Cisco, Google, and Microsoft among its members. + +**[ Now see [the hidden cause of slow internet and how to fix it][1].]** + +The 800GbE spec adds new media access control (MAC) and physical coding sublayer (PCS) methods, which tweaks these functions to distribute data across eight physical lanes running at a native 106.25Gbps. (A lane can be a copper twisted pair or in optical cables, a strand of fiber or a wavelength.)  The 800GBASE-R specification is built on two 400 GbE 2xClause PCSs to create a single MAC which operates at a combined 800Gbps. + +And while the focus is on eight 106.25G lanes, it's not locked in. It is possible to run 16 lanes at half the speed, or 53.125Gbps. + +The new standard offers half the latency of 400G Ethernet specification, but the new spec also cuts the forward error correction (FEC) overhead on networks running at 50 Gbps, 100 Gbps, and 200 Gbps by half, thus reducing the packet-processing load on the NIC. + +By lowering latency this will feed the need for speed in latency-sensitive applications like [high-performance computing][2] and artificial intelligence, where lots of data needs to be moved around as fast as possible. + +[][3] + +Doubling from 400G to 800G wasn’t too great of a technological leap. It meant adding more lanes at the same transfer rate, with a few tweaks. But breaking a terabit, something Cisco and other networking firms have been talking about for a decade, will require a significant reworking of the technology and won’t be an easy fix. + +It likely won’t be cheap, either. 800G works with existing hardware and 400GbE switches are not cheap, running as high as six figures. Moving past the terabit barrier with a major revision to the technology will likely be even more expensive. But for hyperscalers and HPC customers, that’s par for the course. + +The ETC didn’t say when to expect new hardware supporting the 800G, but given its modest change to existing specs, it could appear this year, assuming the pandemic-induced shutdown doesn’t throw a monkey wrench into plans. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3538529/ethernet-consortium-announces-completion-of-800gbe-spec.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3107744/internet/the-hidden-cause-of-slow-internet-and-how-to-fix-it.html +[2]: https://www.networkworld.com/article/3444399/high-performance-computing-do-you-need-it.html +[3]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 76d336d28f8556b0e3a66710ee8e0599a16c68f5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Apr 2020 02:03:54 +0800 Subject: [PATCH 0343/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200417=20How?= =?UTF-8?q?=20to=20compress=20files=20on=20Linux=205=20ways?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200417 How to compress files on Linux 5 ways.md --- ...7 How to compress files on Linux 5 ways.md | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 sources/tech/20200417 How to compress files on Linux 5 ways.md diff --git a/sources/tech/20200417 How to compress files on Linux 5 ways.md b/sources/tech/20200417 How to compress files on Linux 5 ways.md new file mode 100644 index 0000000000..5ce33cd18c --- /dev/null +++ b/sources/tech/20200417 How to compress files on Linux 5 ways.md @@ -0,0 +1,207 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to compress files on Linux 5 ways) +[#]: via: (https://www.networkworld.com/article/3538471/how-to-compress-files-on-linux-5-ways.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +How to compress files on Linux 5 ways +====== +There are a number of tools that you use to compress files on Linux systems, but they don't all behave the same way or yield the same level of compression. In this post, we compare five of them. +Getty Images + +There are quite a few commands on Linux for compressing files. One of the newest and most effective is **xz**, but they all have advantages for both saving disk space and preserving files for later use. In this post, we compare the compression commands and point out the significant differences. + +### tar + +The tar command is not specifically a compression command. It’s generally used to pull a number of files into a single file for easy transport to another system or to back the files up as a related group. It also provides compression as a feature, which makes a lot of sense, and the addition of the **z** compression option is available to make this happen. + +When compression is added to a **tar** command with the **z** option, tar uses **gzip** to do the compressing. + +You can use **tar** to compress a single file as easily as a group though this offers no particular advantage over using **gzip** directly. To use **tar** for this, just identify the file as you would a group of files with a “tar cfz newtarfile filename” command like this: + +``` +$ tar cfz bigfile.tgz bigfile + ^ ^ + | | + +- new file +- file to be compressed + +$ ls -l bigfile* +-rw-rw-r-- 1 shs shs 103270400 Apr 16 16:09 bigfile +-rw-rw-r-- 1 shs shs 21608325 Apr 16 16:08 bigfile.tgz +``` + +Note the significant reduction in the file size. + +If you prefer, you can use the **tar.gz** extension which might make the character of the file a bit more obvious, but most Linux users will probably recognize **tgz** as meaning the same thing – the combination of **tar** and **gz** to indicate that the file is a compressed tar file. You will be left with both the original file and the compressed file once the compression is complete. + +To collect a number of files together and compress the resultant “tar ball” in one command, use the same basic syntax, but specify the files to be included as a group in place of the single file. Here’s an example: + +[][1] + +``` +$ tar cfz bin.tgz bin/* + ^ ^ + | +-- files to include + + new file +``` + +### zip + +The **zip** command creates a compressed file while leaving the original file intact. The syntax is straightforward except that, as with **tar**, you have to remember that your original file should be the last argument on the command line. + +``` +$ zip ./bigfile.zip bigfile +updating: bigfile (deflated 79%) +$ ls -l bigfile bigfile.zip +-rw-rw-r-- 1 shs shs 103270400 Apr 16 11:18 bigfile +-rw-rw-r-- 1 shs shs 21606889 Apr 16 11:19 bigfile.zip +``` + +### gzip + +The **gzip** command is very simple to use. You just type "gzip" followed by the name of the file you want to compress. Unlike the commands described above, **gzip** will encrypt the files "in place". In other words, the original file will be replaced by the encrypted file. + +``` +$ gzip bigfile +$ ls -l bigfile* +-rw-rw-r-- 1 shs shs 21606751 Apr 15 17:57 bigfile.gz +``` + +### bzip2 + +As with the **gzip** command, **bzip2** will compress the file that you select "in place", leaving only the original file. + +``` +$ bzip bigfile +$ ls -l bigfile* +-rw-rw-r-- 1 shs shs 18115234 Apr 15 17:57 bigfile.bz2 +``` + +### xz + +A relative newcomer to the compression command team, **xz** is a front runner in terms of how well it compresses files. Like the two previous commands, you only need to supply the file name to the command. Again, the original file is compressed in place. + +``` +$ xz bigfile +$ ls -l bigfile* +-rw-rw-r-- 1 shs shs 13427236 Apr 15 17:30 bigfile.xz +``` + +For large files, you are likely to notice that **xz** takes longer to run than other compression commands, but the compression results are very impressive. + +### Comparisons to consider + +Most people have heard it said that "size isn't everything". So, let's compare file size as well as some other issues to be considered when you make plans for how you want to compress your files. + +The stats shown below all relate to compressing the single file – bigfile – used in the example commands shown above. This file is a large and fairly random text file. Compression rates will depend to some extent on the content of the files. + +#### Size reduction + +When compared, the various compression commands shown above yielded the following results. The percentages represent how the compressed files compare with the original file. + +``` +-rw-rw-r-- 1 shs shs 103270400 Apr 16 14:01 bigfile +------------------------------------------------------ +-rw-rw-r-- 1 shs shs 18115234 Apr 16 13:59 bigfile.bz2 ~17% +-rw-rw-r-- 1 shs shs 21606751 Apr 16 14:00 bigfile.gz ~21% +-rw-rw-r-- 1 shs shs 21608322 Apr 16 13:59 bigfile.tgz ~21% +-rw-rw-r-- 1 shs shs 13427236 Apr 16 14:00 bigfile.xz ~13% +-rw-rw-r-- 1 shs shs 21606889 Apr 16 13:59 bigfile.zip ~21% +``` + +The **xz** commands wins, ending up at only 13% the size of the original file, but all of these compression commands reduced the original file size quite significantly. + +#### Whether the original files are replaced + +The **bzip2**, **gzip** and **xz** commands all replace the original files with compressed versions. The **tar** and **zip** commands to not. + +#### Run time + +The **xz** command seems to take more time than the other commands to encrypt the files. For bigfile, the approximate times were: + +``` +command run-time +tar 4.9 seconds +zip 5.2 seconds +bzip2 22.8 seconds +gzip 4.8 seconds +xz 50.4 seconds +``` + +Decompression times are likely to be considerably smaller than compression times. + +#### File permissions + +Regardless of what permissions you have set on your original file, permissions for the compressed file will be based on your **umask** setting, except for **bzip2** which retains the original file's permissions. + +#### Compatibility with Windows + +The **zip** command creates a file which can be used (i.e., decompressed) on Windows systems as well as Linux and other Unix systems without having to install other tools which may or may not be available. + +### Decompressing files + +The commands for decompressing files are similar to those used to compress the files. These commands would work for decompressing bigfile after the compression commands shown above were run. + + * tar: **tar xf bigfile.tgz** + * zip: **unzip bigfile.zip** + * gzip: **gunzip bigfile.gz** + * bzip2: **bunzip2 bigfile.gz2** + * xz: **xz -d bigfile.xz** or **unxz bigfile.xz** + + + +### Running your own compression comparisons + +If you'd like to run some tests on your own, grab a large but replaceable file and compress it using each of the commands shown above – preferably using a new subdirectory. You might have to first install **xz** if you want to include it in the tests.This script can make the comparison easier, but will likely take a few minutes to complete. + +``` +#!/bin/bash + +# ask user for filename +echo -n "filename> " +read filename + +# you need this because some commands will replace the original file +cp $filename $filename-2 + +# clean up first (in case previous results are still available) +rm $filename.* + +tar cvfz ./$filename.tgz $filename > /dev/null +zip $filename.zip $filename > /dev/null +bzip2 $filename +# recover original file +cp $filename-2 $filename +gzip $filename +# recover original file +cp $filename-2 $filename +xz $filename + +# show results +ls -l $filename.* + +# replace the original file +mv $filename-2 $filename +``` + +Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3538471/how-to-compress-files-on-linux-5-ways.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[2]: https://www.facebook.com/NetworkWorld/ +[3]: https://www.linkedin.com/company/network-world From b770695e03c2a30c9073798c564cecd36b3a752f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 18 Apr 2020 12:33:52 +0800 Subject: [PATCH 0344/1809] Rename sources/tech/20200417 Face-to-face collaboration for community to become more impactful - Chip Childers.md to sources/talk/20200417 Face-to-face collaboration for community to become more impactful - Chip Childers.md --- ...tion for community to become more impactful - Chip Childers.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200417 Face-to-face collaboration for community to become more impactful - Chip Childers.md (100%) diff --git a/sources/tech/20200417 Face-to-face collaboration for community to become more impactful - Chip Childers.md b/sources/talk/20200417 Face-to-face collaboration for community to become more impactful - Chip Childers.md similarity index 100% rename from sources/tech/20200417 Face-to-face collaboration for community to become more impactful - Chip Childers.md rename to sources/talk/20200417 Face-to-face collaboration for community to become more impactful - Chip Childers.md From e21237f5d107b47727271096b0a07ec312da4d30 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Sat, 18 Apr 2020 12:41:51 +0800 Subject: [PATCH 0345/1809] TSL 20200228 Getting started with Linux firewalls --- ...28 Getting started with Linux firewalls.md | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) rename {sources => translated}/tech/20200228 Getting started with Linux firewalls.md (68%) diff --git a/sources/tech/20200228 Getting started with Linux firewalls.md b/translated/tech/20200228 Getting started with Linux firewalls.md similarity index 68% rename from sources/tech/20200228 Getting started with Linux firewalls.md rename to translated/tech/20200228 Getting started with Linux firewalls.md index 7c2cefc682..bc5d20732a 100644 --- a/sources/tech/20200228 Getting started with Linux firewalls.md +++ b/translated/tech/20200228 Getting started with Linux firewalls.md @@ -1,25 +1,24 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with Linux firewalls) -[#]: via: (https://opensource.com/article/20/2/firewall-cheat-sheet) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Getting started with Linux firewalls" +[#]: via: "https://opensource.com/article/20/2/firewall-cheat-sheet" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" -Getting started with Linux firewalls +Linux 防火墙入门教程 ====== -A firewall is your computer's first line of defense against network -intrusion. Download our cheat sheet to make sure you're secure. +防火墙是你的计算机防止网络入侵的第一道屏障。为确保你的安全,请下载我们的备忘单。 ![Cheat Sheet cover image][1] -A sensible firewall is your computer's first line of defense against network intrusion. When you're at home, you're probably behind a firewall built into the router supplied by your internet service provider. When you're away from home, though, the only firewall you have is the one running on your computer, so it's important to configure and control the firewall on your Linux computer. If you run a Linux server, it's just as important to know how to manage your firewall so that you can protect it from unwanted traffic both locally and remotely. +合理的防火墙是你的计算机防止网络入侵的第一道屏障。你在家里上网,通常互联网服务提供会在路由中搭建了一层防火墙。如果不在家里上网,那么你计算机上的那层防火墙就是仅有的一层,因为配置和控制好你 Linux 电脑上的防火墙很重要。如果你维护一台 Linux 服务器,知道怎么去管理你的防火墙同样重要,只要掌握了这些知识你才能保护你的服务器免于本地或远程非法流量的入侵。 -### Install a firewall +### 安装防火墙 -Many Linux distributions ship with a firewall already installed, and traditionally that was **iptables**. It is extremely effective and customizable, but it can be complex to configure. Luckily, developers have produced several frontends to help users control their firewall without writing lengthy iptables rules. +很多 Linux 发行版本已经自带了防火墙,通常是 `iptables`。它很有效并可以自定义,但配置起来有点复杂。幸运的是,有开发者写出了一些前端界面来帮助用户不需要写冗长的 iptables 规则就可以控制防火墙。 -On Fedora, CentOS, Red Hat, and similar distributions, the firewall software installed by default is **firewalld**, which is configured and controlled with the **firewall-cmd** command. On Debian and most other distributions, firewalld is available to install from your software repository. Ubuntu ships with the Uncomplicated Firewall (ufw), so to use firewalld, you must enable the **universe** repository: +在 Fedora,CentOS,Red Hat 和一些类似的发行版本上,默认安装的防火墙软件是 `firewalld`,是用 **firewall-cmd** 命令来配置和控制的。在 Debian 和大部分其他发行版上,可以从你的软件仓库安装 firewalld。Ubuntu 自带的是 Uncomplicated Firewall(ufw),所以你必须打开 **universe** 库才能使用 firewalld: ``` @@ -27,25 +26,25 @@ $ sudo add-apt-repository universe $ sudo apt install firewalld ``` -You must also deactivate ufw: +你还需要停用 ufw: ``` `$ sudo systemctl disable ufw` ``` -There's no reason _not_ to use ufw. It's an excellent firewall frontend. However, this article focuses on firewalld because of its wide availability and integration into systemd, which is shipped with nearly every distribution. +没有理由*不*用 ufw。它是一个强大的防火墙前端。然而,本文重点讲 firewalld,因为大部分发行版都支持它而且它集成到了 systemd,systemd 是几乎所有发行版都自带的。 -Regardless of your distribution, for a firewall to be effective, it must be active, and it should be loaded at boot time: +不管你的发行版是哪个,都要先激活防火墙才能让它生效,激活需要在启动时加载: ``` `$ sudo systemctl enable --now firewalld` ``` -### Understanding firewall zones +### 理解防火墙的 zone -Firewalld aims to make firewall configuration as simple as possible. It does this by establishing _zones_. A zone is a set of sensible, common rules that suit the everyday needs of most users. There are nine by default: +Firewalld 旨在让防火墙的配置工作尽可能简单。它通过建立 *zone* 来实现这个目标。一个 zone 是一类型的合理、通用的规则,这些规则适配大部分用户的日常需求。 * **trusted:** All network connections are accepted. This is the least paranoid firewall setting and should only be used in a trusted environment, such as a test lab or in a family home where everyone on the local network is known to be friendly. * **home, work, internal:** In these three zones, most incoming connections are accepted. They each exclude traffic on ports that usually expect no activity. Any of them is a reasonable setting for use in a home setting where there is no reason to expect network traffic to obscure ports, and you generally trust the other users on the network. @@ -124,5 +123,5 @@ via: https://opensource.com/article/20/2/firewall-cheat-sheet [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image) +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coverimage_cheat_sheet.png?itok=lYkNKieP "Cheat Sheet cover image" [2]: https://opensource.com/downloads/firewall-cmd-cheat-sheet From 5edac4c8560bb719df772065b54624234a52d0c1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 18 Apr 2020 13:48:01 +0800 Subject: [PATCH 0346/1809] Rename sources/talk/20200418 Ethernet consortium announces completion of 800GbE spec.md to sources/news/20200418 Ethernet consortium announces completion of 800GbE spec.md --- ...418 Ethernet consortium announces completion of 800GbE spec.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{talk => news}/20200418 Ethernet consortium announces completion of 800GbE spec.md (100%) diff --git a/sources/talk/20200418 Ethernet consortium announces completion of 800GbE spec.md b/sources/news/20200418 Ethernet consortium announces completion of 800GbE spec.md similarity index 100% rename from sources/talk/20200418 Ethernet consortium announces completion of 800GbE spec.md rename to sources/news/20200418 Ethernet consortium announces completion of 800GbE spec.md From 15fe356d75a3ef19b95a248c6301a3d471ab4dee Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Apr 2020 14:21:06 +0800 Subject: [PATCH 0347/1809] PRF @geekpi --- ...ow to Add Multiple Time Zones in Ubuntu.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/translated/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md b/translated/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md index c3ab289f06..0260e1327d 100644 --- a/translated/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md +++ b/translated/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Add Multiple Time Zones in Ubuntu) @@ -10,11 +10,13 @@ 如何在 Ubuntu 中添加多个时区 ====== -_**此教程展示了使用 GNOME 桌面环境在 Ubuntu 和其他发行版中为多个时区添加其他时钟的步骤。**_ +> 本快速教程介绍了在 Ubuntu 和其他发行版中使用 GNOME 桌面环境添加多时区时钟的步骤。 + +![](https://img.linux.net.cn/data/attachment/album/202004/18/142021jborblzkglbebrkk.jpg) 如果你的家人或同事在另一个国家,或者你居住在一个有多个时区的国家,那么了解时差就变得很重要。毕竟,你不想在凌晨 4 点打电话打扰别人。 -一些 Linux 用户还会加一个 [UTC 时间][1]标签,因为大多数服务器都使用 UTC。 +一些 Linux 用户还会记下 [UTC 时间][1],因为大多数服务器都使用 UTC。 如果你有多个时钟,那么可以更好地管理此类情况。你可以将一个时钟设置为本地时间,并将其他时钟同步到其他时区。这使得了解不同时间变得更加容易。 @@ -26,11 +28,11 @@ _**此教程展示了使用 GNOME 桌面环境在 Ubuntu 和其他发行版中 要添加其他时钟,可以使用一个叫 [GNOME Clocks][3] 的小程序。 -GNOME Clocks 是一个简单的应用,它可以显示多个位置的时间和日期。你也可以使用它来设置闹钟或计时器。还包括秒表功能。 +GNOME Clocks 是一个简单的应用,它可以显示多个位置的时间和日期。你也可以使用它来设置闹钟或计时器,它还包括秒表功能。 GNOME Clocks 存在于 Ubuntu 的 Universe 仓库中。因此,请确保首先[启用 Universe 仓库][4]。 -你可以在软件中心中搜索 GNOME Clocks 并从那里安装它。 +你可以在软件中心中搜索 “GNOME Clocks” 并从那里安装它。 ![Gnome Clocks Ubuntu Software Center][5] @@ -42,13 +44,13 @@ sudo apt install gnome-clocks 如果你使用的是其他 Linux 发行版,那么请使用发行版的软件中心或软件包管理器来安装此程序。 -安装后,请按 super 键(Windows 键)并搜索 clocks: +安装后,请按 `Super` 键( `Windows` 键)并搜索 clocks: ![Gnome Clocks App Search Ubuntu][6] -启动程序,你应该会看到一个提供一些选项的界面,例如添加世界时钟、设置闹钟、使用秒表和计时器。 +启动程序,你应该会看到一个界面,提供一些选项,例如添加世界时钟、设置闹钟、使用秒表和计时器。 -单击左上角的 + 号,它将为你提供搜索地理位置的选项。搜索,选择并添加。 +单击左上角的 “+” 号,它将为你提供搜索地理位置的选项。搜索、选择并添加。 ![Adding additional clocks][7] @@ -56,13 +58,13 @@ sudo apt install gnome-clocks ![Multiple clocks for multiple time zones][8] -你可以使用 Super + M 键快速打开消息托盘。你可以掌握这些[有用的 Ubuntu 快捷方式][9]来节省时间。 +你可以使用 `Super + M` 键快速打开消息托盘。你可以掌握这些[有用的 Ubuntu 快捷方式][9]来节省时间。 如果要删除其他时钟,你可以从 GNOME Clocks 应用界面执行以下操作: ![Remove Additional Clocks][10] -你无法删除当前时区并设置为其他时区。有其他方法[更改 Linux 中的当前时区][11]。 +你无法(在这里)删除当前时区并设置为其他时区。有其他方法[更改 Linux 中的当前时区][11]。 我希望你喜欢这个快速技巧。欢迎提出问题和建议。 @@ -73,7 +75,7 @@ via: https://itsfoss.com/add-multiple-time-zones-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a424681b9f925b22ab193d4952064b878b31886b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Apr 2020 14:21:39 +0800 Subject: [PATCH 0348/1809] PUB @geekpi https://linux.cn/article-12121-1.html --- .../20200413 How to Add Multiple Time Zones in Ubuntu.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200413 How to Add Multiple Time Zones in Ubuntu.md (98%) diff --git a/translated/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md b/published/20200413 How to Add Multiple Time Zones in Ubuntu.md similarity index 98% rename from translated/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md rename to published/20200413 How to Add Multiple Time Zones in Ubuntu.md index 0260e1327d..8cd0619343 100644 --- a/translated/tech/20200413 How to Add Multiple Time Zones in Ubuntu.md +++ b/published/20200413 How to Add Multiple Time Zones in Ubuntu.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12121-1.html) [#]: subject: (How to Add Multiple Time Zones in Ubuntu) [#]: via: (https://itsfoss.com/add-multiple-time-zones-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 3f4a6b9c256de84b2b8d96d0e7b03a9b55646bb6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Apr 2020 15:16:39 +0800 Subject: [PATCH 0349/1809] PRF @wxy --- ...live Linux history with the ROX desktop.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20191216 Relive Linux history with the ROX desktop.md b/translated/tech/20191216 Relive Linux history with the ROX desktop.md index 42b9c52dde..c618f9c4de 100644 --- a/translated/tech/20191216 Relive Linux history with the ROX desktop.md +++ b/translated/tech/20191216 Relive Linux history with the ROX desktop.md @@ -1,30 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Relive Linux history with the ROX desktop) [#]: via: (https://opensource.com/article/19/12/linux-rox-desktop) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -用 ROX 桌面版重温 Linux 历史 +用 ROX 桌面重温 Linux 历史 ====== > 这篇文章是 Linux 桌面 24 天特别系列的一部分。如果你想来一次有趣的时光之旅,ROX 桌面非常值得一试。 -![Person typing on a 1980's computer][1] +![](https://img.linux.net.cn/data/attachment/album/202004/18/151533n196wag64gwhs0ga.jpg) -[ROX][2] 桌面已经不再积极开发,而它的遗留问题至今仍然存在,即使在它活跃开发的时候,它也是一个另类的 Linux 桌面。当其他的桌面感觉与旧的 Unix 或 Windows 界面大致相似时,ROX 则属于 BeOS、AmigaOS 和 [RISC OS][3] 桌面阵营。 +[ROX][2] 桌面已经不再积极开发,而它的遗留问题至今仍然存在,但即使在它活跃开发的时候,它也是一个另类的 Linux 桌面。当其他的桌面感觉与旧式的 Unix 或 Windows 界面大致相似时,ROX 则属于 BeOS、AmigaOS 和 [RISC OS][3] 桌面阵营。 它专注于拖放式操作(这使得它的可访问性对某些用户来说并不理想)、点击式操作、弹出式上下文菜单,以及一个独特的应用程序目录系统,无需安装即可运行本地应用程序。 ### 安装 ROX -如今,ROX 基本上都被遗弃了,只剩下一点残渣碎片留给用户自己去收集整理。幸运的是,这个难题相对来说比较容易解决,但是当你在发行版的软件仓库中找到 ROX 桌面的碎片时,不要被迷惑了,因为那并不是 ROX 桌面所有的碎片。ROX 常用的部分 —— 文件管理器([ROX-Filer][4])和终端([ROXTerm][5]) —— 似乎在大多数流行的发行版软件仓库中都有存在,你可以将它们作为独立的应用程序安装(和使用)。然而,要运行 ROX 桌面,你必须同时安装 ROX-Session 和它所依赖的库。 +如今,ROX 基本上都被遗弃了,只剩下一点残渣碎片留给用户自己去收集整理。幸运的是,这个难题相对来说比较容易解决,但是当你在发行版的软件仓库中找到 ROX 桌面的碎片时,不要被迷惑了,因为那并不是 ROX 桌面全部的碎片。ROX 常用的部分 —— 文件管理器([ROX-Filer][4])和终端([ROXTerm][5]) —— 似乎在大多数流行的发行版软件仓库中都有存在,你可以将它们作为独立的应用程序安装(并使用)。然而,要运行 ROX 桌面,你必须同时安装 ROX-Session 和它所依赖的库。 我在 Slackware 14.2 上安装了 ROX,但它应该可以在任何 Linux 或 BSD 系统上运行。 -首先,你必须从其版本库中安装 [ROX-lib2][6]。按照它的理念,你要安装 ROX-lib2,只需下载tarball、[解压][7],然后将 `ROX-lib` 目录移动到 `/usr/local/lib` 下。 +首先,你必须从其版本库中安装 [ROX-lib2][6]。你要安装 ROX-lib2,按照它的理念,只需下载tarball、[解压][7],然后将 `ROX-lib` 目录移动到 `/usr/local/lib` 下就行。 接下来,你要安装 [ROX-Session][8]。这可能需要从源码中编译,因为它很可能不在你的软件仓库中。编译过程需要编译工具,这些工具在 Slackware 上是默认提供的,但在其他发行版中往往会被省略,以节省初始下载空间。根据你的发行版不同,你必须安装的包的名称也不同,所以请参考文档来了解具体内容。例如,在 Debian 发行版中,你可以在 [Debian 的 wiki][9] 中了解构建需求,而在 Fedora 发行版中,请参考 [Fedora 的文档][10]。安装了构建工具后,执行自定义的 ROX-Session 构建脚本。 @@ -36,7 +36,7 @@ $ ./AppRun 如果你还没有从你的软件库中安装 ROX-Filer,请在继续之前安装。 -这些组件共同组成了一个完整的 ROX 桌面。要登录到新桌面,请从当前桌面会话中注销。默认情况下,你的会话管理器(KDM、GDM、LightDM 或 XDM,视你的设置而定)会继续登录到您之前的桌面,所以在登录前必须覆盖。 +这些组件共同组成了一个完整的 ROX 桌面。要登录到新桌面,请从当前桌面会话中注销。默认情况下,你的会话管理器(KDM、GDM、LightDM 或 XDM,视你的设置而定)会继续登录到你之前的桌面,所以在登录前必须覆盖。 使用 SDDM: @@ -46,9 +46,9 @@ $ ./AppRun ![][12] -### ROX桌面特性 +### ROX 桌面特性 -ROX 桌面默认情况下很简单,屏幕底部有一个面板,桌面上有一个通往主目录的快捷方式图标。面板中包含了一些常用位置的快捷方式。这就是 ROX 桌面的全部功能,至少在安装后就是这样。如果你想要时钟或日历或系统托盘,你需要找到提供这些功能的应用程序。 +ROX 桌面默认情况下很简单,屏幕底部有一个面板,桌面上有一个通往主目录的快捷方式图标。面板中包含了一些常用位置的快捷方式。这就是 ROX 桌面的全部功能,至少在安装后就是这样。如果你想要时钟、日历或系统托盘,你需要找到提供这些功能的应用程序。 ![Default ROX desktop][13] @@ -56,7 +56,7 @@ ROX 桌面默认情况下很简单,屏幕底部有一个面板,桌面上有 面板也可以进行一些修改。你可以在其中放置不同的快捷方式,甚至可以创建自己的小程序。 -没有应用菜单,也没有上下文菜单中的应用快捷方式。相反,你可以手动导航到 `/usr/share/applications`,或者你可以将你的应用目录或目录添加到 ROX 面板中。 +它没有应用菜单,也没有上下文菜单中的应用快捷方式。相反,你可以手动导航到 `/usr/share/applications`,或者你可以将你的应用目录或目录添加到 ROX 面板中。 ![ROX desktop][14] @@ -64,9 +64,9 @@ ROX 桌面的工作流程集中在鼠标驱动上,让人联想到 Mac OS 7.5 ### 应用程序目录、AppRun 和 AppImage -ROX 桌面有一个优雅的惯例,在这个惯例中,包含一个名为 `AppRun` 的脚本的目录就可以像一个应用程序一样被执行。这意味着,要制作一个 ROX 应用程序,你所要做的就是将代码编译到一个目录中,将一个名为`AppRun` 的脚本放在该目录的根目录下,执行你所编译的二进制文件,然后将该目录标记为可执行。ROX-Filer 会按照你设置的方式来显示一个目录,并以特殊的图标和颜色显示一个目录。当你点击一个应用程序目录,ROX-Filer 会自动运行里面的 `AppRun` 脚本。它的外观和行为就像一个已经安装好的应用程序,但它是在用户的主目录下的本地目录,不需要特殊的权限。 +ROX 桌面有一个优雅的惯例,按照此惯例,包含一个名为 `AppRun` 的脚本的目录就可以像一个应用程序一样被执行。这意味着,要制作一个 ROX 应用程序,你所要做的就是将代码编译到一个目录中,将一个名为`AppRun` 的脚本放在该目录的根目录下,来执行你所编译的二进制文件,然后将该目录标记为可执行即可。ROX-Filer 会按照你设置的方式来显示一个目录,并以特殊的图标和颜色显示一个目录。当你点击一个应用程序目录,ROX-Filer 会自动运行里面的 `AppRun` 脚本。它的外观和行为就像一个已经安装好的应用程序,但它是在用户的主目录下的本地目录,不需要特殊的权限。 -这是一个方便的功能,但它是那些你使用时感觉很好的小功能之一,因为它很容易做到。它绝不是必要的,它只是比在本地建立一个应用程序,将目录隐藏在某个不显眼的地方,并建立一个快速的 `.desktop` 文件作为你的启动器,要领先了几步。然而,应用程序目录的概念已经当做灵感被 [AppImage][16] 打包系统所 [借鉴][15] 。 +这是一个方便的功能,但它是那些你使用时感觉很好的小功能之一,因为它很容易做到。它绝不是必要的,它只是比在本地建立一个应用程序,将目录隐藏在某个不显眼的地方,并建立一个快速的 `.desktop` 文件作为你的启动器,要领先了几步。然而,应用程序目录的概念已经当做灵感被 [AppImage][16] 打包系统所 [借鉴][15]。 ### 为什么应该试试 ROX 桌面 @@ -79,7 +79,7 @@ via: https://opensource.com/article/19/12/linux-rox-desktop 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 975ab0e347c6ac6c7bb2ff87b90069b31943db3a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Apr 2020 15:17:08 +0800 Subject: [PATCH 0350/1809] PUB @wxy https://linux.cn/article-12123-1.html --- .../20191216 Relive Linux history with the ROX desktop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191216 Relive Linux history with the ROX desktop.md (99%) diff --git a/translated/tech/20191216 Relive Linux history with the ROX desktop.md b/published/20191216 Relive Linux history with the ROX desktop.md similarity index 99% rename from translated/tech/20191216 Relive Linux history with the ROX desktop.md rename to published/20191216 Relive Linux history with the ROX desktop.md index c618f9c4de..72c2993473 100644 --- a/translated/tech/20191216 Relive Linux history with the ROX desktop.md +++ b/published/20191216 Relive Linux history with the ROX desktop.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12123-1.html) [#]: subject: (Relive Linux history with the ROX desktop) [#]: via: (https://opensource.com/article/19/12/linux-rox-desktop) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 202a1001a4cc162307cb79c9314e1395e554f92f Mon Sep 17 00:00:00 2001 From: Zioyi Date: Sat, 18 Apr 2020 16:43:52 +0800 Subject: [PATCH 0351/1809] Update 20200417 12 Linux Commands to Have Some Fun in the Terminal.md translating by Zioyi --- ...200417 12 Linux Commands to Have Some Fun in the Terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md b/sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md index 9c7843ea59..81c05aa211 100644 --- a/sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md +++ b/sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Zioyi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 57e6faf796e5f802c41f156c97c33eef3a13c73c Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Sat, 18 Apr 2020 19:50:53 +0800 Subject: [PATCH 0352/1809] TSL 20200228 Getting started with Linux firewalls --- ...28 Getting started with Linux firewalls.md | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/translated/tech/20200228 Getting started with Linux firewalls.md b/translated/tech/20200228 Getting started with Linux firewalls.md index bc5d20732a..93cc37289e 100644 --- a/translated/tech/20200228 Getting started with Linux firewalls.md +++ b/translated/tech/20200228 Getting started with Linux firewalls.md @@ -1,22 +1,22 @@ -[#]: collector: "lujun9972" -[#]: translator: "lxbwolf" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " -[#]: subject: "Getting started with Linux firewalls" -[#]: via: "https://opensource.com/article/20/2/firewall-cheat-sheet" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Linux firewalls) +[#]: via: (https://opensource.com/article/20/2/firewall-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) Linux 防火墙入门教程 ====== 防火墙是你的计算机防止网络入侵的第一道屏障。为确保你的安全,请下载我们的备忘单。 ![Cheat Sheet cover image][1] -合理的防火墙是你的计算机防止网络入侵的第一道屏障。你在家里上网,通常互联网服务提供会在路由中搭建了一层防火墙。如果不在家里上网,那么你计算机上的那层防火墙就是仅有的一层,因为配置和控制好你 Linux 电脑上的防火墙很重要。如果你维护一台 Linux 服务器,知道怎么去管理你的防火墙同样重要,只要掌握了这些知识你才能保护你的服务器免于本地或远程非法流量的入侵。 +合理的防火墙是你的计算机防止网络入侵的第一道屏障。你在家里上网,通常互联网服务提供会在路由中搭建一层防火墙。如果不在家里上网,那么你计算机上的那层防火墙就是仅有的一层,因为配置和控制好你 Linux 电脑上的防火墙很重要。如果你维护一台 Linux 服务器,知道怎么去管理你的防火墙同样重要,只要掌握了这些知识你才能保护你的服务器免于本地或远程非法流量的入侵。 ### 安装防火墙 -很多 Linux 发行版本已经自带了防火墙,通常是 `iptables`。它很有效并可以自定义,但配置起来有点复杂。幸运的是,有开发者写出了一些前端界面来帮助用户不需要写冗长的 iptables 规则就可以控制防火墙。 +很多 Linux 发行版本已经自带了防火墙,通常是 `iptables`。它很强大并可以自定义,但配置起来有点复杂。幸运的是,有开发者写出了一些前端界面来帮助用户不需要写冗长的 iptables 规则就可以控制防火墙。 在 Fedora,CentOS,Red Hat 和一些类似的发行版本上,默认安装的防火墙软件是 `firewalld`,是用 **firewall-cmd** 命令来配置和控制的。在 Debian 和大部分其他发行版上,可以从你的软件仓库安装 firewalld。Ubuntu 自带的是 Uncomplicated Firewall(ufw),所以你必须打开 **universe** 库才能使用 firewalld: @@ -46,17 +46,17 @@ $ sudo apt install firewalld Firewalld 旨在让防火墙的配置工作尽可能简单。它通过建立 *zone* 来实现这个目标。一个 zone 是一类型的合理、通用的规则,这些规则适配大部分用户的日常需求。 - * **trusted:** All network connections are accepted. This is the least paranoid firewall setting and should only be used in a trusted environment, such as a test lab or in a family home where everyone on the local network is known to be friendly. - * **home, work, internal:** In these three zones, most incoming connections are accepted. They each exclude traffic on ports that usually expect no activity. Any of them is a reasonable setting for use in a home setting where there is no reason to expect network traffic to obscure ports, and you generally trust the other users on the network. - * **public:** For use in public areas. This is a paranoid setting, intended for times when you do not trust other computers on the network. Only selected common and mostly safe incoming connections are accepted. - * **dmz:** DMZ stands for demilitarized zone. This zone is intended for computers that are publically accessible, located on an organization's external network with limited access to the internal network. For personal computers, this is usually not a useful zone, but it is an important option for certain types of servers. - * **external:** For use on external networks with masquerading enabled (meaning the addresses of your private network are mapped to and hidden behind a public IP address). Similar to the dmz zone, only selected incoming connections are accepted, including SSH. - * **block:** Only network connections initiated within this system are possible, and all incoming network connections are rejected with an **icmp-host-prohibited** message. This is an extremely paranoid setting and is an important option for certain types of servers or personal computers in an untrusted or hostile environment. - * **drop:** Any and all incoming network packets are dropped with no reply. Only outgoing network connections are possible. The only setting more paranoid than this one is turning off your WiFi and unplugging your Ethernet cable. + * **trusted:** 接受所有的连接。这是最低级别的防火墙设置,只能在一个完全信任的环境中,如测试实验室或网络中相互都认识的家庭网络中。 + * **home, work, internal: **在这三个 zone 中,接受大部分来的连接。它们每个都会拒绝不活跃的端口进来的流量。这三个都适合用于家庭环境中,因为在家庭环境中不会出现端口模糊的网络流量,在家庭网络中你可以基本信任其他的用户。 + * **public:** 用于公共区域内。这是个极端的设置,当你不信任网络中的其他计算机时使用。只能接收经过选择的和基本安全的连接。 + * **dmz:** DMZ 表示隔离区。这个 zone 多用于可公开访问的计算机,属于某个组织的外部网络不能完全访问内网的计算机。对于个人计算机,它没什么用,但是对某类服务器来说它是个很重要的选项。 + * **external:** 用于外部网络,会开启伪装(你私人网络的地址被映射到一个外网 IP 地址,并隐藏起来)。跟 DMZ 类似,仅接受经过选择的连接,包括 SSH。 + * **block:** 仅接收在本系统中初始化的网络连接。接收到的任何网络连接都会被 **icmp-host-prohibited** 信息拒绝。这个一个极度偏激的设置,对于某类服务器或处于不信任或不安全的环境中的个人计算机来说很重要。 + * **drop:** 接收的所有网络包都被丢弃,没有任何回复。仅能有发送出去的网络连接。比这个设置更极端的办法,只有关闭 WiFi 和拔掉网线。 -You can read about each zone and any other zones defined by your distribution or sysadmin by looking at the configuration files in **/usr/lib/firewalld/zones**. For instance, here's the FedoraWorkstation zone that ships with Fedora 31: +你可以查看你发行版本的所有 zone,或通过配置文件 **/usr/lib/firewalld/zones** 来查看管理员设置。举个例子:下面是 Fefora 31 自带的 FedoraWorkstation zone: ``` @@ -73,16 +73,16 @@ $ cat /usr/lib/firewalld/zones/FedoraWorkstation.xml </zone> ``` -### Getting your current zone +### 获取当前的 zone -You can see what zone you're in at any time with the **\--get-active-zones** option: +任何时候你都可以通过 **\--get-active-zones** 选项来查看你是在哪个 zone ``` `$ sudo firewall-cmd --get-active-zones` ``` -In response, you receive the name of the active zone along with the network interface assigned to it. On a laptop, that usually means you have a WiFi card in the default zone: +输出结果中,会有当前活跃的 zone 名字和分配给它的网络接口。笔记本电脑上,在默认 zone 中通常意味着你有个 WiFi 卡: ``` @@ -90,9 +90,9 @@ FedoraWorkstation   interfaces: wlp61s0 ``` -### Change your current zone +### 修改你当前的 zone -To change your zone, reassign your network interface to a different zone. For instance, to change the example **wlp61s0** card to the public zone: +把你的网络接口分配给另一个 zone,就可以改变 zone。例如,把例子中的 **wlp61s0** 卡修改为 public zone: ``` @@ -100,15 +100,15 @@ $ sudo firewall-cmd --change-interface=wlp61s0 \ \--zone=public ``` -You can change the active zone for an interface any time you please and for any reason—whether you're going out to a café and feel the need to increase your laptop's security policy, or you're going to work and need to open up some ports to get on the intranet, or for any other reason. The options for **firewall-cmd** auto-complete when you press the **Tab** key, so as long as you remember the keywords "change" and "zone," you can stumble through the command until you learn it by memory. +你可以为一个接口修改活跃的 zone,不管出于什么理由 — 无论你是要出去喝杯咖啡还是感觉有必要增强笔记本电脑的安全策略,无论是你要去工作需要开启某些端口才能进入内联网,还是任何其他的理由。在你凭记忆学会 **firewall-cmd** 命令之前,你只要记住了关键词 ”change“ 和 ”zone“,就可以慢慢掌握,因为按下 **Tab** 时,它的选项会自动补全。 -### Learn more +### 更多信息 -There's a lot more you can do with your firewall, including customizing existing zones, setting a default zone, and more. The more comfortable with firewalls you get, the more secure your online activities are, so we've created a [cheat sheet][2] for quick and easy reference. +你可以用你的防火墙干更多的事,比如自定义已存在的 zone,设置默认的 zone,等等。你对防火墙越了解,你在网上的活动就越安全,所以我们创建了一个[备忘单][2]便于速查和参考。 -### Download your [firewall cheat sheet][2] +### 下载你的 [防火墙备忘单][2] -David Both shares how he replaced his dedicated network firewall computer with a Raspberry Pi 2. +David Both分享了他是怎样用树莓派 2 替换他的专用网络防火墙电脑的。 -------------------------------------------------------------------------------- @@ -116,12 +116,12 @@ via: https://opensource.com/article/20/2/firewall-cheat-sheet 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[lxbwolf](https://github.com/lxbwolf) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coverimage_cheat_sheet.png?itok=lYkNKieP "Cheat Sheet cover image" +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image) [2]: https://opensource.com/downloads/firewall-cmd-cheat-sheet From 65a1e7c7d87f9308672b223a59a2fab4db9441a1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Apr 2020 20:55:21 +0800 Subject: [PATCH 0353/1809] PRF @geekpi --- ...Which Desktop Environment You are Using.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/translated/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md b/translated/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md index 4345d5cff8..dcee63114b 100644 --- a/translated/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md +++ b/translated/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md @@ -1,26 +1,26 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Here’s How to Find Out Which Desktop Environment You are Using) [#]: via: (https://itsfoss.com/find-desktop-environment/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -这是找出你所使用的桌面环境的方法 +如何找出你所使用的桌面环境 ====== 如果你是 Linux 新用户,并在一个 Linux 论坛中寻求帮助,那么你可能会被问以下问题: -_**“你使用的是哪个桌面环境?”**_ +> “你使用的是哪个桌面环境?” -你知道什么是桌面环境,但你如何知道你使用的是哪一个?我会告诉你如何找到它。我将首先展示命令行方法,因为这适用于[各种 Linux 发行版][1]。我还将展示如何通过图形方式获得。 +你知道什么是桌面环境desktop environment(DE),但你如何知道你使用的是哪一个?我会告诉你如何找到它。我将首先展示命令行方法,因为这适用于[各种 Linux 发行版][1]。我还将展示如何通过图形方式获得。 ### 检查你使用的是哪个桌面环境 ![][2] -你可以[在 Linux 中使用 echo 命令][3]在终端中显示 XDG_CURRENT_DESKTOP 变量的值。 +你可以[在 Linux 中使用 echo 命令][3]在终端中显示 `XDG_CURRENT_DESKTOP` 变量的值。 打开终端并复制粘贴此命令: @@ -37,15 +37,15 @@ ubuntu:GNOME 尽管此命令可以快速告诉你正在使用哪个桌面环境,但它不会提供任何其他信息。 -在某些情况下,了解桌面环境版本(也称为 DE)可能很重要。软件的每个新版本都会带来新功能或删除某些功能。[GNOME 3.36][6] 引入了“请勿打扰”选项,以关闭所有桌面通知。 +在某些情况下,了解桌面环境版本可能很重要。软件的每个新版本都会带来新功能或删除某些功能。[GNOME 3.36][6] 引入了“请勿打扰”选项,以关闭所有桌面通知。 -假设你了解了此新的“请勿打扰”功能。你确认自己正在使用 GNOME,但是在 GNOME 桌面上看不到此选项。如果你可以检查系统上已安装的 GNOME 桌面版本,那么这会很清楚。 +假设你了解了这个新的“请勿打扰”功能。你确认自己正在使用 GNOME,但是在 GNOME 桌面上看不到此选项。如果你可以检查系统上已安装的 GNOME 桌面版本,那么这会很清楚。 我将先向你展示命令检查桌面环境版本,因为你可以在任何运行桌面环境的 Linux 中使用它。 ### 如何获取桌面环境版本 -与获取桌面环境的名称不同。获取其版本号并不直接,因为它没有标准的命令或环境变量可以提供此信息。 +与获取桌面环境的名称不同。获取其版本号的方法并不直接,因为它没有标准的命令或环境变量可以提供此信息。 在 Linux 中获取桌面环境信息的一种方法是使用 [Screenfetch][7] 之类的工具。此[命令行工具以 ascii 格式显示 Linux 发行版的 logo][8] 以及一些基本的系统信息。桌面环境版本就是其中之一。 @@ -57,7 +57,7 @@ sudo apt install screenfetch 对于其他 Linux 发行版,请使用系统的软件包管理器来安装此程序。 -安装后,只需在终端中输入 screenfetch 即可,它应该显示桌面环境版本以及其他系统信息。 +安装后,只需在终端中输入 `screenfetch` 即可,它应该显示桌面环境版本以及其他系统信息。 ![Check Desktop Environment Version][10] @@ -67,7 +67,7 @@ sudo apt install screenfetch ### 使用 GUI 检查桌面环境版本 -几乎所有桌面环境在其 “Settings-About” 部分中都提供了基本的系统详细信息。 +几乎所有桌面环境在其 “Settings”->“About” 部分中都提供了基本的系统详细信息。 一个主要问题是,大多数桌面环境看起来都不同,因此我无法展示每个桌面环境的确切步骤。我将展示 GNOME 的,让你在桌面上发现它。 @@ -90,7 +90,7 @@ via: https://itsfoss.com/find-desktop-environment/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0bfddc4995b1829ceb4ea9d055842ffffea288ef Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Apr 2020 20:58:30 +0800 Subject: [PATCH 0354/1809] PUB @geekpi https://linux.cn/article-12124-1.html --- ...How to Find Out Which Desktop Environment You are Using.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md (98%) diff --git a/translated/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md b/published/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md similarity index 98% rename from translated/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md rename to published/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md index dcee63114b..963a64f356 100644 --- a/translated/tech/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md +++ b/published/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12124-1.html) [#]: subject: (Here’s How to Find Out Which Desktop Environment You are Using) [#]: via: (https://itsfoss.com/find-desktop-environment/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From a7a8682e9f327983eb80bc6a57a173000190948f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Apr 2020 22:51:14 +0800 Subject: [PATCH 0355/1809] PRF @mr-ping --- ... Ways To Update Linux Kernel For Ubuntu.md | 129 ++++++++---------- 1 file changed, 60 insertions(+), 69 deletions(-) diff --git a/translated/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md b/translated/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md index fbc0c67658..ed7bfc2489 100644 --- a/translated/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md +++ b/translated/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md @@ -1,42 +1,41 @@ [#]: collector: "lujun9972" [#]: translator: "mr-ping" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "Different Ways To Update Linux Kernel For Ubuntu" [#]: via: "https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/" [#]: author: "SK https://www.ostechnix.com/author/sk/" - -升级Ubuntu Linux核心的几种不同方法 +升级 Ubuntu Linux 内核的几种不同方法 ====== ![](https://www.ostechnix.com/wp-content/uploads/2019/01/ubuntu-linux-kernel-720x340.png) -这个指南里介绍了7种为Ubuntu升级Linux核心的不同方法。这7种方法里,有5种需要重启系统来使新核心生效,其他两种则不用。升级之前,**强烈建议您将重要数据进行备份!** 这里提到的所有方法只在Ubuntu中测试过。我们并不确定这些方法是不是也能适用于其他Ubuntu的特色发行版(如:Xubuntu)和衍生发行版(如:Linux Mint)。 +这个指南里介绍了 7 种为 Ubuntu 升级 Linux 内核的不同方法。这 7 种方法里,有 5 种需要重启系统来使新内核生效,其他两种则不用。升级之前,**强烈建议你将重要数据进行备份!** 这里提到的所有方法只在 Ubuntu 中测试过。我们并不确定这些方法是不是也能适用于其他 Ubuntu 的特色发行版(如: Xubuntu)和衍生发行版(如:Linux Mint)。 -### 第一部分: 需要重启的核心升级 +### 第一部分:需要重启的内核升级 -以下方法需要您重启系统以便新的核心生效。所有方法都建议在个人系统或测试系统中进行。重要的事儿再说一遍,请备份好您Ubuntu中的重要数据、配置文件和其他重要的东西。 +以下方法需要你重启系统以便新的内核生效。以下所有方法都建议在个人系统或测试系统中进行。重要的事儿再说一遍,请备份好你 Ubuntu 中的重要数据、配置文件和其他重要的东西。 -### 方法1 - 使用dpkg升级Linux核心(手动方式) +#### 方法 1 - 使用 dpkg 升级 Linux 内核(手动方式) -这个方法里会帮助你手动从**[kernel.ubuntu.com][1]**网站下载可用的最新Linux核心。如果你打算安装最新版(而不是稳定版或者正式发布版),那这种方法对你会很有用。从以上链接下载Linux核心版本。编写这个指南的时候,最新的可用版本是**5.0-rc1**,最新的稳定版是**v4.20**. +这个方法可以帮助你从 [kernel.ubuntu.com][1] 网站手动下载可用的最新 Linux 内核。如果你打算安装最新版(而不是稳定版或者正式发布版),那这种方法对你会很有用。从以上链接下载 Linux 内核版本。编写这个指南的时候,最新的可用版本是 **5.0-rc1**,最新的稳定版是 **v4.20**。 ![][3] -基于你的选择,点击相应的Linux核心版本链接,找到你对应的架构(‘Build for XXX’)的那部分。然后下载符合以下格式的两个文件(其中 X.Y.Z 是最高版本号): +点击你所选择的 Linux 内核版本链接,找到你对应的架构(“Build for XXX”)的那部分。然后下载符合以下格式的两个文件(其中 X.Y.Z 是最高版本号): 1. linux-image-*X.Y.Z*-generic-*.deb 2. linux-modules-X.Y.Z*-generic-*.deb -在终端中修改文件所在的目录,然后执行命令,手动安装核心: +在终端中改变到文件所在的目录,然后执行此命令手动安装内核: ``` $ sudo dpkg --install *.deb ``` -重启系统,使用新核心: +重启系统,使用新内核: ``` $ sudo reboot @@ -48,29 +47,28 @@ $ sudo reboot $ uname -r ``` -对于分步的说明,请查看以下名为“Install Linux Kernel 4.15 LTS On DEB based systems”的文章。 +对于分步的说明,请查看下列链接中对应的部分。 -+ [Install Linux Kernel 4.15 In RPM And DEB Based Systems](https://www.ostechnix.com/install-linux-kernel-4-15-rpm-deb-based-systems/) ++ [在基于 RPM 和 DEB 的系统中安装 Linux 内核 4.15](https://www.ostechnix.com/install-linux-kernel-4-15-rpm-deb-based-systems/) -以上的指南是针对的是4.15版本,不过安装最新版本的所有的步骤都是一样的。 +以上的指南是针对的是 4.15 版本,不过安装最新版本的所有的步骤都是一样的。 -**优势:** 不必联网(你可以从任何系统中下载Linux核心来使用) +**优势:** 不必联网(你可以从任何系统中下载 Linux 内核来使用) **缺点:** 手动更新,需要重启系统。 -#### 方法2 - 用apt-get来升级Linux核心(推荐方法) +#### 方法 2 - 用 apt-get 来升级 Linux 内核(推荐方法) -这是在类Ubuntu系统中升级Linux核心的推荐方法。不同于上一个方法,这种方法会从Ubuntu官方仓库下载、安装核心版本而不是从 **kernel.ubuntu.com**网站。 +这是在类 Ubuntu 系统中升级 Linux 内核的推荐方法。不同于上一个方法,这种方法会从 Ubuntu 官方仓库下载、安装内核版本,而不是从 **kernel.ubuntu.com**网站。 -要升级包括核心的整个系统,只需要执行: +要升级包括内核的整个系统,只需要执行: ``` $ sudo apt-get update - $ sudo apt-get upgrade ``` -如果只希望升级核心,运行: +如果只希望升级内核,运行: ``` $ sudo apt-get upgrade linux-image-generic @@ -80,117 +78,112 @@ $ sudo apt-get upgrade linux-image-generic **缺点:** 需要联网,需要重启。 -从官方库中升级核心是最接近开箱即用的方法,并且不会出什么问题。如果是生产环境的系统,这是最为推荐的升级Linux核心的方法。 +从官方库中升级内核是最接近开箱即用的方法,并且不会出什么问题。如果是生产环境的系统,这是最为推荐的升级 Linux 内核的方法。 -方法1和方法2都需要用户去介入到升级Linux核心的过程中。而下边的方法(3、 4、 5)则几乎是全自动的。 +方法 1 和方法 2 都需要用户去介入到升级 Linux 内核的过程中。而下边的方法(3、 4、 5)则几乎是全自动的。 -#### 方法3 - 使用Ukuu升级Linux核心 +#### 方法 3 - 使用 Ukuu 升级 Linux 内核 -**Ukuu**是一个用于从**kernel.ubuntu.com**下载Linux核心,并且将其自动安装到Ubuntu桌面系统和服务器系统中的Gtk图形化界面和命令行工具。Ukku并不是单单简化了手动下载、安装新核心的过程,同时也会帮助你移除旧的和不再需要的核心。更多细节可以参照以下指南。 +**Ukuu**是一个 Gtk GUI 和命令行工具,它可以从 kernel.ubuntu.com 下载最新的 Linux 主线内核,并自动安装到你的 Ubuntu 桌面版和服务器版中。Ukku 不仅简化了手动下载和安装新内核的过程,同时也会帮助你安全地移除旧的和不再需要的内核。更多细节可以参照以下指南。 -+ [Ukuu – An Easy Way To Install And Upgrade Linux Kernel In Ubuntu-based Systems](https://www.ostechnix.com/ukuu-an-easy-way-to-install-and-upgrade-linux-kernel-in-ubuntu-based-systems/) ++ [Ukuu:在 Ubuntu 系统中安装和升级 Linux 内核的简单方法](https://www.ostechnix.com/ukuu-an-easy-way-to-install-and-upgrade-linux-kernel-in-ubuntu-based-systems/) -**优势:** 易于安装使用。自动安装主线核心。 +**优势:** 易于安装使用。自动安装主线内核。 **缺点:** 需要联网,需要重启。 -#### 方法4 - 使用UKTools升级Linux核心 +#### 方法 4 - 使用 UKTools 升级 Linux 内核 -跟Ukuu差不多,**UKTools**也会从**kernel.ubuntu.com**网站获取最新的核心并且自动安装到Ubuntu以及类似于Linux Mint的延伸发行版中。 +跟 Ukuu 差不多,**UKTools** 也会从 kernel.ubuntu.com 网站获取最新的稳定内核并且自动安装到 Ubuntu 以及类似于 Linux Mint 的延伸发行版中。关于UKTools的更多详情,请参见下面的链接。 -+ [UKTools – Upgrade Latest Linux Kernel In Ubuntu And Derivatives](https://www.ostechnix.com/uktools-upgrade-latest-linux-kernel-in-ubuntu-and-derivatives/) ++ [UKTools:升级Ubuntu及其衍生产品中的最新Linux内核](https://www.ostechnix.com/uktools-upgrade-latest-linux-kernel-in-ubuntu-and-derivatives/) -**优势:** 简单,自动 +**优势:** 简单,自动。 **缺点:** 需要联网,需要重启。 -#### 方法5 - 使用Linux核心工具集(Linux Kernel Utilities)安装Linux核心 +#### 方法 5 - 使用 Linux 内核实用程序更新 Linux 内核 -**Linux Kernel Utilities**是目前另一个用于升级类Ubuntu系统Linux核心的程序。实质上,它是一个由一系列Bash脚本构成的合集,用于编译并且可以选择性地为Debian(译者注:Ubuntu的上游发行版)及其衍生发行版升级核心。它包含三个工具集,一个用于手动编译、安装来自于 [**http://www.kernel.org**][4] 网站的源码核心,另一个用于安装来自****网站的事先编译好的核心,第三个脚本用于移除旧核心。更多细节请浏览以下链接。 +**Linux 内核实用程序**是目前另一个用于升级类 Ubuntu 系统 Linux 内核的程序。实质上,它是一个由一系列 Bash 脚本构成的合集,用于编译并且可以选择性地为 Debian(LCTT 译注:Ubuntu 的上游发行版)及其衍生发行版升级内核。它包含三个实用程序,一个用于手动编译、安装来自于 [http://www.kernel.org][4] 网站的源码内核,另一个用于安装来自 网站的预编译的内核,第三个脚本用于移除旧内核。更多细节请浏览以下链接。 -+ [Linux Kernel Utilities – Scripts To Compile And Update Latest Linux Kernel For Debian And Derivatives](https://www.ostechnix.com/linux-kernel-utilities-scripts-compile-update-latest-linux-kernel-debian-derivatives/) ++ [Linux 内核实用程序:编译和更新最新的 Linux 内核的脚本,适用于 Debian 及其衍生产品](https://www.ostechnix.com/linux-kernel-utilities-scripts-compile-update-latest-linux-kernel-debian-derivatives/) -**优势:** 简单,自动 +**优势:** 简单,自动。 **缺点:** 需要联网,需要重启。 -### 第二部分 – Kernel Updates without reboot +### 第二部分:无需重启的内核升级 -我之前说过,上边所有的方法都需要你去重启服务器(译者注:也可以是桌面版)来启用新核心。如果是个人系统或者测试系统,可以这么办。但对于无法停机的生产环境系统该怎么办呢?一点问题没有,这时候**实时补丁(livepatching)**就派上用场了。 +我之前说过,上边所有的方法都需要你重启服务器(LCTT 译注:也可以是桌面版)来启用新内核。如果是个人系统或者测试系统,可以这么办。但对于无法停机的生产环境系统该怎么办呢?一点问题没有,这时候实时补丁livepatching就派上用场了。 -**实时补丁**(或者叫热补丁)允许你在不需要重启的情况下安装Linux升级或补丁来保证你的服务器处于最新的安全等级之下。这对web主机、游戏服务器这类需要不间断在线的服务器来说是很有价值的。事实上,任何情况下,服务器都应该保持在不间断运行的状态下。由于Linux供应商只会在出于修复安全漏洞的目的下维护补丁,所以如果安全性是你的点,这种方式再适合不过了。 +**实时补丁**(或者叫热补丁)允许你在不重启的情况下安装 Linux 更新或补丁,使你的服务器处于最新的安全级别。这对 web 主机、游戏服务器这类需要不间断在线的服务器来说是很有价值的。事实上,任何情况下,服务器都应该保持在不间断运行的状态下。由于 Linux 供应商只会在出于修复安全漏洞的目的下维护补丁,所以如果安全性是你最关注的问题时,这种方式再适合不过了。 -以下两种方法可以在不需要重启的情况下为生产环境和执行关键任务的Ubuntu服务器更新Linux核心。 +以下两种方法不需要重启,对于生产环境和执行关键任务的 Ubuntu 服务器的 Linux 内核更新非常有用。 -#### 方法6 – 使用Canonical实时补丁服务(Canonical Livepatch Service)来更新Linux核心 +#### 方法 6 – 使用 Canonical 实时补丁服务来更新 Linux 内核 ![][5] -[**Canonical Livepatch Service**][6] 可以在不需要重启Ubuntu系统的情况下执行核心升级、补丁和安全的热修复等操作,在减少服务器宕机的情况下保障其安全。Canonical Livepatch Service 可以在安装过程当中或安装之后尽心设置. 如果你使用的是Ubuntu桌面版,软件更新器会自动检查核心补丁的更新,并且通知你。在基于控制台的系统中,则需要你主动运行apt-get update命令来进行升级。由于需要你手动运行“apt-get upgrade”命令它才会安装核心的安全补丁,所以算是半自动的。 +[Canonical 实时补丁服务][6]可以在不需要重启 Ubuntu 系统的情况下自动应用内核更新、补丁和安全补丁。它可以减少Ubuntu系统的停机时间,并保证系统的安全。Canonical 实时补丁服务可以在安装过程当中或安装之后进行设置。如果你使用的是 Ubuntu 桌面版,软件更新器会自动检查内核补丁的更新,并通知你。在基于控制台的系统中,则需要你定期运行 `apt-get update` 命令来进行升级。由于需要你手动运行 `apt-get upgrade` 命令它才会安装内核的安全补丁,所以算是半自动的。 -Livepatch对三个及以下系统免费,如果多于三个,你需要升级成名为**Ubuntu Advantage**的企业支持方案套件。这个套件包括**Kernel Livepatching**及以下服务: +实时补丁对三个及以下系统免费,如果多于三个,你需要升级成名为 **Ubuntu Advantage** 的企业支持方案套件。这个套件包括 **Kernel 实时补丁**及以下服务: - * Extended Security Maintenance – Ubuntu生命周期后的重要安全更新 - * Landscape – 针对大规模使用Ubuntu的系统管理工具 - * Knowledge Base – 由Ubuntu专家撰写的私人文章和教程 + * 扩展安全维护 – Ubuntu 生命周期后的重要安全更新 + * Landscape – 针对大规模使用 Ubuntu 的系统管理工具 + * 知识库 – 由 Ubuntu 专家撰写的私人文章和教程 * 电话和网站支持 **价格** -Ubuntu Advantage包含三种付费计划, 必备(Essential), 标准(Standard)和 高级(Advanced).最基础的计划(Essential 计划)从 **单物理节点 225 美元/年**和**单VPS 75美元/年**开始计价。看上去应该不支持针对Ubuntu服务器版和桌面版的按月订阅。你可以在 [**此处**][7]浏览所有计划的细节信息。 +Ubuntu Advantage 包含三种付费计划,即基本计划、标准计划和高级计划。最基础的计划(基本计划)从 **单物理节点 225 美元/年**和**单VPS 75美元/年**开始计价。对于 Ubuntu 服务器版和桌面版看上去没有按月订阅。你可以在[此处][7]浏览所有计划的细节信息。 -**优势:** 简单。半自动化。无需重启。支持三个免费系统。 +**优势:** 简单。半自动化。无需重启。支持三个免费系统。 -**缺点:** 4个以上主机的话非常昂贵. 没有补丁回滚。 +**缺点:** 4 个以上主机的话非常昂贵。没有补丁回滚。 -**开启 Canonical Livepatch Service** +##### 开启 Canonical 实时补丁 如果你想在安装后设置实时补丁服务,依照以下方法逐步执行: -从 [**https://auth.livepatch.canonical.com/**][8] 获取一个秘钥. +从 [https://auth.livepatch.canonical.com/][8] 获取一个密钥。 ``` $ sudo snap install canonical-livepatch - $ sudo canonical-livepatch enable your-key ``` -#### 方法7- 使用KernelCare升级Linux内核 +#### 方法 7 - 使用 KernelCare 升级 Linux 内核 ![][9] -[**KernelCare**][10] 是所有实时补丁方案中最新的一个. 它是 [CloudLinux][11]推出的产品. KernelCare 可以运行在Ubuntu和其他的Linux特殊发行版中. 它每四个小时检查一遍补丁的发布,并在无需确认的情况下安装它们. 如果更新后存在问题,可以将补丁进行回滚。 +[KernelCare][10] 是最新的实时补丁方案。它是 [CloudLinux][11] 推出的产品。KernelCare 可以运行在 Ubuntu 和其他的 Linux 发行版中。它每四个小时检查一遍补丁的发布,并在无需确认的情况下安装它们。如果更新后存在问题,可以将补丁进行回滚。 **价格** -费用,每台服务器:**4 美元/月** , **45 美元/年**. +费用,每台服务器:**4 美元/月**,**45 美元/年**。 -跟Ubuntu Livepatch相比,kernelCare看起来非常便宜、实惠。好的方面在于**也可以按月订阅**。另一个前者不具备的功能是支持如Red Hat, CentOS, Debian, Oracle Linux, Amazon Linux 以及 OpenVZ, Proxmox 这种虚拟平台等等的其他Linux发行版。 +跟 Ubuntu 实时补丁相比,KernelCare 看起来非常便宜、实惠。好的方面在于**也可以按月订阅**。另一个前者不具备的功能是支持其他 Linux 发行版,如 Red Hat、CentOS、Debian、Oracle Linux、Amazon Linux 以及 OpenVZ、Proxmox 等虚拟化平台。 -你可以在 [**此处**][12] 了解KernelCare的所有特性和简介,以及所有的付费计划的细节。 +你可以在[此处][12]了解 KernelCare 的所有特性和简介,以及所有的付费计划的细节。 -**优势:** 简单。全自动化。范围更广的操作系统覆盖。补丁回滚。无需重启。对非盈利组织提供免费许可。价格低廉。 +**优势:** 简单。全自动化。覆盖范围更广的操作系统。补丁回滚。无需重启。对非营利组织提供免费许可。价格低廉。 -**缺点:** 除了30天试用外无免费计划。 +**缺点:** 不是免费的(除了30天的试用期)。 -**开启 KernelCare Service** +##### 开启 KernelCare 服务 -此处 [**https://cloudlinux.com/kernelcare-free-trial5**][14] 获取30天免费试用秘钥。 +在 [https://cloudlinux.com/kernelcare-free-trial5][14] 获取一个 30 天免费试用密钥。 -执行以下命令开启KernelCare并注册秘钥。 +执行以下命令开启 KernelCare 并注册秘钥。 ``` $ sudo wget -qq -O - https://repo.cloudlinux.com/kernelcare/kernelcare_install.sh | bash - $ sudo /usr/bin/kcarectl --register KEY ``` -如果你的目标是价格实惠,并且通过可靠的社区服务来保障你的Linux服务器核心的更新,那KernelCare是个不错的选择。 +如果你正在寻找一种经济实惠且可靠的商业服务来保持 Linux 服务器上的 Linux 内核更新,那么 KernelCare 是个不错的选择。 - -*由来自Cloud Linux的技术撰稿人和内容作者**Paul A. Jacobs**撰写。* - -**推荐阅读:** +*由来自 Cloud Linux 的技术撰稿人和内容作者 Paul A. Jacobs 提供。* 到此,希望这边文章能对你有所帮助。如果你觉得还有其他的工具和方法需要列在这里,可以在留言区给我们留言。我会根据反馈检查和更新这篇指南的。 @@ -198,8 +191,6 @@ $ sudo /usr/bin/kcarectl --register KEY Cheers! - - -------------------------------------------------------------------------------- via: https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/ @@ -207,7 +198,7 @@ via: https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/ 作者:[SK][a] 选题:[lujun9972][b] 译者:[mr-ping](https://github.com/mr-ping) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From aa0146cd01983880c0111240916b2ac696262d22 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Apr 2020 22:51:55 +0800 Subject: [PATCH 0356/1809] PUB @mr-ping https://linux.cn/article-12125-1.html --- ...190107 Different Ways To Update Linux Kernel For Ubuntu.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190107 Different Ways To Update Linux Kernel For Ubuntu.md (99%) diff --git a/translated/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md b/published/20190107 Different Ways To Update Linux Kernel For Ubuntu.md similarity index 99% rename from translated/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md rename to published/20190107 Different Ways To Update Linux Kernel For Ubuntu.md index ed7bfc2489..50e1bb7e16 100644 --- a/translated/tech/20190107 Different Ways To Update Linux Kernel For Ubuntu.md +++ b/published/20190107 Different Ways To Update Linux Kernel For Ubuntu.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "mr-ping" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-12125-1.html" [#]: subject: "Different Ways To Update Linux Kernel For Ubuntu" [#]: via: "https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/" [#]: author: "SK https://www.ostechnix.com/author/sk/" From 3f44b6951126521d90a03ef7e9e25ee4e6742fdd Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sat, 18 Apr 2020 23:18:45 +0800 Subject: [PATCH 0357/1809] Update 20200313 What is the internet backbone and how it works.md --- ...313 What is the internet backbone and how it works.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sources/talk/20200313 What is the internet backbone and how it works.md b/sources/talk/20200313 What is the internet backbone and how it works.md index 8393026255..a2e13ef449 100644 --- a/sources/talk/20200313 What is the internet backbone and how it works.md +++ b/sources/talk/20200313 What is the internet backbone and how it works.md @@ -8,23 +8,30 @@ [#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) What is the internet backbone and how it works +互联网的骨干网是什么以及它是怎样工作的 ====== Tier 1 internet service providers (ISP) mesh their high-speed fiber-optic networks together to create the internet backbone, which moves traffic efficiently among geographic regions. [Gerd Altmann][1] [(CC0)][2] +一级互联网服务提供商(ISP)将其高速光纤网络连接在一起,形成互联网的骨干网,实现在地理区域之间高效地传输流量。[Gerd Altmann][1] [(CC0)][2] The internet generates massive amounts of computer-to-computer traffic, and insuring all that traffic can be delivered anywhere in the world requires the aggregation of a vast array of high-speed networks collectively known as the internet backbone, but how does that work? +互联网会产生大量的计算机到计算机的流量,要确保所有流量都可以在世界上任何地方之间送达,就需要大量汇聚的高速网络,这些网络统称为互联网骨干网,但是它是如何工作的呢? ### What is the internet backbone? - +互联网的骨干网是什么? Like any other network, the internet consists of access links that move traffic to high-bandwidth routers that move traffic from its source over the best available path toward its destination. This core is made up of individual high-speed fiber-optic networks that peer with each other to create the internet backbone. +像任何其他网络一样,Internet由接入链路组成,这些接入链路将流量传输到高带宽路由器,路由器又将流量从源地址通过最佳可用路径传输到目的地址。其核心是由相互连接的各个高速光纤网络而构成的Internet骨干网。 The individual core networks are privately owned by Tier 1 internet service providers (ISP), giant carriers whose networks are tied together. These providers include AT&T, CenturyLink, Cogent Communications, Deutsche Telekom, Global Telecom and Technology (GTT), NTT Communications, Sprint, Tata Communications, Telecom Italia Sparkle, Telia Carrier, and Verizon. +各个独立的核心网络由一级互联网服务提供商(ISP)所拥有,这些大型运营商的网络连接在一起。这些运营商包括AT&T,CenturyLink,Cogent Communications,德国电信,全球电信和技术(GTT),NTT Communications,Sprint,Tata Communications,意大利Sparkle电信,Telia Carrier和Verizon。 [[Get regularly scheduled insights by signing up for Network World newsletters.]][3] By joining these long-haul networks together, Tier 1 ISPs create a single worldwide network that gives all of them access to the entire internet routing table so they can efficiently deliver traffic to its destination through a hierarchy of progressively more local ISPs. +通过将这些远程网络连接在一起,一级ISP们创建了一个他们都可以访问整个路由表的单一的全球性网络,因此他们可以通过逐步层次化地增加本地ISP网络来有效地将流量传输到其目的地。 In addition to being physically connected, these backbone providers are held together by a shared network protocol, TCP/IP. They are actually two protocols, transport control protocol and internet protocol that set up connections between computers, insuring that the connections are reliable and formating messages into packets. +除了物理连接之外,这些骨干运营商还通过一致的网络协议TCP/IP融合在一起。它们实际上是两个协议,传输控制协议和Internet协议,它们在计算机之间建立连接,以确保连接可靠并将消息格式化为数据包。 ### Internet exchange points (IXP) tie the backbone together From 394c0423a699a87dabdf2083545e8b4f1a2e1508 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 19 Apr 2020 01:05:25 +0800 Subject: [PATCH 0358/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200419=20Gett?= =?UTF-8?q?ing=20Started=20With=20Pacman=20Commands=20in=20Arch-based=20Li?= =?UTF-8?q?nux=20Distributions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md --- ...mands in Arch-based Linux Distributions.md | 250 ++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md diff --git a/sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md b/sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md new file mode 100644 index 0000000000..f2fd06793f --- /dev/null +++ b/sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md @@ -0,0 +1,250 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting Started With Pacman Commands in Arch-based Linux Distributions) +[#]: via: (https://itsfoss.com/pacman-command/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +Getting Started With Pacman Commands in Arch-based Linux Distributions +====== + +_**Brief: This beginner’s guide shows you what you can do with pacmancommands in Linux, how to use them to find new packages, install and upgrade new packages, and clean your system.**_ + +The [pacman][1] package manager is one of the main difference between [Arch Linux][2] and other major distributions like Red Hat and Ubuntu/Debian. It combines a simple binary package format with an easy-to-use [build system][3]. The aim of pacman is to easily manage packages, either from the [official repositories][4] or the user’s own builds. + +If you ever used Ubuntu or Debian-based distributions, you might have used the apt-get or apt commands. Pacman is the equivalent in Arch Linux. If you [just installed Arch Linux][5], one of the first few [things to do after installing Arch Linux][6] is to learn to use pacman commands. + +In this beginner’s guide, I’ll explain some of the essential usage of the pacmand command that you should know for managing your Arch-based system. + +### Essential pacman commands Arch Linux users should know + +![][7] + +Like other package managers, pacman can synchronize package lists with the software repositories to allow the user to download and install packages with a simple command by solving all required dependencies. + +#### Install packages with pacman + +You can install a single package or multiple packages using pacman command in this fashion: + +``` +pacman -S _package_name1_ _package_name2_ ... +``` + +![Installing a package][8] + +The -S stands for synchronization. It means that pacman first synchronizes + +The pacman database categorises the installed packages in two groups according to the reason why they were installed: + + * **explicitly-installed**: the packages that were installed by a generic pacman -S or -U command + * **dependencies**: the packages that were implicitly installed because [required][9] by another package that was explicitly installed. + + + +#### Remove an installed package + +To remove a single package, leaving all of its dependencies installed: + +``` +pacman -R package_name_ +``` + +![Removing a package][10] + +To remove a package and its dependencies which are not required by any other installed package: + +``` +pacman -Rs _package_name_ +``` + +To remove dependencies that are no longer needed. For example, the package which needed the dependencies was removed. + +``` +pacman -Qdtq | pacman -Rs - +``` + +#### Upgrading packages + +Pacman provides an easy way to [update Arch Linux][11]. You can update all installed packages with just one command. This could take a while depending on how up-to-date the system is. + +The following command synchronizes the repository databases _and_ updates the system’s packages, excluding “local” packages that are not in the configured repositories: + +``` +pacman -Syu +``` + + * S stands for sync + * y is for refresh (local + * u is for system update + + + +Basically it is saying that sync to central repository (master package database), refresh the local copy of the master package database and then perform the system update (by updating all packages that have a newer version available). + +![System update][12] + +Attention! + +If you are an Arch Linux user before upgrading, it is advised to visit the [Arch Linux home page][2] to check the latest news for out-of-the-ordinary updates. If manual intervention is needed an appropriate news post will be made. Alternatively you can subscribe to the [RSS feed][13] or the [arch-announce mailing list][14]. + +Be also mindful to look over the appropriate [forum][15] before upgrading fundamental software (such as the kernel, xorg, systemd, or glibc), for any reported problems. + +**Partial upgrades are unsupported** at a rolling release distribution such as Arch and Manjaro. That means when new library versions are pushed to the repositories, all the packages in the repositories need to be rebuilt against the libraries. For example, if two packages depend on the same library, upgrading only one package, might break the other package which depends on an older version of the library. + +#### Use pacman to search for packages + +Pacman queries the local package database with the -Q flag, the sync database with the -S flag and the files database with the -F flag. + +Pacman can search for packages in the database, both in packages’ names and descriptions: + +``` +pacman -Ss _string1_ _string2_ ... +``` + +![Searching for a package][16] + +To search for already installed packages: + +``` +pacman -Qs _string1_ _string2_ ... +``` + +To search for package file names in remote packages: + +``` +pacman -F _string1_ _string2_ ... +``` + +To view the dependency tree of a package: + +``` +pactree _package_naenter code hereme_ +``` + +#### Cleaning the package cache + +Pacman stores its downloaded packages in /var/cache/pacman/pkg/ and does not remove the old or uninstalled versions automatically. This has some advantages: + + 1. It allows to [downgrade][17] a package without the need to retrieve the previous version through other sources. + 2. A package that has been uninstalled can easily be reinstalled directly from the cache folder. + + + +However, it is necessary to clean up the cache periodically to prevent the folder to grow in size. + +The [paccache(8)][18] script, provided within the [pacman-contrib][19] package, deletes all cached versions of installed and uninstalled packages, except for the most recent 3, by default: + +``` +paccache -r +``` + +![Clear cache][20] + +To remove all the cached packages that are not currently installed, and the unused sync database, execute: + +``` +pacman -Sc +``` + +To remove all files from the cache, use the clean switch twice, this is the most aggressive approach and will leave nothing in the cache folder: + +``` +pacman -Scc +``` + +#### Installing local or third-party packages + +Install a ‘local’ package that is not from a remote repository: + +``` +pacman -U _/path/to/package/package_name-version.pkg.tar.xz_ +``` + +Install a ‘remote’ package, not contained in an official repository: + +``` +pacman -U http://www.example.com/repo/example.pkg.tar.xz +``` + +### Bonus: Troubleshooting common errors with pacman + +Here are some common errors you may encounter while managing packages with pacman. + +#### Failed to commit transaction (conflicting files) + +If you see the following error: + +``` +error: could not prepare transaction +error: failed to commit transaction (conflicting files) +package: /path/to/file exists in filesystem +Errors occurred, no packages were upgraded. +``` + +This is happening because pacman has detected a file conflict and will not overwrite files for you. + +A safe way to solve this is to first check if another package owns the file (pacman -Qo _/path/to/file_). If the file is owned by another package, file a bug report. If the file is not owned by another package, rename the file which ‘exists in filesystem’ and re-issue the update command. If all goes well, the file may then be removed. + +Instead of manually renaming and later removing all the files that belong to the package in question, you may explicitly run _**pacman -S –overwrite glob package**_ to force pacman to overwrite files that match _glob_. + +#### Failed to commit transaction (invalid or corrupted package) + +Look for .part files (partially downloaded packages) in /var/cache/pacman/pkg/ and remove them. It is often caused by usage of a custom XferCommand in pacman.conf. + +#### Failed to init transaction (unable to lock database) + +When pacman is about to alter the package database, for example installing a package, it creates a lock file at /var/lib/pacman/db.lck. This prevents another instance of pacman from trying to alter the package database at the same time. + +If pacman is interrupted while changing the database, this stale lock file can remain. If you are certain that no instances of pacman are running then delete the lock file. + +Check if a process is holding the lock file: + +``` +lsof /var/lib/pacman/db.lck +``` + +If the above command doesn’t return anything, you can remove the lock file: + +``` +rm /var/lib/pacman/db.lck +``` + +If you find the PID of the process holding the lock file with lsof command output, kill it first and then remove the lock file. + +I hope you like my humble effort in explaining the basic pacman commands. Please leave your comments below and don’t forget to subscribe on our social media. Stay safe! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/pacman-command/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://www.archlinux.org/pacman/ +[2]: https://www.archlinux.org/ +[3]: https://wiki.archlinux.org/index.php/Arch_Build_System +[4]: https://wiki.archlinux.org/index.php/Official_repositories +[5]: https://itsfoss.com/install-arch-linux/ +[6]: https://itsfoss.com/things-to-do-after-installing-arch-linux/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/essential-pacman-commands.jpg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-S.png?ssl=1 +[9]: https://wiki.archlinux.org/index.php/Dependency +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-R.png?ssl=1 +[11]: https://itsfoss.com/update-arch-linux/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-Syu.png?ssl=1 +[13]: https://www.archlinux.org/feeds/news/ +[14]: https://mailman.archlinux.org/mailman/listinfo/arch-announce/ +[15]: https://bbs.archlinux.org/ +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-Ss.png?ssl=1 +[17]: https://wiki.archlinux.org/index.php/Downgrade +[18]: https://jlk.fjfi.cvut.cz/arch/manpages/man/paccache.8 +[19]: https://www.archlinux.org/packages/?name=pacman-contrib +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-paccache-r.png?ssl=1 From ad490326f87f602ca8a5f0c7b3793025a2fcb848 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 19 Apr 2020 01:06:51 +0800 Subject: [PATCH 0359/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200418=20My?= =?UTF-8?q?=2010=20guiding=20principles=20for=20open=20source=20community?= =?UTF-8?q?=20management?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200418 My 10 guiding principles for open source community management.md --- ...es for open source community management.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20200418 My 10 guiding principles for open source community management.md diff --git a/sources/tech/20200418 My 10 guiding principles for open source community management.md b/sources/tech/20200418 My 10 guiding principles for open source community management.md new file mode 100644 index 0000000000..c5e62ba6b3 --- /dev/null +++ b/sources/tech/20200418 My 10 guiding principles for open source community management.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (My 10 guiding principles for open source community management) +[#]: via: (https://opensource.com/article/20/4/open-source-community-management) +[#]: author: (Florian Effenberger https://opensource.com/users/floeff) + +My 10 guiding principles for open source community management +====== +It's not just about subject matter expertise; leadership in the open +source world requires special skills and processes. +![community team brainstorming ideas][1] + +Many activities these days, be they sports, social work, arts or free and open source software, are organized in some sort of community. If backed by a respective legal entity, this not only helps with getting donations and entering contracts but also puts statutes and rules in place that establish the values and ideals all contributors share and abide by. + +Inside these communities, there can be various roles. Some of them have formal requirements and annual or biannual elections, e.g., the board of directors or the supervisory board; others exist ad hoc within dynamically grown groups and can change frequently. Either of those are ideally composed of experienced and enthusiastic community members who take leadership and responsibility. + +Many regular contributors will, therefore, eventually face the question of whether to accept a certain role. Based on my experience with being a board member of the former German associations [OpenOffice.org][2] Deutschland e.V. and Freies Office Deutschland e.V., previous chairman and current executive director of [The Document Foundation][3] and founding member of the Munich [Open-Source-Treffen e.V.][4], I would like to share some personal insights on the topic. + +These views are purely my own, and your mileage might vary. It is likely that others had both similar and different experiences, so I'm looking forward to any feedback and thoughts you might have. + +### 1\. Cooperation + +A community is all about cooperation. Boards, groups, and bodies are no different in this regard. Usually, you don't know who will co-serve on an elected committee with you until shortly before you start your duty. Therefore, it is important to cooperate openly with your new colleagues in a transparent, trustworthy, and effective way, within the committee as well as the larger community. + +Sharing a common understanding of responsibilities and duties, and even more importantly, of your goals, visions, and plans can help a lot. It's not necessary for these to all be totally aligned in the first place, as long as there are consensus and compromise to help you identify goals that benefit the community and their objectives at large. In a vivid and diverse community, several goals can often be pursued at once, as most won't be mutually exclusive or otherwise prohibitive. + +And then let's not forget one thing: the fun! Be proud that you have been entrusted by your peers to drive the community and its projects toward a bright future. Be proud that you can help steer the ship and shape the soul of something that is important to you. As is often the case in life, cooperating and working together with others is key to success. Joining forces is not only easier but also much more fun than working alone. + +### 2\. Commitment + +Taking over a role is something that can and should make you proud. See this as something you have been entrusted with for a certain amount of time because your contributions have been recognized by the community as extraordinary and remarkable. You acted in a visible and trustworthy fashion, and people credit you with leadership skills. + +Depending on the role you take, the honor often comes with a fair amount of new responsibility beyond what you already do, and it might involve subjects yet unknown to you. In other words: Be ready to put in some time and effort. + +How much time such a commitment takes obviously depends on multiple factors: what specific role you take, how many contributors you have to coordinate with, how large your organization is, and of course, what kind of projects you run. [In one of its annual reports][5], board members of The Document Foundation explained that every year "they each donate 15 to 20 days of activity to TDF for Board duties in addition to other volunteering" and the members of its membership committee donate "between 10 and 15 days of activity." + +### 3\. Variety + +Should you be elected into an organizations' formal body, you will see yourself responsible for representing the entity from a marketing perspective, but also from a legal and organizational point of view. Other than the more glamorous parts, these duties often also entail regular meetings, annual budget planning and reserve building, tax filings and annual activity reports, team management, trademark and copyright handling, planning and overseeing tenders, and all sorts of expected and unexpected legal matters and fostering liaisons with other entities, all of which are rather unglamorous tasks rarely seen by the general public. + +That requires the willingness to learn in a variety of areas and for having a rather high tolerance for frustration. Luckily, most of the groups I know are composed of members with different skills, so it's likely someone is either already experienced in or willing to learn one or more of the respective areas. Looking at The Document Foundation's [rules of procedure][6] for the board, a total of 13 different areas of oversight can be identified, each one staffed with one or more volunteers, matched to their area of interest. + +### 4\. Delegation + +Handling all the work alone as a pure volunteer will sooner or later become an impossible task and, unless you have magical superpowers, it's strongly advisable to share these with other seat holders, volunteers, and, if they exist, staff and external professionals. Often, growing organizational demands luckily come together with the financial growth of the entity, which makes paying professionals for certain tasks quite feasible and sensible. Accounting, administration, and legal advice are prime examples of things to outsource (unless that's the service you already provide, of course). + +If you oversee a large part of the organization, you primarily need to focus on strategy and the mission at large, so it is advisable to delegate many tasks to others. Remember, the community has entrusted you to steer the ship, to oversee the big picture; don't bother yourself with every little detail and micromanagement, but get enough insight to oversee those you task and trust that they do a good job. + +### 5\. Responsibility + +In the end, however, it still is the ultimate and shared responsibility of all representatives to oversee and coordinate the work, ensure all duties are fulfilled, and, especially for board members, take care that all legal obligations are met. Remember, donors trust you to make good use of their money, so you have a huge responsibility. + +In nearly all legislations, there exist numerous rules and regulations you are bound by, and the unfortunate tendency is often to make things more complicated instead of relaxing them. + +In case something goes wrong, those most exposed are first in line to be confronted with that, both from a social and legal point of view. + +### 6\. Social + +Depending on the size of the organization and your role, you might not only have responsibility for tasks and projects, but also for a paid team. Keep in mind that, for many, their economic situation depends on the success of your organization. Job security and a positive work environment are important factors to keep a happy and dedicated team. + +Gaining the skills and finding the time as a pure volunteer to oversee a large full-time team is demanding. Interacting by talking, listening, and being open helps a lot for both your team and the organization. In many organizations, the paid team is there to serve your community, to drive forward the success of the project, to take away annoying administrative tasks from you, and to work on tasks that support and enable your contributors. + +Working at charities can be a bit different from companies. Given most of your income consists of donor's money, you have less monetary flexibility than commercial employers. However, you provide a far superior experience than many traditional businesses. Use that as your advantage—your team does something for the good cause, can work with people around the world, can really make a difference, and at the same time make a living out of what they love. Communicate frequently, and don't forget to laud people if they do a good job, especially in remote working environments. + +### 7\. Diversity + +Crucial and essential is that representatives reflect the diversity of the community—different genders, religions, languages, cultures, backgrounds, and experiences add an incredibly exciting variety that you should aim hard to achieve in any board, committee, and group. While this can turn out to be challenging in the beginning, it for sure will enrich your community in ways you never dared to dream of before. + +This diversity is one of the most important and exciting assets a larger community offers; you'll soon learn how it widens the view, helps you to question your own thoughts and positions, and contributes greatly to your overall efforts. If you run an open source community, do exactly as the name suggests—be open, be passionate, and try to get to the bottom of things! + +### 8\. Coordination + +Having members from around the globe can make you face some practical problems though—most notably, languages and time zones. While English as a common denominator is spoken widely in Europe, it might be different for other countries, and including those who don't speak English as their mother tongue is key if you have a large community. You risk losing vital insight into what your worldwide community does if you don't manage to connect to them. + +Something the law of physics at least currently doesn't allow is overcoming the different time zones. Finding suitable meeting slots for participants on different continents, matching everyone's working schedule, and providing a work-life balance aren't trivial requirements, especially when you want to include a paid team. As you end your workday, colleagues from a different continent are just about to start theirs. While the volunteers need meeting times after office hours, your staff would probably rather not stay in the office until late or during the weekends. + +Likely there isn't an ideal meeting time, but you will end up finding a compromise that works for most people, possibly including alternate meeting times. A word to the wise: use calendar invites and meeting planners with time zones to avoid confusion, especially during times of daylight savings changes. + +The choice of medium is important as well—all stakeholders need to be aware of and included in important discussions. Some of these are thus better done in email; others are easier to handle on the phone. You might also find it convenient to prepare initial discussions via emails and have the final vote on the phone. + +Properly prefixing email subjects with votes and discussions can likewise be helpful to handle the influx of messages and catch people's attention. The same is true for meeting intervals, agendas, deadlines, quorum requirements, and sunset periods—these need to reflect everyone's needs, factoring in availabilities, vacations, and absences. The rationale behind this is that taking a role requires continuous, active participation in many communities, to keep up with what's going on, and that is much easier when the rules are clear. + +Depending on your setup and the jurisdiction you're in, votes and meetings also have formal requirements you have to stick to. + +### 9\. Trust + +Trustworthiness is probably one of the most important characteristics for anyone who fills a leadership role. Email conversations lack tone and gestures, making it harder to understand moods, emotions, and intentions. Thus it's even more important to assume best intentions on each side, trying to avoid what is known as confirmation bias, i.e., interpreting actions and words in a way that seems to confirm your existing negative assumptions. + +Trust especially comes into play when the entity is located in a country whose language you don't speak or whose legal system you are not familiar with—you will have to rely on translation services and people acting as gateways, be they volunteers or paid professionals. + +### 10\. Reward + +Filling a community role usually means plenty of hard work on top of your existing duties, but there are plenty of rewards for all that work. It is a very honorable and truly exciting opportunity that will not only enrich your professional life (and makes a good item on a CV) but beyond that, enriches your personality, your skills, and your point of view. If you're passionate about what you do, if you're open to new things, if you want to shape the future of what you love—then you indeed might be a great candidate to serve the community and lead by example. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/open-source-community-management + +作者:[Florian Effenberger][a] +选题:[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/floeff +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/meeting_discussion_brainstorm.png?itok=7_m4CC8S (community team brainstorming ideas) +[2]: http://OpenOffice.org +[3]: https://www.documentfoundation.org/ +[4]: https://www.opensourcetreffen.de/ +[5]: https://wiki.documentfoundation.org/File:AnnualReport2016LR.pdf +[6]: https://wiki.documentfoundation.org/TDF/BoD_rules From 1df21ea33676f5fa40713a9d8e6aadf28db31fa9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 19 Apr 2020 09:54:36 +0800 Subject: [PATCH 0360/1809] Rename sources/tech/20200418 My 10 guiding principles for open source community management.md to sources/talk/20200418 My 10 guiding principles for open source community management.md --- ... 10 guiding principles for open source community management.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200418 My 10 guiding principles for open source community management.md (100%) diff --git a/sources/tech/20200418 My 10 guiding principles for open source community management.md b/sources/talk/20200418 My 10 guiding principles for open source community management.md similarity index 100% rename from sources/tech/20200418 My 10 guiding principles for open source community management.md rename to sources/talk/20200418 My 10 guiding principles for open source community management.md From cf0158f5b1f37c50285af73e11fe61317dc123d5 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sun, 19 Apr 2020 10:09:44 +0800 Subject: [PATCH 0361/1809] Almost done --- ... the internet backbone and how it works.md | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/sources/talk/20200313 What is the internet backbone and how it works.md b/sources/talk/20200313 What is the internet backbone and how it works.md index a2e13ef449..935ffd66e4 100644 --- a/sources/talk/20200313 What is the internet backbone and how it works.md +++ b/sources/talk/20200313 What is the internet backbone and how it works.md @@ -7,8 +7,7 @@ [#]: via: (https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html) [#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) -What is the internet backbone and how it works -互联网的骨干网是什么以及它是怎样工作的 +What is the internet backbone and how it works 互联网的骨干网是什么以及它是怎样工作的 ====== Tier 1 internet service providers (ISP) mesh their high-speed fiber-optic networks together to create the internet backbone, which moves traffic efficiently among geographic regions. [Gerd Altmann][1] [(CC0)][2] @@ -17,55 +16,61 @@ Tier 1 internet service providers (ISP) mesh their high-speed fiber-optic networ The internet generates massive amounts of computer-to-computer traffic, and insuring all that traffic can be delivered anywhere in the world requires the aggregation of a vast array of high-speed networks collectively known as the internet backbone, but how does that work? 互联网会产生大量的计算机到计算机的流量,要确保所有流量都可以在世界上任何地方之间送达,就需要大量汇聚的高速网络,这些网络统称为互联网骨干网,但是它是如何工作的呢? -### What is the internet backbone? -互联网的骨干网是什么? +### What is the internet backbone? 互联网的骨干网是什么? Like any other network, the internet consists of access links that move traffic to high-bandwidth routers that move traffic from its source over the best available path toward its destination. This core is made up of individual high-speed fiber-optic networks that peer with each other to create the internet backbone. 像任何其他网络一样,Internet由接入链路组成,这些接入链路将流量传输到高带宽路由器,路由器又将流量从源地址通过最佳可用路径传输到目的地址。其核心是由相互连接的各个高速光纤网络而构成的Internet骨干网。 The individual core networks are privately owned by Tier 1 internet service providers (ISP), giant carriers whose networks are tied together. These providers include AT&T, CenturyLink, Cogent Communications, Deutsche Telekom, Global Telecom and Technology (GTT), NTT Communications, Sprint, Tata Communications, Telecom Italia Sparkle, Telia Carrier, and Verizon. -各个独立的核心网络由一级互联网服务提供商(ISP)所拥有,这些大型运营商的网络连接在一起。这些运营商包括AT&T,CenturyLink,Cogent Communications,德国电信,全球电信和技术(GTT),NTT Communications,Sprint,Tata Communications,意大利Sparkle电信,Telia Carrier和Verizon。 +各个独立的核心网络由一级互联网服务提供商(ISP),大型运营商所拥有。他们的网络连接在一起。这些提供商包括AT&T,CenturyLink,Cogent Communications,德国电信,全球电信和技术(GTT),NTT Communications,Sprint,Tata Communications,意大利Sparkle电信,Telia Carrier和Verizon。 [[Get regularly scheduled insights by signing up for Network World newsletters.]][3] By joining these long-haul networks together, Tier 1 ISPs create a single worldwide network that gives all of them access to the entire internet routing table so they can efficiently deliver traffic to its destination through a hierarchy of progressively more local ISPs. -通过将这些远程网络连接在一起,一级ISP们创建了一个他们都可以访问整个路由表的单一的全球性网络,因此他们可以通过逐步层次化地增加本地ISP网络来有效地将流量传输到其目的地。 +通过将这些长途网连接在一起,一级ISP们创建了一个他们可以访问整个路由表的单一的全球性网络,因此他们可以通过逐步层次化地增加本地ISP网络来有效地将流量传输到其目的地。 In addition to being physically connected, these backbone providers are held together by a shared network protocol, TCP/IP. They are actually two protocols, transport control protocol and internet protocol that set up connections between computers, insuring that the connections are reliable and formating messages into packets. -除了物理连接之外,这些骨干运营商还通过一致的网络协议TCP/IP融合在一起。它们实际上是两个协议,传输控制协议和Internet协议,它们在计算机之间建立连接,以确保连接可靠并将消息格式化为数据包。 +除了物理连接之外,这些骨干提供商还通过一致的网络协议TCP/IP融合在一起。它们实际上是两个协议,传输控制协议和Internet协议,它们在计算机之间建立连接,以确保连接可靠并将消息格式化为数据包。 -### Internet exchange points (IXP) tie the backbone together +### Internet exchange points (IXP) tie the backbone together 互联网交接点(IXP)将骨干连接在一起 Backbone ISPs connect their networks at peering points, neutrally owned locations with high-speed switches and routers that move traffic among the peers. These are often owned by third parties, sometimes non-profits, that facilitate unifying the backbone. +骨干ISP在对等点,中立位置通过高速交换机和路由器连接其网络。这些通常由第三方(有时是非营利组织)提供,以促进骨干网的统一。 Participating Tier 1 ISPs help fund the IXPs, but don’t charge each other for transporting traffic from the other Tier 1 ISPs in a relationship known as settlement-free peering. Such agreements eliminate potential financial disputes that might have the result of slowing down internet performance. +有1级ISP的参与有助于为IXP提供资金,但是在称为无结算的对等关系中,彼此之间不收取从其他1级ISP传输流量的费用。此类协议消除了可能导致互联网性能下降的潜在财务纠纷。 [][4] -### How fast is the backbone? - +### How fast is the backbone? 骨干网有多快? The internet backbone is made up of the fastest routers, which can deliver 100Gbps trunk speeds. These routers are made by vendors including Cisco, Extreme, Huawei, Juniper, and Nokia, and use the border gateway protocol (BGP) to route traffic among themselves. +互联网骨干网由最快的路由器组成,可以提供100Gbps的线路速度。这些路由器由包括Cisco,Extreme,Huawei,Juniper和Nokia在内的供应商制造,使用边界网关协议(BGP)在彼此之间路由流量。 -### How traffic gets on the backbone +### How traffic gets on the backbone 流量是如何进入骨干网的 Below the Tier 1 ISPs are smaller Tier 2 and Tier 3 ISPs. +1级ISP之下是小的2级和3级ISP。 Tier 3 providers provide businesses and consumers with access to the internet. These providers have no access of their own to the internet backbone, so on their own would not be able to connect their customers to all of the billions of internet-attached computers. +3级(ISP)提供商为企业和消费者提供了Internet接入服务。这些提供商自己没有接入互联网骨干网,因此,他们自己无法将其客户连接到数十亿台互联网上的计算机。 Buying access to Tier 1 providers is expensive. So often Tier 3 ISPs contract with Tier 2 (regional) ISPs that have their own networks that can deliver traffic to a limited geographic area but not to all internet-attached devices. +购买一级(ISP)提供商的接入权非常昂贵。通常3级ISP与具有自己网络的2级(区域)ISP签订合同,利用2级ISP的网络将流量传输到有限的地理区域,但不能传输到所有Internet上的设备。 In order to do that, Tier 2 ISPs contract with Tier 1 ISPs for access to the global backbone, and in that way make the entire internet accesssible to their customers. +为此,2级ISP与1级ISP签约以访问全球骨干网,并以这种方式使客户可以访问整个Internet。 This arrangment makes it possible for traffic from a computer on one side of the world to connect to one on the other side. That traffic goes from a source computer to a Tier 3 ISP that routes it to a Tier 2 ISP that routes it to a Tier 1 backbone provider that routes it to the appropriate Tier 2 ISP that routes it to a Tier 3 access provider that delivers it to the destination computer. +这种方式使得来自世界一侧的计算机的流量能够连接到另一侧的计算机。流量从源计算机流向3级ISP,再路由到2级ISP,再路由到1级骨干网提供商,再路由到正确的2级ISP,最后路由到提供该数据的3级接入提供商连接的目标计算机。 Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - +加入[Facebook][5]和[LinkedIn][6]上的Network World社区,就可以评论最前沿的话题。 -------------------------------------------------------------------------------- via: https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html 作者:[Tim Greene][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[messon007](https://github.com/messon007) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3172cee103d9048d293c522dd18f21a4435d2b77 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sun, 19 Apr 2020 10:15:50 +0800 Subject: [PATCH 0362/1809] remove origin and move to translated --- ... the internet backbone and how it works.md | 85 ------------------- ... the internet backbone and how it works.md | 69 +++++++++++++++ 2 files changed, 69 insertions(+), 85 deletions(-) delete mode 100644 sources/talk/20200313 What is the internet backbone and how it works.md create mode 100644 translated/talk/20200313 What is the internet backbone and how it works.md diff --git a/sources/talk/20200313 What is the internet backbone and how it works.md b/sources/talk/20200313 What is the internet backbone and how it works.md deleted file mode 100644 index 935ffd66e4..0000000000 --- a/sources/talk/20200313 What is the internet backbone and how it works.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (messon007) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What is the internet backbone and how it works) -[#]: via: (https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html) -[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) - -What is the internet backbone and how it works 互联网的骨干网是什么以及它是怎样工作的 -====== -Tier 1 internet service providers (ISP) mesh their high-speed fiber-optic networks together to create the internet backbone, which moves traffic efficiently among geographic regions. -[Gerd Altmann][1] [(CC0)][2] -一级互联网服务提供商(ISP)将其高速光纤网络连接在一起,形成互联网的骨干网,实现在地理区域之间高效地传输流量。[Gerd Altmann][1] [(CC0)][2] - -The internet generates massive amounts of computer-to-computer traffic, and insuring all that traffic can be delivered anywhere in the world requires the aggregation of a vast array of high-speed networks collectively known as the internet backbone, but how does that work? -互联网会产生大量的计算机到计算机的流量,要确保所有流量都可以在世界上任何地方之间送达,就需要大量汇聚的高速网络,这些网络统称为互联网骨干网,但是它是如何工作的呢? - -### What is the internet backbone? 互联网的骨干网是什么? -Like any other network, the internet consists of access links that move traffic to high-bandwidth routers that move traffic from its source over the best available path toward its destination. This core is made up of individual high-speed fiber-optic networks that peer with each other to create the internet backbone. -像任何其他网络一样,Internet由接入链路组成,这些接入链路将流量传输到高带宽路由器,路由器又将流量从源地址通过最佳可用路径传输到目的地址。其核心是由相互连接的各个高速光纤网络而构成的Internet骨干网。 - -The individual core networks are privately owned by Tier 1 internet service providers (ISP), giant carriers whose networks are tied together. These providers include AT&T, CenturyLink, Cogent Communications, Deutsche Telekom, Global Telecom and Technology (GTT), NTT Communications, Sprint, Tata Communications, Telecom Italia Sparkle, Telia Carrier, and Verizon. -各个独立的核心网络由一级互联网服务提供商(ISP),大型运营商所拥有。他们的网络连接在一起。这些提供商包括AT&T,CenturyLink,Cogent Communications,德国电信,全球电信和技术(GTT),NTT Communications,Sprint,Tata Communications,意大利Sparkle电信,Telia Carrier和Verizon。 - -[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] - -By joining these long-haul networks together, Tier 1 ISPs create a single worldwide network that gives all of them access to the entire internet routing table so they can efficiently deliver traffic to its destination through a hierarchy of progressively more local ISPs. -通过将这些长途网连接在一起,一级ISP们创建了一个他们可以访问整个路由表的单一的全球性网络,因此他们可以通过逐步层次化地增加本地ISP网络来有效地将流量传输到其目的地。 - -In addition to being physically connected, these backbone providers are held together by a shared network protocol, TCP/IP. They are actually two protocols, transport control protocol and internet protocol that set up connections between computers, insuring that the connections are reliable and formating messages into packets. -除了物理连接之外,这些骨干提供商还通过一致的网络协议TCP/IP融合在一起。它们实际上是两个协议,传输控制协议和Internet协议,它们在计算机之间建立连接,以确保连接可靠并将消息格式化为数据包。 - -### Internet exchange points (IXP) tie the backbone together 互联网交接点(IXP)将骨干连接在一起 - -Backbone ISPs connect their networks at peering points, neutrally owned locations with high-speed switches and routers that move traffic among the peers. These are often owned by third parties, sometimes non-profits, that facilitate unifying the backbone. -骨干ISP在对等点,中立位置通过高速交换机和路由器连接其网络。这些通常由第三方(有时是非营利组织)提供,以促进骨干网的统一。 - -Participating Tier 1 ISPs help fund the IXPs, but don’t charge each other for transporting traffic from the other Tier 1 ISPs in a relationship known as settlement-free peering. Such agreements eliminate potential financial disputes that might have the result of slowing down internet performance. -有1级ISP的参与有助于为IXP提供资金,但是在称为无结算的对等关系中,彼此之间不收取从其他1级ISP传输流量的费用。此类协议消除了可能导致互联网性能下降的潜在财务纠纷。 - -[][4] - -### How fast is the backbone? 骨干网有多快? -The internet backbone is made up of the fastest routers, which can deliver 100Gbps trunk speeds. These routers are made by vendors including Cisco, Extreme, Huawei, Juniper, and Nokia, and use the border gateway protocol (BGP) to route traffic among themselves. -互联网骨干网由最快的路由器组成,可以提供100Gbps的线路速度。这些路由器由包括Cisco,Extreme,Huawei,Juniper和Nokia在内的供应商制造,使用边界网关协议(BGP)在彼此之间路由流量。 - -### How traffic gets on the backbone 流量是如何进入骨干网的 - -Below the Tier 1 ISPs are smaller Tier 2 and Tier 3 ISPs. -1级ISP之下是小的2级和3级ISP。 - -Tier 3 providers provide businesses and consumers with access to the internet. These providers have no access of their own to the internet backbone, so on their own would not be able to connect their customers to all of the billions of internet-attached computers. -3级(ISP)提供商为企业和消费者提供了Internet接入服务。这些提供商自己没有接入互联网骨干网,因此,他们自己无法将其客户连接到数十亿台互联网上的计算机。 - -Buying access to Tier 1 providers is expensive. So often Tier 3 ISPs contract with Tier 2 (regional) ISPs that have their own networks that can deliver traffic to a limited geographic area but not to all internet-attached devices. -购买一级(ISP)提供商的接入权非常昂贵。通常3级ISP与具有自己网络的2级(区域)ISP签订合同,利用2级ISP的网络将流量传输到有限的地理区域,但不能传输到所有Internet上的设备。 - -In order to do that, Tier 2 ISPs contract with Tier 1 ISPs for access to the global backbone, and in that way make the entire internet accesssible to their customers. -为此,2级ISP与1级ISP签约以访问全球骨干网,并以这种方式使客户可以访问整个Internet。 - -This arrangment makes it possible for traffic from a computer on one side of the world to connect to one on the other side. That traffic goes from a source computer to a Tier 3 ISP that routes it to a Tier 2 ISP that routes it to a Tier 1 backbone provider that routes it to the appropriate Tier 2 ISP that routes it to a Tier 3 access provider that delivers it to the destination computer. -这种方式使得来自世界一侧的计算机的流量能够连接到另一侧的计算机。流量从源计算机流向3级ISP,再路由到2级ISP,再路由到1级骨干网提供商,再路由到正确的2级ISP,最后路由到提供该数据的3级接入提供商连接的目标计算机。 - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. -加入[Facebook][5]和[LinkedIn][6]上的Network World社区,就可以评论最前沿的话题。 --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html - -作者:[Tim Greene][a] -选题:[lujun9972][b] -译者:[messon007](https://github.com/messon007) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Tim-Greene/ -[b]: https://github.com/lujun9972 -[1]: https://pixabay.com/en/social-media-digitization-faces-3271592/ -[2]: https://creativecommons.org/publicdomain/zero/1.0/ -[3]: https://www.networkworld.com/newsletters/signup.html -[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/translated/talk/20200313 What is the internet backbone and how it works.md b/translated/talk/20200313 What is the internet backbone and how it works.md new file mode 100644 index 0000000000..d8294dba3c --- /dev/null +++ b/translated/talk/20200313 What is the internet backbone and how it works.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: (messon007) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is the internet backbone and how it works) +[#]: via: (https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html) +[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) + +互联网的骨干网是什么以及它是怎样工作的 +====== +一级互联网服务提供商(ISP)将其高速光纤网络连接在一起,形成互联网的骨干网,实现在不同地理区域之间高效地传输流量。[Gerd Altmann][1] [(CC0)][2] + +互联网会产生大量的计算机到计算机的流量,要确保所有流量都可以在世界上任何地方之间传输,就需要大量汇聚的高速网络,这些网络统称为互联网骨干网,但是它是如何工作的呢? + +### 互联网的骨干网是什么? +像任何其他网络一样,Internet由接入链路组成,这些接入链路将流量传输到高带宽路由器,路由器又将流量从源地址通过最佳可用路径传输到目的地址。其核心是由相互连接的各个高速光纤网络而构成的Internet骨干网。 + +各个独立的核心网络由一级互联网服务提供商(ISP),大型运营商所拥有。他们的网络连接在一起。这些提供商包括AT&T,CenturyLink,Cogent Communications,德国电信,全球电信和技术(GTT),NTT Communications,Sprint,Tata Communications,意大利Sparkle电信,Telia Carrier和Verizon。 + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +通过将这些长途网连接在一起,一级ISP们创建了一个他们可以访问整个路由表的单一的全球性网络,因此他们可以通过逐步层次化地增加本地ISP网络来有效地将流量传输到其目的地。 + +除了物理连接之外,这些骨干提供商还通过一致的网络协议TCP/IP融合在一起。它们实际上是两个协议,传输控制协议和IP协议,它们在计算机之间建立连接,以确保连接可靠并将消息格式化为数据包。 + +### 互联网交接点(IXP)将骨干连接在一起 + +骨干ISP在对等点,中立位置通过高速交换机和路由器连接其网络。这些通常由第三方(有时是非营利组织)提供,以促进骨干网的统一。 + +有1级ISP的参与有助于为IXP提供资金,但是在称为无结算的对等关系中,彼此之间不收取从其他1级ISP传输流量的费用。此类协议消除了可能导致互联网性能下降的潜在财务纠纷。 + +[][4] + +### 骨干网有多快? +互联网骨干网由最快的路由器组成,可以提供100Gbps的线路速度。这些路由器由包括Cisco,Extreme,Huawei,Juniper和Nokia在内的供应商制造,使用边界网关协议(BGP)在彼此之间路由流量。 + +### 流量是如何进入骨干网的 + +1级ISP之下是小的2级和3级ISP。 + +3级(ISP)提供商为企业和消费者提供了Internet接入服务。这些提供商自己没有接入互联网骨干网,因此,他们自己无法将其客户连接到数十亿台互联网上的计算机。 + +购买一级(ISP)提供商的接入权非常昂贵。通常3级ISP与具有自己网络的2级(区域)ISP签订合同,利用2级ISP的网络将流量传输到有限的地理区域,但不能传输到所有Internet上的设备。 + +为此,2级ISP与1级ISP签约以访问全球骨干网,并以这种方式使客户可以访问整个Internet。 + +这种方式使得来自世界一侧的计算机的流量能够连接到另一侧的计算机。流量从源计算机流向3级ISP,再路由到2级ISP,再路由到1级骨干网提供商,再路由到正确的2级ISP,最后路由到提供该数据的3级接入提供商连接的目标计算机。 + +加入[Facebook][5]和[LinkedIn][6]上的Network World社区,就可以评论最前沿的话题。 +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html + +作者:[Tim Greene][a] +选题:[lujun9972][b] +译者:[messon007](https://github.com/messon007) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Tim-Greene/ +[b]: https://github.com/lujun9972 +[1]: https://pixabay.com/en/social-media-digitization-faces-3271592/ +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 99b0e53413c50cf24291ab2863dbd4e0a197009f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Apr 2020 11:56:49 +0800 Subject: [PATCH 0363/1809] PRF @wxy --- .../20200211 Navigating man pages in Linux.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translated/tech/20200211 Navigating man pages in Linux.md b/translated/tech/20200211 Navigating man pages in Linux.md index 5a160269e9..c4f575891c 100644 --- a/translated/tech/20200211 Navigating man pages in Linux.md +++ b/translated/tech/20200211 Navigating man pages in Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Navigating man pages in Linux) @@ -12,11 +12,11 @@ > Linux 系统上的手册页可以做的不仅仅是提供特定命令的信息。它们可以帮助你发现你没有意识到的命令。 -[Hello I'm Nik][1] [(CC0)][2] +![Hello I'm Nik][1] 手册页提供了关于 Linux 命令的基本信息,很多用户经常参考它,但手册页的内容比我们很多人意识到的要多得多。 -你总是可以输入一个像 `man who` 这样的命令,然后得到 `who` 命令的工作原理的漂亮描述,但是探索你可能不知道的命令可能会更有启发。例如,你可以使用 `man` 命令来帮助确定处理一些非常具有挑战性的任务的命令,或者显示一些选项,这些选项可以帮助你以新的更好的方式使用你已经知道的命令。 +你总是可以输入一个像 `man who` 这样的命令,然后得到 `who` 命令的工作原理的漂亮描述,但是探索你可能不知道的命令可能会更有启发。例如,你可以使用 `man` 命令来帮助找到一些处理非常具有挑战性的任务的命令,或者显示一些选项,这些选项可以帮助你以新的更好的方式使用你已经知道的命令。 让我们来浏览一些选项,看看最终的结果是什么。 @@ -41,11 +41,11 @@ useradd (8) - create a new user or update default new user information zshroadmap (1) - informal introduction to the zsh manual The Zsh Manual, … ``` -需要说明的是,上面的第三项只是提到 “new users” 类似的内容,并不是设置、删除或配置用户账号的命令。`man` 命令只是在命令描述中匹配了一些词,作用很像 `apropos` 命令。注意上面列出的每个命令后面的括号中的数字。这些数字与包含这些命令的手册页的部分有关。 +需要说明的是,上面的第三项只是提到 “new users” 类似的内容,并不是设置、删除或配置用户账号的命令。`man` 命令只是在命令描述中匹配了一些词,作用很像 `apropos` 命令。注意上面列出的每个命令后面的括号中的数字。这些数字与包含这些命令的手册页的分区有关。 -### 确定手册页的部分 +### 确定手册页的分区 -`man` 命令部分将命令划分为不同的类别。要列出这些类别,请键入 `man man`,并查看类似下面的描述。你的系统中很可能没有第 9 部分的命令。 +`man` 命令的分区将其内容划分为不同的类别。要列出这些类别,请键入 `man man`,并查看类似下面的描述。你的系统中很可能没有第 9 分区的命令。 - `1`:可执行程序或 shell 命令 - `2`:系统调用(内核提供的函数) @@ -59,7 +59,7 @@ zshroadmap (1) - informal introduction to the zsh manual The Zsh Manual, 手册页涵盖了比我们通常认为的“命令”更多的内容。从上面的描述中可以看到,它们涵盖了系统调用、库调用、特殊文件等等。 -下面的列表显示了 Linux 系统中的手册页的实际存储位置。这些目录上的日期会有所不同,因为随着更新,其中一些部分会有新的内容,而另一些则不会。 +下面的列表显示了 Linux 系统中的手册页的实际存储位置。这些目录上的日期会有所不同,因为随着更新,其中一些分区会有新的内容,而另一些则不会。 ``` $ ls -ld /usr/share/man/man? @@ -89,13 +89,13 @@ lrwxrwxrwx 1 root root 9 Sep 5 06:38 [.1.gz -> test.1.gz -rw-r--r-- 1 root root 2378 Aug 23 2018 ac.1.gz ``` -### 按部分列出的手册页 +### 按分区列出的手册页 -即使只看第 1 部分的前 10 个手册页(如上所示),你也可能会看到一些新的命令 —— 也许是 `a2query` 或 `aaflip`(如上所示)。 +即使只看第 1 分区的前 10 个手册页(如上所示),你也可能会看到一些新的命令 —— 也许是 `a2query` 或 `aaflip`(如上所示)。 -探索命令的更好策略是按节列出命令,不查看文件本身,而是使用 `man` 命令向你显示命令并提供每个命令的简要说明。 +探索命令的更好策略是按分区列出命令,不查看文件本身,而是使用 `man` 命令向你显示命令并提供每个命令的简要说明。 -在下面的命令中,`-s 1` 指示 `man` 显示第 1 部分中的命令信息。`-k .` 使该命令对所有命令都有效,而不是指定一个特定的关键字;如果没有这个,`man` 命令就会回过头来问:“你想要什么手册页?”所以,使用关键字来选择一组相关的命令,或者使用点来显示一个部分中的所有命令。 +在下面的命令中,`-s 1` 指示 `man` 显示第 1 分区中的命令信息。`-k .` 使该命令对所有命令都有效,而不是指定一个特定的关键字;如果没有这个,`man` 命令就会回过头来问:“你想要什么手册页?”所以,使用关键字来选择一组相关的命令,或者使用点来显示一个分区中的所有命令。 ``` $ man -s 1 -k . @@ -111,9 +111,9 @@ enchant (1) - a spellchecker … ``` -### 有几本手册页? +### 有多少手册页? -如果你对每个部分中有多少手册页感到好奇,可以使用以下命令按部分对它们进行计数: +如果你对每个分区中有多少手册页感到好奇,可以使用以下命令按分区对它们进行计数: ``` $ for num in {1..8} @@ -158,13 +158,13 @@ via: https://www.networkworld.com/article/3519853/navigating-man-pages-in-linux. 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ [b]: https://github.com/lujun9972 -[1]: https://unsplash.com/photos/YiRQIglwYig +[1]: https://images.idgesg.net/images/article/2019/10/field-note_play-book_playbook_map_navigation_journey_by-hello-i-m-nik-via-unsplash-100813507-large.jpg [2]: https://creativecommons.org/publicdomain/zero/1.0/ [3]: https://www.networkworld.com/slideshow/153439/linux-best-desktop-distros-for-newbies.html#tk.nww-infsb [4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) From beccbb531a5be7834c28941fac6850bfc619bf1d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Apr 2020 11:57:53 +0800 Subject: [PATCH 0364/1809] PUB @wxy https://linux.cn/article-12127-1.html --- .../20200211 Navigating man pages in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200211 Navigating man pages in Linux.md (99%) diff --git a/translated/tech/20200211 Navigating man pages in Linux.md b/published/20200211 Navigating man pages in Linux.md similarity index 99% rename from translated/tech/20200211 Navigating man pages in Linux.md rename to published/20200211 Navigating man pages in Linux.md index c4f575891c..98ca0579ed 100644 --- a/translated/tech/20200211 Navigating man pages in Linux.md +++ b/published/20200211 Navigating man pages in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12127-1.html) [#]: subject: (Navigating man pages in Linux) [#]: via: (https://www.networkworld.com/article/3519853/navigating-man-pages-in-linux.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 8123fdab6f1e5df9a4cb5a8f7f7160fdf9867e34 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Apr 2020 21:12:57 +0800 Subject: [PATCH 0365/1809] PRF @geekpi --- ...istrator in Nautilus File Manager in Linux.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/translated/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md b/translated/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md index 3355744d64..e327970e1f 100644 --- a/translated/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md +++ b/translated/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Open Files and Folders as Administrator in Nautilus File Manager in Linux) @@ -10,7 +10,9 @@ 如何在 Linux 的 Nautilus 文件管理器中以管理员身份打开文件和文件夹 ====== -_**了解如何在 Ubuntu 和其他 Linux 发行版的 Nautilus 文件管理器的右键菜单中添加“以管理员身份打开”选项。**_ +> 了解如何在 Ubuntu 和其他 Linux 发行版的 Nautilus 文件管理器的右键菜单中添加“以管理员身份打开”选项。 + +![](https://img.linux.net.cn/data/attachment/album/202004/19/211224hurk01u0kuvqnpvn.jpg) 如果要以根用户身份打开或编辑文件,你总是可以在终端中执行此操作。但我知道有些人对命令行不适应。 @@ -18,15 +20,11 @@ _**了解如何在 Ubuntu 和其他 Linux 发行版的 Nautilus 文件管理器 如果你必须以 root 用户身份访问文件夹或以 root 用户权限编辑文件,那你可以在 [Nautilus 文件管理器][1]中以图形方式进行操作。 -一个干净的 Nautilus hack 方式能让你以管理员也就是 root 打开文件和文件夹。让我向你展示如何做。 - -#### [Ubuntu 的 root 用户:你应该知道的重要事项][3] - -根用户对于任何 Linux 发行版都是必不可少的。在本 Ubuntu 初学者系列文章中了解 Ubuntu 为何锁定 root 用户以及如何使用它。 +一个小巧优雅的 Nautilus 技巧能让你以管理员(也就是 root)打开文件和文件夹。让我向你展示如何做。 ### 在 Nautilus 文件管理器的右键菜单中添加“以管理员身份打开”选项 -_**警告!请不要以 root 用户身份打开和编辑随机文件,因为这样可能会弄乱文件并导致系统损坏。仅在需要时使用它。**_ +> 警告!请不要以 root 用户身份打开和编辑随机文件,因为这样可能会弄乱文件并导致系统损坏。仅在需要时使用它。 我展示的是 Ubuntu 的步骤。你可以根据你的发行版的软件包管理器进行更改。 @@ -69,7 +67,7 @@ via: https://itsfoss.com/open-nautilus-as-administrator/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0db2a16f4041c3a2c7946e752b2751b7235e8f81 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Apr 2020 21:13:30 +0800 Subject: [PATCH 0366/1809] PUB @geekpi https://linux.cn/article-12128-1.html --- ...ders as Administrator in Nautilus File Manager in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md (98%) diff --git a/translated/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md b/published/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md similarity index 98% rename from translated/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md rename to published/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md index e327970e1f..4b46fad9b3 100644 --- a/translated/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md +++ b/published/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12128-1.html) [#]: subject: (How to Open Files and Folders as Administrator in Nautilus File Manager in Linux) [#]: via: (https://itsfoss.com/open-nautilus-as-administrator/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 6552f880f486ce2611708024a0a21957da94cb3e Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sun, 19 Apr 2020 21:25:19 +0800 Subject: [PATCH 0367/1809] Translating --- sources/tech/20200416 Learning to love systemd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200416 Learning to love systemd.md b/sources/tech/20200416 Learning to love systemd.md index 0aa8609ee7..70243db915 100644 --- a/sources/tech/20200416 Learning to love systemd.md +++ b/sources/tech/20200416 Learning to love systemd.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (messon007) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From dcea59cc037d08e908b3b22ef1613ec662096a90 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sun, 19 Apr 2020 21:28:37 +0800 Subject: [PATCH 0368/1809] translating --- sources/tech/20200417 Create a SDN on Linux with open source.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200417 Create a SDN on Linux with open source.md b/sources/tech/20200417 Create a SDN on Linux with open source.md index 2e144abb26..5e69bb4db6 100644 --- a/sources/tech/20200417 Create a SDN on Linux with open source.md +++ b/sources/tech/20200417 Create a SDN on Linux with open source.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (messon007) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 718724b2f2fc9fbe940d5c8423b4a8be16dae6c3 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sun, 19 Apr 2020 21:37:56 +0800 Subject: [PATCH 0369/1809] translating --- sources/tech/20180612 Systemd Services- Reacting to Change.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180612 Systemd Services- Reacting to Change.md b/sources/tech/20180612 Systemd Services- Reacting to Change.md index a004f123c8..125b871602 100644 --- a/sources/tech/20180612 Systemd Services- Reacting to Change.md +++ b/sources/tech/20180612 Systemd Services- Reacting to Change.md @@ -1,3 +1,4 @@ +//messon007 translating Systemd Services: Reacting to Change ====== From bdb6b002e57c02760fdef87c8b5a89c8acf17b27 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sun, 19 Apr 2020 21:38:31 +0800 Subject: [PATCH 0370/1809] translating --- ...0180619 Systemd Services- Monitoring Files and Directories.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180619 Systemd Services- Monitoring Files and Directories.md b/sources/tech/20180619 Systemd Services- Monitoring Files and Directories.md index 601132a33f..f0ad489b5a 100644 --- a/sources/tech/20180619 Systemd Services- Monitoring Files and Directories.md +++ b/sources/tech/20180619 Systemd Services- Monitoring Files and Directories.md @@ -1,3 +1,4 @@ +//translating by messon007 Systemd Services: Monitoring Files and Directories ====== From 2ef8928e862b9b9049c261d020e75488873e4c3a Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sun, 19 Apr 2020 21:39:45 +0800 Subject: [PATCH 0371/1809] translating --- ...20190205 CFS- Completely fair process scheduling in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190205 CFS- Completely fair process scheduling in Linux.md b/sources/tech/20190205 CFS- Completely fair process scheduling in Linux.md index be44e75fea..fce243271a 100644 --- a/sources/tech/20190205 CFS- Completely fair process scheduling in Linux.md +++ b/sources/tech/20190205 CFS- Completely fair process scheduling in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (messon007) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 205d9a0daaf47d6ffe0251d0a63512df5198f843 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sun, 19 Apr 2020 22:18:35 +0800 Subject: [PATCH 0372/1809] Update 20200401 The ins and outs of high-performance computing as a service.md --- ...high-performance computing as a service.md | 39 +++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md index 0b0a1ac39b..45d258e08c 100644 --- a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md +++ b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md @@ -7,84 +7,109 @@ [#]: via: (https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html) [#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) -The ins and outs of high-performance computing as a service +The ins and outs of high-performance computing as a service 高性能计算即服务的来龙去脉 ====== HPC services can be a way to meet expanding supercomputing needs, but depending on the use case, they’re not necessarily better than on-premises supercomputers. Dell EMC - +HPC服务可以满足不断扩展的超级计算需求,但根据使用情况,它们不一定比本地超级计算机更好。 戴尔EMC Electronics on missiles and military helicopters need to survive extreme conditions. Before any of that physical hardware can be deployed, defense contractor McCormick Stevenson Corp. simulates the real-world conditions it will endure, relying on finite element analysis software like Ansys, which requires significant computing power. +导弹和军用直升机上的电子设备需要在极端条件下生存。 在部署任何物理硬件之前,国防承包商麦考密克·史蒂文森公司(McCormick Stevenson Corp.)都依赖于像Ansys这样的有限元素分析软件来模拟它会承受的现实条件,该软件需要强大的计算能力。 Then one day a few years ago, it unexpectedly ran up against its computing limits. - +几年前的一天,它出乎意料地超出了计算极限。 [10 of the world's fastest supercomputers][1] "We had some jobs that would have overwhelmed the computers that we had in office," says Mike Krawczyk, principal engineer at McCormick Stevenson. "It did not make economic or schedule sense to buy a machine and install software." Instead, the company contracted with Rescale, which could sell them cycles on a supercomputer-class system for a tiny fraction of what they would've spent on new hardware. +麦考密克·史蒂文森(McCormick Stevenson)的首席工程师迈克·克劳奇奇(Mike Krawczyk)说:“我们从事的某些工作会使我们在办公室使用的计算机不堪重负。” “购买机器并安装软件在经济上或计划上都不合理。”取而代之的是,该公司与Rescale签约,可以在超级计算机级系统上向他们出售自行车的周期,而这只花费了他们在新硬件上花费的一小部分。 McCormick Stevenson had become an early adopter in a market known as supercomputing as a service or high-performance computing (HPC) as a service – two terms that are closely related. HPC is the application of supercomputers to computationally complex problems, while supercomputers are those computers at the cutting edge of processing capacity, according to the National Institute for Computational Sciences. +麦考密克·史蒂文森(McCormick Stevenson)已成为市场上的早期采用者,该市场被称为超级计算即服务或高性能计算(HPC)即服务–这两个紧密相关的术语。根据国家计算科学研究所的说法,HPC是超级计算机在计算复杂问题上的应用,而超级计算机是处理能力最先进的那些计算机。 Whatever it's called, these services are upending the traditional supercomputing market and bringing HPC power to customers who could never afford it before. But it's no panacea, and it's definitely not plug-and-play – at least not yet. +无论以何种方式称呼,这些服务都在颠覆传统的超级计算市场,并将HPC功能带给以前买不起的客户。但这不是万能药,而且绝对不是即插即用的,至少现在还没有。 -### HPC services in practice +### HPC services in practice HPC服务实践 From the end user's perspective, HPC as a service resembles the batch-processing model that dates back to the early mainframe era. "We create an Ansys batch file and send that up, and after it runs, we pull down the result files and import them locally here," Krawczyk says. +从最终用户的角度来看,HPC即服务类似于可追溯到大型机早期的批处理模型。 “我们创建一个Ansys批处理文件并将其发送出去,然后运行它,我们将结果文件下拉并在此处本地导入,” Krawczyk说。 Behind the scenes, cloud providers are running the supercomputing infrastructure in their own data centers – though that doesn't necessarily imply the sort of cutting-edge hardware you might be visualizing when you hear "supercomputer." As Dave Turek, Vice President of Technical Computing at IBM OpenPOWER, explains it, HPC services at their core are "a collection of servers that are strung together with an interconnect. You have the ability to invoke this virtual computing infrastructure that allows you to bring a lot of different servers to work together in a parallel construct to solve the problem when you present it." - +在幕后,云提供商正在其自己的数据中心中运行超级计算基础结构,尽管这不一定意味着您在听到“超级计算机”时可能会看到的最先进的硬件。正如IBM OpenPOWER技术计算副总裁Dave Turek解释说的那样,HPC服务的核心是“由互连串在一起的服务器的集合。您可以调用此虚拟计算基础结构,使您能够当您提出问题时,许多不同的服务器可以并行构造在一起以解决问题。” [][2] Sounds simple in theory. But making it viable in practice required some chipping away at technical problems, according to Theo Lynn, Professor of Digital Business at Dublin City University. What differentiates ordinary computing from HPC is those interconnects – high-speed, low-latency, and expensive – so those needed to be brought to the world of cloud infrastructure. Storage performance and data transport also needed to be brought up to a level at least in the same ballpark as on-prem HPC before HPC services could be viable. +理论上听起来很简单。都柏林城市大学数字业务教授西奥·林恩(Theo Lynn)表示,但要使其在实践中可行,需要解决一些技术问题。普通计算与HPC的区别在于那些互连-高速,低延迟和昂贵-因此需要将这些互连引入云基础架构领域。在HPC服务可行之前,还至少需要将存储性能和数据传输提升到与本地HPC相同的水平。 But Lynn says that some of the innovations that have helped HPC services take off have been more institutional than technological. In particular, "we are now seeing more and more traditional HPC applications adopting cloud-friendly licensing models – a barrier to adoption in the past." +但是林恩说,一些帮助高性能计算服务起飞的创新比技术更具有制度性。特别是,“我们现在看到越来越多的传统HPC应用程序采用云友好型许可模式-过去是采用这种模式的障碍。” And the economics have also shifted the potential customer base, he says. "Cloud service providers have opened up the market more by targeting low-end HPC buyers who couldn’t afford the capex associated with traditional HPC and opening up the market to new users. As the markets open up, the hyperscale economic model becomes more and more feasible, costs start coming down." +他说,经济也改变了潜在的客户群。 “云服务提供商通过针对那些负担不起与传统HPC相关的资本支出的低端HPC买家,并向新用户开放市场,进一步开放了市场。随着市场的开放,超大规模经济模型变得越来越多,更可行,成本开始下降。” -Avoid on-premises CAPEX** +Avoid on-premises CAPEX** 避免内部资本支出** ** HPC services are attractive to private-sector customers in the same fields where traditional supercomputing has long held sway. These include sectors that rely heavily on complex mathematical modeling, including defense contractors like McCormick Stevenson, along with oil and gas companies, financial services firms, and biotech companies. Dublin City University's Lynn adds that loosely coupled workloads are a particularly good use case, which meant that many early adopters used it for 3D image rendering and related applications. +在传统超级计算长期占据主导地位的相同领域,HPC服务对私营部门客户具有吸引力。这些行业包括严重依赖复杂数学模型的行业,包括麦考密克·史蒂文森(McCormick Stevenson)等国防承包商,以及石油和天然气公司,金融服务公司和生物技术公司。都柏林城市大学的Lynn补充说,松散耦合的工作负载是一个特别好的用例,这意味着许多早期采用者将其用于3D图像渲染和相关应用程序。 But when does it make sense to consider HPC services over on-premises HPC? For hhpberlin, a German company that simulates smoke propagation in and fire damage to structural components of buildings, the move came as it outgrew its current resources. +但是,何时在本地HPC上考虑HPC服务才有意义?对于德国的hhpberlin公司,该公司模拟烟雾在建筑物中的传播和火灾对建筑物结构部件的破坏,此举是因为它超出了其现有资源。 "For several years, we had run our own small cluster with up to 80 processor cores," says Susanne Kilian, hhpberlin's scientific head of numerical simulation. "With the rise in application complexity, however, this constellation has increasingly proven to be inadequate; the available capacity was not always sufficient to handle projects promptly." +hhpberlin数值模拟的科学负责人Susanne Kilian说:“几年来,我们一直在运行自己的小型集群,该集群具有多达80个处理器内核。” “但是,随着应用程序复杂性的提高,这种架构已经越来越不足够;可用容​​量并不总是足够迅速地处理项目。” But just spending money on a new cluster wasn't an ideal solution, she says: "In view of the size and administrative environment of our company, the necessity of constant maintenance of this cluster (regular software and hardware upgrades) turned out to be impractical. Plus, the number of required simulation projects is subject to significant fluctuations, such that the utilization of the cluster was not really predictable. Typically, phases with very intensive use alternate with phases with little to no use." By moving to an HPC service model, hhpberlin shed that excess capacity and the need to pay up front for upgrades. +她说:“但是,仅仅花钱买一个新的集群并不是一个理想的解决方案:鉴于我们公司的规模和管理环境,持续维护该集群(定期进行软件和硬件升级)的必要性非常明显。另外,所需的模拟项目的数量会出现很大的波动,因此群集的使用情况并不是真正可预测的。通常,使用率很高的阶段与很少使用或不使用的阶段交替出现。”通过转换为HPC服务模式,hhpberlin消除了过剩的容量,无需支付升级费用。 IBM's Turek explains the calculus that different companies go through while assessing their needs. For a biosciences startup with 30 people, "you need computing, but you really can't afford to have 15% of your staff dedicated to it. It's just like you might also say you don't want to have on-staff legal representation, so you'll get that as a service as well." For a bigger company, though, it comes down to weighing the operational expense of an HPC service against the capacity expense of buying an in-house supercomputer or HPC cluster. +IBM的Turek解释了不同公司在评估其需求时所经历的计算过程。对于拥有30名员工的生物科学初创公司来说,“您需要计算,但您实在负担不起15%的员工专心致志。这就像您可能还说过,您不想拥有在职法律代表,因此您也可以将其作为服务获得。”但是,对于一家较大的公司而言,归结为权衡HPC服务的运营费用与购买内部超级计算机或HPC集群的容量费用。 So far, those are the same sorts of arguments you'd have over adopting any cloud service. But the opex vs. capex dilemma can be weighted towards the former by some of the specifics of the HPC market. Supercomputers aren't commodity hardware like storage or x86 servers; they're very expensive, and technological advances can swiftly render them obsolete. As McCormick Stevenson's Krawczyk puts it, "It's like buying a car: as soon as you drive off the lot it starts to depreciate." And for many companies –especially larger and less nimble ones – the process of buying a supercomputer can get hopelessly bogged down. "You're caught up in planning issues, building issues, construction issues, training issues, and then you have to execute an RFP," says IBM's Turek. "You have to work through the CIO. You have to work with your internal customers to make sure there's continuity of service. It's a very, very complex process and not something that a lot of institutions are really excellent at executing." +到目前为止,这些都是您采用任何云服务时都会遇到的相同类型的争论。但是,可以通过HPC市场的某些细节将运营支出与资本支出的困境加权为前者。超级计算机不是诸如存储或x86服务器之类的商用硬件;它们非常昂贵,技术进步会很快使其过时。正如麦考密克·史蒂文森(McCormick Stevenson)的克拉维奇(Krawczyk)所说,“这就像在买车:开车一走,它就会开始贬值。”对于许多公司,尤其是规模较大,灵活性较差的公司,购买超级计算机的过程可能会陷入无望的泥潭。 IBM的Turek说:“您陷入了计划问题,建筑问题,施工问题,培训问题,然后必须执行RFP。” “您必须通过CIO进行工作。您必须与内部客户合作以确保服务的连续性。这是一个非常非常复杂的过程,并不是很多机构在执行方面都非常出色。” Once you choose to go down the services route for HPC, you'll find you get many of the advantages you expect from cloud services, particularly the ability to pay only for HPC power when you need it, which results in an efficient use of resources. Chirag Dekate, Senior Director and Analyst at Gartner, says bursty workloads, when you have short-term needs for high-performance computing, are a key use case driving adoption of HPC  services. +选择了HPC的服务路线后,您会发现您将从云服务中获得了许多期望,特别是仅在需要时才需要为HPC功能付费的能力,从而可以有效利用资源。 Gartner高级总监兼分析师Chirag Dekate表示,当您对高性能计算有短期需求时,突发性工作负载是推动HPC服务采用的关键用例。 "In the manufacturing industry, you tend to have a high peak of HPC activity around the product design stage," he says. "But once the product is designed, HPC resources are less utilized during the rest of the product-development cycle." In contrast, he says, "when you have large, long-running jobs, the economics of the cloud wear down." +他说:“在制造业中,在产品设计阶段,HPC活动往往会达到很高的峰值。” “但是,一旦产品设计完成,在其余产品开发周期中,HPC资源的利用率就会降低。” 相比之下,他说:“当您拥有大量长期运行的工作时,云的经济就会逐渐减弱。” With clever system design, you can integrate those HPC-services bursts of activity with your own in-house conventional computing. Teresa Tung, managing director in Accenture Labs, gives an example: "Accessing HPC via APIs makes it seamless to mix with traditional computing. A traditional AI pipeline might have its training done on a high-end supercomputer at the stage when the model is being developed, but then the resulting trained model that runs predictions over and over would be deployed on other services in the cloud or even devices at the edge." +通过巧妙的系统设计,您可以将这些HPC服务突发事件与您自己的内部常规计算集成在一起。 埃森哲实验室常务董事董德丽举了一个例子:“通过API访问HPC可以无缝地与传统计算混合。在模型构建阶段,传统的AI管道可能会在高端超级计算机上进行培训。 开发出来的软件,但是最终生成的经过反复训练的模型将部署在云中的其他服务上,甚至部署在边缘设备上。” ### It's not for all use cases** ** Use of HPC services lends itself to batch-processing and loosely-coupled use cases. That ties into a common HPC downside: data transfer issues. High-performance computing by its very nature often involves huge data sets, and sending all that information over the internet to a cloud service provider is no simple thing. "We have clients I talk to in the biotech industry who spend $10 million a month on just the data charges," says IBM's Turek. +HPC服务的使用适合批处理和松散耦合的用例。这与HPC的常见缺点有关:数据传输问题。从本质上讲,高性能计算通常涉及庞大的数据集,而将所有这些信息通过Internet发送到云服务提供商并不是一件容易的事。 IBM的Turek说:“我们与生物技术行业的客户交流,他们每月仅在数据费用上就花费1000万美元。” And money isn't the only potential problem. Building a workflow that makes use of your data can challenge you to work around the long times required for data transfer. "When we had our own HPC cluster, local access to the simulation results already produced – and thus an interactive interim evaluation — was of course possible at any time," says hhpberlin's Kilian. "We're currently working on being able to access and evaluate the data produced in the cloud even more efficiently and interactively at any desired time of the simulation without the need to download large amounts of simulation data." +金钱并不是唯一的潜在问题。建立一个利用您的数据的工作流程可能会挑战您在数据传输所需的长时间内工作。 hhpberlin的Kilian说:“当我们拥有自己的HPC集群时,当然可以随时本地访问已经产生的仿真结果,从而进行交互式的临时评估。” “我们目前正在努力,能够在任何所需的模拟时间更高效,交互地访问和评估云中生成的数据,而无需下载大量的模拟数据。” Mike Krawczyk cites another stumbling block: compliance issues. Any service a defense contractor uses needs to be complaint with the International Traffic in Arms Regulations (ITAR), and McCormick Stevenson went with Rescale in part because it was the only vendor they found that checked that box. While more do today, any company looking to use cloud services should be aware of the legal and data-protection issues involved in living on someone else's infrastructure, and the sensitive nature of many of HPC's use cases makes this doubly true for HPC as a service. +Mike Krawczyk提到了另一个绊脚石:合规性问题。国防承包商使用的任何服务都需要向《国际武器交易条例》(ITAR)进行投诉,麦考密克·史蒂文森(McCormick Stevenson)之所以选择Rescale,部分原因是这是他们发现该复选框的唯一供应商。如今,尽管有更多的公司这样做,但任何希望使用云服务的公司都应该意识到生活在其他人的基础架构上所涉及的法律和数据保护问题,而且许多HPC用例的敏感性质使得这对于HPC即服务而言是双重事实。 。 In addition, the IT governance that HPC services require goes beyond regulatory needs. For instance, you'll need to keep track of whether your software licenses permit cloud use ­– especially with specialized software packages written to run on an on-premises HPC cluster. And in general, you need to keep track of how you use HPC services, which can be a tempting resource, especially if you've transitioned from in-house systems where staff was used to having idle HPC capabilities available. For instance, Ron Gilpin, senior director and Azure Platform Services global lead at Avanade, suggests dialing back how many processing cores you use for tasks that aren't time sensitive. "If a job only needs to be completed in an hour instead of ten minutes," he says, "that might use 165 processors instead of 1,000, a savings of thousands of dollars." +此外,HPC服务所需的IT治理超出了监管需求。例如,您需要跟踪您的软件许可证是否允许云使用­ –尤其是针对专门编写在本地HPC群集上运行的软件包。通常,您需要跟踪HPC服务的使用方式,这可能是一个诱人的资源,尤其是当您从习惯于工作人员的内部系统过渡到具有可用的空闲HPC功能时。例如,Avanade全球平台高级主管兼Azure平台服务全球负责人Ron Gilpin建议,回拨您用于非时间敏感任务的处理核心数量。他说:“如果一项工作只需要一个小时而不是十分钟就可以完成,那么它可以使用165个处理器而不是1,000个,从而节省了数千美元。” ### A premium on HPC skills** ** One of the biggest barriers to HPC adoption has always been the unique in-house skills it requires, and HPC services don't magically make that barrier vanish. "Many CIOs have migrated a lot of their workloads into the cloud and they have seen cost savings and increased agility and efficiency, and believe that they can achieve similar results in HPC ecosystems," says Gartner's Dekate. "And a common misperception is that they can somehow optimize human resource cost by essentially moving away from system admins and hiring new cloud experts who can solve their HPC workloads." +一直以来,采用HPC的最大障碍之一就是其所需的独特内部技能,而HPC服务并不能使这种障碍消失。 Gartner的Dekate表示:“许多CIO将许多工作负载迁移到了云中,他们看到了节省成本,提高敏捷性和效率的信念,并且相信他们可以在HPC生态系统中实现类似的结果。” “一个普遍的误解是,他们可以从本质上远离系统管理员,并聘用可以解决其HPC工作负载的新云专家,从而以某种方式优化人力资源成本。” "But HPC is not one of the main enterprise environments," he says. "You're dealing with high-end compute nodes interconnected with high-bandwidth, low-latency networking stacks, along with incredibly complicated application and middleware stacks. Even the filesystem layers in many cases are unique to HPC environments. Not having the right skills can be destabilizing." +他说:“但是HPC并不是主要的企业环境之一。” “您正在处理与高带宽,低延迟网络堆栈以及难以置信的复杂应用程序和中间件堆栈互连的高端计算节点。在许多情况下,甚至文件系统层也是HPC环境所独有的。没有适当的技能 可能会破坏稳定。” But supercomputing skills are in shortening supply, something Dekate refers to as the workforce "greying," in the wake of a generation of developers going to splashy startups rather than academia or the more staid firms where HPC is in use. As a result, vendors of HPC services are doing what they can to bridge the gap. IBM's Turek says that many HPC vets will always want to roll their own exquisitely fine-tuned code and will need specialized debuggers and other tools to help them do that for the cloud. But even HPC newbies can make calls to code libraries built by vendors to exploit supercomputing's parallel processing. And third-party software providers sell turnkey software packages that abstract away much of HPC's complication. +但是超级计算技术却在缩短供应,Dekate将其称为劳动力“灰色”,这是因为一代开发人员将目光投向了新兴的初创公司,而不是学术界或使用HPC的更老套的公司。结果,HPC服务的供应商正在尽其所能弥合差距。 IBM的Turek表示,许多HPC兽医将始终希望推出他们自己精心调整过的代码,并且将需要专门的调试器和其他工具来帮助他们在云中实现这一目标。但是,即使是HPC新手也可以调用供应商构建的代码库,以利用超级计算的并行处理。第三方软件提供商出售的交钥匙软件包可以消除许多HPC复杂性。 Accenture's Tung says the sector needs to lean further into this in order to truly prosper. "HPCaaS has created dramatically impactful new capability, but what needs to happen is making this easy to apply for the data scientist, the enterprise architect, or the software developer," she says. "This includes easy to use APIs, documentation, and sample code. It includes user support to answer questions. It’s not enough to provide an API; that API needs to be fit-for-purpose. For a data scientist this should likely be in Python and easily change out for the frameworks she is already using. The value comes from enabling these users who ultimately will have their jobs improved through new efficiencies and performance, if only they can access the new capabilities." If vendors can pull that off, HPC services might truly bring supercomputing to the masses. +埃森哲的董先生表示,该行业需要进一步倾斜才能真正繁荣。她说:“ ​​HPCaaS已经创建了具有重大影响力的新功能,但是需要做的是使它易于应用于数据科学家,企业架构师或软件开发人员。” “这包括易于使用的API,文档和示例代码。它包含用户回答问题的支持。仅提供API是不够的; API需要适合特定用途。对于数据科学家而言,这可能应该包含在其中。使用Python并轻松地更改她已经在使用的框架。其价值来自使这些用户能够获得新的效率和性能,只要他们能够使用新功能,他们最终将通过新的效率和性能来改善他们的工作。”如果供应商能够做到这一点,那么HPC服务可能真正将超级计算带入大众。 Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. - +加入[Facebook] [3]和[LinkedIn] [4]上的Network World社区,以评论最重要的主题。 -------------------------------------------------------------------------------- via: https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html From d841221c690e833b6810b9b564606b9ba993f5ab Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Sun, 19 Apr 2020 22:31:19 +0800 Subject: [PATCH 0373/1809] APL --- ...nage complex Git workspaces with Great Teeming Workspaces.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md b/sources/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md index ef41241e35..c679c29a38 100644 --- a/sources/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md +++ b/sources/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1d5c81b2289c21e78b0f22c32e0a3ee06258ad56 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Apr 2020 22:49:43 +0800 Subject: [PATCH 0374/1809] =?UTF-8?q?=E6=B8=85=E9=99=A4=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ecurity tools, and more industry trends.md | 65 ----------- ... leaders for hybrid cloud battles ahead.md | 74 ------------ ...ent from KDE, and more open source news.md | 73 ------------ ...ed Decentralized Alternative to YouTube.md | 107 ------------------ 4 files changed, 319 deletions(-) delete mode 100644 sources/news/20200402 Ansible streaming video series, open source security tools, and more industry trends.md delete mode 100644 sources/news/20200408 IBM taps new leaders for hybrid cloud battles ahead.md delete mode 100644 sources/news/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md delete mode 100644 sources/tech/20200406 Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube.md diff --git a/sources/news/20200402 Ansible streaming video series, open source security tools, and more industry trends.md b/sources/news/20200402 Ansible streaming video series, open source security tools, and more industry trends.md deleted file mode 100644 index d2dba3b1cb..0000000000 --- a/sources/news/20200402 Ansible streaming video series, open source security tools, and more industry trends.md +++ /dev/null @@ -1,65 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ansible streaming video series, open source security tools, and more industry trends) -[#]: via: (https://opensource.com/article/20/4/ansible-security-more-industry-trends) -[#]: author: (Tim Hildred https://opensource.com/users/thildred) - -Ansible streaming video series, open source security tools, and more industry trends -====== -A weekly look at open source community and industry trends. -![Person standing in front of a giant computer screen with numbers, data][1] - -As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. - -## [Ansible 101 by Jeff Geerling: a YouTube streaming series][2] - -> After the incredible response I got from [making my Ansible books free for the rest of March][3] to help people learn new automation skills, I tried to think of some other things I could do to help developers who may be experiencing hardship during the coronavirus pandemic and market upheaval. - -**The impact**: Not everyone is a frontline worker in this crisis, but then not every problem it has created needs one. This is a great example of someone using their resources to help in a unique way. - -## [Open source security tools for cloud and container applications][4] - -> Open-source security tools play an important role in securing your container-based infrastructure. Tools such as Anchore can be used for strong governance capabilities, while on the other hand, Dagda can be used to perform static analysis of known vulnerabilities. Two other tools, OpenSCAP and Clair, also provide good capabilities for vulnerability scanning and compliance management. So, depending upon your business requirements and priorities, you can select the right tool to secure your container investments. - -**The impact**: Containers are Linux, and container security is open source as well. - -## [Cloud cover: Clearing up some misunderstandings about data centres][5] - -> The [carbon footprint of data][6] is becoming more and more of a concern, but there appears to be little economic interest in decreasing the amount of data flowing around the world to mitigate this. In that scenario, finding the most energy-efficient and carbon-neutral ways to run purpose-built data centres could be the only answer. - -**The impact**: I was talking to a colleague who manages a team of virtualization engineers about this very problem. He seemed optimistic about the amount of headway his team could make on improving the energy consumption of things like KVM at the kernel level; though at the moment customers aren't asking for it. I'd guess that if, for example, the price of carbon emissions were to go up for some reason, that situation would change pretty quickly. - -## [Business culture is key in OpenStack network requirements][7] - -> The main question is: What is your [culture][8]? Do you go to a vendor and say, 'Give me your design, tell me what to buy and how to support it'? Starting out, you evaluate systems. What are your options? -> -> If you have siloed folks that work on a particular model of equipment, then OpenStack is probably not for you. If you have people that function at a higher level with some fundamental understanding about the underlying architecture that makes things work, then OpenStack can be very useful for you, and you're much less restricted. - -**The impact:** Not every organization can adopt a given technology. Certainly not without a willingness to change at a fundamental level. - -_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/ansible-security-more-industry-trends - -作者:[Tim Hildred][a] -选题:[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/thildred -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) -[2]: https://www.jeffgeerling.com/blog/2020/ansible-101-jeff-geerling-youtube-streaming-series -[3]: https://www.jeffgeerling.com/blog/2020/you-can-get-my-devops-books-free-rest-month -[4]: http://techgenix.com/open-source-security-tools/ -[5]: https://www.siliconrepublic.com/enterprise/data-centres-seamus-dunne-interxion -[6]: https://www.siliconrepublic.com/machines/data-carbon-footprint -[7]: https://searchnetworking.techtarget.com/feature/Business-culture-is-key-in-OpenStack-network-requirements -[8]: https://whatis.techtarget.com/definition/corporate-culture diff --git a/sources/news/20200408 IBM taps new leaders for hybrid cloud battles ahead.md b/sources/news/20200408 IBM taps new leaders for hybrid cloud battles ahead.md deleted file mode 100644 index fbcb14b32d..0000000000 --- a/sources/news/20200408 IBM taps new leaders for hybrid cloud battles ahead.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (IBM taps new leaders for hybrid cloud battles ahead) -[#]: via: (https://www.networkworld.com/article/3536654/ibm-taps-new-leaders-for-hybrid-cloud-battles-ahead.html) -[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) - -IBM taps new leaders for hybrid cloud battles ahead -====== -IBM installs Arvind Krishna as CEO, and appoints Red Hat execs to round out new cloud-oriented team -Stephen Lawson/IDG - -Amid the business chaos COVID-19 is causing, IBM has set its course by [installing][1] Arvind Krishna as CEO and Red Hat CEO Jim Whitehurst as IBM president.  The company also named Red Hat veteran Paul Cormier as CEO of Red Hat. - -Krishna replaces long-time CEO Virginia Rometty, who will  retire at the end of the year, and the package of executive moves solidifies the team that will lead Big Blue into to [hybrid-cloud][2] world where it will battle Amazon, Google and Microsoft. - -[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] - -Right now, though, that team must also compete in the face the COVID-19 pandemic, an issue [Krishna][4] mentioned in a [letter he posted on LinkedIn][5] on his first day on the job, April 6. - -“During this challenging time, we all need to have empathy, solidarity, and understanding for each other…If there’s one thing that this public health crisis has brought to light it is the ever essential role of IBM in the world. We are the backbone of some of the most critical systems of the world. Our technologies and services help banks run credit-card transactions, businesses run supply chains, telcos connect customers, healthcare providers improve patient care, and companies and cities tackle cyberthreats,” Krishna wrote. - -IBM has been part of the technology community that is helping address COVID-19.  For example, [IBM Research][6] has been developing cloud and AI-powered technologies that can help researchers battle against coronavirus, in part by accelerating COVID-19 drug discovery.  - -IBM is also leading the [COVID-19 High Performance Computing Consortium][7] with AWS, Google, HPE, and Microsoft as well as US National Labs, NASA, and others to bring [high-performance computing][8] systems together to help researchers run massive modeling calculations. - -While COVID-19 is a focus for now, the long term-goal is developing cloud technologies. - -[][9] - -“I believe we can make IBM the most trusted technology partner of the 21st century. For this to happen, we have to ensure that IBM continues to innovate and lead in the transformational journeys our clients are on. Hybrid cloud and AI are two dominant forces driving change for our clients and must have the maniacal focus of the entire company,” he stated. - -### Linux, Kubernetes and containers - -Krishna also wrote about IBM’s strategic cloud directions going forward. “First, we have to deepen our understanding of IBM’s two strategic battles: the journey to hybrid cloud and AI. We all need to understand and leverage IBM’s sources of competitive advantage. Namely, our open source and security leadership, our deep expertise and trust, and the fact that we enable clients to build mission-critical applications once and run them anywhere,” Krishna stated. - -IBM also has to win the battle for architecting the cloud. “There’s a unique window of opportunity for IBM and Red Hat to establish [Linux][10], containers and Kubernetes as the new standard. We can make Red Hat OpenShift the default choice for hybrid cloud in the same way that Red Hat Enterprise Linux is the default choice for the operating system,” Krishna stated. - -When IBM closed its [acquisition][11] of Red Hat last July for $34 billion it was clear it would take on the hybrid-cloud market and now, especially with the current executive team in place, that path is set more solidly. - -Krishna, 57, was a principal architect of IBM’s $34 billion acquisition of Red Hat last year and was IBM’s senior vice president of Cloud and Cognitive Software. Red Hat said Cormier drove more than 25 acquisitions at Red Hat and is credited with pioneering the subscription model that transformed Red Hat from an open-source disruptor to an enterprise-technology mainstay. - -Also as part of the new team, IBM said it tapped Bank of America telecom and cloud-technology executive Howard Boville as senior vice president of cloud platform, overseeing the IBM Cloud. - -Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3536654/ibm-taps-new-leaders-for-hybrid-cloud-battles-ahead.html - -作者:[Michael Cooney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3518795/ibms-ceo-virginia-rometty-to-be-replaced-by-its-cloud-red-hat-chiefs.html -[2]: https://www.networkworld.com/article/3233132/what-is-hybrid-cloud-computing.html -[3]: https://www.networkworld.com/newsletters/signup.html -[4]: https://www.cnbc.com/video/2020/04/06/watch-cnbcs-full-interview-with-new-ibm-ceo-arvind-krishna.html?linkId=85936703 -[5]: https://www.linkedin.com/pulse/my-first-day-ceo-our-journey-together-arvind-krishna/?trackingId=SRWcJy7mSzagoHDTJX%2Br2Q%3D%3D -[6]: https://www.ibm.com/thought-leadership/covid19/ -[7]: https://www.networkworld.com/article/3533426/covid-19-tech-giants-government-agencies-add-supercomputing-to-the-fight.html -[8]: https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html -[9]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) -[10]: https://www.networkworld.com/article/3215226/what-is-linux-uses-featres-products-operating-systems.html -[11]: https://www.networkworld.com/article/3317517/the-ibm-red-hat-deal-what-it-means-for-enterprises.html -[12]: https://www.facebook.com/NetworkWorld/ -[13]: https://www.linkedin.com/company/network-world diff --git a/sources/news/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md b/sources/news/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md deleted file mode 100644 index bdff5b8ce2..0000000000 --- a/sources/news/20200411 New Linux integrity checker from Microsoft, Raspberry Pi-smart TV replacement from KDE, and more open source news.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (New Linux integrity checker from Microsoft, Raspberry Pi smart TV replacement from KDE, and more open source news) -[#]: via: (https://opensource.com/article/20/4/news-april-11) -[#]: author: (Ben Cotton https://opensource.com/users/bcotton) - -New Linux integrity checker from Microsoft, Raspberry Pi smart TV replacement from KDE, and more open source news -====== -Catch up on the biggest open source headlines from the past two weeks. -![][1] - -In this edition of our open source news roundup, we take a look at GNOME Foundation's new contributor program, a new Linux integrity checker from Microsoft, a free software alternative to smart TVs, and more! - -### GNOME Foundation launches a new contributor program - -A key part of keeping open source communities vibrant and healthy is bringing in new contributors. To help promote this, the GNOME Foundation and Endless teamed up to launch the inaugural [Community Engagement Challenge][2]. Phase one launched this week by opening the call for submitting project applications. Candidate projects should be aimed at bringing beginners into open source and encouraging ongoing participation in open source communities. Projects don’t have to be coding, they can also be games, videos, written materials, and so on. - -A panel of judges will select 20 projects to participate in phase two, where ideas will be turned into proofs of concept. At each phase, cash prizes will be awarded. [Proposals][3] are due July 1, 2020. - -### Microsoft announces code integrity checker for Linux - -When you run a program, you want it to be the one you think you’re running. This week, Microsoft announced [Integrity Policy Enforcement][4] (IPE), a Linux Security Model released under the GPLv2. - -IPE is targeted toward specific-purpose devices like network firewalls, not for general-purpose computing. It provides runtime verification that the code being executed matches the desired version. This allows administrators to detect and block altered binaries. - -IPE is currently in the Request for Comments stage on the [linux-security-module][5] mailing list. - -### KDE announces Plasma Bigscreen - -I recently bought a new TV and, if you haven’t been in the market lately, it’s hard to find “dumb” televisions. I didn’t want a smart TV because I worry about the manufacturer abandoning the software and what the device might do with my data. So KDE’s recent [Plasma Bigscreen][6] announcement caught my eye. - -Plasma Bigscreen takes the KDE Plasma interface I use every day and combines it with [Mycroft AI][7] to turn single-board computers into a smart TV. The beta, released last month, includes support for the Raspberry Pi 4 (Model B). - -### In other news - - * [IVPN for Android is now available on F-Droid][8] - * [IBM gives Outreachy $50,000 grant][9] - * [Warren For President Tech Team open source many of their projects][10] - * [Firefox 75.0 is released with a redesigned address bar and distribution via Flatpak][11] - * [LineageOS releases version 17.1 based on Android 10][12] - * [Linux kernel 5.6 released][13] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/news-april-11 - -作者:[Ben Cotton][a] -选题:[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/bcotton -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/weekly_news_roundup_tv.png?itok=tibLvjBd -[2]: https://www.gnome.org/challenge -[3]: https://surveys.gnome.org/index.php/986379?lang=en -[4]: https://microsoft.github.io/ipe/ -[5]: https://lore.kernel.org/linux-security-module/20200406181045.1024164-1-deven.desai@linux.microsoft.com/T/#m297116cd00666428c2ae3e627ff39653ebb691fb -[6]: https://dot.kde.org/2020/03/26/plasma-tv-presenting-plasma-bigscreen -[7]: https://mycroft.ai/ -[8]: https://www.ivpn.net/blog/ivpn-for-android-is-now-available-on-f-droid -[9]: https://developer.ibm.com/blogs/ibm-second-open-source-community-grant-outreachy/ -[10]: https://medium.com/@teamwarren/open-source-tools-from-the-warren-for-president-tech-team-f1f27d2c7551 -[11]: https://www.mozilla.org/en-US/firefox/75.0/releasenotes/ -[12]: https://lineageos.org/Changelog-24/ -[13]: https://lore.kernel.org/lkml/CAHk-=wi9ZT7Stg-uSpX0UWQzam6OP9Jzz6Xu1CkYu1cicpD5OA@mail.gmail.com/ diff --git a/sources/tech/20200406 Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube.md b/sources/tech/20200406 Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube.md deleted file mode 100644 index 6c6c84e084..0000000000 --- a/sources/tech/20200406 Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube.md +++ /dev/null @@ -1,107 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube) -[#]: via: (https://itsfoss.com/lbry/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube -====== - -_**LBRY is a new Blockchain-based, open source platform for sharing digital content. It is gaining popularity as a decentralized alternative to YouTube but LBRY is more than just a video sharing service.**_ - -### LBRY is an open source blockchain based platform for content sharing - -At the core of it, [LBRY][1] is a new protocol which is a peer to peer, decentralized file sharing and payment network secured by [blockchain][2] technology. Anyone can build apps on top of LBRY protocol that interact with digital content on the LBRY network. But these technical stuff is for developers. - -As a user you can use [LBRY platform][3] for watching videos, listening to music and reading eBooks. - -As a content creator, you can use LBRY to share your digital content like video, music, images, podcasts, eBooks etc. - -Unlike YouTube, your activities are not tracked to serve you ads. In fact, LBRY is ad free. If you are logged into the network, you won’t see any ads anywhere on its website. - -### No ads, and you may even earn cryptocurrency for viewing videos on LBRY - -The LBRY is ‘governed’ by its own cryptocurrency called LBC (LBRY Credits). - -Like any other cryptocurrency, you can mine it, buy it or get it from someone else. Content creators can set a price in LBC for streaming their content or they can provide it for free and get tipped in LBC by the viewers. - -Don’t worry, you don’t necessarily need to buy LBC. Since its new, you’ll get LBC as rewards for doing simple tasks as viewing videos, exploring LBRY, following channels etc. In fact, you’ll get a few LBC simply for creating an account at LBRY and setting up your profile. - -![LBRY Rewards Sample][4] - -You’ll also get LBC in rewards for inviting other users to LBRY platform. For example, if you join [LBRY from It’s FOSS invite link][5], both you and I get LBC as reward. - -The LBRY reward system will change once the platform grows. Remember initially Bitcoins were also readily available and now it values thousands of dollars. - -### Open source, peer to peer, blockchain: LBRY ticks all the right blocks for a privacy-aware user - -![LBRY interface][6] - -While the cyptocurrency is essential to create a fair and open marketplace in LBRY, its main feature is the peer to peer, decentralized network using blockchain. LBRY puts emphasis on treating you as user, not a product. - -Everything built to power LBRY is open source. You can find the entire source code on its GitHub repository. - -[LBRY on GitHub][7] - -The [LBRY FAQ page][8] is a good resource to know more about LBRY and how it works. - -### Using LBRY - -![][9] - -If you want to give LBRY a try, you can check out its [video sharing platform][3]. If you are logged in or using its app, you won’t see any ads. - -Creating an account on LBRY will also let you get the LBRY rewards (i.e. the LBC cryptocurrency). You can watch the videos on LBRY web site or on its application. - -I have noticed that video streaming is slightly faster when you use the app instead of web browser. [LBRY app is available][10] for Linux, Windows, macOS, iOS and Android. - -As a web publisher, It’s FOSS is on all major social media channels. We appreciate and respect such decentralized services and try to make a presence on such offbeat platform. You can [find us on Mastodon][11], a [decentralized alternative to Twitter][12]. You can also find It’s FOSS on LBRY. - -While we will be putting our video content primarily on YouTube and Vimeo (for ad-free experience), our YouTube content will be automatically available on LBRY as well. - -So if you are going to use LBRY, you can follow us there to watch all our videos on LBRY. - -[Join LBRY and follow It’s FOSS][5] - -### Conclusion - -There may not be a lot of content on LBRY right now. LBRY is trying to encourage and reward creators who publish on LBRY first instead of YouTube. - -LBRY is in early stages but its team is working hard to become a viable alternative to YouTube. It has an open road map where they have shared an insight into all their future plans. You may [check it out yourself][13]. - -By the way, LBRY is not the only platform of this kind. [PeerTube][14] is a similar service that provides a peer to peer video sharing platform. - -_**If you are someone who doesn’t like tech giants like Google, Microsoft, Huawei ‘spying’ on your data, keeping a profile of you to serve you targeted ads, you may try platforms like PeerTube and LBRY.**_ - -What do you think of LBRY? Are you already using something like LBRY or PeerTube? If not, are you willing to give it a try? What’s your overall feeling about P2P platforms like LBRY? Do share your views in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/lbry/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://lbry.com/ -[2]: https://en.wikipedia.org/wiki/Blockchain -[3]: https://lbry.tv/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry-rewards-sample.png?ssl=1 -[5]: https://lbry.tv/$/invite/@itsfoss:0 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry.png?ssl=1 -[7]: https://github.com/lbryio/ -[8]: https://lbry.com/faq -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry-interface.jpg?ssl=1 -[10]: https://lbry.com/get -[11]: https://mastodon.social/@itsfoss -[12]: https://itsfoss.com/mastodon-open-source-alternative-twitter/ -[13]: https://lbry.com/roadmap -[14]: https://joinpeertube.org/ From 5f6bcac98e74530fd706e00a4e6dee56aa5a5f74 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 20 Apr 2020 00:54:12 +0800 Subject: [PATCH 0375/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200419=20A=20?= =?UTF-8?q?stress-free=20guide=20to=20keeping=20WordPress=20sites=20update?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200419 A stress-free guide to keeping WordPress sites updated.md --- ...uide to keeping WordPress sites updated.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20200419 A stress-free guide to keeping WordPress sites updated.md diff --git a/sources/tech/20200419 A stress-free guide to keeping WordPress sites updated.md b/sources/tech/20200419 A stress-free guide to keeping WordPress sites updated.md new file mode 100644 index 0000000000..98ee9b1b1e --- /dev/null +++ b/sources/tech/20200419 A stress-free guide to keeping WordPress sites updated.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A stress-free guide to keeping WordPress sites updated) +[#]: via: (https://opensource.com/article/20/4/updating-wordpress) +[#]: author: (Sara Kelly https://opensource.com/users/sarapk) + +A stress-free guide to keeping WordPress sites updated +====== +This practical guide to a necessary task will show you how to maximize +site performance and avoid bugs and other issues with regular updates. +![Working from home at a laptop][1] + +We all know how important it is to keep WordPress sites updated. New updates provide the latest bug and security fixes against any nasties lurking on the web. But, more critically, an outdated site can also lead to poor performance, such as slow loading speed or an outdated look and feel. + +Unfortunately, keeping your WordPress site up-to-date is not as easy as clicking a button. There are several components to consider, from theme to plugins to PHP. Even worse, updating too quickly can wreak another kind of havoc. Have you ever experienced the dreaded, "There has been a critical error on your website" warning after an innocent little update? I know I have, many times! + +Here is a practical guide on what to look out for, as well as when and what to update, to ensure your WordPress site works well. + +### Updating WordPress + +Let's start with the basics. Check your WordPress version is up-to-date by visiting Dashboard > Updates. + +![WordPress update screen][2] + +### Choosing a WordPress theme + +Before we deep dive into updating themes, I'd like to take a few steps back. Choose an up-to-date theme from the get-go and do your homework before installing it! There is nothing worse than pouring your heart and soul into customizing a new theme, only to discover it is buggy. + +Questions to ask when choosing a theme include: + + * When was it first created? + * What is the current version available? + * Does the theme provider still maintain an active demo site and helpdesk? + * What do recent reviews say about the theme? + + + +If the theme provider is no longer maintaining the theme, save yourself the trouble and move on. Also, don't assume that just because you paid for a theme, that is necessarily maintained. I recently fell into this trap when I purchased [Pinable][3]. I loved the Pinterest look and feel. However, soon after installation, I noticed the lack of customization within the theme settings, major compatibility issues arose with my plugins, and the customer service was nonexistent. I should have known better. The theme was created in 2013 and selling for a bargain. + +If you already have a theme, then pay attention to how frequently updates become available. If there are never any updates, the theme provider may have closed up shop. It is only a matter of time before the impact of an outdated theme will cause problems. + +A quick aside while we are on the topic—up-to-date themes also give access to the two new alignment options in the WordPress block editor, which enable wide-width and full-width images. These help your blog posts look more professional. While there are a number of [tutorials][4] on the web that show you how to manually update your functions, PHP file, and CSS to enable the new alignment blocks, the code does not always work on older themes (especially masonry themes). + +![Wordpress theme][5] + +### Updating themes + +To check the current version of your theme, go to Appearance > Themes and click on the active theme to see the current version. If an upgrade is available, there will be an alert banner. Click on "update now" to initiate the update. You can also check for updates by going to Dashboard > Updates. + +![Themify screenshot][6] + +If you purchased a theme from a marketplace such as [Envato][7] or [Themify][8], check the theme documentation to learn what is required to initiate updates, as it will not show up automatically in the dashboard. In most cases, you will be required to download and install a specific plugin or manually upload new versions when they become available. In the latter case, you will need to delete or rename the old theme file via your cPanel before you can install the new one. A guide to installing themes via cPanel is available [here][9]. + +If you plan to customize your theme extensively and are worried about the impact of this when upgrading, consider creating a child theme first. A child theme lets you make changes without touching the original theme's code. You can then update your site without losing any customizations you've made. Read more about child themes [here][10]. + +As I said before, the source of most issues tends to be the theme. Learn what is required to keep your theme up to date, and do so regularly. If your theme provider is no longer creating updates, then find a new theme. + +### Easy does it for plugins + +If you manage multiple plugins, then you will be used to the frequent dashboard reminders to update! Before we get onto that, though, let's touch on some basics. + +As a general rule, you don't want to have too many plugins. They slow down the speed of your site by creating more code that the browser has to load. Always delete any inactive plugins. I prefer to manage plugins on the Plugins tab. Here you can see all active and inactive plugins, the current version, and whether an update is available. To update the plugin, simply click "update." + +![Plugin update page][11] + +Nonetheless, I implore you to wait a week or two before installing new updates. Updating my plugins too quickly has caused me no end of grievances. To begin with, updates are prone to human error. Don't be the guinea pig that tests out the latest version. Sometimes, the newest version of a plugin is not compatible with an older version of WordPress or your theme. Check these are up-to-date first. + +### Website down after updating plugins? + +If your site has stopped working or performance has dropped noticeably after updating your plugins, then all is not lost. Forget about those newfangled plugins that promise to test speed and identify buggy plugins (the last thing you want is more plugins)! Disable all your plugins, then activate one at a time while you test the speed and performance of your site on a website such as [Pingdom][12]. This is a great exercise to perform periodically, even if your website has not crashed. Once you identify the plugin causing the problem, delete it. + +In the event you cannot access WordPress because there is a critical error, then you will need to access your files via cPanel and delete all the plugin folders from there ([full instructions here][13]). Don't worry; doing this will not impact your website's content. You can then proceed to reinstall and activate the plugins one-by-one via WordPress. + +Cache plugins tend to be the biggest culprit in my experience. Issues with cache plugins can be minimized by clearing the cache frequently. Do not install multiple cache plugins that perform the same function, as they will only serve to slow down your site. The only way to truly get around cache plugin issues is to either not use them, use a plugin recommended by your hosting provider, or become an expert on cache. [This blog][14] on common cache issues in WordPress is a good place to start. + +### Back up before updating PHP + +If you are concerned about your website speed and have spent enough time browsing Google for answers, then you likely have seen the advice, "You gotta update your PHP!" Please tread carefully with manual PHP updates, though! If you have a good hosting provider, you should never need to do this. Rather, select the option for automatic PHP version management with your host. Newer versions of PHP may not be stable or compatible with the version of WordPress you are running. Let your hosting provider be the one to determine when updates are ready. + +However, if you are adamant that an old version of PHP is causing your website to be slow, take care to follow these steps before initiating an update. First, back up your site. Investing in a premium version of [Jetpack][15] is worth its weight in gold. Jetpack can perform real-time as well as daily backups, depending on your plan. Not to mention, their customer service and troubleshooting support are excellent. Secondly, inform your hosting provider that you plan to update the PHP and seek their advice first. If your host is unable to advise or wants to charge you for the privilege, you should probably think about changing hosts. + +You can update PHP either via cPanel or via your hosting platform under Devs > PHP Manager. After that, you are on your own, as that is where my expertise on PHP ends. + +If you have any other tips or pitfalls regarding updating WordPress, drop them in the comments box below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/updating-wordpress + +作者:[Sara Kelly][a] +选题:[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/sarapk +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) +[2]: https://opensource.com/sites/default/files/uploads/wp_update_1.png (Wordpress update screen) +[3]: https://www.theme-junkie.com/themes/pinable/ +[4]: https://www.billerickson.net/full-and-wide-alignment-in-gutenberg/ +[5]: https://opensource.com/sites/default/files/uploads/wp_theme_2.png (Wordpress theme) +[6]: https://opensource.com/sites/default/files/uploads/themify_3.png (Themify screenshot) +[7]: https://elements.envato.com/ +[8]: https://themify.me/ +[9]: https://hostadvice.com/how-to/how-to-install-a-wordpress-theme-using-cpanel/ +[10]: https://developer.wordpress.org/themes/advanced-topics/child-themes/ +[11]: https://opensource.com/sites/default/files/uploads/plugins_4.png (Plugin update page) +[12]: https://tools.pingdom.com/ +[13]: https://www.wpbeginner.com/plugins/how-to-deactivate-all-plugins-when-not-able-to-access-wp-admin/ +[14]: https://mhthemes.com/support/knb/solving-common-cache-issues-on-wordpress-websites/ +[15]: https://jetpack.com/upgrade/backup/?utm_source=google&utm_campaign=google_jetpack_search_brand_desktop_sg_en&utm_medium=paid_search&utm_term=%2Bwordpress%20%2Bjetpack%20%2Bbackup&creative=379260213317&campaignid=2061290863&utm_content=77066462603&matchtype=b&device=c&network=g&gclid=Cj0KCQjwu6fzBRC6ARIsAJUwa2RuPx5Dzr72eBEtZegsf11MmOBgLiwLX2HcEUXVaULIgv1MdZqGmeAaArmFEALw_wcB&gclsrc=aw.ds From 55587d534b294fd5c86e73074710039f9bbb8e85 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 20 Apr 2020 08:42:36 +0800 Subject: [PATCH 0376/1809] translated --- ...or creating Raspberry Pi SD card images.md | 75 ------------------- ...or creating Raspberry Pi SD card images.md | 75 +++++++++++++++++++ 2 files changed, 75 insertions(+), 75 deletions(-) delete mode 100644 sources/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md create mode 100644 translated/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md diff --git a/sources/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md b/sources/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md deleted file mode 100644 index 133a389f91..0000000000 --- a/sources/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md +++ /dev/null @@ -1,75 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (A handy utility for creating Raspberry Pi SD card images) -[#]: via: (https://opensource.com/article/20/4/raspberry-pi-imager-mac) -[#]: author: (James Farrell https://opensource.com/users/jamesf) - -A handy utility for creating Raspberry Pi SD card images -====== -Getting started with Raspberry Pi Imager on a Mac. -![Raspberries with pi symbol overlay][1] - -There are many ways to buy a Raspberry Pi, and depending on who you buy it from, it may or may not come with an operating system already installed on it. Getting an OS onto a Raspberry Pi is a matter of "flashing" an SD card with an OS image. To make this as easy as possible, the [Raspberry Pi Foundation][2] has introduced a Raspberry Pi Imager application, and you can download it for all major platforms. Here's a quick intro to this helpful new utility. - -### Install the Imager - -You can find the Raspberry Pi Imager over at the usual [Raspberry Pi Downloads][3] page. Versions exist for Mac, Ubuntu, and Windows. I will download and demonstrate the Mac version. - -Installation on Mac consists of the usual DMG image that mounts to your desktop, and then a typical installer window appears: - -![Raspberry Pi Imager installer][4] - -Simply drag the cute raspberry icon to the Application folder, and you are done. Invoke that from Launchpad, and you are presented with a series of simple buttons and menus to choose from. It really cannot be simpler than this: - -![Raspberry Pi Imager home screen][5] - -### Images and options available - -The default options contain a variety of images for various Raspberry Pi models. Raspbian is the top choice with two available options for smaller "Lite" and fatter "Full" versions available. The LibreELEC Kodi entertainment system is available in various model-specific builds. Ubuntu 18 and 19 have 32-bit and 64-bit builds available for different Pi models. There is an RPi 4 EEPROM recovery utility and a function to format your card using FAT32. Finally, a generic image installer option is available that I will try out a little later. Pretty handy for a simple and compact utility. - -### Install some images - -I had a 16g micro SD card that I decided to play with. I selected the default Raspbian image, chose my attached USB/SD device, and pressed WRITE. Here is a brief demo: - -![Raspberry Pi Imager demo][6] - -I didn't post the entire sequence there. I believe it downloaded the image as it was writing and took a few minutes on my wireless connection to finish. The process goes through a write and then a verify cycle before it is finished. When it was done, I ejected the device, popped the card into my RPi 3, and was treated to the usual graphical Raspbian setup wizard and desktop environment. - -That wasn't quite enough for me; I get plenty of Linux on a daily basis and was looking for a little more today. I went back to the [Raspberry Pi Downloads][3] page and pulled down the RISC OS image. This process was nearly as easy. Download the RISCOSPi.5.24.zip file, extract it, and find the ro524-1875M.img file. From the Operating System button, I selected the Use Custom option and selected the desired image file. The process was pretty much the same; the only real difference being I had to hunt around my Downloads directory and select an image. Once the file was finished writing, back into the Pi 3, and RISC OS was ready to go. - -### Gripes on USB C - -This is just a silly aside, but how many of you are a bit frustrated with the total inconvenience of USB C these days? I'm using a MacBook Pro, which only has USB C ports, and I am subject to a never-ending swap of adapters to get things done. Take a look at this: - -![USB C adapter][7] - -Yes, that is a USB C to USB A adapter, then a USB to SD card reader, and an SD to micro SD adapter inside. I probably could have found something online to simplify this, but these are the parts I had on hand to support my family's myriad Mac, Windows, and Linux hosts. Enough about that, but I hope you got a chuckle from that insanity. - -### Summary - -The new Raspberry Pi Imager is a simple and effective tool for getting off the ground quickly with Raspberry Pi images. [BalenaEtcher][8] is a similar tool for imaging your removable devices, but this new Raspberry Pi Imager makes the process of common RPi OS installations (like Raspbian) a bit easier by eliminating the steps to fetch those common images. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/raspberry-pi-imager-mac - -作者:[James Farrell][a] -选题:[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/jamesf -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-raspberrypi_0.png?itok=Kczz87J2 (Raspberries with pi symbol overlay) -[2]: https://www.raspberrypi.org/ -[3]: https://www.raspberrypi.org/downloads/ -[4]: https://opensource.com/sites/default/files/uploads/install_1.png (Raspberry Pi Imager installer) -[5]: https://opensource.com/sites/default/files/uploads/screen_2_0.png (Raspberry Pi Imager home screen) -[6]: https://opensource.com/sites/default/files/uploads/demo_3.gif (Raspberry Pi Imager demo) -[7]: https://opensource.com/sites/default/files/uploads/adapter_4.png (USB C adapter) -[8]: https://www.balena.io/etcher/ diff --git a/translated/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md b/translated/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md new file mode 100644 index 0000000000..c70870d6e0 --- /dev/null +++ b/translated/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A handy utility for creating Raspberry Pi SD card images) +[#]: via: (https://opensource.com/article/20/4/raspberry-pi-imager-mac) +[#]: author: (James Farrell https://opensource.com/users/jamesf) + +一个方便的用于创建树莓派 SD 卡镜像的程序 +====== +开始在 Mac 上使用 Raspberry Pi Imager +![Raspberries with pi symbol overlay][1] + +有多种购买树莓派的方法,同时树莓派会取决于你从哪里购买的从而可能附带或不附带操作系统。将操作系统安装到树莓派上就是用系统镜像“刷新” SD 卡。为了使之尽可能简单,[树莓派基金会][2]引入了 Raspberry Pi Imager,你可以将其下载到所有主流平台。以下这个有用的新工具介绍。 + +### 安装 Imager + +你通常可以在[树莓派下载][3]页面上找到 Raspberry Pi Imager。它有 Mac、Ubuntu 和 Windows 版本。我将下载并演示 Mac 版本。 + +Mac 的安装包是常规的 DMG 镜像,它会挂载到你的桌面,然后经典的安装界面就会出现: + +![Raspberry Pi Imager installer][4] + +只需将可爱的树莓图标拖到 Application 文件夹,就可以完成。从 Launchpad 中调用它,你会看到一系列简单的按钮和菜单供你选择。真的不能比这更简单了: + +![Raspberry Pi Imager home screen][5] + +### 可用的镜像和选项 + +默认选项包含各种树莓派型号的镜像。Raspbian 是首选,它有两个可用的选项,较小的 “Lite” 版本和较大的 “Full” 版本。LibreELEC Kodi 娱乐系统有各种特定于型号的版本。Ubuntu 18 和 19 有适用于不同树莓派型号的 32 位和 64 位版本。有一个 RPi 4 EEPROM 恢复程序,以及使用 FAT32 格式化卡的功能。最后,有一个通用的镜像安装程序选项,稍后我将进行尝试。这个简单而紧凑的程序非常方便。 + +### 安装一些镜像 + +我决定使用 16g 的 micro SD 卡。我选择了默认的 Raspbian 镜像,选择已连接的 USB/SD 设备,然后按下 WRITE。这是一个简短的演示: + +![Raspberry Pi Imager demo][6] + +我没有在此处发布完整信息。我相信它在下载镜像后写入,对于我的无线连接这花费了几分钟完成。该过程在完成之前先经过写入,然后经过验证周期。完成后,我弹出设备,并将卡插入到我的 RPi 3 中,然后按照通常的图形 Raspbian 安装向导和桌面环境进行设置。 + +这对我来说还不够。我每天都会下载许多 Linux,今天我还在寻找更多。我回到了[树莓派下载][3]页面,并下载了 RISC OS 镜像。这个过程几乎一样容易。下载 RISCOSPi.5.24.zip 文件,将其解压缩,然后找到 ro524-1875M.img 文件。在 “Operating System” 按钮中,我选择了 “Use Custom” 并选择了所需的镜像文件。这个过程几乎是相同的。唯一真正的区别是我必须在下载目录中搜寻并选择一个镜像。文件写完后,回到树莓派 3,RISC OS 可以使用了。 + +### 对 USB C 的抱怨 + +顺便说一句,如今有多少人对 USB C 带来的不便感到沮丧?我使用的是只有 USB C 口的 MacBook Pro,我需要不断更换适配器才能完成工作。看看这个: + +![USB C adapter][7] + +是的,那是一个 USB C 到 USB A 适配器,然后是一个 USB 到 SD 卡读卡器,以及一个 SD 到 micro SD 适配器。我可能可以在网上找到一些东西来简化此过程,但这是支持我家五花八门的 Mac、Windows 和 Linux 主机的部分。够了,但我希望你能从这种混乱中得到一笑。 + +### 总结 + +新的 Raspberry Pi Imager 是一种简单有效的工具来快速烧录树莓派镜像。[BalenaEtcher][8] 是用于对可移动设备进行烧录的类似工具,但是新的 Raspberry Pi Imager 通过消除获取那些常见镜像的步骤,使普通树莓派系统安装(如 Raspbian)更加容易。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/raspberry-pi-imager-mac + +作者:[James Farrell][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jamesf +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-raspberrypi_0.png?itok=Kczz87J2 (Raspberries with pi symbol overlay) +[2]: https://www.raspberrypi.org/ +[3]: https://www.raspberrypi.org/downloads/ +[4]: https://opensource.com/sites/default/files/uploads/install_1.png (Raspberry Pi Imager installer) +[5]: https://opensource.com/sites/default/files/uploads/screen_2_0.png (Raspberry Pi Imager home screen) +[6]: https://opensource.com/sites/default/files/uploads/demo_3.gif (Raspberry Pi Imager demo) +[7]: https://opensource.com/sites/default/files/uploads/adapter_4.png (USB C adapter) +[8]: https://www.balena.io/etcher/ From 5f78e01ff3fe0a3172f431bea85d83d5fa3b7c33 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 20 Apr 2020 08:48:45 +0800 Subject: [PATCH 0377/1809] translating --- ...8 Ethernet consortium announces completion of 800GbE spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20200418 Ethernet consortium announces completion of 800GbE spec.md b/sources/news/20200418 Ethernet consortium announces completion of 800GbE spec.md index a7a6bf1c1a..3a687f8800 100644 --- a/sources/news/20200418 Ethernet consortium announces completion of 800GbE spec.md +++ b/sources/news/20200418 Ethernet consortium announces completion of 800GbE spec.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 772f4d8bbeebfb04a0fe415c3151f39b8c297cfb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 Apr 2020 10:43:55 +0800 Subject: [PATCH 0378/1809] PRF @lxbwolf --- ...28 Getting started with Linux firewalls.md | 96 +++++++++---------- 1 file changed, 43 insertions(+), 53 deletions(-) diff --git a/translated/tech/20200228 Getting started with Linux firewalls.md b/translated/tech/20200228 Getting started with Linux firewalls.md index 93cc37289e..1300d21fcd 100644 --- a/translated/tech/20200228 Getting started with Linux firewalls.md +++ b/translated/tech/20200228 Getting started with Linux firewalls.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with Linux firewalls) @@ -9,17 +9,18 @@ Linux 防火墙入门教程 ====== -防火墙是你的计算机防止网络入侵的第一道屏障。为确保你的安全,请下载我们的备忘单。 -![Cheat Sheet cover image][1] -合理的防火墙是你的计算机防止网络入侵的第一道屏障。你在家里上网,通常互联网服务提供会在路由中搭建一层防火墙。如果不在家里上网,那么你计算机上的那层防火墙就是仅有的一层,因为配置和控制好你 Linux 电脑上的防火墙很重要。如果你维护一台 Linux 服务器,知道怎么去管理你的防火墙同样重要,只要掌握了这些知识你才能保护你的服务器免于本地或远程非法流量的入侵。 +> 防火墙是你的计算机防止网络入侵的第一道屏障。为确保你的安全,请下载我们的备忘单。 + +![](https://img.linux.net.cn/data/attachment/album/202004/20/104205paugcytauqctqw6c.jpg) + +合理的防火墙是你的计算机防止网络入侵的第一道屏障。你在家里上网,通常互联网服务提供会在路由中搭建一层防火墙。当你离开家时,那么你计算机上的那层防火墙就是仅有的一层,所以配置和控制好你 Linux 电脑上的防火墙很重要。如果你维护一台 Linux 服务器,那么知道怎么去管理你的防火墙同样重要,只要掌握了这些知识你才能保护你的服务器免于本地或远程非法流量的入侵。 ### 安装防火墙 -很多 Linux 发行版本已经自带了防火墙,通常是 `iptables`。它很强大并可以自定义,但配置起来有点复杂。幸运的是,有开发者写出了一些前端界面来帮助用户不需要写冗长的 iptables 规则就可以控制防火墙。 - -在 Fedora,CentOS,Red Hat 和一些类似的发行版本上,默认安装的防火墙软件是 `firewalld`,是用 **firewall-cmd** 命令来配置和控制的。在 Debian 和大部分其他发行版上,可以从你的软件仓库安装 firewalld。Ubuntu 自带的是 Uncomplicated Firewall(ufw),所以你必须打开 **universe** 库才能使用 firewalld: +很多 Linux 发行版本已经自带了防火墙,通常是 `iptables`。它很强大并可以自定义,但配置起来有点复杂。幸运的是,有开发者写出了一些前端程序来帮助用户控制防火墙,而不需要写冗长的 iptables 规则。 +在 Fedora、CentOS、Red Hat 和一些类似的发行版本上,默认安装的防火墙软件是 `firewalld`,通过 `firewall-cmd` 命令来配置和控制。在 Debian 和大部分其他发行版上,可以从你的软件仓库安装 firewalld。Ubuntu 自带的是简单防火墙Uncomplicated Firewall(ufw),所以要使用 firewalld,你必须启用 `universe` 软件仓库: ``` $ sudo add-apt-repository universe @@ -28,87 +29,76 @@ $ sudo apt install firewalld 你还需要停用 ufw: - ``` -`$ sudo systemctl disable ufw` +$ sudo systemctl disable ufw ``` -没有理由*不*用 ufw。它是一个强大的防火墙前端。然而,本文重点讲 firewalld,因为大部分发行版都支持它而且它集成到了 systemd,systemd 是几乎所有发行版都自带的。 - -不管你的发行版是哪个,都要先激活防火墙才能让它生效,激活需要在启动时加载: +没有理由*不用* ufw。它是一个强大的防火墙前端。然而,本文重点讲 firewalld,因为大部分发行版都支持它而且它集成到了 systemd,systemd 是几乎所有发行版都自带的。 +不管你的发行版是哪个,都要先激活防火墙才能让它生效,而且需要在启动时加载: ``` -`$ sudo systemctl enable --now firewalld` +$ sudo systemctl enable --now firewalld ``` -### 理解防火墙的 zone +### 理解防火墙的域 -Firewalld 旨在让防火墙的配置工作尽可能简单。它通过建立 *zone* 来实现这个目标。一个 zone 是一类型的合理、通用的规则,这些规则适配大部分用户的日常需求。 +Firewalld 旨在让防火墙的配置工作尽可能简单。它通过建立zone来实现这个目标。一个域是一组的合理、通用的规则,这些规则适配大部分用户的日常需求。默认情况下有九个域。 - * **trusted:** 接受所有的连接。这是最低级别的防火墙设置,只能在一个完全信任的环境中,如测试实验室或网络中相互都认识的家庭网络中。 - * **home, work, internal: **在这三个 zone 中,接受大部分来的连接。它们每个都会拒绝不活跃的端口进来的流量。这三个都适合用于家庭环境中,因为在家庭环境中不会出现端口模糊的网络流量,在家庭网络中你可以基本信任其他的用户。 - * **public:** 用于公共区域内。这是个极端的设置,当你不信任网络中的其他计算机时使用。只能接收经过选择的和基本安全的连接。 - * **dmz:** DMZ 表示隔离区。这个 zone 多用于可公开访问的计算机,属于某个组织的外部网络不能完全访问内网的计算机。对于个人计算机,它没什么用,但是对某类服务器来说它是个很重要的选项。 - * **external:** 用于外部网络,会开启伪装(你私人网络的地址被映射到一个外网 IP 地址,并隐藏起来)。跟 DMZ 类似,仅接受经过选择的连接,包括 SSH。 - * **block:** 仅接收在本系统中初始化的网络连接。接收到的任何网络连接都会被 **icmp-host-prohibited** 信息拒绝。这个一个极度偏激的设置,对于某类服务器或处于不信任或不安全的环境中的个人计算机来说很重要。 - * **drop:** 接收的所有网络包都被丢弃,没有任何回复。仅能有发送出去的网络连接。比这个设置更极端的办法,只有关闭 WiFi 和拔掉网线。 - - - -你可以查看你发行版本的所有 zone,或通过配置文件 **/usr/lib/firewalld/zones** 来查看管理员设置。举个例子:下面是 Fefora 31 自带的 FedoraWorkstation zone: + * `trusted`:接受所有的连接。这是最不偏执的防火墙设置,只能用在一个完全信任的环境中,如测试实验室或网络中相互都认识的家庭网络中。 + * `home`、`work`、`internal`:在这三个域中,接受大部分进来的连接。它们各自排除了预期不活跃的端口进来的流量。这三个都适合用于家庭环境中,因为在家庭环境中不会出现端口不确定的网络流量,在家庭网络中你一般可以信任其他的用户。 + * `public`:用于公共区域内。这是个偏执的设置,当你不信任网络中的其他计算机时使用。只能接收选定的常见和最安全的进入连接。 + * `dmz`:DMZ 表示隔离区。这个域多用于可公开访问的、位于机构的外部网络、对内网访问受限的计算机。对于个人计算机,它没什么用,但是对某类服务器来说它是个很重要的选项。 + * `external`:用于外部网络,会开启伪装(你的私有网络的地址被映射到一个外网 IP 地址,并隐藏起来)。跟 DMZ 类似,仅接受经过选择的传入连接,包括 SSH。 + * `block`:仅接收在本系统中初始化的网络连接。接收到的任何网络连接都会被 `icmp-host-prohibited` 信息拒绝。这个一个极度偏执的设置,对于某类服务器或处于不信任或不安全的环境中的个人计算机来说很重要。 + * `drop`:接收的所有网络包都被丢弃,没有任何回复。仅能有发送出去的网络连接。比这个设置更极端的办法,唯有关闭 WiFi 和拔掉网线。 +你可以查看你发行版本的所有域,或通过配置文件 `/usr/lib/firewalld/zones` 来查看管理员设置。举个例子:下面是 Fefora 31 自带的 `FedoraWorkstation` 域: ``` $ cat /usr/lib/firewalld/zones/FedoraWorkstation.xml -<?xml version="1.0" encoding="utf-8"?> -<zone> -  <short>Fedora Workstation</short> -  <description>Unsolicited incoming network packets are rejected from port 1 to 1024, except for select network services. Incoming packets that are related to outgoing network connections are accepted. Outgoing network connections are allowed.</description> -  <service name="dhcpv6-client"/> -  <service name="ssh"/> -  <service name="samba-client"/> -  <port protocol="udp" port="1025-65535"/> -  <port protocol="tcp" port="1025-65535"/> -</zone> + + + Fedora Workstation + Unsolicited incoming network packets are rejected from port 1 to 1024, except for select network services. Incoming packets that are related to outgoing network connections are accepted. Outgoing network connections are allowed. + + + + + + ``` -### 获取当前的 zone - -任何时候你都可以通过 **\--get-active-zones** 选项来查看你是在哪个 zone +### 获取当前的域 +任何时候你都可以通过 `--get-active-zones` 选项来查看你处于哪个域: ``` -`$ sudo firewall-cmd --get-active-zones` +$ sudo firewall-cmd --get-active-zones ``` -输出结果中,会有当前活跃的 zone 名字和分配给它的网络接口。笔记本电脑上,在默认 zone 中通常意味着你有个 WiFi 卡: - +输出结果中,会有当前活跃的域的名字和分配给它的网络接口。笔记本电脑上,在默认域中通常意味着你有个 WiFi 卡: ``` FedoraWorkstation   interfaces: wlp61s0 ``` -### 修改你当前的 zone - -把你的网络接口分配给另一个 zone,就可以改变 zone。例如,把例子中的 **wlp61s0** 卡修改为 public zone: +### 修改你当前的域 +要更改你的域,请将网络接口重新分配到不同的域。例如,把例子中的 `wlp61s0` 卡修改为 public 域: ``` -$ sudo firewall-cmd --change-interface=wlp61s0 \ -\--zone=public +$ sudo firewall-cmd --change-interface=wlp61s0 --zone=public ``` -你可以为一个接口修改活跃的 zone,不管出于什么理由 — 无论你是要出去喝杯咖啡还是感觉有必要增强笔记本电脑的安全策略,无论是你要去工作需要开启某些端口才能进入内联网,还是任何其他的理由。在你凭记忆学会 **firewall-cmd** 命令之前,你只要记住了关键词 ”change“ 和 ”zone“,就可以慢慢掌握,因为按下 **Tab** 时,它的选项会自动补全。 +你可以在任何时候、任何理由改变一个接口的活动域 —— 无论你是要去咖啡馆,觉得需要增加笔记本的安全策略,还是要去上班,需要打开一些端口进入内网,或者其他原因。在你凭记忆学会 `firewall-cmd` 命令之前,你只要记住了关键词 `change` 和 `zone`,就可以慢慢掌握,因为按下 `Tab` 时,它的选项会自动补全。 ### 更多信息 -你可以用你的防火墙干更多的事,比如自定义已存在的 zone,设置默认的 zone,等等。你对防火墙越了解,你在网上的活动就越安全,所以我们创建了一个[备忘单][2]便于速查和参考。 +你可以用你的防火墙干更多的事,比如自定义已存在的域,设置默认域,等等。你对防火墙越了解,你在网上的活动就越安全,所以我们创建了一个[备忘单][2]便于速查和参考。 -### 下载你的 [防火墙备忘单][2] - -David Both分享了他是怎样用树莓派 2 替换他的专用网络防火墙电脑的。 +- 下载你的 [防火墙备忘单][2]。 -------------------------------------------------------------------------------- @@ -117,7 +107,7 @@ via: https://opensource.com/article/20/2/firewall-cheat-sheet 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5921ebb846f715a5ce951c218c2037ff3816f70c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 Apr 2020 10:44:30 +0800 Subject: [PATCH 0379/1809] PUB @lxbwolf https://linux.cn/article-12130-1.html --- .../20200228 Getting started with Linux firewalls.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200228 Getting started with Linux firewalls.md (98%) diff --git a/translated/tech/20200228 Getting started with Linux firewalls.md b/published/20200228 Getting started with Linux firewalls.md similarity index 98% rename from translated/tech/20200228 Getting started with Linux firewalls.md rename to published/20200228 Getting started with Linux firewalls.md index 1300d21fcd..a8a9749395 100644 --- a/translated/tech/20200228 Getting started with Linux firewalls.md +++ b/published/20200228 Getting started with Linux firewalls.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12130-1.html) [#]: subject: (Getting started with Linux firewalls) [#]: via: (https://opensource.com/article/20/2/firewall-cheat-sheet) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 36ff13cf13313ef5f638e30092c97b2321a4ad45 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 Apr 2020 18:45:02 +0800 Subject: [PATCH 0380/1809] PRF @wxy --- ...late -wash your hands- in 500 languages.md | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/translated/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md b/translated/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md index 28669c6c39..81f0527796 100644 --- a/translated/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md +++ b/translated/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md @@ -7,41 +7,40 @@ [#]: via: (https://opensource.com/article/20/4/ai-translation) [#]: author: (Daniel Whitenack https://opensource.com/users/datadan) -我是如何用 AI 把 “请洗手”翻译成 500 种语言的? +我是如何用 AI 把“请洗手”翻译成 500 种语言的? ====== > 通过使用人类和机器生成的翻译,可以将关键的健康短语翻译成世界各地的当地语言。 -![Two diverse hands holding a globe][1] +![](https://img.linux.net.cn/data/attachment/album/202004/20/184427f1a2t5z61m5xxo1t.jpg) -你可能不知道,目前世界上有 [7117 种语言][2],不是方言,而是在用的语言! 然而,世界上大部分的数字媒体只采用几十种语言,而像谷歌翻译这样的翻译平台只支持 100 种左右的语言。这样的现实意味着,由于缺乏及时获取信息的机会,全世界有数十亿人被边缘化。当前的冠状病毒(COVID-19)大流行已经让人痛苦地意识到了这一点,凸显了将健康相关的短语(如“请洗手wash your hands”或“保持距离”等)即时、快速翻译成小众语言的必要性。 +你可能不知道,目前世界上有 [7117 种语言][2]在使用,不是方言,而是在用的语言! 然而,世界上许多数字媒体只能使用几十种语言,而像谷歌翻译这样的翻译平台只支持 100 种左右的语言。这样的现实意味着,由于缺乏及时获取信息的机会,全世界有数十亿人被边缘化。当前的冠状病毒(COVID-19)大流行已经让人痛苦地意识到了这一点,凸显了将健康相关的短语(如“请洗手wash your hands”或“保持距离”等)即时、快速翻译成小众语言的必要性。 -为此,我应用了最先进的AI技术,用 544 种语言构建出了与“请洗手”相近的短语并进行了统计(我的 GPU 还在运行)。多语言无监督和监督嵌入Multilingual Unsupervised and Supervised Embeddings(MUSE)方法被用来训练这 544 种语言和英语之间的跨语言单词嵌入。然后,这些嵌入方法可以从现有文档中提取出与目标短语相似的短语。 +为此,我应用了最先进的 AI 技术,用 544 种语言构建出了与“请洗手”相近的短语并进行了统计(我的 GPU 还在运行)。多语言无监督和受监督嵌入Multilingual Unsupervised and Supervised Embeddings(MUSE)方法被用来训练这 544 种语言和英语之间的跨语言单词嵌入。然后,这些嵌入方法可以从现有文档中提取出与目标短语相似的短语。 我与 SIL 国际公司的同事们合作完成了这项工作,他们收集了该短语的更多的人工翻译结果。这些人工翻译结果和我的一些机器翻译结果的组合可以在[这个民族语指南页面][3]上搜索到(机器生成的短语用一个小的机器人图标表示),更多的翻译将在生成/收集到的时候加入。 ### 利用现有的语料库 -SIL 国际公司已经完成了 2000 多种语言的语言工作,目前管理着 1600 多个语言项目。因此,当我解决这个特殊的问题时,我知道我们很可能已经多次将“请洗手”和/或类似的短语翻译成了数百种语言,而这一猜测得到了回报。我很快就从我们的档案库中收集到了超过 900 种语言的文件(主要是完成的贝壳书模板、教材和圣经)。这些文件中的每一份文件都有一个英文的对应语,其中必然包括“请洗手”和/或类似“请洗脸”这样的短语。此外,这些文件的质量都很高,并与当地语言社区合作进行了翻译和检查。 +SIL 国际公司已经完成了 2000 多种语言的语言工作,目前管理着 1600 多个语言项目。因此,当我解决这个特殊的问题时,我知道我们很可能已经多次将“请洗手”和/或类似的短语翻译成了数百种语言,而这一猜测得到了回报。我很快就从我们的档案库中收集到了超过 900 种语言的文档(主要是完成的贝壳书模板、教材和圣经)。这些文档中的每一份都有一个英文的对应版本,其中必然包括“请洗手”和/或类似“请洗脸”这样的短语。此外,这些文档的质量都很高,并与当地语言社区合作进行了翻译和检查。 这是相当多语言的数据集。然而,有两个问题需要克服。首先,这个数据包含了大多数语言的数千种样本,这与训练机器翻译模型所使用的数百万个样本形成了鲜明对比。其次,即使文档中包含目标语言中的“请洗手”这个短语,我们也不知道这个短语在周围文本中的确切位置。 -我们当然可以利用[低资源语言的机器翻译][4]中的一些最新技巧,但要在每一对语言中快速调整翻译模型的自动化方法,还需要一些时间。此外,我们所针对的许多语言都没有现成的可以与之比较评估指标的基线,例如[BLEU 评分][5]。考虑到对冠状病毒大流行的迫切担忧,我们希望比这更快一点(尽管我们计划在将来再来解决这个问题)。 +我们当然可以利用[低资源语言的机器翻译][4]中的一些最新技巧,但是需要花费一些时间来调整自动化方法,以快速适应每种语言对中的翻译模型。此外,我们所针对的许多语言都没有现成的的基线,可以用来比较评估指标(例如 [BLEU 评分][5])。考虑到对冠状病毒大流行的迫切担忧,我们希望比这更快一点(尽管我们计划在将来再来解决这个问题)。 -我选择通过在现有的文档中寻找短语本身或短语的组件(如“请洗”或“你的手”)来尝试构建“请洗手”这个短语。为了找到这些成分,我使用 Facebook Research 的 [多语言无监督和监督嵌入(MUSE)][6]对每个 {英语、目标语言} 对进行跨语言cross-lingual嵌入训练。MUSE 以单语言monolingual的单词嵌入作为输入(我使用 [fasttext][7] 来生成这些词),并使用对抗性方法学习从英语到目标嵌入空间的映射。这个过程的输出是跨语言cross-lingual的单词嵌入。 +我选择通过在现有的文档中寻找短语本身或短语的组件(如“请洗”或“你的手”)来尝试构建“请洗手”这个短语。为了找到这些成分,我使用 Facebook Research 的[多语言无监督和受监督嵌入(MUSE)][6]对每个 {英语、目标语言} 对进行了跨语言cross-lingual嵌入训练。MUSE 以单语言monolingual的单词嵌入作为输入(我使用 [fasttext][7] 来生成这些词),并使用对抗性方法学习了从英语到目标嵌入空间的映射。这个过程的输出是跨语言cross-lingual的单词嵌入。 ![Using fasttext along with MUSE to perform cross-language embedding][8] -一旦产生了跨语言嵌入,我们就可以开始在目标语言文档中寻找短语成分。结果发现,整个文档中清楚地使用了“请洗脸”这个短语以及单独的“手”、“请洗”等词。对于每一种语言,我都通过 n-grams 搜索我预期该短语会出现的地方(根据其在英语平行语中的用法)。使用跨语言嵌入法对 n-grams 进行了矢量化,并使用各种距离指标与英语短语的矢量化版本进行了比较。在嵌入空间中,与英文短语“最接近”的 n-grams 被确定为目标语言匹配。 +一旦产生了跨语言嵌入,我们就可以开始在目标语言文档中寻找短语组件。结果发现,整个文档中清楚地使用了“请洗脸”这个短语以及单独的“手”、“请洗”等词。对于每一种语言,我都通过 n-gram 搜索我预期该短语会出现的地方(根据其在英语的对应版本中的用法)。使用跨语言嵌入法对 n-gram 进行了矢量化处理,并使用各种距离指标与英语短语的矢量化版本进行了比较。在嵌入空间中,与英文短语“最接近”的 n-gram 被确定为与目标语言匹配。 -最后,将与英语对应的成分短语进行组合,生成目标语言中的“请洗手”短语。这种组合方式再次利用跨语言嵌入,确保组件短语的组合方式合适。例如,如果我们在目标语言中匹配“请洗脚”这个短语,就必须将“脚”对应的 n-gram 替换成“手”对应的 n-gram。下面是伯利兹·克里奥尔Belize Kriol英语的一个例子: +最后,将与英语对应的成分短语进行组合,生成目标语言中的“请洗手”短语。这种组合方式再次利用了跨语言嵌入,以确保以合适方式组合组件。例如,如果我们在目标语言中匹配“请洗脚”这个短语,就必须将“脚”对应的 n-gram 替换成“手”对应的 n-gram。下面是伯利兹·克里奥尔Belize Kriol英语的一个例子: ![][9] -当然,在这个匹配过程中,有一些假设,这个过程完全有可能不能产生语法上正确的预测。例如,我假设在大多数语言中,“手”的单词和“脚”的单词都是一个字元长的(字元由空格和标点符号隔开)。当然,情况肯定不一定是这样。这可能会造成类似于“和洗的和手你”或类似的不好的词条。希望我们可以克服其中的一些局限性,并在未来扩展这个系统,但是,现在,我们选择用图形来强化这个想法。 - -我们将世界卫生组织的洗手说明改编成了一个 PNG 图片模板。然后,我们把我们翻译和生成的短语,用 Bash 和 Go 脚本的组合将其渲染到洗手图像中。这样,在文字和图像中都强调了正确洗手的理念(只是为了防止我们生成的翻译有问题)。 +当然,在这个匹配过程中,会做一些假设,这个过程完全有可能不能产生语法上正确的预测。例如,我假设在大多数语言中,“手”的单词和“脚”的单词都是一个字元token长的(字元由空格和标点符号隔开)。当然并非总是如此。这可能会造成类似于“和洗和手你”或类似的瑕疵词条。希望我们可以克服其中的一些局限性,并在未来扩展这个系统,但是,现在,我们选择用图形来强化这个想法。 +我们将世界卫生组织的洗手说明改编成了一个 PNG 图片模板。然后,我们把我们翻译和生成的短语,用 Bash 和 Go 脚本的组合将其渲染到洗手图像中。这样,在文字和图像中都强调了正确洗手的理念(以防万一我们生成的翻译很尴尬)。 ![][10] @@ -91,11 +90,11 @@ SIL 国际公司已经完成了 2000 多种语言的语言工作,目前管理 - 我们的系统:yaakuuvaitana nnikiiyauvaa fini - 谷歌翻译:不支持 -构建的短语类似于参考翻译,或者似乎是“请洗手”的另一种说法。例如,在保加利亚语中,我预测为“умий ръцете”,而谷歌翻译预测为“Измий си ръцете”。然而,如果我用谷歌翻译回译我的预测,我还是会得到“请洗手”。有一些不确定的地方,我无法与参考译文(例如,所罗门群岛的 Pijin [pis])或人类注释的跨度进行比较,但我仍然可以验证“洗”(wasim)和“手”(han)分别用在其他必定是谈论洗或手的参考文件中。大约有 15% 的译文可以用这个方法验证,我希望在收集参考文献字典的过程中,能验证更多的译文。 +构造的短语类似于参考翻译,或者似乎是“请洗手”的另一种说法。例如,在保加利亚语中,我预测为“умий ръцете”,而谷歌翻译预测为“Измий си ръцете”。 然而,如果我用谷歌翻译回译我的预测,我还是会得到“请洗手”。有一些不确定的地方,我无法与参考译文(例如,所罗门群岛的 Pijin [pis])或人类注释的跨度进行比较,但我仍然可以验证“洗”(wasim)和“手”(han)分别用在其他必定是谈论洗或手的参考文件中。 大约有 15% 的译文可以用这个方法验证,我希望在收集参考文献字典的过程中能进行更多的验证。 -请注意,我最多使用了每种语言中大约 7000 个句子来得到上述译文,即使是意大利语这样的高资源语言也是如此。我也没有依赖语言对之间的对齐句子。尽管在这种数据非常稀缺、无监督的情况下,但对于两个系统都支持的语言,我仍然能够获得类似于谷歌翻译的短语。这证明了这种“混合”方法(无监督的单词嵌入+基于规则的匹配)在将短语翻译成数据非常少的语言中的潜在用途。 +请注意,我最多使用了每种语言中大约 7000 个句子来得到上述译文,即使是意大利语这样的高资源语言也是如此。我也不依赖语言对之间的对齐句子。尽管存在这种数据非常稀缺、无监督的情况,但对于两个系统都支持的语言,我仍然能够获得类似于谷歌翻译的短语。这证明了这种“混合”方法(无监督的单词嵌入+基于规则的匹配)在将短语翻译成数据非常少的语言中的潜在用途。 -注意:我绝对不是说这是解决冠状病毒和其他健康相关的信息传播问题的解决方案。这里仍有很多东西需要探索和正式评估,我们正在为此努力。在很多情况下,这种方法无法帮助构建数百种语言的重要信息资料。但是,我认为,我们都应该尝试着为当前危机的相关问题制定创造性的解决方案。也许这只是一个非常大的拼图中的一块。 +注意:我绝对不是说这是解决冠状病毒和其他健康相关的信息传播问题的解决方案。这里仍有很多东西需要探索和正式评估,我们正在为此努力。在很多情况下,这种方法无法帮助构建数百种语言的重要信息资料。但是,我认为,我们所有人都应该尝试着为当前危机的相关问题制定创造性的解决方案。也许这只是一个非常大的拼图中的一块。 你可以在[这个民族语言指南][3]上查看经过验证的译文加上人工翻译的完整列表。此外,我们即将以论文的形式对这一系统进行更深入的描述和分析。我们欢迎公众对翻译进行反馈,以帮助系统进行微调,最重要的是,确保将健康信息传递给世界各地的边缘化语言社区。 @@ -116,7 +115,7 @@ via: https://opensource.com/article/20/4/ai-translation 作者:[Daniel Whitenack][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7730ae62fdb55a2dac2e4c384e1ecf7202e16258 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 Apr 2020 18:54:56 +0800 Subject: [PATCH 0381/1809] PUB @wxy https://linux.cn/article-12131-1.html --- ...ng AI to translate -wash your hands- in 500 languages.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md (99%) diff --git a/translated/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md b/published/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md similarity index 99% rename from translated/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md rename to published/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md index 81f0527796..4117cefacf 100644 --- a/translated/tech/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md +++ b/published/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12131-1.html) [#]: subject: (How I'm using AI to translate 'wash your hands' in 500 languages) [#]: via: (https://opensource.com/article/20/4/ai-translation) [#]: author: (Daniel Whitenack https://opensource.com/users/datadan) From 2abf39ff6a44c30ecb92f2f654eb2cac1e707a05 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 Apr 2020 22:30:00 +0800 Subject: [PATCH 0382/1809] APL --- sources/tech/20200415 Writing Java with Quarkus in VS Code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200415 Writing Java with Quarkus in VS Code.md b/sources/tech/20200415 Writing Java with Quarkus in VS Code.md index 2d61db71de..4773a04411 100644 --- a/sources/tech/20200415 Writing Java with Quarkus in VS Code.md +++ b/sources/tech/20200415 Writing Java with Quarkus in VS Code.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From aeb425f83897117697189ffedbbfc36a9af910ed Mon Sep 17 00:00:00 2001 From: Zioyi Date: Mon, 20 Apr 2020 23:10:50 +0800 Subject: [PATCH 0383/1809] Update and rename sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md to sources/translated/20200417 12 Linux Commands to Have Some Fun in the Terminal.md --- ...mmands to Have Some Fun in the Terminal.md | 343 ------------------ ...mmands to Have Some Fun in the Terminal.md | 343 ++++++++++++++++++ 2 files changed, 343 insertions(+), 343 deletions(-) delete mode 100644 sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md create mode 100644 sources/translated/20200417 12 Linux Commands to Have Some Fun in the Terminal.md diff --git a/sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md b/sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md deleted file mode 100644 index 81c05aa211..0000000000 --- a/sources/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md +++ /dev/null @@ -1,343 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Zioyi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (12 Linux Commands to Have Some Fun in the Terminal) -[#]: via: (https://itsfoss.com/funny-linux-commands/) -[#]: author: (Community https://itsfoss.com/author/itsfoss/) - -12 Linux Commands to Have Some Fun in the Terminal -====== - -_**So, you think Linux terminal is all work and no fun? These funny Linux commands will prove you wrong.**_ - -The Linux terminal is the place to get serious work done. We have plenty of useful [linux command tips and tricks][1] to help you with that. - -But, did you know that you can have a lot of fun using the terminal? Well, if you did not, then you are not alone. Most Linux users see the terminal as an interface that is designed and built for system management and development tasks. - -However, you will be surprised to know that there are tons of [terminal based games][2] and [ASCII games][3] that you can play in the terminal. - -And, in this article, I’m going to explore some interesting, some funny and some ridiculous commands that you can type into the terminal on Linux and have fun! - -### Have some fun in Linux terminal with these commands - -![][4] - -You’ll find a lot of these commands ridiculous or useless but some of them could actually be put to some good use. - -I have added installation instructions for Ubuntu/Debian. If you are using Ubuntu-based distribution, please make sure to [enable universe repository][5] as most of these commands are not in the main repository. - -If you are using Arch, Fedora, SUSE, Solus or any other non-Ubuntu distributions, please use your distribution’s package manager to install these funny Linux commands. - -#### 1\. Run a train in the terminal - -Let’s take a ride in the locomotive and begin our auspicious journey. And I mean it literally! - -The sl command allows you to run a train in your terminal. - -![][6] - -Here’s how to install the command: - -``` -sudo apt install sl -``` - -Once done, you can simply type in the following in the terminal to get started: - -``` -sl -``` - -Impressive, isn’t it? But, hold on. We are not done yet! Apparently, you can fly your locomotive. Just add the option -F, Mr. Potter: - -``` -sl -F -``` - -****This should make the locomotive get wings to fly off from the terminal window! - -#### 2\. Add the Matrix effect to your Linux terminal - -Remember the iconic sci-fi movie [The Matrix][7]? The green text falling down on the terminal became an identity of Matrix. - -You can have this Matrix digital rain on your Linux box as well! You just need to install **cmatrix** and type it in the terminal. - -![][8] - -Installing cmatrix on Debian/Ubuntu Linux: - -``` -sudo apt install cmatrix -``` - -Now, all you have to do is type the following to get the matrix screen on terminal: - -``` -cmatrix -``` - -Press Ctrl+C to stop it, Mr. Anderson. - -**Recommended Read:** - -![][9] - -#### [Watch Star Wars In Linux Terminal via Telnet][10] - -Watch Star Wars in ASCII art Linux terminal. - -#### 3\. Let there be fire - -Keep your fire extinguisher handy because now you are going to start a fire in your terminal! - -![][11] - -To get it installed, here’s what you have to type: - -``` -sudo apt install libaa-bin -``` - -Once done start a fire in your terminal by entering: - -``` -aafire -``` - -Press Ctrl+C to stop it. - -#### 4\. Fortune ~~Cookie~~ Command - -Want to know your fortune but there are no fortune cookies around you? - -Not to worry, you just need to type “fortune” on your terminal and press enter. The terminal will display a random sentence just like you usually get in fortune cookies. - -![][12] - -Install it with: - -``` -sudo apt install fortune -``` - -Once done, simply type in the command below to know your fortune: - -``` -fortune -``` - -Now this is one of the commands here that you could actually use. You can use it as message of the day so that in a multi-user environment, all the users will see a random fortune cookie when they login. - -You may also add it to your bashrc file so that it shows you a random message as soon as you log in to the terminal. - -#### 5\. Pet lover? This is for you - -Oneko is a little fun command that will change your regular cursor into a mouse and creates a curious little cat who will chase your cursor once you move it. It’s not limited to just the terminal. You can keep on working while the cat chases the cursor. - -Now, that’s something fun to do specially if you have kids at home. - -![][13] - -Install Oneko with this command: - -``` -sudo apt install oneko -``` - -Run it with this command: - -``` -oneko -``` - -In case you want a dog instead of a cat, type: - -``` -oneko -dog -``` - -There are a few more types of cats available. You can get that information by using oneko –help. To stop it, use Ctrl+C. - -#### 6\. Little brother is watching you - -Xeyes is a tiny gui program that let the user draws a pair of ever watching eyes! It will follow your mouse cursor constantly. Run the command and see it yourself! - -![][14] - -You can install it using this command: - -``` -sudo apt install xeyes -``` - -And then use it with this: - -``` -xeyes -``` - -Press Ctrl+C to stop it. - -#### Let the terminal speak for you - -To try out this command, make sure you have turned on your speakers. [eSpeak][15] is a fun command that gives your terminal a voice. Yes, you heard that right. - -Install the package first: - -``` -sudo apt install espeak -``` - -Next, you need to simply type in the command along with a text that you want to listen as audio: - -``` -espeak "Type what your computer says" -``` - -Whatever you place in the double quotes, your computer is obligated to say! It’s like [echo command in Linux][16]. But instead of printing, it speaks. - -#### Toilet (but it has nothing to do with a washroom) - -This sounds weird, yes. But, it’s just a command that transforms a text into large ASCII characters. - -![][17] - -Install toilet with this command: - -``` -sudo apt install toilet -``` - -Once done, you just need to type in: - -``` -toilet sample text you want -``` - -I don’t know why this little program is called toilet. - -#### What does the ~~fox~~ cow say? - -Cowsay is a command that displays a cow using ASCII characters in the terminal. And by using this command you can instruct the cow to say anything you want. - -Not to be confused with any audio – it will just display a text (like you usually see in a comic book). - -![Cowsay Cowthink][18] - -Install ****cowsay: - -``` -sudo apt install cowsay -``` - -Once you have it installed, you just need to type in: - -``` -cowsay "your text" -``` - -Whatever you place in the double quotes, your cow is obligated to say! I have seen a few sysadmins using it to display the message of the day. Maybe you can do the same. You may even combine it with fortune command. - -#### Banner Command - -The banner command works just like the toilet command but it is limited to print only 10 characters at most. - -![][19] - -You can install banner command like this: - -``` -sudo apt install sysvbanner -``` - -Then use it in the following way: - -``` -banner "Welcome" -``` - -Replace content in the double quotes and you shall have your desired text displayed. - -#### Yes command - -![][20] - -The “yes” command helps you to loop an automated response until you terminate the command. This command will print the exact same thing indefinitely. If you want to produce huge amounts of junk text fast, then this command will work like a charm. - -You may also use it to provide a yes to a command (if it prompts for it). For example, the apt upgrade command asks for your confirmation, you can use it like this: - -``` -yes | sudo apt upgrade -``` - -You don’t need to install any package for it. Yes command is already available. - -Terminate the yes command loop, simply press **CTRL + C**. - -#### Get a new identity, well, sort of - -Want to generate a random fake identity? I give you the command “rig”. Once you place this in the terminal, it will generate a fake identity. - -![][21] - -Install rig with this command: - -``` -sudo apt install rig -``` - -Then simply type this: - -``` -rig -``` - -It may be used in scripts or web-apps that displays random information but I haven’t done anything of that sort on my own. - -**Wrapping Up** - -I hope you liked this list of fun Linux commands. Which command do you like the most here? Do you know some other such amusing commands? Do share it with us in the comment section. - -![][22] - -### Srimanta Koley - -A passionate writer, a distrohopper and an open source enthusiast, Srimanta is extremely fond of everything related to technology. He loves to read books and has an unhealthy addiction to the 90s! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/funny-linux-commands/ - -作者:[Community][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/itsfoss/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/linux-command-tricks/ -[2]: https://itsfoss.com/best-command-line-games-linux/ -[3]: https://itsfoss.com/best-ascii-games/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fun-linux-commands.png?ssl=1 -[5]: https://itsfoss.com/ubuntu-repositories/ -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/sl-command.jpg?ssl=1 -[7]: https://en.wikipedia.org/wiki/The_Matrix -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/matrix-screen-command.png?ssl=1 -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png?fit=732%2C462&ssl=1 -[10]: https://itsfoss.com/star-wars-linux/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fire-command.png?ssl=1 -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fortune-command.jpg?ssl=1 -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/oneko-command.jpg?ssl=1 -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/xeyes-command.jpg?ssl=1 -[15]: https://itsfoss.com/espeak-text-speech-linux/ -[16]: https://linuxhandbook.com/echo-command/ -[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/toilet-command.jpg?ssl=1 -[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/cowsay-cowthink.jpg?ssl=1 -[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/banner-command.jpg?ssl=1 -[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/yes-yourtext.jpg?ssl=1 -[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/rig-command.jpg?ssl=1 -[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/srimanta.jpg?ssl=1 diff --git a/sources/translated/20200417 12 Linux Commands to Have Some Fun in the Terminal.md b/sources/translated/20200417 12 Linux Commands to Have Some Fun in the Terminal.md new file mode 100644 index 0000000000..13538cc7cf --- /dev/null +++ b/sources/translated/20200417 12 Linux Commands to Have Some Fun in the Terminal.md @@ -0,0 +1,343 @@ +[#]: collector: (lujun9972) +[#]: translator: (Zioyi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (12 Linux Commands to Have Some Fun in the Terminal) +[#]: via: (https://itsfoss.com/funny-linux-commands/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +12个有趣的Linux终端命令 +====== + +_**你觉得Linux终端里只有无趣的工作吗?那你一定不知道下面这些有趣的Linux命令吧。**_ + +Linux终端是用来完成复杂的工作的,我们有很多有用的[linux命令奇技淫巧][1]来帮助你。 + +但是,你知道你还可以用终端来做很多有趣的是吗?如果你不知道,没关系,大多数Linux用户也都只把终端视为一个用来管理系统和执行任务的交互接口。 + +然而,如果你知道这里有些你可以在终端玩的[基于终端的游戏][2]和[ASCII码游戏][3],你一定会大吃一惊。 + +在这篇文章中,我将会探索一些有趣的、可笑的、荒谬的命令来让你可以在终端中找点乐子! + +### 用这些命令在Linux终端中找点乐子 + +![][4] + +你可能会觉得这些命令荒谬或没用,但是有一些还是可以被好好利用的。 + +我已经添加了Ubuntu/Debian的安装组件,如果你使用基于Ubuntu的发行版,请确保[启用通用仓库][5]因为大多数命令不在主仓库中。 + +如果你使用Arch、Fedora、SUSE、Solus或者其他非Ubuntu的发行版,请使用你的发行版包管理工具去安装这些有趣的Linux命令。 + +#### 1\. 在终端开一辆火车 + +让我们坐上火车,来一场说走就走的旅行的,没错,就是字面意思! + +sl命令可以让你在终端运行一辆火车。 + +![][6] + +安装方法: + +``` +sudo apt install sl +``` + +完成后,你只要在终端输入下面的命令就可以开始 + +``` +sl +``` + +很精彩,对吧?但等等,我们还没结束!你还可以让你的火车飞起来,只要加上参数-F,Magic: + +``` +sl -F +``` + +**这样会让火车长出翅膀飞出终端窗口!** + +#### 2\. 给你的Linux终端加上矩阵效果 + +还记得科幻电影[黑客帝国][7]吗?掉落在终端的绿字变成一个矩阵符号。 + +你也可以在你的Linux电脑里有这样的矩阵数字雨!你只需要安装**cmatric**然后在终端输入它就行。 + +![][8] + +在Debian/Ubuntu Linux上安装cmatrix: + +``` +sudo apt install cmatrix +``` + +现在,你要做的就是输入下面的命令,在终端就会有矩阵屏幕了: + +``` +cmatrix +``` + +按住Ctrl+C来停止它,黑客先生。 + +**推荐阅读:** + +![][9] + +#### [通过Telnet在Linux终端看星际大战][10] + +在Linux终端看星际大战。 + +#### 3\. 让这里着火 + +拿好灭火器因为接下来你要在你的终端里点火了! + +![][11] + +想安装它,你要输入: + +``` +sudo apt install libaa-bin +``` + +完成后,你输入下面的命令,你的终端就会燃起一团火焰: + +``` +aafire +``` + +按住Ctril+C来停止它。 + +#### 4\. 幸运饼干命令 + +想知道你的运气怎样但身边没有幸运饼干? + +别担心,你只需在终端打出“fortune”然后按下回车。终端将会显示出一个你的幸运语就像你从幸运饼干里得到的一样。 + +![][12] + +安装它: + +``` +sudo apt install fortune +``` + +完成后,只要在命令行打出下面的内容,你就会知道你的运气怎样: + +``` +fortune +``` + +这是一个你可以实际去使用的命令。你可以用它作为每日消息,这样在多用户环境下,每个用户登录后都会得到一个“幸运饼干”。 + +你也可以把它添加到bashrc文件,这样当你登进终端你就会看到了。 + +#### 5\. 宠物爱好者?这是给你准备的 + +Oneko是一个有趣的命令,可以把你的光标变成一只老鼠,然后创造一只猫,一旦你移动光标,就会来追你。这不仅局限于终端。当猫追逐光标时,你可以继续工作。 + +如果你家里有孩子这一定很有趣。 + +![][13] + +用下面的命令安装Oneko + +``` +sudo apt install oneko +``` + +用下面的命令运行它: + +``` +oneko +``` + +如果你不喜欢猫,喜欢狗,输入: + +``` +oneko -dog +``` + +这里有很多种小宠物,你可以用oneko -help获取信息。用Ctrl+C终止它。 + +#### 6\. 有个小兄弟在看着你 + +Xeyes是一个很小的GUI程序,它可以绘制出一双眼睛一直盯着你!它会不断跟随您的鼠标光标,运行命令自己看看! + +![][14] + +你可以用下面命令安装: + +``` +sudo apt install xeyes +``` + +然后这样用它: + +``` +xeyes +``` + +按住Ctrl+C终止它。 + +#### 7\. Let the terminal speak for you +#### 7\. 让终端帮你讲话 + +打开你的扬声器,你来试试这个命令,[eSpeak][15]是一个有趣的命令,它可以让你的终端说话。是的,你没听错。 + +先安装这个包: + +``` +sudo apt install espeak +``` + +接下来,你只需要输入在命令行中输入你想听到的话: + +``` +espeak "Type what your computer says" +``` + +无论你在双引号里面填什么,你的电脑都会复述出来!它就像[在Linux中的echo命令][16],但不是打印出来,而是说出来。 + +#### 8\. 卫生间(但它不能洗衣服) + +这听起来有点奇怪,是的。但是,这只是一个命令,用来将文本转换成大的ASCII字符。 + +![][17] + +用这个命令安装toilet: + +``` +sudo apt install toilet +``` + +完成后,你只需输入: + +``` +toilet sample text you want +``` + +我也不知道为啥这个小程序叫卫生间。 + +#### 9\. 那个牛说什么? + +Cowsay是一个在终端中用ASCII字符展示出一头牛的命令。通过这个命令,你可以控制牛说出你想说的话。 + +别纠结声音,它只展示文本(就是你看漫画书一样)。 + +![Cowsay Cowthink][18] + +安装**cowsay**: + +``` +sudo apt install cowsay +``` + +安装完成后,你只要输入: + +``` +cowsay "your text" +``` + +无论你在双引号里填什么,你的牛都会说!我看到一些系统管理员用它来展示每天的消息。你也可以这样,你甚至可以把它和fortune命令结合。 + +#### 10\. Banner命令 + +banner命令与toilet命令相似,但它限制最多只能打印10个字符。 + +![][19] + +你可以这样安装banner命令: + +``` +sudo apt install sysvbanner +``` + +然后这样运行: + +``` +banner "Welcome" +``` + +替换双引号里的内容,你将会得到你想要的展示内容。 + +#### 11\. Yes命令 + +![][20] + +yes命令帮助你在循环中自动响应直到终止命令。这个命令将会一直打印相同的内容。如果你想快速生成大量垃圾文本,那么此命令将像超级按钮一样工作。 + +你也可以使用它为命令提供“yes”(如果提示)。例如,apt upgrade命令会要求你确认,你可以像这样使用它: + +``` +yes | sudo apt upgrade +``` + +你不需要安装任何包,Yes命令已经存在了。 + +想要终止yes命令循环,只需按住**CTRL+C**。 + +#### 12\. 得到一个新的身份 + +要生成一个随机的假身份吗?我推荐你用rig命令。你在终端运行它,就会生成一个假的身份。 + +![][21] + +用这个命令安装rig: + +``` +sudo apt install rig +``` + +只需像这样输入: + +``` +rig +``` + +它可能被用在脚本或者web应用中展示随机信息,但我自己还没做过什么。 + +**结尾** + +我希望你会喜欢这个有趣的Linux命令列表。你最喜欢哪个命令呢?你还知道其他有趣的命令吗?请在评论部分与我们分享。 + +![][22] + +### Srimanta Koley + +Srimanta是一位热情的作家、发行者、开源爱好者,非常喜欢与技术相关的所有内容。他喜欢读书,特别是90年的书! +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/funny-linux-commands/ + +作者:[Community][a] +选题:[lujun9972][b] +译者:[Zioyi](https://github.com/Zioyi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-command-tricks/ +[2]: https://itsfoss.com/best-command-line-games-linux/ +[3]: https://itsfoss.com/best-ascii-games/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fun-linux-commands.png?ssl=1 +[5]: https://itsfoss.com/ubuntu-repositories/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/sl-command.jpg?ssl=1 +[7]: https://en.wikipedia.org/wiki/The_Matrix +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/matrix-screen-command.png?ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png?fit=732%2C462&ssl=1 +[10]: https://itsfoss.com/star-wars-linux/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fire-command.png?ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fortune-command.jpg?ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/oneko-command.jpg?ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/xeyes-command.jpg?ssl=1 +[15]: https://itsfoss.com/espeak-text-speech-linux/ +[16]: https://linuxhandbook.com/echo-command/ +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/toilet-command.jpg?ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/cowsay-cowthink.jpg?ssl=1 +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/banner-command.jpg?ssl=1 +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/yes-yourtext.jpg?ssl=1 +[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/rig-command.jpg?ssl=1 +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/srimanta.jpg?ssl=1 From 19f26ef6a288e2c89b5d9fc0a61f6448f28160c6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 20 Apr 2020 23:19:55 +0800 Subject: [PATCH 0384/1809] Revert "APL:20200415 writing java with quarkus in vs code" --- sources/tech/20200415 Writing Java with Quarkus in VS Code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200415 Writing Java with Quarkus in VS Code.md b/sources/tech/20200415 Writing Java with Quarkus in VS Code.md index 4773a04411..2d61db71de 100644 --- a/sources/tech/20200415 Writing Java with Quarkus in VS Code.md +++ b/sources/tech/20200415 Writing Java with Quarkus in VS Code.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (wxy) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8c02f7d05b6ac60dc9830ce7dfd6118bf5960bd3 Mon Sep 17 00:00:00 2001 From: Zioyi Date: Mon, 20 Apr 2020 23:29:49 +0800 Subject: [PATCH 0385/1809] fix archive --- ...20200417 12 Linux Commands to Have Some Fun in the Terminal.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources/translated => translated/tech}/20200417 12 Linux Commands to Have Some Fun in the Terminal.md (100%) diff --git a/sources/translated/20200417 12 Linux Commands to Have Some Fun in the Terminal.md b/translated/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md similarity index 100% rename from sources/translated/20200417 12 Linux Commands to Have Some Fun in the Terminal.md rename to translated/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md From c13e3dfd6615ccc048e51166f7e9df4ffc969b24 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 21 Apr 2020 00:53:50 +0800 Subject: [PATCH 0386/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200421=20Myst?= =?UTF-8?q?iQ:=20A=20Free=20and=20Open=20Source=20Audio/Video=20Converter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md --- ...e and Open Source Audio-Video Converter.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md diff --git a/sources/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md b/sources/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md new file mode 100644 index 0000000000..cfddc43c54 --- /dev/null +++ b/sources/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (MystiQ: A Free and Open Source Audio/Video Converter) +[#]: via: (https://itsfoss.com/mystiq/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +MystiQ: A Free and Open Source Audio/Video Converter +====== + +_**Brief: MystiQ is a new open-source video converter tool available for Linux and Windows. It uses FFMPEG underneath and provides you a neat and clean graphical interface based on Qt.**_ + +### MystiQ, a QT-based GUI Frontend for FFmpeg + +![][1] + +An audio/video conversion tool always comes in handy for every computer user across multiple platforms. + +For that very same reason, I thought it would be a great idea to highlight the [MystiQ app][2] – which is a relatively new video/audio converter tool available for Linux and Windows users. As of now, there’s no support for macOS – but it could arrive in the near future. + +MystiQ is a graphical frontend for [FFmpeg][3] based on [Qt 5 user interface][4]. Now, you can always [install and use ffmpeg in Linux command line][5] but that’s not very comfortable, is it? This is why tools like [Handbrake][6] and MystiQ exist to make our life easier. + +Since MystiQ is based on FFmpeg, you can use it for some basic video editing like trimming a video, rotating it etc. + +Let’s have a look at its features. + +### Features of MystiQ video converter + +![][7] + +Even though the MystiQ app is fairly new to the scene – it packs a good set of essential features. Here’s an overview of what it offers: + + * Video conversion + * Audio conversion (extracting the audio from the video as well) + * Formats supported: MP4, WEBM, MKV, MP3, MOV, OGG, WAV, ASF, FLV, 3GP, M4A, and a few others. + * Cross-platform (Windows & Linux) + * Packages for both 32-bit and 64-bit systems available + * Ability to tweak the audio quality (sample rate, bit rate, etc,.) for conversion + * **Basic video editing capabilities** (clipping the video, inserting a subtitle, rotating the video, scaling the video, etc) + * Convert your color video to black and white + * Several presets available to easily convert a video for the best quality or for the best compression. + + + +**Recommended Read:** + +![][8] + +#### [Easily Convert Audio File Formats with SoundConverter in Linux][9] + +If you are looking for converting audio file formats to wav, mp3, ogg or any other format, SoundConverter is the tool you need in Linux. + +### Installing MystiQ + +You may not find it listed in your software center – but it is quite easy to get it installed on a Linux distro. + +It provides an **.AppImage file** and **.deb/.rpm** files (with 32-bit and 64-bit packages). If you’re curious, you can read [how to use the AppImage file][10] if you want to use that. + +You can also find their [GitHub page][11] and look at the source code or any recent pre-release packages if you want to help them test the software to improve it. + +You can download the installer files for both Linux and Windows from its official website. + +[Download MystiQ][2] + +**Wrapping Up** + +For this quick highlight article, I used [Pop!_OS][12] 20.04 to test the MytiQ converter app and I had no issues converting video and audio files. And, the conversion was fast enough for an average user like me. + +Feel free to try it out and let me know your thoughts on it! Also, if you’ve been using another tool to convert videos and audio on Linux, what is it? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/mystiq/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/mystiq-converter-ft.jpg?ssl=1 +[2]: https://mystiqapp.com/ +[3]: https://www.ffmpeg.org/ +[4]: https://www.qt.io/ +[5]: https://itsfoss.com/ffmpeg/ +[6]: https://itsfoss.com/handbrake/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/mystiq-options.jpg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/Convert-audio-file-format-linux.png?fit=800%2C450&ssl=1 +[9]: https://itsfoss.com/sound-converter-linux/ +[10]: https://itsfoss.com/use-appimage-linux/ +[11]: https://github.com/swl-x/MystiQ/ +[12]: https://system76.com/pop From d5d81143d11d35a7df17f0a96b37bcf7434bf259 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 21 Apr 2020 00:55:20 +0800 Subject: [PATCH 0387/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200420=204=20?= =?UTF-8?q?Git=20scripts=20I=20can't=20live=20without?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200420 4 Git scripts I can-t live without.md --- ...0420 4 Git scripts I can-t live without.md | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 sources/tech/20200420 4 Git scripts I can-t live without.md diff --git a/sources/tech/20200420 4 Git scripts I can-t live without.md b/sources/tech/20200420 4 Git scripts I can-t live without.md new file mode 100644 index 0000000000..93f084f11f --- /dev/null +++ b/sources/tech/20200420 4 Git scripts I can-t live without.md @@ -0,0 +1,202 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 Git scripts I can't live without) +[#]: via: (https://opensource.com/article/20/4/git-extras) +[#]: author: (Vince Power https://opensource.com/users/vincepower) + +4 Git scripts I can't live without +====== +The Git Extras repo hosts more than 60 scripts that add to Git's basic +functionality. Here's how to install, use, and contribute to it. +![Person using a laptop][1] + +In 2005, [Linus Torvalds][2] created [Git][3] to replace the proprietary distributed source control management solution that he had previously used to maintain the Linux kernel. Since then, Git has become a dominant version-control solution for open source and cloud-native development teams. + +Even feature-rich applications like Git don't have every feature that people want or need, so they make the effort to create them. In the case of Git, that person would be [TJ Holowaychuk][4]. His [Git Extras][5] project hosts more than 60 "extras" with features that expand Git's basic functionality. + +### Using Git Extras + +Here's how to use four of the most popular Git Extras. + +#### git-ignore + +git-ignore is a convenient extra that allows you to manually add file types and comments to the **.git-ignore** file without having to open a text editor. It works with both the global ignore file for your user account and the individual ignore file for the repository you are working in. + +Executing git-ignore without a parameter will list the global ignore file first, then the local ignore files. + + +``` +$ git ignore +Global gitignore: /home/alice/.gitignore +# Numerous always-ignore extensions +*.diff +*.err +*.orig +*.rej +*.swo +*.swp +*.vi +*~ +*.sass-cache + +# OS or Editor folders +Thumbs.db +\--------------------------------- +Local gitignore: .gitignore +nbproject +``` + +#### git-info + +git-info retrieves all the information you need to get your head in the context of a repo you are working with. It includes any remote URLs, remote branches, local branches, configuration info, and the last commit. + + +``` +$ git info + +## Remote URLs: + +origin      [git@github.com][6]:sampleAuthor/git-extras.git (fetch) +origin      [git@github.com][6]:sampleAuthor/git-extras.git (push) + +## Remote Branches: + +origin/HEAD -> origin/master +origin/myBranch + +## Local Branches: + +myBranch +* master + +## Most Recent Commit: + +commit e3952df2c172c6f3eb533d8d0b1a6c77250769a7 +Author: Sample Author <[sampleAuthor@gmail.com][7]> + +Added git-info command. + +Type ´git log´ for more commits, or ´git show <commit id>´ for full commit details. + +## Configuration (.git/config): + +color.diff=auto +color.status=auto +color.branch=auto +user.name=Sample Author +user.email=[sampleAuthor@gmail.com][7] +core.repositoryformatversion=0 +core.filemode=true +core.bare=false +core.logallrefupdates=true +core.ignorecase=true +remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* +remote.origin.url=[git@github.com][6]:mub/git-extras.git +branch.master.remote=origin +branch.master.merge=refs/heads/master +``` + +#### git-mr and git-pr + +These extras do similar things and work in basically the same way. + + * git-mr checks out a merge request from GitLab + * git-pr checks out a pull request on GitHub + + + +In either case, you just need the merge or pull request number or the full URL, and it will fetch the remote reference, check out the branch, and adjust the config, so Git knows which branch it will replace. + + +``` +$ git mr 51 +From gitlab.com:owner/repository + * [new ref]         refs/merge-requests/51/head -> mr/51 +Switched to branch 'mr/51' +``` + +#### git-release + +By combining **commit**, **tag**, and **push** into a single command, git-release saves a lot of keystrokes for executing three commands that often run in sequence. + +To commit with a specific **<tagname>** and a custom message: + + +``` +`$ git release 0.1.0 -m <+ powerful feature added>` +``` + +#### Other extras + +These are just four of the 60+ Git Extras in the repo. To access the full list of commands available in Git Extras, either review the [Commands.md][8] file in the source repository or run the following command after you install Git Extras. + + +``` +`$ git extras --help` +``` + +### Install Git Extras + +The main prerequisite for Git Extras is having the command-line version of Git installed. If you plan to build from source, you also need additional utilities (e.g., **make**) to be available. + +If you are using a recent version of macOS, Git Extras installation is best handled using [Homebrew][9] (as with most open source tools): + + +``` +`$ brew install git-extras` +``` + +On Linux, Git Extras is available on each platform's native package manager. Sometimes, you need to enable an extra repository, like [EPEL][10] on CentOS, then run a single command: + + +``` +`$ sudo yum install git-extras` +``` + +Full installation instructions for other Linux distributions, BSD, and other platforms are available in the [Installation.md][11] file in the repository. + +### Contributing + +Do you have a piece of functionality you think is missing from Git and have built or want to build a script to handle it? Why not share it with the world by making it part of the Git Extras distribution! + +To do so, contribute the functionality to the Git Extras repository. There are more specific details in the [CONTRIBUTING.md][12] file in the repository, but the basics are easy: + + 1. Create a Bash script that handles the functionality. + 2. Create a basic man file so people will know how to use it. + 3. Update the command list and completion scripts to let people know the functionality exists. + 4. Run the integrity check to make sure you didn't break anything. + 5. Create a pull request for your functionality. + + + +Contributing to Git Extras will go a long way towards making life a little easier for your fellow Git users. You can learn more about it in the project's [README][13]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/git-extras + +作者:[Vince Power][a] +选题:[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/vincepower +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://en.wikipedia.org/wiki/Linus_Torvalds +[3]: https://git-scm.com/ +[4]: https://github.com/tj +[5]: https://github.com/tj/git-extras +[6]: mailto:git@github.com +[7]: mailto:sampleAuthor@gmail.com +[8]: https://github.com/tj/git-extras/blob/master/Commands.md +[9]: https://brew.sh/ +[10]: https://fedoraproject.org/wiki/EPEL +[11]: https://github.com/tj/git-extras/blob/master/Installation.md +[12]: https://github.com/tj/git-extras/blob/master/CONTRIBUTING.md +[13]: https://github.com/tj/git-extras/blob/master/Readme.md From 858a8a7ee3ae9ac0512a507a43d957f6ffaa8d4b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 21 Apr 2020 00:56:45 +0800 Subject: [PATCH 0388/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200420=20New?= =?UTF-8?q?=20open=20source=20GIS=20projects=20for=20Kubernetes=20applicat?= =?UTF-8?q?ions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200420 New open source GIS projects for Kubernetes applications.md --- ...IS projects for Kubernetes applications.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20200420 New open source GIS projects for Kubernetes applications.md diff --git a/sources/tech/20200420 New open source GIS projects for Kubernetes applications.md b/sources/tech/20200420 New open source GIS projects for Kubernetes applications.md new file mode 100644 index 0000000000..a8fdec6e71 --- /dev/null +++ b/sources/tech/20200420 New open source GIS projects for Kubernetes applications.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (New open source GIS projects for Kubernetes applications) +[#]: via: (https://opensource.com/article/20/4/gis-kubernetes) +[#]: author: (Adam Timm https://opensource.com/users/timmam) + +New open source GIS projects for Kubernetes applications +====== +pg_tileserv and pg_featureserv make it easier for developers to add +location services to Kubernetes applications. +![A map with a route highlighted][1] + +Spatial data from geographic information systems (GIS) is all around us. From smartphones that make our lives better and more convenient to precision agriculture that is increasing the amount of food farmers can produce while reducing the cost, whether or not we realize it, almost every part of our lives is touched by spatial data. + +This increase of spatial data is simultaneously bringing an increase of open spatial datasets that people can consume and use to build all sorts of new applications. However, these types of datasets have not always been easy to work with. Also, due to the size of some of the geographic data, they can be difficult to bring to modern application deployment frameworks such as Kubernetes. + +To help with these issues, [Crunchy Data][2] recently announced two new open source projects, [pg_tileserv][3] and [pg_featureserv][4], to make it easier to develop cloud-native spatial applications. These projects, part of open source [Crunchy Spatial][5], help developers leverage the robust [PostGIS][6] geospatial database extension to [PostgreSQL][7] without having to write complex SQL statements. + +So what are pg_tileserv and pg_featuresev, how do they make it easier for developers to add location services to their Kubernetes applications, and what does this mean for the future of spatial applications? + +### Traditional GIS vs. modern spatial microservices + +Traditionally, when an organization or individual works with spatial data, they start with a product that grew up as a GIS. There are many high-quality open source GIS products ([QGIS][8], [GeoServer][9], [GeoNode][10], etc.), but they may not align with modern, cloud-native approaches to software design. + +The popularity of Kubernetes creates challenges for these legacy applications around automation and deployment, as they require a lot of manual configuration, for example, when data sources are added and modified. In many setups, these spatial applications must exist outside Kubernetes and cannot leverage many of the conveniences it provides. + +In contrast, modern spatial services should be driven by the spatial data that they are processing and serving out. They should align with modern software development practices and scale efficiently and integrate easily with developer workflows. + +Applications that are spatially aware also need to ensure they can handle the unique characteristics of spatial data (e.g., geometries, projections, etc.). To do all of this in independent microservices can be challenging unless you have a highly capable database to do the majority of the work for you. This is where pg_tileserv and pg_featureserv help, as both projects leverage the power of PostGIS, an open source geospatial extension to PostgreSQL, to provide advanced spatial capabilities from a simple REST framework + +### Generate map vector tiles with pg_tileserv + +![pg_tileserv][11] + +pg_tileserv is a lightweight vector tile server written in Go that enables you to generate [vector tiles][12] directly from PostGIS. It does this by implementing the **ST_AsMVT()** function in a best-practice method that translates an HTTP request to the database. It includes common defaults that allow you to pass a database connection URL to the server and be up and running in no time. There's no heavyweight software to install and configure, and it's designed for cloud-native GIS applications. + +For specific examples on how to use it, check out our blog posts on [tile serving][13] and [spatial tile serving with PostgreSQL functions][14]. + +### Annotate your maps with pg_featureserv + +![pg_featureserv][15] + +pg_featureserv is a lightweight service written in Go that enables you to serve features directly out of PostGIS. It implements the [OGC API][16] for features and provides a standard REST endpoint for your spatial data and functions contained in PostGIS. Just like pg_tileserv, there's no heavyweight software to install; just pass a database connection URL to your PostGIS database, and you're off to the races. For a specific example of how to use it, check out our post on [querying spatial features][17]. + +### Focus on spatial data, not GIS + +With our deep background in developing PostGIS and building PostGIS-backed applications, we wanted to help developers unlock all the value of spatial data in a way that is easy to deploy, scale, and maintain. As the source code of pg_tileserv and pg_featureserv show, we are just leveraging functions already in PostGIS. This allows developers to quickly add spatial data to their applications and data scientists to focus on the data. + +![GIS architecture][18] + +The benefits of this approach are: + + * Faster performance because PostgreSQL and PostGIS are doing the work for you + * Less configuration to maintain because the database structure is the configuration + * By design, it runs in the cloud at enterprise scale from the start + * Shorter times to update customer-facing applications—when you update your data in the database, your application is updated instantly + * Ability to focus more on maintaining your data and delivering value to your users and less on wrangling software + + + +Also, since these services respond to the configuration of your database, they also expose functions contained in the database. Rather than developing their data functions to incorporate them into software later, data scientists can create functions in the database that are immediately made available via a REST API. The software begins to fade into the background so an organization can focus on the data. + +Suffice it to say, we're pretty excited about these new geospatial services, and we definitely want your feedback on them. Feel free to check out [pg_tileserve][3] and [pg_featureserv][4], try deploying them alongside your PostGIS databases with the [PostgreSQL Operator][19], and share your feedback in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/gis-kubernetes + +作者:[Adam Timm][a] +选题:[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/timmam +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/map_route_location_gps_path.png?itok=RwtS4DsU (A map with a route highlighted) +[2]: https://www.crunchydata.com/ +[3]: https://github.com/CrunchyData/pg_tileserv +[4]: https://github.com/CrunchyData/pg_featureserv +[5]: https://www.crunchydata.com/products/crunchy-spatial/ +[6]: https://postgis.net/ +[7]: https://www.postgresql.org +[8]: https://www.qgis.org/en/site/ +[9]: http://geoserver.org/ +[10]: http://geonode.org/ +[11]: https://opensource.com/sites/default/files/pg_tileserv.jpg (pg_tileserv) +[12]: https://info.crunchydata.com/blog/dynamic-vector-tiles-from-postgis +[13]: https://info.crunchydata.com/blog/crunchy-spatial-tile-serving +[14]: https://info.crunchydata.com/blog/crunchy-spatial-tile-serving-with-postgresql-functions +[15]: https://opensource.com/sites/default/files/pg_featureserv.jpg (pg_featureserv) +[16]: http://www.ogcapi.org/ +[17]: https://info.crunchydata.com/blog/crunchy-spatial-querying-spatial-features-with-pg_featureserv +[18]: https://opensource.com/sites/default/files/uploads/architecture_0.png (GIS architecture) +[19]: https://github.com/CrunchyData/postgres-operator From 69f8d72714849b526a49f7b4f290498f47afe03d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 21 Apr 2020 00:57:39 +0800 Subject: [PATCH 0389/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200420=20Why?= =?UTF-8?q?=20I=20use=20open=20source=20technology=20for=20web=20developme?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200420 Why I use open source technology for web development.md --- ...n source technology for web development.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/tech/20200420 Why I use open source technology for web development.md diff --git a/sources/tech/20200420 Why I use open source technology for web development.md b/sources/tech/20200420 Why I use open source technology for web development.md new file mode 100644 index 0000000000..03a2ea4148 --- /dev/null +++ b/sources/tech/20200420 Why I use open source technology for web development.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why I use open source technology for web development) +[#]: via: (https://opensource.com/article/20/4/open-source-web-development) +[#]: author: (Jimmy McArthur https://opensource.com/users/jimmymcarthur) + +Why I use open source technology for web development +====== +Micro-frontends with an API-driven approach power the OpenStack +Foundation's platforms. +![Text editor on a browser, in blue][1] + +Every day, millions of people all over the world access the [OpenStack Foundation][2]'s (OSF) web properties to learn about open infrastructure. This level of usage requires a platform and toolsets that are fast, flexible, and affordable—and this is where open source comes in. Not only that, but given that we work for an open source software foundation, we naturally incorporate open source technologies into everything we do, including web development. + +### Considerations for web development + +When thinking about web development technologies, we must consider how we manage our software lifecycles. All software development includes some sort of [lifecycle management][3] with the opportunity to plan, analyze, design, and implement the code. Our web development team usually works on the fly, often under tight deadlines, and with other departments. That means our requirements and workflow must be flexible enough to allow for quick iterations, updates, and corrections. I'd rather push out something quickly and, if needed, go back in and make things pixel perfect after the fact. + +Our team also has to consider all the stakeholders involved in the website, including our talented marketing teams who aren't familiar with Git workflows. That led us, like many others, to utilize a content management system (CMS), so those professionals can make updates without having to use Git. + +### Building a CMS-agnostic web architecture + +In order to uphold this need for flexibility, traditionally, we relied on an open source CMS, [SilverStripe][4]. However, our requirements quickly outgrew the system. So, we built a standalone API and use static micro-sites with [React][5] JavaScript components to pull data into custom-designed presentation layers. We use this system in everything from mobile apps to websites to digital signs. This has become known as a [Jamstack][6] architecture. We found this model was extensible enough that it allowed us to move our data anywhere while being CMS-agnostic. + +When adopting this API-driven workflow, we realized that our data was used in many different places and presented in many different ways. Across our seven web properties, we share everything from graphics to dynamic content. A standard CMS won't do this without a lot of custom development work along with either cron jobs or costly database queries. + +When things are API-driven, you can access all these different datasets across a variety of platforms while largely protecting your infrastructure from major traffic spikes. For example, the OSF collaborated with [Tipit][7], the OSF's digital design and development partner, to develop a completely open source end-to-end event management software. Our event-schedule data is presented on web pages, mobile apps, and digital signage. It's the same data, managed from a single place, but with different presentation layers, formats, and platforms. + +### Open source identity access management + +A cornerstone of moving to a decentralized Jamstack architecture is the need to establish identity and access rights. When using JavaScript to call for things in an API, we may need to require authentication and authorization. Therefore, we had to separate the identity provider from any individual implementation. There are two concepts to this: identity (authN) and identity access management (authZ). The identity provider confirms who you are, while access management confirms what roles and permissions you have to do different things. One of the first requirements when developing the event-management software was to establish a standalone identity provider. + +Enter [OpenStackID][8], which is an [OpenID Connect][9] with oAuth2 SSO solution. OpenStackID started out as a more secure way for users to log into [Openstack.org][10] and manage their profiles. Even as the number of websites and event apps we manage grows, this creates a seamless authentication experience for users. The access-management portion allows us to build standalone React-based apps that use the identity provider to determine if a particular user has the rights to do the things they want to do in that specific application. + +One thing that runs through everyone's mind—especially in a global open source community—is privacy. It's a large factor in creating our web and event properties. With OpenStackID, users can log into their [OpenStackID account][11] and set application permissions using the OAuth 2 console. If they decide they no longer want their app associated with their OpenStackID, they can simply remove permissions. + +For example, we have users for our events that do not want their personal information to be associated with their presence at our conferences. The way the platforms are set up, all personally identifiable data is managed securely on the OpenID server, and it's not shared between applications unless the user strictly enables it. Beyond that, we never share things like the events a user attends or pieces of their user profile unless it's completely anonymized, or they specifically allow it in order to remain aligned with the [Four Opens][12] or our community philosophy. + +### Better web infrastructure using open source + +Taking our considerations and shifting toward a more flexible implementation of a CMS has helped our teams collaborate more effectively. Most importantly, we continue to follow our community values by providing great privacy and security options thanks to open source technology. + +If you're interested in our approach, check out the OSF Foundation website's [source code][13]. You can also access the following source code repos to see the approach in action: + + * [Zuul website][14] + * [Airship website][15] + * [StarlingX website][16] + * [Kata Containers website][17] + * [MOC and Open Infra Labs website][18] + * [Open Stack Foundation website][19] + * [Open Infrastructure Summit admin][20] + * [Open Infrastructure Summit CFP][21] + * [Open Infrastructure Summit Signage][22] + * [OpenStack Survey GraphQL API to access survey data and reports][23] + * [OpenStack Survey Graphene API to feed summit reports][24] + * [OpenStackID authentication system][25] + * [OpenStackID resource server][26] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/open-source-web-development + +作者:[Jimmy McArthur][a] +选题:[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/jimmymcarthur +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) +[2]: https://osf.dev/ +[3]: https://en.wikipedia.org/wiki/Systems_development_life_cycle +[4]: https://www.silverstripe.org/ +[5]: https://reactjs.org/ +[6]: https://jamstack.org/ +[7]: https://www.tipit.net/ +[8]: https://opendev.org/explore/repos?q=openstackid&tab=&sort=recentupdate +[9]: https://openid.net/connect/ +[10]: http://Openstack.org +[11]: https://openstackid.org/ +[12]: https://osf.dev/about/four-opens/ +[13]: https://github.com/OpenStackweb/openstack-org +[14]: https://opendev.org/zuul/zuul-website +[15]: https://github.com/AirshipWeb/airship-website +[16]: https://github.com/StarlingXWeb/starlingx-website +[17]: https://github.com/kata-containers/www.katacontainers.io +[18]: https://github.com/OpenStackweb/openinfralabs-website +[19]: https://github.com/OpenStackweb/osf-website +[20]: https://github.com/OpenStackweb/summit-admin +[21]: https://github.com/OpenStackweb/call-for-presentations +[22]: https://github.com/OpenStackweb/openstacksignage +[23]: https://github.com/OpenStackweb/openstack-survey-api +[24]: https://github.com/OpenStackweb/summit-reports-api +[25]: https://opendev.org/osf/openstackid +[26]: https://opendev.org/osf/openstackid-resources From ae7d7e2330d71fcaf13b7c6a73a23da61ebcc000 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Tue, 21 Apr 2020 01:07:06 +0800 Subject: [PATCH 0390/1809] TSL --- ...orkspaces with Great Teeming Workspaces.md | 149 ++++++++---------- 1 file changed, 65 insertions(+), 84 deletions(-) rename {sources => translated}/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md (83%) diff --git a/sources/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md b/translated/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md similarity index 83% rename from sources/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md rename to translated/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md index c679c29a38..db5f0bf1ca 100644 --- a/sources/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md +++ b/translated/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md @@ -7,155 +7,136 @@ [#]: via: (https://opensource.com/article/20/2/git-great-teeming-workspaces) [#]: author: (Daniel Gryniewicz https://opensource.com/users/dang) -Manage complex Git workspaces with Great Teeming Workspaces +使用 Great Teeming Workspaces 管理复杂的 Git 工作空间 ====== -GTWS is a set of scripts that make it easy to have development -environments for different projects and different versions of a project. +GTWS 是一系列脚本,这些脚本能让我们在开发环境中管理一个有不同项目和不同版本的工程时变得更简单。 ![Coding on a computer][1] -Great Teeming Workspaces ([GTWS][2]) is a complex workspace management package for Git that makes it easy to have development environments for different projects and different versions of a project. +[GTWS][2] 是一个 Git 的复杂工作空间管理工具包,可以让我们在开发环境中管理一个有不同项目和不同版本的工程时变得更简单。 -Somewhat like Python [venv][3], but for languages other than Python, GTWS handles workspaces for multiple versions of multiple projects. You can create, update, enter, and leave workspaces easily, and each project or version combination has (at most) one local origin that syncs to and from the upstream—all other workspaces update from the local origin. - -### Layout +有点像 Python 的 [venv][3],但不是为 Python 语言准备的。GTWS 用来处理多项目的多个版本的工作空间。你可以很容易地创建、更新、进入和离开工作空间,每个项目或版本的组合(最多)有一个本地的 origin,用来与 upstream 同步 — 其余的所有工作空间都从本地的 origin 更新。 +### 部署 ``` ${GTWS_ORIGIN}/<project>/<repo>[/<version>] ${GTWS_BASE_SRCDIR}/<project>/<version>/<workspacename>/{<repo>[,<repo>...]} ``` -Each level in the source tree (plus the homedir for globals) can contain a **.gtwsrc** file that maintains settings and Bash code relevant to that level. Each more specific level overrides the higher levels. +源目录的每一级(包括全局的 home 目录)可以包含一个 **.gtwsrc** 文件,这个文件中维护与当前级相关的设置和 bash 代码。每一级的配置会覆盖上一级。 -### Setup - -Check out GTWS with: +### 安装 +用下面的命令检出 GTWS: ``` `git clone https://github.com/dang/gtws.git` ``` -Set up your **${HOME}/.gtwsrc**. It should include **GTWS_ORIGIN** and optionally **GTWS_SETPROMPT**. - -Add the repo directory to your path: +配置你的 **${HOME}/.gtwsrc**。它应该包含 **GTWS_ORIGIN**,也可以再包含 **GTWS_SETPROMPT**。 +把仓库目录加到环境变量中: ``` `export PATH="${PATH}:/path/to/gtws` ``` -### Configuration +### 配置 -Configuration is via cascading **.gtwsrc** files. It walks the real path down from the root, and each **.gtwsrc** file it finds is sourced in turn. More specific files override less specific files. +通过级联 **.gtwsrc** 文件来进行配置。它从根目录向下遍历,会执行在每级目录中找到的 **.gtwsrc** 文件。下级目录的文件会覆盖上一级。 -Set the following in your top-level **~/.gtws/.gtwsrc**: +在你最上层的文件 **~/.gtws/.gtwsrc** 中进行如下设置: - * **GTWS_BASE_SRCDIR:** This is the base of all the projects' source trees. It defaults to **$HOME/src**. - * **GTWS_ORIGIN:** This sets the location of the origin Git trees. It defaults to **$HOME/origin**. - * **GTWS_SETPROMPT:** This is optional. If it's set, the shell prompt will have the workspace name in it. - * **GTWS_DEFAULT_PROJECT:** This is the project used when no project is given or known. If it is not given, projects must be specified on the command line. - * **GTWS_DEFAULT_PROJECT_VERSION:** This is the default version to check out. It defaults to **master**. + * **GTWS_BASE_SRCDIR:** 所有项目源文件目录树的 base。默认为 **$HOME/src**。 + * **GTWS_ORIGIN:** 指定 origin git 目录树的路径。默认为 **$HOME/origin**。 + * **GTWS_SETPROMPT:** 可选配置。如果配置了这个参数,shell 提示符会有工作空间的名字。 + * **GTWS_DEFAULT_PROJECT:** 不指定项目或项目未知时默认的项目名。如果不指定,使用命令行时必须指明项目。 + * **GTWS_DEFAULT_PROJECT_VERSION:** 检出的默认版本。默认为 **master**。 +在每个项目的根目录进行以下设置: + * **GTWS_PROJECT:** 项目的名字(和 base 目录)。 + * **gtws_project_clone:** 这个函数用于克隆一个项目的指定版本。如果未定义,它会假定项目的 origin 对每一个版本都有一个单独的目录,这样会导致克隆一堆 Git 仓库。 + * **gtws_project_setup:** 在克隆完所有的仓库后,可以选择是否调用这个函数,调用后可以对项目进行必要的配置,如在 IDE 中配置工作空间。 -Set the following at the project level of each project: +在项目版本级进行以下设置: - * **GTWS_PROJECT:** The name (and base directory) of the project. - * **gtws_project_clone:** This function is used to clone a specific version of a project. If it is not defined, then it is assumed that the origin for the project contains a single directory per version, and that contains a set of Git repos to clone. - * **gtws_project_setup:** This optional function is called after all cloning is done and allows any additional setup necessary for the project, such as setting up workspaces in an IDE. + * **GTWS_PROJECT_VERSION:** 项目的版本。用于正确地从 origin 拉取代码。类似 Git 中的分支名字。 +下面这些参数可以在目录树的任意地方进行配置,如果能生效,它们可以被重写多次: + * **GTWS_PATH_EXTRA:** 这些是工作空间中加到路径后的额外的路径元素。 + * **GTWS_FILES_EXTRA:** 这些是不在版本控制内,但应该在工作空间中被检出的额外的文件。这些文件包括 **.git/info/exclude**,每个文件都与仓库的 base 相关联。 -Set this at the project version level: +### origin 目录 - * **GTWS_PROJECT_VERSION:** This is the version of the project. It's used to pull from the origin correctly. In Git, this is likely the branch name. +**GTWS_ORIGIN** (大部分脚本中)指向拉取和推送的原始 Git 检出目录。 - - -These things can go anywhere in the tree and can be overridden multiple times, if it makes sense: - - * **GTWS_PATH_EXTRA:** These are extra path elements to be added to the path inside the workspace. - * **GTWS_FILES_EXTRA:** These are extra files not under version control that should be copied into each checkout in the workspace. This includes things like **.git/info/exclude**, and each file is relative to the base of its repo. - - - -### Origin directories - -**GTWS_ORIGIN** (in most scripts) points to the pristine Git checkouts to pull from and push to. - -Layout of **${GTWS_ORIGIN}**: +**${GTWS_ORIGIN}** 部署: * **/<project>** - * This is the base for repos for a project. - * If **gtws_project_clone** is given, this can have any layout you desire. - * If **gtws_project_clone** is not given, this must contain a single subdirectory named **git** that contains a set of bare Git repos to clone. + * 这是一个项目的仓库 base。 + * 如果指定了 **gtws_project_clone**,你可以配置任意的部署路径。 + * 如果没有指定 **gtws_project_clone**,这个路径下必须有个名为 **git** 的子目录,且 **git** 目录下有一系列用来克隆的裸 Git 仓库。 +### 工作流示例 +假设你有一个项目名为 **Foo**,它的 upstream 为 **github.com/foo/foo.git**。这个仓库有个名为 **bar** 的子模块,它的 upstream 是 **github.com/bar/bar.git**。Foo 项目在 master 分支开发,使用稳定版本的分支。 -### Workflow example +为了能在 Foo 中使用 GTWS,你首先要配置目录结构。本例中假设你使用默认的目录结构。 -Suppose you have a project named **Foo** that has an upstream repository at **github.com/foo/foo.git**. This repo has a submodule named **bar** with an upstream at **github.com/bar/bar.git**. The Foo project does development in the master branch and uses stable version branches. - -Before you can use GTWS with Foo, first you must set up the directory structure. These examples assume you are using the default directory structure. - - * Set up your top level **.gtwsrc**: + * 配置你最上层的 **.gtwsrc**: * **cp ${GTWS_LOC}/examples/gtwsrc.top ~/.gtwsrc** - * Edit **~/.gtwsrc** and change as necessary. - * Create top-level directories: + * 根据需要修改 **~/.gtwsrc**。 + * 创建顶级目录: * **mkdir -p ~/origin ~/src** - * Create and set up the project directory: + * 创建并配置项目目录: * **mkdir -p ~/src/foo** **cp ${GTWS_LOC}/examples/gtwsrc.project ~/src/foo/.gtwsrc** - * Edit **~/src/foo/.gtwsrc** and change as necessary. - * Create and set up the master version directory: + * 根据需要修改 **~/src/foo/.gtwsrc**。 + * 创建并配置 master 版本目录: * **mkdir -p ~/src/foo/master** **cp ${GTWS_LOC}/examples/gtwsrc.version ~/src/foo/master/.gtwsrc** - * Edit **~/src/foo/master/.gtwsrc** and change as necessary. - * Go to the version directory and create a temporary workspace to set up the mirrors: + * 根据需要修改 **~/src/foo/master/.gtwsrc**。 + * 进入版本目录并创建一个临时工作空间来配置镜像: * **mkdir -p ~/src/foo/master/tmp** **cd ~/src/foo/master/tmp git clone --recurse-submodules git://github.com/foo/foo.git cd foo -gtws-mirror -o ~/origin -p foo** - * This will create **~/origin/foo/git/foo.git** and **~/origin/foo/submodule/bar.git**. - * Future clones will clone from these origins rather than from upstream. - * This workspace can be deleted now. +gtws-mirror -o ~/origin -p foo**(译注:这个地方原文有误,不加 `-s` 参数会报错) + * 上面命令会创建 **~/origin/foo/git/foo.git** 和 **~/origin/foo/submodule/bar.git**。 + * 以后的克隆操作会从这些 origin 而不是 upstream 克隆。 + * 现在可以删除工作空间了。 +到现在为止,Foo 的 master 分支的工作可以结束了。假设你现在想修复一个 bug,名为 **bug1234**。你可以脱离你当前的工作空间为修复这个 bug 单独创建一个工作空间,之后在新创建的工作空间中开发。 - -At this point, work can be done on the master branch of Foo. Suppose you want to fix a bug named **bug1234**. You can create a workspace for this work to keep it isolated from anything else you're working on, and then work within this workspace. - - * Go to the version directory, and create a new workspace: + * 进入版本目录,创建一个新的工作空间: * **cd ~/src/foo/master mkws bug1234** - * This creates **bug1234/**, and inside it checks out Foo (and its submodule **bar**) and makes **build/foo** for building it. - * Enter the workspace. There are two ways to do this: + * 上面的命令创建了 **bug1234/**,在这个目录下检出了 Foo(和它的子模块 **bar**),并创建了 **build/foo** 来构建它。 + * 有两种方式进入工作空间: * **cd ~/src/foo/master/bug1234 startws** -or +或者 **cd ~/src/foo/master/** **startws bug1234** - * This starts a subshell within the bug1234 workspace. This shell has the GTWS environment plus any environment you set up in your stacked **.gtwsrc** files. It also adds the base of the workspace to your CD path, so you can **cd** into relative paths from that base. - * At this point, you can do work on bug1234, build it, test it, and commit your changes. When you're ready to push to upstream, do this:  + * 上面的命令在 bug1234 工作空间中开启了一个子 shell。这个 shell 有 GTWS 的环境和你在各级 **.gtwsrc** 文件中设置的环境。它也把你工作空间的 base 路径加入到了 CD,因此你可以从 base 路径 **cd** 到相关的目录中。 + * 现在你可以修复 bug1234了,构建、测试、提交你的修改。当你可以把代码推送到 upstream 时,执行下面的命令: **cd foo wspush**  - * **wspush** will push the branch associated with your workspace—first to your local origin and then to the upstream. - * If upstream changes. you can sync your local checkout using:  + * **wspush** 会把代码推送到与你工作空间相关的分支 — 先推送到本地的 origin,再推送到 upstream。 + * 当 upstream 有修改时,你可以用下面的命令同步到本地: **git sync** - * This envokes the **git-sync** script in GTWS, which will update your checkout from the local origin. To update the local origin, use:  + * 上面的命令调用了 GTWS 的 **git-sync** 脚本,会从本地 origin 更新代码。使用下面的命令来更新本地的 origin: **git sync -o**  - * This will update your local origin and submodules' mirrors, then use those to update your checkout. **git-sync** has other nice features. - * When you're done using the workspace, just exit the shell: + * 上面的命令会更新你本地的 origin 和子模块的镜像,然后用那些命令来更新你的检出仓库的代码。**git-sync** 也有一些其他的很好的工鞥。 + * 当要结束工作空间中的工作时,直接退出 shell: **exit** - * You can re-enter the workspace at any time and have multiple shells in the same workspace at the same time. - * When you're done with a workspace, you can remove it using the **rmws** command or just remove its directory tree.  - * There is a script named **tmws** that enters a workspace within tmux, creating a set of windows/panes that are fairly specific to my workflow.  Feel free to modify it to suit your needs. - - - -### The script + * 你可以在任何时间重复进入工作空间,也可以在同一时间在相同的工作空间中开多个 shell。 + * 当你不需要某个工作空间时,你可以使用 **rmws** 来删除它,或者直接删除它的目录树。 + * 还有一个脚本 **tmws** 使用 tmux 进入工作空间,能创建一系列的窗口/窗格,这完美契合我的工作流。你可以根据你自己的需求来修改它。 +### 脚本内容 ``` #!/bin/bash @@ -1157,7 +1138,7 @@ via: https://opensource.com/article/20/2/git-great-teeming-workspaces 作者:[Daniel Gryniewicz][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[lxbwolf](https://github.com/lxbwolf) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 039f085be3478c108286f5f27144c38741fd36f6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 21 Apr 2020 08:44:24 +0800 Subject: [PATCH 0391/1809] translated --- ...20200413 How to install Python on Linux.md | 159 ------------------ ...20200413 How to install Python on Linux.md | 157 +++++++++++++++++ 2 files changed, 157 insertions(+), 159 deletions(-) delete mode 100644 sources/tech/20200413 How to install Python on Linux.md create mode 100644 translated/tech/20200413 How to install Python on Linux.md diff --git a/sources/tech/20200413 How to install Python on Linux.md b/sources/tech/20200413 How to install Python on Linux.md deleted file mode 100644 index 07d4aa4087..0000000000 --- a/sources/tech/20200413 How to install Python on Linux.md +++ /dev/null @@ -1,159 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to install Python on Linux) -[#]: via: (https://opensource.com/article/20/4/install-python-linux) -[#]: author: (Vijay Singh Khatri https://opensource.com/users/vijaytechnicalauthor) - -How to install Python on Linux -====== -Step-by-step instructions for installing the latest Python instead of -(or alongside) an older version on Linux. -![OpenStack source code \(Python\) in VIM][1] - -[Python][2] is now the [most popular][3], most used programming language. Python's simple syntax and low learning curve make it the ultimate choice for beginners as well as professional developers. Python is also a very versatile programming language. It's used nearly everywhere—from web development to artificial intelligence—really anywhere other than mobile development. - -If you're using Python, there's a good chance you're a developer (or want to become one), and Linux is a great platform for creating software. But when you're working with Python every day, you sometimes want to stay up to date with the very latest version. You may not want to replace the default install of Python on your system just to test drive the latest one, so this article explains how to install the latest version of Python 3 on Linux without replacing the version provided by your distribution. - -Use the **python --version terminal** command to check whether Python is already installed and, if so, which version you have. If Python is not installed on your Linux system, or you want to install an updated version, follow the steps below. - -### Step-by-step installation instructions - -#### **Step 1:** First, install development packages required to build Python. - -#### On Debian: - - -``` -$ sudo apt update -$ sudo apt install build-essential zlib1g-dev \ -libncurses5-dev libgdbm-dev libnss3-dev \ -libssl-dev libreadline-dev libffi-dev curl -``` - -#### On Fedora: - - -``` -`$ sudo dnf groupinstall development` -``` - -#### Step 2: Download the stable latest release of Python 3 - -Visit the [official Python website][4] and download the latest version of Python 3. After the download is complete, you hav a **.tar.xz** archive file (a "tarball") containing the source code of Python. - -#### Step 3: Extract the tarball - -Once the download is complete, extract the tarball by either using the extractor application of your choice or the [Linux **tar** command][5], for example: - - -``` -`$ tar -xf Python-3.?.?.tar.xz` -``` - -#### Step 4: Configure the script - -Once the Python tarball has been extracted, navigate to the configure script and execute it in your Linux terminal with: - - -``` -$ cd Python-3.* -./configure -``` - -The configuration may take some time. Wait until it is successfully finishes before proceeding. - -#### Step 5: Start the build process - -If you already have a version of Python installed on your system and you want to install the new version alongside it, use this command: - - -``` -`$ sudo make altinstall` -``` - -The build process may take some time. - -If you want to replace your current version of Python with this new version, you should uninstall your current Python package using your package manager (such as **apt** or **dnf**) and then install: - - -``` -`$ sudo make install` -``` - -However, it's generally preferable to install software as a package (such as a **.deb** or **.rpm** file) so your system can track and update it for you. Because this article assumes the latest Python isn't yet packaged yet, though, you probably don't have that option. In that case, you can either install Python with **altinstall** as suggested, or rebuild an existing Python package using the latest source code. That's an advanced topic and specific to your distribution, so it's out of scope for this article. - -#### Step 6: Verify the installation - -If you haven't encountered any errors, the latest Python is now installed on your Linux system. To verify it, write one of these commands in your terminal: - - -``` -`python3 --version` -``` - -or - - -``` -`python --version` -``` - -If the output says **Python 3.x**, Python 3 has been successfully installed. - -### Create a virtual environment (optional) - -Python provides a package known as **venv** (virtual environment), which helps you isolate a program directory or package from other ones. - -To create a virtual environment, enter the following in the Python terminal (in this example, assume the version of Python you've installed is in the **3.8** series): - - -``` -`python3.8 -m venv example` -``` - -This command creates a new directory (which I've named **example**), with some subdirectories. - -To activate the virtual environment, enter: - - -``` -$ source example/bin/activate -(example) $ -``` - -Notice that your terminal prompt (**$**) is now preceeded by an environment name. - -To deactivate the virtual environment, use the **deactivate** command: - - -``` -`(example) $ deactivate` -``` - -### Conclusion - -Python is a fun language that's developed and improved frequently. Getting familiar with new features is easy, once you understand how to install the latest release without interfering with the stable version provided from your distribution. - -If you have any feedback or questions, please leave them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/install-python-linux - -作者:[Vijay Singh Khatri][a] -选题:[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/vijaytechnicalauthor -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_1.jpg?itok=lHQK5zpm (OpenStack source code (Python) in VIM) -[2]: https://www.python.org/ -[3]: http://pypl.github.io/PYPL.html -[4]: http://python.org -[5]: https://opensource.com/article/17/7/how-unzip-targz-file diff --git a/translated/tech/20200413 How to install Python on Linux.md b/translated/tech/20200413 How to install Python on Linux.md new file mode 100644 index 0000000000..af38718735 --- /dev/null +++ b/translated/tech/20200413 How to install Python on Linux.md @@ -0,0 +1,157 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to install Python on Linux) +[#]: via: (https://opensource.com/article/20/4/install-python-linux) +[#]: author: (Vijay Singh Khatri https://opensource.com/users/vijaytechnicalauthor) + +如何在 Linux 上安装 Python +====== +在 Linux 上安装最新 Python (或并列多个)而不是老版本的分步说明。 +![OpenStack source code \(Python\) in VIM][1] + +[Python][2] 现在是[最受欢迎][3],最常用的编程语言。Python 的简单语法和较低的学习曲线使其成为初学者和专业开发人员的最终选择。Python 还是一种非常通用的编程语言。从 Web 开发到人工智能,它几乎在除了移动开发的所有地方都有使用。 + +如果你使用的是 Python,那么你很有可能是一名开发人员(或想成为一名开发人员),而 Linux 是创建软件的绝佳平台。但是,当你每天使用 Python 时,有时你希望使用最新版本。你可能不想仅仅为了测试最新版本的系统而替换了默认的 Python 安装,因此本文说明了如何在 Linux 上安装最新版本的 Python 3,而不替换发行版提供的版本。 + +使用 **python --version terminal** 命令检查是否已安装 Python,如果已安装,那么检查是哪个版本。如果你的 Linux 系统上未安装 Python,或者你想安装更新的版本,请按照以下步骤操作。 + +### 分步安装说明 + +#### **步骤 1:**首先,安装构建 Python 所需的开发包。 + +#### 在 Debian 上: + + +``` +$ sudo apt update +$ sudo apt install build-essential zlib1g-dev \ +libncurses5-dev libgdbm-dev libnss3-dev \ +libssl-dev libreadline-dev libffi-dev curl +``` + +#### 在 Fedora 上: + + +``` +`$ sudo dnf groupinstall development` +``` + +#### 步骤 2:下载稳定的最新版本的 Python 3 + +访问[官方 Python 网站][4]并下载最新版本的 Python3。下载完成后,你会有一个 **.tar.xz** 归档文件(“tarball”),其中包含 Python 的源代码。 + +#### 步骤 3:解压 tarball + +下载完成后,使用解压程序或 [Linux 的 **tar** 命令][5]解压压缩包,例如: + +``` +`$ tar -xf Python-3.?.?.tar.xz` +``` + +#### 步骤 4:配置脚本 + +解压 Python 压缩包后,进入 configure 脚本所在目录并在 Linux 终端中使用以下命令执行该脚本: + + +``` +$ cd Python-3.* +./configure +``` + +配置可能需要一些时间。等待直到成功完成,然后再继续。 + +#### 步骤 5:开始构建过程 + +如果你的系统上已经安装了某个版本的 Python,并且希望同时安装新版本的 Python,请使用以下命令: + + +``` +`$ sudo make altinstall` +``` + +构建过程可能需要一些时间。 + +如果要使用此版本替换当前版本的 Python,那么应使用包管理器(例如 **apt** 或 **dnf**)卸载当前的 Python 包,然后安装: + + +``` +`$ sudo make install` +``` + +但是,通常最好将软件作为包安装(例如 **.deb** 或 **.rpm** 文件),以便系统可以为你跟踪和更新它。因为本文假设尚未打包最新的 Python,所以你可能没有这个选择。在这种情况下,你可以按照建议使用 **altinstall** 来安装 Python,或者使用最新的源代码重建现有的 Python 包。这是一个高级主题,并且特定于你的发行版,因此不在本文讨论范围之内。 + +#### 步骤 6:验证安装 + +如果你没有遇到任何错误,那么现在你的 Linux 系统上已安装了最新的 Python。要进行验证,请在终端中输入以下命令之一: + + +``` +`python3 --version` +``` + +或者 + + +``` +`python --version` +``` + +如果输出显示 **Python 3.x**,那么说明 Python 3 已成功安装。 + +### 创建虚拟环境(可选) + +Python 提供了名为 **venv**(虚拟环境)的软件包,可帮助你将程序目录或软件包与其他目录或软件包隔离。 + +要创建虚拟环境,请在 Python 终端中输入以下内容(在此示例中,假定你安装的 Python 版本为 **3.8** 系列): + + +``` +`python3.8 -m venv example` +``` + +该命令创建一个带有一些子目录的新目录(我将其命名为 **example**)。 + +要激活虚拟环境,请输入: + + +``` +$ source example/bin/activate +(example) $ +``` + +请注意,你的终端提示符(**$**)现在以环境名称开头。 + +要停用虚拟环境,请使用 **deactivate** 命令: + + +``` +`(example) $ deactivate` +``` + +### 总结 + +Python 是一种有趣的语言,经常被开发和改进。一旦了解了如何安装最新版本而又不干扰发行版提供的稳定版本,熟悉新功能将很容易。 + +如果你有任何反馈或问题,请在评论中提出。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/install-python-linux + +作者:[Vijay Singh Khatri][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/vijaytechnicalauthor +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_1.jpg?itok=lHQK5zpm (OpenStack source code (Python) in VIM) +[2]: https://www.python.org/ +[3]: http://pypl.github.io/PYPL.html +[4]: http://python.org +[5]: https://opensource.com/article/17/7/how-unzip-targz-file From 1d54018ac3bdbb1c2102800d0819d55ac19a9dd0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 21 Apr 2020 08:48:06 +0800 Subject: [PATCH 0392/1809] translating --- .../20200416 How to package Python applications for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200416 How to package Python applications for Linux.md b/sources/tech/20200416 How to package Python applications for Linux.md index 24e8343038..a765f4a536 100644 --- a/sources/tech/20200416 How to package Python applications for Linux.md +++ b/sources/tech/20200416 How to package Python applications for Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 36ee8b0ab66e0f65244ad170d0120d1000256e16 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 21 Apr 2020 09:06:18 +0800 Subject: [PATCH 0393/1809] Rename sources/tech/20200420 Why I use open source technology for web development.md to sources/talk/20200420 Why I use open source technology for web development.md --- ...200420 Why I use open source technology for web development.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200420 Why I use open source technology for web development.md (100%) diff --git a/sources/tech/20200420 Why I use open source technology for web development.md b/sources/talk/20200420 Why I use open source technology for web development.md similarity index 100% rename from sources/tech/20200420 Why I use open source technology for web development.md rename to sources/talk/20200420 Why I use open source technology for web development.md From 4b51ab8866b7c7f40e39193db2f211d6f7b4e583 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Apr 2020 09:45:22 +0800 Subject: [PATCH 0394/1809] PRF @geekpi --- ...20200413 How to install Python on Linux.md | 72 +++++++++---------- 1 file changed, 32 insertions(+), 40 deletions(-) diff --git a/translated/tech/20200413 How to install Python on Linux.md b/translated/tech/20200413 How to install Python on Linux.md index af38718735..eebb701a9c 100644 --- a/translated/tech/20200413 How to install Python on Linux.md +++ b/translated/tech/20200413 How to install Python on Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to install Python on Linux) @@ -9,21 +9,22 @@ 如何在 Linux 上安装 Python ====== -在 Linux 上安装最新 Python (或并列多个)而不是老版本的分步说明。 -![OpenStack source code \(Python\) in VIM][1] -[Python][2] 现在是[最受欢迎][3],最常用的编程语言。Python 的简单语法和较低的学习曲线使其成为初学者和专业开发人员的最终选择。Python 还是一种非常通用的编程语言。从 Web 开发到人工智能,它几乎在除了移动开发的所有地方都有使用。 +> 在 Linux 上安装最新 Python,替代或与老版本并存的分步说明。 + +![](https://img.linux.net.cn/data/attachment/album/202004/21/094500u63lnlgukgnjb0t0.jpg) + +[Python][2] 现在是[最流行][3]、最常用的编程语言。Python 的简单语法和较低的学习曲线使其成为初学者和专业开发人员的终极选择。Python 还是一种非常通用的编程语言。从 Web 开发到人工智能,它几乎在除了移动开发的所有地方都有使用。 如果你使用的是 Python,那么你很有可能是一名开发人员(或想成为一名开发人员),而 Linux 是创建软件的绝佳平台。但是,当你每天使用 Python 时,有时你希望使用最新版本。你可能不想仅仅为了测试最新版本的系统而替换了默认的 Python 安装,因此本文说明了如何在 Linux 上安装最新版本的 Python 3,而不替换发行版提供的版本。 -使用 **python --version terminal** 命令检查是否已安装 Python,如果已安装,那么检查是哪个版本。如果你的 Linux 系统上未安装 Python,或者你想安装更新的版本,请按照以下步骤操作。 +使用 `python --version` 终端命令检查是否已安装 Python,如果已安装,那么检查是哪个版本。如果你的 Linux 系统上未安装 Python,或者你想安装更新的版本,请按照以下步骤操作。 ### 分步安装说明 -#### **步骤 1:**首先,安装构建 Python 所需的开发包。 - -#### 在 Debian 上: +#### 步骤 1:首先,安装构建 Python 所需的开发包 +在 Debian 上 ``` $ sudo apt update @@ -32,29 +33,27 @@ libncurses5-dev libgdbm-dev libnss3-dev \ libssl-dev libreadline-dev libffi-dev curl ``` -#### 在 Fedora 上: - +在 Fedora 上: ``` -`$ sudo dnf groupinstall development` +$ sudo dnf groupinstall development ``` -#### 步骤 2:下载稳定的最新版本的 Python 3 +#### 步骤 2:下载最新的稳定版本的 Python 3 -访问[官方 Python 网站][4]并下载最新版本的 Python3。下载完成后,你会有一个 **.tar.xz** 归档文件(“tarball”),其中包含 Python 的源代码。 +访问[官方 Python 网站][4]并下载最新版本的 Python 3。下载完成后,你会有一个 `.tar.xz` 归档文件(“tarball”),其中包含 Python 的源代码。 #### 步骤 3:解压 tarball -下载完成后,使用解压程序或 [Linux 的 **tar** 命令][5]解压压缩包,例如: +下载完成后,使用解压程序或 [Linux 的 tar 命令][5]解压压缩包,例如: ``` -`$ tar -xf Python-3.?.?.tar.xz` +$ tar -xf Python-3.?.?.tar.xz ``` #### 步骤 4:配置脚本 -解压 Python 压缩包后,进入 configure 脚本所在目录并在 Linux 终端中使用以下命令执行该脚本: - +解压 Python 压缩包后,进入 `configure` 脚本所在目录并在 Linux 终端中使用以下命令执行该脚本: ``` $ cd Python-3.* @@ -67,73 +66,66 @@ $ cd Python-3.* 如果你的系统上已经安装了某个版本的 Python,并且希望同时安装新版本的 Python,请使用以下命令: - ``` -`$ sudo make altinstall` +$ sudo make altinstall ``` 构建过程可能需要一些时间。 -如果要使用此版本替换当前版本的 Python,那么应使用包管理器(例如 **apt** 或 **dnf**)卸载当前的 Python 包,然后安装: - +如果要使用此版本替换当前版本的 Python,那么应使用包管理器(例如 `apt` 或 `dnf`)卸载当前的 Python 包,然后安装: ``` -`$ sudo make install` +$ sudo make install ``` -但是,通常最好将软件作为包安装(例如 **.deb** 或 **.rpm** 文件),以便系统可以为你跟踪和更新它。因为本文假设尚未打包最新的 Python,所以你可能没有这个选择。在这种情况下,你可以按照建议使用 **altinstall** 来安装 Python,或者使用最新的源代码重建现有的 Python 包。这是一个高级主题,并且特定于你的发行版,因此不在本文讨论范围之内。 +但是,通常最好以软件包的形式(例如 `.deb` 或 `.rpm` 文件)来安装软件,以便系统可以为你跟踪和更新它。因为本文假设尚未打包最新的 Python,所以你可能没有这个选择。在这种情况下,你可以按照建议使用 `altinstall` 来安装 Python,或者使用最新的源代码重构现有的 Python 包。这是一个高级主题,并且特定于你的发行版,因此不在本文讨论范围之内。 #### 步骤 6:验证安装 如果你没有遇到任何错误,那么现在你的 Linux 系统上已安装了最新的 Python。要进行验证,请在终端中输入以下命令之一: - ``` -`python3 --version` +python3 --version ``` 或者 - ``` -`python --version` +python --version ``` -如果输出显示 **Python 3.x**,那么说明 Python 3 已成功安装。 +如果输出显示 `Python 3.x`,那么说明 Python 3 已成功安装。 ### 创建虚拟环境(可选) -Python 提供了名为 **venv**(虚拟环境)的软件包,可帮助你将程序目录或软件包与其他目录或软件包隔离。 - -要创建虚拟环境,请在 Python 终端中输入以下内容(在此示例中,假定你安装的 Python 版本为 **3.8** 系列): +Python 提供了名为 `venv`(虚拟环境)的软件包,可帮助你将程序目录或软件包与其他目录或软件包隔离。 +要创建虚拟环境,请在 Python 终端中输入以下内容(在此示例中,假定你安装的 Python 版本为 `3.8` 系列): ``` -`python3.8 -m venv example` +python3.8 -m venv example ``` -该命令创建一个带有一些子目录的新目录(我将其命名为 **example**)。 +该命令创建一个带有一些子目录的新目录(我将其命名为 `example`)。 要激活虚拟环境,请输入: - ``` $ source example/bin/activate (example) $ ``` -请注意,你的终端提示符(**$**)现在以环境名称开头。 - -要停用虚拟环境,请使用 **deactivate** 命令: +请注意,你的终端提示符(`$`)现在以环境名称开头。 +要停用虚拟环境,请使用 `deactivate` 命令: ``` -`(example) $ deactivate` +(example) $ deactivate ``` ### 总结 -Python 是一种有趣的语言,经常被开发和改进。一旦了解了如何安装最新版本而又不干扰发行版提供的稳定版本,熟悉新功能将很容易。 +Python 是一种有趣的语言,它的开发和改进非常频繁。一旦了解了如何安装最新版本而又不干扰发行版提供的稳定版本,熟悉新功能将很容易。 如果你有任何反馈或问题,请在评论中提出。 @@ -144,7 +136,7 @@ via: https://opensource.com/article/20/4/install-python-linux 作者:[Vijay Singh Khatri][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From eab03a33e511769e5e97663f7c15f2922c482fc8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Apr 2020 09:45:56 +0800 Subject: [PATCH 0395/1809] PUB @geekpi https://linux.cn/article-12132-1.html --- .../20200413 How to install Python on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200413 How to install Python on Linux.md (98%) diff --git a/translated/tech/20200413 How to install Python on Linux.md b/published/20200413 How to install Python on Linux.md similarity index 98% rename from translated/tech/20200413 How to install Python on Linux.md rename to published/20200413 How to install Python on Linux.md index eebb701a9c..7a152a5489 100644 --- a/translated/tech/20200413 How to install Python on Linux.md +++ b/published/20200413 How to install Python on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12132-1.html) [#]: subject: (How to install Python on Linux) [#]: via: (https://opensource.com/article/20/4/install-python-linux) [#]: author: (Vijay Singh Khatri https://opensource.com/users/vijaytechnicalauthor) From a72323745edc2feff272a1bf80e5979c37435368 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Apr 2020 22:28:03 +0800 Subject: [PATCH 0396/1809] PRF @messon007 --- ...ource cloud native projects to consider.md | 214 +++++++++--------- 1 file changed, 106 insertions(+), 108 deletions(-) diff --git a/translated/tech/20190814 9 open source cloud native projects to consider.md b/translated/tech/20190814 9 open source cloud native projects to consider.md index 9ccb1fc0ab..6832854007 100644 --- a/translated/tech/20190814 9 open source cloud native projects to consider.md +++ b/translated/tech/20190814 9 open source cloud native projects to consider.md @@ -1,208 +1,206 @@ [#]: collector: (lujun9972) [#]: translator: (messon007) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (9 open source cloud native projects to consider) [#]: via: (https://opensource.com/article/19/8/cloud-native-projects) [#]: author: (Bryant Son https://opensource.com/users/brsonhttps://opensource.com/users/marcobravo) -值得考虑的9个开源的云原生项目 +值得关注的 9 个开源云原生项目 ====== -工作中用了容器?熟悉这些出自云原生计算基金会的项目? -![clouds in the sky with blue pattern][1] +> 工作中用了容器?熟悉这些出自云原生计算基金会的项目吗? + +![](https://img.linux.net.cn/data/attachment/album/202004/21/222735oa1wib1wgypoiwpp.jpg) 随着用容器来开发应用的实践变得流行,[云原生应用][2]也在增长。云原生应用的定义为: -> "云原生技术被用于开发应用程序,这些应用通过将服务打包在容器中来完成构建,被部署为微服务,并通过敏捷的DevOps流程和持续集成工作流在弹性基础设施上管理。" -这个定义提到了构成云原生应用的4个元素: +> “云原生技术用于开发使用打包在容器中的服务所构建的应用程序,以微服务的形式部署,并通过敏捷的 DevOps 流程和持续交付工作流在弹性基础设施上进行管理。” + +这个定义提到了构成云原生应用的不可或缺的四个元素: 1. 容器 2. 微服务 3. DevOps 4. 持续集成和持续交付 (CI/CD) - -尽管这些技术各有各自独特的历史,但它们相互补充,共同导致了云原生应用和工具在短时间内惊人的指数级增长。这个[云原生计算基金会][4]信息图呈现了当今云原生应用生态的规模和广度。 +尽管这些技术各有各自独特的历史,但它们之间却相辅相成,在短时间内实现了云原生应用和工具的惊人的指数级增长。这个[云原生计算基金会(CNCF)][4]信息图呈现了当今云原生应用生态的规模和广度。 ![Cloud-Native Computing Foundation applications ecosystem][5] -云原生计算基金会项目 +*云原生计算基金会项目* -我想说,瞧着吧!这仅仅是一个开始。正如NodeJS的出现引发了无休止的JavaScript工具的爆炸式增长一样,容器技术的普及也推动了云原生应用的指数增长。 +我想说,瞧着吧!这仅仅是一个开始。正如 NodeJS 的出现引发了无数的 JavaScript 工具的爆炸式增长一样,容器技术的普及也推动了云原生应用的指数增长。 -好消息是,有几个组织负责监管这些技术并将它们融合在一起。 其中之一是[**Open Containers Initiative(OCI)**][6],它是一个轻量级的,开放的治理机构(或项目),“它是在Linux基金会的主持下形成的,其明确目的是创建开放的行业标准的容器格式和运行时。” 另一个是** CNCF **,“它是一个致力于使云原生计算具有通用性和可持续性的开源软件基金会”。 +好消息是,有几个组织负责监管并将这些技术连接在一起。 其中之一是 [开放容器倡议][6]Open Containers Initiative(OCI),它是一个轻量级的、开放的治理机构(或项目),“它是在 Linux 基金会的支持下形成的,其明确目的是创建开放的行业标准的容器格式和运行时。” 另一个是 CNCF,它是“一个致力于使云原生计算普及和可持续发展的开源软件基金会”。 + +通常除了围绕云原生应用建立社区之外,CNCF 还帮助项目围绕其云原生应用建立结构化管理。CNCF 创建了成熟等级的概念(沙箱级、孵化级或毕业级),分别与下图中的“创新者”、“早期采用者”和“早期大量应用”相对应。 -除了常见的围绕云原生应用建立社区之外,CNCF还帮助项目基于其云原生应用建立结构化的管理。CNCF创建了成熟等级的概念(沙箱级,孵化级或毕业级),分别与下图中的“创新者”,“早期采用者”和“早期大量应用”相对应。 ![CNCF project maturity levels][7] -CNCF项目成熟等级 +*CNCF 项目成熟等级* -CNCF为每个成熟等级制定了详细的[标准][8](为方便读者而列在下面)。 获得技术监督委员会(TOC)三分之二的同意才能转为孵化或毕业级。 +CNCF 为每个成熟等级制定了详细的[标准][8](为方便读者而列在下面)。获得技术监督委员会(TOC)三分之二的同意才能转为孵化或毕业级。 -### 沙箱级 +**沙箱级** -> 要想成为沙箱级,一个项目必须至少有两个TOC赞助商。 有关详细过程,请参见《 CNCF沙箱指南v1.0》。 +> 要想成为沙箱级,一个项目必须至少有两个 TOC 赞助商。 有关详细过程,请参见《CNCF 沙箱指南 v1.0》。 +**孵化级** -### 孵化级 - ->注意:孵化级是我们期望对项目进行全面尽职调查的起点。 +> 注:孵化级是我们期望对项目进行全面的尽职调查的起点。 > ->要进入孵化阶段,项目除了满足沙箱阶段的要求之外还要满足: +> 要进入孵化级,项目除了满足沙箱级的要求之外还要满足: > -> *证明至少有三个独立的最终用户已成功将其用于生产,且TOC判断这些最终用户具有足够的质量和范围。 -> *合入者的数量要合理。合入者定义为具有合入权的人。即可以接受对部分或全部项目贡献的人。 -> *演示有大量正在进行的提交和合并的贡献。 -> *由于这些指标可能会根据项目的类型,范围和大小而有很大差异,因此TOC对足以满足这些标准的活动级别拥有最终决策权 +> * 证明至少有三个独立的最终用户已成功将其用于生产,且 TOC 判断这些最终用户具有足够的质量和范围。 +> * 提交者的数量要合理。提交者定义为具有提交权的人,即可以接受部分或全部项目贡献的人。 +> * 显示出有大量持续提交和合并贡献。 +> * 由于这些指标可能会根据项目的类型、范围和大小而有很大差异,所以 TOC 有权决定是否满足这些标准的活动水平。 +**毕业级** - -### 毕业级 - ->要从沙箱或孵化级毕业,或者要使一个新项目作为已毕业项目加入,项目除了必须满足孵化级的标准外还要满足: +> 要从沙箱或孵化级毕业,或者要使一个新项目作为已毕业项目加入,项目除了必须满足孵化级的标准外还要满足: > -> *至少有两个组织的提交者。 -> *已获得并维护了“核心基础设施计划最佳实践徽章”。 -> *已完成独立和第三方安全审核,并发布了具有与以下示例类似的范围和质量的结果(包括已解决的关键漏洞):和所有关键毕业之前需要解决漏洞。 -> *采用CNCF行为准则。 -> *明确定义项目治理和提交流程。最好将其排布在GOVERNANCE.md文件中,并引用显示当前提交者和荣誉提交者的OWNERS.md文件。 -> *至少有主仓的项目采用者的公开列表(例如,ADOPTERS.md或项目网站上的徽标)。 -> *获得TOC的多数票,进入毕业阶段。如果项目能够证明足够的成熟度,则可以尝试直接从沙箱过渡到毕业。项目可以无限期保持孵化状态,但是通常预计它们会在两年内毕业。 +> * 至少有两个来自组织的提交者。 +> * 已获得并保持了“核心基础设施计划最佳实践徽章”。 +> * 已完成独立的第三方安全审核,并发布了具有与以下示例类似的范围和质量的结果(包括已解决的关键漏洞):,并在毕业之前需要解决所有关键的漏洞。 +> * 采用《CNCF 行为准则》。 +> * 明确规定项目治理和提交流程。最好将其列在 `GOVERNANCE.md` 文件中,并引用显示当前提交者和荣誉提交者的 `OWNERS.md` 文件。 +> * 至少有一个主仓的项目采用者的公开列表(例如,`ADOPTERS.md` 或项目网站上的徽标)。 +> * 获得 TOC 的绝大多数票,进入毕业阶段。如果项目能够表现出足够的成熟度,则可以尝试直接从沙箱级过渡到毕业级。项目可以无限期保持孵化状态,但是通常预计它们会在两年内毕业。 -## 值得考虑的9个项目 +### 值得关注的 9 个项目 -本文不可能涵盖所有的CNCF项目,我将介绍最有趣的9个“已毕业和孵化中”的开源项目。 +本文不可能涵盖所有的 CNCF 项目,我将介绍最有趣的 9 个毕业和孵化的开源项目。 名称|授权类型|简要描述 ---|---|--- [Kubernetes][9] | Apache 2.0 | 容器编排平台 [Prometheus][10] | Apache 2.0 | 系统和服务监控工具 [Envoy][11] | Apache 2.0 | 边缘和服务代理 -[rkt][12] | Apache 2.0 | Pod原生的容器引擎 +[rkt][12] | Apache 2.0 | Pod 原生的容器引擎 [Jaeger][13] | Apache 2.0 | 分布式跟踪系统 -[Linkerd][14] | Apache 2.0 | 无感服务网格 -[Helm][15] | Apache 2.0 | Kubernetes包管理器 +[Linkerd][14] | Apache 2.0 | 透明服务网格 +[Helm][15] | Apache 2.0 | Kubernetes 包管理器 [Etcd][16] | Apache 2.0 | 分布式键值存储 -[CRI-O][17] | Apache 2.0 | 专门用于Kubernetes的轻量级运行时环境 +[CRI-O][17] | Apache 2.0 | 专门用于 Kubernetes 的轻量级运行时环境 我也创建了视频材料来介绍这些项目。 -## 毕业项目 +- [video](https://youtu.be/3cDxYO2GK4w) -已毕业的项目被认为是成熟的,已被许多组织采用的,并且严格遵守了CNCF的准则。 以下是三个最受欢迎的开源CNCF毕业项目。 (请注意,其中一些描述来源于项目的网站并被做了改编。) +### 毕业项目 -### Kubernetes +毕业的项目被认为是成熟的,已被许多组织采用的,并且严格遵守了 CNCF 的准则。以下是三个最受欢迎的开源 CNCF 毕业项目。(请注意,其中一些描述来源于项目的网站并被做了改编。) -Kubernetes! 我们如何在不提及Kubernetes的情况下谈论云原生应用程序? Google发明的Kubernetes无疑是最著名的基于容器的应用程序的容器编排平台,而且它还是一个开源工具。 +#### Kubernetes(希腊语“舵手”) -什么是容器编排平台? 通常,一个容器引擎本身可以管理几个容器。 但是,当您谈论数千个容器和数百个服务时,管理这些容器变得非常复杂。 这就是容器编排引擎的用武之地。容器编排引擎通过自动化容器的部署,管理,网络和可用性来帮助管理大量的容器。 +Kubernetes! 说起云原生应用,怎么能不提 Kubernetes 呢? Google 发明的 Kubernetes 无疑是最著名的基于容器的应用程序的容器编排平台,而且它还是一个开源工具。 -Docker Swarm和Mesosphere Marathon也是容器编排引擎,但是可以肯定地说Kubernetes在竞争中胜出(至少现在是这样)。Kubernetes还诞生了容器即服务(CaaS)平台如[OKD][18],它是Origin社区针对Kubernetes的发行版,并成了[Red Hat OpenShift][19]的一部分。 +什么是容器编排平台?通常,一个容器引擎本身可以管理几个容器。但是,当你谈论数千个容器和数百个服务时,管理这些容器变得非常复杂。这就是容器编排引擎的用武之地。容器编排引擎通过自动化容器的部署、管理、网络和可用性来帮助管理大量的容器。 -想开始学习请访问[Kubernetes GitHub仓库][9],并从[Kubernetes文档][20]页面访问其文档和学习资源。 +Docker Swarm 和 Mesosphere Marathon 也是容器编排引擎,但是可以肯定地说,Kubernetes 已经赢得了这场比赛(至少现在是这样)。Kubernetes 还催生了像 [OKD][18] 这样的容器即服务(CaaS)平台,它是 Kubernetes 的 Origin 社区发行版,并成了 [Red Hat OpenShift][19] 的一部分。 -### Prometheus +想开始学习,请访问 [Kubernetes GitHub 仓库][9],并从 [Kubernetes 文档][20]页面访问其文档和学习资源。 -Prometheus是2012年在SoundCloud上构建的一个开源系统监控和告警工具。之后,许多公司和组织都使用了Prometheus,并且该项目拥有非常活跃的开发者和用户群体。 现在,它是一个独立于公司的独立维护的开源项目。 +#### Prometheus(普罗米修斯) + +Prometheus 是 2012 年在 SoundCloud 上构建的一个开源的系统监控和告警工具。之后,许多公司和组织都采用了 Prometheus,并且该项目拥有非常活跃的开发者和用户群体。现在,它已经成为一个独立的开源项目,独立于公司之外进行维护。 ![Prometheus’ architecture][21] -Prometheus的架构 +*Prometheus 的架构* -理解Prometheus的最简单方法是可视化一个生产系统,该系统需要24(小时)x365天都可以正常运行。 没有哪个系统是完美的,也有减少故障的技术(称为容错系统)。 但是,如果出现问题,最重要的是尽快识别它。 这就是像Prometheus这样的监控工具的用武之地。Prometheus不仅是容器监控工具,它在云原生应用公司中也最受欢迎。 此外,其他开源监视工具,包括[Grafana][22],都借鉴了Prometheus。 +理解 Prometheus 的最简单方法是可视化一个生产系统,该系统需要 24(小时)x 365(天)都可以正常运行。没有哪个系统是完美的,也有减少故障的技术(称为容错系统),但是,如果出现问题,最重要的是尽快发现问题。这就是像 Prometheus 这样的监控工具的用武之地。Prometheus 不仅仅是一个容器监控工具,但它在云原生应用公司中最受欢迎。此外,其他开源监视工具,包括 [Grafana][22],都借助了 Prometheus。 -开始使用Prometheus的最佳方法是下载其[GitHub仓库][10]。 在本地运行Prometheus很容易,但是您需要安装一个容器引擎。 您可以在[Prometheus网站][23]上查看详细的文档。 +开始使用 Prometheus 的最佳方法是下载其 [GitHub 仓库][10]。在本地运行 Prometheus 很容易,但是你需要安装一个容器引擎。你可以在 [Prometheus 网站][23]上查看详细的文档。 -### Envoy +### Envoy(使者) -Envoy(或Envoy代理)是专为云原生应用设计的开源的边缘代理和服务代理。 由Lyft创建的Envoy是为单一服务和应用而设计的高性能的C++分布式代理,同时也是为由大量微服务组成的服务网格架构而设计的通信总线和通用数据平面。 基于对Nginx,HAProxy,硬件负载均衡器和云负载均衡器等方案了解的基础上,Envoy与每个应用相伴(并行)运行,并对网络进行了高度抽象,最终以平台无关的方式来提供通用功能。 +Envoy(或 Envoy 代理)是专为云原生应用设计的开源的边缘代理和服务代理。由 Lyft 创建的 Envoy 是为单一服务和应用而设计的高性能的 C++ 开发的分布式代理,同时也是为由大量微服务组成的服务网格架构而设计的通信总线和通用数据平面。Envoy 建立在 Nginx、HAProxy、硬件负载均衡器和云负载均衡器等解决方案的基础上,Envoy 与每个应用相伴(并行)运行,并通过提供平台无关的方式提供通用特性来抽象网络。 -当基础设施中的所有服务流量都经过一个Envoy网格时,很容易就可以通过连贯的监测来可视化问题域,调整整体性能,并在单个位置添加基础功能。基本上,Envoy代理是一个可帮助组织为生产环境构建容错系统的服务网格工具。 +当基础设施中的所有服务流量都经过 Envoy 网格时,很容易就可以通过一致的可观测性来可视化问题域,调整整体性能,并在单个位置添加基础功能。基本上,Envoy 代理是一个可帮助组织为生产环境构建容错系统的服务网格工具。 -服务网格应用有很多替代方案,例如Uber的[Linkerd][24](下面会讨论)和[Istio][25]。 Istio通过将其部署为[Sidecar][26]并利用了[Mixer][27]的配置模型,实现了对Envoy的扩展。 Envoy的显著特性有: +服务网格应用有很多替代方案,例如 Uber 的 [Linkerd][24](下面会讨论)和 [Istio][25]。Istio 通过将其部署为 [Sidecar][26] 并利用了 [Mixer][27] 的配置模型,实现了对 Envoy 的扩展。Envoy 的显著特性有: - *所有的“table stakes(入场筹码,引申为基础必备特性)”特性(与控制平面(例如Istio)组合时) - *带载运行时99%数据可达到低延时 - *将L3/L4过滤器作为核心,支持额外的L7过滤器 - *支持gRPC和HTTP / 2(上行/下行) -   *由API驱动,并支持动态配置和热重载 - *重点关注指标收集,跟踪和整体可监测性 +* 包括所有的“入场筹码table stakes(LCTT 译注:引申为基础必备特性)”特性(与 Istio 这样的控制平面组合时) +* 带载运行时 99% 数据可达到低延时 +* 可以作为核心的 L3/L4 过滤器,提供了开箱即用的 L7 过滤器 +* 支持 gRPC 和 HTTP/2(上行/下行) +* 由 API 驱动,并支持动态配置和热重载 +* 重点关注指标收集、跟踪和整体可监测性 +要想了解 Envoy,证实其能力并实现其全部优势,需要丰富的生产级环境运行的经验。你可以在其[详细文档][28]或访问其 [GitHub][11] 仓库了解更多信息。 -要想了解Envoy,证实其能力并意识到其全部优势,需要丰富的在生产级环境运行的经验。 您可以在[详细文档][28]或访问其[GitHub][11]仓库了解更多信息。 +### 孵化项目 -## 孵化项目 +下面是六个最流行的开源的 CNCF 孵化项目。 -下面是最流行的开源的CNCF孵化项目中的六个。 +#### rkt(火箭) -### rkt +rkt, 读作“rocket”,是一个 Pod 原生的容器引擎。它有一个命令行接口用来在 Linux 上运行容器。从某种意义上讲,它和其他容器如 [Podman][29]、Docker 和 CRI-O 相似。 -rkt, 拼为"rocket", 是一个pod原生的容器引擎。它有一个命令行接口用来在Linux上运行容器。从某种意义上讲,它和其他容器如[Podman][29], Docker和CRI-O相似。 +rkt 最初是由 CoreOS (后来被 Red Hat 收购)开发的,你可以在其网站上找到详细的[文档][30],以及在 [GitHub][12] 上访问其源代码。 -rkt最初由CoreOS开发(后来被Red Hat收购),您可以在其网站上找到详细的[文档][30],以及在[GitHub][12]上访问其源代码。 +#### Jaeger(贼鸥) -### Jaeger +Jaeger 是一个开源的端到端的分布式追踪系统,适用于云端应用。在某种程度上,它是像 Prometheus 这样的监控解决方案。但它有所不同,因为其使用场景有所扩展: -Jaeger是面向云原生应用的开源的端到端的分布式跟踪系统。 在某种程度上,它是像Prometheus这样的监控解决方案。但它有所不同,因为其使用场景有所扩展: +* 分布式事务监控 +* 性能和延时优化 +* 根因分析 +* 服务依赖性分析 +* 分布式上下文传播 - * 分布式事务监控 - * 性能和延时优化 - * 根因分析 - * 服务的依赖分析 - * 分布式上下文传播 +Jaeger 是一项 Uber 打造的开源技术。你可以在其网站上找到[详细文档][31],以及在 [GitHub][13] 上找到其源码。 +#### Linkerd +像创建 Envoy 代理的 Lyft 一样,Uber 开发了 Linkerd 开源解决方案用于生产级的服务维护。在某些方面,Linkerd 就像 Envoy 一样,因为两者都是服务网格工具,旨在提供平台级的可观测性、可靠性和安全性,而无需进行配置或代码更改。 -Jaeger是Uber建立的开源的技术。 您可以在其网站上找到[详细文档][31],以及在GitHub上找到其[源码][13]。 +但是,两者之间存在一些细微的差异。 尽管 Envoy 和 Linkerd 充当代理并可以通过所连接的服务进行上报,但是 Envoy 并不像 Linkerd 那样被设计为 Kubernetes Ingress 控制器。Linkerd 的显著特点包括: -### Linkerd +* 支持多种平台(Docker、Kubernetes、DC/OS、Amazon ECS 或任何独立的机器) +* 内置服务发现抽象,可以将多个系统联合在一起 +* 支持 gRPC、HTTP/2 和 HTTP/1.x请 求和所有的 TCP 流量 -像创建Envoy代理的Lyft一样,Uber开发了Linkerd开源解决方案用于生产级的服务维护。在某些方面,Linkerd就像Envoy一样,因为两者都是服务网格工具,旨在提供平台级的可观测性,可靠性和安全性,而无需进行配置或代码更改。 +你可以在 [Linkerd 网站][32]上阅读有关它的更多信息,并在 [GitHub][14] 上访问其源码。 -但是,两者之间存在一些细微的差异。 尽管Envoy和Linkerd充当代理并可以通过所连接的服务进行上报,但是Envoy并不像Linkerd那样被设计为Kubernetes Ingress控制器。 Linkerd的显著功能包括: +#### Helm(舵轮) - *支持多种平台(Docker,Kubernetes,DC / OS,Amazon ECS或单机) - *内置服务发现抽象将多个系统集成在一起 - *支持gRPC,HTTP / 2和HTTP / 1.x请求和所有的TCP流量 +Helm 基本上就是 Kubernetes 的包管理器。如果你使用过 Apache Maven、Maven Nexus 或类似的服务,你就会理解 Helm 的作用。Helm 可帮助你管理 Kubernetes 应用程序。它使用“Helm Chart”来定义、安装和升级最复杂的 Kubernetes 应用程序。Helm 并不是实现此功能的唯一方法;另一个流行的概念是 [Kubernetes Operators][33],它被 Red Hat OpenShift 4 所使用。 +你可以按照其文档中的[快速开始指南][34]或 [GitHub 指南][15]来试用 Helm。 -您可以在[Linkerd网站][32]上阅读有关它的更多信息,并在[GitHub][14]上访问其源码。 +#### Etcd -### Helm +Etcd 是一个分布式的、可靠的键值存储,用于存储分布式系统中最关键的数据。其主要特性有: -Helm基本上是Kubernetes的软件包管理器。 如果您使用过Apache Maven,Maven Nexus或类似的服务,您就会理解Helm的作用。 Helm可帮助您管理Kubernetes应用程序。 它使用“Helm图”来定义,安装和升级最复杂的Kubernetes应用程序。 Helm并不是实现此功能的唯一方法; 另一个流行的概念是[Kubernetes Operators][33],它被Red Hat OpenShift 4所使用。 +* 定义明确的、面向用户的 API(gRPC) +* 自动 TLS,可选的客户端证书验证 +* 速度(可达每秒 10,000 次写入) +* 可靠性(使用 Raft 实现分布式) -您可以按照其文档中的[快速开始指南][34]或[GitHub指南][15]来试用Helm。 +Etcd 是 Kubernetes 和许多其他技术的默认的内置数据存储方案。也就是说,它很少独立运行或作为单独的服务运行;相反,它以集成到 Kubernetes、OKD/OpenShift 或其他服务中的形式来运作。还有一个 [etcd Operator][35] 可以用来管理其生命周期并解锁其 API 管理功能: -### Etcd +你可以在 [etcd 文档][36]中了解更多信息,并在 [GitHub][16]上访问其源码。 -Etcd是用于分布式系统中最关键数据的分布式的,可靠的键值存储。 其主要特性有: +#### CRI-O - *定义明确的,面向用户的API(gRPC) - *客户端证书验证可选的自动TLS - *速度(可达每秒10,000次写入) - *可靠性(使用Raft实现分布式) +CRI-O 是 Kubernetes 运行时接口的 OCI 兼容实现。CRI-O 用于各种功能,包括: -Etcd是Kubernetes和许多其他技术的默认的内置数据存储方案。也就是说,它很少独立运行或作为单独的服务运行; 相反,它利用了集成到Kubernetes,OKD / OpenShift或其他服务中的一个。 还有[etcd Operator][35]来管理其生命周期并解锁其API管理功能: +* 使用 runc(或遵从 OCI 运行时规范的任何实现)和 OCI 运行时工具运行 +* 使用容器/镜像进行镜像管理 +* 使用容器/存储来存储和管理镜像层 +* 通过容器网络接口(CNI)来提供网络支持 -您可以在[etcd文档][36]中了解更多信息,并在GitHub上访问其[源码][16]。 - -### CRI-O - -CRI-O是Kubernetes运行时接口的OCI兼容实现。CRI-O用于各种功能,包括: - - *使用runc(或遵从OCI运行时规范的任何实现)和OCI运行时工具运行 - *使用容器/镜像进行镜像管理 - *使用容器/存储来存储和管理镜像层 - *通过容器网络接口(CNI)来提供网络支持 - -CRI-O提供了大量的[文档][37],包括指南,教程,文章,甚至播客,您还可以访问其[GitHub页面][17]。 +CRI-O 提供了大量的[文档][37],包括指南、教程、文章,甚至播客,你还可以访问其 [GitHub 页面][17]。 * * * -我错过了其他有趣且开源的云原生项目吗? 请在评论中提醒我。 +我错过了其他有趣且开源的云原生项目吗?请在评论中提醒我。 + -------------------------------------------------------------------------------- via: https://opensource.com/article/19/8/cloud-native-projects @@ -210,7 +208,7 @@ via: https://opensource.com/article/19/8/cloud-native-projects 作者:[Bryant Son][a] 选题:[lujun9972][b] 译者:[messon007](https://github.com/messon007) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 024afe741ecff53cf874923b75d68d5293d3a9ef Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Apr 2020 22:31:44 +0800 Subject: [PATCH 0397/1809] PUB @messon007 https://linux.cn/article-12135-1.html --- ...814 9 open source cloud native projects to consider.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) rename {translated/tech => published}/20190814 9 open source cloud native projects to consider.md (99%) diff --git a/translated/tech/20190814 9 open source cloud native projects to consider.md b/published/20190814 9 open source cloud native projects to consider.md similarity index 99% rename from translated/tech/20190814 9 open source cloud native projects to consider.md rename to published/20190814 9 open source cloud native projects to consider.md index 6832854007..0c2ffabd03 100644 --- a/translated/tech/20190814 9 open source cloud native projects to consider.md +++ b/published/20190814 9 open source cloud native projects to consider.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (messon007) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12135-1.html) [#]: subject: (9 open source cloud native projects to consider) [#]: via: (https://opensource.com/article/19/8/cloud-native-projects) [#]: author: (Bryant Son https://opensource.com/users/brsonhttps://opensource.com/users/marcobravo) @@ -116,7 +116,7 @@ Prometheus 是 2012 年在 SoundCloud 上构建的一个开源的系统监控和 开始使用 Prometheus 的最佳方法是下载其 [GitHub 仓库][10]。在本地运行 Prometheus 很容易,但是你需要安装一个容器引擎。你可以在 [Prometheus 网站][23]上查看详细的文档。 -### Envoy(使者) +#### Envoy(使者) Envoy(或 Envoy 代理)是专为云原生应用设计的开源的边缘代理和服务代理。由 Lyft 创建的 Envoy 是为单一服务和应用而设计的高性能的 C++ 开发的分布式代理,同时也是为由大量微服务组成的服务网格架构而设计的通信总线和通用数据平面。Envoy 建立在 Nginx、HAProxy、硬件负载均衡器和云负载均衡器等解决方案的基础上,Envoy 与每个应用相伴(并行)运行,并通过提供平台无关的方式提供通用特性来抽象网络。 @@ -197,8 +197,6 @@ CRI-O 是 Kubernetes 运行时接口的 OCI 兼容实现。CRI-O 用于各种功 CRI-O 提供了大量的[文档][37],包括指南、教程、文章,甚至播客,你还可以访问其 [GitHub 页面][17]。 -* * * - 我错过了其他有趣且开源的云原生项目吗?请在评论中提醒我。 -------------------------------------------------------------------------------- From 0c36d0e031235fae564f22d21c5f3ec0f5d08437 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Apr 2020 23:24:30 +0800 Subject: [PATCH 0398/1809] PRF @geekpi --- ...or creating Raspberry Pi SD card images.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/translated/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md b/translated/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md index c70870d6e0..70285bfa91 100644 --- a/translated/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md +++ b/translated/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (A handy utility for creating Raspberry Pi SD card images) @@ -9,10 +9,12 @@ 一个方便的用于创建树莓派 SD 卡镜像的程序 ====== -开始在 Mac 上使用 Raspberry Pi Imager + +> 开始在 Mac 上使用 Raspberry Pi Imager。 + ![Raspberries with pi symbol overlay][1] -有多种购买树莓派的方法,同时树莓派会取决于你从哪里购买的从而可能附带或不附带操作系统。将操作系统安装到树莓派上就是用系统镜像“刷新” SD 卡。为了使之尽可能简单,[树莓派基金会][2]引入了 Raspberry Pi Imager,你可以将其下载到所有主流平台。以下这个有用的新工具介绍。 +有多种购买树莓派的方法,根据你的购买渠道的不同,可能附带或不附带操作系统。要在树莓派上安装操作系统,只需将操作系统镜像 “闪存” 到 SD 卡即可。为了使之尽可能简单,[树莓派基金会][2]推出一个 Raspberry Pi Imager 实用程序,你可以在所有主流平台上下载它。下面就来简单介绍一下这个有用的新工具。 ### 安装 Imager @@ -22,7 +24,7 @@ Mac 的安装包是常规的 DMG 镜像,它会挂载到你的桌面,然后 ![Raspberry Pi Imager installer][4] -只需将可爱的树莓图标拖到 Application 文件夹,就可以完成。从 Launchpad 中调用它,你会看到一系列简单的按钮和菜单供你选择。真的不能比这更简单了: +只需将可爱的树莓图标拖到“应用”文件夹,就可以完成。从启动台中调用它,你会看到一系列简单的按钮和菜单供你选择。真的不能比这更简单了: ![Raspberry Pi Imager home screen][5] @@ -32,13 +34,13 @@ Mac 的安装包是常规的 DMG 镜像,它会挂载到你的桌面,然后 ### 安装一些镜像 -我决定使用 16g 的 micro SD 卡。我选择了默认的 Raspbian 镜像,选择已连接的 USB/SD 设备,然后按下 WRITE。这是一个简短的演示: +我决定使用 16g 的 micro SD 卡。我选择了默认的 Raspbian 镜像,选择已连接的 USB/SD 设备,然后按下 “WRITE” 按钮。这是一个简短的演示: ![Raspberry Pi Imager demo][6] -我没有在此处发布完整信息。我相信它在下载镜像后写入,对于我的无线连接这花费了几分钟完成。该过程在完成之前先经过写入,然后经过验证周期。完成后,我弹出设备,并将卡插入到我的 RPi 3 中,然后按照通常的图形 Raspbian 安装向导和桌面环境进行设置。 +我没有在此处发布整个操作过程。我认为它是在写入的时候下载了镜像,对于我的无线连接这花费了几分钟。该过程在完成之前要先经过写入,然后经过验证环节。完成后,我弹出设备,并将卡插入到我的树莓派 3 中,然后按照通常的图形 Raspbian 安装向导和桌面环境进行设置。 -这对我来说还不够。我每天都会下载许多 Linux,今天我还在寻找更多。我回到了[树莓派下载][3]页面,并下载了 RISC OS 镜像。这个过程几乎一样容易。下载 RISCOSPi.5.24.zip 文件,将其解压缩,然后找到 ro524-1875M.img 文件。在 “Operating System” 按钮中,我选择了 “Use Custom” 并选择了所需的镜像文件。这个过程几乎是相同的。唯一真正的区别是我必须在下载目录中搜寻并选择一个镜像。文件写完后,回到树莓派 3,RISC OS 可以使用了。 +这对我来说还不够。我每天都会下载许多 Linux,今天我还在寻找更多。我回到了[树莓派下载][3]页面,并下载了 RISC OS 镜像。这个过程几乎一样容易。下载 RISCOSPi.5.24.zip 文件,将其解压缩,然后找到 ro524-1875M.img 文件。在 “Operating System” 按钮中,我选择了 “Use Custom” 并选择了所需的镜像文件。这个过程几乎是相同的。唯一真正的不同是我必须在下载目录中搜寻并选择一个镜像。文件写完后,回到树莓派 3,RISC OS 可以使用了。 ### 对 USB C 的抱怨 @@ -46,11 +48,11 @@ Mac 的安装包是常规的 DMG 镜像,它会挂载到你的桌面,然后 ![USB C adapter][7] -是的,那是一个 USB C 到 USB A 适配器,然后是一个 USB 到 SD 卡读卡器,以及一个 SD 到 micro SD 适配器。我可能可以在网上找到一些东西来简化此过程,但这是支持我家五花八门的 Mac、Windows 和 Linux 主机的部分。够了,但我希望你能从这种混乱中得到一笑。 +是的,那是一个 USB C 到 USB A 适配器,然后是一个 USB 到 SD 卡读卡器,以及一个 SD 到 micro SD 适配器。我可能可以在网上找到一些东西来简化此过程,但这些都是我手头有的部件,以支持我家五花八门的 Mac、Windows 和 Linux 主机。说到这里就不多说了,但我希望你能从这些疯狂的东西中得到一个笑点。 ### 总结 -新的 Raspberry Pi Imager 是一种简单有效的工具来快速烧录树莓派镜像。[BalenaEtcher][8] 是用于对可移动设备进行烧录的类似工具,但是新的 Raspberry Pi Imager 通过消除获取那些常见镜像的步骤,使普通树莓派系统安装(如 Raspbian)更加容易。 +新的 Raspberry Pi Imager 是一种简单有效的工具,可以快速烧录树莓派镜像。[BalenaEtcher][8] 是用于对可移动设备进行烧录的类似工具,但是新的 Raspberry Pi Imager 通过省去了获取那些常见镜像的步骤,使普通树莓派系统安装(如 Raspbian)更加容易。 -------------------------------------------------------------------------------- @@ -59,7 +61,7 @@ via: https://opensource.com/article/20/4/raspberry-pi-imager-mac 作者:[James Farrell][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 76a90602890d470e26805fe4eaf24e2bd32be653 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Apr 2020 23:32:24 +0800 Subject: [PATCH 0399/1809] PUB @geekpi https://linux.cn/article-12136-1.html --- ... handy utility for creating Raspberry Pi SD card images.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200413 A handy utility for creating Raspberry Pi SD card images.md (98%) diff --git a/translated/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md b/published/20200413 A handy utility for creating Raspberry Pi SD card images.md similarity index 98% rename from translated/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md rename to published/20200413 A handy utility for creating Raspberry Pi SD card images.md index 70285bfa91..9fd472c01d 100644 --- a/translated/tech/20200413 A handy utility for creating Raspberry Pi SD card images.md +++ b/published/20200413 A handy utility for creating Raspberry Pi SD card images.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12136-1.html) [#]: subject: (A handy utility for creating Raspberry Pi SD card images) [#]: via: (https://opensource.com/article/20/4/raspberry-pi-imager-mac) [#]: author: (James Farrell https://opensource.com/users/jamesf) From af5bcac0b200667e223b853f0cbd67a200d6f755 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Apr 2020 00:53:54 +0800 Subject: [PATCH 0400/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200422=20How?= =?UTF-8?q?=20to=20Check=20the=20Available=20Network=20Interfaces,=20Assoc?= =?UTF-8?q?iated=20IP=20Addresses,=20MAC=20Addresses,=20and=20Interface=20?= =?UTF-8?q?Speed=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md --- ...Addresses, and Interface Speed on Linux.md | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 sources/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md diff --git a/sources/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md b/sources/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md new file mode 100644 index 0000000000..ca7e8fe2aa --- /dev/null +++ b/sources/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md @@ -0,0 +1,202 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux) +[#]: via: (https://www.2daygeek.com/linux-unix-check-network-interfaces-names-nic-speed-ip-mac-address/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux +====== + +By default when you set up the server you will configure the primary network interface. + +This is part of the build work that everyone does. + +Sometimes you may need to configure an additional network interface for several reasons. + +This could be a network bonding/teaming or high availability or a separate interface for application requirements or backups. + +To do so, you need to know how many interfaces your computer has and their speed to configure it. + +There are many commands to check for available network interfaces, but we only use the IP command. + +Later we will write a separate article with all these tools. + +In this tutorial, we will show you the Available Network Interface Card (NIC) information, such as the interface name, associated IP address, MAC address, and interface speed. + +### What’s IP Command + +**[IP command][1]** is similar to ifconfig, which is used to for assigning Static IP Address, Route & Default Gateway, etc., + +``` +# ip a + +1: lo: mtu 65536 qdisc noqueue state UNKNOWN + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever +2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 + link/ether fa:16:3e:a0:7d:5a brd ff:ff:ff:ff:ff:ff + inet 192.168.1.101/24 brd 192.168.1.101 scope global eth0 + inet6 fe80::f816:3eff:fea0:7d5a/64 scope link + valid_lft forever preferred_lft forever +``` + +### What’s ethtool Command + +The ethtool is used to query or control network driver and hardware settings. + +``` +# ethtool eth0 +``` + +### 1) How to Check the Available Network Interfaces on Linux Using the IP Command + +When you run the IP command without any arguments, it gives you plenty of information, but if you only need the available network interfaces, use the following customized IP command. + +``` +# ip a |awk '/state UP/{print $2}' + +eth0: +eth1: +``` + +### 2) How to Check the IP Address of a Network Interface on Linux Using the IP Command + +If you only want to see which IP address is assigned to which interface, use the following customized IP command. + +``` +# ip -o a show | cut -d ' ' -f 2,7 +or +ip a |grep -i inet | awk '{print $7, $2}' + +lo 127.0.0.1/8 +192.168.1.101/24 +192.168.1.102/24 +``` + +### 3) How to Check the Network Interface Card MAC Address on Linux Using the IP Command + +If you only want to see the network interface name and the corresponding MAC address, use the following format. + +To check a specific network interface MAC address. + +``` +# ip link show dev eth0 |awk '/link/{print $2}' +00:00:00:55:43:5c +``` + +To check MAC address for all network interface. + +``` +# vi /opt/scripts/mac-addresses.sh + +#!/bin/sh +ip a |awk '/state UP/{print $2}' | sed 's/://' | while read output; +do +echo $output: +ethtool -P $output +done +``` + +Run the below shell script to get the MAC address for multiple network interfaces. + +``` +# sh /opt/scripts/mac-addresses.sh + +eth0: +Permanent address: 00:00:00:55:43:5c +eth1: +Permanent address: 00:00:00:55:43:5d +``` + +### 4) How to Check the Network Interface Port Speed on Linux Using the ethtool Command + +If you want to check the network interface port speed on Linux, use the ethtool command. + +To check the speed of a particular network interface port. + +``` +# ethtool eth0 |grep "Speed:" + +Speed: 10000Mb/s +``` + +To check the port speed for all network interfaces. + +``` +# vi /opt/scripts/port-speed.sh + +#!/bin/sh +ip a |awk '/state UP/{print $2}' | sed 's/://' | while read output; +do +echo $output: +ethtool $output |grep "Speed:" +done +``` + +Run the below shell script to get the port speed for multiple network interfaces. + +``` +# sh /opt/scripts/port-speed.sh + +eth0: +Speed: 10000Mb/s +eth1: +Speed: 10000Mb/s +``` + +### 5) Shell Script to Verify Network Interface Card Information + +This **[shell script][2]** allows you to gather all of the above information, such as network interface names, IP addresses of network interfaces, MAC addresses of network interfaces, and the speed of a network interface port. + +``` +# vi /opt/scripts/nic-info.sh + +#!/bin/sh +hostname +echo "-------------" +for iname in $(ip a |awk '/state UP/{print $2}') +do +echo "$iname" +ip a | grep -A2 $iname | awk '/inet/{print $2}' +ip a | grep -A2 $iname | awk '/link/{print $2}' +ethtool $iname |grep "Speed:" +done +``` + +Run the below shell script to check network card information. + +``` +# sh /opt/scripts/nic-info.sh + +vps.2daygeek.com +---------------- +eth0: +192.168.1.101/24 +00:00:00:55:43:5c +Speed: 10000Mb/s +eth1: +192.168.1.102/24 +00:00:00:55:43:5d +Speed: 10000Mb/s +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-unix-check-network-interfaces-names-nic-speed-ip-mac-address/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/ip-command-configure-network-interface-usage-linux/ +[2]: https://www.2daygeek.com/category/shell-script/ From 3f7f92f8752007ee6802f40fee6ff44f2b4c70c9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Apr 2020 01:00:34 +0800 Subject: [PATCH 0401/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200422=20Thin?= =?UTF-8?q?gs=20You=20Should=20Know=20About=20Ubuntu=2020.04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200422 Things You Should Know About Ubuntu 20.04.md --- ...ings You Should Know About Ubuntu 20.04.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20200422 Things You Should Know About Ubuntu 20.04.md diff --git a/sources/tech/20200422 Things You Should Know About Ubuntu 20.04.md b/sources/tech/20200422 Things You Should Know About Ubuntu 20.04.md new file mode 100644 index 0000000000..48ac52bece --- /dev/null +++ b/sources/tech/20200422 Things You Should Know About Ubuntu 20.04.md @@ -0,0 +1,129 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Things You Should Know About Ubuntu 20.04) +[#]: via: (https://itsfoss.com/ubuntu-20-04-faq/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Things You Should Know About Ubuntu 20.04 +====== + +[Ubuntu 20.04 release][1] is just around the corner and you may have a few questions and doubts regarding upgrades, installation etc. + +I hosted some Q&A sessions on various social media channels to answer doubts of readers like you. + +I am going to list these common questions about Ubuntu 20.04 with their answers. I hope it helps you clear the doubts you have. And if you still have questions, feel free to ask in the comment section below. + +### Ubuntu 20.04: Your Questions Answered + +![][2] + +Just to clarify, some of the answers here maybe influenced by my personal opinion. If you are an experienced Ubuntu user, some of the questions may sound _silly_ to you but it not to the new Ubuntu users. + +#### When will Ubuntu 20.04 be released? + +Ubuntu 20.04 LTS is releasing on 23rd April 2020. All the participating flavors like Kubuntu, Lubuntu, Xubuntu, Budgie, MATE etc will have their 20.04 release available on the same day. + +#### What are the system requirements for Ubuntu 20.04? + +For the default GNOME version, you should have a minimum 4 GB of RAM, 2 GHz dual core processor and at least 25 GB of disk space. + +Other [Ubuntu flavors][3] may have different system requirements. + +#### Can I use Ubuntu 20.04 on 32-bit systems? + +No, not at all. You cannot use Ubuntu 20.04 on 32-bit systems. Even if you are using 32-bit Ubuntu 18.04, you cannot upgrade to Ubuntu 20.04. There is ISO for 32-bit systems for past several years. + +![Error while upgrading 32-bit Ubuntu 18.04 to Ubuntu 20.04][4] + +#### Can I use Wine on Ubuntu 20.04? + +Yes, you can still use Wine on Ubuntu 20.04 as the 32-bit lib support is still there for packages needed by Wine and [Steam Play][5]. + +#### Do I have to pay for Ubuntu 20.04 or purchase a license? + +No, Ubuntu is completely free to use. You don’t have to buy a license key or activate Ubuntu like you do in Windows. + +The download section of Ubuntu requests you to donate some money but it’s up to you if you want to give some money for developing this awesome operating system. + +#### What GNOME version does it have? + +Ubuntu 20.04 has GNOME 3.36. + +#### Does Ubuntu 20.04 have better performance than Ubuntu 18.04? + +Yes, in several aspects. Ubuntu 20.04 installs faster and it even boost faster. I have shown the performance comparison in the video below at 4:40 minutes. + +The scroll, Windows animation and other UI elements are more fluid and give a smoother experience in GNOME 3.36. + +#### How long will Ubuntu 20.04 be supported? + +It is a long-term support (LTS) release and like any LTS release, it will be supported for five years. Which means that Ubuntu 20.04 will get security and maintenance updates until April 2025. + +#### Will I lose data while upgrading to Ubuntu 20.04? + +You can upgrade to Ubuntu 20.04 from Ubuntu 19.10 or Ubuntu 18.04. You don’t need to create a live USB and install from it. All you need is a good internet connection that can download around 1.5 GB of data. + +Upgrading from an existing system doesn’t harm your files. You should have all your files as it is and most of your existing software should be either have the same version or upgraded versions. + +If you have used some third-party tools or [additional PPA][6], the upgrade procedure will disable them. You can enable these additional repositories again if they are available for Ubuntu 20.04. + +Upgrading takes like an hour and after a restart, you will be logged in to the newer version. + +Though your data will not be touched and you won’t lose system files and configurations, it is always a good idea to make backup of important data externally. + +#### When will I get to upgrade to Ubuntu 20.04? + +![][7] + +If you are using Ubuntu 19.10 and have correct update settings in place (as mentioned in the earlier sections), you should be notified for upgrading to Ubuntu 20.04 within a few days of Ubuntu 18.04 release. + +For Ubuntu 18.04 users, it may take some weeks before they are officially notified of the availability of Ubuntu 18.04. Probably, you may get the prompt after the first point release of Ubuntu 20.04.1. + +#### If I upgrade to Ubuntu 20.04, can I downgrade to 19.10 or 18.04? + +No, you cannot. While upgrading to a newer version is easy, there is no option to downgrade.  If you want to go back to Ubuntu 18.04, you’ll have [install Ubuntu 18.04][8] again. + +#### I am using Ubuntu 18.04 LTS. Should I Upgrade to Ubuntu 20.04 LTS? + +That depends upon you. If you are impressed by the new features in Ubuntu 20.04 and want to get your hands on it, you should upgrade. + +If you want a more stable system, I advise waiting for the first point release Ubuntu 20.04.1 release that will have bug fixes in the new release. 20.04.1 should typically be coming approximately two months after the release of Ubuntu 20.04. + +In either case, I recommend upgrading to Ubuntu 20.04 sooner or later. Ubuntu 20.04 has newer kernel, performance improvement and above all newer versions of software available in the repository. + +Make a backup on external disk and with a good internet connectivity, the upgrade should not be an issue. + +#### Should I do a fresh install of Ubuntu 20.04 or upgrade to it from 18.04/19.10? + +If you have a choice, make a backup of your data and do a fresh install of Ubuntu 20.04. + +Upgrading to 20.04 from an existing version is a convenient option. However, in my opinion, it still keeps some traces/packages of the older version. A fresh install is always cleaner. + +#### Any other questions about Ubuntu 20.04? + +If you have any other doubts regarding Ubuntu 20.04, please feel free to leave a comment below. If you think some other information should be added to the list, please let me know. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-20-04-faq/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-20-04-release-features/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu_20_04_faq.jpg?ssl=1 +[3]: https://itsfoss.com/which-ubuntu-install/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-32-bit.jpg?ssl=1 +[5]: https://itsfoss.com/steam-play/ +[6]: https://itsfoss.com/ppa-guide/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04.jpg?ssl=1 +[8]: https://itsfoss.com/install-ubuntu/ From b551ddfdda71a18754e404704cd34a5c96afb70d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Apr 2020 01:01:13 +0800 Subject: [PATCH 0402/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200421=20How?= =?UTF-8?q?=20I=20use=20Hugo=20for=20my=20classroom's=20open=20source=20CM?= =?UTF-8?q?S?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200421 How I use Hugo for my classroom-s open source CMS.md --- ...Hugo for my classroom-s open source CMS.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20200421 How I use Hugo for my classroom-s open source CMS.md diff --git a/sources/tech/20200421 How I use Hugo for my classroom-s open source CMS.md b/sources/tech/20200421 How I use Hugo for my classroom-s open source CMS.md new file mode 100644 index 0000000000..bef4b09a9a --- /dev/null +++ b/sources/tech/20200421 How I use Hugo for my classroom-s open source CMS.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I use Hugo for my classroom's open source CMS) +[#]: via: (https://opensource.com/article/20/4/hugo-classroom) +[#]: author: (Peter Cheer https://opensource.com/users/petercheer) + +How I use Hugo for my classroom's open source CMS +====== +This open source software streamlines text editing while leaving room +for customization. +![Digital hand surrounding by objects, bike, light bulb, graphs][1] + +People love Markdown text with good reason—it is easy to write, easy to read, easy to edit, and it can be converted to a wide range of other text mark up formats. While Markdown text is very good for content creation and manipulation, it imposes limitations on the options for content display. + +If we could combine the virtues of Markdown with the power and flexibility of Cascading Style Sheets, HTML5, and JavaScript, that would be something special. One of the programs trying to do this is [Hugo][2]. Hugo was created in 2013 by Steve Francia; it is cross-platform and open source under an Apache 2.0 license with an active developer community and a growing user base. + +The basic concept is that pieces of content, such as web pages or blog posts, written in Markdown and associated with metadata, are converted into HTML and combined with templates and themes to produce a complete web site. The power and flexibility come through these themes and templates or changing the default behaviors of Hugo. This power comes with a degree of unavoidable complexity, but there are lots of [pre-built templates][3] available if you lack the time or inclination to make your own. + +Installing Hugo on my Linux machine was quick and easy. Starting a new project is as simple as typing **hugo new site quickstart** at the command line which creates a new project with this folder structure: + + * **archetypes**: Content template files that contain preconfigured front matter metadata (date, title, draft). You can create new archetypes with custom front matter fields. + * **assets**: Stores all the files, which are processed by Hugo Pipes (e.g., CSS/Sass files). This directory is not created by default. + * **config.toml**: The default site config file. + * **content**: Where all the content Markdown files live. + * **data**: Used to store configuration files that can be used by Hugo when generating your website. + * **layouts**: Stores templates as .html files. + * **static**: Stores all the static content—images, CSS, JavaScript, etc. + * **themes**: For the Hugo theme of your choice. + + + +The Markdown files in the content folder can be created manually or by Hugo and edited with any text editor or your Markdown creation tool of choice. If created manually, you will need to add any metadata that is needed. I prefer to use [Ghostwriter][4] for writing Markdown. Images are usually kept in a sub-folder in the static folder. Site development can proceed quickly, as Hugo includes a web server for testing and pre-viewing. + +To check your work, type **hugo server** at the command line to start the server. By default, Hugo will not publish: + + * Content with a future **publishdate** value. + * Content with **draft: true** status. + * Content with a past **expirydate** value. + + + +Adding **hugo server -D** will include draft articles, and Hugo can be configured to mark all new articles as draft. After starting the web server, you can see your work in a web browser at localhost:1313. Once the server is started by default, it will automatically reload the browser window when it detects a change to one of your files. + +There are tasks Markdown cannot do that need some HTML code. Hugo recognizes this but believes in keeping Markdown code as clean, simple, and uncluttered as possible. Hugo does this with shortcodes such as **{{< youtube id= "w7Ft2ymGmfc" autoplay= "true">}}**, which will embed the YouTube video with id. w7Ft2ymGmfc. There are quite a few pre-built shortcodes for common tasks, but it is also possible to create your own for particular jobs. + +I work in education quite a lot and wanted to include some interactive puzzles and questions on my Hugo-generated website. To get the output looking like this: + +![JClic shortcode][5] + +I created the activities with an open source Java program called [JClic][6], exported them as HTML5, put that into static/activities/excel, and displayed it in an iframe. + +The HTML code, which would spoil the nice clean Markdown content, looks like this: + + +``` +    <[iframe][7] +       src="/activity/excel/index.html" +       title="Activity" +       height="400" +       frameborder="0" +       marginwidth="0" +       marginheight="0" +       scrolling="no" +       style="border: 1px solid #CCC; border-width: 1px; margin-bottom: 20px; width: 100%;" +       allowfullscreen="true"> +    </[iframe][7]> +``` + +The code is saved in layouts/shortcodes as **activity.html** + +This makes the shortcode placed inside my Markdown file **{{<activity>}}**, which is much neater. + +When your project is ready, you can build it with the **hugo** command; this will create a public folder and generate the website in it. Hugo has a number of built-in deployment options for different hosting providers—basically, you deploy your site by copying the public folder to your production web server. There is a lot more to Hugo that I haven't even gotten to yet, including configuration options, importing content from other static site generators and Wordpress, display data from JSON files, syntax highlighting of source code, and the fact that it is very fast (an advantage when working with large sites). + +In many software tools, ease-of-use comes at the expense of flexibility, or vice-versa; Hugo makes a largely successful attempt at including both. For basic use with Markdown content and a pre-built theme, Hugo is easy to use and produces rapid results. Alternatively, if you have the need to alter the configuration settings or dive in and create your own themes, shortcodes, templates, or metadata schemes, that choice is open to you. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/hugo-classroom + +作者:[Peter Cheer][a] +选题:[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/petercheer +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolseriesk12_rh_021x_0.png?itok=fvorN0e- (Digital hand surrounding by objects, bike, light bulb, graphs) +[2]: https://gohugo.io/ +[3]: https://themes.gohugo.io/ +[4]: http://github.com/wereturtle/ghostwriter +[5]: https://opensource.com/sites/default/files/uploads/jclic_shortcode.png (JClic shortcode) +[6]: https://clic.xtec.cat/legacy/en/index.html +[7]: http://december.com/html/4/element/iframe.html From c832e9cdb82144acafba47bd12e77648bdc1a065 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Apr 2020 01:02:06 +0800 Subject: [PATCH 0403/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200421=20Usin?= =?UTF-8?q?g=20Python=20to=20visualize=20COVID-19=20projections?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200421 Using Python to visualize COVID-19 projections.md --- ...ython to visualize COVID-19 projections.md | 255 ++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 sources/tech/20200421 Using Python to visualize COVID-19 projections.md diff --git a/sources/tech/20200421 Using Python to visualize COVID-19 projections.md b/sources/tech/20200421 Using Python to visualize COVID-19 projections.md new file mode 100644 index 0000000000..96fcb61521 --- /dev/null +++ b/sources/tech/20200421 Using Python to visualize COVID-19 projections.md @@ -0,0 +1,255 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Python to visualize COVID-19 projections) +[#]: via: (https://opensource.com/article/20/4/python-data-covid-19) +[#]: author: (AnuragGupta https://opensource.com/users/999anuraggupta) + +Using Python to visualize COVID-19 projections +====== +I'll demonstrate how to create two visualizations of the spread of a +virus across the globe, provided open data and using open source +libraries. +![Colorful sound wave graph][1] + +Using [Python][2] and some graphing libraries, you can project the total number of confirmed cases of COVID-19, and also display the total number of deaths for a country (this article uses India as an example) on a given date. Humans sometimes need help interpreting and processing the meaning of data, so this article also demonstrates how to create an animated horizontal bar graph for five countries, showing the variation of cases by date. + +### Projecting confirmed cases and deaths for India + +This is done in three steps. + +#### 1\. Download data + +Scientific data isn't always open, but fortunately, many modern science and healthcare organizations are eager to share information with each other and the public. Data about COVID-19 cases is available online, and it's updated frequently. + +To parse the data, you first must download it:  + +Load the data directly into a Pandas DataFrame. Pandas provides a function, **read_csv()**, which can take a URL and give back a DataFrame object, as shown below: + + +``` +import pycountry +import plotly.express as px +import pandas as pd +URL_DATASET = r'' +df1 = pd.read_csv(URL_DATASET) +print(df1.head(3))  # Get first 3 entries in the dataframe +print(df1.tail(3))  # Get last 3 entries in the dataframe +``` + +The top row of the data set contains column names: + + 1. Date + 2. Country + 3. Confirmed + 4. Recovered + 5. Deaths + + + +The output of the **head** query includes a unique identifier (not listed as a column) plus an entry for each column: + + +``` +0 2020-01-22 Afghanistan 0 0 0 +1 2020-01-22 Albania 0 0 0 +1 2020-01-22 Algeria 0 0 0 +``` + +The output of the **tail** query is similar but contains the tail end of the data set: + + +``` +12597 2020-03-31 West Bank and Gaza 119 18 1 +12598 2020-03-31 Zambia 35 0 0 +12599 2020-03-31 Zimbabwe 8 0 1 +``` + +From the output, you can see that the DataFrame (**df1**) has the following columns: + + 1. Date + 2. Country + 3. Confirmed + 4. Recovered + 5. Dead + + + +Further, you can see that the **Date** column has entries starting from January 22 to March 31. This database is updated daily, so you will have current values. + +#### 2\. Select data for India + +In this step, we will select only those rows in the DataFrame that include India. This is shown in the script below: + + +``` +#### ----- Step 2 (Select data for India)---- +df_india = df1[df1['Country'] == 'India'] +print(df_india.head(3)) +``` + +#### 3\. Plot data + +Here we create a bar chart. We will put the dates on the X-axis and the number of confirmed cases and the number of deaths on the Y-axis. There are a few noteworthy things about this part of the script which are as follows: + + * The line of code: **plt.rcParams["_figure.figsize"_]=20,20** is meant only for Jupyter. So remove it if you are using some other IDE. + + * Notice the line of code: **ax1 = plt.gca()**. To ensure that both the plots i.e. for confirmed cases as well as for deaths are plotted on the same graph, we need to give to the second graph the **ax** object of the plot. So we use **gca()** to do this. (By the way, 'gca' stands for 'get current axis'). + + + + +The complete script is given below: + + +``` +#  Author:- Anurag Gupta # email:- [999.anuraggupta@gmail.com][3] +%matplotlib inline +import matplotlib.pyplot as plt +import pandas as pd + +#### ----- Step 1 (Download data)---- +URL_DATASET = r'' +df1 = pd.read_csv(URL_DATASET) +# print(df1.head(3))  # Uncomment to see the dataframe + +#### ----- Step 2 (Select data for India)---- +df_india = df1[df1['Country'] == 'India'] +print(df_india.head(3)) + +#### ----- Step 3 (Plot data)---- +# Increase size of plot +plt.rcParams["figure.figsize"]=20,20  # Remove if not on Jupyter +# Plot column 'Confirmed' +df_india.plot(kind = 'bar', x = 'Date', y = 'Confirmed', color = 'blue') + +ax1 = plt.gca() +df_india.plot(kind = 'bar', x = 'Date', y = 'Deaths', color = 'red', ax = ax1) +plt.show() +``` + +The entire script is [available on GitHub][4]. + +### Creating an animated horizontal bar graph for five countries + +Note for Jupyter: To run this in Jupyter as a dynamic animation rather than as a static png, you need to add a magic command at the beginning of your cell, namely: **%matplotlib notebook**. This will keep the figure alive instead of displaying a static png file and can hence also show animations. If you are on another IDE, remove this line. + +#### 1\. Download the data + +This step is exactly the same as in the previous script, and therefore, it need not be repeated. + +#### 2\. Create a list of all dates + +If you examine the data you downloaded, you notice that it has a column **Date**. Now, this column has a date value for each country. So the same date is occurring a number of times. We need to create a list of dates with only unique values. This will be used on the X-axis of our bar charts. We have a line of code like: **list_dates = df[_‘Date’_].unique()**. The **unique()** method will pick up only the unique values for each date. + +#### 3\. Pick five countries and create an **ax** object + +Take a list of five countries. (You can choose whatever countries you prefer, or even increase or decrease the number of countries). I have also taken a list of five colors for the bars of each country. (You can change this too if you like). One important line of code here is: **fig, ax = plt.subplots(figsize=(15, 8))**. This is needed to create an **ax** object. + +#### 4\. Write the call back function + +If you want to do animation in Matplotlib, you need to create an object of a class called **matplotlib.animation.FuncAnimation**. The signature of this class is available online. The constructor of this class, apart from other parameters, also takes a parameter called **func**, and you have to give this parameter a callback function. So in this step, we will write the callback function, which is repeatedly called in order to render the animation. + +#### 5\. Create **FuncAnimation** object + +This step has partly been explained in the previous step. + +Our code to create an object of this class is: + + +``` +my_anim = animation.FuncAnimation(fig = fig, func = plot_bar, +                    frames= list_dates, blit=True, +                    interval=20) +``` + +The three important parameters to be given are: + + * **fig**, which must be given a fig object, which we created earlier. + * **func**, which must be the call back function. + * **frames**, which must contain the variable on which the animation is to be done. Here in our case, it will be the list of dates we created earlier. + + + +#### 6\. Save the animation to an mp4 file + +You can save the animation created into an mp4 file. But for this you need **ffmpeg**. You can download this using pip by **pip install ffmpeg-python**, or using conda (on Jupyter) **install -c conda-forge ffmpeg**. + +And finally, you can run the animation using **plt.show()**. Please note that on many platforms, the **ffmpeg** may not work properly and may require further "tweaking." + + +``` +%matplotlib notebook +#  Author:- Anurag Gupta # email:- [999.anuraggupta@gmail.com][3] +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.animation as animation +from time import sleep + +#### ---- Step 1:- Download data +URL_DATASET = r'' +df = pd.read_csv(URL_DATASET, usecols = ['Date', 'Country', 'Confirmed']) +# print(df.head(3)) # uncomment this to see output + +#### ---- Step 2:- Create list of all dates +list_dates = df['Date'].unique() +# print(list_dates) # Uncomment to see the dates + +#### --- Step 3:- Pick 5 countries. Also create ax object +fig, ax = plt.subplots(figsize=(15, 8)) +# We will animate for these 5 countries only +list_countries = ['India', 'China', 'US', 'Italy', 'Spain'] +# colors for the 5 horizontal bars +list_colors = ['black', 'red', 'green', 'blue', 'yellow'] + +### --- Step 4:- Write the call back function +# plot_bar() is the call back function used in FuncAnimation class object +def plot_bar(some_date): +    df2 = df[df['Date'].eq(some_date)] +    ax.clear() +    # Only take Confirmed column in descending order +    df3 = df2.sort_values(by = 'Confirmed', ascending = False) +    # Select the top 5 Confirmed countries +    df4 = df3[df3['Country'].isin(list_countries)] +    # print(df4)  # Uncomment to see that dat is only for 5 countries +    sleep(0.2)  # To slow down the animation +    # ax.barh() makes a horizontal bar plot. +    return ax.barh(df4['Country'], df4['Confirmed'], color= list_colors) + +###----Step 5:- Create FuncAnimation object--------- +my_anim = animation.FuncAnimation(fig = fig, func = plot_bar, +                    frames= list_dates, blit=True, +                    interval=20) + +### --- Step 6:- Save the animation to an mp4 +# Place where to save the mp4. Give your file path instead +path_mp4 = r'C:\Python-articles\population_covid2.mp4'   +# my_anim.save(path_mp4, fps=30, extra_args=['-vcodec', 'libx264']) +my_anim.save(filename = path_mp4, writer = 'ffmpeg', +             fps=30, +             extra_args= ['-vcodec', 'libx264', '-pix_fmt', 'yuv420p']) +plt.show() +``` + +The complete script is [available on GitHub][5]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/python-data-covid-19 + +作者:[AnuragGupta][a] +选题:[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/999anuraggupta +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/colorful_sound_wave.png?itok=jlUJG0bM (Colorful sound wave graph) +[2]: https://opensource.com/resources/python +[3]: mailto:999.anuraggupta@gmail.com +[4]: https://raw.githubusercontent.com/ag999git/jupyter_notebooks/master/corona_bar_india +[5]: https://raw.githubusercontent.com/ag999git/jupyter_notebooks/master/corona_bar_animated From ce078aeb7444deeae8ca7f63413dd26a7660bb40 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Apr 2020 01:03:01 +0800 Subject: [PATCH 0404/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200421=20How?= =?UTF-8?q?=20I=20use=20Python=20to=20map=20the=20global=20spread=20of=20C?= =?UTF-8?q?OVID-19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200421 How I use Python to map the global spread of COVID-19.md --- ...on to map the global spread of COVID-19.md | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 sources/tech/20200421 How I use Python to map the global spread of COVID-19.md diff --git a/sources/tech/20200421 How I use Python to map the global spread of COVID-19.md b/sources/tech/20200421 How I use Python to map the global spread of COVID-19.md new file mode 100644 index 0000000000..2f5f8dbef0 --- /dev/null +++ b/sources/tech/20200421 How I use Python to map the global spread of COVID-19.md @@ -0,0 +1,170 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I use Python to map the global spread of COVID-19) +[#]: via: (https://opensource.com/article/20/4/python-map-covid-19) +[#]: author: (AnuragGupta https://opensource.com/users/999anuraggupta) + +How I use Python to map the global spread of COVID-19 +====== +Create a color coded geographic map of the potential spread of the virus +using these open source scripts. +![Globe up in the clouds][1] + +The spread of disease is a real concern for a world in which global travel is commonplace. A few organizations track significant epidemics (and any pandemic), and fortunately, they publish their work as open data. The raw data can be difficult for humans to process, though, and that's why data science is so vital. For instance, it could be useful to visualize the worldwide spread of COVID-19 with Python and Pandas. + +It can be hard to know where to start when you're faced with large amounts of raw data. The more you do it, however, the more patterns begin to emerge. Here's a common scenario, applied to COVID-19 data: + + 1. Download COVID-19 country spread daily data into a Pandas DataFrame object from GitHub. For this, you need the Python Pandas library. + 2. Process and clean the downloaded data and make it suitable for visualizing. The downloaded data (as you will see for yourself) is in quite good condition. The one problem with this data is that it uses the names of countries, but it's better to use three-digit ISO 3 codes. To generate the three-digit ISO 3 codes, use a small Python library called pycountry. Having generated these codes, you can add an extra column to our DataFrame and populate it with these codes. + 3. Finally, for the visualization, use the **express** module of a library called Plotly. This article uses what are called choropleth maps (available in Plotly) to visualize the worldwide spread of the disease. + + + +### Step 1: Corona data + +We will download the latest corona data from: + + + +We will load the data directly into a Pandas DataFrame. Pandas provides a function, **read_csv()**, which can take a URL and return a DataFrame object as shown below: + + +``` +import pycountry +import plotly.express as px +import pandas as pd +URL_DATASET = r'' +df1 = pd.read_csv(URL_DATASET) +print(df1.head(3))  # Get first 3 entries in the dataframe +print(df1.tail(3))  # Get last 3 entries in the dataframe +``` + +The screenshot of output (on Jupyter) is: + +![Jupyter screenshot][2] + +From output, you can see that the DataFrame (df1) has the following columns: + + 1. Date + 2. Country + 3. Confirmed + 4. Recovered + 5. Dead + + + +Further, you can see that the **Date** column has entries starting from January 22 to March 31. This database is updated daily, so you will get the current values. + +### Step 2: Cleaning and modifying the data frame + +We need to add another column to this DataFrame, which has the three-letter ISO alpha-3 codes. To do this, I followed these steps: + + 1. Create a list of all countries in the database. This was required because in the **df**, in the column **Country**, each country was figuring for each date. So in effect, the **Country** column had multiple entries for each country. To do this, I used the **unique().tolist()** functions. + 2. Then I took a dictionary **d_country_code** (initially empty) and populated it with keys consisting of country names and values consisting of their three-letter ISO codes. + 3. To generate the three-letter ISO code for a country, I used the function **pycountry.countries.search_fuzzy(country)**. You need to understand that the return value of this function is a "list of **Country** objects." I passed the return value of this function to a name country_data. Further, in this list of objects, the first object i.e., at index 0, is the best fit. Further, this **\** object has an attribute **alpha_3**. So, I can "access" the 3 letter ISO code by using **country_data[0].alpha_3**. However, it is possible that some country names in the DataFrame may not have a corresponding ISO code (For example, disputed territories). So, for such countries, I gave an ISO code of "i.e. a blank string. Further, you need to wrap this code in a try-except block. The statement: **print(_‘could not add ISO 3 code for ->'_, country)** will give a printout of those countries for which the ISO 3 codes could not be found. In fact, you will find such countries as shown with white color in the final output. + 4. Having got the three-letter ISO code for each country (or an empty string for some), I added the country name (as key) and its corresponding ISO code (as value) to the dictionary **d_country_code**. For adding these, I used the **update()** method of the Python dictionary object. + 5. Having created a dictionary of country names and their codes, I added them to the DataFrame using a simple for loop. + + + +### Step 3: Visualizing the spread using Plotly + +A choropleth map is a map composed of colored polygons. It is used to represent spatial variations of a quantity. We will use the express module of Plotly conventionally called **px**. Here we show you how to create a choropleth map using the function: **px.choropleth**. + +The signature of this function is: + + +``` +`plotly.express.choropleth(data_frame=None, lat=None, lon=None, locations=None, locationmode=None, geojson=None, featureidkey=None, color=None, hover_name=None, hover_data=None, custom_data=None, animation_frame=None, animation_group=None, category_orders={}, labels={}, color_discrete_sequence=None, color_discrete_map={}, color_continuous_scale=None, range_color=None, color_continuous_midpoint=None, projection=None, scope=None, center=None, title=None, template=None, width=None, height=None)` +``` + +The noteworthy points are that the **choropleth()** function needs the following things: + + 1. A geometry in the form of a **geojson** object. This is where things are a bit confusing and not clearly mentioned in its documentation. You may or may not provide a **geojson** object. If you provide a **geojson** object, then that object will be used to plot the earth features, but if you don't provide a **geojson** object, then the function will, by default, use one of the built-in geometries. (In our example here, we will use a built-in geometry, so we won't provide any value for the **geojson** argument) + 2. A pandas DataFrame object for the attribute **data_frame**. Here we provide our DataFrame ie **df1** we created earlier. + 3. We will use the data of **Confirmed** column to decide the color of each country polygon. + 4. Further, we will use the **Date** column to create the **animation_frame**. Thus as we slide across the dates, the colors of the countries will change as per the values in the **Confirmed** column. + + + +The complete code is given below: + + +``` +import pycountry +import plotly.express as px +import pandas as pd +# ----------- Step 1 ------------ +URL_DATASET = r'' +df1 = pd.read_csv(URL_DATASET) +# print(df1.head) # Uncomment to see what the dataframe is like +# ----------- Step 2 ------------ +list_countries = df1['Country'].unique().tolist() +# print(list_countries) # Uncomment to see list of countries +d_country_code = {}  # To hold the country names and their ISO +for country in list_countries: +    try: +        country_data = pycountry.countries.search_fuzzy(country) +        # country_data is a list of objects of class pycountry.db.Country +        # The first item  ie at index 0 of list is best fit +        # object of class Country have an alpha_3 attribute +        country_code = country_data[0].alpha_3 +        d_country_code.update({country: country_code}) +    except: +        print('could not add ISO 3 code for ->', country) +        # If could not find country, make ISO code ' ' +        d_country_code.update({country: ' '}) + +# print(d_country_code) # Uncomment to check dictionary   + +# create a new column iso_alpha in the df +# and fill it with appropriate iso 3 code +for k, v in d_country_code.items(): +    df1.loc[(df1.Country == k), 'iso_alpha'] = v + +# print(df1.head)  # Uncomment to confirm that ISO codes added +# ----------- Step 3 ------------ +fig = px.choropleth(data_frame = df1, +                    locations= "iso_alpha", +                    color= "Confirmed",  # value in column 'Confirmed' determines color +                    hover_name= "Country", +                    color_continuous_scale= 'RdYlGn',  #  color scale red, yellow green +                    animation_frame= "Date") + +fig.show() +``` + +The output is something like the following: + +![Map][3] + +You can download and run the [complete code][4]. + +To wrap up, here are some excellent resources on choropleth in Plotly: + + * + * [https://plotly.com/python/reference/#choropleth][5] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/python-map-covid-19 + +作者:[AnuragGupta][a] +选题:[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/999anuraggupta +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cloud-globe.png?itok=_drXt4Tn (Globe up in the clouds) +[2]: https://opensource.com/sites/default/files/uploads/jupyter_screenshot.png (Jupyter screenshot) +[3]: https://opensource.com/sites/default/files/uploads/map_2.png (Map) +[4]: https://github.com/ag999git/jupyter_notebooks/blob/master/corona_spread_visualization +[5]: tmp.azs72dmHFd#choropleth From da9a56c71925de5916b0687d0ec34cf78a4322b3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Apr 2020 01:05:53 +0800 Subject: [PATCH 0405/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200421=20IoT?= =?UTF-8?q?=20offers=20a=20way=20to=20track=20COVID-19=20via=20connected?= =?UTF-8?q?=20thermometers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200421 IoT offers a way to track COVID-19 via connected thermometers.md --- ...ack COVID-19 via connected thermometers.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sources/talk/20200421 IoT offers a way to track COVID-19 via connected thermometers.md diff --git a/sources/talk/20200421 IoT offers a way to track COVID-19 via connected thermometers.md b/sources/talk/20200421 IoT offers a way to track COVID-19 via connected thermometers.md new file mode 100644 index 0000000000..a3ba9f972e --- /dev/null +++ b/sources/talk/20200421 IoT offers a way to track COVID-19 via connected thermometers.md @@ -0,0 +1,54 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IoT offers a way to track COVID-19 via connected thermometers) +[#]: via: (https://www.networkworld.com/article/3539058/iot-offers-a-way-to-track-covid-19-via-connected-thermometers.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +IoT offers a way to track COVID-19 via connected thermometers +====== +The COVID-19 pandemic has catapulted one manufacturer of connected thermometers to national prominence, as Kinsa provides a possible window into the spread of the disease. +[Kinsa / Leaflet / OpenStreetMap / CARTO][1] + +A company called Kinsa is leveraging [IoT][2] tech to create a network of connected thermometers, collecting a huge amount of anonymous health data that could offer insights into the current and future pandemics. + +The company’s founder and CEO, Inder Singh, said that the ability to track fever levels across the U.S. in close to real time could be a crucial piece of information for both the public at large and for decision-makers in the healthcare sector and government. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +The system’s networking technology is relatively straightforward – the thermometer connects via Bluetooth to an app on the user’s phone, which reports anonymized data back to Kinsa’s cloud over the Internet. Singh emphasizes that the company only organizes data down to the county level, and asserts that identifying individuals through Kinsa’s data is more or less impossible. + +“We’re not providing PII, we’re not providing identified data,” he said. “The app just guides you to the care and services you need.” + +Armed with the temperature reading and some basic demographic information about the person whose temperature was taken and their other symptoms, the app can offer rudimentary guidance about whether a visit to the doctor is needed or not, and whether the user’s area is seeing unusual levels of fever. + +However, the real value is in the aggregated data that Kinsa analyzes and breaks out on its [U.S. Health Weather Map][1], gleaned from the million-plus thermometers in the company’s ecosystem. The idea, according to Singh, is to provide the public with a way to make more informed decisions about their health. + +“It’s very participatory,” he said. “Everyone gets the data, and everyone can respond.” + +Kinsa still sells its thermometers directly to consumers, but plans are afoot for the company to collaborate more closely with local governments, health authorities and even school districts – Singh said that Kinsa is already partnering with two U.S. states (which he declined to name), and several city governments, including St. Augustine, Florida. + +“Our hope is that we can figure out how to build a scalable model – we’re never gonna scale globally by just selling $20 thermometers,” he said. The goal is to become widespread enough that the product can act as a meaningful early warning system for the healthcare sector. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3539058/iot-offers-a-way-to-track-covid-19-via-connected-thermometers.html + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://healthweather.us/?mode=Atypical +[2]: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 4e02c2825405b7599643d3977d245191a63ed918 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Apr 2020 01:06:50 +0800 Subject: [PATCH 0406/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200421=20How?= =?UTF-8?q?=20to=20take=20advantage=20of=20Linux's=20extensive=20vocabular?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200421 How to take advantage of Linux-s extensive vocabulary.md --- ...vantage of Linux-s extensive vocabulary.md | 273 ++++++++++++++++++ 1 file changed, 273 insertions(+) create mode 100644 sources/tech/20200421 How to take advantage of Linux-s extensive vocabulary.md diff --git a/sources/tech/20200421 How to take advantage of Linux-s extensive vocabulary.md b/sources/tech/20200421 How to take advantage of Linux-s extensive vocabulary.md new file mode 100644 index 0000000000..249d9d84f5 --- /dev/null +++ b/sources/tech/20200421 How to take advantage of Linux-s extensive vocabulary.md @@ -0,0 +1,273 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to take advantage of Linux's extensive vocabulary) +[#]: via: (https://www.networkworld.com/article/3539011/how-to-takke-advantage-of-linuxs-extensive-vocabulary.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +How to take advantage of Linux's extensive vocabulary +====== +Linux systems don't only know a lot of words, it has commands that can help you use them by finding words that are on the tip of your tongue or fixing your typos. +Sandra Henry-Stocker + +While you might not think of Linux as a writing tutor, it does have some commendable language skills – at least when it comes to English. While the average American probably has a vocabulary between 20,000 and 50,000 words, Linux can claim over 100,000 words (spellings, not definitions). And you can easily put this vocabulary to work for you in a number of ways. Let’s look at how Linux can help with your word challenges. + +### Help with finding words + +First, let’s focus on finding words.If you use the **wc** command to count the number of words in the **/usr/share/dict/words** file on your system, you should see something like this: + +``` +$ wc -l /usr/share/dict/words +102402 /usr/share/dict/words +``` + +As you can see, the **words** file on this system contains 102,402 words. So, when you’re trying to nail down just the right word and are having trouble, you stand a good chance of finding it on your system by remembering (or guessing at) some part of it. But you'll need a little help narrowing down those 102,402 words to a group worth your time to review. In this command, we’re looking for words that start with the letters “revi”. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] + +``` +$ grep ^reviv /usr/share/dict/words +revival +revival's +revivalist +revivalist's +revivalists +revivals +revive +revived +revives +revivification +revivification's +revivified +revivifies +revivify +revivifying +reviving +``` + +That’s sixteen words that start with the string “revi”. The **^** character represents the beginning of the word and, as you might have suspected, each word in the file is on a line by itself. + +A good number of the words in the **/usr/share/dict/words** file are names. If you want to  find words regardless of whether they're capitalized, add the **-i** (ignore case) option to your **grep** command. + +``` +$ grep -i ^wool /usr/share/dict/words +Woolf +Woolf's +Woolite +Woolite's +Woolongong +Woolongong's +Woolworth +Woolworth's +wool +... +``` + +You can also look for words that end in or contain a certain string of letters. In this next command, we look for words that contain the string “nativ” at any location. + +``` +$ grep 'nativ' /usr/share/dict/words +alternative +alternative's +alternatively +alternatives +imaginative +imaginatively +native +native's +natives +nativities +nativity +nativity's +nominative +nominative's +nominatives +unimaginative +``` + +In this next command, we look for words that end in “emblance”, the **$** character representing the end of the line. Only two words in the **words** file fit the bill. + +[][2] + +``` +$ grep 'emblance$' /usr/share/dict/words +resemblance +semblance +``` + +If we, for some reason, want to find words with exactly 21 letters, we could use this command: + +``` +$ grep '^.....................$' /usr/share/dict/words +counterintelligence's +electroencephalograms +electroencephalograph +``` + +On the other hand, making sure we've typed the correct number of dots can be tedious. This next command is little easier to manage: + +``` +$ grep -E '^[[:alpha:]]{21}$' /usr/share/dict/words +electroencephalograms +electroencephalograph +``` + +This command does the same thing: + +``` +$ grep -E '^\w{21}$' /usr/share/dict/words +electroencephalograms +electroencephalograph +``` + +The one important difference between these commands is that the one with the dots matches any string of 21 characters. The two specifying "alpha" or "\w" only match letters, so they find only two matching words. + +Now let’s look for words that contain 20 letters (or more) in a row. + +``` +$ grep -E '(\w{20})' /usr/share/dict/words +Andrianampoinimerina +Andrianampoinimerina's +counterrevolutionaries +counterrevolutionary +counterrevolutionary's +electroencephalogram +electroencephalogram's +electroencephalograms +electroencephalograph +electroencephalograph's +electroencephalographs +uncharacteristically +``` + +That command returns words with apostrophes because they contain 20 letters in a row before they get to that point. + +Next, we’ll check out words with 21 or more characters. The 1 and 20 in combination with the **v** (invert) option in this command cause **grep** to skip over words with anywhere from 1 to 20 characters. + +``` +$ grep -vwE '\w{1,20}' /usr/share/dict/words +counterrevolutionaries +electroencephalograms +electroencephalograph +electroencephalographs +``` + +In this next command, we look for words that start with “ex” and have four additional letters. + +``` +$ grep '^ex.\{4\}$' /usr/share/dict/words +exacts +exalts +exam's +exceed +excels +except +excess +excise +excite +excuse +… +``` + +In case you're curious, the **words** file on this system contains 43 such words: + +``` +$ grep '^ex.\{4\}$' /usr/share/dict/words | wc -l +43 +``` + +To get help with spelling, you should try **aspell**. It can help you with individual words or run a spell check scan through an entire text file. In this first example, we ask **aspell** to help with a single word. It finds the word we’re after along with a couple other possibilities. + +### Checking a word + +``` +$ aspell -a +@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.7) +prolifferate <== entered word +& prolifferate 3 0: proliferate, proliferated, proliferates <== replacement options +``` + +If **aspell** doesn’t provide a list of words, that means that the spelling you offered was correct. Here's an example: + +``` +$ aspell -a +@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.7) +proliferate <== entered text +* <== no suggestions +``` + +Typing **^C** (control-c) exits **aspell**. + +### Checking a file + +When checking a file with **aspell**, you get suggestions for each misspelled word. When **aspell** spots typos, it highlights the misspelled words one at a time and gives you a chance to choose from a list of properly spelled words that are similar enough to the misspelled words to be good candidates for replacing them. + +To start checking a file, type **aspell -c** followed by the file name. + +``` +$ aspell -c thesis +``` + +You'll see something like this: + +``` +This thesis focusses on … + +1) focuses 6) Fosse's +2) focused 7) flosses +3) cusses 8) courses +4) fusses 9) focus +5) focus's 0) fuses +i) Ignore I) Ignore all +r) Replace R) Replace all +a) Add l) Add Lower +b) Abort x) Exit +``` + +Make your selection by pressing the key listed next to the word you want (1, 2, etc.) and **aspell** will replace the misspelled word in the file and move on to the next one if there are others. Notice that you also have options to replace the word by typing another one. Press "x" when you're done. + +### Help with crossword puzzles + +If you’re working on a crossword puzzle and need to find a five-letter word that starts with a “d” and has a “u” as its fourth letter, you can use a command like this: + +``` +$ grep -i '^d..u.$' /usr/share/dict/words +datum +debug +debut +demur +donut +``` + +### Help with word scrambles + +If you’re working on a puzzle that requires you to de-scramble the letters in a string until you've found a proper word, you can offer the list of letters to grep like this example in which **grep** turns the letters "yxusonlia" into the word “anxiously”. + +``` +$ grep -P '^(?:([yxusonlia])(?!.*?\1)){9}$' /usr/share/dict/words +anxiously +``` + +Linux’s word skills are impressive and sometimes even fun. Whether you're hoping to find words you can't quite call to mind or get a little help cheating on word puzzles, Linux offers some clever options. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3539011/how-to-takke-advantage-of-linuxs-extensive-vocabulary.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From 459216f29a79edf4a89088180ec8f5e3b7777a60 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Apr 2020 01:08:07 +0800 Subject: [PATCH 0407/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200421=20How?= =?UTF-8?q?=20underwater=20Internet=20of=20Things=20will=20work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200421 How underwater Internet of Things will work.md --- ...underwater Internet of Things will work.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/talk/20200421 How underwater Internet of Things will work.md diff --git a/sources/talk/20200421 How underwater Internet of Things will work.md b/sources/talk/20200421 How underwater Internet of Things will work.md new file mode 100644 index 0000000000..16503a8143 --- /dev/null +++ b/sources/talk/20200421 How underwater Internet of Things will work.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How underwater Internet of Things will work) +[#]: via: (https://www.networkworld.com/article/3538393/how-underwater-internet-of-things-will-work.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +How underwater Internet of Things will work +====== +Lasers will be used to power underwater devices and transmit data below the ocean's surface. +North Sea Port + +More than two-thirds of the world's surface is covered by water. It plays an important role in our economic existence, including in major verticals such as oil and gas, shipping and tourism. + +As the Internet of Things proliferates, questions arise as to how IoT will manifest itself underwater given that radio waves degrade over distance in seawater, and underwater acoustic communication (which does actually work okay) is easily eavesdropped on and isn't stealthy. + +To make the underwater Internet of Things happen, light is the answer, some say. Researchers at King Abdullah University of Science and Technology (KAUST) in Thuwal, Saudi Arabia, are proposing underwater optical communications. They're investigating simultaneous lightwave information and power transfer (SLIPT) configurations, which they're using to transmit energy and data to underwater electronic devices. Recently, the researchers announced a breakthrough experiment in which they were able to achieve an underwater, two-way transmission of data and power over 1.5 yards between a solar panel-equipped sensor and a receiver. + +The SLIPT system will be more usable than wires strung. And in the case of human underwater equipment inspections, for example, SLIPT will be less prone to error than hand signals and less prone to audible confusion than ultrasound voice-based communicators. Remarkably, to this day, hand signals are still a common form of communication between divers. + +"SLIPT can help charge devices in inaccessible locations where continuous powering is costly or not possible," said Jose Filho, a PhD student at KAUST, [in an article][1] on the school's web site. + +Filho, who has been involved in developing the laser project, envisages ships or boats on the water's surface beaming optical communications to underwater vehicles or IoT sensors on the ocean floor. The lasers would simultaneously communicate with and power underwater robots and devices. Return data is relayed to the surface vessel, which then communicates to land bases or data centers via RF (radio). + +Surface buoys – or even unmanned aerial vehicles (drones) flying well above turbulent waves – could be used to inject power down to the seabed surface and, at the same time, receive data, researchers believe. + +[][2] + +The school explains that there's still much development that needs to be performed before SLIPT is operational, but it sees potential. "Underwater optical communication provides an enormous bandwidth and is useful for reliably transmitting information over several meters," co-first author Abderrahmen Trichili said in the article. + +KAUST, located on the Red Sea coast, has been involved in this area of technical exploration for some years. It was involved in developing some early, record-breaking underwater data communications. In 2015 it ran a 4.8 gigabit per second, 16-QAM-OFDM transmission with a 450-nanometer laser. OFDM, or Orthogonal Frequency Division Multiplexing, splits single data streams into multiple channels to reduce interference. + +Interestingly, seas and oceans are becoming increasingly important to data centers. Large swaths of the world's population are found on or near coasts, rather than inland, and we're seeing a shift towards edge-style computing that positions resources closer to sources of data. There's also a need for compute cooling, which ocean water can provide. Even wave energy as a method of powering servers means sea and data are becoming intertwined. + +Microsoft launched an [undersea water-cooling data center][3] 117 feet below the water surface in 2018. Additionally, garden-hose-sized cables carry almost all global, public Internet traffic [underwater, across oceans and between continents][4]. It's not done through satellite, as many imagine. + +So, this is not a brand-new synergy. Apart from the eco-monitoring drivers, one of the likeliest and most important reasons that ocean-based computing is being explored keenly is that there isn't any rent payable or jurisdictional ownership on the high seas. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3538393/how-underwater-internet-of-things-will-work.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://discovery.kaust.edu.sa/en/article/952/the-power-of-light-for-internet-of-underwater-things +[2]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[3]: https://www.networkworld.com/article/3283332/microsoft-launches-undersea-free-cooling-data-center.html +[4]: https://www.networkworld.com/article/3004465/how-vulnerable-are-the-internets-undersea-cables.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 46ec4304097bb247006a03802892bbfabff9af85 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 22 Apr 2020 08:52:03 +0800 Subject: [PATCH 0408/1809] translated --- ...ium announces completion of 800GbE spec.md | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 sources/news/20200418 Ethernet consortium announces completion of 800GbE spec.md diff --git a/sources/news/20200418 Ethernet consortium announces completion of 800GbE spec.md b/sources/news/20200418 Ethernet consortium announces completion of 800GbE spec.md deleted file mode 100644 index 3a687f8800..0000000000 --- a/sources/news/20200418 Ethernet consortium announces completion of 800GbE spec.md +++ /dev/null @@ -1,56 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ethernet consortium announces completion of 800GbE spec) -[#]: via: (https://www.networkworld.com/article/3538529/ethernet-consortium-announces-completion-of-800gbe-spec.html) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Ethernet consortium announces completion of 800GbE spec -====== -The specification for 800GbE doubles the maximum speed of the current Ethernet standard, but also tweaks other aspects including latency. -Martyn Williams/IDGNS - -The industry-backed Ethernet Technology Consortium has announced the completion of a specification for 800 Gigabit Ethernet technology. - -Based on many of the technologies used in the current top-end 400 Gigabit Ethernet protocol, the new spec is formally known as 800GBASE-R. The consortium that designed it (then known as the 25 Gigabit Ethernet Consortium) was also instrumental in developing the 25, 50, and 100 Gigabit Ethernet protocols and includes Broadcom, Cisco, Google, and Microsoft among its members. - -**[ Now see [the hidden cause of slow internet and how to fix it][1].]** - -The 800GbE spec adds new media access control (MAC) and physical coding sublayer (PCS) methods, which tweaks these functions to distribute data across eight physical lanes running at a native 106.25Gbps. (A lane can be a copper twisted pair or in optical cables, a strand of fiber or a wavelength.)  The 800GBASE-R specification is built on two 400 GbE 2xClause PCSs to create a single MAC which operates at a combined 800Gbps. - -And while the focus is on eight 106.25G lanes, it's not locked in. It is possible to run 16 lanes at half the speed, or 53.125Gbps. - -The new standard offers half the latency of 400G Ethernet specification, but the new spec also cuts the forward error correction (FEC) overhead on networks running at 50 Gbps, 100 Gbps, and 200 Gbps by half, thus reducing the packet-processing load on the NIC. - -By lowering latency this will feed the need for speed in latency-sensitive applications like [high-performance computing][2] and artificial intelligence, where lots of data needs to be moved around as fast as possible. - -[][3] - -Doubling from 400G to 800G wasn’t too great of a technological leap. It meant adding more lanes at the same transfer rate, with a few tweaks. But breaking a terabit, something Cisco and other networking firms have been talking about for a decade, will require a significant reworking of the technology and won’t be an easy fix. - -It likely won’t be cheap, either. 800G works with existing hardware and 400GbE switches are not cheap, running as high as six figures. Moving past the terabit barrier with a major revision to the technology will likely be even more expensive. But for hyperscalers and HPC customers, that’s par for the course. - -The ETC didn’t say when to expect new hardware supporting the 800G, but given its modest change to existing specs, it could appear this year, assuming the pandemic-induced shutdown doesn’t throw a monkey wrench into plans. - -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3538529/ethernet-consortium-announces-completion-of-800gbe-spec.html - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3107744/internet/the-hidden-cause-of-slow-internet-and-how-to-fix-it.html -[2]: https://www.networkworld.com/article/3444399/high-performance-computing-do-you-need-it.html -[3]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) -[4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world From 1cc8c0fb0b95d6bc7fd0664f99ec08b86fc0524a Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 22 Apr 2020 08:52:44 +0800 Subject: [PATCH 0409/1809] translated --- ...ium announces completion of 800GbE spec.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 translated/news/20200418 Ethernet consortium announces completion of 800GbE spec.md diff --git a/translated/news/20200418 Ethernet consortium announces completion of 800GbE spec.md b/translated/news/20200418 Ethernet consortium announces completion of 800GbE spec.md new file mode 100644 index 0000000000..3ef20c7cb4 --- /dev/null +++ b/translated/news/20200418 Ethernet consortium announces completion of 800GbE spec.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ethernet consortium announces completion of 800GbE spec) +[#]: via: (https://www.networkworld.com/article/3538529/ethernet-consortium-announces-completion-of-800gbe-spec.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +以太网联盟宣布完成 800Gb 以太网规范 +====== +800Gb 以太网规范使当前以太网标准的最高速度提高了一倍,但同时也对包括延迟在内的其他方面进行了调整。 +Martyn Williams/IDGNS + +由业界支持的以太网技术联盟已宣布完成 800Gb 以太网技术规范。 + +它基于当前高端 400Gb 以太网协议中使用的许多技术,新规范正式称为 800GBASE-R。设计它的联盟(当时称为 25Gb 以太网联盟)在开发 25、50 和 100Gb 以太网协议方面也发挥了重要作用,其成员包括 Broadcom、Cisco、Google 和 Microsoft。 + +800Gb 以太网规范增加了新的媒体访问控制(MAC)和物理编码子层(PCS)方法,新规范对这些功能进行了调整,来使用 8 条 106.25Gbps 的物理通道分发数据。(通道可以是铜双绞线,也可以是光缆,一束光纤或光波。)800GBASE-R 规范建立在两个 400 GbE 2xClause PCS 之上,以创建一个以 800Gbps 的总速率运行的单个 MAC。 + +尽管主要是使用八条 106.25Gb 通道,但这并不是固定的。它可以以一半的速度 (53.125Gbps) 使用 16 条通道。 + +新标准提供了 400G 以太网规范的一半延迟,但是新规范也将运行在 50 Gbps、100 Gbps 和 200 Gbps 的网络上的前向纠错(FEC)开销减少了一半,从而减少了网卡上的数据包处理负担。 + +通过降低延迟,这将满足对延迟敏感的应用(例如[高性能计算][2]和人工智能)中对速度的需求,在这些应用中,需要尽可能快地移动大量数据。 + +[][3] + +从 400G 增加到 800G 并不是技术上大的飞跃。这意味着要以相同的传输速率添加更多通道,并进行一些调整。但是,要想突破 Tb,Cisco 和其他网络公司已经讨论了十年了,这将需要对技术进行重大修改,而且并非易事。 + +新技术可能也不便宜。800G 可与现有硬件一起使用,而 400Gb 以太网交换机价格不菲,高达六位数。对技术进行重大修改,越过 Tb 障碍,可能会变得更加昂贵。但是对于大客户和高性能计算客户而言,这是预料之中的。 + +ETC 并未透露何时会支持 800G 的新硬件,但鉴于其对现有规格的适度更改,它可能会在今年出现,前提是疫情引起的停滞不会影响它。 + +加入 [Facebook][4] 和 [LinkedIn][5] 上的 Network World 社区,评论热门主题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3538529/ethernet-consortium-announces-completion-of-800gbe-spec.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[2]: https://www.networkworld.com/article/3444399/high-performance-computing-do-you-need-it.html +[3]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world \ No newline at end of file From c4b95ab13c0cec165a4a76ace9044e38c301a8cd Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 22 Apr 2020 08:54:25 +0800 Subject: [PATCH 0410/1809] translating --- ...0421 MystiQ- A Free and Open Source Audio-Video Converter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md b/sources/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md index cfddc43c54..4b793e918a 100644 --- a/sources/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md +++ b/sources/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 204457e381c45cb6ee198346cc60a465209a0d7c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Apr 2020 16:15:22 +0800 Subject: [PATCH 0411/1809] PRF @geekpi --- ...ium announces completion of 800GbE spec.md | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/translated/news/20200418 Ethernet consortium announces completion of 800GbE spec.md b/translated/news/20200418 Ethernet consortium announces completion of 800GbE spec.md index 3ef20c7cb4..d97f52e94b 100644 --- a/translated/news/20200418 Ethernet consortium announces completion of 800GbE spec.md +++ b/translated/news/20200418 Ethernet consortium announces completion of 800GbE spec.md @@ -1,38 +1,36 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Ethernet consortium announces completion of 800GbE spec) [#]: via: (https://www.networkworld.com/article/3538529/ethernet-consortium-announces-completion-of-800gbe-spec.html) [#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) -以太网联盟宣布完成 800Gb 以太网规范 +以太网技术联盟宣布完成 800Gb 以太网规范 ====== -800Gb 以太网规范使当前以太网标准的最高速度提高了一倍,但同时也对包括延迟在内的其他方面进行了调整。 -Martyn Williams/IDGNS -由业界支持的以太网技术联盟已宣布完成 800Gb 以太网技术规范。 +> 800Gb 以太网规范使当前以太网标准的最高速度提高了一倍,但同时也对包括延迟在内的其他方面进行了调整。 -它基于当前高端 400Gb 以太网协议中使用的许多技术,新规范正式称为 800GBASE-R。设计它的联盟(当时称为 25Gb 以太网联盟)在开发 25、50 和 100Gb 以太网协议方面也发挥了重要作用,其成员包括 Broadcom、Cisco、Google 和 Microsoft。 +![](https://images.techhive.com/images/article/2017/05/170522-networking-2-100723415-large.jpg) -800Gb 以太网规范增加了新的媒体访问控制(MAC)和物理编码子层(PCS)方法,新规范对这些功能进行了调整,来使用 8 条 106.25Gbps 的物理通道分发数据。(通道可以是铜双绞线,也可以是光缆,一束光纤或光波。)800GBASE-R 规范建立在两个 400 GbE 2xClause PCS 之上,以创建一个以 800Gbps 的总速率运行的单个 MAC。 +由业界支持的以太网技术联盟Ethernet Technology Consortium(ETC)已宣布完成 800Gb 以太网技术规范。 + +新规范基于当前高端 400Gb 以太网协议中使用的许多技术,新规范正式称为 800GBASE-R。设计它的联盟(当时称为 25Gb 以太网联盟)在开发 25、50 和 100Gb 以太网协议方面也发挥了重要作用,其成员包括 博通、思科、谷歌和微软。 + +800Gb 以太网规范增加了新的介质访问控制media access control(MAC)和物理编码子层physical coding sublayer(PCS)方法,新规范对这些功能进行了调整,来使用 8 条 106.25Gbps 的物理通道分发数据。(通道可以是铜双绞线,也可以是光缆,一束光纤或光波。)800GBASE-R 规范建立在两个 400 GbE 2xClause PCS 之上,以创建一个以 800Gbps 的总速率运行的单个 MAC。 尽管主要是使用八条 106.25Gb 通道,但这并不是固定的。它可以以一半的速度 (53.125Gbps) 使用 16 条通道。 -新标准提供了 400G 以太网规范的一半延迟,但是新规范也将运行在 50 Gbps、100 Gbps 和 200 Gbps 的网络上的前向纠错(FEC)开销减少了一半,从而减少了网卡上的数据包处理负担。 +新标准提供了 400G 以太网规范的一半延迟,但是新规范也将运行在 50 Gbps、100 Gbps 和 200 Gbps 的网络上的前向纠错forward error correction(FEC)开销减少了一半,从而减少了网卡上的数据包处理负担。 通过降低延迟,这将满足对延迟敏感的应用(例如[高性能计算][2]和人工智能)中对速度的需求,在这些应用中,需要尽可能快地移动大量数据。 -[][3] +从 400G 增加到 800G 并不是太大的技术飞跃。它意味着在相同的传输速率下增加更多的通道,再做一些调整。但是,要想突破 Tb 级,Cisco 和其他网络公司已经讨论了十年了,这将需要对技术进行重大修改,而且并非易事。 -从 400G 增加到 800G 并不是技术上大的飞跃。这意味着要以相同的传输速率添加更多通道,并进行一些调整。但是,要想突破 Tb,Cisco 和其他网络公司已经讨论了十年了,这将需要对技术进行重大修改,而且并非易事。 +新技术可能也不便宜。800G 可与现有硬件一起使用,而 400Gb 以太网交换机价格不菲,高达六位数。对技术进行重大修改,越过 Tb 障碍,可能会变得更加昂贵。但是对于大客户和高性能计算客户而言,这也是情理之中的事。 -新技术可能也不便宜。800G 可与现有硬件一起使用,而 400Gb 以太网交换机价格不菲,高达六位数。对技术进行重大修改,越过 Tb 障碍,可能会变得更加昂贵。但是对于大客户和高性能计算客户而言,这是预料之中的。 - -ETC 并未透露何时会支持 800G 的新硬件,但鉴于其对现有规格的适度更改,它可能会在今年出现,前提是疫情引起的停滞不会影响它。 - -加入 [Facebook][4] 和 [LinkedIn][5] 上的 Network World 社区,评论热门主题。 +ETC 并未透露何时会支持 800G 的新硬件,但考虑到它对现有规格的变化不大,它可能会在今年出现,前提是疫情引起的停滞不会影响它。 -------------------------------------------------------------------------------- @@ -41,7 +39,7 @@ via: https://www.networkworld.com/article/3538529/ethernet-consortium-announces- 作者:[Andy Patrizio][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -50,4 +48,4 @@ via: https://www.networkworld.com/article/3538529/ethernet-consortium-announces- [2]: https://www.networkworld.com/article/3444399/high-performance-computing-do-you-need-it.html [3]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) [4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world \ No newline at end of file +[5]: https://www.linkedin.com/company/network-world From 8cca21d4ecf5daa1781cdc663f4bea979f35eed7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Apr 2020 16:15:54 +0800 Subject: [PATCH 0412/1809] PUB @geekpi https://linux.cn/article-12138-1.html --- ...Ethernet consortium announces completion of 800GbE spec.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20200418 Ethernet consortium announces completion of 800GbE spec.md (98%) diff --git a/translated/news/20200418 Ethernet consortium announces completion of 800GbE spec.md b/published/20200418 Ethernet consortium announces completion of 800GbE spec.md similarity index 98% rename from translated/news/20200418 Ethernet consortium announces completion of 800GbE spec.md rename to published/20200418 Ethernet consortium announces completion of 800GbE spec.md index d97f52e94b..c909b1fb0e 100644 --- a/translated/news/20200418 Ethernet consortium announces completion of 800GbE spec.md +++ b/published/20200418 Ethernet consortium announces completion of 800GbE spec.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12138-1.html) [#]: subject: (Ethernet consortium announces completion of 800GbE spec) [#]: via: (https://www.networkworld.com/article/3538529/ethernet-consortium-announces-completion-of-800gbe-spec.html) [#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) From d3b203461730a97dbda8314d10a52926d4ea9484 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Apr 2020 21:02:01 +0800 Subject: [PATCH 0413/1809] APL --- sources/tech/20190712 What is Silverblue.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190712 What is Silverblue.md b/sources/tech/20190712 What is Silverblue.md index c23a45b9f8..0cb2914f00 100644 --- a/sources/tech/20190712 What is Silverblue.md +++ b/sources/tech/20190712 What is Silverblue.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 25a39d7934b87680798cc699719fb937bdc1d2f8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Apr 2020 23:04:18 +0800 Subject: [PATCH 0414/1809] TSL --- sources/tech/20190712 What is Silverblue.md | 98 ------------------- .../tech/20190712 What is Silverblue.md | 98 +++++++++++++++++++ 2 files changed, 98 insertions(+), 98 deletions(-) delete mode 100644 sources/tech/20190712 What is Silverblue.md create mode 100644 translated/tech/20190712 What is Silverblue.md diff --git a/sources/tech/20190712 What is Silverblue.md b/sources/tech/20190712 What is Silverblue.md deleted file mode 100644 index 0cb2914f00..0000000000 --- a/sources/tech/20190712 What is Silverblue.md +++ /dev/null @@ -1,98 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What is Silverblue?) -[#]: via: (https://fedoramagazine.org/what-is-silverblue/) -[#]: author: (Tomáš Popela https://fedoramagazine.org/author/tpopela/) - -What is Silverblue? -====== - -![][1] - -Fedora Silverblue is becoming more and more popular inside and outside the Fedora world. So based on feedback from the community, here are answers to some interesting questions about the project. If you do have any other Silverblue related questions, please leave it in the comments section and we will try to answer them in a future article. - -### What is Silverblue? - -Silverblue is a codename for the new generation of the desktop operating system, previously known as Atomic Workstation. The operating system is delivered in images that are created by utilizing the _[rpm-ostree][2]_ [project][2]. The main benefits of the system are speed, security, atomic updates and immutability. - -### What does “Silverblue” actually mean? - -“Team Silverblue” or “Silverblue” in short doesn’t have any hidden meaning. It was chosen after roughly two months when the project, previously known as Atomic Workstation was rebranded. There were over 150 words or word combinations reviewed in the process. In the end _Silverblue_ was chosen because it had an available domain as well as the social network accounts. One could think of it as a new take on Fedora’s blue branding, and could be used in phrases like “Go, Team Silverblue!” or “Want to join the team and improve Silverblue?”. - -### What is ostree? - -[OSTree or libostree is a project][3] that combines a “git-like” model for committing and downloading bootable filesystem trees, together with a layer to deploy them and manage the bootloader configuration. OSTree is used by rpm-ostree, a hybrid package/image based system that Silverblue uses. It atomically replicates a base OS and allows the user to “layer” the traditional RPM on top of the base OS if needed. - -### Why use Silverblue? - -Because it allows you to concentrate on your work and not on the operating system you’re running. It’s more robust as the updates of the system are atomic. The only thing you need to do is to restart into the new image. Also, if there’s anything wrong with the currently booted image, you can easily reboot/rollback to the previous working one, if available. If it isn’t, you can download and boot any other image that was generated in the past, using the _ostree_ command. - -Another advantage is the possibility of an easy switch between branches (or, in an old context, Fedora releases). You can easily try the _[Rawhide][4]_ or _[updates-testing][5]_ branch and then return back to the one that contains the current stable release. Also, you should consider Silverblue if you want to try something new and unusual. - -### What are the benefits of an immutable OS? - -One of the main benefits is security. The base operating system is mounted as read-only, and thus cannot be modified by malicious software. The only way to alter the system is through the _rpm-ostree_ utility. - -Another benefit is robustness. It’s nearly impossible for a regular user to get the OS to the state when it doesn’t boot or doesn’t work properly after accidentally or unintentionally removing some system library. Try to think about these kind of experiences from your past, and imagine how Silverblue could help you there. - -### How does one manage applications and packages in Silverblue? - -For graphical user interface applications, [Flatpak][6] is recommended, if the application is available as a flatpak. Users can choose between Flatpaks from either Fedora and built from Fedora packages and in Fedora-owned infrastructure, or Flathub that currently has a wider offering. Users can install them easily through GNOME Software, which already supports Fedora Silverblue. - -One of the first things users find out is there is no _dnf_ preinstalled in the OS. The main reason is that it wouldn’t work on Silverblue — and part of its functionality was replaced by the _rpm-ostree_ command. Users can overlay the traditional packages by using the _rpm-ostree install PACKAGE_. But it should only be used when there is no other way. This is because when the new system images are pulled from the repository, the system image must be rebuilt every time it is altered to accommodate the layered packages, or packages that were removed from the base OS or replaced with a different version. - -Fedora Silverblue comes with the default set of GUI applications that are part of the base OS. The team is working on porting them to Flatpaks so they can be distributed that way. As a benefit, the base OS will become smaller and easier to maintain and test, and users can modify their default installation more easily. If you want to look at how it’s done or help, take a look at the official [documentation][7]. - -### What is Toolbox? - -[_Toolbox_][8] is a project to make containers easily consumable for regular users. It does that by using _podman_’s rootless containers. _Toolbox_ lets you easily and quickly create a container with a regular Fedora installation that you can play with or develop on, separated from your OS. - -### Is there any Silverblue roadmap? - -Formally there isn’t any, as we’re focusing on problems we discover during our testing and from community feedback. We’re currently using Fedora’s [Taiga][9] to do our planning. - -### What’s the release life cycle of the Silverblue? - -It’s the same as regular Fedora Workstation. A new release comes every 6 months and is supported for 13 months. The team plans to release updates for the OS bi-weekly (or longer) instead of daily as they currently do. That way the updates can be more thoroughly tested by QA and community volunteers before they are sent to the rest of the users. - -### What is the future of the immutable OS? - -From our point of view the future of the desktop involves the immutable OS. It’s safest for the user, and Android, ChromeOS, and the last macOS Catalina all use this method under the hood. For the Linux desktop there are still problems with some third party software that expects to write to the OS. HP printer drivers are a good example. - -Another issue is how parts of the system are distributed and installed. Fonts are a good example. Currently in Fedora they’re distributed in RPM packages. If you want to use them, you have to overlay them and then restart to the newly created image that contains them. - -### What is the future of standard Workstation? - -There is a possibility that the Silverblue will replace the regular Workstation. But there’s still a long way to go for Silverblue to provide the same functionality and user experience as the Workstation. In the meantime both desktop offerings will be delivered at the same time. - -### How does Atomic Workstation or Fedora CoreOS relate to any of this? - -Atomic Workstation was the name of the project before it was renamed to Fedora Silverblue. - -Fedora CoreOS is a different, but similar project. It shares some fundamental technologies with Silverblue, such as _rpm-ostree_, _toolbox_ and others. Nevertheless, CoreOS is a more minimal, container-focused and automatically updating OS. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/what-is-silverblue/ - -作者:[Tomáš Popela][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/tpopela/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/07/what-is-fedora-silverblue-816x345.jpg -[2]: https://rpm-ostree.readthedocs.io/en/latest/ -[3]: https://ostree.readthedocs.io/en/latest/ -[4]: https://fedoraproject.org/wiki/Releases/Rawhide -[5]: https://fedoraproject.org/wiki/QA:Updates_Testing -[6]: https://flatpak.org/ -[7]: https://docs.fedoraproject.org/en-US/flatpak/tutorial/ -[8]: https://github.com/debarshiray/toolbox -[9]: https://teams.fedoraproject.org/project/silverblue/ diff --git a/translated/tech/20190712 What is Silverblue.md b/translated/tech/20190712 What is Silverblue.md new file mode 100644 index 0000000000..afc855d820 --- /dev/null +++ b/translated/tech/20190712 What is Silverblue.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is Silverblue?) +[#]: via: (https://fedoramagazine.org/what-is-silverblue/) +[#]: author: (Tomáš Popela https://fedoramagazine.org/author/tpopela/) + +何谓 Silverblue? +====== + +![][1] + +Fedora Silverblue 在 Fedora 世界内外越来越受欢迎。因此,根据社区的反馈,以下是关于这个项目的一些有趣问题的答案。如果你有任何其他与 Silverblue 相关的问题,请在评论区留言,我们会在未来的文章中回答。 + +### 何谓 Silverblue? + +Silverblue 是新一代桌面操作系统的代号,之前被称为 Atomic Workstation。该操作系统是通过利用 [rpm-ostree 项目][2]创建的映像来交付的。这种系统的主要优点是速度、安全性、原子更新和不变性。 + +### “Silverblue”到底是什么意思? + +“Team Silverblue” 或简称 “Silverblue”,没有任何隐藏的含义。该项目以前被称为 Atomic Workstation,大约两个月后更名时选中了这个名字。在这个过程中,审查过 150 多个单词或单词组合。最终选择了 “Silverblue”,因为它有一个可用的域名以及社交网络账号。人们可以把它看成是 Fedora 的蓝色品牌的一个新的品牌形象,可以用在诸如“加油,Silverblue 团队!”或“想加入该团队,改进 Silverblue 吗?”这样的短语中。 + +### 何谓 ostree? + +[OSTree 或 libostree 是一个项目][3],它结合了一个类似 Git 的提交和下载可引导文件系统树的模型,以及用于部署它们和管理引导加载程序配置的层。OSTree 被 rpm-ostree 所使用,这是 Silverblue 使用的一个基于包/镜像的混合系统。它原子化地复制了一个基础操作系统,并允许用户在需要时在基础操作系统之上 "分层 "传统的 RPM。 + +### 为何使用 Silverblue? + +因为它可以让你专注于你的工作,而不是你正在运行的操作系统。因为系统的更新是原子式的,所以它更稳健。你唯一需要做的事情就是重新启动到新的镜像中。此外,如果当前启动的镜像有什么问题,你可以很容易地重启/回滚到之前可以工作的镜像,如果有的话。如果没有,你可以使用 `ostree` 命令下载并启动过去生成的任何其他镜像。 + +另一个好处是可以在不同的分支(或者用旧的语境说就是 Fedora 版本)之间轻松切换。你可以轻松地尝试 [Rawhide][4] 或 [updates-testing][5] 分支,然后返回到包含当前稳定版本的分支。另外,如果你想尝试一些新奇的东西,也可以考虑试试 Silverblue。 + +### 不可变的操作系统有什么好处? + +其中一个主要的好处是安全。基础操作系统是以只读的形式挂载的,因此不能被恶意软件修改。唯一可以改变系统的方法是通过 `rpm-ostree` 实用程序。 + +另一个好处是健壮性。普通用户几乎不可能在不小心或无意中删除了一些系统库后,让操作系统恢复到不启动或无法正常工作的状态。试着想想你过去的这些经历,就可以明白 Silverblue 如何帮助你。 + +### 如何在 Silverblue 中管理应用程序和包? + +对于图形化用户界面的应用程序,建议使用 [Flatpak][6],如果应用程序是以 Flatpak 的形式提供的话。用户可以选择来自 Fedora 的 Flatpak,和从 Fedora 包及 Fedora 自己的基础架构中构建的 Flatpak,或者目前有更广泛的交付的 Flathub。用户可以通过已经支持 Fedora Silverblue 的 GNOME “软件”轻松安装它们。 + +用户首先发现的一件事就是操作系统中没有预装 `dnf`。主要原因是它不能在 Silverblue 上工作 —— 它的部分功能被 `rpm-ostree` 命令所取代。用户可以通过使用 `rpm-ostree install PACKAGE` 来层叠传统的软件包。但只有在没有其他方法的情况下,才应该使用这种方式。这是因为从存储库中提取新的系统镜像时,每次更改系统镜像时都必须重新构建系统镜像,以容纳分层的包或从基础操作系统中删除或替换为其他版本的包。 + +Fedora Silverblue 自带的默认 GUI 应用程序集是基础操作系统的一部分。团队正在努力将它们移植到 Flatpak 上,这样它们就可以通过这种方式分发。其中一个好处是,基础操作系统将变得更小,更容易维护和测试,用户可以更容易修改他们的默认安装环境。如果你想看一下它是怎么做的,或者有什么帮助,可以看看官方的 [文档][7]。 + +### 什么是 Toolbox? + +[Toolbox][8] 是一个让普通用户可以轻松使用容器的项目。它通过使用 podman 的无 root 容器来实现。Toolbox 可以让你在常规的 Fedora 安装中轻松、快速地创建一个容器,你可以在这个容器上折腾或开发,而与你的操作系统分离。 + +### Silverblue 有路线图吗? + +形式上没有,因为我们正在关注在测试过程中发现的问题和社区的反馈。我们目前正在使用 Fedora 的 [Taiga][9] 来进行规划。 + +### Silverblue 的发布周期是多少? + +它和普通的 Fedora Workstation 是一样的。每 6 个月发布一次新版本,支持期为 13 个月。团队计划每两周(或更长时间)发布一次更新,而不是像现在这样每天发布一次。这样一来,更新可以在发送给其他用户之前,由 QA 和社区志愿者进行更彻底的测试。 + +### 不可变操作系统的未来前景如何? + +从我们的角度来看,桌面的未来涉及到了不可变的操作系统。这对用户来说是最安全的,Android、ChromeOS、ChromeOS、最近的 macOS Catalina 全都在底层采用了这种方式。而对于 Linux 桌面来说,一些第三方软件期望写到操作系统的问题还是存在的。HP 打印机驱动程序就是一个很好的例子。 + +另一个问题是系统中的部分软件如何分发和安装。字体就是一个很好的例子。目前在 Fedora 中,它们是以 RPM 包的形式分发的。如果你想使用它们,你必须层叠它们,然后重新启动到新创建的包含它们的镜像中。 + +### 标准版 Workstation 的前景如何? + +Silverblue 有可能会取代普通的Workstation版本。但 Silverblue 要提供与Workstation版本相同的功能和用户体验,还有很长的路要走。在此期间,这两款桌面产品将同时推出。 + +### Atomic Workstation或 Fedora CoreOS 与这些有什么关系? + +Atomic Workstation 是在更名为 Fedora Silverblue 之前的项目名称。 + +Fedora CoreOS 是一个不同但相似的项目。它与 Silverblue 共享一些基本技术,如 `rpm-ostree`、`toolbox` 等。尽管如此,CoreOS 是一个更简约、专注于容器、自动更新的操作系统。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/what-is-silverblue/ + +作者:[Tomáš Popela][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/tpopela/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/07/what-is-fedora-silverblue-816x345.jpg +[2]: https://rpm-ostree.readthedocs.io/en/latest/ +[3]: https://ostree.readthedocs.io/en/latest/ +[4]: https://fedoraproject.org/wiki/Releases/Rawhide +[5]: https://fedoraproject.org/wiki/QA:Updates_Testing +[6]: https://flatpak.org/ +[7]: https://docs.fedoraproject.org/en-US/flatpak/tutorial/ +[8]: https://github.com/debarshiray/toolbox +[9]: https://teams.fedoraproject.org/project/silverblue/ From cb5c005b09e2df578446dd47e3c24c86dd95237b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 23 Apr 2020 00:53:43 +0800 Subject: [PATCH 0415/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200423=20Diff?= =?UTF-8?q?erence=20Between=20YUM=20and=20RPM=20Package=20Manager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200423 Difference Between YUM and RPM Package Manager.md --- ...nce Between YUM and RPM Package Manager.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20200423 Difference Between YUM and RPM Package Manager.md diff --git a/sources/tech/20200423 Difference Between YUM and RPM Package Manager.md b/sources/tech/20200423 Difference Between YUM and RPM Package Manager.md new file mode 100644 index 0000000000..8b2a0c3b3b --- /dev/null +++ b/sources/tech/20200423 Difference Between YUM and RPM Package Manager.md @@ -0,0 +1,110 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Difference Between YUM and RPM Package Manager) +[#]: via: (https://www.2daygeek.com/comparison-difference-between-yum-vs-rpm/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Difference Between YUM and RPM Package Manager +====== + +Package managers play a key role in the Linux system. + +It allows you to install, update, view, search and delete software packages to suit your needs. + +Each of the distributions has their own set of package managers and use them based on your Linux distributions. + +RPM is one of the oldest traditional package managers, designed to work on Red Hat-based systems such as Red Hat Enterprise Linux (RHEL), CentOS, Fedora and openSUSE (which is based on suse Enterprise Linux). + +But when it comes to dependency resolution and package update (full system update/upgrade), there is an prominent limitation for RPM package manager. + +If you want to know the **[difference between yum and dnf package manager][1]** go to the following article. + +This means that yum can download and install all required dependencies automatically, but rpm will tell you to install a list of dependencies, and then you have to manually install them. + +This is practically impossible and time consuming when you want to install a group of packages using the **[rpm command][2]**. + +That’s where the **[YUM Package Manager][3]** comes in handy and solve both problems. + +### What’s RPM? + +RPM refers to RPM Package Manager (formerly known as Red Hat Package Manager) is a powerful, command-line package management tool developed for the Red Hat operating system. + +It is now used as a core component in many Linux distributions such as Centos, Fedora, Oracle Linux, openSUSE and Mageia. + +RPM Package Manager allows you to install, upgrade, delete, query and verify packages on RPM-based Linux systems. + +RPM files comes with the `.rpm` extension. The RPM package consists of an archive file, that contains libraries and dependencies for a specific package, that do not conflict with other packages installed on your system. + +There are many front-end tools available on Linux to install the RPM package that make the installation process more efficiently compared to the RPM tool, especially for handling dependencies. + +If you want to know more about the front-end package manager of Linux distributions, go to the link below. + + * **[List of Front-ent Command-line Package Manager for Linux][4]** + + + +If you would like GUI package manager for Linux, go to the link below. + + * **[List of GUI Package Manager for Linux][5]** + + + +### What’s YUM? + +Yum is a free and open-source command-line package-management application for Linux operating systems that uses the RPM Package Manager. + +Yum is a front-end tool for rpm that automatically solves dependencies for packages. + +It installs RPM software packages from distribution official repositories and other third-party repositories. + +Yum allows you to install, update, search and remove packages from your system. + +If you want to keep your system up-to-date, you can enable automatic updates via yum-cron. + +Also, it allows you to exclude a package or packages from the yum update if you need to. + +Yum is installed by default and you do not need to install it. + +S.No | RPM | YUM +---|---|--- +1 | Red Hat introduced RPM in 1997. | Yellowdog UPdater (YUP) was developed in 1999-2001 and YUM replaced the original YUP utility in 2003. +2 | RPM stands for RPM Package manager (formally known as Red Hat package manager) | YUM stands for Yellowdog Updater Modified. +3 | The RPM File Naming Convention is as follows. +httpd-2.4.6-92.el7.x86_64.rpm +httpd - Name of the actual package +2.4.6 - Version of package release +92 - Subversion of package release +el7 - Red Hat Version +x86_64 - Hardware architecture +rpm - File extension | It uses the rpm database in the backend. +4 | It doesn't resolve dependencies, you must install them manually. | It automatically resolves dependencies and install them simultaneously (any package will be installed with its dependencies). +5 | This allows you to install multiple versions of the package at once | This does not allow and shows that the package is already installed. +6 | When installing a package using the RPM command you must provide the exact location of the ".rpm" package. | You can install any package available in the repository, but you only need to know the package name. +7 | RPM is not dependent on YUM | It is a frontend tool that uses the RPM package manager on the backend to manage packages. +8 | It is difficult to manage RPM in terms of package installation | YUM is the easiest way to manage RPM packages. +9 | RPM doesn't allow you to upgrade the entire system to the latest available version | YUM allows you to upgrade your system to the latest available version (minor version upgrade, for example, 7.0 to 7.x) +10 | RPM doesn't allow you to automatically update/upgrade packages installed on your system | YUM allows you to automatically update/upgrade the updates available on your system. +11 | It doesn't use the online repository to perform any actions. | It relies entirely on the online repository to do all the work. +12 | RPM is a package format and it is a low-level package manager that does basic things. | This is a top-level front-end package manager that can do everything you need. + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/comparison-difference-between-yum-vs-rpm/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/ +[2]: https://www.2daygeek.com/linux-rpm-command-examples-manage-packages-fedora-centos-rhel-systems/ +[3]: https://www.2daygeek.com/linux-yum-command-examples-manage-packages-rhel-centos-systems/ +[4]: https://www.2daygeek.com/list-of-command-line-package-manager-for-linux/ +[5]: https://www.2daygeek.com/list-of-graphical-frontend-tool-for-linux-package-manager/ From 43a9bf2fb9bd4771f753508db03129932b3db4bb Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 23 Apr 2020 08:48:15 +0800 Subject: [PATCH 0416/1809] translating --- ...o package Python applications for Linux.md | 179 ------------------ ...o package Python applications for Linux.md | 177 +++++++++++++++++ 2 files changed, 177 insertions(+), 179 deletions(-) delete mode 100644 sources/tech/20200416 How to package Python applications for Linux.md create mode 100644 translated/tech/20200416 How to package Python applications for Linux.md diff --git a/sources/tech/20200416 How to package Python applications for Linux.md b/sources/tech/20200416 How to package Python applications for Linux.md deleted file mode 100644 index a765f4a536..0000000000 --- a/sources/tech/20200416 How to package Python applications for Linux.md +++ /dev/null @@ -1,179 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to package Python applications for Linux) -[#]: via: (https://opensource.com/article/20/4/package-python-applications-linux) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -How to package Python applications for Linux -====== -Learn how to use dh_virtualenv to make your Python applications -installable as .deb packages. -![Python in a tree][1] - -One way to make Python applications installable on Debian-based operating systems (such as Debian or [Elementary OS][2]) is by using the [dh_virtualenv][3] tool. It builds a **.deb** package that wraps a Python virtual environment around an application and deploys it upon installing. - -In this article, I will explain how to use it with the example of building a package containing the [HTTPie][4] tool to test HTTP APIs from the command line without having to activate a virtual environment. - -### Packaging with dh_virtualenv - -First, you need to install the tools that dh_virtualenv needs. dh_virtualenv's [documentation][5] provides all of the installation options. On my Debian-based system, I entered: - - -``` -`apt-get install dh-virtualenv devscripts` -``` - -While the [devscripts][6] package is not required, it will simplify doing the subsequent operations. - -Now, create a directory to keep the sources. Since this is a local, unofficial, packaging of HTTPie, I called it **myhttp**. Next, let's create some files inside **myhttp** to provide metadata to the Debian build system. - -First, create the **debian/control** file: - - -``` -Source: myhttp -Section: python -Priority: extra -Maintainer: Jan Doe <[jandoe@example.org][7]> -Build-Depends: debhelper (>= 9), python3.7, dh-virtualenv (>= 0.8) -Standards-Version: 3.9.5 - -Package: myhttp -Architecture: any -Pre-Depends: dpkg (>= 1.16.1), python3.7, ${misc:Pre-Depends} -Depends: ${misc:Depends} -Description: http client - Useful for doing stuff -``` - -So what is all this information about? As the [Debian documentation][8] puts it: - -> "Lines 1–7 are the control information for the source package. Lines 9–13 are the control information for the binary package." - -Here's my take: - - * the **section** value is mostly meaningless for our case, but needs to be there. It's meaningful to provide information to the guided UI installer, which is not relevant for this package. - * The extra **Priority** value is the right priority for 3rd party packages like this one. - * It is highly recommended to put real contact details in the **Maintainer** field. It does not have to be your personal e-mail, though -- "Infrastructure Team <[infra-team-list@company.example.com][9]>", for example, if the package is maintained by the team and you would like issues to be sent to the team's mail alias. - * The **build-depends** field indicates that you need debhelper, python, and dh-virtualenv to build the package: the package build process will make sure those dependencies are installed at package build time. - * The **standards version** is mostly for human consumption. It indicates which guide you are following. This guide is based on the official documentation of dh-virtualenv, which is based on the 3.9.5 guide from Debian. It is almost always the best choice to name the binary package and the source package the same. - * The **Architecture** field should be **Any** because a virtual environment might include some architecture-specific files: otherwise, the field would be better chosen as **all**. - * Keep the **pre-depends** list as-is: pre-depends is a pretty strict form of dependencies, and it is rare that you need anything more than the minimum suggested here. The dependencies are usually calculated accurately by the build system, so there is no reason to specify them manually. - * If your package is mostly for internal use, then the **Description** might only specify minimal information and a link to the company wiki; otherwise, more details might be useful. - - - -Then create the **debian/compat** file, which [exists mostly for historical purposes][10]: - - -``` -`$ echo "9" > debian/compat` -``` - -Next, create the changelog to tell package users what has changed since the last release. The easiest way is to use **dch --create** to create a template and then fill in the values. - -Filled in, it looks like: - - -``` -myhttp (2.0.0-1) stable; urgency=medium - -  * Initial release. - - -- Jan Doe <[jandoe@example.org][7]>  Fri, 27 Mar 2020 01:09:22 +0000 -``` - -Now you need to tell the tool to install HTTPie, but which version? - -Create a **requirements.in** file that has loose versions: - - -``` -`httpie` -``` - -In general, the loose requirements file will only contain direct dependencies of your project and will specify minimum versions if needed. It is not always necessary to specify the minimum versions: the tools are usually biased towards tightening the dependencies towards "latest version possible". In the case where your Debian package corresponds to one internal Python package, a common case in internal applications, the loose requirements file will look similar: just one line with the name of the package. - -Then use **pip-compile** (which is available by installing the PyPI package **pip-tools**): - - -``` -`$ pip-compile requirements.in > requirements.txt` -``` - -This will produce a strict dependency file called **requirements.txt**: - - -``` -# -# This file is autogenerated by pip-compile -# To update, run: -# -#    pip-compile requirements.in -# -certifi==2019.11.28       # via requests -chardet==3.0.4            # via requests -httpie==2.0.0             # via -r requirements.in -idna==2.9                 # via requests -pygments==2.6.1           # via httpie -requests==2.23.0          # via httpie -urllib3==1.25.8           # via requests -``` - -Finally, write a **debian/rules** file for creating the package. Since dh_virtualenv does all the hard work, the rules file is simple: - - -``` -#!/usr/bin/make -f - -%: -        dh $@ --with python-virtualenv --python /usr/bin/python3.7 -``` - -Be sure to specify the Python interpreter. By default, it will use the interpreter in **/usr/bin/python**, which is Python 2, but you should use a [supported version of Python][11]. - -The writing is finished; all that's left is to build the package: - - -``` -`$ debuild -b -us -uc` -``` - -This will produce a file in the parent directory with a name like **myhttp_2.0.0-1_amd64.deb**. This file can be installed on any compatible operating system. - -In general, it's best to build Debian packages that are intended for a specific platform, such as Debian 10.0, on the same platform. - -You can store this Debian package in a repository and install it on all relevant systems with, for example, [Ansible][12]. - -### Conclusion - -Packaging applications for Debian-based operating systems is a multi-step process. Using dh_virtualenv will make the process straightforward. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/package-python-applications-linux - -作者:[Moshe Zadka][a] -选题:[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/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-python.jpg?itok=F2PYP2wT (Python in a tree) -[2]: https://opensource.com/article/19/12/pantheon-linux-desktop -[3]: https://dh-virtualenv.readthedocs.io/en/latest/ -[4]: https://opensource.com/article/19/8/getting-started-httpie -[5]: https://dh-virtualenv.readthedocs.io/en/1.1/tutorial.html -[6]: http://man.he.net/man1/devscripts -[7]: mailto:jandoe@example.org -[8]: https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#control -[9]: mailto:infra-team-list@company.example.com -[10]: https://www.debian.org/doc/manuals/maint-guide/dother.en.html#compat -[11]: https://opensource.com/article/19/11/end-of-life-python-2 -[12]: https://opensource.com/resources/what-ansible diff --git a/translated/tech/20200416 How to package Python applications for Linux.md b/translated/tech/20200416 How to package Python applications for Linux.md new file mode 100644 index 0000000000..a44918f7cd --- /dev/null +++ b/translated/tech/20200416 How to package Python applications for Linux.md @@ -0,0 +1,177 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to package Python applications for Linux) +[#]: via: (https://opensource.com/article/20/4/package-python-applications-linux) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +如何为 Linux 打包 Python 应用 +====== +了解如何使用 dh_virtualenv 来让你的 Python 应用可作为 .deb 包安装。 +![Python in a tree][1] + +一种让 Python 应用可在基于 Debian 的操作系统(例如 Debian 或 [Elementary OS][2])上安装的方法是使用 [dh_virtualenv][3] 工具。它会构建一个封装了 Python 虚拟环境的 **.deb** 包,并在安装时进行部署。 + +在本文中,我将以构建包含 [HTTPie][4] 工具的包为例,说明如何无需激活虚拟环境即可从命令行测试 HTTP API。 + +### 使用 dh_virtualenv 打包 + +首先,你需要安装 dh_virtualenv 所需的工具。dh_virtualenv 的[文档][5]提供了所有安装选项。在基于 Debian 的系统上,我输入: + +``` +`apt-get install dh-virtualenv devscripts` +``` + +尽管不需要 [devscripts][6] 包,但它将简化后续操作。 + +现在,创建一个目录来保存源码。由于这是 HTTPie 的本地非官方打包,因此我将其称为 **myhttp**。 接下来,让我们在 **myhttp** 内创建一些文件以向 Debian 构建系统提供元数据。 + +首先,创建 **debian/control** 文件: + + +``` +Source: myhttp +Section: python +Priority: extra +Maintainer: Jan Doe <[jandoe@example.org][7]> +Build-Depends: debhelper (>= 9), python3.7, dh-virtualenv (>= 0.8) +Standards-Version: 3.9.5 + +Package: myhttp +Architecture: any +Pre-Depends: dpkg (>= 1.16.1), python3.7, ${misc:Pre-Depends} +Depends: ${misc:Depends} +Description: http client + Useful for doing stuff +``` + +那么这些是什么信息呢? [Debian 文档][8]指出: + +>“第 1–7 行是源码包的控制信息。第 9–13 行是二进制包的控制信息。” + +以下是我使用的: + + * **section** 的值对于我们来说大多没有意义,但需要存在。它对提供 UI 安装程序信息是有意义的,这与此包无关。 + * 额外的 **Priority** 值是像这样的第三方包的正确优先级。 + * 强烈建议在 **Maintainer** 字段中填写正确的联系人信息。但是,如果包由团队维护,并且你希望将问题发送到团队的邮件别名,例如 “Infrastructure Team <[infra-team-list@company.example.com][9]>”,那这不一定是你的个人邮箱。 + * **build-depends** 字段标识你需要 debhelper、python 和 dh-virtualenv 来构建包:包生成过程将确保这些依赖项在包构建时安装。 + * **standards version** 字段主要给人看。它表明你遵循的指南。本指南基于 dh-virtualenv 的官方文档,它是基于 Debian 的 3.9.5 指南。最好一直将源码包和二进制包命名相同。 + * **Architecture** 字段应为 **Any**,因为除非虚拟环境可能包含一些特定于体系结构的文件。否则,最好选择该字段为 **any**。 + * 保持 Pre-Depends 列表为当前的样式:预依赖是一种非常严格的依赖关系形式,你很少会需要比建议的最小依赖更多的依赖项。依赖项通常由构建系统准确计算,因此没有理由手动指定它们。 + * 如果你的包主要用于内部,那么 **Description** 字段只需要最少的信息或者指向公司 wiki 的链接,不然详细信息更有用。 + + + +然后创建 **debian/compat** 文件,它[主要出于历史目的而存在][10]: + + +``` +`$ echo "9" > debian/compat` +``` + +接下来,创建更新日志以告知包用户自上一发行版以来发生了什么变化。最简单的方法是使用 **dch --create** 创建模板,然后填写值。 + +填写后,它看起来像: + + +``` +myhttp (2.0.0-1) stable; urgency=medium + +  * Initial release. + + -- Jan Doe <[jandoe@example.org][7]>  Fri, 27 Mar 2020 01:09:22 +0000 +``` + +现在你需要告诉工具安装 HTTPie,但是哪个版本? + +创建一个宽松版本的 **requirements.in** 文件: + + +``` +`httpie` +``` + +通常,宽松的需求文件将仅包含项目的直接依赖项,并在需要时指定最低版本。 不一定总是需要指定最低版本:这些工具通常偏向于将依赖关系转化为“可能的最新版本”。如果你的 Debian 包与一个内部 Python 包相对应,这是内部应用中的一种常见情况,那么宽松的需求文件看起来将很相似:仅包含包名的一行。 + +然后使用 **pip-compile**(可通过安装 PyPI 包 **pip-tools** 获得): + + +``` +`$ pip-compile requirements.in > requirements.txt` +``` + +这会生成一个严格的依赖文件,名为 **requirements.txt**: + + +``` +# +# This file is autogenerated by pip-compile +# To update, run: +# +#    pip-compile requirements.in +# +certifi==2019.11.28       # via requests +chardet==3.0.4            # via requests +httpie==2.0.0             # via -r requirements.in +idna==2.9                 # via requests +pygments==2.6.1           # via httpie +requests==2.23.0          # via httpie +urllib3==1.25.8           # via requests +``` + +最后,写一个 **debian/rules** 文件来创建包。因为 dh_virtualenv 会处理所有困难的事,因此规则文件很简单: + + +``` +#!/usr/bin/make -f + +%: +        dh $@ --with python-virtualenv --python /usr/bin/python3.7 +``` + +确保指定 Python 解释器。默认它会使用 **/usr/bin/python**,这是 Python2,但是你应该使用一个[受支持的 Python 版本][11] + +完成了,接下来就是构建包: + + +``` +`$ debuild -b -us -uc` +``` + +这会在父目录生成一个类似 **myhttp_2.0.0-1_amd64.deb** 的文件。该文件可在任何兼容的系统上安装。 + +通常,最好在同一平台上构建用于特定平台(例如 Debian 10.0)的 Debian 包。 + +你可以将此 Debian 包保存在存仓库中,并使用例如 [Ansible][12] 的工具将其安装在所有相关系统上。 + +### 总结 + +给基于 Debian 的系统的打包应用是一个有多个步骤的过程。使用 dh_virtualenv 将使过程变得简单。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/package-python-applications-linux + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-python.jpg?itok=F2PYP2wT (Python in a tree) +[2]: https://opensource.com/article/19/12/pantheon-linux-desktop +[3]: https://dh-virtualenv.readthedocs.io/en/latest/ +[4]: https://opensource.com/article/19/8/getting-started-httpie +[5]: https://dh-virtualenv.readthedocs.io/en/1.1/tutorial.html +[6]: http://man.he.net/man1/devscripts +[7]: mailto:jandoe@example.org +[8]: https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#control +[9]: mailto:infra-team-list@company.example.com +[10]: https://www.debian.org/doc/manuals/maint-guide/dother.en.html#compat +[11]: https://opensource.com/article/19/11/end-of-life-python-2 +[12]: https://opensource.com/resources/what-ansible From b2e9e40b782dcfe6d188b07be3acbc52df12df2f Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 23 Apr 2020 08:52:35 +0800 Subject: [PATCH 0417/1809] translating --- ...IP Addresses, MAC Addresses, and Interface Speed on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md b/sources/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md index ca7e8fe2aa..a16a007124 100644 --- a/sources/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md +++ b/sources/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8bd8f9d08e788ed8252a6c5a5687775e935d8b94 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Apr 2020 09:49:51 +0800 Subject: [PATCH 0418/1809] PRF @wxy --- ...te web tutorials with Reveal.js and Git.md | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/translated/tech/20200408 Create web tutorials with Reveal.js and Git.md b/translated/tech/20200408 Create web tutorials with Reveal.js and Git.md index 5466f55d81..f5ad4bf06b 100644 --- a/translated/tech/20200408 Create web tutorials with Reveal.js and Git.md +++ b/translated/tech/20200408 Create web tutorials with Reveal.js and Git.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Create web tutorials with Reveal.js and Git) @@ -10,9 +10,9 @@ 使用 Reveal.js 和 Git 创建网页教程 ====== -> 通过这个简单的工作流程创建的研讨会幻灯片,可以在任何浏览器、设备和平台上一致地查看。 +> 通过这个简单的工作流程创建的研讨会幻灯片,可以在任何浏览器、设备和平台上获得一致的查看效果。 -![Person reading a book and digital copy][1] +![](https://img.linux.net.cn/data/attachment/album/202004/23/094800ohkpbjd3zbj0dj0d.jpg) 无论你是学习者还是教师,你可能都会认识到采用幻灯片放映来传播知识的在线研讨会workshop的价值。如果你曾经偶然看到过这样一个逐页、逐章设置的井井有条的教程,你可能会想知道创建这样的一个网站有多难。 @@ -20,9 +20,9 @@ ### 介绍 -当我开始将学习内容放到网上置时,体验并不是很好。我想要的是一种可重复的、一致的、易于维护的东西,因为我的内容会随着我的教学技术而进步。 +当我开始将学习内容放到网上置时,体验并不是很好。我想要的是一种可重复的、一致的、易于维护的东西,因为我的内容会随着我教学的技术发展而变化。 -我尝试了许多交付模型,从 [Asciidoctor][2] 这样的低级代码生成器到在单个 PDF 文件中放置教程。全都不能让我满意。当我举办现场的在座研讨会时,我喜欢使用幻灯片放映,因此我想知道我是否可以为自己的在线的,自定进度的研讨会体验做同样的事情。 +我尝试了许多交付模型,从 [Asciidoctor][2] 这样的低级代码生成器到在单个 PDF 文件中放置教程。全都不能让我满意。当我举办现场的在座研讨会时,我喜欢使用幻灯片放映,因此我想知道我是否可以为我自己的在线的,自定进度的研讨会体验做同样的事情。 经过一番挖掘,我为创建无痛的研讨会网站打下了基础。当时我已经在使用一个演示文稿生成框架,这对我来说是很有帮助的,因为这个框架可以产生对网站友好的格式(HTML)。 @@ -33,13 +33,13 @@ * 研讨会的想法(这是你的问题,我帮不了你) * 用于研讨会幻灯片的 Reveal.js * GitLab 项目仓库 - * 你最喜欢的 HTML 代码编辑器 + * 你常用的 HTML 代码编辑器 * Web 浏览器 * 在你的机器上安装好 Git 如果这个列表看起来令人望而生畏,那么有一个快速入门的方法,不需要把所有的东西一个个都拉到一起。你可以用我的模板项目来给你提供幻灯片和项目设置的入门教程。 -本文假设你熟悉 Git 和托管在 Git 平台(如 GitLab)上的项目。如果你需要指导或教程,请查看我们的[Git 入门系列][3]。 +本文假设你熟悉 Git 和在 Git 平台(如 GitLab)上托管项目。如果你需要指导或教程,请查看我们的[Git 入门系列][3]。 首先,将模板项目克隆到本地机器上。 @@ -49,7 +49,7 @@ $ git clone https://gitlab.com/eschabell/beginners-guide-automated-workshops.git 为此设置一个新的 GitLab 项目,导入模板项目作为初始导入。 -研讨会网站有一些重要的文件。在**根目录**下,你会发现一个名为 `.gitlab-ci.yml` 的文件,当你向主分支提交修改时(即合并拉取请求到 `master` 分支),这个文件会作为触发器。它可以触发将 `slides` 目录的全部内容复制到 GitLab 项目的 `website` 文件夹中。 +研讨会网站有一些重要的文件。在**根目录**下,你会发现一个名为 `.gitlab-ci.yml` 的文件,当你向主分支提交修改时(即将拉取请求合并到 `master` 分支),这个文件会作为触发器。它可以触发将 `slides` 目录的全部内容复制到 GitLab 项目的 `website` 文件夹中。 我把它托管在我的 GitLab 账户中,名为 `beginners-guide-automated-workshops`。当它部署完毕后,你可以在浏览器中通过导航到下列地址查看 `slides` 目录的内容: @@ -79,7 +79,7 @@ https://[YOUR_USERNAME].gitlab.io/[YOUR_PROJECT_NAME] * `images` 目录 * `index.html`文件 -在你喜欢的 HTML/CSS 编辑器中打开每一个文件,然后进行下面描述的修改。你用哪个编辑器并不重要,我更喜欢 [RubyMine IDE][5],因为它能在本地浏览器中提供页面预览。这对我在将内容推送到研讨会网站之前测试内容时很有帮助。 +在你常用的 HTML/CSS 编辑器中打开每一个文件,然后进行下面描述的修改。你用哪个编辑器并不重要,我更喜欢 [RubyMine IDE][5],因为它能在本地浏览器中提供页面预览。这对我在将内容推送到研讨会网站之前测试内容时很有帮助。 #### default.css 文件 @@ -91,7 +91,7 @@ https://[YOUR_USERNAME].gitlab.io/[YOUR_PROJECT_NAME] font-family: "Red Hat Display", "Overpass", san-serif; ``` -如果你使用的是非标准字体类型,则必须在以下行中将其导入(与 Overpass 字体类型相同): +如果你使用的是非标准字体类型,则必须在以下行中将其导入(Overpass 字体类型就是这样做的): ``` @import url('SOME_URL'); @@ -105,7 +105,7 @@ background: url("…/…/images/backgrounds/basic.png") 要设置一个默认背景,只需将这一行指向你要使用的图片。 -#### images 目录 +#### images 目录 顾名思义,`images` 目录是用来存储你想在研讨会幻灯片上使用的图片。例如,我通常会把展示研讨会主题进展的截图放在我的个人幻灯片上。 @@ -131,7 +131,6 @@ background: url("…/…/images/backgrounds/basic.png") 现在继续到 `body` 部分。你会注意到它被分成了许多 `section` 标签。`body` 的开头包含了一个注释,说明你正在为每个标有 `section` 的打开和关闭的标签创建幻灯片。 - ```
@@ -156,9 +155,9 @@ background: url("…/…/images/backgrounds/basic.png") ``` -这张幻灯片有两个区域,用 `div` 标签划分。用空格隔开了标题和作者。 +这张幻灯片有两个区域,用 `div` 标签分隔。用空格隔开了标题和作者。 -如果你有一定的 HTML 使用知识,可以尝试各种东西来开发你的研讨会。你使用浏览器预览结果的时候真的很方便。有些 IDE 提供了本地查看修改,但你也可以打开 `index.html` 文件查看你的修改,然后再推送到资源库中。 +如果你有一定的 HTML 使用知识,可以尝试各种东西来开发你的研讨会。使用浏览器预览结果的时候真的很方便。有些 IDE 提供了本地查看修改,但你也可以打开 `index.html` 文件查看你的修改,然后再推送到资源库中。 一旦你对你的研讨会感到满意,推送你的修改,然后等待它们通过持续集成管道。它们将像模板项目一样被托管在 。 @@ -166,7 +165,7 @@ background: url("…/…/images/backgrounds/basic.png") 要了解更多关于这个工作流程可以做什么,请查看下面的示例研讨会和托管了研讨会集合的网站。所有这些都是基于本文中描述的工作流程。 -研讨会的例子: +研讨会例子: * [Red Hat Process Automation Manage workshop][6] * [JBoss Travel Agency BPM Suite online workshop][7] @@ -177,7 +176,7 @@ background: url("…/…/images/backgrounds/basic.png") * [Application development in the cloud workshop][9] * [Portfolio architecture: Workshops for creating impactful architectural diagrams][10] -我希望这本新手指南和模板研讨会项目能让你看到,在开发和维护工作室网站的过程中,可以轻松、无痛地完成。我也希望这个工作流程能让你的研讨会受众几乎在任何设备上都能完全访问你的内容,这样他们就能从你分享的知识中学习到你的知识。 +我希望这本新手指南和模板研讨会项目能让你看到,在开发和维护研讨会网站的过程中,可以轻松、无痛地完成。我也希望这个工作流程能让你的研讨会受众几乎在任何设备上都能完全访问你的内容,这样他们就能从你分享的知识中学习到你的知识。 -------------------------------------------------------------------------------- @@ -186,7 +185,7 @@ via: https://opensource.com/article/20/4/create-web-tutorial-git 作者:[Eric D. Schabell][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 33649a710666f0fe066a14da68feadf998f45e9c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Apr 2020 09:50:57 +0800 Subject: [PATCH 0419/1809] PUB @wxy https://linux.cn/article-12139-1.html --- .../20200408 Create web tutorials with Reveal.js and Git.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200408 Create web tutorials with Reveal.js and Git.md (99%) diff --git a/translated/tech/20200408 Create web tutorials with Reveal.js and Git.md b/published/20200408 Create web tutorials with Reveal.js and Git.md similarity index 99% rename from translated/tech/20200408 Create web tutorials with Reveal.js and Git.md rename to published/20200408 Create web tutorials with Reveal.js and Git.md index f5ad4bf06b..8d549aceaf 100644 --- a/translated/tech/20200408 Create web tutorials with Reveal.js and Git.md +++ b/published/20200408 Create web tutorials with Reveal.js and Git.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12139-1.html) [#]: subject: (Create web tutorials with Reveal.js and Git) [#]: via: (https://opensource.com/article/20/4/create-web-tutorial-git) [#]: author: (Eric D. Schabell https://opensource.com/users/eschabell) From 923725556c3fc4dfac376a360071e70b5a424e62 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Apr 2020 12:06:36 +0800 Subject: [PATCH 0420/1809] APL --- .../20200423 Difference Between YUM and RPM Package Manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200423 Difference Between YUM and RPM Package Manager.md b/sources/tech/20200423 Difference Between YUM and RPM Package Manager.md index 8b2a0c3b3b..3afb4f3d9b 100644 --- a/sources/tech/20200423 Difference Between YUM and RPM Package Manager.md +++ b/sources/tech/20200423 Difference Between YUM and RPM Package Manager.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2a11ad1751cba0985b70742b6e1d158eff86a2df Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Apr 2020 12:57:35 +0800 Subject: [PATCH 0421/1809] TSL --- ...nce Between YUM and RPM Package Manager.md | 110 ------------------ ...nce Between YUM and RPM Package Manager.md | 89 ++++++++++++++ 2 files changed, 89 insertions(+), 110 deletions(-) delete mode 100644 sources/tech/20200423 Difference Between YUM and RPM Package Manager.md create mode 100644 translated/tech/20200423 Difference Between YUM and RPM Package Manager.md diff --git a/sources/tech/20200423 Difference Between YUM and RPM Package Manager.md b/sources/tech/20200423 Difference Between YUM and RPM Package Manager.md deleted file mode 100644 index 3afb4f3d9b..0000000000 --- a/sources/tech/20200423 Difference Between YUM and RPM Package Manager.md +++ /dev/null @@ -1,110 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Difference Between YUM and RPM Package Manager) -[#]: via: (https://www.2daygeek.com/comparison-difference-between-yum-vs-rpm/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -Difference Between YUM and RPM Package Manager -====== - -Package managers play a key role in the Linux system. - -It allows you to install, update, view, search and delete software packages to suit your needs. - -Each of the distributions has their own set of package managers and use them based on your Linux distributions. - -RPM is one of the oldest traditional package managers, designed to work on Red Hat-based systems such as Red Hat Enterprise Linux (RHEL), CentOS, Fedora and openSUSE (which is based on suse Enterprise Linux). - -But when it comes to dependency resolution and package update (full system update/upgrade), there is an prominent limitation for RPM package manager. - -If you want to know the **[difference between yum and dnf package manager][1]** go to the following article. - -This means that yum can download and install all required dependencies automatically, but rpm will tell you to install a list of dependencies, and then you have to manually install them. - -This is practically impossible and time consuming when you want to install a group of packages using the **[rpm command][2]**. - -That’s where the **[YUM Package Manager][3]** comes in handy and solve both problems. - -### What’s RPM? - -RPM refers to RPM Package Manager (formerly known as Red Hat Package Manager) is a powerful, command-line package management tool developed for the Red Hat operating system. - -It is now used as a core component in many Linux distributions such as Centos, Fedora, Oracle Linux, openSUSE and Mageia. - -RPM Package Manager allows you to install, upgrade, delete, query and verify packages on RPM-based Linux systems. - -RPM files comes with the `.rpm` extension. The RPM package consists of an archive file, that contains libraries and dependencies for a specific package, that do not conflict with other packages installed on your system. - -There are many front-end tools available on Linux to install the RPM package that make the installation process more efficiently compared to the RPM tool, especially for handling dependencies. - -If you want to know more about the front-end package manager of Linux distributions, go to the link below. - - * **[List of Front-ent Command-line Package Manager for Linux][4]** - - - -If you would like GUI package manager for Linux, go to the link below. - - * **[List of GUI Package Manager for Linux][5]** - - - -### What’s YUM? - -Yum is a free and open-source command-line package-management application for Linux operating systems that uses the RPM Package Manager. - -Yum is a front-end tool for rpm that automatically solves dependencies for packages. - -It installs RPM software packages from distribution official repositories and other third-party repositories. - -Yum allows you to install, update, search and remove packages from your system. - -If you want to keep your system up-to-date, you can enable automatic updates via yum-cron. - -Also, it allows you to exclude a package or packages from the yum update if you need to. - -Yum is installed by default and you do not need to install it. - -S.No | RPM | YUM ----|---|--- -1 | Red Hat introduced RPM in 1997. | Yellowdog UPdater (YUP) was developed in 1999-2001 and YUM replaced the original YUP utility in 2003. -2 | RPM stands for RPM Package manager (formally known as Red Hat package manager) | YUM stands for Yellowdog Updater Modified. -3 | The RPM File Naming Convention is as follows. -httpd-2.4.6-92.el7.x86_64.rpm -httpd - Name of the actual package -2.4.6 - Version of package release -92 - Subversion of package release -el7 - Red Hat Version -x86_64 - Hardware architecture -rpm - File extension | It uses the rpm database in the backend. -4 | It doesn't resolve dependencies, you must install them manually. | It automatically resolves dependencies and install them simultaneously (any package will be installed with its dependencies). -5 | This allows you to install multiple versions of the package at once | This does not allow and shows that the package is already installed. -6 | When installing a package using the RPM command you must provide the exact location of the ".rpm" package. | You can install any package available in the repository, but you only need to know the package name. -7 | RPM is not dependent on YUM | It is a frontend tool that uses the RPM package manager on the backend to manage packages. -8 | It is difficult to manage RPM in terms of package installation | YUM is the easiest way to manage RPM packages. -9 | RPM doesn't allow you to upgrade the entire system to the latest available version | YUM allows you to upgrade your system to the latest available version (minor version upgrade, for example, 7.0 to 7.x) -10 | RPM doesn't allow you to automatically update/upgrade packages installed on your system | YUM allows you to automatically update/upgrade the updates available on your system. -11 | It doesn't use the online repository to perform any actions. | It relies entirely on the online repository to do all the work. -12 | RPM is a package format and it is a low-level package manager that does basic things. | This is a top-level front-end package manager that can do everything you need. - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/comparison-difference-between-yum-vs-rpm/ - -作者:[Magesh Maruthamuthu][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.2daygeek.com/author/magesh/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/ -[2]: https://www.2daygeek.com/linux-rpm-command-examples-manage-packages-fedora-centos-rhel-systems/ -[3]: https://www.2daygeek.com/linux-yum-command-examples-manage-packages-rhel-centos-systems/ -[4]: https://www.2daygeek.com/list-of-command-line-package-manager-for-linux/ -[5]: https://www.2daygeek.com/list-of-graphical-frontend-tool-for-linux-package-manager/ diff --git a/translated/tech/20200423 Difference Between YUM and RPM Package Manager.md b/translated/tech/20200423 Difference Between YUM and RPM Package Manager.md new file mode 100644 index 0000000000..c0bf8b7352 --- /dev/null +++ b/translated/tech/20200423 Difference Between YUM and RPM Package Manager.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Difference Between YUM and RPM Package Manager) +[#]: via: (https://www.2daygeek.com/comparison-difference-between-yum-vs-rpm/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +YUM 和 RPM 包管理器的不同之处 +====== + +软件包管理器在 Linux 系统中扮演着重要的角色。它允许你安装、更新、查看、搜索和删除软件包,以满足你的需求。 + +每个发行版都有自己的一套包管理器,依据你的 Linux 发行版来分别使用它们。 + +RPM 是最古老的传统软件包管理器之一,它是为基于 Red Hat 的系统设计的,如 Red Hat Enterprise Linux(RHEL)、CentOS、Fedora 和 openSUSE(它基于 suse Enterprise Linux)等系统。但在依赖解析和包更新(全系统更新/升级)方面,RPM 包管理器有一个突出的限制。 + +> 如果你想知道 [YUM 和 DNF 包管理器的区别][1]请参考该文章。 + +这意味着 yum 可以自动下载并安装所有需要的依赖项,但 rpm 会告诉你安装一个依赖项列表,然后你必须手动安装。 + +当你想用 [rpm 命令][2] 安装一组包时,这实际上是不可能的,而且很费时间。 + +这时,[YUM 包管理器][3] 就派上了用场,解决了这两个问题。 + +### 什么是 RPM? + +RPM 指的是 RPM Package Manager(原名 Red Hat Package Manager),是一个功能强大的命令行包管理工具,是为 Red Hat 操作系统开发的。 + +它现在被用作许多 Linux 发行版的核心组件,如 Centos、Fedora、Oracle Linux、openSUSE 和 Mageia 等。 + +RPM 软件包管理器允许你在基于 RPM 的 Linux 系统上安装、升级、删除、查询和验证软件包。 + +RPM 文件的扩展名为 `.rpm`。RPM 包由一个存档文件组成,其中包含了一个特定包的库和依赖关系,这些库和依赖关系与系统上安装的其他包不冲突。 + +在 Linux 上有很多前端工具可以用来安装 RPM 包,与 RPM 工具相比,这些工具可以使安装过程更加高效,尤其是在处理依赖关系方面。 + +如果你想了解更多关于 Linux 发行版的前端包管理器的信息,请到下面的链接。 + +* [Linux 命令行包管理器列表][4] + +如果你想了解 Linux 的 GUI 包管理器,请到下面的链接。 + +* [Linux GUI 包管理器列表][5] + +### 什么是 YUM? + +Yum 是一个 Linux 操作系统上的自由开源的命令行包管理程序,它使用 RPM 包管理器。Yum 是一个 RPM 的前端工具,可以自动解决软件包的依赖关系。它可以从发行版官方仓库和其他第三方仓库中安装 RPM 软件包。 + +Yum 允许你在系统中安装、更新、搜索和删除软件包。如果你想让你的系统保持更新,你可以通过 yum-cron 启用自动更新。 + +此外,如果你需要的话,它还允许你在 `yum update` 中排除一个或多个软件包。 + +Yum 是默认安装的,你不需要安装它。 + +编号 | RPM | YUM +--- | --- | --- +1 | 红帽在 1997 年引入了 RPM | Yellowdog UPdater(YUP)开发于 1999-2001 年,YUM 于 2003 年取代了原来的 YUP 工具 +2 | RPM 代表 RPM Package manager(原名 Red Hat package manager) | YUM 代表 Yellowdog Updater Modified +3 | RPM 文件的命名规则如下,`httpd-2.4.6-92.el7.x86_64.rpm`:`httpd` - 实际的包名;`2.4.6` - 包发布版本号;`92` - 包发布子版本号;`el7` - Red Hat 版本;`x86_64` - 硬件架构;`rpm` - 文件扩展名 | 后台使用 rpm 数据库 +4 | 不解析依赖关系,你必须手动安装依赖 | 可以自动解析依赖关系并同时安装它们(任何包都会和它的依赖关系一起安装) +5 | 允许你同时安装多个版本的软件包 | 不允许,并显示该软件包已经安装 +6 | 当使用 RPM 命令安装一个软件包时,你必须提供 `.rpm` 软件包的确切位置 | 你可以安装仓库中的任何软件包,而你只需要知道软件包的名称就可以了 +7 | RPM 不依赖于 YUM | 它是一个前端工具,在后台使用 RPM 包管理器来管理包 +8 | RPM 在安装包的管理方面比较难 | YUM 是最简单的管理 RPM 包的方法 +9 | RPM 不能让你将整个系统升级到最新的版本 | YUM 可以让你将系统升级到最新的版本(例如 7.0 到 7.x 的小版本升级) +10 | RPM 不能让你自动更新/升级安装在系统上的软件包 | YUM 可以让你自动更新/升级系统上的更新 +11 | 不使用在线仓库来执行任何操作 | 完全依赖在线仓库来完成所有的工作 +12 | RPM 是一种包格式,它也是一个底层的包管理器,只做基本的事情 | 这是一个上层的包管理器前端,它可以完成你所需要的一切工作 + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/comparison-difference-between-yum-vs-rpm/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/ +[2]: https://www.2daygeek.com/linux-rpm-command-examples-manage-packages-fedora-centos-rhel-systems/ +[3]: https://www.2daygeek.com/linux-yum-command-examples-manage-packages-rhel-centos-systems/ +[4]: https://www.2daygeek.com/list-of-command-line-package-manager-for-linux/ +[5]: https://www.2daygeek.com/list-of-graphical-frontend-tool-for-linux-package-manager/ From abe4def77fa4e490e7d6af75df733452c493b278 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 23 Apr 2020 13:09:56 +0800 Subject: [PATCH 0422/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191220=20The?= =?UTF-8?q?=20Difference=20Between=20DNF=20and=20YUM,=20Why=20is=20Yum=20R?= =?UTF-8?q?eplaced=20by=20DNF=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md --- ...DNF and YUM, Why is Yum Replaced by DNF.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md diff --git a/sources/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md b/sources/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md new file mode 100644 index 0000000000..01d6522274 --- /dev/null +++ b/sources/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Difference Between DNF and YUM, Why is Yum Replaced by DNF?) +[#]: via: (https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +The Difference Between DNF and YUM, Why is Yum Replaced by DNF? +====== + +**[Yum Package Manager][1]** has been replaced by **[DNF Package Manager][2]** since many long-standing issues in Yum remain unresolved. + +These problems include poor performance, excessive memory usage, slowdown for dependency resolution. + +DNF uses “libsolv” for dependency resolution, developed and maintained by SUSE to improve performance. + +It was written mostly in python, and it has its own way of coping with dependency resolution. + +Its API is not fully documented, and its extension system only allows Python plugins. + +Yum is a front-end tool for rpm that manages dependencies and repositories, and then uses RPM to install, download, and remove packages. + +Why would they want to build a new tool instead of fixing existing problems? + +Ales Kozamblak explained that the fixing was not technically feasible and that the yum team was not ready to accept the changes immediately. + +Also, the big challenge is that there are 56K lines for yum, but only 29K lines for DNF. + +So there is no way to fix it, except the fork. + +However yum was working fine. + +S.No | DNF (Dandified YUM) | YUM (Yellowdog Updater, Modified) +---|---|--- +1 | DNF uses libsolv for dependency resolution, developed and maintained by SUSE. | YUM uses the public API for dependency resolution +2 | API is fully documented | API is not fully documented +3 | It is written in C, C++, Python | It is written only in Python +4 | DNF is currently used in Fedora, Red Hat Enterprise Linux 8 (RHEL), CentOS 8, OEL 8 and Mageia 6/7. | YUM is currently used in Red Hat Enterprise Linux 6/7 (RHEL), CentOS 6/7, OEL 6/7. +5 | DNf supports various extensions | Yum supports only Python based extension +6 | The API is well documented so it's easy to create new features | It is very difficult to create new features because the API is not properly documented. +7 | The DNF uses less memory when synchronizing the metadata of the repositories. | The YUM uses excessive memory when synchronizing the metadata of the repositories. +8 | DNF uses a satisfiability algorithm to solve dependency resolution (It's using a dictionary approach to store and retrieve package and dependency information). | Yum dependency resolution gets sluggish due to public API. +9 | All performance is good in terms of memory usage and dependency resolution of repository metadata. | Over all performance is poor in terms of many factors. +10 | DNF Update: If a package contains irrelevant dependencies during a DNF update process, the package will not be updated. | YUM will update a package without verifying this. +11 | If the enabled repository does not respond, dnf will skip it and continue the transaction with the available repositories. | If a repository is not available, YUM will stop immediately. +12 | dnf update and dnf upgrade equals. | It's different in yum +13 | The dependencies on package installation are not updated | Yum offered an option for this behavior +14 | Clean Up Package Removal: When removing a package, dnf automatically removes any dependency packages not explicitly installed by the user. | Yum didn’t do this +15 | Repo Cache Update Schedule: By default, ten minutes after the system boots, updates to configured repositories are checked by dnf hourly. This action is controlled by the system timer unit named "/usr/lib/systemd/system/dnf-makecache.timer". | Yum do this too. +16 | Kernel packages are not protected by dnf. Unlike Yum, you can delete all kernel packages, including one that runs. | Yum will not allow you to remove the running kernel +17 | libsolv: for solving packages and reading repositories. + +hawkey: hawkey, library providing simplified C and Python API to libsolv. + +librepo: library providing C and Python (libcURL like) API for downloading linux repository metadata and packages. + +libcomps: Libcomps is alternative for yum.comps library. It’s written in pure C as library and there’s bindings for python2 and python3 | Yum does not use separate libraries to perform this function. +18 | DNF contains 29k lines of code | Yum contains 56k lines of code +19 | DNF was developed by Ales Kozumplik | YUM was developed by Zdenek Pavlas, Jan Silhan and team members + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[2]: https://www.2daygeek.com/linux-dnf-command-examples-manage-packages-fedora-centos-rhel-systems/ From 1eceb9a7806a1ab38a46758b52b2a56d18c5db98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Thu, 23 Apr 2020 14:06:22 +0800 Subject: [PATCH 0423/1809] Translated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原文中的菜单应该是 路径 ,作者写成 对象 了。在翻译的时候直接改过来了 --- ... make a Halloween lantern with Inkscape.md | 188 ------------------ ... make a Halloween lantern with Inkscape.md | 188 ++++++++++++++++++ 2 files changed, 188 insertions(+), 188 deletions(-) delete mode 100644 sources/tech/20191014 How to make a Halloween lantern with Inkscape.md create mode 100644 translated/tech/20191014 How to make a Halloween lantern with Inkscape.md diff --git a/sources/tech/20191014 How to make a Halloween lantern with Inkscape.md b/sources/tech/20191014 How to make a Halloween lantern with Inkscape.md deleted file mode 100644 index 25324f030e..0000000000 --- a/sources/tech/20191014 How to make a Halloween lantern with Inkscape.md +++ /dev/null @@ -1,188 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to make a Halloween lantern with Inkscape) -[#]: via: (https://opensource.com/article/19/10/how-make-halloween-lantern-inkscape) -[#]: author: (Jess Weichler https://opensource.com/users/cyanide-cupcake) - -How to make a Halloween lantern with Inkscape -====== -Use open source tools to make a spooky and fun decoration for your -favorite Halloween haunt. -![Halloween - backlit bat flying][1] - -The spooky season is almost here! This year, decorate your haunt with a unique Halloween lantern made with open source! - -Typically, a portion of a lantern's structure is opaque to block the light from within. What makes a lantern a lantern are the parts that are missing: windows cut from the structure so that light can escape. While it's impractical for lighting, a lantern with windows in spooky shapes and lurking silhouettes can be atmospheric and a lot of fun to create. - -This article demonstrates how to create your own lantern using [Inkscape][2]. If you don't have Inkscape, you can install it from your software repository on Linux or download it from the [Inkscape website][3] on MacOS and Windows. - -### Supplies - - * Template ([A4][4] or [Letter][5] size) - * Cardstock (black is traditional) - * Tracing paper (optional) - * Craft knife, ruler, and cutting mat (a craft cutting machine/laser cutter can be used instead) - * Craft glue - * LED tea-light "candle" -_Safety note:_ Only use battery-operated candles for this project. - - - -### Understanding the template - -To begin, download the correct template for your region (A4 or Letter) from the links above and open it in Inkscape. - -* * * - -* * * - -* * * - -**![Lantern template screen][6]** - -The gray-and-white checkerboard background is see-through (in technical terms, it's an _alpha channel_.) - -The black base forms the lantern. Right now, there are no windows for light to shine through; the lantern is a solid black base. You will use the **Union** and **Difference** options in Inkscape to design the windows digitally. - -The dotted blue lines represent fold scorelines. The solid orange lines represent guides. Windows for light should not be placed outside the orange boxes. - -To the left of the template are a few pre-made objects you can use in your design. - -### To create a window or shape - - 1. Create an object that looks like the window style you want. Objects can be created using any of the shape tools in Inkscape's left toolbar. Alternately, you can download Creative Commons- or Public Domain-licensed clipart and import the PNG file into your project. - 2. When you are happy with the shape of the object, turn it into a **Path** (rather than a **Shape**, which Inkscape sees as two different kinds of objects) by selecting **Object > Object to Path** in the top menu. - - - -![Object to path menu][7] - - 3. Place the object on top of the base shape. - 4. Select both the object and the black base by clicking one, pressing and holding the Shift key, then selecting the other. - 5. Select **Object > Difference** from the top menu to remove the shape of the object from the base. This creates what will become a window in your lantern. - - - -![Object > Difference menu][8] - -### To add an object to a window - -After making a window, you can add objects to it to create a scene. - -**Tips:** - - * All objects, including text, must be connected to the base of the lantern. If not, they will fall out after cutting and leave a blank space. - * Avoid small, intricate details. These are difficult to cut, even when using a machine like a laser cutter or a craft plotter. - - - 1. Create or import an object. - 2. Place the object inside the window so that it is touching at least two sides of the base. - 3. With the object selected, choose **Object > Object to Path** from the top menu. - - - -![Object to path menu][9] - - 4. Select the object and the black base by clicking on each one while holding the Shift key). - 5. Select **Object > Union** to join the object and the base. - - - -### Add text - -Text can either be cut out from the base to create a window (as I did with the stars) or added to a window (which blocks the light from within the lantern). If you're creating a window, only follow steps 1 and 2 below, then use **Difference** to remove the text from the base layer. - - 1. Select the Text tool from the left sidebar to create text. Thick, bold fonts work best. - -![Text tool][10] - - 2. Select your text, then choose **Path > Object to Path** from the top menu. This converts the text object to a path. Note that this step means you can no longer edit the text, so perform this step _only after_ you're sure you have the word or words you want. - - 3. After you have converted the text, you can press **F2** on your keyboard to activate the **Node Editor** tool to clearly show the nodes of the text when it is selected with this tool. - - - - -![Text selected with Node editor][11] - - 4. Ungroup the text. - 5. Adjust each letter so that it slightly overlaps its neighboring letter or the base. - - - -![Overlapping the text][12] - - 6. To connect all of the letters to one another and to the base, re-select all the text and the base, then select **Path > Union**. - -![Connecting letters and base with Path > Union][13] - - - - -### Prepare for printing - -The following instructions are for hand-cutting your lantern. If you're using a laser cutter or craft plotter, follow the techniques required by your hardware to prepare your files. - - 1. In the **Layer** panel, click the **Eye** icon beside the **Safety** layer to hide the safety lines. If you don't see the Layer panel, reveal it by selecting **Layer > Layers** from the top menu. - 2. Select the black base. In the **Fill and Stroke** panel, set the fill to **X** (meaning _no fill_) and the **Stroke** to solid black (that's #000000ff to fans of hexes). - - - -![Setting fill and stroke][14] - - 3. Print your pattern with **File > Print**. - - 4. Using a craft knife and ruler, carefully cut around each black line. Lightly score the dotted blue lines, then fold. - -![Cutting out the lantern][15] - - 5. To finish off the windows, cut tracing paper to the size of each window and glue it to the inside of the lantern. - -![Adding tracing paper][16] - - 6. Glue the lantern together at the tabs. - - 7. Turn on a battery-powered LED candle and place it inside your lantern. - - - - -![Completed lantern][17] - -Now your lantern is complete and ready to light up your haunt. Happy Halloween! - -How to make Halloween bottle labels with Inkscape, GIMP, and items around the house. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/10/how-make-halloween-lantern-inkscape - -作者:[Jess Weichler][a] -选题:[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/cyanide-cupcake -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/halloween_bag_bat_diy.jpg?itok=24M0lX25 (Halloween - backlit bat flying) -[2]: https://opensource.com/article/18/1/inkscape-absolute-beginners -[3]: http://inkscape.org -[4]: https://www.dropbox.com/s/75qzjilg5ak2oj1/papercraft_lantern_A4_template.svg?dl=0 -[5]: https://www.dropbox.com/s/8fswdge49jwx91n/papercraft_lantern_letter_template%20.svg?dl=0 -[6]: https://opensource.com/sites/default/files/uploads/lanterntemplate_screen.png (Lantern template screen) -[7]: https://opensource.com/sites/default/files/uploads/lantern1.png (Object to path menu) -[8]: https://opensource.com/sites/default/files/uploads/lantern2.png (Object > Difference menu) -[9]: https://opensource.com/sites/default/files/uploads/lantern3.png (Object to path menu) -[10]: https://opensource.com/sites/default/files/uploads/lantern4.png (Text tool) -[11]: https://opensource.com/sites/default/files/uploads/lantern5.png (Text selected with Node editor) -[12]: https://opensource.com/sites/default/files/uploads/lantern6.png (Overlapping the text) -[13]: https://opensource.com/sites/default/files/uploads/lantern7.png (Connecting letters and base with Path > Union) -[14]: https://opensource.com/sites/default/files/uploads/lantern8.png (Setting fill and stroke) -[15]: https://opensource.com/sites/default/files/uploads/lantern9.jpg (Cutting out the lantern) -[16]: https://opensource.com/sites/default/files/uploads/lantern10.jpg (Adding tracing paper) -[17]: https://opensource.com/sites/default/files/uploads/lantern11.jpg (Completed lantern) diff --git a/translated/tech/20191014 How to make a Halloween lantern with Inkscape.md b/translated/tech/20191014 How to make a Halloween lantern with Inkscape.md new file mode 100644 index 0000000000..5e1424ed02 --- /dev/null +++ b/translated/tech/20191014 How to make a Halloween lantern with Inkscape.md @@ -0,0 +1,188 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to make a Halloween lantern with Inkscape) +[#]: via: (https://opensource.com/article/19/10/how-make-halloween-lantern-inkscape) +[#]: author: (Jess Weichler https://opensource.com/users/cyanide-cupcake) + +如何使用 Inkscape 制作万圣节灯笼 +====== +使用开源软件为你最喜欢的万圣节灯笼制作一个有趣和怪异的装饰品。 +![万圣节 - 背光飞行的蝙蝠][1] + +闹鬼的季节快到了!今年,使用开源软件装饰一个独一无二的万圣节灯笼! + +灯笼的一部分结构体是不透明的,以阻挡内部的光线。灯笼之所以成为灯笼,是因为其去掉了一些东西 :从结构体上切下的窗户,这样光线就可以射出。虽然照明不实用,但是一个有着怪异形状窗户和隐藏暗色轮廓的灯笼却可以令人兴奋,并创造出很多乐趣。 + +这篇演示如何使用 [Inkscape][2] 创建你自己的灯笼。如果还没有 Inkscape ,在 Linux 上,你可以从软件包存储库中安装它,在 MacOS 和 Windows 上,你可以从[Inkscape 网站][3] 上下载它. + +### 使用材料 + + * 模板 ([A4][4] 或 [Letter][5] 大小) + * 卡片纸 (黑色是传统色) + * 描图纸 (可选) + * 裁纸刀,尺子, 切割垫板 (可使用工艺切割机/激光切割机代替) + * 工艺胶 + * LED 茶灯"蜡烛" + +_安全注意事项:_ 这个项目只使用电池操作的蜡烛。 + + + +### 理解模板 + +首先,从什么的链接下载你所在区域 (A4 或 Letter) 的合适的模板,然后在 Inkscape 中打开它。 + +* * * + +* * * + +* * * + +**![灯笼模板荧光屏][6]** + +灰白色的棋盘格背景是透明的(从技术角度来说,它是 _alpha 通道_。) + +黑色基板构成了灯笼。现在,没有窗口可以让光线穿过;灯笼有一个非镂空的黑色基板。你将在 Inkscape 中使用 **并集** 和 **差集** 选项来数字化的设计窗户。 + +蓝色虚线表示折线。橙色实线表示参考线。采光窗户不应该放在橙色盒子的外面。 + +模板的左侧是你可以在你设计中使用的一些预先制作好的对象。 + +### 来创建一个窗户或形状 + + 1. 创建一个看起来像你想要的窗口样式的对象。可以使用 Inkscape 左侧工具栏中的一些形状工具来创建对象。此外,你可以下载 Creative Commons- 或 Public Domain-licensed 剪贴画,并导入 PNG 文件到你的项目中。 + 2. 当你对对象满意时,在顶部菜单中选择 **路径 > 对象转化成路径** 将其转换为一个 **路径** (而不是一个 **形状** ,Inkscape 视其为两个不同的目标)。 + + + +![对象到路径菜单][7] + + 3. 在基板形状的上面放置目标。 + 4. 选择目标和黑色基板。通过先单击一个,并按住 Shift 按键,再选择另一个来完成。 + 5. 从顶部菜单选择 **路径 > 差集** 来从基板的对象中移除形状。这将创建灯笼中的一个窗户。 + + + +![路径 > 差集 菜单][8] + +### 添加一个对象到一个窗户中 + +在制作一个窗户后,你可以添加对象到其中来创建一个景色绘画。 + +**提示:** + + * 所有的对象,包括文本,必须连接到灯笼的基板,否则,在切割后会掉落下来,并留下一片空白区。 + * 避免小而复杂的细微之处。即使使用激光切割机或工艺切割机等机器,也很难切割这些细微之处。 + + + 1. 创建或导入一个对象。 + 2. 放置对象到窗口内,以便它至少接触基板的两侧。 + 3. 选择对象后,从顶部菜单选择 **连接 > 对象转化成路径** 。 + + + +![对象到路径 菜单][9] + + 4. 选择对象和黑色基板,通过在按住 Shift 按键的同时单击每一个来完成。 + 5. 选择 **路径 > 并集** 来使对象和基板合二为一。 + + + +### 添加文本 + +文本可以从创建一个窗户的基板上剪下来(就像我对星星所做的那样),或者也可以添加到一个窗户上(它在独挡来自灯笼内部的光线)。如果你正在创建一个窗户,只需要执行下面的步骤1和步骤2,然后使用 **差集** 来从基板层移除文本。 + + 1. 从左侧边栏中选择文本工具来创建文本。粗体字体效果最好。 + +![文本工具][10] + + 2. 选择你的文本,然后从顶部菜单选择 **路径 > 对象转化成路径** 。这将转换文本对象为一个路径。注意,这个步骤意味着你将不能再编辑该文本,所以,_只有当_ 你确定你拥有想要的单词后,执行这个步骤。 + + 3. 在你转换文本后,你可以按键盘上的 **F2** 来激活 **节点编辑器** 工具,当选择使用这个工具时,可以清楚地显示文本的节点。 + + + + +![选中的文本使用节点编辑器][11] + + 4. 取消文本分组。 + 5. 调整每个字母,以便使其与相邻字母或基板稍微重叠。 + + + +![重叠文本][12] + + 6. 为将所有的字母彼此连接并连接到基板,重新选择所有文本和基板,然后选择 **路径 > 并集**。 + +![使用 路径 > 并集 连接字母和基板][13] + + + + +### 准备打印 + +下面是手工切割灯笼的说明。如果使用激光切割机或工艺切割机,遵循硬件所需要的技巧来准备好你的文件。 + + 1. 在 **图层** 面板中,单击 **安全** 图层旁边的**眼睛** 图标来隐藏安全线。如果你看不到图层面板,通过顶部菜单选择 **图层 > 图层** 来显示它。 + 2. 选择黑色基板。在 **填充和笔划** 面板中,设置填充为 **X** (意味着 _不填充_),设置 **笔划** 为纯黑色(对于巫法的粉丝来说是 #000000ff )。 + + + +![设置填充和笔划][14] + + 3. 使用 **文件 > 打印** 来打印你的图案样本。 + + 4. 使用一把工艺刀和直尺,小心地绕着每一条黑线切割。在蓝色虚线上轻划,然后折叠。 + +![裁剪灯笼][15] + + 5. 为完成窗户的制作,剪切摹图纸到每个窗户的大小,然后粘贴它到灯笼的内侧。 + +![添加摹图纸][16] + + 6. 在折条处把灯笼的粘在一起。 + + 7. 接通电池供电的 LED 蜡烛,并放置它到你灯笼中。 + + + + +![完成灯笼][17] + +现在你的灯笼已经完成并准备好照亮你的诡异的装饰品。万圣节快乐! + +如何使用 Inkscape,GIMP 制作万圣节瓶子标签和家用物品。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/10/how-make-halloween-lantern-inkscape + +作者:[Jess Weichler][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cyanide-cupcake +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/halloween_bag_bat_diy.jpg?itok=24M0lX25 (Halloween - backlit bat flying) +[2]: https://opensource.com/article/18/1/inkscape-absolute-beginners +[3]: http://inkscape.org +[4]: https://www.dropbox.com/s/75qzjilg5ak2oj1/papercraft_lantern_A4_template.svg?dl=0 +[5]: https://www.dropbox.com/s/8fswdge49jwx91n/papercraft_lantern_letter_template%20.svg?dl=0 +[6]: https://opensource.com/sites/default/files/uploads/lanterntemplate_screen.png (Lantern template screen) +[7]: https://opensource.com/sites/default/files/uploads/lantern1.png (Object to path menu) +[8]: https://opensource.com/sites/default/files/uploads/lantern2.png (Object > Difference menu) +[9]: https://opensource.com/sites/default/files/uploads/lantern3.png (Object to path menu) +[10]: https://opensource.com/sites/default/files/uploads/lantern4.png (Text tool) +[11]: https://opensource.com/sites/default/files/uploads/lantern5.png (Text selected with Node editor) +[12]: https://opensource.com/sites/default/files/uploads/lantern6.png (Overlapping the text) +[13]: https://opensource.com/sites/default/files/uploads/lantern7.png (Connecting letters and base with Path > Union) +[14]: https://opensource.com/sites/default/files/uploads/lantern8.png (Setting fill and stroke) +[15]: https://opensource.com/sites/default/files/uploads/lantern9.jpg (Cutting out the lantern) +[16]: https://opensource.com/sites/default/files/uploads/lantern10.jpg (Adding tracing paper) +[17]: https://opensource.com/sites/default/files/uploads/lantern11.jpg (Completed lantern) From da9a8024d79bb21fb42cf8c45f97b89a7c68db6b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Apr 2020 15:46:15 +0800 Subject: [PATCH 0424/1809] PRF @messon007 --- ... the internet backbone and how it works.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/translated/talk/20200313 What is the internet backbone and how it works.md b/translated/talk/20200313 What is the internet backbone and how it works.md index d8294dba3c..716d6e5154 100644 --- a/translated/talk/20200313 What is the internet backbone and how it works.md +++ b/translated/talk/20200313 What is the internet backbone and how it works.md @@ -1,53 +1,53 @@ [#]: collector: (lujun9972) [#]: translator: (messon007) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What is the internet backbone and how it works) [#]: via: (https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html) [#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) -互联网的骨干网是什么以及它是怎样工作的 +什么是互联网骨干网,它是怎样工作的 ====== -一级互联网服务提供商(ISP)将其高速光纤网络连接在一起,形成互联网的骨干网,实现在不同地理区域之间高效地传输流量。[Gerd Altmann][1] [(CC0)][2] + +> 一级互联网服务提供商(ISP)将其高速光纤网络连接在一起,形成互联网的骨干网,实现在不同地理区域之间高效地传输流量。 + +![](https://images.idgesg.net/images/article/2018/04/global_network_connections_by_gerd_altmann_cc0_via_pixabay_1200x800-100754306-large.jpg) 互联网会产生大量的计算机到计算机的流量,要确保所有流量都可以在世界上任何地方之间传输,就需要大量汇聚的高速网络,这些网络统称为互联网骨干网,但是它是如何工作的呢? ### 互联网的骨干网是什么? -像任何其他网络一样,Internet由接入链路组成,这些接入链路将流量传输到高带宽路由器,路由器又将流量从源地址通过最佳可用路径传输到目的地址。其核心是由相互连接的各个高速光纤网络而构成的Internet骨干网。 -各个独立的核心网络由一级互联网服务提供商(ISP),大型运营商所拥有。他们的网络连接在一起。这些提供商包括AT&T,CenturyLink,Cogent Communications,德国电信,全球电信和技术(GTT),NTT Communications,Sprint,Tata Communications,意大利Sparkle电信,Telia Carrier和Verizon。 +像任何其他网络一样,互联网由接入链路组成,这些接入链路将流量传输到高带宽路由器,路由器又将流量从源地址通过最佳可用路径传输到目的地址。其核心是由相互连接的、彼此对等的各个高速光纤网络而构成的互联网骨干网。 -[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] +单个独立的核心网络由一级互联网服务提供商(ISP)所拥有。他们的网络连接在一起。这些提供商包括 AT&T、CenturyLink、Cogent Communications,、Deutsche Telekom、Global Telecom and Technology (GTT)、NTT Communications、Sprint、Tata Communications,、Telecom Italia Sparkle、Telia Carrier和 Verizon。 -通过将这些长途网连接在一起,一级ISP们创建了一个他们可以访问整个路由表的单一的全球性网络,因此他们可以通过逐步层次化地增加本地ISP网络来有效地将流量传输到其目的地。 +通过将这些长途网连接在一起,一级 ISP 们创建了一个他们可以访问整个路由表的单一的全球性网络,因此他们可以通过逐步层次化地增加本地 ISP 网络来有效地将流量传输到其目的地。 -除了物理连接之外,这些骨干提供商还通过一致的网络协议TCP/IP融合在一起。它们实际上是两个协议,传输控制协议和IP协议,它们在计算机之间建立连接,以确保连接可靠并将消息格式化为数据包。 +除了物理连接之外,这些骨干网提供商还通过一致的网络协议 TCP/IP 融合在一起,这实际上是两个协议,传输控制协议transport control protocol互联网协议internet protocol,它们在计算机之间建立连接,以确保连接可靠,并将消息格式化为数据包。 -### 互联网交接点(IXP)将骨干连接在一起 +### 互联网交接点(IXP)将骨干网连接在一起 -骨干ISP在对等点,中立位置通过高速交换机和路由器连接其网络。这些通常由第三方(有时是非营利组织)提供,以促进骨干网的统一。 +骨干网 ISP 在中立位置的对等点通过高速交换机和路由器连接其网络。这些通常由第三方(有时是非营利组织)提供,以促进骨干网的统一。 -有1级ISP的参与有助于为IXP提供资金,但是在称为无结算的对等关系中,彼此之间不收取从其他1级ISP传输流量的费用。此类协议消除了可能导致互联网性能下降的潜在财务纠纷。 - -[][4] +参与的一级 ISP 会帮助资助 IXP,但不向其他一级 ISP 收取流量传输费用,这种关系称为无结算对等。这种协议消除了可能导致互联网性能下降的潜在财务纠纷。 ### 骨干网有多快? -互联网骨干网由最快的路由器组成,可以提供100Gbps的线路速度。这些路由器由包括Cisco,Extreme,Huawei,Juniper和Nokia在内的供应商制造,使用边界网关协议(BGP)在彼此之间路由流量。 + +互联网骨干网由最快的路由器组成,可以提供 100Gbps 的线路速度。这些路由器由包括 Cisco、Extreme、华为、Juniper 和 Nokia 在内的供应商制造,使用边界网关协议(BGP)在彼此之间路由流量。 ### 流量是如何进入骨干网的 -1级ISP之下是小的2级和3级ISP。 +在 1 级 ISP 之下是规模较小的 2 级和 3 级 ISP。 -3级(ISP)提供商为企业和消费者提供了Internet接入服务。这些提供商自己没有接入互联网骨干网,因此,他们自己无法将其客户连接到数十亿台互联网上的计算机。 +3 级 ISP 为企业和消费者提供了互联网接入服务。这些提供商自己没有接入互联网骨干网,因此,他们自己无法将其客户连接到数十亿台互联网上的计算机。 -购买一级(ISP)提供商的接入权非常昂贵。通常3级ISP与具有自己网络的2级(区域)ISP签订合同,利用2级ISP的网络将流量传输到有限的地理区域,但不能传输到所有Internet上的设备。 +购买一级 ISP 提供商的接入非常昂贵。通常 3 级 ISP 与拥有自己网络的 2 级(区域)ISP 签订合同,利用 2 级 ISP 的网络将流量传输到有限的地理区域,但不能传输到所有互联网上的设备。 -为此,2级ISP与1级ISP签约以访问全球骨干网,并以这种方式使客户可以访问整个Internet。 +为此,2 级 ISP 与 1 级 ISP 签约以访问全球骨干网,并以这种方式使客户可以访问整个互联网。 -这种方式使得来自世界一侧的计算机的流量能够连接到另一侧的计算机。流量从源计算机流向3级ISP,再路由到2级ISP,再路由到1级骨干网提供商,再路由到正确的2级ISP,最后路由到提供该数据的3级接入提供商连接的目标计算机。 +这种方式使得来自世界一侧的计算机的流量能够连接到另一侧的计算机。流量从源计算机流向 3 级 ISP,再路由到 2 级 ISP,再路由到 1 级骨干网提供商,再路由到正确的 2 级 ISP,最后路由到提供该数据的 3 级接入提供商连接的目标计算机。 -加入[Facebook][5]和[LinkedIn][6]上的Network World社区,就可以评论最前沿的话题。 -------------------------------------------------------------------------------- via: https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html @@ -55,7 +55,7 @@ via: https://www.networkworld.com/article/3532318/what-is-the-internet-backbone- 作者:[Tim Greene][a] 选题:[lujun9972][b] 译者:[messon007](https://github.com/messon007) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 56824d6b5daa64e152253186368fe68fe67ac21a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Apr 2020 15:46:51 +0800 Subject: [PATCH 0425/1809] PUB @geekpi https://linux.cn/article-12141-1.html --- ...20200313 What is the internet backbone and how it works.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20200313 What is the internet backbone and how it works.md (98%) diff --git a/translated/talk/20200313 What is the internet backbone and how it works.md b/published/20200313 What is the internet backbone and how it works.md similarity index 98% rename from translated/talk/20200313 What is the internet backbone and how it works.md rename to published/20200313 What is the internet backbone and how it works.md index 716d6e5154..5e120b20da 100644 --- a/translated/talk/20200313 What is the internet backbone and how it works.md +++ b/published/20200313 What is the internet backbone and how it works.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (messon007) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12141-1.html) [#]: subject: (What is the internet backbone and how it works) [#]: via: (https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html) [#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) From 77257fdd10424d9a4e945ef3e530eb10fff3f74f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Apr 2020 23:56:06 +0800 Subject: [PATCH 0426/1809] PRF @geekpi --- ...o package Python applications for Linux.md | 112 ++++++++---------- 1 file changed, 52 insertions(+), 60 deletions(-) diff --git a/translated/tech/20200416 How to package Python applications for Linux.md b/translated/tech/20200416 How to package Python applications for Linux.md index a44918f7cd..a5e40e7df9 100644 --- a/translated/tech/20200416 How to package Python applications for Linux.md +++ b/translated/tech/20200416 How to package Python applications for Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to package Python applications for Linux) @@ -9,146 +9,138 @@ 如何为 Linux 打包 Python 应用 ====== -了解如何使用 dh_virtualenv 来让你的 Python 应用可作为 .deb 包安装。 -![Python in a tree][1] -一种让 Python 应用可在基于 Debian 的操作系统(例如 Debian 或 [Elementary OS][2])上安装的方法是使用 [dh_virtualenv][3] 工具。它会构建一个封装了 Python 虚拟环境的 **.deb** 包,并在安装时进行部署。 +> 了解如何使用 dh_virtualenv 来让你的 Python 应用可作为 .deb 包安装。 -在本文中,我将以构建包含 [HTTPie][4] 工具的包为例,说明如何无需激活虚拟环境即可从命令行测试 HTTP API。 +![](https://img.linux.net.cn/data/attachment/album/202004/23/235547iztz5d955t9s9b5t.jpg) + +在基于 Debian 的操作系统(例如 Debian 或 [Elementary OS][2])上安装 Python 应用的一种方法是使用 [dh_virtualenv][3] 工具。它可以构建一个 `.deb` 包,在应用之外封装了一个 Python 虚拟环境,并在安装时进行部署。 + +在本文中,我将以构建一个包含 [HTTPie][4] 工具的包为例来解释如何使用它,以便在无需激活虚拟环境的情况下从命令行测试 HTTP API。 ### 使用 dh_virtualenv 打包 -首先,你需要安装 dh_virtualenv 所需的工具。dh_virtualenv 的[文档][5]提供了所有安装选项。在基于 Debian 的系统上,我输入: +首先,你需要安装 `dh_virtualenv` 所需的工具。`dh_virtualenv` 的[文档][5]提供了所有安装选项。在基于 Debian 的系统上,我输入: ``` -`apt-get install dh-virtualenv devscripts` +apt-get install dh-virtualenv devscripts ``` -尽管不需要 [devscripts][6] 包,但它将简化后续操作。 +尽管不需要 [devscripts][6] 包,但它可以简化后续操作。 -现在,创建一个目录来保存源码。由于这是 HTTPie 的本地非官方打包,因此我将其称为 **myhttp**。 接下来,让我们在 **myhttp** 内创建一些文件以向 Debian 构建系统提供元数据。 - -首先,创建 **debian/control** 文件: +现在,创建一个目录来保存源码。由于这是一个本地的、非官方的 HTTPie 打包,因此我将其称为 `myhttp`。接下来,让我们在 `myhttp` 内创建一些文件,向 Debian 构建系统提供元数据。 +首先,创建 `debian/control` 文件: ``` Source: myhttp Section: python Priority: extra -Maintainer: Jan Doe <[jandoe@example.org][7]> -Build-Depends: debhelper (>= 9), python3.7, dh-virtualenv (>= 0.8) +Maintainer: Jan Doe +Build-Depends: debhelper (>= 9), python3.7, dh-virtualenv (>= 0.8) Standards-Version: 3.9.5 Package: myhttp Architecture: any -Pre-Depends: dpkg (>= 1.16.1), python3.7, ${misc:Pre-Depends} +Pre-Depends: dpkg (>= 1.16.1), python3.7, ${misc:Pre-Depends} Depends: ${misc:Depends} Description: http client - Useful for doing stuff + Useful for doing stuff ``` -那么这些是什么信息呢? [Debian 文档][8]指出: +那么这些是什么信息呢?正如 [Debian 文档][8]指出的: >“第 1–7 行是源码包的控制信息。第 9–13 行是二进制包的控制信息。” 以下是我使用的: - * **section** 的值对于我们来说大多没有意义,但需要存在。它对提供 UI 安装程序信息是有意义的,这与此包无关。 - * 额外的 **Priority** 值是像这样的第三方包的正确优先级。 - * 强烈建议在 **Maintainer** 字段中填写正确的联系人信息。但是,如果包由团队维护,并且你希望将问题发送到团队的邮件别名,例如 “Infrastructure Team <[infra-team-list@company.example.com][9]>”,那这不一定是你的个人邮箱。 - * **build-depends** 字段标识你需要 debhelper、python 和 dh-virtualenv 来构建包:包生成过程将确保这些依赖项在包构建时安装。 - * **standards version** 字段主要给人看。它表明你遵循的指南。本指南基于 dh-virtualenv 的官方文档,它是基于 Debian 的 3.9.5 指南。最好一直将源码包和二进制包命名相同。 - * **Architecture** 字段应为 **Any**,因为除非虚拟环境可能包含一些特定于体系结构的文件。否则,最好选择该字段为 **any**。 - * 保持 Pre-Depends 列表为当前的样式:预依赖是一种非常严格的依赖关系形式,你很少会需要比建议的最小依赖更多的依赖项。依赖项通常由构建系统准确计算,因此没有理由手动指定它们。 - * 如果你的包主要用于内部,那么 **Description** 字段只需要最少的信息或者指向公司 wiki 的链接,不然详细信息更有用。 - - - -然后创建 **debian/compat** 文件,它[主要出于历史目的而存在][10]: +* `Section` 的值对于我们来说大多没有意义,但需要存在。它对给引导式 UI 安装程序提供信息是有意义的,但对于这个包来说,没有意义。 +* `Priority` 对像这样的第三方包的正确值是 `extra`。 +* 强烈建议在 `Maintainer` 字段中填写正确的联系人信息。但不一定非得是你的个人电子邮件,如果包由团队维护,并且你希望将问题发送到团队的邮件别名,例如 `Infrastructure Team `。 +* `Build-Depends` 字段标识你需要 `debhelper`、`python` 和 `dh-virtualenv` 来构建包:包构建过程中将确保这些依赖项在包构建时已安装。 +* `Standards-Version` 字段主要给人看。它表明你遵循的指南。本指南基于 `dh-virtualenv` 的官方文档,它是基于 Debian 的 3.9.5 指南。最好一直将源码包和二进制包命名相同。 +* `Architecture` 字段应为 `Any`,因为除非虚拟环境可能包含一些特定于体系结构的文件。否则,最好选择该字段为 `any`。 +* 保持 `Pre-Depends` 列表不变:它是一种非常严格的依赖关系形式,你很少会需要比这里建议的最小依赖更多的依赖项。依赖项通常由构建系统准确计算,因此没有理由手动指定它们。 +* 如果你的包主要用于内部,那么 `Description` 字段可能只需要最少的信息或者指向公司 wiki 的链接,不然更多的信息会更有用。 +然后创建 `debian/compat` 文件,它[主要出于历史目的而存在][10]: ``` -`$ echo "9" > debian/compat` +$ echo "9" > debian/compat ``` -接下来,创建更新日志以告知包用户自上一发行版以来发生了什么变化。最简单的方法是使用 **dch --create** 创建模板,然后填写值。 +接下来,创建更新日志以告知包用户自上次发布以来发生了什么变化。最简单的方法是使用 `dch --create` 创建模板,然后填写值。 填写后,它看起来像: - ``` myhttp (2.0.0-1) stable; urgency=medium -  * Initial release. + * Initial release. - -- Jan Doe <[jandoe@example.org][7]>  Fri, 27 Mar 2020 01:09:22 +0000 + -- Jan Doe Fri, 27 Mar 2020 01:09:22 +0000 ``` 现在你需要告诉工具安装 HTTPie,但是哪个版本? -创建一个宽松版本的 **requirements.in** 文件: - +创建一个宽松版本的 `requirements.in` 文件: ``` -`httpie` +httpie ``` -通常,宽松的需求文件将仅包含项目的直接依赖项,并在需要时指定最低版本。 不一定总是需要指定最低版本:这些工具通常偏向于将依赖关系转化为“可能的最新版本”。如果你的 Debian 包与一个内部 Python 包相对应,这是内部应用中的一种常见情况,那么宽松的需求文件看起来将很相似:仅包含包名的一行。 - -然后使用 **pip-compile**(可通过安装 PyPI 包 **pip-tools** 获得): +通常,宽松的需求文件将仅包含项目的直接依赖项,并在需要时指定最低版本。不一定总是需要指定最低版本:这些工具通常偏向于将依赖关系转化为“可能的最新版本”。如果你的 Debian 包与一个内部 Python 包相对应,这是内部应用中的一种常见情况,那么宽松的需求文件看起来将很相似:仅包含包名的一行。 +然后使用 `pip-compile`(可通过安装 PyPI 包 `pip-tools` 获得): ``` -`$ pip-compile requirements.in > requirements.txt` +$ pip-compile requirements.in > requirements.txt ``` -这会生成一个严格的依赖文件,名为 **requirements.txt**: - +这会生成一个严格的依赖文件,名为 `requirements.txt`: ``` # # This file is autogenerated by pip-compile # To update, run: # -#    pip-compile requirements.in +# pip-compile requirements.in # -certifi==2019.11.28       # via requests -chardet==3.0.4            # via requests -httpie==2.0.0             # via -r requirements.in -idna==2.9                 # via requests -pygments==2.6.1           # via httpie -requests==2.23.0          # via httpie -urllib3==1.25.8           # via requests +certifi==2019.11.28 # via requests +chardet==3.0.4 # via requests +httpie==2.0.0 # via -r requirements.in +idna==2.9 # via requests +pygments==2.6.1 # via httpie +requests==2.23.0 # via httpie +urllib3==1.25.8 # via requests ``` -最后,写一个 **debian/rules** 文件来创建包。因为 dh_virtualenv 会处理所有困难的事,因此规则文件很简单: - +最后,写一个 `debian/rules` 文件来创建包。因为 `dh_virtualenv` 会处理所有困难的事,因此规则文件很简单: ``` #!/usr/bin/make -f %: -        dh $@ --with python-virtualenv --python /usr/bin/python3.7 + dh $@ --with python-virtualenv --python /usr/bin/python3.7 ``` -确保指定 Python 解释器。默认它会使用 **/usr/bin/python**,这是 Python2,但是你应该使用一个[受支持的 Python 版本][11] +确保指定 Python 解释器。默认它会使用 `/usr/bin/python`,这是 Python2,但是你应该使用一个[受支持的 Python 版本][11]。 完成了,接下来就是构建包: - ``` -`$ debuild -b -us -uc` +$ debuild -b -us -uc ``` -这会在父目录生成一个类似 **myhttp_2.0.0-1_amd64.deb** 的文件。该文件可在任何兼容的系统上安装。 +这会在父目录生成一个类似 `myhttp_2.0.0-1_amd64.deb` 的文件。该文件可在任何兼容的系统上安装。 通常,最好在同一平台上构建用于特定平台(例如 Debian 10.0)的 Debian 包。 -你可以将此 Debian 包保存在存仓库中,并使用例如 [Ansible][12] 的工具将其安装在所有相关系统上。 +你可以将此 Debian 包保存在软件仓库中,并使用例如 [Ansible][12] 的工具将其安装在所有相关系统上。 ### 总结 -给基于 Debian 的系统的打包应用是一个有多个步骤的过程。使用 dh_virtualenv 将使过程变得简单。 +给基于 Debian 的系统的打包应用是一个有着多个步骤的过程。使用 `dh_virtualenv` 将使过程变得简单明了。 -------------------------------------------------------------------------------- @@ -157,7 +149,7 @@ via: https://opensource.com/article/20/4/package-python-applications-linux 作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 56c99bf74e599cd436b2864f212f84af1e345c69 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Apr 2020 23:56:35 +0800 Subject: [PATCH 0427/1809] PUB @geekpi https://linux.cn/article-12143-1.html --- .../20200416 How to package Python applications for Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200416 How to package Python applications for Linux.md (99%) diff --git a/translated/tech/20200416 How to package Python applications for Linux.md b/published/20200416 How to package Python applications for Linux.md similarity index 99% rename from translated/tech/20200416 How to package Python applications for Linux.md rename to published/20200416 How to package Python applications for Linux.md index a5e40e7df9..95b6bba528 100644 --- a/translated/tech/20200416 How to package Python applications for Linux.md +++ b/published/20200416 How to package Python applications for Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12143-1.html) [#]: subject: (How to package Python applications for Linux) [#]: via: (https://opensource.com/article/20/4/package-python-applications-linux) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From 46a62210b98fe3e77c866736324439affc261cb5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 24 Apr 2020 01:03:41 +0800 Subject: [PATCH 0428/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200424=20Ubun?= =?UTF-8?q?tu=2020.04=20LTS=20Released.=20Download=20Now!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200424 Ubuntu 20.04 LTS Released. Download Now.md --- ...Ubuntu 20.04 LTS Released. Download Now.md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20200424 Ubuntu 20.04 LTS Released. Download Now.md diff --git a/sources/tech/20200424 Ubuntu 20.04 LTS Released. Download Now.md b/sources/tech/20200424 Ubuntu 20.04 LTS Released. Download Now.md new file mode 100644 index 0000000000..9eb9a036c7 --- /dev/null +++ b/sources/tech/20200424 Ubuntu 20.04 LTS Released. Download Now.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu 20.04 LTS Released. Download Now!) +[#]: via: (https://itsfoss.com/download-ubuntu-20-04/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Ubuntu 20.04 LTS Released. Download Now! +====== + +_**Brief: Ubuntu 20.04 LTS Focal Fossa has been finally released. Here is a quick recap of the new features and the download links for Ubuntu 20.04** **and the official flavours for it**._ + +The wait is finally over. Ubuntu 20.04 LTS has finally arrived and is available to download! + +![][1] + +If you were already using Ubuntu 19.10, you may not notice a lot of noticeable differences – but the list of improvements that I’m looking at is indeed impressive. + +If you’re curious about what’s new, I’ll mention a few key highlights for this release. + +### Ubuntu 20.04: What’s new? + +Considering the previous 18.04 LTS release, Ubuntu 20.04 LTS involves a lot of visual changes and under-the-hood improvements as well. + +Of course, with the addition of [GNOME 3.36][2], a major visual upgrade and the performance improvement is quite obvious. Here’s a video highlighting what’s new in Ubuntu 20.04: + +You can also dive into one of our articles highlighting [new features of Ubuntu 20.04][3], if you’re curious. + +In either case, let me just give you some highlights: + + * GNOME 3.36 is the default desktop + * The performance has improved a lot + * The new Yaru theme is gorgeous, comes in dark mode as well + * You won’t have to see the Amazon app anymore, it’s gone for good! + * Improved [ZFS][4] support + * You get the latest [Linux Kernel 5.4][5] (LTS) + * Adds exFAT support + * Improved hardware and graphics support + * Updated software Python 3.8.2 + * Wireguard is being backported to Linux Kernel 5.4 to be utilized on Ubuntu 20.04 + + + +If you want to see the features in detail and in action, please watch this video highlighting the best features of 20.04 LTS: + +[Subscribe to our YouTube channel for more Linux videos][6] + +In case you’re new to Ubuntu and have questions about Ubuntu 20.04, we also have a quick [Ubuntu 20.04 FAQ][7] article for you. + +### Upgrade to Ubuntu 20.04 from 18.04 and 19.10 + +If you are already using Ubuntu 18.04 or 19.10, you can easily upgrade to Ubuntu 20.04 from within your system. + +This way, your files and most of the applications settings remain as it is while you start using the new version without reinstalling it from the ISO. + +You can read this detailed tutorial to learn [how to upgrade Ubuntu to a newer version][8]. + +Please note that if you are using Lubuntu 18.04, you must not upgrade to Lubuntu 20.04. Lubuntu 18.04 used Lxde desktop while later versions use LXQt desktop. Upgrading this way result in conflicts and possible broken system. + +### Download Ubuntu 20.04 LTS + +You can grab the ISO or the torrent file, depending on what you prefer: + +[Ubuntu 20.04 LTS (ISO)][9] + +[Ubuntu 20.04 LTS (Torrent)][10] + +Please follow this tutorial to learn [how to install Ubuntu][11]. + +### Download Ubuntu 20.04 LTS Official Flavours + +If you want to grab an official flavour of Ubuntu with a different desktop environment, please follow the links below. + +[Ubuntu MATE 20.04 LTS][12] + +[Kubuntu 20.04 LTS][13] + +[Xubuntu 20.04 LTS][14] + +[Ubuntu Budgie 20.04 LTS][15] + +[Ubuntu Studio 20.04 LTS][16] + +[Lubuntu 20.04 LTS][17] + +If you don’t find the latest ISO/torrent file listed in their respective official sites, simply head to [cdimages.ubuntu.com][18] to find all the flavours listed. + +Next, navigate to the **name-of-the-distro** -> **releases** -> **20.04** -> **release** and then you should find the links to the ISO and the torrent files listed. + +If you have questions, please refer to this article that answers [frequently asked questions about Ubuntu 20.04][7]. If you are going to install it, do check our recommended [things to do after installing Ubuntu 20.04][19]. + +Enjoy Ubuntu 20.04 LTS Focal Fossa! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/download-ubuntu-20-04/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Ubuntu-20.04-LTS-released.png?ssl=1 +[2]: https://itsfoss.com/gnome-3-36-release/ +[3]: https://itsfoss.com/ubuntu-20-04-release-features/ +[4]: https://itsfoss.com/what-is-zfs/ +[5]: https://itsfoss.com/linux-kernel-5-4/ +[6]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[7]: https://itsfoss.com/ubuntu-20-04-faq/ +[8]: https://itsfoss.com/upgrade-ubuntu-version/ +[9]: http://releases.ubuntu.com/focal/ubuntu-20.04-desktop-amd64.iso +[10]: http://releases.ubuntu.com/focal/ubuntu-20.04-desktop-amd64.iso.torrent +[11]: https://itsfoss.com/install-ubuntu/ +[12]: https://ubuntu-mate.org/download/amd64/focal/ +[13]: https://kubuntu.org/getkubuntu/ +[14]: https://xubuntu.org/download/ +[15]: https://ubuntubudgie.org/downloads/ +[16]: https://ubuntustudio.org/ +[17]: https://lubuntu.me/downloads/ +[18]: http://cdimages.ubuntu.com/ +[19]: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/ From 5878f65d3237e7e504b08d85f8a788031f250a9e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 24 Apr 2020 01:04:33 +0800 Subject: [PATCH 0429/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200424=2016?= =?UTF-8?q?=20Things=20to=20do=20After=20Installing=20Ubuntu=2020.04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md --- ...ngs to do After Installing Ubuntu 20.04.md | 283 ++++++++++++++++++ 1 file changed, 283 insertions(+) create mode 100644 sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md diff --git a/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md b/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md new file mode 100644 index 0000000000..cca31a0426 --- /dev/null +++ b/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md @@ -0,0 +1,283 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (16 Things to do After Installing Ubuntu 20.04) +[#]: via: (https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +16 Things to do After Installing Ubuntu 20.04 +====== + +_**Here is a list of tweaks and things to do after installing Ubuntu 20.04, to get a smoother and better desktop Linux experience.**_ + +[Ubuntu 20.04 LTS brings plenty of new features][1] and visual changes. If you choose to install Ubuntu 20.04, let me show you a few recommended steps that you can follow to get started with it. + +### 16 Things to do after installing Ubuntu 20.04 LTS “Focal Fossa” + +![][2] + +The steps I am going to mention here are my recommendation. You may ignore a few customization or tweaks if they don’t suit your need and interest. + +Similarly, some steps may seem too simple but essential for someone completely new to Ubuntu. + +A number of suggestions here are suited for the default Ubuntu 20.04 with GNOME desktop. So please check [which Ubuntu version][3] and [which desktop environment][4] you are using. + +Let’s get started with the list of things to do after installing Ubuntu 20.04 LTS codenamed Focal Fossa. + +#### 1\. Get your system ready by updating and enabling additional repos + +The first thing you should do after installing Ubuntu or any other Linux distribution is to update it. Linux works on a local database of available packages. And this cache needs to be synced in order for you to be able to install any software. + +It is very easy to update Ubuntu. You can run the software updater from the menu (press Windows key and search for software updater): + +![Software Updater in Ubuntu 20.04][5] + +You may also use the following command in the terminal to update your system: + +``` +sudo apt update && sudo apt upgrade +``` + +Next, you should make sure that you have [universe and multiverse repositories enabled][6]. You’ll have access to a lot more software with these repositories. I also recommend reading about [Ubuntu repositories][6] to learn the basic concept behind it. + +Search for Software & Updates in the menu: + +![Software & Updates Settings][7] + +Make sure to check the boxes in front of the repositories: + +![Enable additional repositories][8] + +#### 2\. Install media codecs to play MP3, MPEG4 and other media files + +If you want to play media files like MP3, MPEG4, AVI etc, you’ll need to install media codecs. Ubuntu doesn’t install it by default because of copyright issues in various countries. + +As an individual, you can install these media codecs easily [using the Ubuntu Restricted Extra package][9]. This will install media codecs, Adobe Flash player and [Microsoft True Type Fonts in your Ubuntu system][10]. + +You can install it by [clicking this link][11] (it will asked to be open in software center) or use this command: + +``` +sudo apt install ubuntu-restricted-extras +``` + +If you encounter the EULA or the license screen, remember to use the tab key to select between the options and then hit enter to confirm your choice. + +![Press tab to select OK and press enter][12] + +#### 3\. Install software from the software center or the web + +Now that you have set up the repositories and updated the package cache, you should start installing software that you need. + +There are several ways of [installing applications in Ubuntu][13]. The easiest and the official way is to use the Software Center. + +![Ubuntu Software Center][14] + +If you want some recommendation about software, please refer to this extensive [list of Ubuntu applications for different purposes][15]. + +Some software vendors provide .deb files to easily install their application. You may get the deb files from their website. For example, to [install Google Chrome on Ubuntu][16], you can get the deb file from its website and double click on it to start the installation. + +#### 4\. Enjoy gaming with Steam Proton and GameMode + +[Gaming on Linux][17] has come a long way. You are not restricted to a handful of games included by default. You can [install Steam on Ubuntu][18] and enjoy a good number of games. + +[Steam’s new P][19][r][19][oton project][19] enables you to play a number of Windows-only games on Linux. In addition to that, Ubuntu 20.04 comes with [Feral Interactive’s GameMode][20] installed by default. + +The GameMode automatically adjust Linux system performance to give more priority to games than other background processes. + +This means some games that support the GameMode (like [Rise of Tomb Raiders][21]) should have improved performance on Ubuntu. + +#### 5\. Manage auto-updates (for intermediate and experts) + +Recently, Ubuntu has started to automatically download and install security updates that are essential to your system. This is a security feature as a regular user, you should leave it as it is, + +But if you like to do everything on your own and this auto-update is frequently leading you to [“Unable to lock the administration directory” error][22], maybe you can change the auto updates behavior. + +You can opt for the Show immediately so that it notifies you of security updates as soon as they are available instead of automatically installing. + +![Control the auto updates settings][23] + +#### 6\. Control automatic suspend and screenlock for laptops + +If you are using Ubuntu 20.04 on a laptop then you may want to pay attention to a few power and screenlock settings. + +If your laptop is on battery mode, Ubuntu will suspend the system after 20 minutes of inactivity. This is done to save battery power. Personally, I don’t like it and thus I disable it. + +Similarly, if you leave your system for a few minutes, it automatically locks the screen. I don’t like this behavior as well so I prefer disabling it. + +![Power Settings in Ubuntu 20.04][24] + +#### 7\. Enjoy dark mode + +One of the [most talked about features of Ubuntu 20.04][25] is the dark mode. You can enable the dark mode by going into Settings and selecting it under Appearance section. + +![Enable Dark Theme Ubuntu][26] + +You may have to do some [additional tweaking to get full dark mode in Ubuntu 20.04][27]. + +#### 8\. Control desktop icons and launcher + +If you want a minimal looking desktop, you can disable the icons on the desktop. You can also disable the launcher from the left side and the appindicators in the top panel. + +All this can be controlled via the new GNOME Extensions that is already available by default. + +![][28] + +By the way, you can also change the position of the launcher to the bottom or to the right by going to the Settings->Appearance. + +#### 9\. Use emojis (smileys) and special characters or disable it from the search + +Ubuntu provides an easy way to use smiley or the emoticons. There is a dedicated application called Characters installed by default. It basically gives you [Unicode][29] of the emojis. + +Not only emojis, you can use it to get the unicode for French, German, Russian and Latin characters. Clicking on the symbol gives you the opportunity to copy the unicode and when you paste this code, your chosen symbol should be typed. + +![Emoji Ubuntu][30] + +You’ll find these special characters and emoticons appearing in the desktop search as well. You can copy them from the search results as well. + +![Emojis appear in desktop search][31] + +If you don’t want to see them in search results, you should disable their access to the search feature. The next section discuss how to do that. + +#### 10\. Master the desktop search + +The GNOME desktop has a powerful search feature. Most people use it for searching installed applications but it is more than just that. + +Press the super key (Windows key) and search for something. It will show any applications that matches that search term, followed by system settings and matching applications available in the software center. + +![Desktop search][32] + +Not only that, the search can also find text inside files. If you are using the calendar, it can also find your meetings and reminders. You can even do quick calculations in the search and copy its result. + +![Quick Calculations Ubuntu Search][33] + +You can control what can be searched and in which order by going into Settings. + +![][34] + +#### 11\. Use nightlight feature to reduce eye strain at night + +If you use your computer or smartphone at night, you should use the night light feature to reduce eye strain. I feel that it helps a lot. + +The night light feature adds a yellow tint to the screen which is less pinching than the white light. + +You can enable night light in the Settings -> Displays and switching to Night Light tab. You can set the ‘yellowness’ as per your liking. + +![Nightlight feature][35] + +#### 12\. Got a 2K/4K screen? Use fractional scaling to get bigger icons and fonts + +If you feel that the icons, fonts, folders everything looks too small on your HiDPI screen, you can take advantage of the fractional scaling. + +Enabling fractional scaling gives you more options to increase the size between 100% to 200%. You can choose the scaling size that suits your preference. + +![Enable fractional scaling from Settings -> Displays][36] + +#### 13\. Explore GNOME Extensions to extend the usability of GNOME desktop + +The GNOME desktop has tiny plugins or add-ons called Extensions. You should [learn to use GNOME extensions][37] to extend the usability of your system. + +As you can see in the image below, the weather extension shows the weather information in the top panel. A tiny but useful thing. You may also take a look at some of [best GNOME extensions][38] here. Don’t install all of them, use only those that are useful to you. + +![Weather Extension][39] + +#### 14\. Enable ‘do not disturb’ mode and focus on work + +If you want to concentrate on work, disabling desktop notifications would come handy. You can easily enable ‘do not disturb’ mode and mute all notifications. + +![Enable ‘Do Not Disturb’ to get rid of desktop notifications][40] + +These notifications will still be in the message tray so that you can read them later but they won’t pop up on the desktop anymore. + +#### 15\. Clean your system + +This is something you don’t need to do right after installing Ubuntu. But keeping it in mind will help you. + +Over the time, your system will have significant amount of packages that won’t be needed anymore. You can remove them all in one go with this command: + +``` +sudo apt autoremove +``` + +There are other [ways to clean Ubuntu to free disk space][41] but this is the easiest and safest. + +#### 16\. Tweak and customize the GNOME desktop to your liking + +I highly recommend [installing GNOME Tweaks tool][42]. This will give you access to a few additional settings to tweak. + +![Gnome Tweaks Tool][43] + +For example, you can [display battery percentage][44], [fix right click in touchpad issue][45], change shell theme, change mouse pointer speed, display date and week numbers, change application window behavior etc. + +There is no end to customization and I cannot probably most of them here. This is why I recommend [reading these articles][42] about [customizing GNOME desktop][46]. + +You can also [install new themes in Ubuntu][47] though personally, I like the default theme in this release. This is the first time that I have stuck with the default icons and theme in an Ubuntu release. + +#### What do you do after installing Ubuntu? + +If you are an Ubuntu beginner, I recommend [going through this collection of Ubuntu tutorials][48] to get started with it. + +So these were my recommendations. What are the steps you follow after installing Ubuntu? Share your favorite things and I might update this article with your suggestions. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-20-04-release-features/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/things-to-do-after-installing-ubuntu-20-04.jpg?ssl=1 +[3]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ +[4]: https://itsfoss.com/find-desktop-environment/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-updater-ubuntu-20-04.jpg?ssl=1 +[6]: https://itsfoss.com/ubuntu-repositories/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-updates-settings-ubuntu-20-04.jpg?ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/extra-repositories-ubuntu-20.jpg?ssl=1 +[9]: https://itsfoss.com/install-media-codecs-ubuntu/ +[10]: https://itsfoss.com/install-microsoft-fonts-ubuntu/ +[11]: https://ubuntu-restricted-extras/ +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/installing_ubuntu_restricted_extras.jpg?ssl=1 +[13]: https://itsfoss.com/remove-install-software-ubuntu/ +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-center-ubuntu-20.png?resize=800%2C509&ssl=1 +[15]: https://itsfoss.com/best-ubuntu-apps/ +[16]: https://itsfoss.com/install-chrome-ubuntu/ +[17]: https://itsfoss.com/linux-gaming-guide/ +[18]: https://itsfoss.com/install-steam-ubuntu-linux/ +[19]: https://itsfoss.com/steam-play/ +[20]: https://github.com/FeralInteractive/gamemode +[21]: https://en.wikipedia.org/wiki/Rise_of_the_Tomb_Raider +[22]: https://itsfoss.com/could-not-get-lock-error/ +[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/auto-updates-ubuntu.png?resize=800%2C361&ssl=1 +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/power-settings-ubuntu-20-04.png?fit=800%2C591&ssl=1 +[25]: https://www.youtube.com/watch?v=lpq8pm_xkSE +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-dark-theme-ubuntu.png?ssl=1 +[27]: https://itsfoss.com/dark-mode-ubuntu/ +[28]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/disable-dock-ubuntu-20-04.png?ssl=1 +[29]: https://en.wikipedia.org/wiki/List_of_Unicode_characters +[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/emoji-ubuntu.jpg?ssl=1 +[31]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/emojis-desktop-search-ubuntu.jpg?ssl=1 +[32]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-desktop-search-1.jpg?ssl=1 +[33]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/quick-calculations-ubuntu-search.jpg?ssl=1 +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/search-settings-control-ubuntu.png?resize=800%2C534&ssl=1 +[35]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/nightlight-ubuntu-20-04.png?ssl=1 +[36]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/fractional-scaling-ubuntu.jpg?ssl=1 +[37]: https://itsfoss.com/gnome-shell-extensions/ +[38]: https://itsfoss.com/best-gnome-extensions/ +[39]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/weather-extension-ubuntu.jpg?ssl=1 +[40]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/do-not-distrub-option-ubuntu-20-04.png?ssl=1 +[41]: https://itsfoss.com/free-up-space-ubuntu-linux/ +[42]: https://itsfoss.com/gnome-tweak-tool/ +[43]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/gnome-tweaks-tool-ubuntu-20-04.png?fit=800%2C551&ssl=1 +[44]: https://itsfoss.com/display-battery-ubuntu/ +[45]: https://itsfoss.com/fix-right-click-touchpad-ubuntu/ +[46]: https://itsfoss.com/gnome-tricks-ubuntu/ +[47]: https://itsfoss.com/install-themes-ubuntu/ +[48]: https://itsfoss.com/getting-started-with-ubuntu/ From d4b65fc799876fc42788c9c14efc0464b5092021 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 24 Apr 2020 01:06:17 +0800 Subject: [PATCH 0430/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200423=20Gett?= =?UTF-8?q?ing=20to=20know=20our=20new,=20virtual=20world?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200423 Getting to know our new, virtual world.md --- ... Getting to know our new, virtual world.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20200423 Getting to know our new, virtual world.md diff --git a/sources/tech/20200423 Getting to know our new, virtual world.md b/sources/tech/20200423 Getting to know our new, virtual world.md new file mode 100644 index 0000000000..70eebbbeee --- /dev/null +++ b/sources/tech/20200423 Getting to know our new, virtual world.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting to know our new, virtual world) +[#]: via: (https://opensource.com/article/20/4/virtual-community-management) +[#]: author: (Patricia Dugan https://opensource.com/users/patricia-dugan) + +Getting to know our new, virtual world +====== +Our current forced physical separation could generate innovations that +actually bring our communities closer together. +![Women in computing and open source v5][1] + +Witnessing the ongoing global impact of COVID-19 is a profoundly affecting experience that continues to humble us all in ways we couldn't have anticipated. Technology organizations are quickly evolving within this new reality, in which all of our human interactions are virtual until further notice. + +### Virtual open source community management + +When it comes to nurturing cultures designed to promote and reward open source innovation—as well as communities' economic, technological, and physical wellbeing—I can best speak to those I help build and manage. I believe communities should be built by weaving a tapestry of demographics and ranges of expertise. They should do this in a way that facilitates rich communication and empowers those building open source software to share knowledge with each other. + +The move to virtual connection and digitalized events only makes these methods more crucial. + +I'll share an example. Recently, I was speaking with a pillar of the Traefik open source community, known as a [Traefik Ambassador][2], based in Turkey, over video conference about a potential webinar. He suggested that, instead, we expand the speaker set to include other community members. Soon, we'd invited other contributors from Poland and Switzerland. We met online, and out of that conversation, the webinar has evolved into a collaborative series with community members taking turns presenting insights and melding different types of software together. What struck me was that if we'd had this conversation just one month ago, it would have simply focused on the creation of an asset. Now, contributors are bonding over a purpose-driven creation, with greater intention around facilitating innovation and excitement. + +Based on my experience building and growing open source communities, I believe that this new era of virtual connection offers an unprecedented opportunity for innovation and growth—as long as it is managed with equal focus on the people creating it. Below are five observations on how the world of open source can positively shape the future of innovation in a virtual and seemingly uncertain world. + +### The virtual world is flat. + +Open source communities, teams, and backing companies provide an exceptional model of how to accelerate innovation. That's especially true in these extraordinary times. At its core, open source democratizes the development process, something we see replicated more widely in our new virtual ecosystems. As the opportunity for input becomes more inclusive, organizations are seeing a flattening in infrastructure, both in communications and in operations. Existing hierarchical power structures are weakening as more voices are heard, and the best ideas are given the chance to rise to the top through greater exposure. + +As social distancing makes backchannel and handshake agreements much more complicated to execute, I predict that the traditional dance required to access and take positions in leadership will be replaced by flatter, more open methods that ultimately produce fresher—and better—perspectives. Online communication has a way of laying bare the real substance of interactions and ideas, bolstering meritocracy that's central to the strength of open source. + +### The virtual world is fast. + +This "flattening" structural shift has the potential to increase the pace and quality of innovation, as virtual events and communications widen the spotlight to now shine a light on previously unseen contributors. Creative minds among engineers, developers, and others outside of traditional leadership positions will leverage their comfort with the web and virtual channels to find each other and collaborate faster. This is nothing new for those in open source, and I expect organizations still clinging to legacy approaches will find themselves investing in learning how to implement flatter, virtual communications structures, and beginning to build them into traditional operational models. This means doubling down on efficiency and being willing to let go of the ["it's always been done this way"][3] mentality. + +### The virtual world needs community. + +Developers can conserve energy attending virtual events: there's no commute, nor other distractions from the work at hand. Working remotely and connecting only via virtual mediums enables open source contributors to create, share, and use code just about as fast as their brains allow, empowering rapid code contributions, collaborations, and new solutions produced with velocity. + +While this shift may result in productivity gains, organizations must be careful of creating the impression that a team member's most important asset is their brain. When open source developers were asked what the best part of their job was, [62% claimed it was their "personal passion."][4] Recognizing individuals as unique contributors to open source communities is necessary and essential to development—both technical and human. During this period, when we're hitting the pause button on in-person interaction, remote interactions via chats, video conferences, and phone calls will enable the human moments necessary for growth and connection. Those in open source rely on the power of community, and this extraordinary time will require the continuous and earnest commitment to it. + +### The virtual world is composed of individuals. + +The potential for greater innovation and meritocracy through virtual-only channels will only be realized if communities, organizations, and individuals also pursue and achieve wellness. It's crucial for the interpersonal bonds that maintain our energy and psychological health—traditionally forged through real-life, face-to-face contact—to continue to exist as part of the way we now work. If that disappears, there's the risk that our industry and communities become purely transactional, lacking the joy and drive that carries work forward, much less great work and innovation. Developers are especially rooted in a sense of purpose, with [only 3% reporting that money and perks were the best part of their job.][4] + +Overall wellness and support to prevent burnout should already have been central considerations for modern organizations, but they are even more important now. Virtual connectivity may set us up to work fast, but that can backfire if we're not also set up to be well. + +### The virtual world needs kindness. + +I also predict that virtual-only communication will close the distance between our online avatars and ourselves as real people. The impact of "toxic" individuals, hidden behind a computer, with little to no consequence for being a "bad actor," will be reduced and less acceptable. A growing presence of new voices will set the tone, adhering to well thought out codes of conduct, making poor behavior explicitly unwelcome. As much of our connection moves online, the norms that guide our offline behavior will become increasingly important. We'll transition to a less individualistic paradigm, and open source's long history of considering what defines good citizenship will offer insight to those looking to integrate a sense of shared responsibility into organizations. + +I feel extremely grateful to be in technology, particularly in the open source world, given it's an industry built upon the promise of innovation. At least for the moment, we as an industry can serve as a lighthouse for connection in difficult times, and as a model for collaboration and intention for those not as familiar with how to be highly productive in a virtual world. For the open source community and beyond, there is a great opportunity to lean into creating as much beneficial virtual culture as we can. Through this experience, we'll all learn new ways of interacting, which will serve us well in the future. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/virtual-community-management + +作者:[Patricia Dugan][a] +选题:[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/patricia-dugan +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_5.png?itok=YHpNs_ss (Women in computing and open source v5) +[2]: https://info.containo.us/traefik-ambassador-program +[3]: https://goleansixsigma.com/the-most-dangerous-phrase/ +[4]: https://www.linuxfoundation.org/wp-content/uploads/2019/10/osjobsreport_2018.pdf From 131e6501cbf7815dae50982b3bc6bdccfc860785 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 24 Apr 2020 01:07:06 +0800 Subject: [PATCH 0431/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200423=204=20?= =?UTF-8?q?open=20source=20chat=20applications=20you=20should=20use=20righ?= =?UTF-8?q?t=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200423 4 open source chat applications you should use right now.md --- ...t applications you should use right now.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20200423 4 open source chat applications you should use right now.md diff --git a/sources/tech/20200423 4 open source chat applications you should use right now.md b/sources/tech/20200423 4 open source chat applications you should use right now.md new file mode 100644 index 0000000000..25aa100c53 --- /dev/null +++ b/sources/tech/20200423 4 open source chat applications you should use right now.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 open source chat applications you should use right now) +[#]: via: (https://opensource.com/article/20/4/open-source-chat) +[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) + +4 open source chat applications you should use right now +====== +Collaborating remotely is an essential capability now, making open +source real-time chat an essential piece of your toolbox. +![Chat bubbles][1] + +The first thing we usually do after waking up in the morning is to check our cellphone to see if there are important messages from our colleagues and friends. Whether or not it's a good idea, this behavior has become part of our daily lifestyle. + +> _"Man is a rational animal. He can think up a reason for anything he wants to believe."_ +> _– Anatole France_ + +No matter the soundness of the reason, we all have a suite of communication tools—email, phone calls, web-conferencing tools, or social networking—we use on a daily basis. Even before COVID-19, working from home already made these communication tools an essential part of our world. And as the pandemic has made working from home the new normal, we're facing unprecedented changes to how we communicate, which makes these tools not merely essential but now required. + +### Why chat? + +When working remotely as a part of a globally distributed team, we must have a collaborative environment. Chat applications play a vital role in helping us stay connected. In contrast to email, chat applications provide fast, real-time communications with colleagues around the globe. + +There are a lot of factors involved in choosing a chat application. To help you pick the right one for you, in this article, I'll explore four open source chat applications and one open source video-communication tool (for when you need to be "face-to-face" with your colleagues), then outline some of the features you should look for in an effective communication application. + +### 4 open source chat apps + +#### Rocket.Chat + +![Rocket.Chat][2] + +[Rocket.Chat][3] is a comprehensive communication platform that classifies channels as public (open to anyone who joins) or private (invitation-only) rooms. You can also send direct messages to people who are logged in; share documents, links, photos, videos, and GIFs; make video calls; and send audio messages without leaving the platform. + +Rocket.Chat is free and open source, but what makes it unique is its self-hosted chat system. You can download it onto your server, whether it's an on-premises server or a virtual private server on a public cloud. + +Rocket.Chat is completely free, and its [source code][4] is available on GitHub. Many open source projects use Rocket.Chat as their official communication platform. It is constantly evolving with new features and improvements. + +The things I like the most about Rocket.Chat are its ability to be customized according to user requirements and that it uses machine learning to do automatic, real-time message translation between users. You can also download Rocket.Chat for your mobile device and use it on the go. + +#### IRC + +![IRC on WeeChat 0.3.5][5] + +[Internet Relay Chat (IRC)][6] is a real-time, text-based form of communication. Although it's one of the oldest forms of electronic communication, it remains popular among many well-known software projects. + +IRC channels are discrete chat rooms. It allows you to have conversations with multiple people in an open channel or chat with someone privately one-on-one. If a channel name starts with a #, you can assume it to be official, whereas chat rooms that begin with ## are unofficial and usually casual. + +[Getting started with IRC][7] is easy. Your IRC handle or nickname is what allows people to find you, so it must be unique. But your choice of IRC client is completely your decision. If you want a more feature-rich application than a standard IRC client, you can connect to IRC with [Riot.im][8]. + +Given its age, why should you still be on IRC? For one reason, it remains the home for many of the free and open source projects we depend on. If you want to participate in open source software and communities, IRC is the option to get started. + +#### Zulip + +![Zulip][9] + +[Zulip][10] is a popular group-chat application that follows the topic-based threading model. In Zulip, you subscribe to streams, just like in IRC channels or Rocket.Chat. But each Zulip stream opens a topic that is unique, which helps you track conversations later, thus making it more organized. + +Like other platforms, it supports emojis, inline images, video, and tweet previews. It also supports LaTeX for sharing math formulas or equations and Markdown and syntax highlighting for sharing code. + +Zulip is cross-platform and offers APIs for building your own integrations. Something I especially like about Zulip is its integration feature with GitHub: if I'm working on an issue, I can use Zulip's marker to link back to the pull request ID. + +Zulip is open source (you can access its [source code][11] on GitHub) and free to use, but it has paid offerings for on-premises support, [LDAP][12] integration, and more storage. + +#### Let's Chat + +![Let's Chat][13] + +[Let's Chat][14] is a self-hosted chat solution for small teams. It runs on Node.js and MongoDB and can be deployed to local servers or hosted services with a few clicks. It's free and open source, with the [source code][15] available on GitHub. + +What differentiates Let's Chat from other open source chat tools is its enterprise features: it supports LDAP and [Kerberos][16] authentication. It also has all the features a new user would want: you can search message history in the archives and tag people with mentions like @username. + +What I like about Let's Chat is that it has private and password-protected rooms, image embeds, GIPHY support, and code pasting. It is constantly evolving and adding more features to its bucket. + +### Bonus: Open source video chat with Jitsi + +![Jitsi][17] + +Sometimes text chat isn't enough, and you need to talk to someone face-to-face. In times like these, when in-person meetings aren't an option, video chat is the best alternative. [Jitsi][18] is a complete, open source, multi-platform, and WebRTC-compliant videoconferencing tool. + +Jitsi began with Jitsi Desktop and has evolved into multiple [projects][19], including Jitsi Meet, Jitsi Videobridge, jibri, and libjitsi, with [source code][20] published for each on GitHub. + +Jitsi is secure and scalable and supports advanced video-routing concepts such as simulcast and bandwidth estimation, as well as typical capabilities like audio, recording, screen-sharing, and dial-in features. You can set a password to secure your video-chat room and protect it against intruders, and it also supports live-streaming over YouTube. You can also build your own Jitsi server and host it on-premises or on a virtual private server, such as a Digital Ocean Droplet. + +What I like most about Jitsi is that it is free and frictionless; anyone can start a meeting in no time by visiting [meet.jit.si][21], and users are good to go with no need for registration or installation. (However, registration gives you calendar integrations.) This low-barrier-to-entry alternative to popular videoconferencing services is helping Jitsi's popularity spread rapidly. + +### Tips for choosing a chat application + +The variety of open source chat applications can make it hard to pick one. The following are some general guidelines for choosing a chat app. + + * Tools that have an interactive interface and simple navigation are ideal. + * It's better to look for a tool that has great features and allows people to use it in various ways. + * Integrations with tools you use can play an important role in your decision. Some tools have great and seamless integrations with GitHub, GitLab, and certain applications, which is a useful feature. + * It's convenient to use tools that have a pathway to hosting on cloud-based services. + * The security of the chat service should be taken into account. The ability to host services on a private server is necessary for many organizations and individuals. + * It's best to select communication tools that have rich privacy settings and allow for both private and public chat rooms. + + + +Since people are more dependent than ever on online services, it is smart to have a backup communication platform available. For example, if a project is using Rocket.Chat, it should also have the option to hop into IRC, if necessary. Since these services are continuously updating, you may find yourself connected to multiple channels, and this is where integration becomes so valuable. + +Of the different open source chat services available, which ones do you like and use? How do these tools help you work remotely? Please share your thoughts in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/open-source-chat + +作者:[Sudeshna Sur][a] +选题:[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/sudeshna-sur +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) +[2]: https://opensource.com/sites/default/files/uploads/rocketchat.png (Rocket.Chat) +[3]: https://rocket.chat/ +[4]: https://github.com/RocketChat/Rocket.Chat +[5]: https://opensource.com/sites/default/files/uploads/irc.png (IRC on WeeChat 0.3.5) +[6]: https://en.wikipedia.org/wiki/Internet_Relay_Chat +[7]: https://opensource.com/article/16/6/getting-started-irc +[8]: https://opensource.com/article/17/5/introducing-riot-IRC +[9]: https://opensource.com/sites/default/files/uploads/zulip.png (Zulip) +[10]: https://zulipchat.com/ +[11]: https://github.com/zulip/zulip +[12]: https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol +[13]: https://opensource.com/sites/default/files/uploads/lets-chat.png (Let's Chat) +[14]: https://sdelements.github.io/lets-chat/ +[15]: https://github.com/sdelements/lets-chat +[16]: https://en.wikipedia.org/wiki/Kerberos_(protocol) +[17]: https://opensource.com/sites/default/files/uploads/jitsi_0_0.jpg (Jitsi) +[18]: https://jitsi.org/ +[19]: https://jitsi.org/projects/ +[20]: https://github.com/jitsi +[21]: http://meet.jit.si From c4b74b4ff7f1815c5a41db442f79484455827f77 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 24 Apr 2020 08:43:10 +0800 Subject: [PATCH 0432/1809] translated --- ...e and Open Source Audio-Video Converter.md | 97 ------------------- ...e and Open Source Audio-Video Converter.md | 91 +++++++++++++++++ 2 files changed, 91 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md create mode 100644 translated/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md diff --git a/sources/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md b/sources/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md deleted file mode 100644 index 4b793e918a..0000000000 --- a/sources/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (MystiQ: A Free and Open Source Audio/Video Converter) -[#]: via: (https://itsfoss.com/mystiq/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -MystiQ: A Free and Open Source Audio/Video Converter -====== - -_**Brief: MystiQ is a new open-source video converter tool available for Linux and Windows. It uses FFMPEG underneath and provides you a neat and clean graphical interface based on Qt.**_ - -### MystiQ, a QT-based GUI Frontend for FFmpeg - -![][1] - -An audio/video conversion tool always comes in handy for every computer user across multiple platforms. - -For that very same reason, I thought it would be a great idea to highlight the [MystiQ app][2] – which is a relatively new video/audio converter tool available for Linux and Windows users. As of now, there’s no support for macOS – but it could arrive in the near future. - -MystiQ is a graphical frontend for [FFmpeg][3] based on [Qt 5 user interface][4]. Now, you can always [install and use ffmpeg in Linux command line][5] but that’s not very comfortable, is it? This is why tools like [Handbrake][6] and MystiQ exist to make our life easier. - -Since MystiQ is based on FFmpeg, you can use it for some basic video editing like trimming a video, rotating it etc. - -Let’s have a look at its features. - -### Features of MystiQ video converter - -![][7] - -Even though the MystiQ app is fairly new to the scene – it packs a good set of essential features. Here’s an overview of what it offers: - - * Video conversion - * Audio conversion (extracting the audio from the video as well) - * Formats supported: MP4, WEBM, MKV, MP3, MOV, OGG, WAV, ASF, FLV, 3GP, M4A, and a few others. - * Cross-platform (Windows & Linux) - * Packages for both 32-bit and 64-bit systems available - * Ability to tweak the audio quality (sample rate, bit rate, etc,.) for conversion - * **Basic video editing capabilities** (clipping the video, inserting a subtitle, rotating the video, scaling the video, etc) - * Convert your color video to black and white - * Several presets available to easily convert a video for the best quality or for the best compression. - - - -**Recommended Read:** - -![][8] - -#### [Easily Convert Audio File Formats with SoundConverter in Linux][9] - -If you are looking for converting audio file formats to wav, mp3, ogg or any other format, SoundConverter is the tool you need in Linux. - -### Installing MystiQ - -You may not find it listed in your software center – but it is quite easy to get it installed on a Linux distro. - -It provides an **.AppImage file** and **.deb/.rpm** files (with 32-bit and 64-bit packages). If you’re curious, you can read [how to use the AppImage file][10] if you want to use that. - -You can also find their [GitHub page][11] and look at the source code or any recent pre-release packages if you want to help them test the software to improve it. - -You can download the installer files for both Linux and Windows from its official website. - -[Download MystiQ][2] - -**Wrapping Up** - -For this quick highlight article, I used [Pop!_OS][12] 20.04 to test the MytiQ converter app and I had no issues converting video and audio files. And, the conversion was fast enough for an average user like me. - -Feel free to try it out and let me know your thoughts on it! Also, if you’ve been using another tool to convert videos and audio on Linux, what is it? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/mystiq/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/mystiq-converter-ft.jpg?ssl=1 -[2]: https://mystiqapp.com/ -[3]: https://www.ffmpeg.org/ -[4]: https://www.qt.io/ -[5]: https://itsfoss.com/ffmpeg/ -[6]: https://itsfoss.com/handbrake/ -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/mystiq-options.jpg?ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/Convert-audio-file-format-linux.png?fit=800%2C450&ssl=1 -[9]: https://itsfoss.com/sound-converter-linux/ -[10]: https://itsfoss.com/use-appimage-linux/ -[11]: https://github.com/swl-x/MystiQ/ -[12]: https://system76.com/pop diff --git a/translated/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md b/translated/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md new file mode 100644 index 0000000000..1c8c5e6fe4 --- /dev/null +++ b/translated/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (MystiQ: A Free and Open Source Audio/Video Converter) +[#]: via: (https://itsfoss.com/mystiq/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +MystiQ:一个免费开源音频/视频转换器 +====== + +_**简述:MystiQ 是可用于 Linux 和 Windows 的新开源视频转换器工具。它的底层使用 FFMPEG,并为你提供基于 Qt 的整洁干净的图形界面。**_ + +### MystiQ,一个基于 QT 的 FFmpeg GUI 前端 + +![][1] + +一个音频/视频转换工具可为跨多个平台的每位计算机用户提供方便。 + +出于同样的原因,我着重介绍 [MystiQ][2] 是个好主意,这是一个相对较新的视频/音频转换器工具,可用于 Linux 和 Windows。截至目前,它还不支持 macOS,但可能会在不久的将来出现。 + +MystiQ 是基于 [Qt 5 界面][4]的 [FFmpeg][3] 图形前端。 现在,你可以随时[在 Linux 命令行中安装并使用 ffmpeg][5],但这不是很舒服,是吗? 这就是为什么 [Handbrake][6] 和 MystiQ 之类的工具可以使我们的生活更轻松的原因。 + +由于 MystiQ 基于 FFmpeg,因此你可以将其用于一些基本的视频编辑,例如修剪、旋转等。 + +让我们来看看它的功能。 + +### MystiQ 视频转换器的功能 + +![][7] + +即使 MystiQ 目前还算是一个新事物,但它也包含了一组很好的基本功能。以下它提供的: + + * 视频转换 + * 音频转换(也可从视频中提取音频) + * 支持格式:MP4、WEBM、MKV、MP3、MOV、OGG、WAV、ASF、FLV、3GP、M4A 等。 + * 跨平台(Windows 和 Linux) + * 适用于 32 位和 64 位系统的安装包 + * 能够调整音频质量(采样率、比特率等)进行转换 + * **基本视频编辑功能**(剪辑视频、插入字幕、旋转视频、缩放视频等) + * 将彩色视频转换为黑白 + * 可轻松转换视频的多个预设以获得最佳质量或获得最佳压缩效果。 + + +#### [在 Linux 中使用 SoundConverter 轻松转换音频文件格式][9] + +如果你想将音频文件格式转换为 wav、mp3、ogg 或任何其他格式,SoundConverter 是你在 Linux 中所需的工具。 + +### 安装 MystiQ + +你可能没有在软件中心中找到它,但将它安装在 Linux 发行版上非常容易。 + +它提供了 **.AppImage** 文件和 **.deb/.rpm** 文件(32 位和 64 位软件包)。如果你好奇想使用的话,可以阅读[如何使用 AppImage 文件][10]。 + +如果你想帮助他们测试软件进行改进,你还可以找到他们的 [GitHub 页面][11],并查看源码或任何近期的预发布软件包。 + +你可以在其官方网站下载适用于 Linux 和 Windows 的安装程序文件。 + +[下载 MystiQ][2] + +**总结** + +在本文中,我使用 [Pop!\_OS][12] 20.04 测试了 MytiQ 转换器,并且在转换视频和音频时没遇到问题。而且,对于像我这样的普通用户来说,它的转换速度足够快。 + +请尝试一下,让我知道你对它的想法!另外,如果你在 Linux 上一直使用其他工具转换视频和音频,那它是什么? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/mystiq/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/mystiq-converter-ft.jpg?ssl=1 +[2]: https://mystiqapp.com/ +[3]: https://www.ffmpeg.org/ +[4]: https://www.qt.io/ +[5]: https://itsfoss.com/ffmpeg/ +[6]: https://itsfoss.com/handbrake/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/mystiq-options.jpg?ssl=1 +[9]: https://itsfoss.com/sound-converter-linux/ +[10]: https://itsfoss.com/use-appimage-linux/ +[11]: https://github.com/swl-x/MystiQ/ +[12]: https://system76.com/pop From 4f12c1304bc3e5c2603df5ddc49940afec5d6cb6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 24 Apr 2020 09:01:19 +0800 Subject: [PATCH 0433/1809] translating --- .../tech/20200422 Things You Should Know About Ubuntu 20.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200422 Things You Should Know About Ubuntu 20.04.md b/sources/tech/20200422 Things You Should Know About Ubuntu 20.04.md index 48ac52bece..1c4a13810e 100644 --- a/sources/tech/20200422 Things You Should Know About Ubuntu 20.04.md +++ b/sources/tech/20200422 Things You Should Know About Ubuntu 20.04.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b83daa693a88eb733277c9e5b93f80a515680287 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 24 Apr 2020 09:06:25 +0800 Subject: [PATCH 0434/1809] Rename sources/tech/20200424 Ubuntu 20.04 LTS Released. Download Now.md to sources/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md --- .../20200424 Ubuntu 20.04 LTS Released. Download Now.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200424 Ubuntu 20.04 LTS Released. Download Now.md (100%) diff --git a/sources/tech/20200424 Ubuntu 20.04 LTS Released. Download Now.md b/sources/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md similarity index 100% rename from sources/tech/20200424 Ubuntu 20.04 LTS Released. Download Now.md rename to sources/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md From 141e8cfda136c948e442d2dcccb07280e810c562 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 24 Apr 2020 09:13:16 +0800 Subject: [PATCH 0435/1809] Rename sources/tech/20200423 Getting to know our new, virtual world.md to sources/talk/20200423 Getting to know our new, virtual world.md --- .../20200423 Getting to know our new, virtual world.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200423 Getting to know our new, virtual world.md (100%) diff --git a/sources/tech/20200423 Getting to know our new, virtual world.md b/sources/talk/20200423 Getting to know our new, virtual world.md similarity index 100% rename from sources/tech/20200423 Getting to know our new, virtual world.md rename to sources/talk/20200423 Getting to know our new, virtual world.md From 486a5f22c463592d997bdfc113b14bf549a41cd3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 Apr 2020 09:18:34 +0800 Subject: [PATCH 0436/1809] APL --- .../news/20200424 Ubuntu 20.04 LTS Released. Download Now.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md b/sources/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md index 9eb9a036c7..dff14c521e 100644 --- a/sources/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md +++ b/sources/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d710d6f17edb6072435b48344ccae40b7889d4e9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 Apr 2020 10:50:31 +0800 Subject: [PATCH 0437/1809] TSL&PRF --- ...Ubuntu 20.04 LTS Released. Download Now.md | 127 ------------------ ...Ubuntu 20.04 LTS Released. Download Now.md | 121 +++++++++++++++++ 2 files changed, 121 insertions(+), 127 deletions(-) delete mode 100644 sources/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md create mode 100644 translated/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md diff --git a/sources/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md b/sources/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md deleted file mode 100644 index dff14c521e..0000000000 --- a/sources/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md +++ /dev/null @@ -1,127 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ubuntu 20.04 LTS Released. Download Now!) -[#]: via: (https://itsfoss.com/download-ubuntu-20-04/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Ubuntu 20.04 LTS Released. Download Now! -====== - -_**Brief: Ubuntu 20.04 LTS Focal Fossa has been finally released. Here is a quick recap of the new features and the download links for Ubuntu 20.04** **and the official flavours for it**._ - -The wait is finally over. Ubuntu 20.04 LTS has finally arrived and is available to download! - -![][1] - -If you were already using Ubuntu 19.10, you may not notice a lot of noticeable differences – but the list of improvements that I’m looking at is indeed impressive. - -If you’re curious about what’s new, I’ll mention a few key highlights for this release. - -### Ubuntu 20.04: What’s new? - -Considering the previous 18.04 LTS release, Ubuntu 20.04 LTS involves a lot of visual changes and under-the-hood improvements as well. - -Of course, with the addition of [GNOME 3.36][2], a major visual upgrade and the performance improvement is quite obvious. Here’s a video highlighting what’s new in Ubuntu 20.04: - -You can also dive into one of our articles highlighting [new features of Ubuntu 20.04][3], if you’re curious. - -In either case, let me just give you some highlights: - - * GNOME 3.36 is the default desktop - * The performance has improved a lot - * The new Yaru theme is gorgeous, comes in dark mode as well - * You won’t have to see the Amazon app anymore, it’s gone for good! - * Improved [ZFS][4] support - * You get the latest [Linux Kernel 5.4][5] (LTS) - * Adds exFAT support - * Improved hardware and graphics support - * Updated software Python 3.8.2 - * Wireguard is being backported to Linux Kernel 5.4 to be utilized on Ubuntu 20.04 - - - -If you want to see the features in detail and in action, please watch this video highlighting the best features of 20.04 LTS: - -[Subscribe to our YouTube channel for more Linux videos][6] - -In case you’re new to Ubuntu and have questions about Ubuntu 20.04, we also have a quick [Ubuntu 20.04 FAQ][7] article for you. - -### Upgrade to Ubuntu 20.04 from 18.04 and 19.10 - -If you are already using Ubuntu 18.04 or 19.10, you can easily upgrade to Ubuntu 20.04 from within your system. - -This way, your files and most of the applications settings remain as it is while you start using the new version without reinstalling it from the ISO. - -You can read this detailed tutorial to learn [how to upgrade Ubuntu to a newer version][8]. - -Please note that if you are using Lubuntu 18.04, you must not upgrade to Lubuntu 20.04. Lubuntu 18.04 used Lxde desktop while later versions use LXQt desktop. Upgrading this way result in conflicts and possible broken system. - -### Download Ubuntu 20.04 LTS - -You can grab the ISO or the torrent file, depending on what you prefer: - -[Ubuntu 20.04 LTS (ISO)][9] - -[Ubuntu 20.04 LTS (Torrent)][10] - -Please follow this tutorial to learn [how to install Ubuntu][11]. - -### Download Ubuntu 20.04 LTS Official Flavours - -If you want to grab an official flavour of Ubuntu with a different desktop environment, please follow the links below. - -[Ubuntu MATE 20.04 LTS][12] - -[Kubuntu 20.04 LTS][13] - -[Xubuntu 20.04 LTS][14] - -[Ubuntu Budgie 20.04 LTS][15] - -[Ubuntu Studio 20.04 LTS][16] - -[Lubuntu 20.04 LTS][17] - -If you don’t find the latest ISO/torrent file listed in their respective official sites, simply head to [cdimages.ubuntu.com][18] to find all the flavours listed. - -Next, navigate to the **name-of-the-distro** -> **releases** -> **20.04** -> **release** and then you should find the links to the ISO and the torrent files listed. - -If you have questions, please refer to this article that answers [frequently asked questions about Ubuntu 20.04][7]. If you are going to install it, do check our recommended [things to do after installing Ubuntu 20.04][19]. - -Enjoy Ubuntu 20.04 LTS Focal Fossa! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/download-ubuntu-20-04/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Ubuntu-20.04-LTS-released.png?ssl=1 -[2]: https://itsfoss.com/gnome-3-36-release/ -[3]: https://itsfoss.com/ubuntu-20-04-release-features/ -[4]: https://itsfoss.com/what-is-zfs/ -[5]: https://itsfoss.com/linux-kernel-5-4/ -[6]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[7]: https://itsfoss.com/ubuntu-20-04-faq/ -[8]: https://itsfoss.com/upgrade-ubuntu-version/ -[9]: http://releases.ubuntu.com/focal/ubuntu-20.04-desktop-amd64.iso -[10]: http://releases.ubuntu.com/focal/ubuntu-20.04-desktop-amd64.iso.torrent -[11]: https://itsfoss.com/install-ubuntu/ -[12]: https://ubuntu-mate.org/download/amd64/focal/ -[13]: https://kubuntu.org/getkubuntu/ -[14]: https://xubuntu.org/download/ -[15]: https://ubuntubudgie.org/downloads/ -[16]: https://ubuntustudio.org/ -[17]: https://lubuntu.me/downloads/ -[18]: http://cdimages.ubuntu.com/ -[19]: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/ diff --git a/translated/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md b/translated/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md new file mode 100644 index 0000000000..9a416774cf --- /dev/null +++ b/translated/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu 20.04 LTS Released. Download Now!) +[#]: via: (https://itsfoss.com/download-ubuntu-20-04/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Ubuntu 20.04 LTS 下载及新特性 +====== + +> Ubuntu 20.04 LTS Focal Fossa 终于发布了。以下是 Ubuntu 20.04 的新功能和下载链接,以及Ubuntu 20.04的官方风味版。 + +等待终于结束了。Ubuntu 20.04 LTS 终于来了,可以下载了! + +![][1] + +如果你已经在使用 Ubuntu 19.10,你可能发现没有太多明显的差异 —— 但我所看到的改进清单确实令人印象深刻。 + +如果你想知道有什么新的东西,我将会提到这个版本的几个主要亮点。 + +### Ubuntu 20.04 有什么新特性? + +与之前的 18.04 LTS 版本相比,Ubuntu 20.04 LTS 有很多视觉上的改变,同时也包括了一些底层的改进。 + +当然,随着 [GNOME 3.36][2] 的加入,视觉上的重大升级和性能上的提升是相当明显的。以下是一段视频,重点介绍了 Ubuntu 20.04 中的新功能。 + +- [What's New in Ubuntu 20.04 Take a Look at the Top Features](https://youtu.be/9u5B0njRgOw) + +如果你有兴趣的话,你也可以深入到我们的文章中去看看,重点介绍 [Ubuntu 20.04 的新功能][3]。 + +不管是哪种情况,让我来给你介绍一些亮点。 + + * GNOME 3.36 是默认的桌面系统 + * 性能提高了很多 + * 新的 Yaru 主题很华丽,也有黑暗模式。 + * 你不会再看到亚马逊应用程序,它已经永远消失了! + * 改进的 [ZFS][4] 支持 + * 你可以获得最新的 [Linux 内核 5.4][5](LTS) + * 增加了对 exFAT 的支持 + * 改进硬件和图形支持 + * 更新软件 Python 3.8.2 + * Wireguard 已被移植到 Linux 内核5.4,可以在 Ubuntu 20.04 上使用。 + +如果你想看详细的功能介绍,请观看这段视频,重点介绍 20.04 LTS 的最佳功能。 + +- [Top 7 Best Features You'll Love in Ubuntu 20.04](https://youtu.be/lpq8pm_xkSE) + +如果你是 Ubuntu 的新手,对 Ubuntu 20.04 有疑问,我们也为你提供了一篇快速的 [Ubuntu 20.04 FAQ][7] 文章。 + +### 从 18.04 和 19.10 升级到 Ubuntu 20.04 + +如果你已经在使用 Ubuntu 18.04 或 19.10,你可以从系统中轻松升级到 Ubuntu 20.04。 + +这样一来,当你开始使用新版本的时候,你的文件和大部分的应用程序设置都会保持原样,而无需从 ISO 中重新安装。 + +你可以阅读此详细教程来学习[如何将 Ubuntu 升级到新版本][8]。 + +请注意,如果你使用的是 Lubuntu 18.04,请不要升级到 Lubuntu 20.04。Lubuntu 18.04 使用的是 Lxde 桌面,而后面的版本使用的是 LXQt 桌面。这样升级可能会导致冲突和系统崩溃。 + +### 下载 Ubuntu 20.04 LTS + +你可以抓取 ISO 或 torrent 文件,这取决于你喜欢什么。 + +- [Ubuntu 20.04 LTS (ISO)][9] +- [Ubuntu 20.04 LTS (Torrent)][10] + +请按照本教程学习[如何安装 Ubuntu][11]。 + +### 下载Ubuntu 20.04 LTS官方版下载 + +如果你想在不同的桌面环境下得到 Ubuntu 的官方版本,请按照下面的链接进行操作。 + +- [Ubuntu MATE 20.04 LTS][12] +- [Kubuntu 20.04 LTS][13] +- [Xubuntu 20.04 LTS][14] +- [Ubuntu Budgie 20.04 LTS][15] +- [Ubuntu Studio 20.04 LTS][16] +- [Lubuntu 20.04 LTS][17] + +如果你没有在各自的官方网站上找到最新的 ISO/torrent 文件,只需前往 [cdimages.ubuntu.com][18] 找到所有的版本。 + +接下来,导航到“发行版名称” -> “releases” -> “20.04” -> “release”,然后你应该可以找到列出的 ISO 和 torrent 文件的链接。 + +如果你有问题,请参考这篇文章,它回答了[关于 Ubuntu 20.04 的常见问题][7]。如果你要安装,请查看我们推荐的[安装 Ubuntu 20.04 之后要做的事情][19]。 + +享受 Ubuntu 20.04 LTS Focal Fossa! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/download-ubuntu-20-04/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Ubuntu-20.04-LTS-released.png?ssl=1 +[2]: https://itsfoss.com/gnome-3-36-release/ +[3]: https://itsfoss.com/ubuntu-20-04-release-features/ +[4]: https://itsfoss.com/what-is-zfs/ +[5]: https://itsfoss.com/linux-kernel-5-4/ +[6]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[7]: https://itsfoss.com/ubuntu-20-04-faq/ +[8]: https://itsfoss.com/upgrade-ubuntu-version/ +[9]: http://releases.ubuntu.com/focal/ubuntu-20.04-desktop-amd64.iso +[10]: http://releases.ubuntu.com/focal/ubuntu-20.04-desktop-amd64.iso.torrent +[11]: https://itsfoss.com/install-ubuntu/ +[12]: https://ubuntu-mate.org/download/amd64/focal/ +[13]: https://kubuntu.org/getkubuntu/ +[14]: https://xubuntu.org/download/ +[15]: https://ubuntubudgie.org/downloads/ +[16]: https://ubuntustudio.org/ +[17]: https://lubuntu.me/downloads/ +[18]: http://cdimages.ubuntu.com/ +[19]: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/ From 3916767e21518c7c830b70d9d06e501e0bf6587c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 Apr 2020 11:01:24 +0800 Subject: [PATCH 0438/1809] PUB @wxy https://linux.cn/article-12146-1.html --- .../20200424 Ubuntu 20.04 LTS Released. Download Now.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20200424 Ubuntu 20.04 LTS Released. Download Now.md (98%) diff --git a/translated/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md b/published/20200424 Ubuntu 20.04 LTS Released. Download Now.md similarity index 98% rename from translated/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md rename to published/20200424 Ubuntu 20.04 LTS Released. Download Now.md index 9a416774cf..fcd11c0e8d 100644 --- a/translated/news/20200424 Ubuntu 20.04 LTS Released. Download Now.md +++ b/published/20200424 Ubuntu 20.04 LTS Released. Download Now.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12146-1.html) [#]: subject: (Ubuntu 20.04 LTS Released. Download Now!) [#]: via: (https://itsfoss.com/download-ubuntu-20-04/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From e5b0c8fbf30d1a8aed27491a81d3a81a2c81ad5b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Apr 2020 00:00:01 +0800 Subject: [PATCH 0439/1809] APL --- sources/tech/20200420 4 Git scripts I can-t live without.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200420 4 Git scripts I can-t live without.md b/sources/tech/20200420 4 Git scripts I can-t live without.md index 93f084f11f..5393461706 100644 --- a/sources/tech/20200420 4 Git scripts I can-t live without.md +++ b/sources/tech/20200420 4 Git scripts I can-t live without.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 99e447649dd7b931b5c1613251d15ea614606075 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Apr 2020 00:51:32 +0800 Subject: [PATCH 0440/1809] TSL --- ...0420 4 Git scripts I can-t live without.md | 202 ------------------ ...0420 4 Git scripts I can-t live without.md | 192 +++++++++++++++++ 2 files changed, 192 insertions(+), 202 deletions(-) delete mode 100644 sources/tech/20200420 4 Git scripts I can-t live without.md create mode 100644 translated/tech/20200420 4 Git scripts I can-t live without.md diff --git a/sources/tech/20200420 4 Git scripts I can-t live without.md b/sources/tech/20200420 4 Git scripts I can-t live without.md deleted file mode 100644 index 5393461706..0000000000 --- a/sources/tech/20200420 4 Git scripts I can-t live without.md +++ /dev/null @@ -1,202 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 Git scripts I can't live without) -[#]: via: (https://opensource.com/article/20/4/git-extras) -[#]: author: (Vince Power https://opensource.com/users/vincepower) - -4 Git scripts I can't live without -====== -The Git Extras repo hosts more than 60 scripts that add to Git's basic -functionality. Here's how to install, use, and contribute to it. -![Person using a laptop][1] - -In 2005, [Linus Torvalds][2] created [Git][3] to replace the proprietary distributed source control management solution that he had previously used to maintain the Linux kernel. Since then, Git has become a dominant version-control solution for open source and cloud-native development teams. - -Even feature-rich applications like Git don't have every feature that people want or need, so they make the effort to create them. In the case of Git, that person would be [TJ Holowaychuk][4]. His [Git Extras][5] project hosts more than 60 "extras" with features that expand Git's basic functionality. - -### Using Git Extras - -Here's how to use four of the most popular Git Extras. - -#### git-ignore - -git-ignore is a convenient extra that allows you to manually add file types and comments to the **.git-ignore** file without having to open a text editor. It works with both the global ignore file for your user account and the individual ignore file for the repository you are working in. - -Executing git-ignore without a parameter will list the global ignore file first, then the local ignore files. - - -``` -$ git ignore -Global gitignore: /home/alice/.gitignore -# Numerous always-ignore extensions -*.diff -*.err -*.orig -*.rej -*.swo -*.swp -*.vi -*~ -*.sass-cache - -# OS or Editor folders -Thumbs.db -\--------------------------------- -Local gitignore: .gitignore -nbproject -``` - -#### git-info - -git-info retrieves all the information you need to get your head in the context of a repo you are working with. It includes any remote URLs, remote branches, local branches, configuration info, and the last commit. - - -``` -$ git info - -## Remote URLs: - -origin      [git@github.com][6]:sampleAuthor/git-extras.git (fetch) -origin      [git@github.com][6]:sampleAuthor/git-extras.git (push) - -## Remote Branches: - -origin/HEAD -> origin/master -origin/myBranch - -## Local Branches: - -myBranch -* master - -## Most Recent Commit: - -commit e3952df2c172c6f3eb533d8d0b1a6c77250769a7 -Author: Sample Author <[sampleAuthor@gmail.com][7]> - -Added git-info command. - -Type ´git log´ for more commits, or ´git show <commit id>´ for full commit details. - -## Configuration (.git/config): - -color.diff=auto -color.status=auto -color.branch=auto -user.name=Sample Author -user.email=[sampleAuthor@gmail.com][7] -core.repositoryformatversion=0 -core.filemode=true -core.bare=false -core.logallrefupdates=true -core.ignorecase=true -remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* -remote.origin.url=[git@github.com][6]:mub/git-extras.git -branch.master.remote=origin -branch.master.merge=refs/heads/master -``` - -#### git-mr and git-pr - -These extras do similar things and work in basically the same way. - - * git-mr checks out a merge request from GitLab - * git-pr checks out a pull request on GitHub - - - -In either case, you just need the merge or pull request number or the full URL, and it will fetch the remote reference, check out the branch, and adjust the config, so Git knows which branch it will replace. - - -``` -$ git mr 51 -From gitlab.com:owner/repository - * [new ref]         refs/merge-requests/51/head -> mr/51 -Switched to branch 'mr/51' -``` - -#### git-release - -By combining **commit**, **tag**, and **push** into a single command, git-release saves a lot of keystrokes for executing three commands that often run in sequence. - -To commit with a specific **<tagname>** and a custom message: - - -``` -`$ git release 0.1.0 -m <+ powerful feature added>` -``` - -#### Other extras - -These are just four of the 60+ Git Extras in the repo. To access the full list of commands available in Git Extras, either review the [Commands.md][8] file in the source repository or run the following command after you install Git Extras. - - -``` -`$ git extras --help` -``` - -### Install Git Extras - -The main prerequisite for Git Extras is having the command-line version of Git installed. If you plan to build from source, you also need additional utilities (e.g., **make**) to be available. - -If you are using a recent version of macOS, Git Extras installation is best handled using [Homebrew][9] (as with most open source tools): - - -``` -`$ brew install git-extras` -``` - -On Linux, Git Extras is available on each platform's native package manager. Sometimes, you need to enable an extra repository, like [EPEL][10] on CentOS, then run a single command: - - -``` -`$ sudo yum install git-extras` -``` - -Full installation instructions for other Linux distributions, BSD, and other platforms are available in the [Installation.md][11] file in the repository. - -### Contributing - -Do you have a piece of functionality you think is missing from Git and have built or want to build a script to handle it? Why not share it with the world by making it part of the Git Extras distribution! - -To do so, contribute the functionality to the Git Extras repository. There are more specific details in the [CONTRIBUTING.md][12] file in the repository, but the basics are easy: - - 1. Create a Bash script that handles the functionality. - 2. Create a basic man file so people will know how to use it. - 3. Update the command list and completion scripts to let people know the functionality exists. - 4. Run the integrity check to make sure you didn't break anything. - 5. Create a pull request for your functionality. - - - -Contributing to Git Extras will go a long way towards making life a little easier for your fellow Git users. You can learn more about it in the project's [README][13]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/git-extras - -作者:[Vince Power][a] -选题:[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/vincepower -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) -[2]: https://en.wikipedia.org/wiki/Linus_Torvalds -[3]: https://git-scm.com/ -[4]: https://github.com/tj -[5]: https://github.com/tj/git-extras -[6]: mailto:git@github.com -[7]: mailto:sampleAuthor@gmail.com -[8]: https://github.com/tj/git-extras/blob/master/Commands.md -[9]: https://brew.sh/ -[10]: https://fedoraproject.org/wiki/EPEL -[11]: https://github.com/tj/git-extras/blob/master/Installation.md -[12]: https://github.com/tj/git-extras/blob/master/CONTRIBUTING.md -[13]: https://github.com/tj/git-extras/blob/master/Readme.md diff --git a/translated/tech/20200420 4 Git scripts I can-t live without.md b/translated/tech/20200420 4 Git scripts I can-t live without.md new file mode 100644 index 0000000000..089c81e20f --- /dev/null +++ b/translated/tech/20200420 4 Git scripts I can-t live without.md @@ -0,0 +1,192 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 Git scripts I can't live without) +[#]: via: (https://opensource.com/article/20/4/git-extras) +[#]: author: (Vince Power https://opensource.com/users/vincepower) + +4 个不可或缺的 Git 脚本 +====== + +> Git Extras 版本库包含了 60 多个脚本,它们是 Git 基本功能的补充。以下是如何安装、使用和贡献的方法。 + +![Person using a laptop][1] + +2005 年,[Linus Torvalds][2] 创建了 [Git][3],以取代他之前用于维护 Linux 内核的专有的分布式源码控制管理解决方案。从那时起,Git 已经成为开源和云原生开发团队的主流版本控制解决方案。 + +但即使是像 Git 这样功能丰富的应用程序,也没有人们想要或需要的每个功能,所以人们会花大力气去创建这些功能。就 Git 而言,这个人就是 [TJ Holowaychuk][4]。他的 [Git Extras][5] 项目承载了 60 多个“附加功能”,这些功能扩展了 Git 的基本功能。 + +### 使用 Git 附加功能 + +下面介绍一下如何使用四种最受欢迎的 Git 附加功能。 + +#### git-ignore + +`git ignore` 是一个方便的附加功能,它可以让你手动添加文件类型和注释到 `.git-ignore` 文件中,而不需要打开文本编辑器。它可以操作你的个人用户帐户的全局忽略文件和单独用于你正在工作的版本库的忽略文件。 + +在没有参数的情况下执行 `git ignore` 会先列出全局忽略文件,然后是本地的忽略文件。 + +``` +$ git ignore +Global gitignore: /home/alice/.gitignore +# Numerous always-ignore extensions +*.diff +*.err +*.orig +*.rej +*.swo +*.swp +*.vi +*~ +*.sass-cache + +# OS or Editor folders +Thumbs.db +--------------------------------- +Local gitignore: .gitignore +nbproject +``` + +#### git-info + +`git info` 可以检索你所需要的所有信息,以获取你正在使用的版本库的上下文信息。它包括远程 URL、远程分支、本地分支、配置信息和最后一次的提交信息。 + +``` +$ git info + +## Remote URLs: + +origin git@github.com:sampleAuthor/git-extras.git (fetch) +origin git@github.com:sampleAuthor/git-extras.git (push) + +## Remote Branches: + +origin/HEAD -> origin/master +origin/myBranch + +## Local Branches: + +myBranch +* master + +## Most Recent Commit: + +commit e3952df2c172c6f3eb533d8d0b1a6c77250769a7 +Author: Sample Author + +Added git-info command. + +Type ´git log´ for more commits, or ´git show ´ for full commit details. + +## Configuration (.git/config): + +color.diff=auto +color.status=auto +color.branch=auto +user.name=Sample Author +user.email=sampleAuthor@gmail.com +core.repositoryformatversion=0 +core.filemode=true +core.bare=false +core.logallrefupdates=true +core.ignorecase=true +remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* +remote.origin.url=git@github.com:mub/git-extras.git +branch.master.remote=origin +branch.master.merge=refs/heads/master +``` + +#### git-mr 和 git-pr + +这些附加功能的作用类似,工作方式也基本相同。 + +* `git mr` 检出来自 GitLab 的合并请求。 +* `git pr` 检出来自 GitHub 的拉取请求。 + +无论是哪种情况,你只需要合并请求号、拉取请求号或完整的 URL,它就会抓取远程引用,检出分支,并调整配置,这样 Git 就知道要替换哪个分支了。 + +``` +$ git mr 51 +From gitlab.com:owner/repository + * [new ref] refs/merge-requests/51/head -> mr/51 +Switched to branch 'mr/51' +``` + +#### git-release + +通过将 `commit`、`tag` 和 `push` 合并到一个命令中,`git release` 可以节省大量的按键来执行这三个命令,而这三个命令往往是依次运行的。 + +要用特定的 `` 和自定义消息提交: + +``` +$ git release 0.1.0 -m <+ powerful feature added> +``` + +#### 其他附加功能 + +这只是该版本库中 60 多个 Git 附加功能中的四个命令。要访问 Git Extras 中的全部命令,请查看该源代码库中的 [Commands.md][8] 文件,或者在安装 Git Extras 后运行以下命令。 + +``` +$ git extras --help +``` + +### 安装 Git 附加功能 + +使用 Git 附加功能的主要前提是安装了 Git 的命令行版本。如果你打算从源码中构建,还需要有额外的工具(例如:`make`)。 + +如果你使用的是最新版本的 macOS,那么 Git 附加功能的安装最好使用 [Homebrew][9](和大多数开源工具一样)。 + +``` +$ brew install git-extras +``` + +在 Linux 上,每个平台的原生包管理器中都有 Git Extras。有时,你需要启用一个额外的仓库,比如在 CentOS 上的 [EPEL][10],然后运行一条命令。 + +``` +$ sudo yum install git-extras +``` + +其他 Linux 发行版、BSD 和其他平台的完整安装说明可以在该版本库的 [Installation.md][11] 文件中找到。 + +### 贡献 + +你是否你认为 Git 中有缺少的功能,并且已经构建了一个脚本来处理它?为什么不把它作为 Git Extras 发布版的一部分,与全世界分享呢? + +要做到这一点,请将该功能贡献到 Git Extras 仓库中。更多具体细节请参见仓库中的 [CONTRIBUTING.md][12] 文件,但基本的操作方法很简单。 + +1. 创建一个处理该功能的 Bash 脚本。 +2. 创建一个基本的 man 文件,让大家知道如何使用它。 +3. 更新命令列表和补完脚本,让人们知道这个功能的存在。 +4. 运行完整性检查,确保你没有破坏任何东西。 +5. 为你的功能创建一个拉取请求。 + +向 Git Extras 贡献贡献,会让你的 Git 用户的生活更轻松一些。你可以在项目的 [README][13] 中了解更多。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/git-extras + +作者:[Vince Power][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/vincepower +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://en.wikipedia.org/wiki/Linus_Torvalds +[3]: https://git-scm.com/ +[4]: https://github.com/tj +[5]: https://github.com/tj/git-extras +[6]: mailto:git@github.com +[7]: mailto:sampleAuthor@gmail.com +[8]: https://github.com/tj/git-extras/blob/master/Commands.md +[9]: https://brew.sh/ +[10]: https://fedoraproject.org/wiki/EPEL +[11]: https://github.com/tj/git-extras/blob/master/Installation.md +[12]: https://github.com/tj/git-extras/blob/master/CONTRIBUTING.md +[13]: https://github.com/tj/git-extras/blob/master/Readme.md From b3836c036ab1bcdd2193b1c78b4c51e858a1261f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Apr 2020 01:00:52 +0800 Subject: [PATCH 0441/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200425=20What?= =?UTF-8?q?=20Happened=20to=20IPv5=3F=20Why=20there=20is=20IPv4,=20IPv6=20?= =?UTF-8?q?but=20no=20IPv5=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md --- ...v5- Why there is IPv4, IPv6 but no IPv5.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md diff --git a/sources/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md b/sources/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md new file mode 100644 index 0000000000..ac820a3369 --- /dev/null +++ b/sources/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What Happened to IPv5? Why there is IPv4, IPv6 but no IPv5?) +[#]: via: (https://itsfoss.com/what-happened-to-ipv5/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +What Happened to IPv5? Why there is IPv4, IPv6 but no IPv5? +====== + +If you have spent any amount of time in the world of the internet, you should have heard about the IPv4 and IPv6 protocols that our computers use every day. + +One question that you might be asking is: Why there is no IPv5? Why IPv6 came after IPv4 and not IPv5? Was there ever a IPv5 and if yes, whatever happened to IPv5? + +The answer is yes, there was an IPv5…sort of. Let me quickly explain a few things around it. + +### The early history of the internet + +![ARPA Logical Map in 1977 | Image courtesy: Wikipedia][1] + +In the late 1960s, the US Department of Defense’s [Advanced Research Projects Agency][2] (ARPA) started a [project][3] to link computers across the country. The initial goal was to create a networked system of all of the ARPA-funded computers across the country. + +Since this was the first time a network of this scale was put together, they were also creating the technology and hardware as they went. One of the first things they worked was an internet protocol (IP) named [Transmission Control Protocol][4] (TCP). This protocol “reliable, ordered, and error-checked delivery of a stream of octets (bytes) between applications running on hosts communicating via an IP network”. Basically, it made sure data got where it needed to go safely. + +Originally, TCP was designed to be [“a host-level, end-to-end protocol and a packaging and routing protocol”][5]. However, they realized that they needed to split the protocol to make it more manageable. It was decided that IP would handle packaging and routing. + +By this time TCP had gone through three versions, so the new protocol became known as IPv4. + +### The birth of IPv5 + +IPv5 started life under a different name: Internet Stream Protocol (or ST). It was created to experiment with streaming voice and video [“by Apple, NeXT, and Sun Microsystems”][6]. + +This new protocol was capable of “transferring data packets on specific frequencies while maintaining communication”. + +### So what happened to IPv5? + +![][7] + +IPv5 was never accepted as an official internet protocol. This was mainly due to the 32-bit limitation. + +IPV5 used the same addressing system as IPv4. Each address was made up of four sets of numbers between 0 and 255. This limited the number of possible addresses to [4.3 billion][6]. + +In the early 1970s, that might have seemed like more than the world would ever need. However, the explosive growth of the Internet proved that idea wrong. In 2011, the world officially ran out of the IPv4 addresses. + +In the 1990s, a new project was started to work on the next generation of internet protocol (IPng). This led to the 128-bit IPv6. An IPv6 address contains a [“series of eight 4-character hexadecimal numbers”][6] that can contain numbers from 0 to 9 and letters from A to F. Unlike IPv4, IPv6 had trillions of possible addresses, so we should be safe for a while. + +Meanwhile, IPv5 laid the groundwork for the voice-over-IP technology that we use to communicate all over the world today. **So, I guess in some small way, you could say that IPv5 still survives to this day**. + +I hope you liked this anecdote about internet history. You may read some other [trivia article about Linux and tech in general][8]. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][9]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/what-happened-to-ipv5/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Arpa_internet.png?fit=800%2C573&ssl=1 +[2]: https://en.wikipedia.org/wiki/DARPA +[3]: https://en.wikipedia.org/wiki/ARPANET +[4]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol +[5]: https://fcw.com/articles/2006/07/31/what-ever-happened-to-ipv5.aspx +[6]: https://www.lifewire.com/what-happened-to-ipv5-3971327 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/what-happened-to-ipv5.png?ssl=1 +[8]: https://itsfoss.com/category/story/ +[9]: https://reddit.com/r/linuxusersgroup From 6f450a57bb5bccb3b2e1cba5f2326b054ecd823a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Apr 2020 01:02:23 +0800 Subject: [PATCH 0442/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200424=20What?= =?UTF-8?q?=20you=20need=20to=20know=20about=20open=20source=20ad=20blocke?= =?UTF-8?q?rs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200424 What you need to know about open source ad blockers.md --- ...d to know about open source ad blockers.md | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 sources/tech/20200424 What you need to know about open source ad blockers.md diff --git a/sources/tech/20200424 What you need to know about open source ad blockers.md b/sources/tech/20200424 What you need to know about open source ad blockers.md new file mode 100644 index 0000000000..c3fb98def0 --- /dev/null +++ b/sources/tech/20200424 What you need to know about open source ad blockers.md @@ -0,0 +1,55 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What you need to know about open source ad blockers) +[#]: via: (https://opensource.com/article/20/4/ad-blockers) +[#]: author: (Joshua Pearce https://opensource.com/users/jmpearce) + +What you need to know about open source ad blockers +====== +Three open source ad blockers were tested against a "no ad blocker" +control. +![Browser of things][1] + +A new [study][2] meant to investigate energy conservation of free and open source ad blockers has unexpectedly shown that Internet ads are wasting shocking amounts of your time. + +More importantly, the results show how you can get that time back. The study estimates that the average Internet user would save over 100 hours a year by using [uBlock Origi][3][n][3][,][3] a free and open source ad blocker. uBlock Origin was the most effective ad blocker tested, but all ad blockers save time, energy and money according to the study. + +![Ad blocker screen comparison][4] + +The results show that page load time dropped 11% with [AdBlock+][5], 22% with [Privacy Badger][6], and 28% with [uBlock Origi][3][n][3]. These are not significant on a single page, but Internet users spend more than half of their time online rapidly clicking through websites, spending less than 15 seconds on a given page. With all these clicks, the additional time to load ads really starts to add up. + +The article _[Energy Conservation with Open Source Ad Blockers][7]_, published in the journal _Technologies,_ was originally conceived to address rising energy consumption. Internet-related electricity consumption is rising rapidly as global Internet users spend more than 6.5 hours per day online. Americans, for example, have more than doubled the time they spend online since 2000 to almost 24 hours a week. Open source ad blockers have the potential to reduce the time, and thus the electricity, spent by eliminating ads during Internet browsing and video streaming. + +In the study, three open source ad blockers were tested against a "no ad blocker" control. Page load times were recorded for browsing a representative selection of the most-accessed websites worldwide, including web searching (Google, Yahoo, Bing), information (Weather.com, Wikipedia), and news sites (CNN, Fox, New York Times). In addition, the study analyzed the time spent watching ads on videos for both trending and non-trending content. This part of the study was more challenging due to the lack of data on the ratio of YouTube watching time spent on trending vs. non-trending content. The time wasted viewing ads per video ranged from 0.06% up to a staggering 21%. Thus, the total hours lost to loading ads was only recorded for browsing. + +Overall, the results showed that the energy wasted loading ads is not trivial. As a lot of the electricity used for running computers continues to come from coal, which causes air pollution and premature death, the study analyzed the potential for ad blockers to save American lives. The results were shocking: the energy conserved if everyone in the United States used the open source ad blocker would save over 36 American lives per year. + +Electricity costs money, so cutting ads could also save consumers money. In the United States, if all Internet users enabled Privacy Badger on their computers, Americans would save more than $91 million annually. Globally, the results of the investigation were even more striking. uBlock Origin could save global consumers more than $1.8 billion a year. + +This study was done before everyone was forced to stay home because of the COVID-19 pandemic, so all the values can be viewed as conservative underestimates. Overall, the study found open source ad blockers are a potentially effective technology for energy conservation. + +Although free and open source ad blockers save energy and are good for the environment, you are probably going to use them primarily to block annoying ads and save yourself time. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/ad-blockers + +作者:[Joshua Pearce][a] +选题:[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/jmpearce +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) +[2]: https://www.mdpi.com/2227-7080/8/2/18 +[3]: https://github.com/gorhill/uBlock +[4]: https://opensource.com/sites/default/files/uploads/os_ad_blocker_story_.png (Ad blocker screen comparison) +[5]: https://adblockplus.org/ +[6]: https://privacybadger.org/ +[7]: https://www.academia.edu/42434401/Energy_Conservation_with_Open_Source_Ad_Blockers From a16c17b4cde14288c09bfae1cd5791a3dcf7c752 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Apr 2020 01:09:41 +0800 Subject: [PATCH 0443/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200424=20Red?= =?UTF-8?q?=20Hat=20Enterprise=20Linux=208.2=20Hits=20the=20stage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200424 Red Hat Enterprise Linux 8.2 Hits the stage.md --- ...Hat Enterprise Linux 8.2 Hits the stage.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/talk/20200424 Red Hat Enterprise Linux 8.2 Hits the stage.md diff --git a/sources/talk/20200424 Red Hat Enterprise Linux 8.2 Hits the stage.md b/sources/talk/20200424 Red Hat Enterprise Linux 8.2 Hits the stage.md new file mode 100644 index 0000000000..e00e88716c --- /dev/null +++ b/sources/talk/20200424 Red Hat Enterprise Linux 8.2 Hits the stage.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Red Hat Enterprise Linux 8.2 Hits the stage) +[#]: via: (https://www.networkworld.com/article/3540189/red-hat-enterprise-linux-82-hits-the-stage.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Red Hat Enterprise Linux 8.2 Hits the stage +====== +RHEL 8.2 has new capabilities for management of hybrid-cloud environments and container tools to help fuel cloud-native development. +Stephen Lawson/IDG + +Red Hat Enterprise Linux (RHEL) 8.2 brings new features that include expanded monitoring capabilities in Red Hat Insights for and new container tools, including containerized versions of Skopeo and Buildah. + +Red Hat says RHEL 8.2 is arriving at a time when, because of the Covid-19 pandemic, a growing percentage of IT staffers are working remotely. Their ability to support the management and monitoring of operations and their ability to detect and address problems has never been more critical, and upgrades to Red Hat Insights are designed to help. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] + +### Red Hat Insights + +[Red Hat Insights][2], is Red Hat’s operations and security-risk-management offering and helps detect, diagnose and remediate potential problems before they affect production systems or end users. It was included in RHEL in May 2019. + +The latest updates include: + + * Improved visibility and  security for managing large, complex environments + * Policy and patch services to help determine which product advisories apply and guidance for problem remediation + * A "drift service" to make it easier to compare baselines, shape strategies that reduce complexity, and make troubleshooting easier + + + +### Monitoring and performance updates + +RHEL 8.2 brings some performance upgrades includeing: + + * Improved resource management with Control Groups (cgroup) v2, which is designed to reserve and set limits on memory usage to help prevent processes from overconsuming memory and causing system failures or slowdowns. + * Optimizing performance-sensitive workloads via NUMA and sub-NUMA service policies. + * Performance Co-Pilot (PCP) 5.0.2 which adds collection agents for Microsoft SQL Server 2019 to gather and analyze SQL Server metrics to draw a clearer picture of database and operating-system performance. + * Red Hat subscription watch,a service for viewing and managing RHEL and Red Hat OpenShift Container Platform subscriptions. + + + +### Evolving container tools + +RHEL 8.2 includes new container tools that are supported for 24 months as part of Red Hat's Tech Preview, which provides early access to new products. The tools include Buildah for building and Skopeo for transferring container images. + +The new relase also introduces Udica, a policy tool for containerized SELinux that can make it less likely that processes will break out of containers and cause problems to other containers or the host. + +[][3] + +Red Hat Enterprise Linux 8.2 also introduces enhancements to the Red Hat Universal Base Image, including: + + * OpenJDK and .NET 3.0 for developing  certification-ready cloud-native Red Hat applications + * **Improved access to source code associated with a given image through a single command**, making it easier for Red Hat partners to meet source code requirements for open source licensing needs. + + + +### Ease of use + +Other new features are meant to make it easier to manage RHEL: + + * RHEL subscription registration as part of the installation process, making it easier to on-board new installations. + * Enabling Red Hat Insights during installation to simplify the launch of Insights for Red Hat Enterprise Linux deployments. + * Refinement and control of the Red Hat Enterprise Linux life cycle with testing for in-place upgrades, Red Hat Insights rules to help with upgrades, and the [Convert2 RHEL][4] tool that can help shift workloads from unsupported clones like CentOS to RHEL. + + + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3540189/red-hat-enterprise-linux-82-hits-the-stage.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: https://www.redhat.com/en/blog/expanding-management-operational-and-security-risks-new-red-hat-insights +[3]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[4]: https://www.redhat.com/en/blog/convert2rhel-how-update-rhel-systems-place-subscribe-rhel +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From a57065c236a4d683a37394576aacd28e39f96175 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Apr 2020 01:11:05 +0800 Subject: [PATCH 0444/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200424=20FCC?= =?UTF-8?q?=20boosts=20Wi-Fi=206=20spectrum=20five-fold?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200424 FCC boosts Wi-Fi 6 spectrum five-fold.md --- ...4 FCC boosts Wi-Fi 6 spectrum five-fold.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/talk/20200424 FCC boosts Wi-Fi 6 spectrum five-fold.md diff --git a/sources/talk/20200424 FCC boosts Wi-Fi 6 spectrum five-fold.md b/sources/talk/20200424 FCC boosts Wi-Fi 6 spectrum five-fold.md new file mode 100644 index 0000000000..4d3545f522 --- /dev/null +++ b/sources/talk/20200424 FCC boosts Wi-Fi 6 spectrum five-fold.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (FCC boosts Wi-Fi 6 spectrum five-fold) +[#]: via: (https://www.networkworld.com/article/3540288/fcc-boosts-wi-fi-6-spectrum-five-fold.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +FCC boosts Wi-Fi 6 spectrum five-fold +====== +The Federal Communications Commission has approved a chunk of wireless spectrum called the 6GHz band for unlicensed use by Wi-Fi 6, and gear that supports it could be available by the end of the year. +[tejasp][1] [(CC0)][2] + +The Federal Communications commission has opened up a wide swath of wireless spectrum for unlicensed use by Wi-Fi devices, which will lead to Wi-Fi access points that have greatly expanded capacity. + +It’s a huge victory for the Wi-Fi industry, as the ruling means that the amount of spectrum available for Wi-Fi just about quintupled in an instant. That means big, spacious channels – and a lot more channels overall – that can handle a lot more data and a lot more connections at the same time, according to Aruba vice president of wireless strategy and standards Chuck Lukaszewski. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +“Overnight, you’re going to see an additional gigabit per second or more of potential throughput,” he said. + +That’s a major upside, certainly, even if “overnight” might be a slightly optimistic view of when [Wi-Fi 6E][4] – the trade name for the new version of Wi-Fi that will take advantage of the new spectrum – hits the market. While some of the necessary standards haven’t yet been finalized by the IEEE, the basic ability to use 6GHz frequencies is already written into the existing Wi-Fi 6 specification. + +Broadcom director of product marketing and government affairs Chris Szymanski said that the main technical hurdle to implementing Wi-Fi 6E will be new radios, but that his company is among those that has already been designing and building compatible silicon. + +“I expect that the FCC will provide guidance on how to certify devices in the next few months,” he said. “I expect product available in the US in the late fall before the holidays.” + +Enterprise uptake will likely have to wait until compatible smartphones, laptops and the like are on shelves because existing Wi-Fi 6 cliets won’t be able to take advantage of the new 6Ghz spectrum. + +**[ [Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][5] ]** + +New access points are likely to have three radios in them, as opposed to the usual two, noted senior vice president of Ruckus Wireless and cloud at Commscope Bart Giordano. One each for the existing 2.4GHz and 5GHz bands, and a third for 6Ghz. + +“Antennas will be very similar because these spectrums sit next to one another,” he said, “but there’s specific tunings you have to do.” + +The driving force behind the spectrum expansion is the bottomless demand for capacity caused by the increasing use of wireless just about everywhere. The FCC’s announcement cites projections from Cisco that say about 60% of worldwide data traffic will move across Wi-Fi links within the next two years. + +Incumbent licensed users of parts of the 6GHz spectrum – which are mostly businesses using microwave links for wireless backhaul and public safety services – are far less pleased by the FCC’s decision. The Utilities Technology Council is one of several groups critical of earlier proposals to open the 6GHz band to broad-based unlicensed use, saying earlier that assurances that existing users would be protected from interference are unconvincing. + +“We have and will continue to provide the FCC with technical detail demonstrating the very real interference potential from unlicensed use across all parts of the band and the need for thoroughly tested automated frequency coordination (AFC) to protect incumbent users,” the group said in a statement. “While we appreciate the FCC proposing to require AFC for the standard-power access points, these measures must also be applied to all unlicensed devices in the band to prevent interference to mission-critical utility communications systems.” + +Farpoint Group principal and Network World contributor Craig Mathias said that it’s not going to be a smooth process, but argues that the opening of 6GHz spectrum was too great an opportunity to ignore. + +“Yes, it’s a mess – spectral re-allocations always are,” he said. “[But] I don't see any issues here that can't be addressed, and more unlicensed spectrum is of course always desirable.” + +Incumbent users of the 6GHz spectrum are unlikely to see the type of interference they’re particularly worried about, he added, given the nature of the connections currently in use and the safeguards in the new rule that are designed to protect existing networks. + +“Point-to-point microwave links operate at fairly high power and use both directional antennas and error-checking protocols to ensure reliability and otherwise deal with typical radio issues beyond interference, like the various forms of fading,” said Mathias. “A nearby Wi-Fi transmitter will be operating at much lower power and use its own signal-integrity-management techniques as well. So likely no issues in the vast majority of cases, especially if history is any guide.” + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3540288/fcc-boosts-wi-fi-6-spectrum-five-fold.html + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://pixabay.com/en/wifi-wireless-device-wi-fi-1371030/ +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.networkworld.com/article/3238664/80211-wi-fi-standards-and-speeds-explained.html +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From 06074f5be4d8e9be6f0fa96035d11ccff1ee5759 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Apr 2020 17:33:51 +0800 Subject: [PATCH 0445/1809] PRF @Zioyi --- ...mmands to Have Some Fun in the Terminal.md | 136 ++++++++---------- 1 file changed, 61 insertions(+), 75 deletions(-) diff --git a/translated/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md b/translated/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md index 13538cc7cf..581e683a5c 100644 --- a/translated/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md +++ b/translated/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md @@ -1,40 +1,40 @@ [#]: collector: (lujun9972) [#]: translator: (Zioyi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (12 Linux Commands to Have Some Fun in the Terminal) [#]: via: (https://itsfoss.com/funny-linux-commands/) [#]: author: (Community https://itsfoss.com/author/itsfoss/) -12个有趣的Linux终端命令 +12 个有趣的 Linux 终端命令 ====== -_**你觉得Linux终端里只有无趣的工作吗?那你一定不知道下面这些有趣的Linux命令吧。**_ +> 你觉得 Linux 终端里只有无趣的工作吗?那你一定不知道下面这些有趣的 Linux 命令吧。 -Linux终端是用来完成复杂的工作的,我们有很多有用的[linux命令奇技淫巧][1]来帮助你。 +Linux 终端是用来完成复杂的工作的,我们有很多有用的 [linux 命令奇技淫巧][1]来帮助你。 -但是,你知道你还可以用终端来做很多有趣的是吗?如果你不知道,没关系,大多数Linux用户也都只把终端视为一个用来管理系统和执行任务的交互接口。 +但是,你知道你还可以用终端来做很多有趣的事吗?如果你不知道,没关系,大多数 Linux 用户也都只把终端视为一个用来管理系统和开发工作的交互界面。 -然而,如果你知道这里有些你可以在终端玩的[基于终端的游戏][2]和[ASCII码游戏][3],你一定会大吃一惊。 +然而,如果你知道这里有些你可以在终端玩的[基于终端的游戏][2]和 [ASCII 码游戏][3],你一定会大吃一惊。 在这篇文章中,我将会探索一些有趣的、可笑的、荒谬的命令来让你可以在终端中找点乐子! -### 用这些命令在Linux终端中找点乐子 +### 用这些命令在 Linux 终端中找点乐子 ![][4] 你可能会觉得这些命令荒谬或没用,但是有一些还是可以被好好利用的。 -我已经添加了Ubuntu/Debian的安装组件,如果你使用基于Ubuntu的发行版,请确保[启用通用仓库][5]因为大多数命令不在主仓库中。 +我已经放上了 Ubuntu/Debian 的安装指令,如果你使用基于 Ubuntu 的发行版,请确保[启用 universe 仓库][5],因为大多数命令不在主仓库中。 -如果你使用Arch、Fedora、SUSE、Solus或者其他非Ubuntu的发行版,请使用你的发行版包管理工具去安装这些有趣的Linux命令。 +如果你使用 Arch、Fedora、SUSE、Solus 或者其他非 Ubuntu 的发行版,请使用你的发行版包管理工具去安装这些有趣的 Linux 命令。 -#### 1\. 在终端开一辆火车 +#### 1、在终端开一辆火车 让我们坐上火车,来一场说走就走的旅行的,没错,就是字面意思! -sl命令可以让你在终端运行一辆火车。 +`sl` 命令可以让你在终端运行一辆火车。 ![][6] @@ -44,53 +44,45 @@ sl命令可以让你在终端运行一辆火车。 sudo apt install sl ``` -完成后,你只要在终端输入下面的命令就可以开始 +完成后,你只要在终端输入下面的命令就可以开始: ``` sl ``` -很精彩,对吧?但等等,我们还没结束!你还可以让你的火车飞起来,只要加上参数-F,Magic: +很精彩,对吧?但等等,我们还没结束!你还可以让你的火车飞起来,只要加上参数 `-F`,波特先生,请飞吧: ``` sl -F ``` -**这样会让火车长出翅膀飞出终端窗口!** +这样会让火车长出翅膀飞出终端窗口! -#### 2\. 给你的Linux终端加上矩阵效果 +#### 2、给你的 Linux 终端加上黑客帝国效果 -还记得科幻电影[黑客帝国][7]吗?掉落在终端的绿字变成一个矩阵符号。 +还记得科幻电影[黑客帝国][7]吗?终端里掉落的绿色字符成为了黑客帝国的标志形象。 -你也可以在你的Linux电脑里有这样的矩阵数字雨!你只需要安装**cmatric**然后在终端输入它就行。 +你也可以在你的 Linux 电脑里有这样的黑客帝国数字雨!你只需要安装 `cmatric` 然后在终端输入它就行。 ![][8] -在Debian/Ubuntu Linux上安装cmatrix: +在 Debian/Ubuntu Linux 上安装 cmatrix: ``` sudo apt install cmatrix ``` -现在,你要做的就是输入下面的命令,在终端就会有矩阵屏幕了: +现在,你要做的就是输入下面的命令,在终端就会有黑客帝国屏幕了: ``` cmatrix ``` -按住Ctrl+C来停止它,黑客先生。 +按下 `Ctrl+C` 来停止它,黑客先生。 -**推荐阅读:** +#### 3、燃起来 -![][9] - -#### [通过Telnet在Linux终端看星际大战][10] - -在Linux终端看星际大战。 - -#### 3\. 让这里着火 - -拿好灭火器因为接下来你要在你的终端里点火了! +拿好灭火器,因为接下来你要在你的终端里点火了! ![][11] @@ -106,13 +98,13 @@ sudo apt install libaa-bin aafire ``` -按住Ctril+C来停止它。 +按下 `Ctril+C` 来停止它。 -#### 4\. 幸运饼干命令 +#### 4、幸运饼干命令 想知道你的运气怎样但身边没有幸运饼干? -别担心,你只需在终端打出“fortune”然后按下回车。终端将会显示出一个你的幸运语就像你从幸运饼干里得到的一样。 +别担心,你只需在终端打出 `fortune` 然后按下回车。终端将会随机显示出一个幸运语,就像你从幸运饼干里得到的一样。 ![][12] @@ -128,19 +120,19 @@ sudo apt install fortune fortune ``` -这是一个你可以实际去使用的命令。你可以用它作为每日消息,这样在多用户环境下,每个用户登录后都会得到一个“幸运饼干”。 +这是一个你可以实际使用的命令。你可以用它作为每日消息,这样在多用户环境下,每个用户登录后都会得到一个“幸运饼干”。 -你也可以把它添加到bashrc文件,这样当你登进终端你就会看到了。 +你也可以把它添加到 `bashrc` 文件,这样当你登进终端你就会看到了。 -#### 5\. 宠物爱好者?这是给你准备的 +#### 5、宠物爱好者?这是给你准备的 -Oneko是一个有趣的命令,可以把你的光标变成一只老鼠,然后创造一只猫,一旦你移动光标,就会来追你。这不仅局限于终端。当猫追逐光标时,你可以继续工作。 +`oneko` 是一个有趣的命令,可以把你的光标变成一只老鼠,然后创造一只好奇的猫,一旦你移动光标,就会来追你。这不仅局限于终端。当猫追逐光标时,你可以继续工作。 如果你家里有孩子这一定很有趣。 ![][13] -用下面的命令安装Oneko +用下面的命令安装 `oneko`: ``` sudo apt install oneko @@ -158,11 +150,11 @@ oneko oneko -dog ``` -这里有很多种小宠物,你可以用oneko -help获取信息。用Ctrl+C终止它。 +它有很多种小宠物,你可以用 `oneko -help` 获取信息。按下 `Ctrl+C` 终止它。 -#### 6\. 有个小兄弟在看着你 +#### 6、有个小兄弟在看着你 -Xeyes是一个很小的GUI程序,它可以绘制出一双眼睛一直盯着你!它会不断跟随您的鼠标光标,运行命令自己看看! +`xeyes` 是一个很小的 GUI 程序,它可以绘制出一双眼睛一直盯着你!它会不断跟随你的鼠标光标,运行命令自己看看! ![][14] @@ -178,12 +170,11 @@ sudo apt install xeyes xeyes ``` -按住Ctrl+C终止它。 +按下 `Ctrl+C` 终止它。 -#### 7\. Let the terminal speak for you -#### 7\. 让终端帮你讲话 +#### 7、让终端帮你讲话 -打开你的扬声器,你来试试这个命令,[eSpeak][15]是一个有趣的命令,它可以让你的终端说话。是的,你没听错。 +打开你的扬声器,你来试试这个命令,[eSpeak][15] 是一个有趣的命令,它可以让你的终端说话。是的,你没听错。 先安装这个包: @@ -197,15 +188,15 @@ sudo apt install espeak espeak "Type what your computer says" ``` -无论你在双引号里面填什么,你的电脑都会复述出来!它就像[在Linux中的echo命令][16],但不是打印出来,而是说出来。 +无论你在双引号里面填什么,你的电脑都会复述出来!它就像[在 Linux 中的 echo 命令][16],但不是打印出来,而是说出来。 -#### 8\. 卫生间(但它不能洗衣服) +#### 8、Toilet(但与洗手间无关) -这听起来有点奇怪,是的。但是,这只是一个命令,用来将文本转换成大的ASCII字符。 +这听起来有点奇怪,是的。但是,这只是一个命令,用来将文本转换成大的 ASCII 字符。 ![][17] -用这个命令安装toilet: +用这个命令安装 `toilet`: ``` sudo apt install toilet @@ -217,17 +208,17 @@ sudo apt install toilet toilet sample text you want ``` -我也不知道为啥这个小程序叫卫生间。 +我也不知道为啥这个小程序叫 Toilet。 -#### 9\. 那个牛说什么? +#### 9、那个牛说什么? -Cowsay是一个在终端中用ASCII字符展示出一头牛的命令。通过这个命令,你可以控制牛说出你想说的话。 +`cowsay` 是一个在终端中用 ASCII 字符展示出一头牛的命令。通过这个命令,你可以控制牛说出你想说的话。 别纠结声音,它只展示文本(就是你看漫画书一样)。 ![Cowsay Cowthink][18] -安装**cowsay**: +安装 `cowsay`: ``` sudo apt install cowsay @@ -239,15 +230,15 @@ sudo apt install cowsay cowsay "your text" ``` -无论你在双引号里填什么,你的牛都会说!我看到一些系统管理员用它来展示每天的消息。你也可以这样,你甚至可以把它和fortune命令结合。 +无论你在双引号里填什么,你的牛都会说!我看到一些系统管理员用它来展示每天的消息。你也可以这样,你甚至可以把它和 `fortune` 命令结合。 -#### 10\. Banner命令 +#### 10、旗帜 -banner命令与toilet命令相似,但它限制最多只能打印10个字符。 +`banner` 命令与 `toilet` 命令相似,但它限制最多只能打印 10 个字符。 ![][19] -你可以这样安装banner命令: +你可以这样安装 `banner` 命令: ``` sudo apt install sysvbanner @@ -261,29 +252,29 @@ banner "Welcome" 替换双引号里的内容,你将会得到你想要的展示内容。 -#### 11\. Yes命令 +#### 11、Yes ![][20] -yes命令帮助你在循环中自动响应直到终止命令。这个命令将会一直打印相同的内容。如果你想快速生成大量垃圾文本,那么此命令将像超级按钮一样工作。 +`yes` 命令帮助你在循环中自动响应直到终止命令。这个命令将会一直打印相同的内容。如果你想快速生成大量垃圾文本,那么此命令将像超级按钮一样工作。 -你也可以使用它为命令提供“yes”(如果提示)。例如,apt upgrade命令会要求你确认,你可以像这样使用它: +你也可以使用它为命令提供 `yes` 应答(如果提示应答时)。例如,`apt upgrade` 命令会要求你确认,你可以像这样使用它: ``` yes | sudo apt upgrade ``` -你不需要安装任何包,Yes命令已经存在了。 +你不需要安装任何包,`yes` 命令已经存在了。 -想要终止yes命令循环,只需按住**CTRL+C**。 +想要终止 `yes` 命令循环,只需按下 `CTRL+C`。 -#### 12\. 得到一个新的身份 +#### 12、得到一个新的身份 -要生成一个随机的假身份吗?我推荐你用rig命令。你在终端运行它,就会生成一个假的身份。 +要生成一个随机的假身份吗?我推荐你用 `rig` 命令。你在终端运行它,就会生成一个假的身份。 ![][21] -用这个命令安装rig: +用这个命令安装 `rig`: ``` sudo apt install rig @@ -295,25 +286,20 @@ sudo apt install rig rig ``` -它可能被用在脚本或者web应用中展示随机信息,但我自己还没做过什么。 +它可能被用在脚本或者 web 应用中展示随机信息,但我自己还没做过什么。 -**结尾** +### 结尾 -我希望你会喜欢这个有趣的Linux命令列表。你最喜欢哪个命令呢?你还知道其他有趣的命令吗?请在评论部分与我们分享。 +我希望你会喜欢这个有趣的 Linux 命令列表。你最喜欢哪个命令呢?你还知道其他有趣的命令吗?请在评论部分与我们分享。 -![][22] - -### Srimanta Koley - -Srimanta是一位热情的作家、发行者、开源爱好者,非常喜欢与技术相关的所有内容。他喜欢读书,特别是90年的书! -------------------------------------------------------------------------------- via: https://itsfoss.com/funny-linux-commands/ -作者:[Community][a] +作者:[Srimanta Koley][a] 选题:[lujun9972][b] 译者:[Zioyi](https://github.com/Zioyi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4495baa1ba4a34f217590930266cd9e6d6f6e0bb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Apr 2020 17:38:22 +0800 Subject: [PATCH 0446/1809] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Zioyi 恭喜你完成了第一篇翻译贡献! 本文首发地址: https://linux.cn/article-12149-1.html 你的 LCTT 专页地址: https://linux.cn/lctt/Zioyi 请注册以领取 LCCN: https://lctt.linux.cn/ --- ...0417 12 Linux Commands to Have Some Fun in the Terminal.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200417 12 Linux Commands to Have Some Fun in the Terminal.md (99%) diff --git a/translated/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md b/published/20200417 12 Linux Commands to Have Some Fun in the Terminal.md similarity index 99% rename from translated/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md rename to published/20200417 12 Linux Commands to Have Some Fun in the Terminal.md index 581e683a5c..b7f48944f3 100644 --- a/translated/tech/20200417 12 Linux Commands to Have Some Fun in the Terminal.md +++ b/published/20200417 12 Linux Commands to Have Some Fun in the Terminal.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Zioyi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12149-1.html) [#]: subject: (12 Linux Commands to Have Some Fun in the Terminal) [#]: via: (https://itsfoss.com/funny-linux-commands/) [#]: author: (Community https://itsfoss.com/author/itsfoss/) From 180cc020abe97d2f04b0e58b3cc1312218d38193 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Apr 2020 17:41:13 +0800 Subject: [PATCH 0447/1809] PRF --- ...200417 12 Linux Commands to Have Some Fun in the Terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20200417 12 Linux Commands to Have Some Fun in the Terminal.md b/published/20200417 12 Linux Commands to Have Some Fun in the Terminal.md index b7f48944f3..d13219c30a 100644 --- a/published/20200417 12 Linux Commands to Have Some Fun in the Terminal.md +++ b/published/20200417 12 Linux Commands to Have Some Fun in the Terminal.md @@ -98,7 +98,7 @@ sudo apt install libaa-bin aafire ``` -按下 `Ctril+C` 来停止它。 +按下 `Ctrl+C` 来停止它。 #### 4、幸运饼干命令 From 0108d46e5a1d9fd622e6f79c6061fc3334e53ab3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Apr 2020 19:10:00 +0800 Subject: [PATCH 0448/1809] PRF @cycoe --- ...u need to know about variables in Emacs.md | 70 ++++++++----------- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/translated/tech/20200311 What you need to know about variables in Emacs.md b/translated/tech/20200311 What you need to know about variables in Emacs.md index 635f7d6249..52b341789a 100644 --- a/translated/tech/20200311 What you need to know about variables in Emacs.md +++ b/translated/tech/20200311 What you need to know about variables in Emacs.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What you need to know about variables in Emacs) @@ -9,51 +9,49 @@ 关于 Emacs 中的变量你需要知道的事情 ====== -学习 Elisp 是如何处理变量的,以及如何在你的脚本与配置中使用它们。 -![编程键盘][1] + +> 学习 Elisp 是如何处理变量的,以及如何在你的脚本与配置中使用它们。 + +![](https://img.linux.net.cn/data/attachment/album/202004/25/190905pq1qfk1f8f9qs9v8.jpg) GNU Emacs 是由 C 和 Emacs Lisp(Elisp,Lisp 编程语言的一种方言)写成,它是一个编辑器的同时,又碰巧是 Elisp 的沙盒。因此,理解 Elisp 中的一些基本编程概念会对你有一些帮助。 -如果你是 [Emacs][2] 新手,请先访问 Sacha Chua 的[《给 Emacs 新手的资源》][3]精品帖。本篇文章假定你熟悉常见的 Emacs 术语,并且能够阅读 Elisp 代码的简单片段并对其进行求值。最好你也听说过变量作用域的概念,知道它在其它编程语言中的作用。本篇文章中的示例假定你使用的是相对较新的 Emacs 版本([v.25 之后的版本][4])。 +如果你是 [Emacs][2] 新手,请先阅读 Sacha Chua 的《[给 Emacs 新手的资源][3]》精品帖。本篇文章假定你熟悉常见的 Emacs 术语,并且能够阅读并求值 Elisp 代码的简单片段。最好你也听说过变量作用域的概念,知道它在其它编程语言中的作用。本篇文章中的示例假定你使用的是相对较新的 Emacs 版本([v.25 之后的版本][4])。 -[Elisp 手册][5] 包含了 Elisp 的方方面面,但它是写给那些有明确查找目标的人们的,并且它在这方面也做得相当棒。但是很多人希望这些资源能够在更高的层次上解释 Elisp 的概念,同时将信息压缩成最精华的部分。本篇文章也正是我回应这种呼声的一次尝试,为读者描绘基础的大体轮廓。使他们能在配置中用上这些技巧,也让他们在手册中查询细节变得更容易。 +[Elisp 手册][5] 包含了 Elisp 的方方面面,但它是写给那些有明确查找目标的人们的(它在这方面也做得相当棒)。但是很多人想要能够在更高的层次上解释 Elisp 概念的材料,同时将信息压缩成最精华的部分。本篇文章也正是我回应这种呼声的一次尝试,为读者描绘基础的大体轮廓。使他们能在配置中用上这些技巧,也让他们在手册中查询细节变得更容易。 ### 全局变量 用 `defcustom` 定义的用户设置和用 `defvar` 或 `defconst` 定义的变量是全局的。使用 `defcustom` 或 `defvar` 声明变量的一个非常重要的原因是,当一个变量已经被绑定bind,对它们进行重新求值不会覆盖掉已有的值。举个栗子,如果你在初始化文件中对 `my-var` 进行如下绑定: - ``` -`(setq my-var nil)` +(setq my-var nil) ``` 对如下表达式求值不会将变量覆盖为 `t`: - ``` `(defvar my-var t)` ``` -注意此处有_一个例外_:如果你用 `C-M-x` 快捷键对上述声明求值,它将调用 `eval-defun` 函数,并将变量覆盖为 `t`。通过此方式,你可以按需将变量强制覆盖。这种行为是刻意而为之的:你可能知道,Emacs 中的许多特性是按需加载的,也可以称为自动加载。如果那些文件中的声明将变量覆盖为它们的默认值,那它也就覆盖了你初始化文件中的设置。 +注意此处有*一个例外*:如果你用 `C-M-x` 快捷键对上述声明求值,它将调用 `eval-defun` 函数,并将变量覆盖为 `t`。通过此方式,你可以按需将变量强制覆盖。这种行为是刻意而为之的:你可能知道,Emacs 中的许多特性是按需加载的,也可以称为自动加载。如果那些文件中的声明将变量覆盖为它们的默认值,那它也就覆盖了你初始化文件中的设置。 ### 用户选项 -用户选项就是使用 `defcustom` 声明的全局变量。与使用 `defvar` 声明的变量不同,这些变量可以用 `M-x customize` 界面来配置。据我所知,大部分人因为觉得它开销较大而不经常使用。一旦你知道如何在你的初始化文件中设置变量,也就没有理由一定要去使用它了。许多用户没有意识到的一个细节是,通过 **customize** 的方式设置用户选项能够执行代码,有的时间可用来运行一些附加的配置说明: - +用户选项就是使用 `defcustom` 声明的全局变量。与使用 `defvar` 声明的变量不同,这些变量可以用 `M-x customize` 界面来配置。据我所知,大部分人因为觉得它开销较大而不经常使用。一旦你知道如何在你的初始化文件中设置变量,也就没有理由一定要去使用它了。许多用户没有意识到的一个细节是,通过 `customize` 的方式设置用户选项能够执行代码,有的时间可用来运行一些附加的配置说明: ``` (defcustom my-option t -  "我的用户选项" +  "My user option."   :set (lambda (sym val)          (set-default sym val)          (message "Set %s to %s" sym val))) ``` -若你对这段代码求值,并键入 `M-x customize-option RET my-option RET` 运行 **customize** 界面,lambda 匿名函数就会被调用,回显区域就会显示出该选项的符号名与值。 +若你对这段代码求值,并键入 `M-x customize-option RET my-option RET` 运行 `customize` 界面,lambda 匿名函数就会被调用,回显区域就会显示出该选项的符号名与值。 如果你在初始化文件中使用 `setq` 改变该选项的值,那么匿名函数不会运行。要想在 Elisp 中正确设置一个选项,你需要使用函数 `customize-set-variable`。或者,人们在他们的配置文件中使用了各种版本的 `csetq` 宏来自动处理(如你所愿,你可以通过 GitHub 的代码搜索发现更复杂的变体)。 - ``` (defmacro csetq (sym val)   `(funcall (or (get ',sym 'custom-set) 'set-default) ',sym ,val)) @@ -63,20 +61,18 @@ GNU Emacs 是由 C 和 Emacs Lisp(Elisp,Lisp 编程语言的一种方言) 在你将以上代码放入到你的初始化文件中之后,你便可以使用 `csetq` 宏在设置变量的同时运行任何现存的 `setter` 函数。要证明这点,你可以使用此宏来改变上面定义的选项,并观察回显区域的消息输出。 - ``` -`(csetq my-option nil)` +(csetq my-option nil) ``` ### 动态绑定与词法绑定 当你在使用其它编程语言时,你可能不会意识到动态绑定与词法绑定的区别。当今的大部分编程语言使用词法绑定,并且在学习变量作用域与变量查找时也没有必要去了解它们之间的区别。 -如此看来,Emacs Lisp 比较特殊因为动态绑定是默认选项,词法绑定需要显式启用。这里有一些历史遗留原因,但在实际使用中,你应该_时刻_启用词法绑定,因为它更快并且不容易出错。要启用词法绑定,只需将如下的注释行作为你的 Emacs Lisp 文件的第一行: - +如此看来,Emacs Lisp 比较特殊因为动态绑定是默认选项,词法绑定需要显式启用。这里有一些历史遗留原因,但在实际使用中,你应该*时刻*启用词法绑定,因为它更快并且不容易出错。要启用词法绑定,只需将如下的注释行作为你的 Emacs Lisp 文件的第一行: ``` -`;;; -*- lexical-binding: t; -*-` +;;; -*- lexical-binding: t; -*- ``` 另一种方式,你可以调用 `add-file-local-variable-prop-line`,在你选择将变量 `lexical-binding` 置为 `t` 后,会自动插入如上的注释行。 @@ -105,15 +101,13 @@ GNU Emacs 是由 C 和 Emacs Lisp(Elisp,Lisp 编程语言的一种方言) 如你所知,`let` 用于临时建立局部绑定: - ``` (let ((a "I'm a")       (b "I'm b"))   (message "Hello, %s. Hello %s" a b)) ``` -接下来有趣的是——使用 `defcustom`、`defvar` 以及 `defconst` 定义的变量被称为_特殊变量_,不论词法绑定是否启用,它们都将使用动态绑定: - +接下来有趣的是——使用 `defcustom`、`defvar` 以及 `defconst` 定义的变量被称为*特殊变量*,不论词法绑定是否启用,它们都将使用动态绑定: ``` ;;; -*- lexical-binding: t; -*- @@ -142,7 +136,6 @@ GNU Emacs 是由 C 和 Emacs Lisp(Elisp,Lisp 编程语言的一种方言) 这是另一个常见的示例,如何进行大小写敏感的搜索: - ``` (let ((case-fold-search nil))   (some-function-which-uses-search ...)) @@ -154,26 +147,25 @@ GNU Emacs 是由 C 和 Emacs Lisp(Elisp,Lisp 编程语言的一种方言) ``` (let ((vars ())) -  (mapatoms -   (lambda (cand) -     (when (and (boundp cand) -                (not (keywordp cand)) -                (special-variable-p cand) -                (not (string-match "-" -                                   (symbol-name cand)))) -       (push cand vars)))) -  vars) ;; => (t obarray noninteractive debugger nil) + (mapatoms + (lambda (cand) + (when (and (boundp cand) + (not (keywordp cand)) + (special-variable-p cand) + (not (string-match "-" + (symbol-name cand)))) + (push cand vars)))) + vars) ;; => (t obarray noninteractive debugger nil) ``` ### 缓冲区局部变量 每个缓冲区都能够拥有变量的一个局部绑定。这就意味着对于任何变量,都会首先在当前缓冲区中查找缓冲区局部变量取代默认值。局部变量是 Emacs 中一个非常重要的特性,比如它们被主模式用来建立缓冲区范围内的行为与设置。 -事实上你已经在本文中见过_缓冲区局部变量_——也就是将 `lexical-binding` 在缓冲区范围内设置为 `t` 的特殊注释行。在 Emacs 中,在特殊注释行中定义的缓冲区局部变量也被称为`文件局部变量`。 +事实上你已经在本文中见过*缓冲区局部变量*——也就是将 `lexical-binding` 在缓冲区范围内设置为 `t` 的特殊注释行。在 Emacs 中,在特殊注释行中定义的缓冲区局部变量也被称为*文件局部变量*。 任何的全局变量都可以用缓冲区局部变量来遮掩,比如上面定义的变量 `my-var`,你可用如下方式设置局部变量: - ``` (setq-local my-var t) ;; or (set (make-local-variable 'my-var) t) @@ -185,7 +177,6 @@ GNU Emacs 是由 C 和 Emacs Lisp(Elisp,Lisp 编程语言的一种方言) 因为局部变量意味着对缓冲区的定制,它们也就经常被用于模式钩子中。一个典型的例子如下所示: - ``` (add-hook 'go-mode-hook           (defun go-setup+ () @@ -199,8 +190,7 @@ GNU Emacs 是由 C 和 Emacs Lisp(Elisp,Lisp 编程语言的一种方言) 这将设置 `go-mode` 缓冲区中 `M-x compile` 使用的编译命令。 -另一个重要的方面就是一些变量会_自动_成为缓冲区局部变量。这也就意味着当你使用 `setq` 设置这样一个变量时,它会针对当前缓冲区设置局部绑定。这个特性不应该被经常使用,因为这种隐式的行为并不好。不过如果你想的话,你可以使用如下方法创建自动局部变量: - +另一个重要的方面就是一些变量会*自动*成为缓冲区局部变量。这也就意味着当你使用 `setq` 设置这样一个变量时,它会针对当前缓冲区设置局部绑定。这个特性不应该被经常使用,因为这种隐式的行为并不好。不过如果你想的话,你可以使用如下方法创建自动局部变量: ``` (defvar-local my-automatical-local-var t) @@ -213,9 +203,7 @@ GNU Emacs 是由 C 和 Emacs Lisp(Elisp,Lisp 编程语言的一种方言) Emacs 是一个强大的编辑器,并且随着你的定制它将变得更加强大。现在,你知道了 Elisp 是如何处理变量的,以及你应如何在你自己的脚本与配置中使用它们。 -* * * - -_本篇文章此前采用 CC BY-NC-SA 4.0 许可证发布在 [With-Emacs][7] 上,经过修改(带有合并请求)并在作者允许的情况下重新发布。_ +*本篇文章此前采用 CC BY-NC-SA 4.0 许可证发布在 [With-Emacs][7] 上,经过修改(带有合并请求)并在作者允许的情况下重新发布。* -------------------------------------------------------------------------------- @@ -224,7 +212,7 @@ via: https://opensource.com/article/20/3/variables-emacs 作者:[Clemens Radermacher][a] 选题:[lujun9972][b] 译者:[cycoe](https://github.com/cycoe) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 99b0533680653c76c3ce0557ffeadda0729acd99 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Apr 2020 19:10:26 +0800 Subject: [PATCH 0449/1809] PUB @cycoe https://linux.cn/article-12150-1.html --- ...20200311 What you need to know about variables in Emacs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200311 What you need to know about variables in Emacs.md (99%) diff --git a/translated/tech/20200311 What you need to know about variables in Emacs.md b/published/20200311 What you need to know about variables in Emacs.md similarity index 99% rename from translated/tech/20200311 What you need to know about variables in Emacs.md rename to published/20200311 What you need to know about variables in Emacs.md index 52b341789a..6a2a0aaa63 100644 --- a/translated/tech/20200311 What you need to know about variables in Emacs.md +++ b/published/20200311 What you need to know about variables in Emacs.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12150-1.html) [#]: subject: (What you need to know about variables in Emacs) [#]: via: (https://opensource.com/article/20/3/variables-emacs) [#]: author: (Clemens Radermacher https://opensource.com/users/clemera) From 9b31e6bbf50b1fd770be30041a584fb5d365c017 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Apr 2020 19:11:14 +0800 Subject: [PATCH 0450/1809] PRF --- .../20200311 What you need to know about variables in Emacs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20200311 What you need to know about variables in Emacs.md b/published/20200311 What you need to know about variables in Emacs.md index 6a2a0aaa63..a53c1200ed 100644 --- a/published/20200311 What you need to know about variables in Emacs.md +++ b/published/20200311 What you need to know about variables in Emacs.md @@ -31,7 +31,7 @@ GNU Emacs 是由 C 和 Emacs Lisp(Elisp,Lisp 编程语言的一种方言) 对如下表达式求值不会将变量覆盖为 `t`: ``` -`(defvar my-var t)` +(defvar my-var t) ``` 注意此处有*一个例外*:如果你用 `C-M-x` 快捷键对上述声明求值,它将调用 `eval-defun` 函数,并将变量覆盖为 `t`。通过此方式,你可以按需将变量强制覆盖。这种行为是刻意而为之的:你可能知道,Emacs 中的许多特性是按需加载的,也可以称为自动加载。如果那些文件中的声明将变量覆盖为它们的默认值,那它也就覆盖了你初始化文件中的设置。 From cf7431e4834cb961092b934ac1e05f1c135f77ed Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Sat, 25 Apr 2020 22:32:59 +0800 Subject: [PATCH 0451/1809] Update 20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md --- ...w- Slightly Different Lightweight Linux.md | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md b/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md index 6b8be0c8bd..b672d3b828 100644 --- a/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md +++ b/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md @@ -7,87 +7,87 @@ [#]: via: (https://itsfoss.com/bodhi-linux-review/) [#]: author: (John Paul https://itsfoss.com/author/john/) -Bodhi Linux 5.1 Review: Slightly Different Lightweight Linux +Bodhi Linux 5.1 一览: 略有不同的轻量化 Linux ====== -Bodhi Linux is a [lightweight Linux distribution][1] based on Ubuntu. Unlike most other distributions, Bodhi uses its own Moksha desktop and focuses on providing you a minimal setup to run on older computers. +Bodhi Linux 是一个基于 Ubuntu 的[轻量级Linux发行版][1]。与其他大多数发行版不同,Bodhi 使用自己的 Moksha 桌面,并专注于为你提供在旧计算机上运行的最简设置。 -### What is Bodhi Linux? +### 什么是菩提 Linux? ![Bodhi Start Page][2] -[Bodhi Linux][3] was first introduced in 2011. It is designed with “[minimalism, resource efficiency, and user choice][4]” in mind. The devs strove to provide a “[system that is functional but not bloated][5]“. As such, it uses the lightweight Moksha Desktop and has only the basic applications preinstalled. The idea is to give the user a stable platform to build the system that they want. It is based on the latest Ubuntu LTS. +[Bodhi Linux][3] 最早于2011年推出。它以“[简约、高效和用户自定义][4]”为设计理念。开发人员旨在提供一个“[功能正常但不臃肿的系统][5]”。因此,它使用轻量级的Moksha 桌面,只预装了基本的应用程序。这一做法是为了给用户一个稳定的平台来构建他们想要的系统。它基于最新版的 Ubuntu 长期支持版本。 -### Moksha Desktop +### Moksha 桌面 ![Bodhi Desktop][6] -Originally Bodhi shipped with the [Enlightenment desktop environment][7]. Bodhi Linux has long been known as the “Enlightened” Linux distro. In fact, the word ‘bodhi’ is based on the Sanskrit word for “enlightenment”. +起初菩提是随着[ Enlightenment 桌面环境][7]一起发布的。Bodhi Linux 一直被认为是“开明的”Linux发行版。事实上,“Bodhi”这个词是基于梵文的“开悟”。 -However, that changed when Enlightenment 18 was released. The release was in such bad shape that it was not included in Bodhi. Enlightenment 19 was released and fixed some of the problems, but still had issues. +然而,当 Enlightenment 18版本发布以后,这一切都改变了。该版本是如此的糟糕,它并没有集成 Bodhi 。Enlightenment 19 被发布并修复了一些问题,但仍然存在一些问题。 -After trying to work with the Enlightenment dev team and getting nowhere, the Bodhi devs [forked][8] Enlightenment 17 in 2015. The new desktop environment would be named [Moksha][9], which is based on the Sanskrit word for “emancipation, liberation, or release”. You can find the code for it on [GitHub][10]. +在尝试与 Enlightenment 开发团队合作却毫无进展之后,Bodhi 开发者在2015年复刻了[8]Enlightenment 17。新的桌面环境被命名为[Moksha][9],它是基于梵文单词“解脱、解放或释放”。你可以在[GitHub][10]上找到它的代码。 -### What is new in 5.1.0? +### 5.1.0有什么新特性? -[Subscribe to our YouTube channel for more Linux videos][11] +[订阅我们的YouTube频道来观看更多的Linux视频][11] -[Bodhi 5.1.0][12] is the first release in two years and the second release to be based on Ubuntu 18.04. Besides updating packages, it also has new default icons and theme. This release makes several changes to the default applications. Leafpad comes preinstalled instead of epad and [GNOME Web][13] (also known as Epiphany) replaces [Midori][14]). The eepDater system updater was removed. +[Bodhi 5.1.0][12] 是两年内的第一个版本,也是基于 Ubuntu 18.04 的第二个版本。除了更新包,它还有新的默认图标和主题。该版本对默认应用程序做了几处更改。预装版 Leafpad 取代了 epad 并且 [GNOME Web][13] (也被称为Epiphany)代替了[Midori][14])。删除了eepDater系统更新器。 -There are currently [four different versions][15] of Bodhi 5.1.0 available to [download][16]: Standard, Hwe, Legacy, and AppPack. +目前有[四个不同的版本][15]的菩提5.1.0提供[下载][16]: 标准版(Standard),硬件支持版(Hwe), 兼容版(Legacy), 和软件包版(AppPack). - * Standard will work for systems made in the last decade. It does not push kernel updates. - * Hwe (Hardware Enablement) edition is new to the Bodhi family and is designed to include support for newer hardware and will received kernel updates. The 5.1 release features the 5.3.0-42 kernel. - * Legacy is the only edition that is 32-bit. It uses the “older 4.9.0-6-686 Linux kernel that is optimized for old (15+ years old) hardware. This kernel also does not include the PAE extension which is not supported on many older systems.” - * The AppPack edition is for those who want a fully-loaded system out of the box and comes with many applications preinstalled. + * 标准适用于过去十年内电脑配置。它不推送内核更新。 + * 硬件支持版Hwe (Hardware Enablement)是 Bodhi 新的家族设计包括支持更新的硬件和将收到内核更新。5.1版本的使用的是5.3.0-42内核。 + * 兼容版是唯一的32位版本。它使用“较旧的4.9.0-6-686 Linux内核,该内核针对旧的(15年以上)硬件进行了优化”。这个内核也不包括PAE扩展,这是许多老系统不支持的。” + * 软件包版是为那些想要一个开箱即用并预装了许多应用程序的全负载系统的人准备的。 -### System Requirements for Bodhi Linux +### Bodhi Linux 的系统要求 -Minimum system requirement +最低系统要求 - * 500 MHz processor - * 256 MB of RAM - * 5 GB of drive space + * 500 MHz 处理器 + * 256 MB 内存 + * 5 GB 的硬盘存储空间 -Recommended system requirement +推荐系统要求 - * 1.0 GHz processor - * 512 MB of RAM - * 10 GB of drive space + * 1.0 GHz 处理器 + * 512 MB 内存 + * 10 GB 的硬盘存储空间 -### Experiencing Bodhi Linux +### Bodhi Linux 的体验 ![Old Bodhi Linux][17] -Since it is based on Ubuntu, installing Bodhi was very simple. After I signed into Bodhi, I was surprised by the new theme and icon set. The last time I installed Bodhi (including 5.0 a couple of months ago) I thought that it needed a new look. There was nothing really wrong with the previous theme, but it looked like something from the early 2000. The new theme gives it a more modern look. +由于它是基于 Ubuntu 的,安装 Bodhi 非常简单。当我登录到 Bodhi 后,我对新的主题和图标设置感到惊讶。上次我安装 Bodhi (包括几个月前的5.0)时,我认为它需要一个新的外观。之前的主题并没有什么问题,但看起来像是2000年初的东西。新的主题使它看起来更具现代感。 ![Bodhi Linux 5.1][18] -I was also glad to see that Midori had been replaced by GNOME Web. I’m not a fan of [Midori browser][19]. It always seemed too minimal for me. (However, that might change in the future with [Midori Next][20].) Web felt more like the web browser I need. Most importantly it comes with Firefox Sync, so I can keep all of my bookmarks and passwords synced. +我也很高兴看到 Midori 浏览器被 GNOME Web 所取代。我不是[Midori 浏览器][19]的粉丝。对我来说,它总是显得功能太少了。(不过,随着[Midori Next][20]的推出,这种情况可能会改变。)Web更像是我需要的Web浏览器。最重要的是它带有Firefox同步功能,这样我就可以同步我所有的书签和密码了。 -Unlike many Linux distros, Bodhi doesn’t really come with a stand-alone software center. Instead, if you click the AppCenter icon it opens the browser and navigates to the [AppCenter p][21][a][21][ge][21] of the Bodhi website. Here apps are sorted by category. Most of them are [lightweight applications][22]. +与许多 Linux 发行版不同,Bodhi 并没有一个独立的软件中心。相反,如果你点击 AppCenter 图标,它会打开浏览器,并导航到 Bodhi 网站的软件中心页面[AppCenter page][21]。这里的应用程序是按类别排序的。它们中的大多数是[轻量级应用程序][22]。 ![Bodhi Linux Appcenter][23] -If you click on one of the pages and click “Install”, Bodhi will install it (after to type in your passwords). This is achieved using a neat little program named [apturl][24] that “is a very simple way to install a software package from a web browser”. It’s pretty slick and I wish more Ubuntu-based distros would use it. +如果你点击其中一个页面并点击“安装”,Bodhi 会开始它的安装(在你输入密码之后)。这是通过一个名为[apturl][24]的小程序实现的,它是“源自web浏览器安装软件包的一种非常简单的方法”。它非常灵巧,我希望更多基于ubuntu的发行版使用它。 -Overall, I like the Moksha desktop. It adheres to the desktop metaphor we have seen for decades (and which I am most comfortable with). It stays out of your way but is very easy to change and modify. The only thing I miss is that the application menu doesn’t open when I hit the super key. But I guess you can’t have everything in life. +总的来说,我喜欢 Moksha 桌面。它坚持我们几十年来看到的桌面风格(这是我最喜欢的)。它不干涉你,却很容易改变和定制。我唯一怀念的是,当我点击超级键时,应用程序菜单不打开。但我猜你不可能拥有生活中的一切。 -### Final Thoughts +### 结语 -I was pleasantly surprised by this recent release of Bodhi Linux. In the past, I’ve played with it from time to time. I always liked it, but this last release has been the best so far. In a way, they have broken free of the idea that Bodhi is only for older system by adding support for newer kernels. +我对最近发布的 Bodhi Linux 感到十分惊喜。过去,我经常折腾它。并且我一直很喜欢它,但最近的这个版本是迄今为止最好的。在某种程度上,他们通过增加对新内核的支持,打破了Bodhi只适用于旧系统的想法。 -If you are looking for a change of scenery while staying close to the world of Ubuntu give [Bodhi Linux][3] a try. +如果你想在拥有 Ubuntu 体验的同时改善一下视觉体验,那就试试[Bodhi Linux][3]吧。 -Have you ever used Bodhi Linux? What is your favorite Ubuntu-based distro? Please let us know in the comments below. +你用过 Bodhi Linux 吗?你最喜欢的基于ubuntu的发行版是什么?请在下面的评论中告诉我们。 -If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][25]. +如果你觉得这篇文章很有趣,请花点时间在社交媒体、Hacker News或其他网站上分享 [Reddit][25]. -------------------------------------------------------------------------------- From f868f67d9f6bf98fb8e3eb9e3f94ed4fa40a1d04 Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Sat, 25 Apr 2020 22:38:30 +0800 Subject: [PATCH 0452/1809] Update 20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md --- ...hi Linux 5.1 Review- Slightly Different Lightweight Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md b/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md index b672d3b828..95476933d3 100644 --- a/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md +++ b/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md @@ -12,7 +12,7 @@ Bodhi Linux 5.1 一览: 略有不同的轻量化 Linux Bodhi Linux 是一个基于 Ubuntu 的[轻量级Linux发行版][1]。与其他大多数发行版不同,Bodhi 使用自己的 Moksha 桌面,并专注于为你提供在旧计算机上运行的最简设置。 -### 什么是菩提 Linux? +### 什么是 Bodhi Linux? ![Bodhi Start Page][2] From 6dba8793eca8e26ae2bf2d3e5ee893367c13bcbf Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Sat, 25 Apr 2020 22:39:13 +0800 Subject: [PATCH 0453/1809] Rename sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md to translated/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md --- ...odhi Linux 5.1 Review- Slightly Different Lightweight Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md (100%) diff --git a/sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md b/translated/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md similarity index 100% rename from sources/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md rename to translated/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md From afec8c0d69883d1c4e836eb4e7df909e31c8c5c6 Mon Sep 17 00:00:00 2001 From: Zioyi Date: Sat, 25 Apr 2020 23:13:11 +0800 Subject: [PATCH 0454/1809] translating --- sources/tech/20180710 Building a Messenger App- Messages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20180710 Building a Messenger App- Messages.md b/sources/tech/20180710 Building a Messenger App- Messages.md index 55e596df64..577d7324a3 100644 --- a/sources/tech/20180710 Building a Messenger App- Messages.md +++ b/sources/tech/20180710 Building a Messenger App- Messages.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Zioyi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1b7b114cfe1977ef6bb318e9e78f952bfa929cc9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 26 Apr 2020 01:04:10 +0800 Subject: [PATCH 0455/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200425=20Inli?= =?UTF-8?q?ning=20optimisations=20in=20Go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200425 Inlining optimisations in Go.md --- .../20200425 Inlining optimisations in Go.md | 215 ++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 sources/tech/20200425 Inlining optimisations in Go.md diff --git a/sources/tech/20200425 Inlining optimisations in Go.md b/sources/tech/20200425 Inlining optimisations in Go.md new file mode 100644 index 0000000000..3784d6868b --- /dev/null +++ b/sources/tech/20200425 Inlining optimisations in Go.md @@ -0,0 +1,215 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Inlining optimisations in Go) +[#]: via: (https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Inlining optimisations in Go +====== + +This is a post about how the Go compiler implements inlining and how this optimisation affects your Go code. + +_n.b._ This article focuses on _gc_, the de facto Go compiler from [golang.org][1]. The concepts discussed apply broadly to other Go compilers like gccgo and llgo but may differ in implementation and efficacy. + +### What is inlining? + +Inlining is the act of combining smaller functions into their respective callers. In the early days of computing this optimisation was typically performed by hand. Nowadays inlining is one of a class of fundamental optimisations performed automatically during the compilation process. + +### Why is inlining important? + +Inlining is important for two reasons. The first is it removes the overhead of the function call itself. The second is it permits the compiler to more effectively apply other optimisation strategies. + +#### Function call overhead + +Calling a function[1][2] in any language carries a cost. There are the overheads of marshalling parameters into registers or onto the stack (depending on the ABI) and reversing the process on return. Invoking a function call involves jumping the program counter from one point in the instruction stream to another which can cause a pipeline stall. Once inside the function there is usually some preamble required to prepare a new stack frame for the function to execute and a similar epilogue needed to retire the frame before returning to the caller. + +In Go a function call carries additional costs to support dynamic stack growth. On entry the amount of stack space available to the goroutine is compared to the amount required for the function. If insufficient stack space is available, the preamble jumps into the runtime logic that grows the stack by copying it to a new, larger, location. Once this is done the runtime jumps back to the start of the original function, the stack check is performed again, which now passes, and the call continues. In this way goroutines can start with a small stack allocation which grows only when needed.[2][3] + +This check is cheap–only a few instructions–and because goroutine stacks grows geometrically the check rarely fails. Thus, the branch prediction unit inside a modern processor can hide the cost of the stack check by assuming it will always be successful. In the case where the processor mis-predicts the stack check and has to discard the work done while it was executing speculatively, the cost of the pipeline stall is relatively small compared to the cost of the work needed for the runtime to grow a goroutines stack. + +While the overhead of the generic and Go specific components of each function call are well optimised by modern processors using speculative execution techniques, those overheads cannot be entirely eliminated, thus each function call carries with it a performance cost over and above the time it takes to perform useful work. As a function call’s overhead is fixed, smaller functions pay a larger cost relative to larger ones because they tend to do less useful work per invocation. + +The solution to eliminating these overheads must therefore be to eliminate the function call itself, which the Go compiler does, under certain conditions, by replacing the call to a function with the contents of the function. This is known as _inlining_ because it brings the body of the function in line with its caller. + +#### Improved optimisation opportunities + +Dr. Cliff Click describes inlining as _the_ optimisation performed by modern compilers as it forms the basis for optimisations like constant proportion and dead code elimination. In effect, inlining allows the compiler to _see_ _furthe_r, allowing it to observe, in the context that a particular function is being called, logic that can be further simplified or eliminated entirely. As inlining can be applied recursively optimisation decisions can be made not only in the context of each individual function, but also applied to the chain of functions in a call path. + +### Inlining in action + +The effects of inlining can be demonstrated with this small example + +``` +package main + +import "testing" + +//go:noinline +func max(a, b int) int { + if a > b { + return a + } + return b +} + +var Result int + +func BenchmarkMax(b *testing.B) { + var r int + for i := 0; i < b.N; i++ { + r = max(-1, i) + } + Result = r +} +``` + +Running this benchmark gives the following result:[3][4] + +``` +% go test -bench=.  +BenchmarkMax-4   530687617         2.24 ns/op +``` + +The cost of `max(-1, i)` is around 2.24 nanoseconds on my 2015 MacBook Air. Now let’s remove the `//go:noinline` pragma and see the result: + +``` +% go test -bench=.  +BenchmarkMax-4   1000000000         0.514 ns/op +``` + +From 2.24 ns to 0.51 ns, or according to `benchstat`, a 78% improvement. + +``` +% benchstat {old,new}.txt +name   old time/op  new time/op  delta +Max-4  2.21ns ± 1%  0.49ns ± 6%  -77.96%  (p=0.000 n=18+19) +``` + +Where did these improvements come from? + +First, the removal of the function call and associated preamble[4][5] was a major contributor. Pulling the contents of `max` into its caller reduced the number of instructions executed by the processor and eliminated several branches. + +Now the contents of `max` are visible to the compiler as it optimises `BenchmarkMax` it can make some additional improvements. Consider that once `max` is inlined, this is what the body of `BenchmarkMax` looks like to the compiler: + +``` +func BenchmarkMax(b *testing.B) { + var r int + for i := 0; i < b.N; i++ { + if -1 > i { + r = -1 + } else { + r = i + } + } + Result = r +} +``` + +Running the benchmark again we see our manually inlined version performs as well as the version inlined by the compiler + +``` +% benchstat {old,new}.txt +name   old time/op  new time/op  delta +Max-4  2.21ns ± 1%  0.48ns ± 3%  -78.14%  (p=0.000 n=18+18) +``` + +Now the compiler has access to the result of inlining `max` into `BenchmarkMax` it can apply optimisation passes which were not possible before. For example, the compiler has noted that `i` is initialised to `0` and only incremented so any comparison with `i` can assume `i` will never be negative. Thus, the condition `-1 > i` will never be true.[5][6] + +Having proved that `-1 > i` will never be true, the compiler can simplify the code to + +``` +func BenchmarkMax(b *testing.B) { + var r int + for i := 0; i < b.N; i++ { + if false { + r = -1 + } else { + r = i + } + } + Result = r +} +``` + +and because the branch is now a constant, the compiler can eliminate the unreachable path leaving it with + +``` +func BenchmarkMax(b *testing.B) { + var r int + for i := 0; i < b.N; i++ { + r = i + } + Result = r +} +``` + +Thus, through inlining and the optimisations it unlocks, the compiler has reduced the expression `r = max(-1, i)` to simply `r = i`. + +### The limits of inlining + +In this article I’ve discussed, so called, _leaf_ inlining; the act of inlining a function at the bottom of a call stack into its direct caller. Inlining is a recursive process, once a function has been inlined into its caller, the compiler may inline the resulting code into _its_ caller, as so on. For example, this code + +``` +func BenchmarkMaxMaxMax(b *testing.B) { + var r int + for i := 0; i < b.N; i++ { + r = max(max(-1, i), max(0, i)) + } + Result = r +} +``` + +runs as fast as the previous example as the compiler is able to repeatedly apply the optimisations outlined above to reduce the code to the same `r = i` expression. + +In the next article I’ll discuss an alternative inlining strategy when the Go compiler wishes to inline a function in the middle of a call stack. Finally I’ll discuss the limits that the compiler is prepared to go to to inline code, and which Go constructs are currently beyond its capability. + + 1. In Go, a method is just a function with a predefined formal parameter, the receiver. The relative costs of calling a free function vs a invoking a method, assuming that method is not called through an interface, are the same.[][7] + 2. Up until Go 1.14 the stack check preamble was also used by the garbage collector to stop the world by setting all active goroutine’s stacks to zero, forcing them to trap into the runtime the next time they made a function call. This system was [recently replaced][8] with a mechanism which allowed the runtime to pause an goroutine without waiting for it to make a function call.[][9] + 3. I’m using the `//go:noinline` pragma to prevent the compiler from inlining `max`. This is because I want to isolate the effects of inlining on `max` rather than disabling optimisations globally with `-gcflags='-l -N'`. I go into detail about the `//go:` comments in [this presentation][10].[][11] + 4. You can check this for yourself by comparing the output of `go test -bench=. -gcflags=-S` with and without the `//go:noinline` annotation.[][12] + 5. You can check this yourself with the `-gcflags=-d=ssa/prove/debug=on` flag.[][13] + + + +#### Related posts: + + 1. [Five things that make Go fast][14] + 2. [Why is a Goroutine’s stack infinite ?][15] + 3. [How to write benchmarks in Go][16] + 4. [Go’s hidden #pragmas][17] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://github.com/golang/go +[2]: tmp.gBQ2tEtMHc#easy-footnote-bottom-1-4053 (In Go, a method is just a function with a predefined formal parameter, the receiver. The relative costs of calling a free function vs a invoking a method, assuming that method is not called through an interface, are the same.) +[3]: tmp.gBQ2tEtMHc#easy-footnote-bottom-2-4053 (Up until Go 1.14 the stack check preamble was also used by the garbage collector to stop the world by setting all active goroutine’s stacks to zero, forcing them to trap into the runtime the next time they made a function call. This system was recently replaced with a mechanism which allowed the runtime to pause an goroutine without waiting for it to make a function call.) +[4]: tmp.gBQ2tEtMHc#easy-footnote-bottom-3-4053 (I’m using the //go:noinline pragma to prevent the compiler from inlining max. This is because I want to isolate the effects of inlining on max rather than disabling optimisations globally with -gcflags='-l -N'. I go into detail about the //go: comments in this presentation.) +[5]: tmp.gBQ2tEtMHc#easy-footnote-bottom-4-4053 (You can check this for yourself by comparing the output of go test -bench=. -gcflags=-S with and without the //go:noinline annotation.) +[6]: tmp.gBQ2tEtMHc#easy-footnote-bottom-5-4053 (You can check this yourself with the -gcflags=-d=ssa/prove/debug=on flag.) +[7]: tmp.gBQ2tEtMHc#easy-footnote-1-4053 +[8]: https://github.com/golang/proposal/blob/master/design/24543-non-cooperative-preemption.md +[9]: tmp.gBQ2tEtMHc#easy-footnote-2-4053 +[10]: https://dave.cheney.net/2018/01/08/gos-hidden-pragmas +[11]: tmp.gBQ2tEtMHc#easy-footnote-3-4053 +[12]: tmp.gBQ2tEtMHc#easy-footnote-4-4053 +[13]: tmp.gBQ2tEtMHc#easy-footnote-5-4053 +[14]: https://dave.cheney.net/2014/06/07/five-things-that-make-go-fast (Five things that make Go fast) +[15]: https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite (Why is a Goroutine’s stack infinite ?) +[16]: https://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go (How to write benchmarks in Go) +[17]: https://dave.cheney.net/2018/01/08/gos-hidden-pragmas (Go’s hidden #pragmas) From e2b6de7b673449fb6a87f369d64ae965e554a00b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 26 Apr 2020 01:04:46 +0800 Subject: [PATCH 0456/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200425=20The?= =?UTF-8?q?=20rebirth=20of=20Mapzen,=20new=20projects=20bolster=20PyTorch,?= =?UTF-8?q?=20faster=20AI=20object=20detection,=20and=20other=20open=20sou?= =?UTF-8?q?rce=20news?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200425 The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news.md --- ...t detection, and other open source news.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/tech/20200425 The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news.md diff --git a/sources/tech/20200425 The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news.md b/sources/tech/20200425 The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news.md new file mode 100644 index 0000000000..6e74c028bf --- /dev/null +++ b/sources/tech/20200425 The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news) +[#]: via: (https://opensource.com/article/20/4/news-march-25) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news +====== +Catch up on the biggest open source headlines from the past two weeks. +![][1] + +In this edition of our open source news roundup, we take a look at the rebirth of Mapzen, two new projects to bolster PyTorch, new open source object detection software, and more! + +### Mapzen makes a comeback + +While its technology is used by open source projects like OpenStreetMap and by firms like Foursquare, open source mapping company Mapzen couldn't sustain itself as a business.  Mapzen initially closed its doors in 2018, but it has [a new lease on life][2] with the support of the Linux Foundation. + +As a project under the Urban Computing Foundation (UCF), Mapzen "encompasses six independent projects and communities involved in developing a truly open platform for mapping, search, navigation and transit data." Being under the UCF's umbrella enables Mapzen's developers to "collaborate on and build a common set of open-source tools connecting cities, autonomous vehicles, and smart infrastructure." They can also tap such UCF members as Google, IBM, and the University of California San Diego for support. Mapzen projects are available under their [GitHub organization][3]. + +### New open source projects to bolster PyTorch + +PyTorch, the open source machine learning framework originating out of Facebook, has been getting a lot of love lately from both its creator and from AWS. The two firms have [released open source projects to bolster PyTorch][4]. + +Facebook is sharing TorchServe, "a model-serving framework for PyTorch that will make it easier for developers to put their models into production." AWS's contribution is TorchElastic, "a library that makes it easier for developers to build fault-tolerant training jobs on Kubernetes clusters." PyTorch's product manager Joe Spisak [told VentureBeat][5] that by using the two projects developers can run "training over a number of nodes without the training job actually failing; it will just continue gracefully, and once those nodes come back online, it can basically restart the training." + +You can find the code for [TorchServe][6] and [TorchElastic][7] on GitHub. + +### Microsoft and Huazhong University release object detection AI + +One of the more difficult tasks facing artificial intelligence systems is to accurately detect and identify objects in photos and videos. Researchers from Microsoft and China's Huazhong University have [released an open source tool][8] that does the job quickly and efficiently. + +Called Fair Multi-Object Tracking (FairMOT for short), the tool "outperforms state-of-the-art models on public data sets at 30 frames per second" (almost normal video speed). It took researches about 30 hours to train the software using data from the MOT Challenge, which is "a framework for validating people-tracking algorithms." The team behind FairMOT believe that the tool can be used in "industries ranging from elder care to security, and perhaps be used to track the spread of illnesses like COVID-19." + +You can view the source code and training models for FairMOT in [this GitHub repository][9]. + +#### In other news + + * [Will a small open-source effort from Japan disrupt the autonomous space?][10] + * [Google open-sources data set to train and benchmark AI sound separation models][11] + * [Docker builds open source community around Compose Specification][12] + * [Sophos Sandboxie is now available as an open-source tool][13] + * [PyCon has moved to an online-only event and is available now][14] + + + +Thanks, as always, to Opensource.com staff members and [Correspondents][15] for their help this week. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/news-march-25 + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/weekly_news_roundup_tv.png?itok=tibLvjBd +[2]: https://www.zdnet.com/article/mapzen-open-source-mapping-project-revived-under-the-urban-computing-foundation/ +[3]: https://github.com/mapzen/ +[4]: https://techcrunch.com/2020/04/21/aws-and-facebook-launch-an-open-source-model-server-for-pytorch/ +[5]: https://venturebeat.com/2020/04/21/facebook-partners-with-aws-on-pytorch-1-5-upgrades-like-torchserve-for-model-serving/ +[6]: https://github.com/pytorch/serve +[7]: https://github.com/pytorch/elastic +[8]: https://venturebeat.com/2020/04/08/researchers-open-source-state-of-the-art-object-tracking-ai/ +[9]: https://github.com/ifzhang/FairMOT +[10]: https://www.forbes.com/sites/rahulrazdan/2020/04/04/will-a-small-open-source-effort-from-japan-disrupt-the--autonomous-space-/#6e6819f01cc5 +[11]: https://venturebeat.com/2020/04/09/google-open-sources-data-set-to-train-and-benchmark-ai-sound-separation-models/ +[12]: https://sdtimes.com/softwaredev/docker-builds-open-source-community-around-compose-specification/ +[13]: https://securityaffairs.co/wordpress/101397/malware/sandboxie-sandbox-open-source.html +[14]: https://us.pycon.org/2020/online/ +[15]: https://opensource.com/correspondent-program From 8b99de80e2e8b939bec0a51c2b287dff9c070a42 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 26 Apr 2020 08:43:44 +0800 Subject: [PATCH 0457/1809] translated --- ...Addresses, and Interface Speed on Linux.md | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) rename {sources => translated}/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md (51%) diff --git a/sources/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md b/translated/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md similarity index 51% rename from sources/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md rename to translated/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md index a16a007124..e586660e0c 100644 --- a/sources/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md +++ b/translated/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md @@ -7,28 +7,28 @@ [#]: via: (https://www.2daygeek.com/linux-unix-check-network-interfaces-names-nic-speed-ip-mac-address/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux +如何在 Linux 上检查可用的网络接口、关联的 IP 地址、MAC 地址和接口速度 ====== -By default when you set up the server you will configure the primary network interface. +默认在设置服务器时,你将配置主网络接口。 -This is part of the build work that everyone does. +这是每个人所做的构建工作的一部分。 -Sometimes you may need to configure an additional network interface for several reasons. +有时出于各种原因,你可能需要配置额外的网络接口。 -This could be a network bonding/teaming or high availability or a separate interface for application requirements or backups. +这可以是网络绑定/团队合作或高可用性,也可以是用于应用需求或备份的单独接口。 -To do so, you need to know how many interfaces your computer has and their speed to configure it. +为此,你需要知道计算机有多少接口以及它们的配置速度。 -There are many commands to check for available network interfaces, but we only use the IP command. +有许多命令可检查可用的网络接口,但是我们仅使用 IP 命令。 -Later we will write a separate article with all these tools. +稍后,我们将使用所有这些工具编写单独的文章。 -In this tutorial, we will show you the Available Network Interface Card (NIC) information, such as the interface name, associated IP address, MAC address, and interface speed. +在本教程中,我们将向你显示可用网络网卡(NIC)信息,例如接口名称、关联的 IP 地址、MAC 地址和接口速度。 -### What’s IP Command +### 什么是 IP 命令 -**[IP command][1]** is similar to ifconfig, which is used to for assigning Static IP Address, Route & Default Gateway, etc., +**[IP 命令][1]**类似于 ifconfig, 用于分配静态 IP 地址、路由和默认网关等。 ``` # ip a @@ -45,17 +45,17 @@ In this tutorial, we will show you the Available Network Interface Card (NIC) in valid_lft forever preferred_lft forever ``` -### What’s ethtool Command +### 什么是 ethtool 命令 -The ethtool is used to query or control network driver and hardware settings. +ethtool 用于查询或控制网络驱动或硬件设置。 ``` # ethtool eth0 ``` -### 1) How to Check the Available Network Interfaces on Linux Using the IP Command +### 1)如何在 Linux 上使用 IP 命令检查可用的网络接口 -When you run the IP command without any arguments, it gives you plenty of information, but if you only need the available network interfaces, use the following customized IP command. +在不带任何参数的情况下运行 IP 命令时,它会提供大量信息,但是,如果仅需要可用的网络接口,请使用以下定制的 IP 命令。 ``` # ip a |awk '/state UP/{print $2}' @@ -64,9 +64,9 @@ eth0: eth1: ``` -### 2) How to Check the IP Address of a Network Interface on Linux Using the IP Command +### 2)如何在 Linux 上使用 IP 命令检查网络接口的 IP 地址 -If you only want to see which IP address is assigned to which interface, use the following customized IP command. +如果只想查看 IP 地址分配给了哪个接口,请使用以下定制的 IP 命令。 ``` # ip -o a show | cut -d ' ' -f 2,7 @@ -78,18 +78,18 @@ lo 127.0.0.1/8 192.168.1.102/24 ``` -### 3) How to Check the Network Interface Card MAC Address on Linux Using the IP Command +### 3)如何在 Linux 上使用 IP 命令检查网卡的 MAC 地址 -If you only want to see the network interface name and the corresponding MAC address, use the following format. +如果只想查看网络接口名称和相应的 MAC 地址,请使用以下格式。 -To check a specific network interface MAC address. +检查特定的网络接口的 MAC 地址。 ``` # ip link show dev eth0 |awk '/link/{print $2}' 00:00:00:55:43:5c ``` -To check MAC address for all network interface. +检查所有网络接口的 MAC 地址。 ``` # vi /opt/scripts/mac-addresses.sh @@ -102,7 +102,7 @@ ethtool -P $output done ``` -Run the below shell script to get the MAC address for multiple network interfaces. +运行下面的 shell 脚本获取多个网络接口的 MAC 地址。 ``` # sh /opt/scripts/mac-addresses.sh @@ -113,11 +113,11 @@ eth1: Permanent address: 00:00:00:55:43:5d ``` -### 4) How to Check the Network Interface Port Speed on Linux Using the ethtool Command +### 4)如何在 Linux 上使用 ethtool 命令检查网络接口速度 -If you want to check the network interface port speed on Linux, use the ethtool command. +如果要在 Linux 上检查网络接口速度,请使用 ethtool 命令。 -To check the speed of a particular network interface port. +检查特定网络接口的速度。 ``` # ethtool eth0 |grep "Speed:" @@ -125,7 +125,7 @@ To check the speed of a particular network interface port. Speed: 10000Mb/s ``` -To check the port speed for all network interfaces. +检查所有网络接口速度。 ``` # vi /opt/scripts/port-speed.sh @@ -138,7 +138,7 @@ ethtool $output |grep "Speed:" done ``` -Run the below shell script to get the port speed for multiple network interfaces. +运行以下 shell 脚本获取多个网络接口速度。 ``` # sh /opt/scripts/port-speed.sh @@ -149,9 +149,9 @@ eth1: Speed: 10000Mb/s ``` -### 5) Shell Script to Verify Network Interface Card Information +### 5)验证网卡信息的 Shell 脚本 -This **[shell script][2]** allows you to gather all of the above information, such as network interface names, IP addresses of network interfaces, MAC addresses of network interfaces, and the speed of a network interface port. +通过此 **[shell 脚本][2]**,你可以收集上述所有信息,例如网络接口名称、网络接口的 IP 地址,网络接口的 MAC 地址以及网络接口的速度。 ``` # vi /opt/scripts/nic-info.sh @@ -168,7 +168,7 @@ ethtool $iname |grep "Speed:" done ``` -Run the below shell script to check network card information. +运行以下 shell 脚本检查网卡信息。 ``` # sh /opt/scripts/nic-info.sh @@ -191,7 +191,7 @@ via: https://www.2daygeek.com/linux-unix-check-network-interfaces-names-nic-spee 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From af33cebcfad63da5e6dc5d51d25b89e66d6d0b78 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 26 Apr 2020 08:49:11 +0800 Subject: [PATCH 0458/1809] translating --- ...hat Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md b/sources/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md index ac820a3369..4934186f76 100644 --- a/sources/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md +++ b/sources/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e4376766541a2a7f543275f9191df7040be10dc6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 26 Apr 2020 09:51:05 +0800 Subject: [PATCH 0459/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191007=2020?= =?UTF-8?q?=20Linux=20Command=20Tips=20and=20Tricks=20That=20Will=20Save?= =?UTF-8?q?=20You=20A=20Lot=20of=20Time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191007 20 Linux Command Tips and Tricks That Will Save You A Lot of Time.md --- ...Tricks That Will Save You A Lot of Time.md | 307 ++++++++++++++++++ 1 file changed, 307 insertions(+) create mode 100644 sources/tech/20191007 20 Linux Command Tips and Tricks That Will Save You A Lot of Time.md diff --git a/sources/tech/20191007 20 Linux Command Tips and Tricks That Will Save You A Lot of Time.md b/sources/tech/20191007 20 Linux Command Tips and Tricks That Will Save You A Lot of Time.md new file mode 100644 index 0000000000..da080e65ea --- /dev/null +++ b/sources/tech/20191007 20 Linux Command Tips and Tricks That Will Save You A Lot of Time.md @@ -0,0 +1,307 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (20 Linux Command Tips and Tricks That Will Save You A Lot of Time) +[#]: via: (https://itsfoss.com/linux-command-tricks/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +20 Linux Command Tips and Tricks That Will Save You A Lot of Time +====== + +_**Brief**: Here are some tiny but useful Linux commands, terminal tricks and shortcuts that will save you a lot of time while working with Linux command line._ + +Have you ever encountered a moment when you see your colleague using some simple Linux commands for tasks that took you several keystrokes? And when you saw that you were like, “Wow! I didn’t know it could have been done that easily”. + +In this article, I’ll show you some pro Linux command tricks that will save you a lot of time and in some cases, from plenty of frustration. Not only your friends or colleagues will ‘wow’ at you, it will also help you increase your productivity as you will need fewer keystrokes and even fewer mouse clicks. + +It’s not that these are Linux tips for beginners only. Chances are that even experienced Linux users will find some hidden gems that they were not aware despite using Linux for all these years. + +In any case, you [learn Linux][1] by experience, be it your own or someone else’s :) + +### Cool Linux terminal tricks to save time and increase productivity + +![][2] + +You might already know a few of these Linux command tips or perhaps all of it. In either case, you are welcome to share your favorite tricks in the comment section. + +Some of these tips also depend on how the shell is configured. Let’s begin! + +#### 0\. Using tab for autocompletion + +I’ll start with something really obvious and yet really important: tab completion. + +When you are starting to type something in Linux terminal, you can hit the tab key and it will suggest all the possible options that start with string you have typed so far. + +For example, if you are trying to copy a file named my_best_file_1.txt, you can just type ‘cp m’ and hit tab to see the possible options. + +![Use tab for auto-completion][3] + +You can use tab in completing commands as well. + +[irp posts=”16244″ name=”Difference Between apt and apt-get Explained”] + +#### 1\. Switch back to the last working directory + +Suppose you end up in a long directory path and then you move to another directory in a totally different path. And then you realize that you have to go back to the previous directory you were in. In this case, all you need to do is to type this command: + +``` +cd - +``` + +This will put you back in the last working directory. You don’t need to type the long directory path or copy paste it anymore. + +![Easily switch between directories][4] + +#### 2\. Go back to home directory + +This is way too obvious. You can use the command below to move to your home directory from anywhere in Linux command-line: + +``` +cd ~ +``` + +However, you can also use just cd to go back to home directory: + +``` +cd +``` + +Most modern Linux distributions have the shell pre-configured for this command. Saves you at least two keystrokes here. + +![Move to Home as quickly as possible][5] + +#### 3\. List the contents of a directory + +You must be guessing what’s the trick in the command for listing the contents of a directory. Everyone knows to use the ls -l for this purpose. + +And that’s the thing. Most people use ls -l to list the contents of the directory, whereas the same can be done with the following command: + +``` +ll +``` + +Again, this depends on the Linux distributions and shell configuration, but chances are that you’ll be able to use it in most Linux distributions. + +![Using ll instead of ls -l][6] + +#### 4\. Running multiple commands in one single command + +Suppose, you have to run several commands one after another. Do you wait for the first command to finish running and then execute the next one? + +You can use the ‘;’ separator for this purpose. This way, you can run a number of commands in one line. No need to wait for the previous commands to finish their business. + +``` +command_1; command_2; command_3 +``` + +#### 5\. Running multiple commands in one single command only if the previous command was successful + +In the previous command, you saw how to run several commands in one single command to save time. But what if you have to make sure that commands don’t fail? + +Imagine a situation where you want to build a code and then if the build was successful, run the make? + +You can use && separator for this case. && makes sure that the next command will only run when the previous command was successful. + +``` +command_1 && command_2 +``` + +A good example of this command is when you use sudo apt update && sudo apt upgrade to upgrade your system. + +#### 6\. Easily search and use the commands that you had used in the past + +Imagine a situation where you used a long command couple of minutes/hours ago and you have to use it again. Problem is that you cannot remember the exact command anymore. + +Reverse search is your savior here. You can search for the command in the history using a search term. + +Just use the keys ctrl+r to initiate reverse search and type some part of the command. It will look up into the history and will show you the commands that matches the search term. + +``` +ctrl+r search_term +``` + +By default, it will show just one result. To see more results matching your search term, you will have to use ctrl+r again and again. To quit reverse search, just use Ctrl+C. + +![Reverse search in command history][7] + +Note that in some Bash shells, you can also use Page Up and Down key with your search term and it will autocomplete the command. + +#### 7\. Unfreeze your Linux terminal from accidental Ctrl+S + +You probably are habitual of using Ctrl+S for saving. But if you use that in Linux terminal, you’ll have a frozen terminal. + +Don’t worry, you don’t have to close the terminal, not anymore. Just use Ctrl+Q and you can use the terminal again. + +``` +ctrl+Q +``` + +#### 8\. Move to beginning or end of line + +Suppose you are typing a long command and midway you realize that you had to change something at the beginning. You would use several left arrow keystrokes to move to the start of the line. And similarly for going to the end of the line. + +You can use Home and End keys here of course but alternatively, you can use Ctrl+A to go to the beginning of the line and Ctrl+E to go to the end. + +![Move to the beginning or end of the line][8] + +I find it more convenient than using the home and end keys, especially on my laptop. + +#### 9\. Reading a log file in real time + +In situations where you need to analyze the logs while the application is running, you can use the tail command with -f option. + +``` +tail -f path_to_Log +``` + +You can also use the regular grep options to display only those lines that are meaningful to you: + +``` +tail -f path_to_log | grep search_term +``` + +You can also use the option F here. This will keep the tail running even if the log file is deleted. So if the log file is created again, tail will continue logging. + +#### 10\. Reading compressed logs without extracting + +Server logs are usually gzip compressed to save disk space. It creates an issue for the developer or sysadmin analyzing the logs. You might have to [scp][9] it to your local and then extract it to access the files because, at times, you don’t have write permission to extract the logs. + +Thankfully, z commands save you in such situations. z commands provide alternatives of the regular commands that you use to deal with log files such as less, cat, grep etc. + +So you get zless, zcat, zgrep etc and you don’t even have to explicitly extract the compressed files. Please refer to my earlier article about [using z commands to real compressed logs][10] in detail. + +This was one of the secret finds that won me a coffee from my colleague. + +#### 11\. Use less to read files + +To see the contents of a file, cat is not the best option especially if it is a big file. cat command will display the entire file on your screen. + +You can use Vi, Vim or other terminal based text editors but if you just want to read a file, less command is a far better choice. + +``` +less path_to_file +``` + +You can search for terms inside less, move by page, display with line numbers etc. + +#### 12\. Reuse the last item from the previous command with !$ + +Using the argument of the previous command comes handy in many situations. + +Say you have to create a directory and then go into the newly created directory. There you can use the !$ options. + +![Use !$ to use the argument of last command][11] + +A better way to do the same is to use alt+. . You can use . a number times to shuffle between the options of the last commands. + +#### 13\. Reuse the previous command in present command with !! + +You can call the entire previous command with !!. This comes particularly useful when you have to run a command and realize that it needs root privileges. + +A quick sudo !! saves plenty of keystrokes here. + +![Use !! to use last command as an argument][12] + +#### 14\. Using alias to fix typos + +You probably already know what is an alias command in Linux. What you can do is, to use them to fix typos. + +For example, you might often mistype grep as gerp. If you put an alias in your bashrc in this fashion: + +``` +alias gerp=grep +``` + +This way you won’t have to retype the command again. + +#### 15\. Copy Paste in Linux terminal + +This one is slightly ambiguous because it depends on Linux distributions and terminal applications. But in general, you should be able to copy paste commands with these shortcuts: + + * Select the text for copying and right click for paste (works in Putty and other Windows SSH clients) + * Select the text for copying and middle click (scroll button on the mouse) for paste + * Ctrl+Shift+C for copy and Ctrl+Shift+V for paste + + + +#### 16\. Kill a running command/process + +This one is perhaps way too obvious. If there is a command running in the foreground and you want to exit it, you can press Ctrl+C to stop that running command. + +#### 17\. Using yes command for commands or scripts that need interactive response + +If there are some commands or scripts that need user interaction and you know that you have to enter Y each time it requires an input, you can use Yes command. + +Just use it in the below fashion: + +``` +yes | command_or_script +``` + +#### 18\. Empty a file without deleting it + +If you just want to empty the contents of a text file without deleting the file itself, you can use a command similar to this: + +``` +> filename +``` + +#### 19\. Find if there are files containing a particular text + +There are multiple ways to search and find in Linux command line. But in the case when you just want to see if there are files that contain a particular text, you can use this command: + +``` +grep -Pri Search_Term path_to_directory +``` + +I highly advise mastering find command though. + +#### 20\. Using help with any command + +I’ll conclude this article with one more obvious and yet very important ‘trick’, using help with a command or a command line tool. + +Almost all command and command line tool come with a help page that shows how to use the command. Often using help will tell you the basic usage of the tool/command. + +Just use it in this fashion: + +``` +command_tool --help +``` + +#### Your favorite Linux command line tricks? + +I have deliberately not included commands like [fuck][13] because those are not standard commands that you’ll find everywhere. The tricks discussed here should be usable almost in all Linux distributions and shell without the need of installing a new tool. + +I would also suggest [using alias command in Linux][14] to replace complicated commands with a simple. Saves a lot of time. + +I know that there are more Linux command tricks to save time in the terminal. Why not share some of your experiences with Linux and do share your best trick with rest of the community here? The comment section below is at your disposal. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-command-tricks/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/learn-linux-for-free/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-Tricks-Save-Time.jpeg?resize=800%2C450&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-8.png?ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-1.png?ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-2.png?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-3.png?ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-4.png?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-5.png?ssl=1 +[9]: http://www.hypexr.org/linux_scp_help.php +[10]: https://itsfoss.com/read-compressed-log-files-linux/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-6.png?ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-7.png?ssl=1 +[13]: https://github.com/nvbn/thefuck +[14]: https://linuxhandbook.com/linux-alias-command/ From a974d3355175a0628e038d63c5fa3d30169f1fb3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 26 Apr 2020 12:06:55 +0800 Subject: [PATCH 0460/1809] Rename sources/tech/20200425 The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news.md to sources/news/20200425 The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news.md --- ...rch, faster AI object detection, and other open source news.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200425 The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news.md (100%) diff --git a/sources/tech/20200425 The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news.md b/sources/news/20200425 The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news.md similarity index 100% rename from sources/tech/20200425 The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news.md rename to sources/news/20200425 The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news.md From 1bfff635fcd32d22ffdc1a8bfffd61756d75b352 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 Apr 2020 15:54:18 +0800 Subject: [PATCH 0461/1809] PRF @robsean --- ... make a Halloween lantern with Inkscape.md | 153 +++++++----------- 1 file changed, 60 insertions(+), 93 deletions(-) diff --git a/translated/tech/20191014 How to make a Halloween lantern with Inkscape.md b/translated/tech/20191014 How to make a Halloween lantern with Inkscape.md index 5e1424ed02..04307ec7bc 100644 --- a/translated/tech/20191014 How to make a Halloween lantern with Inkscape.md +++ b/translated/tech/20191014 How to make a Halloween lantern with Inkscape.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to make a Halloween lantern with Inkscape) @@ -9,152 +9,119 @@ 如何使用 Inkscape 制作万圣节灯笼 ====== -使用开源软件为你最喜欢的万圣节灯笼制作一个有趣和怪异的装饰品。 + +> 使用开源软件为你最喜欢的万圣节鬼屋制作一个有趣和怪异的装饰品。 + ![万圣节 - 背光飞行的蝙蝠][1] -闹鬼的季节快到了!今年,使用开源软件装饰一个独一无二的万圣节灯笼! +使用开源软件装饰一个独一无二的万圣节灯笼! -灯笼的一部分结构体是不透明的,以阻挡内部的光线。灯笼之所以成为灯笼,是因为其去掉了一些东西 :从结构体上切下的窗户,这样光线就可以射出。虽然照明不实用,但是一个有着怪异形状窗户和隐藏暗色轮廓的灯笼却可以令人兴奋,并创造出很多乐趣。 +通常,灯笼的一部分结构体是不透明的,以阻挡内部的光线。灯笼之所以成为灯笼,是因为其去掉了一些东西 :从结构体上切开的窗口,这样光线就可以射出。虽然对于照明来说不实用,但是一个有着怪异形状窗口和隐藏暗色轮廓的灯笼却可以令人兴奋,并创造出很多乐趣。 -这篇演示如何使用 [Inkscape][2] 创建你自己的灯笼。如果还没有 Inkscape ,在 Linux 上,你可以从软件包存储库中安装它,在 MacOS 和 Windows 上,你可以从[Inkscape 网站][3] 上下载它. +这篇演示如何使用 [Inkscape][2] 创建你自己的灯笼。如果还没有 Inkscape ,在 Linux 上,你可以从软件库中安装它,在 MacOS 和 Windows 上,你可以从[Inkscape 网站][3] 上下载它. ### 使用材料 - * 模板 ([A4][4] 或 [Letter][5] 大小) - * 卡片纸 (黑色是传统色) - * 描图纸 (可选) - * 裁纸刀,尺子, 切割垫板 (可使用工艺切割机/激光切割机代替) + * 模板([A4][4] 或[信纸][5]大小) + * 卡片纸(黑色是传统色) + * 描图纸(可选) + * 裁纸刀、尺子、切割垫板(可使用工艺切割机/激光切割机代替) * 工艺胶 * LED 茶灯"蜡烛" -_安全注意事项:_ 这个项目只使用电池操作的蜡烛。 - - +安全注意事项:这个项目只使用电池操作的蜡烛。 ### 理解模板 -首先,从什么的链接下载你所在区域 (A4 或 Letter) 的合适的模板,然后在 Inkscape 中打开它。 +首先,从上面的链接下载你所在区域(A4 或信纸)的合适的模板,然后在 Inkscape 中打开它。 -* * * +![灯笼模板荧光屏][6] -* * * +灰白色的棋盘格背景是透明的(从技术角度来说,它是 alpha 通道。) -* * * +黑色基板构成了灯笼。现在,没有窗口可以让光线穿过;灯笼有一个非镂空的黑色基板。你将在 Inkscape 中使用**并集**和**差集**选项来数字化的设计窗口。 -**![灯笼模板荧光屏][6]** - -灰白色的棋盘格背景是透明的(从技术角度来说,它是 _alpha 通道_。) - -黑色基板构成了灯笼。现在,没有窗口可以让光线穿过;灯笼有一个非镂空的黑色基板。你将在 Inkscape 中使用 **并集** 和 **差集** 选项来数字化的设计窗户。 - -蓝色虚线表示折线。橙色实线表示参考线。采光窗户不应该放在橙色盒子的外面。 +蓝色虚线表示折线。橙色实线表示参考线。采光窗口不应该放在橙色盒子的外面。 模板的左侧是你可以在你设计中使用的一些预先制作好的对象。 -### 来创建一个窗户或形状 +### 创建一个窗口或形状 - 1. 创建一个看起来像你想要的窗口样式的对象。可以使用 Inkscape 左侧工具栏中的一些形状工具来创建对象。此外,你可以下载 Creative Commons- 或 Public Domain-licensed 剪贴画,并导入 PNG 文件到你的项目中。 - 2. 当你对对象满意时,在顶部菜单中选择 **路径 > 对象转化成路径** 将其转换为一个 **路径** (而不是一个 **形状** ,Inkscape 视其为两个不同的目标)。 +1. 创建一个看起来像你想要的窗口样式的对象。可以使用 Inkscape 左侧工具栏中的一些形状工具来创建对象。此外,你可以下载共创或公共领域的剪贴画,并导入 PNG 文件到你的项目中。 +2. 当你对对象的形状满意时,在顶部菜单中选择“路径” -> “对象转化成路径” 将其转换为一个路径(而不是一个形状,Inkscape 视其为两种不同的对象)。 + ![对象到路径 菜单][7] +3. 在基板形状的上面放置对象。 +4. 选择对象和黑色基板。通过先单击一个,并按住 `Shift` 按键,再选择另一个来完成。 +5. 从顶部菜单选择“路径” -> “差集” 来从基板的对象中移除形状。这将创建灯笼中的一个窗口。 -![对象到路径菜单][7] + ![路径 > 差集 菜单][8] - 3. 在基板形状的上面放置目标。 - 4. 选择目标和黑色基板。通过先单击一个,并按住 Shift 按键,再选择另一个来完成。 - 5. 从顶部菜单选择 **路径 > 差集** 来从基板的对象中移除形状。这将创建灯笼中的一个窗户。 +### 添加对象到窗口中 +在制作了一个窗口后,你可以添加对象到其中来创建一个场景。 +提示: -![路径 > 差集 菜单][8] +* 所有的对象,包括文本,必须连接到灯笼的基板,否则,在切割后会掉落下来,并留下一片空白。 +* 避免小而复杂的细微之处。即使使用激光切割机或工艺切割机等机器,也很难切割这些细微之处。 -### 添加一个对象到一个窗户中 - -在制作一个窗户后,你可以添加对象到其中来创建一个景色绘画。 - -**提示:** - - * 所有的对象,包括文本,必须连接到灯笼的基板,否则,在切割后会掉落下来,并留下一片空白区。 - * 避免小而复杂的细微之处。即使使用激光切割机或工艺切割机等机器,也很难切割这些细微之处。 - - - 1. 创建或导入一个对象。 - 2. 放置对象到窗口内,以便它至少接触基板的两侧。 - 3. 选择对象后,从顶部菜单选择 **连接 > 对象转化成路径** 。 - - - -![对象到路径 菜单][9] - - 4. 选择对象和黑色基板,通过在按住 Shift 按键的同时单击每一个来完成。 - 5. 选择 **路径 > 并集** 来使对象和基板合二为一。 +1. 创建或导入一个对象。 +2. 放置对象到窗口内,以便它至少接触基板的两侧。 +3. 选择对象后,从顶部菜单选择“连接” -> “对象转化成路径”。 + ![对象到路径 菜单][9] +4. 选择对象和黑色基板,通过在按住 `Shift` 按键的同时单击每一个来完成。 +5. 选择“路径” -> “并集”来使对象和基板合二为一。 ### 添加文本 -文本可以从创建一个窗户的基板上剪下来(就像我对星星所做的那样),或者也可以添加到一个窗户上(它在独挡来自灯笼内部的光线)。如果你正在创建一个窗户,只需要执行下面的步骤1和步骤2,然后使用 **差集** 来从基板层移除文本。 +文本既可以从基板剪出文字来创建一个窗口(就像我对星星所做的那样),或者也可以添加到一个窗口上(它可以阻挡来自灯笼内部的光线)。如果你要创建一个窗口,只需要执行下面的步骤 1 和步骤 2,然后使用“差集”来从基板移除文本。 - 1. 从左侧边栏中选择文本工具来创建文本。粗体字体效果最好。 +1. 从左侧边栏中选择文本工具来创建文本。粗体字体效果最好。 -![文本工具][10] + ![文本工具][10] - 2. 选择你的文本,然后从顶部菜单选择 **路径 > 对象转化成路径** 。这将转换文本对象为一个路径。注意,这个步骤意味着你将不能再编辑该文本,所以,_只有当_ 你确定你拥有想要的单词后,执行这个步骤。 +2. 选择你的文本,然后从顶部菜单选择“路径” -> “对象转化成路径”。这将转换文本对象为一个路径。注意,这个步骤意味着你将不能再编辑该文本,所以,*只有当*你确定你拥有想要的单词后,执行这个步骤。 +3. 在你转换文本后,你可以按键盘上的 `F2` 来激活节点编辑器工具,当选择使用这个工具时,可以清楚地显示文本的节点。 - 3. 在你转换文本后,你可以按键盘上的 **F2** 来激活 **节点编辑器** 工具,当选择使用这个工具时,可以清楚地显示文本的节点。 + ![选中的文本使用节点编辑器][11] +4. 取消文本分组。 +5. 调整每个字母,以便使其与相邻字母或基板稍微重叠。 + ![重叠文本][12] +6. 为将所有的字母彼此连接,并连接到基板,重新选择所有文本和基板,然后选择“路径” -> “并集”。 -![选中的文本使用节点编辑器][11] - - 4. 取消文本分组。 - 5. 调整每个字母,以便使其与相邻字母或基板稍微重叠。 - - - -![重叠文本][12] - - 6. 为将所有的字母彼此连接并连接到基板,重新选择所有文本和基板,然后选择 **路径 > 并集**。 - -![使用 路径 > 并集 连接字母和基板][13] - - - + ![使用 路径 > 并集 连接字母和基板][13] ### 准备打印 下面是手工切割灯笼的说明。如果使用激光切割机或工艺切割机,遵循硬件所需要的技巧来准备好你的文件。 - 1. 在 **图层** 面板中,单击 **安全** 图层旁边的**眼睛** 图标来隐藏安全线。如果你看不到图层面板,通过顶部菜单选择 **图层 > 图层** 来显示它。 - 2. 选择黑色基板。在 **填充和笔划** 面板中,设置填充为 **X** (意味着 _不填充_),设置 **笔划** 为纯黑色(对于巫法的粉丝来说是 #000000ff )。 +1. 在“图层”面板中,单击“安全”图层旁边的“眼睛”图标来隐藏安全线。如果你看不到图层面板,通过顶部菜单选择“图层” -> “图层”来显示它。 +2. 选择黑色基板。在“填充和笔划”面板中,设置填充为“X”(意味着*不填充*),设置“笔划”为纯黑色(对于喜欢十六进制的粉丝来说是 `#000000ff` )。 + ![设置填充和笔划][14] +3. 使用“文件” -> “打印”来打印你的图案。 +4. 使用一把工艺刀和直尺,小心地绕着每一条黑线切割。在蓝色虚线上轻划,然后折叠。 -![设置填充和笔划][14] + ![裁剪灯笼][15] - 3. 使用 **文件 > 打印** 来打印你的图案样本。 +5. 要完成窗口的制作,剪切描图纸为每个窗口的大小,然后粘贴它到灯笼的内侧。 - 4. 使用一把工艺刀和直尺,小心地绕着每一条黑线切割。在蓝色虚线上轻划,然后折叠。 + ![添加描图纸][16] -![裁剪灯笼][15] +6. 在折条处把灯笼的边粘在一起。 +7. 接通电池供电的 LED 蜡烛,并放置它到你灯笼中。 - 5. 为完成窗户的制作,剪切摹图纸到每个窗户的大小,然后粘贴它到灯笼的内侧。 + ![完成灯笼][17] -![添加摹图纸][16] - - 6. 在折条处把灯笼的粘在一起。 - - 7. 接通电池供电的 LED 蜡烛,并放置它到你灯笼中。 - - - - -![完成灯笼][17] - -现在你的灯笼已经完成并准备好照亮你的诡异的装饰品。万圣节快乐! - -如何使用 Inkscape,GIMP 制作万圣节瓶子标签和家用物品。 +现在你的灯笼已经完成了,准备好点亮你的鬼屋了。 -------------------------------------------------------------------------------- @@ -163,7 +130,7 @@ via: https://opensource.com/article/19/10/how-make-halloween-lantern-inkscape 作者:[Jess Weichler][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1b5d2b8327d8a4d52b0af612b038bfb4b785aa14 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 Apr 2020 15:57:50 +0800 Subject: [PATCH 0462/1809] PUB @robsean https://linux.cn/article-12152-1.html --- .../20191014 How to make a Halloween lantern with Inkscape.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191014 How to make a Halloween lantern with Inkscape.md (99%) diff --git a/translated/tech/20191014 How to make a Halloween lantern with Inkscape.md b/published/20191014 How to make a Halloween lantern with Inkscape.md similarity index 99% rename from translated/tech/20191014 How to make a Halloween lantern with Inkscape.md rename to published/20191014 How to make a Halloween lantern with Inkscape.md index 04307ec7bc..1cd31042d1 100644 --- a/translated/tech/20191014 How to make a Halloween lantern with Inkscape.md +++ b/published/20191014 How to make a Halloween lantern with Inkscape.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12152-1.html) [#]: subject: (How to make a Halloween lantern with Inkscape) [#]: via: (https://opensource.com/article/19/10/how-make-halloween-lantern-inkscape) [#]: author: (Jess Weichler https://opensource.com/users/cyanide-cupcake) From 153dc460dcfd8652dd04b55e32bbac1c87d4cac9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 Apr 2020 21:51:19 +0800 Subject: [PATCH 0463/1809] PRF @wxy --- .../tech/20190712 What is Silverblue.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translated/tech/20190712 What is Silverblue.md b/translated/tech/20190712 What is Silverblue.md index afc855d820..23a8d72753 100644 --- a/translated/tech/20190712 What is Silverblue.md +++ b/translated/tech/20190712 What is Silverblue.md @@ -1,54 +1,54 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What is Silverblue?) [#]: via: (https://fedoramagazine.org/what-is-silverblue/) [#]: author: (Tomáš Popela https://fedoramagazine.org/author/tpopela/) -何谓 Silverblue? +Silverblue 是什么? ====== ![][1] Fedora Silverblue 在 Fedora 世界内外越来越受欢迎。因此,根据社区的反馈,以下是关于这个项目的一些有趣问题的答案。如果你有任何其他与 Silverblue 相关的问题,请在评论区留言,我们会在未来的文章中回答。 -### 何谓 Silverblue? +### Silverblue 是什么? Silverblue 是新一代桌面操作系统的代号,之前被称为 Atomic Workstation。该操作系统是通过利用 [rpm-ostree 项目][2]创建的映像来交付的。这种系统的主要优点是速度、安全性、原子更新和不变性。 -### “Silverblue”到底是什么意思? +### “Silverblue” 到底是什么意思? “Team Silverblue” 或简称 “Silverblue”,没有任何隐藏的含义。该项目以前被称为 Atomic Workstation,大约两个月后更名时选中了这个名字。在这个过程中,审查过 150 多个单词或单词组合。最终选择了 “Silverblue”,因为它有一个可用的域名以及社交网络账号。人们可以把它看成是 Fedora 的蓝色品牌的一个新的品牌形象,可以用在诸如“加油,Silverblue 团队!”或“想加入该团队,改进 Silverblue 吗?”这样的短语中。 ### 何谓 ostree? -[OSTree 或 libostree 是一个项目][3],它结合了一个类似 Git 的提交和下载可引导文件系统树的模型,以及用于部署它们和管理引导加载程序配置的层。OSTree 被 rpm-ostree 所使用,这是 Silverblue 使用的一个基于包/镜像的混合系统。它原子化地复制了一个基础操作系统,并允许用户在需要时在基础操作系统之上 "分层 "传统的 RPM。 +[OSTree(或 libostree)是一个项目][3],它结合了一个类似 Git 的提交和下载可引导文件系统树的模型,以及用于部署它们和管理引导加载程序配置的层。OSTree 由 rpm-ostree 使用,这是 Silverblue 使用的一个基于包/镜像的混合系统。它原子化地复制了一个基础操作系统,并允许用户在需要时在基础操作系统之上“层叠”传统的 RPM。 ### 为何使用 Silverblue? 因为它可以让你专注于你的工作,而不是你正在运行的操作系统。因为系统的更新是原子式的,所以它更稳健。你唯一需要做的事情就是重新启动到新的镜像中。此外,如果当前启动的镜像有什么问题,你可以很容易地重启/回滚到之前可以工作的镜像,如果有的话。如果没有,你可以使用 `ostree` 命令下载并启动过去生成的任何其他镜像。 -另一个好处是可以在不同的分支(或者用旧的语境说就是 Fedora 版本)之间轻松切换。你可以轻松地尝试 [Rawhide][4] 或 [updates-testing][5] 分支,然后返回到包含当前稳定版本的分支。另外,如果你想尝试一些新奇的东西,也可以考虑试试 Silverblue。 +另一个好处是可以在不同的分支(或者用旧的语境说就是不同的 Fedora 风味版本)之间轻松切换。你可以轻松地尝试 [Rawhide][4] 或 [updates-testing][5] 分支,然后返回到包含当前稳定版本的分支。另外,如果你想尝试一些新奇的东西,也可以考虑试试 Silverblue。 ### 不可变的操作系统有什么好处? 其中一个主要的好处是安全。基础操作系统是以只读的形式挂载的,因此不能被恶意软件修改。唯一可以改变系统的方法是通过 `rpm-ostree` 实用程序。 -另一个好处是健壮性。普通用户几乎不可能在不小心或无意中删除了一些系统库后,让操作系统恢复到不启动或无法正常工作的状态。试着想想你过去的这些经历,就可以明白 Silverblue 如何帮助你。 +另一个好处是健壮性。普通用户几乎不可能在不小心或无意中删除了一些系统库后,导致操作系统回到不启动或无法正常工作的状态。试着想想你过去的这些经历,就可以明白 Silverblue 可以如何帮助你。 ### 如何在 Silverblue 中管理应用程序和包? -对于图形化用户界面的应用程序,建议使用 [Flatpak][6],如果应用程序是以 Flatpak 的形式提供的话。用户可以选择来自 Fedora 的 Flatpak,和从 Fedora 包及 Fedora 自己的基础架构中构建的 Flatpak,或者目前有更广泛的交付的 Flathub。用户可以通过已经支持 Fedora Silverblue 的 GNOME “软件”轻松安装它们。 +对于图形化用户界面的应用程序,建议使用 [Flatpak][6] —— 如果应用程序是以 Flatpak 的形式提供的话。用户可以选择来自 Fedora 的 Flatpak,和从 Fedora 包及 Fedora 自己的基础架构中构建的 Flatpak,或者是目前有更广泛的交付品的 Flathub。用户可以通过已经支持 Fedora Silverblue 的 GNOME “软件”轻松安装它们。 -用户首先发现的一件事就是操作系统中没有预装 `dnf`。主要原因是它不能在 Silverblue 上工作 —— 它的部分功能被 `rpm-ostree` 命令所取代。用户可以通过使用 `rpm-ostree install PACKAGE` 来层叠传统的软件包。但只有在没有其他方法的情况下,才应该使用这种方式。这是因为从存储库中提取新的系统镜像时,每次更改系统镜像时都必须重新构建系统镜像,以容纳分层的包或从基础操作系统中删除或替换为其他版本的包。 +用户首先发现的一件事就是操作系统中没有预装 `dnf`。主要原因是它不能在 Silverblue 上工作 —— 它的部分功能被 `rpm-ostree` 命令所取代。用户可以通过使用 `rpm-ostree install PACKAGE` 来层叠传统的软件包。但只有在没有其他方法的情况下,才应该使用这种方式。这是因为从存储库中提取新的系统镜像时,每次更改系统镜像时都必须重新构建系统镜像,以容纳层叠的包或从基础操作系统中删除及替换为其他版本的包。 -Fedora Silverblue 自带的默认 GUI 应用程序集是基础操作系统的一部分。团队正在努力将它们移植到 Flatpak 上,这样它们就可以通过这种方式分发。其中一个好处是,基础操作系统将变得更小,更容易维护和测试,用户可以更容易修改他们的默认安装环境。如果你想看一下它是怎么做的,或者有什么帮助,可以看看官方的 [文档][7]。 +Fedora Silverblue 自带的默认 GUI 应用程序集是基础操作系统的一部分。团队正在努力将它们移植到 Flatpak 上,这样它们就可以通过这种方式分发。其中一个好处是,基础操作系统将变得更小,更容易维护和测试,用户可以更容易修改他们的默认安装环境。如果你想看一下它是怎么做的,或者有什么帮助,可以看看官方的[文档][7]。 ### 什么是 Toolbox? -[Toolbox][8] 是一个让普通用户可以轻松使用容器的项目。它通过使用 podman 的无 root 容器来实现。Toolbox 可以让你在常规的 Fedora 安装中轻松、快速地创建一个容器,你可以在这个容器上折腾或开发,而与你的操作系统分离。 +[Toolbox][8] 是一个让普通用户可以轻松使用容器的项目。它通过使用 podman 的无 root 容器环境来实现。Toolbox 可以让你在常规的 Fedora 环境中轻松、快速地创建一个容器,你可以在这个容器上折腾或开发,而与你的操作系统分离。 ### Silverblue 有路线图吗? @@ -60,15 +60,15 @@ Fedora Silverblue 自带的默认 GUI 应用程序集是基础操作系统的一 ### 不可变操作系统的未来前景如何? -从我们的角度来看,桌面的未来涉及到了不可变的操作系统。这对用户来说是最安全的,Android、ChromeOS、ChromeOS、最近的 macOS Catalina 全都在底层采用了这种方式。而对于 Linux 桌面来说,一些第三方软件期望写到操作系统的问题还是存在的。HP 打印机驱动程序就是一个很好的例子。 +从我们的角度来看,桌面的未来会走向到不可变的操作系统。这对用户来说是最安全的,Android、ChromeOS、ChromeOS、最近的 macOS Catalina 全都在底层采用了这种方式。而对于 Linux 桌面来说,一些第三方软件期望写到操作系统的问题还是存在的。HP 打印机驱动程序就是一个很好的例子。 另一个问题是系统中的部分软件如何分发和安装。字体就是一个很好的例子。目前在 Fedora 中,它们是以 RPM 包的形式分发的。如果你想使用它们,你必须层叠它们,然后重新启动到新创建的包含它们的镜像中。 ### 标准版 Workstation 的前景如何? -Silverblue 有可能会取代普通的Workstation版本。但 Silverblue 要提供与Workstation版本相同的功能和用户体验,还有很长的路要走。在此期间,这两款桌面产品将同时推出。 +Silverblue 有可能会取代普通的 Workstation 版本。但 Silverblue 要提供与 Workstation 版本相同的功能和用户体验还有很长的路要走。在此期间,这两款桌面产品将同时推出。 -### Atomic Workstation或 Fedora CoreOS 与这些有什么关系? +### Atomic Workstation 或 Fedora CoreOS 与这些有什么关系? Atomic Workstation 是在更名为 Fedora Silverblue 之前的项目名称。 @@ -81,7 +81,7 @@ via: https://fedoramagazine.org/what-is-silverblue/ 作者:[Tomáš Popela][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 31249e073987fa7e7b490fbbd5d311b40dc0a82a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 Apr 2020 21:51:54 +0800 Subject: [PATCH 0464/1809] PUB @wxy https://linux.cn/article-12153-1.html --- {translated/tech => published}/20190712 What is Silverblue.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190712 What is Silverblue.md (99%) diff --git a/translated/tech/20190712 What is Silverblue.md b/published/20190712 What is Silverblue.md similarity index 99% rename from translated/tech/20190712 What is Silverblue.md rename to published/20190712 What is Silverblue.md index 23a8d72753..7437135b98 100644 --- a/translated/tech/20190712 What is Silverblue.md +++ b/published/20190712 What is Silverblue.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12153-1.html) [#]: subject: (What is Silverblue?) [#]: via: (https://fedoramagazine.org/what-is-silverblue/) [#]: author: (Tomáš Popela https://fedoramagazine.org/author/tpopela/) From 01fe66eb425378770252dd01ef695ab78f963f3c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 Apr 2020 22:17:46 +0800 Subject: [PATCH 0465/1809] APL --- ...ifference Between DNF and YUM, Why is Yum Replaced by DNF.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md b/sources/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md index 01d6522274..63e2443760 100644 --- a/sources/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md +++ b/sources/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 36d5a4074652b64a4dc35728a1814c99088c5ebb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 Apr 2020 23:02:41 +0800 Subject: [PATCH 0466/1809] TSL --- ...DNF and YUM, Why is Yum Replaced by DNF.md | 77 ------------------- ...DNF and YUM, Why is Yum Replaced by DNF.md | 66 ++++++++++++++++ 2 files changed, 66 insertions(+), 77 deletions(-) delete mode 100644 sources/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md create mode 100644 translated/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md diff --git a/sources/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md b/sources/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md deleted file mode 100644 index 63e2443760..0000000000 --- a/sources/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The Difference Between DNF and YUM, Why is Yum Replaced by DNF?) -[#]: via: (https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -The Difference Between DNF and YUM, Why is Yum Replaced by DNF? -====== - -**[Yum Package Manager][1]** has been replaced by **[DNF Package Manager][2]** since many long-standing issues in Yum remain unresolved. - -These problems include poor performance, excessive memory usage, slowdown for dependency resolution. - -DNF uses “libsolv” for dependency resolution, developed and maintained by SUSE to improve performance. - -It was written mostly in python, and it has its own way of coping with dependency resolution. - -Its API is not fully documented, and its extension system only allows Python plugins. - -Yum is a front-end tool for rpm that manages dependencies and repositories, and then uses RPM to install, download, and remove packages. - -Why would they want to build a new tool instead of fixing existing problems? - -Ales Kozamblak explained that the fixing was not technically feasible and that the yum team was not ready to accept the changes immediately. - -Also, the big challenge is that there are 56K lines for yum, but only 29K lines for DNF. - -So there is no way to fix it, except the fork. - -However yum was working fine. - -S.No | DNF (Dandified YUM) | YUM (Yellowdog Updater, Modified) ----|---|--- -1 | DNF uses libsolv for dependency resolution, developed and maintained by SUSE. | YUM uses the public API for dependency resolution -2 | API is fully documented | API is not fully documented -3 | It is written in C, C++, Python | It is written only in Python -4 | DNF is currently used in Fedora, Red Hat Enterprise Linux 8 (RHEL), CentOS 8, OEL 8 and Mageia 6/7. | YUM is currently used in Red Hat Enterprise Linux 6/7 (RHEL), CentOS 6/7, OEL 6/7. -5 | DNf supports various extensions | Yum supports only Python based extension -6 | The API is well documented so it's easy to create new features | It is very difficult to create new features because the API is not properly documented. -7 | The DNF uses less memory when synchronizing the metadata of the repositories. | The YUM uses excessive memory when synchronizing the metadata of the repositories. -8 | DNF uses a satisfiability algorithm to solve dependency resolution (It's using a dictionary approach to store and retrieve package and dependency information). | Yum dependency resolution gets sluggish due to public API. -9 | All performance is good in terms of memory usage and dependency resolution of repository metadata. | Over all performance is poor in terms of many factors. -10 | DNF Update: If a package contains irrelevant dependencies during a DNF update process, the package will not be updated. | YUM will update a package without verifying this. -11 | If the enabled repository does not respond, dnf will skip it and continue the transaction with the available repositories. | If a repository is not available, YUM will stop immediately. -12 | dnf update and dnf upgrade equals. | It's different in yum -13 | The dependencies on package installation are not updated | Yum offered an option for this behavior -14 | Clean Up Package Removal: When removing a package, dnf automatically removes any dependency packages not explicitly installed by the user. | Yum didn’t do this -15 | Repo Cache Update Schedule: By default, ten minutes after the system boots, updates to configured repositories are checked by dnf hourly. This action is controlled by the system timer unit named "/usr/lib/systemd/system/dnf-makecache.timer". | Yum do this too. -16 | Kernel packages are not protected by dnf. Unlike Yum, you can delete all kernel packages, including one that runs. | Yum will not allow you to remove the running kernel -17 | libsolv: for solving packages and reading repositories. - -hawkey: hawkey, library providing simplified C and Python API to libsolv. - -librepo: library providing C and Python (libcURL like) API for downloading linux repository metadata and packages. - -libcomps: Libcomps is alternative for yum.comps library. It’s written in pure C as library and there’s bindings for python2 and python3 | Yum does not use separate libraries to perform this function. -18 | DNF contains 29k lines of code | Yum contains 56k lines of code -19 | DNF was developed by Ales Kozumplik | YUM was developed by Zdenek Pavlas, Jan Silhan and team members - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/ - -作者:[Magesh Maruthamuthu][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.2daygeek.com/author/magesh/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[2]: https://www.2daygeek.com/linux-dnf-command-examples-manage-packages-fedora-centos-rhel-systems/ diff --git a/translated/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md b/translated/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md new file mode 100644 index 0000000000..f73a3e180b --- /dev/null +++ b/translated/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Difference Between DNF and YUM, Why is Yum Replaced by DNF?) +[#]: via: (https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +DNF 和 YUM 的区别,为什么 YUM 会被 DNF 取代? +====== + +由于 Yum 中许多长期存在的问题仍未得到解决,因此 [Yum 包管理器][1]已被 [DNF 包管理器][2]取代。这些问题包括性能差、内存占用过多、依赖解析速度变慢等。 + +DNF 使用 `libsolv` 进行依赖解析,由 SUSE 开发和维护,旨在提高性能。DNF 主要是用 Python 编写的,它有自己的应对依赖解析的方法。 + +Yum 是 RPM 的前端工具,它管理依赖关系和资源库,然后使用 RPM 来安装、下载和删除包。它的 API 没有完整的文档,它的扩展系统只允许 Python 插件。 + +为什么他们要建立一个新的工具,而不是修复现有的问题呢? + +Ales Kozamblak 解释说,这个修复在技术上是不可行的,而且 Yum 团队还没有准备好立即接受修改。 + +另外,最大的挑战是,Yum 有 56000 行代码,但 DNF 只有 29000 行代码。 + +所以除了分叉,没有办法解决。 + +不过 Yum 的运行情况还算可以。 + + +编号 | DNF(Dandified YUM) | YUM(Yellowdog Updater, Modified) +---|---|--- +1 | DNF 使用 libsolv 来解析依赖关系,由 SUSE 开发和维护 | YUM 使用公开的 API 来解析依赖关系 +2 | API 有完整的文档 | API 没有完整的文档 +3 | 由 C、C++、Python 编写的 | 只用 Python 编写 +4 | DNF 目前在 Fedora、RHEL 8、CentOS 8、OEL 8 和 Mageia 6/7 中使用 | YUM 目前在 RHEL 6/7、CentOS 6/7、OEL 6/7 中使用 +5 | DNf 支持各种扩展 | Yum 只支持基于 Python 的扩展 +6 | API 有良好的文档,因此很容易创建新的功能 | 因为 API 没有正确的文档化,所以创建新功能非常困难 +7 | DNF 在同步存储库的元数据时,使用的内存较少 | 在同步存储库的元数据时,YUM 使用了过多的内存 +8 | DNF 使用满足性算法来解决依赖关系解析(它是用字典的方法来存储和检索包和依赖信息)| 由于使用公开 API 的原因,Yum 依赖性解析变得迟钝 +9 | 从内存使用量和版本库元数据的依赖性解析来看,性能都不错 | 总的来说,在很多因素的影响下,表现不佳 +10 | DNF 更新:在 DNF 更新过程中,如果包中包含不相关的依赖,则不会更新 | YUM 将在没有验证的情况下更新软件包 +11 | 如果启用的存储库没有响应,DNF 将跳过它,并继续使用可用的存储库出来事务 | 如果有存储库不可用,YUM 会立即停止 +12 | `dnf update` 和 `dnf upgrade` 是等价的 | 在 Yum 中则不同 +13 | 安装包的依赖关系不更新 | Yum 为这种行为提供了一个选项 +14 | 清理删除的包:当删除一个包时,DNF 会自动删除任何没有被用户明确安装的依赖包 | Yum 不会这样做 +15 | 存储库缓存更新计划:默认情况下,系统启动后 10 分钟后,DNF 每小时检查一次对配置的存储库的更新。这个动作由系统定时器单元 `/usr/lib/systemd/system/system/dnf-makecache.timer` 控制 | Yum 也会这样做 +16 | 内核包不受 DNF 保护。不像 Yum,你可以删除所有的内核包,包括运行中的内核包 | Yum 不允许你删除运行中的内核 +17 | libsolv:用于解包和读取资源库。hawkey: 为 libsolv 提供简化的 C 和 Python API 库。librepo: 提供 C 和 Python(类似 libcURL)API 的库,用于下载 Linux 存储库元数据和软件包。libcomps: 是 yum.comps 库的替代品。它是用纯 C 语言编写的库,有 Python 2 和 Python 3 的绑定。| Yum 不使用单独的库来执行这些功能 +18 | DNF 包含 29000 行代码 | Yum 包含 56000 行代码 +19 | DNF 由 Ales Kozumplik 开发 | YUM 由 Zdenek Pavlas、Jan Silhan 和团队成员开发 + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[2]: https://www.2daygeek.com/linux-dnf-command-examples-manage-packages-fedora-centos-rhel-systems/ From f2e3bc1a1061982d7db387b910e2abf48c1a7176 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 27 Apr 2020 08:40:01 +0800 Subject: [PATCH 0467/1809] translated --- ...ings You Should Know About Ubuntu 20.04.md | 129 ------------------ ...ings You Should Know About Ubuntu 20.04.md | 129 ++++++++++++++++++ 2 files changed, 129 insertions(+), 129 deletions(-) delete mode 100644 sources/tech/20200422 Things You Should Know About Ubuntu 20.04.md create mode 100644 translated/tech/20200422 Things You Should Know About Ubuntu 20.04.md diff --git a/sources/tech/20200422 Things You Should Know About Ubuntu 20.04.md b/sources/tech/20200422 Things You Should Know About Ubuntu 20.04.md deleted file mode 100644 index 1c4a13810e..0000000000 --- a/sources/tech/20200422 Things You Should Know About Ubuntu 20.04.md +++ /dev/null @@ -1,129 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Things You Should Know About Ubuntu 20.04) -[#]: via: (https://itsfoss.com/ubuntu-20-04-faq/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Things You Should Know About Ubuntu 20.04 -====== - -[Ubuntu 20.04 release][1] is just around the corner and you may have a few questions and doubts regarding upgrades, installation etc. - -I hosted some Q&A sessions on various social media channels to answer doubts of readers like you. - -I am going to list these common questions about Ubuntu 20.04 with their answers. I hope it helps you clear the doubts you have. And if you still have questions, feel free to ask in the comment section below. - -### Ubuntu 20.04: Your Questions Answered - -![][2] - -Just to clarify, some of the answers here maybe influenced by my personal opinion. If you are an experienced Ubuntu user, some of the questions may sound _silly_ to you but it not to the new Ubuntu users. - -#### When will Ubuntu 20.04 be released? - -Ubuntu 20.04 LTS is releasing on 23rd April 2020. All the participating flavors like Kubuntu, Lubuntu, Xubuntu, Budgie, MATE etc will have their 20.04 release available on the same day. - -#### What are the system requirements for Ubuntu 20.04? - -For the default GNOME version, you should have a minimum 4 GB of RAM, 2 GHz dual core processor and at least 25 GB of disk space. - -Other [Ubuntu flavors][3] may have different system requirements. - -#### Can I use Ubuntu 20.04 on 32-bit systems? - -No, not at all. You cannot use Ubuntu 20.04 on 32-bit systems. Even if you are using 32-bit Ubuntu 18.04, you cannot upgrade to Ubuntu 20.04. There is ISO for 32-bit systems for past several years. - -![Error while upgrading 32-bit Ubuntu 18.04 to Ubuntu 20.04][4] - -#### Can I use Wine on Ubuntu 20.04? - -Yes, you can still use Wine on Ubuntu 20.04 as the 32-bit lib support is still there for packages needed by Wine and [Steam Play][5]. - -#### Do I have to pay for Ubuntu 20.04 or purchase a license? - -No, Ubuntu is completely free to use. You don’t have to buy a license key or activate Ubuntu like you do in Windows. - -The download section of Ubuntu requests you to donate some money but it’s up to you if you want to give some money for developing this awesome operating system. - -#### What GNOME version does it have? - -Ubuntu 20.04 has GNOME 3.36. - -#### Does Ubuntu 20.04 have better performance than Ubuntu 18.04? - -Yes, in several aspects. Ubuntu 20.04 installs faster and it even boost faster. I have shown the performance comparison in the video below at 4:40 minutes. - -The scroll, Windows animation and other UI elements are more fluid and give a smoother experience in GNOME 3.36. - -#### How long will Ubuntu 20.04 be supported? - -It is a long-term support (LTS) release and like any LTS release, it will be supported for five years. Which means that Ubuntu 20.04 will get security and maintenance updates until April 2025. - -#### Will I lose data while upgrading to Ubuntu 20.04? - -You can upgrade to Ubuntu 20.04 from Ubuntu 19.10 or Ubuntu 18.04. You don’t need to create a live USB and install from it. All you need is a good internet connection that can download around 1.5 GB of data. - -Upgrading from an existing system doesn’t harm your files. You should have all your files as it is and most of your existing software should be either have the same version or upgraded versions. - -If you have used some third-party tools or [additional PPA][6], the upgrade procedure will disable them. You can enable these additional repositories again if they are available for Ubuntu 20.04. - -Upgrading takes like an hour and after a restart, you will be logged in to the newer version. - -Though your data will not be touched and you won’t lose system files and configurations, it is always a good idea to make backup of important data externally. - -#### When will I get to upgrade to Ubuntu 20.04? - -![][7] - -If you are using Ubuntu 19.10 and have correct update settings in place (as mentioned in the earlier sections), you should be notified for upgrading to Ubuntu 20.04 within a few days of Ubuntu 18.04 release. - -For Ubuntu 18.04 users, it may take some weeks before they are officially notified of the availability of Ubuntu 18.04. Probably, you may get the prompt after the first point release of Ubuntu 20.04.1. - -#### If I upgrade to Ubuntu 20.04, can I downgrade to 19.10 or 18.04? - -No, you cannot. While upgrading to a newer version is easy, there is no option to downgrade.  If you want to go back to Ubuntu 18.04, you’ll have [install Ubuntu 18.04][8] again. - -#### I am using Ubuntu 18.04 LTS. Should I Upgrade to Ubuntu 20.04 LTS? - -That depends upon you. If you are impressed by the new features in Ubuntu 20.04 and want to get your hands on it, you should upgrade. - -If you want a more stable system, I advise waiting for the first point release Ubuntu 20.04.1 release that will have bug fixes in the new release. 20.04.1 should typically be coming approximately two months after the release of Ubuntu 20.04. - -In either case, I recommend upgrading to Ubuntu 20.04 sooner or later. Ubuntu 20.04 has newer kernel, performance improvement and above all newer versions of software available in the repository. - -Make a backup on external disk and with a good internet connectivity, the upgrade should not be an issue. - -#### Should I do a fresh install of Ubuntu 20.04 or upgrade to it from 18.04/19.10? - -If you have a choice, make a backup of your data and do a fresh install of Ubuntu 20.04. - -Upgrading to 20.04 from an existing version is a convenient option. However, in my opinion, it still keeps some traces/packages of the older version. A fresh install is always cleaner. - -#### Any other questions about Ubuntu 20.04? - -If you have any other doubts regarding Ubuntu 20.04, please feel free to leave a comment below. If you think some other information should be added to the list, please let me know. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-20-04-faq/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/ubuntu-20-04-release-features/ -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu_20_04_faq.jpg?ssl=1 -[3]: https://itsfoss.com/which-ubuntu-install/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-32-bit.jpg?ssl=1 -[5]: https://itsfoss.com/steam-play/ -[6]: https://itsfoss.com/ppa-guide/ -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04.jpg?ssl=1 -[8]: https://itsfoss.com/install-ubuntu/ diff --git a/translated/tech/20200422 Things You Should Know About Ubuntu 20.04.md b/translated/tech/20200422 Things You Should Know About Ubuntu 20.04.md new file mode 100644 index 0000000000..30a3049bfe --- /dev/null +++ b/translated/tech/20200422 Things You Should Know About Ubuntu 20.04.md @@ -0,0 +1,129 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Things You Should Know About Ubuntu 20.04) +[#]: via: (https://itsfoss.com/ubuntu-20-04-faq/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +关于 Ubuntu 20.04 你应该了解的事情 +====== + +[Ubuntu 20.04][1] 即将发布,你可能对升级、安装等有一些问题和疑问。 + +我在各种社交媒体渠道上主持了一些问答环节,回答像你这样的读者的疑虑。 + +我将列出这些关于Ubuntu 20.04的常见问题,并给出答案。我希望它能帮助你消除你的疑虑。如果你仍有问题,请随时在下面的评论栏提问。 + +### Ubuntu 20.04: 已回复的问题 + +![][2] + +为了澄清一下,这里的一些答案也许受我个人意见的影响。如果你是一个有经验的 Ubuntu 用户,有些问题听起来可能有点愚蠢,但它对 Ubuntu 新用户不是这样。 + +#### Ubuntu 20.04 何时发布? + +Ubuntu 20.04 LTS 于 2020 年 4 月 23 日发布。所有变种,如 Kubuntu、Lubuntu,、Xubuntu、Budgie、MATE 都将和 20.04 同一天发布。 + +#### Ubuntu 20.04 的系统要求是什么? + +对于默认的 GNOME 版本,应至少具有 4GB 的内存、2 GHz 双核处理器和至少 25GB 的磁盘空间。 + +其他 [Ubuntu 变种][3]可能有不同的系统要求。 + +#### 我可以在 32 位系统上使用 Ubuntu 20.04 吗? + +完全不行。你不能在 32 位系统上使用 Ubuntu 20.04。即使你使用的是 32 位 Ubuntu 18.04,也不能升级到 Ubuntu 20.04。过去几年有 32 位的系统 ISO。 + +![Error while upgrading 32-bit Ubuntu 18.04 to Ubuntu 20.04][4] + +#### 我可以在Ubuntu 20.04上使用 Wine 吗? + +是的,你仍然可以在 Ubuntu 20.04 上使用 Wine,因为仍然有 32 位库,来用于 Wine 和 [Steam Play][5] 所需的软件包。 + +#### 我需要购买 Ubuntu 20.04 或许可证? + +不,Ubuntu 是完全免费使用的。你不必像在 Windows 中那样购买许可证密钥或激活 Ubuntu。 + +Ubuntu 的下载页会请求你捐赠一些资金,如果你想捐赠一些钱来帮助开发这个系统,这完全取决于你。 + +#### GNOME 版本是什么? + +Ubuntu 20.04 有 GNOME 3.36。 + +#### Ubuntu 20.04 的性能是否优于 Ubuntu 18.04? + +是的,在几个方面。Ubuntu 20.04 安装速度更快,甚至加速更快。我在 4:40 的视频中展示了性能比较。 + +在 GNOME 3.36 中,滚动、窗口动画和其他 UI 元素更加流畅,并提供了更流畅的体验。 + +#### Ubuntu 20.04 将支持多长时间? + +它是一个长期支持 (LTS) 版本,与任何 LTS 版本一样,它将在五年内得到支持。这意味着 Ubuntu 20.04 将在 2025 年 4 月之前获得安全和维护更新。 + +#### 升级到 Ubuntu 20.04 时,是否会丢失数据? + +你可以从 Ubuntu 19.10 或 Ubuntu 18.04 升级到 Ubuntu 20.04。你无需创建 live USB 并从中安装。你所需要的是一个良好的互联网连接,来下载约1.5GB 的数据。 + +从现有系统升级不会破坏你的文件。你应该会有所有文件,并且大多数现有软件应具有相同的版本或升级后的版本。 + +如果你使用了某些第三方工具或[其他 PPA][6],升级过程将禁用它们。如果 Ubuntu 20.04 适合这些其他存储库,那么可以再次启用它们。 + +升级大约需要一个小时,重启后,你将登录到新版本。 + +虽然你的数据不会被触碰,并且不会丢失系统文件和配置,但最好在外部设备备份重要数据。 + +#### 何时可以升级到 Ubuntu 20.04? + +![][7] + +如果你正在使用 Ubuntu 19.10 并有正确的更新设置(如前面部分所述),那么应在 Ubuntu 18.04 后的几天内通知你升级到 Ubuntu 20.04。 + +对于 Ubuntu 18.04 用户,可能需要几周时间才能正式通知他们 Ubuntu 18.04 可用。可能,你可能会在第一个点版本 Ubuntu 20.04.1 后获得提示。 + +#### 如果我升级到 Ubuntu 20.04,我可以降级到 19.10 或 18.04 吗? + +不行。虽然升级到新版本很容易,但无法选择降级。 如果你想回到 Ubuntu 18.04,你将重新[安装 Ubuntu18.04][8]。 + +#### 我使用的是 Ubuntu 18.04 LTS。我应该升级到 Ubuntu 20.04 LTS 吗? + +这取决于你。如果你对 Ubuntu 20.04 中的新功能印象深刻,并希望上手尝试,那么你应该升级。 + +如果你想要一个更稳定的系统,我建议等待第一个点版本 Ubuntu 20.04.1,新版本将有 bug 修复。20.04.1 通常在 Ubuntu 20.04 发布后大约两个月到来。 + +其他情况下,我建议尽早升级到 Ubuntu 20.04。Ubuntu 20.04 具有更新的内核、性能改进,尤其是仓库中有更新版本的软件。 + +在外部磁盘上进行备份,并且有良好的互联网连接,升级不应成为问题。 + +#### 我应该重新安装 Ubuntu 20.04 还是从 18.04/19.10 升级到 Ubuntu? + +如果你可以选择,请备份数据,并重新安装 Ubuntu 20.04。 + +从现有版本升级到 20.04 是一个方便的选择。然而,在我看来,它仍然保留有一些旧版本的痕迹/包。全新安装更加干净。 + +#### 关于 Ubuntu 20.04 的任何其他问题? + +如果你对 Ubuntu 20.04 有任何疑问,请随时在下面发表评论。如果你认为应该将其他信息添加到列表中,请让我知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-20-04-faq/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-20-04-release-features/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu_20_04_faq.jpg?ssl=1 +[3]: https://itsfoss.com/which-ubuntu-install/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-32-bit.jpg?ssl=1 +[5]: https://itsfoss.com/steam-play/ +[6]: https://itsfoss.com/ppa-guide/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04.jpg?ssl=1 +[8]: https://itsfoss.com/install-ubuntu/ From 962ca7ffef7c40db69d377e7051450caa77a3eb4 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 27 Apr 2020 08:45:39 +0800 Subject: [PATCH 0468/1809] translating --- .../20200331 Rambox is an All-in-one Messenger for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200331 Rambox is an All-in-one Messenger for Linux.md b/sources/tech/20200331 Rambox is an All-in-one Messenger for Linux.md index f70829e98f..5e6a8a2d5c 100644 --- a/sources/tech/20200331 Rambox is an All-in-one Messenger for Linux.md +++ b/sources/tech/20200331 Rambox is an All-in-one Messenger for Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f82310f7a45c8ca987ebb5709c8860282697fd57 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 Apr 2020 09:35:54 +0800 Subject: [PATCH 0469/1809] PRF @qfzy1233 --- ...w- Slightly Different Lightweight Linux.md | 64 ++++++++----------- 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/translated/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md b/translated/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md index 95476933d3..579013dd09 100644 --- a/translated/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md +++ b/translated/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (qfzy1233) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Bodhi Linux 5.1 Review: Slightly Different Lightweight Linux) @@ -10,84 +10,76 @@ Bodhi Linux 5.1 一览: 略有不同的轻量化 Linux ====== -Bodhi Linux 是一个基于 Ubuntu 的[轻量级Linux发行版][1]。与其他大多数发行版不同,Bodhi 使用自己的 Moksha 桌面,并专注于为你提供在旧计算机上运行的最简设置。 +Bodhi Linux 是一个基于 Ubuntu 的[轻量级 Linux 发行版][1]。与其他大多数发行版不同,Bodhi 使用自己的 Moksha 桌面,并专注于为你提供一个可以在旧计算机上运行的最简设置。 ### 什么是 Bodhi Linux? -![Bodhi Start Page][2] +![](https://img.linux.net.cn/data/attachment/album/202004/27/093318yawppv07zqpva4j6.png) -[Bodhi Linux][3] 最早于2011年推出。它以“[简约、高效和用户自定义][4]”为设计理念。开发人员旨在提供一个“[功能正常但不臃肿的系统][5]”。因此,它使用轻量级的Moksha 桌面,只预装了基本的应用程序。这一做法是为了给用户一个稳定的平台来构建他们想要的系统。它基于最新版的 Ubuntu 长期支持版本。 +[Bodhi Linux][3] 最早于 2011 年推出。它以“[简约、高效和用户自定义][4]”为设计理念。开发人员旨在提供一个“[实用但不臃肿的系统][5]”。因此,它使用轻量级的 Moksha 桌面,只预装了基本的应用程序。这一做法是为了给用户一个稳定的平台来构建他们想要的系统。它基于最新版的 Ubuntu 长期支持版本。 ### Moksha 桌面 ![Bodhi Desktop][6] -起初菩提是随着[ Enlightenment 桌面环境][7]一起发布的。Bodhi Linux 一直被认为是“开明的”Linux发行版。事实上,“Bodhi”这个词是基于梵文的“开悟”。 +起初 Bodhi 是装载着 [Enlightenment 桌面环境][7]的。Bodhi Linux 一直被认为是“Enlightenment 系的” Linux 发行版。事实上,“Bodhi”(菩提)这个词是基于梵文的“开悟 enlightenment”。 -然而,当 Enlightenment 18版本发布以后,这一切都改变了。该版本是如此的糟糕,它并没有集成 Bodhi 。Enlightenment 19 被发布并修复了一些问题,但仍然存在一些问题。 +然而,当 Enlightenment 18 版本发布以后,这一切都改变了。该版本是如此的糟糕,以至于它并没有集成到 Bodhi 中。Enlightenment 19 发布后修复了一些问题,但仍然存在一些不足。 -在尝试与 Enlightenment 开发团队合作却毫无进展之后,Bodhi 开发者在2015年复刻了[8]Enlightenment 17。新的桌面环境被命名为[Moksha][9],它是基于梵文单词“解脱、解放或释放”。你可以在[GitHub][10]上找到它的代码。 +在尝试与 Enlightenment 开发团队合作却毫无进展之后,Bodhi 开发者在 2015 年[复刻][8]了 Enlightenment 17。新的桌面环境被命名为 [Moksha][9],它是基于梵文单词“解脱、解放或释放”。你可以在 [GitHub][10] 上找到它的代码。 -### 5.1.0有什么新特性? +### 5.1.0 有什么新特性? -[订阅我们的YouTube频道来观看更多的Linux视频][11] +- [Bodhi Linux 5.1 Trailer](https://youtu.be/e8wcRL9F3p8) -[Bodhi 5.1.0][12] 是两年内的第一个版本,也是基于 Ubuntu 18.04 的第二个版本。除了更新包,它还有新的默认图标和主题。该版本对默认应用程序做了几处更改。预装版 Leafpad 取代了 epad 并且 [GNOME Web][13] (也被称为Epiphany)代替了[Midori][14])。删除了eepDater系统更新器。 - -目前有[四个不同的版本][15]的菩提5.1.0提供[下载][16]: 标准版(Standard),硬件支持版(Hwe), 兼容版(Legacy), 和软件包版(AppPack). - - * 标准适用于过去十年内电脑配置。它不推送内核更新。 - * 硬件支持版Hwe (Hardware Enablement)是 Bodhi 新的家族设计包括支持更新的硬件和将收到内核更新。5.1版本的使用的是5.3.0-42内核。 - * 兼容版是唯一的32位版本。它使用“较旧的4.9.0-6-686 Linux内核,该内核针对旧的(15年以上)硬件进行了优化”。这个内核也不包括PAE扩展,这是许多老系统不支持的。” - * 软件包版是为那些想要一个开箱即用并预装了许多应用程序的全负载系统的人准备的。 +[Bodhi 5.1.0][12] 是这两年内发布的第一个版本,也是基于 Ubuntu 18.04 的第二个版本。除了更新包,它还有新的默认图标和主题。该版本对默认应用程序做了几处更改。预装版 Leafpad 取代了 epad 并且 [GNOME Web][13](也被称为 Epiphany)代替了 [Midori][14]。删除了 eepDater 系统更新器。 +目前有[四个不同的版本][15]的 Bodhi5.1.0 可以[下载][16]: 标准版Standard硬件支持版Hwe兼容版Legacy软件包版AppPack。 +* 标准适用于过去十年内电脑配置。它不推送内核更新。 +* 硬件支持版是 Bodhi 家族的新成员,其设计用来包括对更新的硬件的支持,并会接收到内核更新。5.1 版本的使用的是 5.3.0-42 内核。 +* 兼容版是仅有的 32 位版本。它使用“较旧的 4.9.0-6-686 Linux 内核,该内核针对旧的(15 年以上)硬件进行了优化。这个内核也不包括许多老系统不支持的 PAE 扩展。” +* 软件包版是为那些想要一个开箱即用的全载系统的人准备的,并预装了许多应用程序。 ### Bodhi Linux 的系统要求 -最低系统要求 +最低系统要求: * 500 MHz 处理器 * 256 MB 内存 * 5 GB 的硬盘存储空间 - - -推荐系统要求 +推荐系统要求: * 1.0 GHz 处理器 * 512 MB 内存 * 10 GB 的硬盘存储空间 - - -### Bodhi Linux 的体验 +### 体验 Bodhi Linux ![Old Bodhi Linux][17] -由于它是基于 Ubuntu 的,安装 Bodhi 非常简单。当我登录到 Bodhi 后,我对新的主题和图标设置感到惊讶。上次我安装 Bodhi (包括几个月前的5.0)时,我认为它需要一个新的外观。之前的主题并没有什么问题,但看起来像是2000年初的东西。新的主题使它看起来更具现代感。 +由于它是基于 Ubuntu 的,所以安装 Bodhi 非常简单。当我登录到 Bodhi 后,新的主题和图标集让我大吃一惊。上次我安装 Bodhi(包括几个月前的 5.0)时,我认为它需要换一个新的外观。之前的主题并没有什么问题,但看起来像是二十一世纪初的东西。新的主题使它看起来更具现代感。 ![Bodhi Linux 5.1][18] -我也很高兴看到 Midori 浏览器被 GNOME Web 所取代。我不是[Midori 浏览器][19]的粉丝。对我来说,它总是显得功能太少了。(不过,随着[Midori Next][20]的推出,这种情况可能会改变。)Web更像是我需要的Web浏览器。最重要的是它带有Firefox同步功能,这样我就可以同步我所有的书签和密码了。 +我也很高兴看到 Midori 浏览器被 GNOME Web 所取代。我不是 [Midori 浏览器][19]的粉丝。对我来说,它总是显得功能太少了。(不过,随着 [Midori Next][20] 的推出,这种情况可能会改变。)GNOME Web 更像是我需要的网页浏览器。最重要的是它带有 Firefox Sync,这样我就可以同步我所有的书签和密码了。 -与许多 Linux 发行版不同,Bodhi 并没有一个独立的软件中心。相反,如果你点击 AppCenter 图标,它会打开浏览器,并导航到 Bodhi 网站的软件中心页面[AppCenter page][21]。这里的应用程序是按类别排序的。它们中的大多数是[轻量级应用程序][22]。 +与许多 Linux 发行版不同,Bodhi 并没有一个独立的软件中心。相反,如果你点击 AppCenter 图标,它会打开浏览器,并导航到 Bodhi 网站的软件中心页面 [AppCenter 页面][21]。这里的应用程序是按类别排序的,它们中的大多数是[轻量级应用程序][22]。 ![Bodhi Linux Appcenter][23] -如果你点击其中一个页面并点击“安装”,Bodhi 会开始它的安装(在你输入密码之后)。这是通过一个名为[apturl][24]的小程序实现的,它是“源自web浏览器安装软件包的一种非常简单的方法”。它非常灵巧,我希望更多基于ubuntu的发行版使用它。 +如果你点击其中一个页面并点击“安装”,(在你输入密码之后)Bodhi 就会安装它。这是通过一个名为 [apturl][24] 的小程序实现的,它是“是一个非常简单的从网页浏览器安装软件包的方法”。它非常灵巧,我希望更多基于 Ubuntu 的发行版使用它。 -总的来说,我喜欢 Moksha 桌面。它坚持我们几十年来看到的桌面风格(这是我最喜欢的)。它不干涉你,却很容易改变和定制。我唯一怀念的是,当我点击超级键时,应用程序菜单不打开。但我猜你不可能拥有生活中的一切。 +总的来说,我喜欢 Moksha 桌面。它坚持我们几十年来看到的桌面风格(这是我最喜欢的)。它不会影响你,却很容易改变和定制。我唯一怀念的是,当我按下超级键时,应用程序菜单不打开。但我猜你不可能拥有生活中的一切。 ### 结语 -我对最近发布的 Bodhi Linux 感到十分惊喜。过去,我经常折腾它。并且我一直很喜欢它,但最近的这个版本是迄今为止最好的。在某种程度上,他们通过增加对新内核的支持,打破了Bodhi只适用于旧系统的想法。 +我对最近发布的 Bodhi Linux 感到十分惊喜。过去,我经常折腾它。并且我一直很喜欢它,但最近的这个版本是迄今为止最好的。在某种程度上,他们打破了 Bodhi 只适合老系统的想法,加入了对较新内核的支持。 -如果你想在拥有 Ubuntu 体验的同时改善一下视觉体验,那就试试[Bodhi Linux][3]吧。 +如果你想换换个环境,同时又想在 Ubuntu 的世界里寻找新的风景,那就试试[Bodhi Linux][3]吧。 -你用过 Bodhi Linux 吗?你最喜欢的基于ubuntu的发行版是什么?请在下面的评论中告诉我们。 - -如果你觉得这篇文章很有趣,请花点时间在社交媒体、Hacker News或其他网站上分享 [Reddit][25]. +你用过 Bodhi Linux 吗?你最喜欢的基于 Ubuntu 的发行版是什么?请在下面的评论中告诉我们。 -------------------------------------------------------------------------------- @@ -95,8 +87,8 @@ via: https://itsfoss.com/bodhi-linux-review/ 作者:[John Paul][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[qfzy1233](https://github.com/qfzy1233) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 46c8c472fb3d78fdcc8f717949ac3d6565163c4a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 Apr 2020 15:16:07 +0800 Subject: [PATCH 0470/1809] PUB @qfzy1223 https://linux.cn/article-12155-1.html --- ... Linux 5.1 Review- Slightly Different Lightweight Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md (99%) diff --git a/translated/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md b/published/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md similarity index 99% rename from translated/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md rename to published/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md index 579013dd09..f4380adb2a 100644 --- a/translated/tech/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md +++ b/published/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (qfzy1233) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12155-1.html) [#]: subject: (Bodhi Linux 5.1 Review: Slightly Different Lightweight Linux) [#]: via: (https://itsfoss.com/bodhi-linux-review/) [#]: author: (John Paul https://itsfoss.com/author/john/) From 3280ffb42dc8c051f7778e5f30c71ebd32e8b7f7 Mon Sep 17 00:00:00 2001 From: luzw3 Date: Mon, 27 Apr 2020 16:23:02 +0800 Subject: [PATCH 0471/1809] =?UTF-8?q?=E7=94=B3=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...00424 What you need to know about open source ad blockers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200424 What you need to know about open source ad blockers.md b/sources/tech/20200424 What you need to know about open source ad blockers.md index c3fb98def0..1be2a98950 100644 --- a/sources/tech/20200424 What you need to know about open source ad blockers.md +++ b/sources/tech/20200424 What you need to know about open source ad blockers.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (CrazyShipOne) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e199633a1ce24e9a1a18526c07a69bf979643a05 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 Apr 2020 18:22:08 +0800 Subject: [PATCH 0472/1809] PRF @lxbwolf --- ...orkspaces with Great Teeming Workspaces.md | 1153 ++--------------- 1 file changed, 88 insertions(+), 1065 deletions(-) diff --git a/translated/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md b/translated/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md index db5f0bf1ca..683f3dc313 100644 --- a/translated/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md +++ b/translated/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md @@ -1,1136 +1,159 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Manage complex Git workspaces with Great Teeming Workspaces) [#]: via: (https://opensource.com/article/20/2/git-great-teeming-workspaces) [#]: author: (Daniel Gryniewicz https://opensource.com/users/dang) -使用 Great Teeming Workspaces 管理复杂的 Git 工作空间 +使用 GTWS 管理复杂的 Git 工作空间 ====== -GTWS 是一系列脚本,这些脚本能让我们在开发环境中管理一个有不同项目和不同版本的工程时变得更简单。 -![Coding on a computer][1] -[GTWS][2] 是一个 Git 的复杂工作空间管理工具包,可以让我们在开发环境中管理一个有不同项目和不同版本的工程时变得更简单。 +> GTWS 是一系列脚本,它使我们在开发环境中管理不同的项目和项目的各个版本变得很容易。 -有点像 Python 的 [venv][3],但不是为 Python 语言准备的。GTWS 用来处理多项目的多个版本的工作空间。你可以很容易地创建、更新、进入和离开工作空间,每个项目或版本的组合(最多)有一个本地的 origin,用来与 upstream 同步 — 其余的所有工作空间都从本地的 origin 更新。 +![](https://img.linux.net.cn/data/attachment/album/202004/27/182149xh9s7kb5bkf5875b.jpg) + +[Great Teeming Workspaces][2](GTWS)是一个 Git 的复杂工作空间管理工具包,它使我们在开发环境中管理不同的项目和项目的各个版本变得很容易。 + +有点像 Python 的 [venv][3],但不是为 Python 语言准备的。GTWS 用来管理多个项目的多个版本的工作空间。你可以很容易地创建、更新、进入和离开工作空间,每个项目或版本的组合(最多)有一个本地的 origin,用来与 upstream 同步 — 其余的所有工作空间都从本地的 origin 更新。 ### 部署 ``` -${GTWS_ORIGIN}/<project>/<repo>[/<version>] -${GTWS_BASE_SRCDIR}/<project>/<version>/<workspacename>/{<repo>[,<repo>...]} +${GTWS_ORIGIN}//[/] +${GTWS_BASE_SRCDIR}////{[,...]} ``` -源目录的每一级(包括全局的 home 目录)可以包含一个 **.gtwsrc** 文件,这个文件中维护与当前级相关的设置和 bash 代码。每一级的配置会覆盖上一级。 +源代码目录的每一级(包括全局的家目录)可以包含一个 `.gtwsrc` 文件,这个文件中维护与当前级相关的设置和 bash 代码。每一级的配置会覆盖上一级。 ### 安装 用下面的命令检出 GTWS: ``` -`git clone https://github.com/dang/gtws.git` +git clone https://github.com/dang/gtws.git ``` -配置你的 **${HOME}/.gtwsrc**。它应该包含 **GTWS_ORIGIN**,也可以再包含 **GTWS_SETPROMPT**。 +配置你的 `${HOME}/.gtwsrc`。它应该包含 `GTWS_ORIGIN`,也可以再包含 `GTWS_SETPROMPT`。 把仓库目录加到环境变量中: ``` -`export PATH="${PATH}:/path/to/gtws` +export PATH="${PATH}:/path/to/gtws ``` ### 配置 -通过级联 **.gtwsrc** 文件来进行配置。它从根目录向下遍历,会执行在每级目录中找到的 **.gtwsrc** 文件。下级目录的文件会覆盖上一级。 +通过级联 `.gtwsrc` 文件来进行配置。它从根目录向下遍历,会执行在每级目录中找到的 `.gtwsrc` 文件。下级目录的文件会覆盖上一级。 -在你最上层的文件 **~/.gtws/.gtwsrc** 中进行如下设置: +在你最上层的文件 `~/.gtws/.gtwsrc` 中进行如下设置: - * **GTWS_BASE_SRCDIR:** 所有项目源文件目录树的 base。默认为 **$HOME/src**。 - * **GTWS_ORIGIN:** 指定 origin git 目录树的路径。默认为 **$HOME/origin**。 - * **GTWS_SETPROMPT:** 可选配置。如果配置了这个参数,shell 提示符会有工作空间的名字。 - * **GTWS_DEFAULT_PROJECT:** 不指定项目或项目未知时默认的项目名。如果不指定,使用命令行时必须指明项目。 - * **GTWS_DEFAULT_PROJECT_VERSION:** 检出的默认版本。默认为 **master**。 + * `GTWS_BASE_SRCDIR`:所有项目源文件目录树的基目录。默认为 `$HOME/src`。 + * `GTWS_ORIGIN`: 指定 origin git 目录树的路径。默认为 `$HOME/origin`。 + * `GTWS_SETPROMPT`: 可选配置。如果配置了这个参数,shell 提示符会有工作空间的名字。 + * `GTWS_DEFAULT_PROJECT`: 不指定项目或项目未知时默认的项目名。如果不指定,使用命令行时必须指明项目。 + * `GTWS_DEFAULT_PROJECT_VERSION`: 检出的默认版本。默认为 `master`。 在每个项目的根目录进行以下设置: - * **GTWS_PROJECT:** 项目的名字(和 base 目录)。 - * **gtws_project_clone:** 这个函数用于克隆一个项目的指定版本。如果未定义,它会假定项目的 origin 对每一个版本都有一个单独的目录,这样会导致克隆一堆 Git 仓库。 - * **gtws_project_setup:** 在克隆完所有的仓库后,可以选择是否调用这个函数,调用后可以对项目进行必要的配置,如在 IDE 中配置工作空间。 + * `GTWS_PROJECT`: 项目的名字(和基目录)。 + * `gtws_project_clone`: 这个函数用于克隆一个项目的指定版本。如果未定义,它会假定项目的 origin 对每一个版本都有一个单独的目录,这样会导致克隆一堆 Git 仓库。 + * `gtws_project_setup`: 在克隆完所有的仓库后,可以选择是否调用这个函数,调用后可以对项目进行必要的配置,如在 IDE 中配置工作空间。 在项目版本级进行以下设置: - * **GTWS_PROJECT_VERSION:** 项目的版本。用于正确地从 origin 拉取代码。类似 Git 中的分支名字。 + * `GTWS_PROJECT_VERSION:` 项目的版本。用于正确地从 origin 拉取代码。类似 Git 中的分支名字。 下面这些参数可以在目录树的任意地方进行配置,如果能生效,它们可以被重写多次: - * **GTWS_PATH_EXTRA:** 这些是工作空间中加到路径后的额外的路径元素。 - * **GTWS_FILES_EXTRA:** 这些是不在版本控制内,但应该在工作空间中被检出的额外的文件。这些文件包括 **.git/info/exclude**,每个文件都与仓库的 base 相关联。 + * `GTWS_PATH_EXTRA`: 这些是工作空间中加到路径后的额外的路径元素。 + * `GTWS_FILES_EXTRA`: 这些是不在版本控制内,但应该在工作空间中被检出的额外的文件。这些文件包括 `.git/info/exclude`,每个文件都与仓库的基目录相关联。 ### origin 目录 -**GTWS_ORIGIN** (大部分脚本中)指向拉取和推送的原始 Git 检出目录。 +`GTWS_ORIGIN` (大部分脚本中)指向拉取和推送的原始 Git 检出目录。 -**${GTWS_ORIGIN}** 部署: +`${GTWS_ORIGIN}` 部署: - * **/<project>** - * 这是一个项目的仓库 base。 - * 如果指定了 **gtws_project_clone**,你可以配置任意的部署路径。 - * 如果没有指定 **gtws_project_clone**,这个路径下必须有个名为 **git** 的子目录,且 **git** 目录下有一系列用来克隆的裸 Git 仓库。 + * `/` + * 这是一个项目的仓库的基目录。 + * 如果指定了 `gtws_project_clone`,你可以配置任意的部署路径。 + * 如果没有指定 `gtws_project_clone`,这个路径下必须有个名为 `git` 的子目录,且 `git` 目录下有一系列用来克隆的裸 Git 仓库。 ### 工作流示例 -假设你有一个项目名为 **Foo**,它的 upstream 为 **github.com/foo/foo.git**。这个仓库有个名为 **bar** 的子模块,它的 upstream 是 **github.com/bar/bar.git**。Foo 项目在 master 分支开发,使用稳定版本的分支。 +假设你有一个项目名为 `Foo`,它的 upstream 为 `github.com/foo/foo.git`。这个仓库有个名为 `bar` 的子模块,它的 upstream 是 `github.com/bar/bar.git`。Foo 项目在 master 分支开发,使用稳定版本的分支。 为了能在 Foo 中使用 GTWS,你首先要配置目录结构。本例中假设你使用默认的目录结构。 - * 配置你最上层的 **.gtwsrc**: - * **cp ${GTWS_LOC}/examples/gtwsrc.top ~/.gtwsrc** - * 根据需要修改 **~/.gtwsrc**。 + * 配置你最上层的 `.gtwsrc`: + * `cp ${GTWS_LOC}/examples/gtwsrc.top ~/.gtwsrc` + * 根据需要修改 `~/.gtwsrc`。 * 创建顶级目录: - * **mkdir -p ~/origin ~/src** + * `mkdir -p ~/origin ~/src` * 创建并配置项目目录: - * **mkdir -p ~/src/foo** -**cp ${GTWS_LOC}/examples/gtwsrc.project ~/src/foo/.gtwsrc** - * 根据需要修改 **~/src/foo/.gtwsrc**。 + * `mkdir -p ~/src/foo` + + `cp ${GTWS_LOC}/examples/gtwsrc.project ~/src/foo/.gtwsrc` + * 根据需要修改 `~/src/foo/.gtwsrc`。 * 创建并配置 master 版本目录: - * **mkdir -p ~/src/foo/master** -**cp ${GTWS_LOC}/examples/gtwsrc.version ~/src/foo/master/.gtwsrc** - * 根据需要修改 **~/src/foo/master/.gtwsrc**。 + * `mkdir -p ~/src/foo/master` + + `cp ${GTWS_LOC}/examples/gtwsrc.version ~/src/foo/master/.gtwsrc` + * 根据需要修改 `~/src/foo/master/.gtwsrc`。 * 进入版本目录并创建一个临时工作空间来配置镜像: - * **mkdir -p ~/src/foo/master/tmp** -**cd ~/src/foo/master/tmp -git clone --recurse-submodules git://github.com/foo/foo.git -cd foo -gtws-mirror -o ~/origin -p foo**(译注:这个地方原文有误,不加 `-s` 参数会报错) - * 上面命令会创建 **~/origin/foo/git/foo.git** 和 **~/origin/foo/submodule/bar.git**。 + * `mkdir -p ~/src/foo/master/tmp` + + `cd ~/src/foo/master/tmp` + + `git clone --recurse-submodules git://github.com/foo/foo.git` + + `cd foo` + + `gtws-mirror -o ~/origin -p foo`(译注:这个地方原文有误,不加 `-s` 参数会报错) + * 上面命令会创建 `~/origin/foo/git/foo.git` 和 `~/origin/foo/submodule/bar.git`。 * 以后的克隆操作会从这些 origin 而不是 upstream 克隆。 * 现在可以删除工作空间了。 -到现在为止,Foo 的 master 分支的工作可以结束了。假设你现在想修复一个 bug,名为 **bug1234**。你可以脱离你当前的工作空间为修复这个 bug 单独创建一个工作空间,之后在新创建的工作空间中开发。 +到现在为止,Foo 的 master 分支的工作可以结束了。假设你现在想修复一个 bug,名为 `bug1234`。你可以脱离你当前的工作空间为修复这个 bug 单独创建一个工作空间,之后在新创建的工作空间中开发。 * 进入版本目录,创建一个新的工作空间: - * **cd ~/src/foo/master -mkws bug1234** - * 上面的命令创建了 **bug1234/**,在这个目录下检出了 Foo(和它的子模块 **bar**),并创建了 **build/foo** 来构建它。 + * `cd ~/src/foo/master` + + `mkws bug1234` + * 上面的命令创建了 `bug1234/`,在这个目录下检出了 Foo(和它的子模块 `bar`),并创建了 `build/foo` 来构建它。 * 有两种方式进入工作空间: - * **cd ~/src/foo/master/bug1234 -startws** -或者 -**cd ~/src/foo/master/** -**startws bug1234** - * 上面的命令在 bug1234 工作空间中开启了一个子 shell。这个 shell 有 GTWS 的环境和你在各级 **.gtwsrc** 文件中设置的环境。它也把你工作空间的 base 路径加入到了 CD,因此你可以从 base 路径 **cd** 到相关的目录中。 - * 现在你可以修复 bug1234了,构建、测试、提交你的修改。当你可以把代码推送到 upstream 时,执行下面的命令: -**cd foo -wspush**  - * **wspush** 会把代码推送到与你工作空间相关的分支 — 先推送到本地的 origin,再推送到 upstream。 + * `cd ~/src/foo/master/bug1234` + + `startws` + + 或者 + + `cd ~/src/foo/master/` + + `startws bug1234` + * 上面的命令在 `bug1234` 工作空间中开启了一个子 shell。这个 shell 有 GTWS 的环境和你在各级 `.gtwsrc` 文件中设置的环境。它也把你工作空间的基目录加入到了 CD,因此你可以从 base 路径 `cd` 到相关的目录中。 + * 现在你可以修复 `bug1234` 了,构建、测试、提交你的修改。当你可以把代码推送到 upstream 时,执行下面的命令: + + `cd foo` + + `wspush`  + * `wspush` 会把代码推送到与你工作空间相关的分支 — 先推送到本地的 origin,再推送到 upstream。 * 当 upstream 有修改时,你可以用下面的命令同步到本地: -**git sync** - * 上面的命令调用了 GTWS 的 **git-sync** 脚本,会从本地 origin 更新代码。使用下面的命令来更新本地的 origin: -**git sync -o**  - * 上面的命令会更新你本地的 origin 和子模块的镜像,然后用那些命令来更新你的检出仓库的代码。**git-sync** 也有一些其他的很好的工鞥。 + + `git sync` + * 上面的命令调用了 GTWS 的 `git-sync` 脚本,会从本地 origin 更新代码。使用下面的命令来更新本地的 origin: + + `git sync -o`  + * 上面的命令会更新你本地的 origin 和子模块的镜像,然后用那些命令来更新你的检出仓库的代码。`git-sync` 也有一些其他的很好的工鞥。 * 当要结束工作空间中的工作时,直接退出 shell: -**exit** + + `exit` * 你可以在任何时间重复进入工作空间,也可以在同一时间在相同的工作空间中开多个 shell。 - * 当你不需要某个工作空间时,你可以使用 **rmws** 来删除它,或者直接删除它的目录树。 - * 还有一个脚本 **tmws** 使用 tmux 进入工作空间,能创建一系列的窗口/窗格,这完美契合我的工作流。你可以根据你自己的需求来修改它。 + * 当你不需要某个工作空间时,你可以使用 `rmws` 来删除它,或者直接删除它的目录树。 + * 还有一个脚本 `tmws` 使用 tmux 进入工作空间,能创建一系列的窗口/窗格,这完美契合我的工作流。你可以根据你自己的需求来修改它。 -### 脚本内容 - -``` -#!/bin/bash -# Functions for gtws -# - -GTWS_LOC=$(readlink -f $(dirname "${BASH_SOURCE[0]}")) -export GTWS_LOC - -# if is_interactive; then echo "interactive" fi -# -# Check for an interactive shell -is_interactive() { -        case $- in -                *i*) -                        # Don't die in interactive shells -                        return 0 -                        ;; -                *) -                        return 1 -                        ;; -        esac -} - -# if can_die; then exit -# -# Check to see if it's legal to exit during die -can_die() { -        if (( BASH_SUBSHELL > 0 )); then -                debug_print "\t\tbaby shell; exiting" -                return 0 -        fi -        if ! is_interactive; then -                debug_print "\t\tNot interactive; exiting" -                return 0 -        fi -        debug_print "\t\tParent interactive; not exiting" -        return 1 -} - -# In a function: -# command || die "message" || return 1 -# Outside a function: -# command || die "message" -# -# Print a message and exit with failure -die() { -        echo -e "Failed: $1" >&2 -        if [ ! -z "$(declare -F | grep "GTWScleanup")" ]; then -                GTWScleanup -        fi -        if can_die; then -                exit 1 -        fi -        return 1 -} - -# Alternativess for using die properly to handle both interactive and script useage: -# -# Version 1: -# -#testfunc() { -#       command1 || die "${FUNCNAME}: command1 failed" || return 1 -#       command2 || die "${FUNCNAME}: command2 failed" || return 1 -#       command3 || die "${FUNCNAME}: command3 failed" || return 1 -#} -# -# Version 2: -# -#testfunc() { -#       ( -#               command1 || die "${FUNCNAME}: command1 failed" -#               command2 || die "${FUNCNAME}: command2 failed" -#               command3 || die "${FUNCNAME}: command3 failed" -#       ) -#       return $? -#} -# -# Optionally, the return can be replaced with this: -#       local val=$? -#       [[ "${val}" == "0" ]] || die -#       return ${val} -# This will cause the contaning script to abort - -# usage "You need to provide a frobnicator" -# -# Print a message and the usage for the current script and exit with failure. -usage() { -        local myusage; -        if [ -n "${USAGE}" ]; then -                myusage=${USAGE} -        else -                myusage="No usage given" -        fi -        local me; -        if [ -n "${ME}" ]; then -                me=${ME} -        else -                me=$(basename $0) -        fi -        if [ -n "$1" ]; then -                echo "$@" -        fi -        echo "" -        if [ -n "${DESCRIPTION}" ]; then -                echo -e "${me}: ${DESCRIPTION}" -                echo "" -        fi -        echo "Usage:" -        echo "${me} ${myusage}" -        if [ -n "${LONGUSAGE}" ]; then -                echo -e "${LONGUSAGE}" -        fi -        exit 1 -} - -# debug_print "Print debug information" -# -# Print debug information based on GTWS_VERBOSE -debug_print() { -        if [ -n "${GTWS_VERBOSE}" ]; then -                echo -e "${GTWS_INDENT}$@" >&2 -        fi -} - -# debug_trace_start -# -# Start tracing all commands -debug_trace_start() { -        if [ -n "${GTWS_VERBOSE}" ]; then -                set -x -        fi -} - -# debug_trace_stop -# -# Stop tracing all commands -debug_trace_stop() { -        set +x -} - -# cmd_exists ${cmd} -# -# Determine if a command exists on the system -function cmd_exists { -        which $1 > /dev/null 2>&1 -        if [ "$?" == "1" ]; then -                die "You don't have $1 installed, sorry" || return 1 -        fi -} - -# is_git_repo ${dir} -# -# return success if ${dir} is in a git repo, or failure otherwise -is_git_repo() { -        debug_print "is_git_repo $1" -        if [[ $1 == *:* ]]; then -                debug_print "    remote; assume good" -                return 0 -        elif [ ! -d "$1" ]; then -                debug_print "    fail: not dir" -                return 1 -        fi -        cd "$1" -        git rev-parse --git-dir >/dev/null 2>&1 -        local ret=$? -        cd - > /dev/null -        debug_print "    retval: $ret" -        return $ret -} - -# find_git_repo ${basedir} ${repo_name} repo_dir -# -# Find the git repo for ${repo_name} in ${basedir}.  It's one of ${repo_name} -# or ${repo_name}.git -# -# Result will be in the local variable repo_dir  Or: -# -# repo_dir=$(find_git_repo ${basedir} ${repo_name}) -# -function find_git_repo { -        local basedir=$1 -        local repo_name=$2 -        local __resultvar=$3 -        local try="${basedir}/${repo_name}" - -        if ! is_git_repo "${try}" ; then -                try=${try}.git -        fi - -        is_git_repo "${try}" || die "${repo_name} in ${basedir} is not a git repository" || return 1 - -        if [[ "$__resultvar" ]]; then -                eval $__resultvar="'$try'" -        else -                echo "$try" -        fi -} - -# git_top_dir top -# -# Get the top level of the git repo contaning PWD, or return failure; -# -# Result will be in local variable top  Or: -# -# top = $(git_top_dir) -# -# Result will be in local variable top -function git_top_dir { -        local  __resultvar=$1 -        local __top="$(git rev-parse --show-toplevel 2>/dev/null)" - -        if [ -z "${__top}" ]; then -                die "${PWD} is not a git repo" || return 1 -        fi -        if [[ "$__resultvar" ]]; then -                eval $__resultvar="'$__top'" -        else -                echo "$__top" -        fi -} - -# is_git_rebase -# -# return success if git repo is in a rebase -is_git_rebase() { -        debug_print "is_git_rebase $1" -        (test -d "$(git rev-parse --git-path rebase-merge)" || \ -                test -d "$(git rev-parse --git-path rebase-apply)" ) -        local ret=$? -        debug_print "    retval: $ret" -        return $ret -} - -# is_docker -# -# return success if process is running inside docker -is_docker() { -        debug_print "is_docker" -        grep -q docker /proc/self/cgroup -        return $? -} - -# is_gtws -# -# return success if process is running inside a workspace -is_gtws() { -        if [ -n "${GTWS_WS_GUARD}" ]; then -                return 0 -        fi -        return 1 -} - -function gtws_rcp { -        rsync --rsh=ssh -avzS --progress --ignore-missing-args --quiet "$@" -} - -function gtws_cpdot { -        local srcdir=$1 -        local dstdir=$2 - -        debug_print "${FUNCNAME} - ${srcdir} to ${dstdir}" -        if [ -d "${srcdir}" ] && [ -d "${dstdir}" ]; then -                shopt -s dotglob -                cp -a "${srcdir}"/* "${dstdir}"/ -                shopt -u dotglob -        fi -} - -# gtws_find_dockerfile dockerfile -# -# Result will be in local variable dockerfile  Or: -# -# dockerfile = $(gtws_find_dockerfile) -# -# Result will be in local variable dockerfile -# -# Get the path to the most-specific Dockerfile -function gtws_find_dockerfile { -        local  __resultvar=$1 -        local __dir="${GTWS_WSPATH}" -        local __file="Dockerfile" - -        debug_print "${FUNCNAME} - trying ${__dir}/${__file}" -        if [ ! -f "${__dir}/${__file}" ]; then -                # Version dir -                __dir=$(dirname "${__dir}") -                debug_print "${FUNCNAME} - trying ${__dir}/${__file}" -        fi -        if [ ! -f "${__dir}/${__file}" ]; then -                # Project dir -                __dir=$(dirname "${__dir}") -                debug_print "${FUNCNAME} - trying ${__dir}/${__file}" -        fi -        if [ ! -f "${__dir}/${__file}" ]; then -                # Top level, flavor -                __dir="${GTWS_LOC}/dockerfiles" -                __file="Dockerfile-${FLAVOR}" -                debug_print "${FUNCNAME} - trying ${__dir}/${__file}" -        fi -        if [ ! -f "${__dir}/${__file}" ]; then -                # Top level, base -                __dir="${GTWS_LOC}/dockerfiles" -                __file="Dockerfile-base" -                debug_print "${FUNCNAME} - trying ${__dir}/${__file}" -        fi -        if [ ! -f "${__dir}/${__file}" ]; then -                die "Could not find a Dockerfile" || return 1 -        fi - -        debug_print "${FUNCNAME} - found ${__dir}/${__file}" -        if [[ "$__resultvar" ]]; then -                eval $__resultvar="'${__dir}/${__file}'" -        else -                echo "$__dir" -        fi -} - -# gtws_smopvn ${GTWS_SUBMODULE_ORIGIN:-${GTWS_ORIGIN}} ${GTWS_PROJECT} ${GTWS_PROJECT_VERSION} ${GTWS_WSNAME} smopvn -# -# Result will be in local variable smopvn.  Or: -# -# smopvn = $(gtws_smopvn ${GTWS_SUBMODULE_ORIGIN:-${GTWS_ORIGIN}} ${GTWS_PROJECT} ${GTWS_PROJECT_VERSION} ${GTWS_WSNAME}) -# -# Result will be in local variable smovpn -# -# Get the path to submodules for this workspace -function gtws_smopvn { -        local origin=$1 -        local project=$2 -        local version=$3 -        local name=$4 -        local  __resultvar=$5 -        local __smopv="${origin}/${project}/submodule" - -        if [[ "$__resultvar" ]]; then -                eval $__resultvar="'$__smopv'" -        else -                echo "$__smopv" -        fi -} - -# gtws_opvn ${GTWS_ORIGIN} ${GTWS_PROJECT} ${GTWS_PROJECT_VERSION} ${GTWS_WSNAME} opvn -# -# Result will be in local variable opvn.  Or: -# -# opvn = $(gtws_opvn ${GTWS_ORIGIN} ${GTWS_PROJECT} ${GTWS_PROJECT_VERSION} ${GTWS_WSNAME}) -# -# Result will be in local variable opvn. -# -# Get the path to git repos for this workspace -function gtws_opvn { -        local origin=$1 -        local project=$2 -        local version=$3 -        local name=$4 -        local  __resultvar=$5 -        local __opv="${origin}/${project}/${version}" - -        if [[ $__opv == *:* ]]; then -                __opv="${__opv}/${name}" -                debug_print "remote; using opvn $__opv" -        elif [ ! -d "${__opv}" ]; then -                __opv="${origin}/${project}/git" -                if [ ! -d "${__opv}" ]; then -                        die "No opvn for ${origin} ${project} ${version}" || return 1 -                fi -        fi -        if [[ "$__resultvar" ]]; then -                eval $__resultvar="'$__opv'" -        else -                echo "$__opv" -        fi -} - -# gtws_submodule_url ${submodule} url -# -# Result will be in local variable url  Or: -# -# url = $(gtws_submodule_url ${submodule}) -# -# Result will be in local variable url -# -# Get the URL for a submodule -function gtws_submodule_url { -        local sub=$1 -        local  __resultvar=$2 -        local __url=$(git config --list | grep "submodule.*url" | grep "\<${sub}\>" | cut -d = -f 2) - -        if [ -z "${__url}" ]; then -                local rpath=${PWD} -                local subsub=$(basename "${sub}") -                cd "$(dirname "${sub}")" -                debug_print "${FUNCNAME} trying ${PWD}" -                __url=$(git config --list | grep submodule | grep "\<${subsub}\>" | cut -d = -f 2) -                cd "${rpath}" -        fi - -        debug_print "${FUNCNAME} $sub url: $__url" -        if [[ "$__resultvar" ]]; then -                eval $__resultvar="'$__url'" -        else -                echo "$__url" -        fi -} - -# gtws_submodule_mirror ${smopv} ${submodule} ${sub_sub_basename} mloc -# -# Result will be in local variable mloc  Or: -# -# mloc = $(gtws_submodule_mirror ${smopv} ${submodule} ${sub_sub_basename}) -# -# Result will be in local variable mloc -# -# Get the path to a local mirror of the submodule, if it exists -function gtws_submodule_mirror { -        local smopv=$1 -        local sub=$2 -        local sub_sub=$3 -        local  __resultvar=$4 -        local __mloc="" -        local url=$(gtws_submodule_url ${sub}) -        if [ -n "${url}" ]; then -                local urlbase=$(basename ${url}) -                # XXX TODO - handle remote repositories -                #if [[ ${smopv} == *:* ]]; then -                ## Remote SMOPV means clone from that checkout; I don't cm -                #refopt="--reference ${smopv}/${name}/${sub}" -                if [ -d "${smopv}/${urlbase}" ]; then -                        __mloc="${smopv}/${urlbase}" -                fi -        fi - -        if [[ "$__resultvar" ]]; then -                eval $__resultvar="'$__mloc'" -        else -                echo "$__mloc" -        fi -} - -# gtws_submodule_paths subpaths -# -# Result will be in local variable subpaths  Or: -# -# subpaths = $(gtws_submodule_paths) -# -# Result will be in local variable subpaths -# -# Get the paths to submodules in a get repo.  Does not recurse -function gtws_submodule_paths { -        local  __resultvar=$1 -        local __subpaths=$(git submodule status | sed 's/^ *//' | cut -d ' ' -f 2) - -        if [[ "$__resultvar" ]]; then -                eval $__resultvar="'$__subpaths'" -        else -                echo "$__subpaths" -        fi -} - -# gtws_submodule_clone [<base-submodule-path>] [<sub-sub-basename>] -# -# This will set up all the submodules in a repo.  Should be called from inside -# the parent repo -function gtws_submodule_clone { -        local smopv=$1 -        local sub_sub=$2 -        local sub_paths=$(gtws_submodule_paths) -        local rpath="${PWD}" - -        if [ -z "${smopv}" ]; then -                smopv=$(gtws_smopvn "${GTWS_SUBMODULE_ORIGIN:-${GTWS_ORIGIN}}" "${GTWS_PROJECT}" "${GTWS_PROJECT_VERSION}" "${GTWS_WSNAME}") -        fi -        git submodule init || die "${FUNCNAME}: Failed to init submodules" || return 1 -        for sub in ${sub_paths}; do -                local refopt="" -                local mirror=$(gtws_submodule_mirror "${smopv}" "${sub}" "${sub_sub}") -                debug_print "${FUNCNAME} mirror: ${mirror}" -                if [ -n "${mirror}" ]; then -                        refopt="--reference ${mirror}" -                fi -                git submodule update ${refopt} "${sub}" -                # Now see if there are recursive submodules -                cd "${sub}" -                gtws_submodule_clone "${smopv}/${sub}_submodule" "${sub}" || return 1 -                cd "${rpath}" -        done -} - -# gtws_repo_clone <base-repo-path> <repo> <branch> [<base-submodule-path>] [<target-directory>] -function gtws_repo_clone { -        local baserpath=${1%/} -        local repo=$2 -        local branch=$3 -        local basesmpath=$4 -        local rname=${5:-${repo%.git}} -        local rpath="${baserpath}/${repo}" -        local origpath=${PWD} - -        if [[ ${rpath} != *:* ]]; then -                if [ ! -d "${rpath}" ]; then -                        rpath="${rpath}.git" -                fi -        fi -        if [ -z "${basesmpath}" ]; then -                basesmpath="${baserpath}" -        fi -        debug_print "${FUNCNAME}: cloning ${baserpath} - ${repo} : ${branch} into ${GTWS_WSNAME}/${rname} submodules: ${basesmpath}" - -        # Main repo -        #git clone --recurse-submodules -b "${branch}" "${rpath}" || die "failed to clone ${rpath}:${branch}" || return 1 -        git clone -b "${branch}" "${rpath}" ${rname} || die "${FUNCNAME}: failed to clone ${rpath}:${branch}" || return 1 - -        # Update submodules -        cd "${rname}" || die "${FUNCNAME}: failed to cd to ${rpath}" || return 1 -        gtws_submodule_clone "${basesmpath}" || return 1 -        cd "${origpath}" || die "${FUNCNAME}: Failed to cd to ${origpath}" || return 1 - -        # Copy per-repo settings, if they exist -        gtws_cpdot "${baserpath%/git}/extra/repo/${rname}" "${origpath}/${rname}" - -        # Extra files -        for i in ${GTWS_FILES_EXTRA}; do -                local esrc= - -                IFS=':' read -ra ARR <<< "$i" -                if [ -n "${ARR[1]}" ]; then -                        dst="${rname}/${ARR[1]}" -                else -                        dst="${rname}/${ARR[0]}" -                fi - -                if [ -n "${GTWS_REMOTE_IS_WS}" ]; then -                        esrc="${baserpath}/${dst}" -                else -                        esrc="${baserpath%/git}" -                fi - -                gtws_rcp "${esrc}/${ARR[0]}" "${dst}" -        done -} - -# gtws_project_clone_default ${GTWS_ORIGIN} ${GTWS_PROJECT} ${GTWS_PROJECT_VERSION} ${GTWS_WSNAME} [${SUBMODULE_BASE}] -# -# Clone a version of a project into ${GTWS_WSPATH} (which is the current working directory).  This is the default version of this that clones <origin>/<project>/<version>/* -function gtws_project_clone_default { -        local origin=$1 -        local project=$2 -        local version=$3 -        local name=$4 -        local basesmpath=$5 -        local opv=$(gtws_opvn "${origin}" "${project}" "${version}" "${name}") -        local wspath=${PWD} -        local repos= -        local -A branches - -        if [ -z "${GTWS_PROJECT_REPOS}" ]; then -                for i in "${opv}"/*; do -                        repos="$(basename $i) $repos" -                        branches[$i]=${version} -                done -        else -                for i in ${GTWS_PROJECT_REPOS}; do -                        IFS=':' read -ra ARR <<< "$i" -                        repos="${ARR[0]} $repos" -                        if [ -n "${ARR[1]}" ]; then -                                branches[${ARR[0]}]=${ARR[1]} -                        else -                                branches[${ARR[0]}]=${version} -                        fi -                done -        fi - -        if [ -z "${basesmpath}" ] || [ ! -d "${basesmpath}" ]; then -                basesmpath="${opv}" -        fi - -        for repo in ${repos}; do -                gtws_repo_clone "${opv}" "${repo}" "${branches[${repo}]}" "${basesmpath}" -        done - -        # Copy per-WS settings, if they exist -        gtws_cpdot "${opv%/git}/extra/ws" "${wspath}" -} - -# gtws_repo_setup ${wspath} ${repo_path} -# -# The project can define gtws_repo_setup_local taking the same args to do -# project-specific setup.  It will be called last. -# -# Post-clone setup for an individual repo -function gtws_repo_setup { -        local wspath=$1 -        local rpath=$2 -        local savedir="${PWD}" - -        if [ ! -d "${rpath}" ]; then -                return 0 -        fi - -        cd "${rpath}/src" 2>/dev/null \ -                || cd ${rpath} \ -                || die "Couldn't cd to ${rpath}" || return 1 - -        maketags ${GTWS_MAKETAGS_OPTS} > /dev/null 2> /dev/null & - -        cd ${wspath} || die "Couldn't cd to ${wspath}" || return 1 - -        mkdir -p "${wspath}/build/$(basename ${rpath})" - -        cd "${savedir}" - -        if [ -n "$(declare -F | grep "\<gtws_repo_setup_local\>")" ]; then -                gtws_repo_setup_local "${wspath}" "${rpath}" \ -                        || die "local repo setup failed" || return 1 -        fi -} - -# gtws_project_setup${GTWS_WSNAME} ${GTWS_ORIGIN} ${GTWS_PROJECT} ${GTWS_PROJECT_VERSION} -# -# The project can define gtws_project_setup_local taking the same args to do -# project-specific setup.  It will be called last. -# -# Post clone setup of a workspace in ${GTWS_WSPATH} (which is PWD) -function gtws_project_setup { -        local wsname=$1 -        local origin=$2 -        local project=$3 -        local version=$4 -        local wspath=${PWD} -        local opv=$(gtws_opvn "${origin}" "${project}" "${version}" "placeholder") - -        for i in "${wspath}"/*; do -                gtws_repo_setup "${wspath}" "${i}" -        done - -        mkdir "${wspath}"/install -        mkdir "${wspath}"/chroots -        mkdir "${wspath}"/patches - -        if [ -n "$(declare -F | grep "\<gtws_project_setup_local\>")" ]; then -                gtws_project_setup_local "${wsname}" "${origin}" "${project}" \ -                        "${version}" || die "local project setup failed" || return 1 -        fi -} - -# load_rc /path/to/workspace -# -# This should be in the workspace-level gtwsrc file -# Recursively load all RC files, starting at / -function load_rc { -        local BASE=$(readlink -f "${1}") -        # Load base RC first -        debug_print "load_rc: Enter + Top: ${BASE}" -        source "${HOME}"/.gtwsrc -        while [ "${BASE}" !=  "/" ]; do -                if [ -f "${BASE}"/.gtwsrc ]; then -                        load_rc "$(dirname ${BASE})" -                        debug_print "\tLoading ${BASE}/.gtwsrc" -                        source "${BASE}"/.gtwsrc -                        return 0 -                fi -                BASE=$(readlink -f $(dirname "${BASE}")) -        done -        # Stop at / - -        return 1 -} - -# clear_env -# -# Clear the environment of GTWS_* except for the contents of GTWS_SAVEVARS. -# The default values for GTWS_SAVEVARS are below. -function clear_env { -        local savevars=${GTWS_SAVEVARS:-"LOC PROJECT PROJECT_VERSION VERBOSE WSNAME"} -        local verbose="${GTWS_VERBOSE}" -        debug_print "savevars=$savevars" - -        # Reset prompt -        if [ -n "${GTWS_SAVEPS1}" ]; then -                PS1="${GTWS_SAVEPS1}" -        fi -        if [ -n "${GTWS_SAVEPATH}" ]; then -                export PATH=${GTWS_SAVEPATH} -        fi -        unset LD_LIBRARY_PATH -        unset PYTHONPATH -        unset PROMPT_COMMAND -        unset CDPATH -        unset SDIRS - -        # Save variables -        for i in ${savevars}; do -                SRC=GTWS_${i} -                DST=SAVE_${i} -                debug_print "\t $i: ${DST} = ${!SRC}" -                eval ${DST}=${!SRC} -        done - -        # Clear GTWS evironment -        for i in ${!GTWS*} ; do -                if [ -n "${verbose}" ]; then -                        echo -e "unset $i" >&2 -                fi -                unset $i -        done - -        # Restore variables -        for i in ${savevars}; do -                SRC=SAVE_${i} -                DST=GTWS_${i} -                if [ -n "${verbose}" ]; then -                        echo -e "\t $i: ${DST} = ${!SRC}" >&2 -                fi -                if [ -n "${!SRC}" ]; then -                        eval export ${DST}=${!SRC} -                fi -                unset ${SRC} -        done -} - -# save_env ${file} ${nukevars} -# -# Save the environment of GTWS_* to the give file, except for the variables -# given to nuke.  The default values to nuke are given below. -function save_env { -        local fname=${1} -        local nukevars=${2:-"SAVEPATH ORIGIN WS_GUARD LOC SAVEPS1"} -        debug_print "nukevars=$nukevars" - -        for i in ${!GTWS*} ; do -                for j in ${nukevars}; do -                        if [ "${i}" == "GTWS_${j}" ]; then -                                debug_print "skipping $i" -                                continue 2 -                        fi -                done -                debug_print "saving $i" -                echo "export $i=\"${!i}\"" >> "${fname}" -        done -} - -# gtws_tmux_session_name ${PROJECT} ${VERSION} ${WSNAME} sesname -# -# Result will be in local variable sesname  Or: -# -# sesname = $(gtws_tmux_session_name ${PROJECT} ${VERSION} ${WSNAME}) -# -# Result will be in local variable sesname -# -# Get the tmux session name for a given workspace -function gtws_tmux_session_name { -        local project=$1 -        local version=$2 -        local wsname=$3 -        local  __resultvar=$4 -        local sesname="${project//./_}/${version//./_}/${wsname//./_}" - -        if [[ "$__resultvar" ]]; then -                eval $__resultvar="'$sesname'" -        else -                echo "$sesname" -        fi -} - -# gtws_tmux_session_info ${SESSION_NAME} running attached -# -# Determine if a session is running, and if it is attached -# -# Result will be in local variables running and attached -# -# Test with: -# if $running ; then -#       echo "is running" -# fi - -function gtws_tmux_session_info { -        local ses_name=$1 -        local  __result_running=$2 -        local  __result_attached=$3 - -        local __num_ses=$(tmux ls | grep "^${ses_name}" | wc -l) -        local __attached=$(tmux ls | grep "^${ses_name}" | grep attached) - -        echo "$ses_name ses=${__num_ses}" - -        if [[ "$__result_running" ]]; then -                if [ "${__num_ses}" != "0" ]; then -                        eval $__result_running="true" -                else -                        eval $__result_running="false" -                fi -        fi -        if [[ "$__result_attached" ]]; then -                if [ -n "${__attached}" ]; then -                        eval $__result_attached="true" -                else -                        eval $__result_attached="false" -                fi -        fi -} - -# gtws_tmux_kill ${BASENAME} -# -# Kill all sessiont matching a pattern -function gtws_tmux_kill { -        local basename=$1 -        local old_sessions=$(tmux ls 2>/dev/null | fgrep "${basename}" | cut -f 1 -d:) -        for session in ${old_sessions}; do -                tmux kill-session -t "${session}" -        done -} - -# gtws_tmux_cleanup -# -# Clean up defunct tmux sessions -function gtws_tmux_cleanup { -        local old_sessions=$(tmux ls 2>/dev/null | egrep "^[0-9]{14}.*[0-9]+\\)$" | cut -f 1 -d:) -        for session in ${old_sessions}; do -                tmux kill-session -t "${session}" -        done -} - -# gtws_tmux_attach ${SESSION_NAME} -# -# Attach to a primary session.  It will remain after detaching. -function gtws_tmux_attach { -        local ses_name=$1 - -        tmux attach-session -t "${ses_name}" -} - -# gtws_tmux_slave ${SESSION_NAME} -# -# Create a secondary session attached to the primary session.  It will exit it -# is detached. -function gtws_tmux_slave { -        local ses_name=$1 - -        # Session is is date and time to prevent conflict -        local session=`date +%Y%m%d%H%M%S` -        # Create a new session (without attaching it) and link to base session -        # to share windows -        tmux new-session -d -t "${ses_name}" -s "${session}" -        # Attach to the new session -        gtws_tmux_attach "${session}" -        # When we detach from it, kill the session -        tmux kill-session -t "${session}" -} - -function cdorigin() { -        if [ -n "$(declare -F | grep "gtws_project_cdorigin")" ]; then -                gtws_project_cdorigin $@ -        else -                gtws_cdorigin $@ -        fi -} - -function gtws_get_origin { -        local opv=$1 -        local target=$2 -        local __origin= -        local  __resultvar=$3 - -        # If it's a git repo with a local origin, use that. -        __origin=$(git config --get remote.origin.url) -        if [ ! -d "${__origin}" ]; then -                __origin="${__origin}.git" -        fi -        if [ ! -d "${__origin}" ]; then -                # Try to figure it out -                if [ ! -d "${opv}" ]; then -                        die "No opv for $target" || return 1 -                fi -                find_git_repo "${opv}" "${target}" __origin || return 1 -        fi - -        if [[ "$__resultvar" ]]; then -                eval $__resultvar="'$__origin'" -        else -                echo "$__origin" -        fi -} - -function gtws_cdorigin() { -        local opv=$(gtws_opvn "${GTWS_ORIGIN}" "${GTWS_PROJECT}" "${GTWS_PROJECT_VERSION}" "${GTWS_WSNAME}") -        local gitdir="" -        local target="" -        if [ -n "$1" ]; then -                target="$@" -        else -                git_top_dir gitdir || return 1 -                target=$(basename $gitdir) -        fi - -        gtws_get_origin $opv $target origin || return 1 -        cd "${origin}" -} - -# Copy files to another machine in the same workspace -function wsrcp { -        local target="${!#}" -        local length=$(($#-1)) -        local base=${PWD} - -        if [ -z "${1}" -o -z "${2}" ]; then -                echo "usage: ${FUNCNAME} <path> [<path>...] <target>" -                return 1 -        fi - -        for path in "${@:1:$length}"; do -                gtws_rcp "${path}" "${target}:${base}/${path}" -        done -} - -# Override "cd" inside the workspace to go to GTWS_WSPATH by default -function cd { -        if [ -z "$@" ]; then -                cd "${GTWS_WSPATH}" -        else -                builtin cd $@ -        fi -} - -# Generate diffs/interdiffs for changes and ship to WS on other boxes -function gtws_interdiff { -        local targets=$@ -        local target= -        local savedir=${PWD} -        local topdir=$(git_top_dir) -        local repo=$(basename ${topdir}) -        local mainpatch="${GTWS_WSPATH}/patches/${repo}-full.patch" -        local interpatch="${GTWS_WSPATH}/patches/${repo}-incremental.patch" - -        if [ -z "${targets}" ]; then -                echo "Usage: ${FUNCNAME} <targethost>" -                die "Must give targethost" || return 1 -        fi -        cd "${topdir}" -        if [ -f "${mainpatch}" ]; then -                git diff | interdiff "${mainpatch}" - > "${interpatch}" -        fi -        git diff > "${mainpatch}" -        for target in ${targets}; do -                gtws_rcp "${mainpatch}" "${interpatch}" \ -                        "${target}:${GTWS_WSPATH}/patches" -        done -        cd "${savedir}" -} - -function gtws_debug { -        local cmd=$1 -        if [ -z "${cmd}" ]; then -                echo "Must give a command" -                echo -                die "${FUNCNAME} <cmd-path>" || return 1 -        fi -        local cmdbase=$(basename $cmd) -        local pid=$(pgrep "${cmdbase}") - -        ASAN_OPTIONS="abort_on_error=1" cgdb ${cmd} ${pid} -} - -# remote_cmd "${target}" "${command}" output -# -# Result will be in local variable output  Or: -# -# output = $(remote_cmd "${target}" "${command}") -# -# Result will be in local variable output -# -# Run a command remotely and capture sdtout.  Make sure to quote the command -# appropriately. -remote_cmd() { -        local target=$1 -        local cmd=$2 -        local  __resultvar=$3 -        local output= - -        if [ -z "${GTWS_VERBOSE}" ]; then -                output=$(ssh "${target}" "${cmd}" 2>/dev/null) -        else -                output=$(ssh "${target}" "${cmd}") -        fi -        local ret=$? - -        if [[ "$__resultvar" ]]; then -                eval $__resultvar="'$output'" -        else -                echo "${output}" -        fi -        return ${ret} -} -``` -------------------------------------------------------------------------------- @@ -1139,7 +162,7 @@ via: https://opensource.com/article/20/2/git-great-teeming-workspaces 作者:[Daniel Gryniewicz][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ea687cb5ad34f0b2ce476096fa3767e783d0a110 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 Apr 2020 18:23:04 +0800 Subject: [PATCH 0473/1809] PUB @lxbwolf https://linux.cn/article-12156-1.html --- ...ge complex Git workspaces with Great Teeming Workspaces.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md (99%) diff --git a/translated/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md b/published/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md similarity index 99% rename from translated/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md rename to published/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md index 683f3dc313..9ae4ee5618 100644 --- a/translated/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md +++ b/published/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12156-1.html) [#]: subject: (Manage complex Git workspaces with Great Teeming Workspaces) [#]: via: (https://opensource.com/article/20/2/git-great-teeming-workspaces) [#]: author: (Daniel Gryniewicz https://opensource.com/users/dang) From 462acb38c1bd5a819fc75a1def6370c72c6f64e9 Mon Sep 17 00:00:00 2001 From: luzw3 Date: Mon, 27 Apr 2020 18:37:34 +0800 Subject: [PATCH 0474/1809] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= =?UTF-8?q?=20tech/20200424=20What=20you=20need=20to=20know=20about=20open?= =?UTF-8?q?=20source=20ad=20blockers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d to know about open source ad blockers.md | 55 ------------------- ...d to know about open source ad blockers.md | 55 +++++++++++++++++++ 2 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 sources/tech/20200424 What you need to know about open source ad blockers.md create mode 100644 translated/tech/20200424 What you need to know about open source ad blockers.md diff --git a/sources/tech/20200424 What you need to know about open source ad blockers.md b/sources/tech/20200424 What you need to know about open source ad blockers.md deleted file mode 100644 index 1be2a98950..0000000000 --- a/sources/tech/20200424 What you need to know about open source ad blockers.md +++ /dev/null @@ -1,55 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (CrazyShipOne) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What you need to know about open source ad blockers) -[#]: via: (https://opensource.com/article/20/4/ad-blockers) -[#]: author: (Joshua Pearce https://opensource.com/users/jmpearce) - -What you need to know about open source ad blockers -====== -Three open source ad blockers were tested against a "no ad blocker" -control. -![Browser of things][1] - -A new [study][2] meant to investigate energy conservation of free and open source ad blockers has unexpectedly shown that Internet ads are wasting shocking amounts of your time. - -More importantly, the results show how you can get that time back. The study estimates that the average Internet user would save over 100 hours a year by using [uBlock Origi][3][n][3][,][3] a free and open source ad blocker. uBlock Origin was the most effective ad blocker tested, but all ad blockers save time, energy and money according to the study. - -![Ad blocker screen comparison][4] - -The results show that page load time dropped 11% with [AdBlock+][5], 22% with [Privacy Badger][6], and 28% with [uBlock Origi][3][n][3]. These are not significant on a single page, but Internet users spend more than half of their time online rapidly clicking through websites, spending less than 15 seconds on a given page. With all these clicks, the additional time to load ads really starts to add up. - -The article _[Energy Conservation with Open Source Ad Blockers][7]_, published in the journal _Technologies,_ was originally conceived to address rising energy consumption. Internet-related electricity consumption is rising rapidly as global Internet users spend more than 6.5 hours per day online. Americans, for example, have more than doubled the time they spend online since 2000 to almost 24 hours a week. Open source ad blockers have the potential to reduce the time, and thus the electricity, spent by eliminating ads during Internet browsing and video streaming. - -In the study, three open source ad blockers were tested against a "no ad blocker" control. Page load times were recorded for browsing a representative selection of the most-accessed websites worldwide, including web searching (Google, Yahoo, Bing), information (Weather.com, Wikipedia), and news sites (CNN, Fox, New York Times). In addition, the study analyzed the time spent watching ads on videos for both trending and non-trending content. This part of the study was more challenging due to the lack of data on the ratio of YouTube watching time spent on trending vs. non-trending content. The time wasted viewing ads per video ranged from 0.06% up to a staggering 21%. Thus, the total hours lost to loading ads was only recorded for browsing. - -Overall, the results showed that the energy wasted loading ads is not trivial. As a lot of the electricity used for running computers continues to come from coal, which causes air pollution and premature death, the study analyzed the potential for ad blockers to save American lives. The results were shocking: the energy conserved if everyone in the United States used the open source ad blocker would save over 36 American lives per year. - -Electricity costs money, so cutting ads could also save consumers money. In the United States, if all Internet users enabled Privacy Badger on their computers, Americans would save more than $91 million annually. Globally, the results of the investigation were even more striking. uBlock Origin could save global consumers more than $1.8 billion a year. - -This study was done before everyone was forced to stay home because of the COVID-19 pandemic, so all the values can be viewed as conservative underestimates. Overall, the study found open source ad blockers are a potentially effective technology for energy conservation. - -Although free and open source ad blockers save energy and are good for the environment, you are probably going to use them primarily to block annoying ads and save yourself time. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/ad-blockers - -作者:[Joshua Pearce][a] -选题:[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/jmpearce -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) -[2]: https://www.mdpi.com/2227-7080/8/2/18 -[3]: https://github.com/gorhill/uBlock -[4]: https://opensource.com/sites/default/files/uploads/os_ad_blocker_story_.png (Ad blocker screen comparison) -[5]: https://adblockplus.org/ -[6]: https://privacybadger.org/ -[7]: https://www.academia.edu/42434401/Energy_Conservation_with_Open_Source_Ad_Blockers diff --git a/translated/tech/20200424 What you need to know about open source ad blockers.md b/translated/tech/20200424 What you need to know about open source ad blockers.md new file mode 100644 index 0000000000..981a892257 --- /dev/null +++ b/translated/tech/20200424 What you need to know about open source ad blockers.md @@ -0,0 +1,55 @@ +[#]: collector: (lujun9972) +[#]: translator: (CrazyShipOne) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What you need to know about open source ad blockers) +[#]: via: (https://opensource.com/article/20/4/ad-blockers) +[#]: author: (Joshua Pearce https://opensource.com/users/jmpearce) + +关于开源广告拦截器你需要知道的事 +====== +三个开源广告拦截器针对“无广告拦截器"的情况进行了测试。 +![Browser of things][1] + +一项为了调查免费开源广告拦截器节能情况的[研究][2],意外地发现了互联网广告正在浪费你大量的时间。 + +更重要的是,研究结果表明了你可以挽救回失去的时间。这项研究评估发现,使用 [uBlock Origin][3](一个开源免费的广告拦截器)的情况下平均每个网民一年可以节约超过 100 个小时的时间。 uBlock Origin 是测试中最节能的广告拦截器,不过其他的广告拦截器也为网民节省了时间,能源以及金钱。 + +![Ad blocker screen comparison][4] + +在研究结果中,[AdBlock+][5] 减少了11 % 的页面加载时间,[Privacy Badger][6] 减少了22 %,[uBlock Origin][3] 减少了28 %。对于单独一个页面来说这个时间並不算多,但是网民们浏览页面时常常花费半数以上的时间在网站上快速点击,并且通常在一个页面停留少于 15 秒。鉴于这种情况,加载广告的额外时间增加了许多。 + +发布于 _Technologies_ 杂志上的 _[Energy Conservation with Open Source Ad Blockers][7]_ 最初旨在解决日益增长的能源消耗问题。由于全球网民每日花费超过 6.5 小时上网冲浪,互联网相关用电量正在快速地增加。比如,美国自 2000 年以来网上冲浪时间已经翻倍至几乎一周24小时的时间。开源广告拦截器通过消灭网上冲浪和观看视频时产生的广告,具有节约能源和时间的潜力。 + +在研究过程中,三个开源广告拦截器针对“无广告拦截器”情况进行了测试。一系列全世界最具代表性访问最频繁网站的页面加载时间被记录在案,其中包括搜索引擎(Google,Yahoo,Bing),信息网站(Weather.com,Wikipedia)以及新闻门户(CNN,Fox,New York Times)。除此之外,研究还分析了观看流行与非流行视频内容时广告所花费的时间。这部分研究由于缺乏 Youtube 上流行和非流行内容观看比例的数据而非常具有挑战性。每个视频浪费的广告时间可以从 0.06 % 上升到惊人的 21 %。而且,这还只是浏览器上记录的加载广告而失去的时间。 + +总的来说,研究结果表明加载广告所浪费的能源并不是最重要的。由于运行计算机所需的大量电能来自于造成空气污染和人类减寿的煤炭,研究分析了广告拦截器挽救美国人生命的潜在可能性。结果是令人震惊的:如果每一个美国人使用开源广告拦截器,所节约的能源每年将会拯救超过36个美国人的生命 + +电能即金钱,所以削减广告也可以为消费者节约钱财。在美国,如果所有的网民都在他们的电脑上开启 [Privacy Badger][8],美国人每年可以节约超过 9100 万美元。全球的研究结果则更令人吃惊。uBlock Origin 每年可以为全球消费者节约 18 亿美元。 + +这项研究开始于人们因为新冠肺炎大流行而被迫居家之前,因此所有的数据都可以被认为是保守的估算。整体来说,研究发现了开源广告拦截器是一项潜在的可以节约能源的有效技术。 + +虽然免费的开源广告拦截器可以节约能源并且对自然环境友好,但是可能你只是因为它们可以拦截烦人的广告以节省时间而使用它们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/ad-blockers + +作者:[Joshua Pearce][a] +选题:[lujun9972][b] +译者:[CrazyShipOne](https://github.com/CrazyShipOne) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jmpearce +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) +[2]: https://www.mdpi.com/2227-7080/8/2/18 +[3]: https://github.com/gorhill/uBlock +[4]: https://opensource.com/sites/default/files/uploads/os_ad_blocker_story_.png (Ad blocker screen comparison) +[5]: https://adblockplus.org/ +[6]: https://privacybadger.org/ +[7]: https://www.academia.edu/42434401/Energy_Conservation_with_Open_Source_Ad_Blockers +[8]: https://privacybadger.org/ From 060d673bb066fc5da5a58b18b7488ab3844e030d Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Mon, 27 Apr 2020 20:41:28 +0800 Subject: [PATCH 0475/1809] APL --- sources/tech/20200425 Inlining optimisations in Go.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200425 Inlining optimisations in Go.md b/sources/tech/20200425 Inlining optimisations in Go.md index 3784d6868b..0e29d0d178 100644 --- a/sources/tech/20200425 Inlining optimisations in Go.md +++ b/sources/tech/20200425 Inlining optimisations in Go.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From cad96ad4d31b19ad60adbfd86f3e9f6a43fd172e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 Apr 2020 22:01:57 +0800 Subject: [PATCH 0476/1809] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @CrazyShipOne 恭喜你,完成了第一篇翻译贡献! --- ...d to know about open source ad blockers.md | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/translated/tech/20200424 What you need to know about open source ad blockers.md b/translated/tech/20200424 What you need to know about open source ad blockers.md index 981a892257..670a16fce6 100644 --- a/translated/tech/20200424 What you need to know about open source ad blockers.md +++ b/translated/tech/20200424 What you need to know about open source ad blockers.md @@ -1,36 +1,37 @@ [#]: collector: (lujun9972) [#]: translator: (CrazyShipOne) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What you need to know about open source ad blockers) [#]: via: (https://opensource.com/article/20/4/ad-blockers) [#]: author: (Joshua Pearce https://opensource.com/users/jmpearce) -关于开源广告拦截器你需要知道的事 +开源的广告拦截器不但节能,而且能拯救生命! ====== -三个开源广告拦截器针对“无广告拦截器"的情况进行了测试。 -![Browser of things][1] +> 三个开源广告拦截器与“无广告拦截器”对照组进行了测试。 -一项为了调查免费开源广告拦截器节能情况的[研究][2],意外地发现了互联网广告正在浪费你大量的时间。 +![](https://img.linux.net.cn/data/attachment/album/202004/27/220109b86sidn56sn6inoh.jpg) -更重要的是,研究结果表明了你可以挽救回失去的时间。这项研究评估发现,使用 [uBlock Origin][3](一个开源免费的广告拦截器)的情况下平均每个网民一年可以节约超过 100 个小时的时间。 uBlock Origin 是测试中最节能的广告拦截器,不过其他的广告拦截器也为网民节省了时间,能源以及金钱。 +一项旨在调查自由开源的广告拦截器节能的情况的[研究][2],意外地发现了互联网广告正在浪费你大量的时间。 + +更重要的是,研究结果表明了你可以挽救回这些失去的时间。这项研究评估发现,使用 [uBlock Origin][3](一个开源免费的广告拦截器)的情况下平均每个网民一年可以节约超过 100 个小时的时间。uBlock Origin 是测试中最有效的广告拦截器,不过其他的广告拦截器也为网民节省了时间、能源以及金钱。 ![Ad blocker screen comparison][4] -在研究结果中,[AdBlock+][5] 减少了11 % 的页面加载时间,[Privacy Badger][6] 减少了22 %,[uBlock Origin][3] 减少了28 %。对于单独一个页面来说这个时间並不算多,但是网民们浏览页面时常常花费半数以上的时间在网站上快速点击,并且通常在一个页面停留少于 15 秒。鉴于这种情况,加载广告的额外时间增加了许多。 +在研究结果中,[AdBlock+][5] 减少了 11% 的页面加载时间,[Privacy Badger][6] 减少了 22%,[uBlock Origin][3] 减少了 28%。对于单独一个页面来说这个时间並不算多,但是网民们一半以上的浏览时间都是在网站间快速跳转,通常在一个页面停留少于 15 秒。鉴于这种情况,加载广告的额外时间加起来就很多了。 -发布于 _Technologies_ 杂志上的 _[Energy Conservation with Open Source Ad Blockers][7]_ 最初旨在解决日益增长的能源消耗问题。由于全球网民每日花费超过 6.5 小时上网冲浪,互联网相关用电量正在快速地增加。比如,美国自 2000 年以来网上冲浪时间已经翻倍至几乎一周24小时的时间。开源广告拦截器通过消灭网上冲浪和观看视频时产生的广告,具有节约能源和时间的潜力。 +发布于 Technologies 杂志上的《[用开源的广告拦截器节能][7]》一文最初旨在解决日益增长的能源消耗问题。随着全球网民每日上网时间超过 6.5 小时,与互联网相关的用电量正在快速地增加。以美国人为例,自 2000 年他们的上网时间已经增加了一倍,几乎达到每周 24 小时。开源广告拦截器通过消灭上网和观看视频时产生的广告,潜在地减少了时间,从而减少用电。 -在研究过程中,三个开源广告拦截器针对“无广告拦截器”情况进行了测试。一系列全世界最具代表性访问最频繁网站的页面加载时间被记录在案,其中包括搜索引擎(Google,Yahoo,Bing),信息网站(Weather.com,Wikipedia)以及新闻门户(CNN,Fox,New York Times)。除此之外,研究还分析了观看流行与非流行视频内容时广告所花费的时间。这部分研究由于缺乏 Youtube 上流行和非流行内容观看比例的数据而非常具有挑战性。每个视频浪费的广告时间可以从 0.06 % 上升到惊人的 21 %。而且,这还只是浏览器上记录的加载广告而失去的时间。 +在研究过程中,对三个开源广告拦截器与“无广告拦截器”对照组进行了测试。研究人员记录了浏览全球访问量最大的网站的页面加载时间,其中包括网络搜索(谷歌、雅虎、必应)、信息(Weather.com、维基百科)和新闻网站(CNN、福克斯、纽约时报)。除此之外,研究还分析了观看流行与非流行视频内容时广告所花费的时间。这部分研究由于缺乏 Youtube 上流行和非流行内容观看比例的数据而非常具有挑战性。每个视频浪费在广告观看上的时间可以从 0.06% 到惊人的 21% 不等。而且,这还只是浏览器上记录的加载广告而失去的时间。 -总的来说,研究结果表明加载广告所浪费的能源并不是最重要的。由于运行计算机所需的大量电能来自于造成空气污染和人类减寿的煤炭,研究分析了广告拦截器挽救美国人生命的潜在可能性。结果是令人震惊的:如果每一个美国人使用开源广告拦截器,所节约的能源每年将会拯救超过36个美国人的生命 +总的来说,研究结果表明加载广告所浪费的能源并不是是小事。由于运行电脑所使用的大量电力仍然来自于煤炭,而煤炭会造成空气污染和过早死亡,因此该研究分析了广告拦截器拯救美国人生命的潜力。(LCTT 译注:由于这项研究是美国人完成的,所以这里仅提及了美国人,但是同理可推至全球。)结果是令人震惊的:如果美国人都使用开源广告拦截器,每年节约的能源将会拯救超过 36 个美国人的生命。 -电能即金钱,所以削减广告也可以为消费者节约钱财。在美国,如果所有的网民都在他们的电脑上开启 [Privacy Badger][8],美国人每年可以节约超过 9100 万美元。全球的研究结果则更令人吃惊。uBlock Origin 每年可以为全球消费者节约 18 亿美元。 +电能即金钱,所以削减广告也可以为消费者节约钱财。在美国,如果所有的网民都在他们的电脑上开启 [Privacy Badger][8],美国人每年可以节约超过 9100 万美元。在全球范围内,调查研究的结果则更令人吃惊。uBlock Origin 每年可以为全球消费者节约 18 亿美元。 -这项研究开始于人们因为新冠肺炎大流行而被迫居家之前,因此所有的数据都可以被认为是保守的估算。整体来说,研究发现了开源广告拦截器是一项潜在的可以节约能源的有效技术。 +这项研究始于人们因为新冠肺炎大流行而被迫居家之前,因此所有的数据都可以被认为是保守的估算。整体来说,研究发现了开源广告拦截器是一项潜在的节能技术。 -虽然免费的开源广告拦截器可以节约能源并且对自然环境友好,但是可能你只是因为它们可以拦截烦人的广告以节省时间而使用它们。 +虽然自由开源的广告拦截器可以节约能源,对自然环境也有好处,但你可能主要是为了拦截恼人的广告和节省自己的时间而使用它们。 -------------------------------------------------------------------------------- @@ -39,7 +40,7 @@ via: https://opensource.com/article/20/4/ad-blockers 作者:[Joshua Pearce][a] 选题:[lujun9972][b] 译者:[CrazyShipOne](https://github.com/CrazyShipOne) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1dc9b3607e1530751eaca54b5a993100c6452f6a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 Apr 2020 22:03:12 +0800 Subject: [PATCH 0477/1809] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @CrazyShipOne 本文首发地址: https://linux.cn/article-12157-1.html 你的 LCTT 专页: https://linux.cn/lctt/CrazyShipOne 请注册以领取 LCCN:https://lctt.linux.cn/ --- ...424 What you need to know about open source ad blockers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200424 What you need to know about open source ad blockers.md (98%) diff --git a/translated/tech/20200424 What you need to know about open source ad blockers.md b/published/20200424 What you need to know about open source ad blockers.md similarity index 98% rename from translated/tech/20200424 What you need to know about open source ad blockers.md rename to published/20200424 What you need to know about open source ad blockers.md index 670a16fce6..c28cbc6080 100644 --- a/translated/tech/20200424 What you need to know about open source ad blockers.md +++ b/published/20200424 What you need to know about open source ad blockers.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (CrazyShipOne) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12157-1.html) [#]: subject: (What you need to know about open source ad blockers) [#]: via: (https://opensource.com/article/20/4/ad-blockers) [#]: author: (Joshua Pearce https://opensource.com/users/jmpearce) From 909b8c9d284298ac227520a33c91e11991d572b2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 28 Apr 2020 00:52:47 +0800 Subject: [PATCH 0478/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200428=20Lubu?= =?UTF-8?q?ntu=2020.04=20Review:=20Lightweight,=20Minimalistic,=20Polished?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md --- ...ew- Lightweight, Minimalistic, Polished.md | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md diff --git a/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md b/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md new file mode 100644 index 0000000000..c6857014ef --- /dev/null +++ b/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md @@ -0,0 +1,154 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Lubuntu 20.04 Review: Lightweight, Minimalistic, Polished) +[#]: via: (https://itsfoss.com/lubuntu-20-04-review/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +Lubuntu 20.04 Review: Lightweight, Minimalistic, Polished +====== + +_**Lubuntu 20.04 LTS is significantly different than its previous LTS version. It is aiming to give you a more polished experience rather than just focusing on older computer. Read more about it as I review Lubuntu 20.04.**_ + +### Lubuntu 20.04 Review: First LTS release with LXQt + +I have been using Lubuntu 20.04 from a few days before the release. I usually dwell in Arch world with Manjaro and Cinnamon desktop so using Lubuntu was a pleasant change for me. + +Here’s what I have noticed and felt about Lubuntu 20.04. + +#### Bye bye LXDE, Hello LXQt! + +For a long time, [Lubuntu][1] relied on [LXDE][2] to provide a lightweight Linux experience. It now uses LXQt desktop environment. + +[LXDE][3] is based on GTK (the libraries used by GNOME) and more specifically on GTK+ 2 which is dated in 2020. Dissatisfied with GTK+ 3, LXDE developer Hong Jen Yee decided to port the entire desktop to Qt (the libraries used by KDE). LXDE, the Qt port of it, and the [Razor-qt][4] project were combined to form [LXQt][5]. Although today, LXDE and LXQt coexist as separate projects. + +Since LXDE developer itself is focusing on LXQt, it makes no sense for Lubuntu to stick with a desktop environment that had its last stable release more than three years ago. + +Lubuntu 18.04 is the last version of with [LXDE][3]. Fortunately it’s a long term support edition. It will be supported officially by Lubuntu team till 2021. + +![][6] + +#### Not exclusively for older machines + +As the definition of “older machine” has changed in 2020 Lubuntu 18.04 is the last 32bit version. Nowadays even a 10 year old machine comes with at least 2 gigabytes of ram and a dual-core 64bit processor. + +As per that, [Lubuntu Team will no longer provide minimum system requirements and will no longer primarily focus on older hardware][7]. Although LXQt is still a lightweight, classic yet polished and feature rich desktop environment. + +The First Lubuntu release with LXQt was 18.10, giving the developers three standard releases to perfect the LXQt desktop before the Lubuntu 20.04 LTS release, which is a good development strategy. + +#### Not the regular Ubiquity, Lubuntu 20.04 uses Calamares installer + +![Lubuntu 20.04 Calamares Installer][8] + +A fresh installation begins with the new [Calamares][9] installer, in place of the Ubiquity installer that other [official Ubuntu flavors][10] use. + +The whole process is done in approximately 10 minutes, slightly faster than the previous Lubuntu releases. + +As the .iso comes with the essential applications pre-installed you can get your system fully configured pretty fast too. + +#### No upgrade from Lubuntu 18.04 to Lubuntu 20.04 + +Normally, you can [upgrade Ubuntu from one LTS to another LTS release][11]. But Lubuntu team advises not to upgrade from Lubuntu 18.04 to 20.04. They recommend a fresh install and rightly so. + +Lubuntu 18.04 used LXDE desktop while 20.04 uses LXQt. Due to the extensive changes in the desktop environments, upgrading to 20.04 from 18.04 will result in a broken system. + +#### **More KDE and Qt applications** + +![][12] + +Here are some of the applications that are available by default in this new release and as I can see, not all of them are lightweight and most of them are Qt-based. + +Even the software center used is KDE’s Discover instead of Ubuntu’s GNOME software center. + + * Ark – archive manager + * Bluedevil – bluetooth connector + * Discover Software Center – package management system + * FeatherPad – text editor + * FireFox – web browser + * K3b – CD/DVD burner + * Kcalc – calculator + * KDE partition manager – partition manager + * LibreOffice – Office suite (Qt interface version) + * LXimage-Qt – image viewer and screenshot tool + * Muon – package manager + + + * Noblenote – note taker + * PCManFM-Qt – File manager + * Qlipper – clipboard manager + * qPDFview – PDF viewer + * PulseAudio – audio controller + * Qtransmission – bittorrent client (Qt interface version) + * Quassel – IRC client + * ScreenGrab – Screenshot creator + * Skanlite – scanning + * Startup Disk Creator – USB boot disk maker + * Trojita – email client + * VLC – media player + * [MPV video player][13] + + + +#### Testing Lubuntu 20.04 LTS + +Boot times on the LXQt version of Lubuntu are under a minute, booting from an SSD though. + +LXQt currently requires slightly more memory than the Gtk+ v2-based LXDE, but the alternative Gtk+ v3 toolkit would also have required more memory. + +After a reboot the system runs approximately at a very low of 340 MB for the modern standards, 100 MB more than LXDE. + +![htop running on Lubuntu 20.04][14] + +LXQt is not only for users with an older hardware but also for those who are seeking a simple and classic experience at their new machine. + +The desktop layout looks similar to KDE’s Plasma desktop, don’t you think? + +![Lubuntu 20.04 Desktop][15] + +There’s an application menu in the lower-left corner, a taskbar for pinned and active applications, and a system tray in the lower-right corner. + +Lubuntu in its LXQt version can be easily customized and everything is in the menu under preferences, with most key items under LXQt Settings. + +It is worth-mentioning that LXQt uses the popular [Openbox window manager][16] by default. + +Like the last three releases, 20.04 LTS comes with a default dark theme Lubuntu Arc, but it is quick and easy to change it if it doesn’t suit your taste. + +In daily use, Lubuntu 20.04 has proven to me completely trouble-free as every Ubuntu flavour in fact. + +#### Conclusion + +Lubuntu team has successfully made the transition to a modern, still lightweight and minimal desktop environment. LXDE looks like abandoned and it is a good thing to move away to an active project. + +I hope that Lubuntu 20.04 makes you as much enthusiastic as I am, and if so don’t hesitate to let me know at the comments below. Stay tuned! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/lubuntu-20-04-review/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://lubuntu.me/ +[2]: https://github.com/lxde +[3]: https://lxde.org/ +[4]: https://web.archive.org/web/20160220061334/http://razor-qt.org/ +[5]: https://lxqt.org/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Lubuntu-20-04-review.jpg?ssl=1 +[7]: https://itsfoss.com/lubuntu-no-more-old-distro/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/lubuntu-20-04-installer.jpg?ssl=1 +[9]: https://calamares.io/ +[10]: https://itsfoss.com/which-ubuntu-install/ +[11]: https://itsfoss.com/upgrade-ubuntu-version/ +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/Lubuntu-20.04.gif?ssl=1 +[13]: https://itsfoss.com/mpv-video-player/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/htop.jpg?fit=800%2C629&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/Lubuntu-20.04-desktop.jpg?fit=800%2C450&ssl=1 +[16]: https://en.wikipedia.org/wiki/Openbox From a9b137c8958749f4bcd0879a01ef6f0848374cbb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 28 Apr 2020 00:55:09 +0800 Subject: [PATCH 0479/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200428=20Usin?= =?UTF-8?q?g=20Files=20and=20Folders=20on=20Desktop=20Screen=20in=20Ubuntu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md --- ...and Folders on Desktop Screen in Ubuntu.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md diff --git a/sources/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md b/sources/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md new file mode 100644 index 0000000000..40105e3aed --- /dev/null +++ b/sources/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Files and Folders on Desktop Screen in Ubuntu) +[#]: via: (https://itsfoss.com/add-files-on-desktop-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Using Files and Folders on Desktop Screen in Ubuntu +====== + +_**This beginner tutorial discusses a few difficulties you may face while adding files and folders on the desktop screen on Ubuntu.**_ + +I know a few people who are habitual of putting all the important/frequently used files on the desktop screen for quick access. + +![][1] + +I am not a fan of a cluttered desktop screen but I can imagine that it might actually be helpful to some people. + +For the past few releases, it has been difficult to add files on the desktop screen in Ubuntu’s default GNOME desktop. It’s not really Ubuntu’s fault. + +The [GNOME][2] developers thinks that there is no place for icons and files on the desktop screen. There is no need of putting files on the desktop when you can easily search for it in the menu. And that’s part true. + +This is why the newer version of [GNOME’s File Manager Nautilus][3] doesn’t support icons and files on the desktop very well. + +That said, it’s not impossible to add files and folders on the desktop. Let me show you how you can still use it. + +### Adding files and folders on the desktop screen in Ubuntu + +![][4] + +I am using Ubuntu 20.04 in this tutorial. The steps may or may not vary for other Ubuntu versions. + +#### Add the files and folders to the “Desktop folder” + +If you open the file manager, you should see an entry called Desktop in the left sidebar or in the folders list. This folder represents your desktop screen (in a way). + +![Desktop folder can be used to add files to the desktop screen][5] + +Anything you add to this folder will be reflected on the desktop screen. + +![Anything added to the Desktop folder will be reflected on the desktop screen][6] + +If you delete files from this ‘Desktop folder’, it will be removed from the desktop screen as well. + +#### Drag and drop files to desktop screen doesn’t work + +Now, if you try to drag and drop files from the file manager on the desktop, it won’t work. It’s not a bug, it’s a feature that irks a lot of people. + +A workaround would be to open two instances of the file manager. Open Desktop folder in one of them and then drag and drop files to this folder and they will be added on the desktop. + +I know that’s not ideal but you don’t have a lot of choices here. + +#### You cannot use Ctrl+C and Ctrl+V to copy-paste on the desktop, use the right click menu + +To add salt to injury, you cannot use Ctrl+V the famous keyboard shortcut to paste files on the desktop screen. + +But you can still use the right click context menu and select Paste from there to put the copied files on the desktop. You can even create new folders this way. + +![Right click menu can be used for copy-pasting files to desktop][7] + +Does it make sense? Not to me but that’s how it is in Ubuntu 20.04. + +#### You cannot delete files and folder using the Delete key, use the right click menu again + +What’s worse is that you cannot use the delete key or shift delete key to remove files from the desktop screen. But you can still right click on the files or folders and select “Move to trash” to delete the file. + +![Delete files from desktop using right click][8] + +Alright, so now you know that at least there is a way to add files on the desktop with some restrictions. But it doesn’t end here unfortunately. + +You cannot search for files with their names on the desktop screen. Normally, if you start typing ‘abc’, files starting with ‘abc’ are highlighted. You don’t get it here. + +I don’t know why so many restrictions have been put on adding files on the desktop. Thankfully, I don’t use it a lot otherwise I have been way too frustrated. + +If interested, you may read about [adding application shortcut on the desktop in Ubuntu][9] as well. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/add-files-on-desktop-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/files-on-desktop-ubuntu.jpg?ssl=1 +[2]: https://www.gnome.org/ +[3]: https://wiki.gnome.org/Apps/Files +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/adding-files-desktop-ubuntu.png?ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/desktop-folder-ubuntu.png?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/adding-files-desktop-screen-ubuntu.jpg?ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/adding-new-files-ubuntu-desktop.jpg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/delete-files-from-desktop-ubuntu.jpg?ssl=1 +[9]: https://itsfoss.com/ubuntu-desktop-shortcut/ From 8522d8fd9a834046262f65c769c6a3490abe3677 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 28 Apr 2020 00:55:58 +0800 Subject: [PATCH 0480/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200427=20How?= =?UTF-8?q?=20to=20secure=20your=20Linux=20email=20services=20with=20SSL/T?= =?UTF-8?q?LS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200427 How to secure your Linux email services with SSL-TLS.md --- ... your Linux email services with SSL-TLS.md | 209 ++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 sources/tech/20200427 How to secure your Linux email services with SSL-TLS.md diff --git a/sources/tech/20200427 How to secure your Linux email services with SSL-TLS.md b/sources/tech/20200427 How to secure your Linux email services with SSL-TLS.md new file mode 100644 index 0000000000..163e6b017f --- /dev/null +++ b/sources/tech/20200427 How to secure your Linux email services with SSL-TLS.md @@ -0,0 +1,209 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to secure your Linux email services with SSL/TLS) +[#]: via: (https://opensource.com/article/20/4/securing-linux-email) +[#]: author: (Marc Skinner https://opensource.com/users/marc-skinner) + +How to secure your Linux email services with SSL/TLS +====== +Protect your Linux email services by understanding security +certificates. +![email or newsletters via inbox and browser][1] + +Traditionally, email services send data in an unprotected way—whether you are sending emails via SMTP or receiving them via IMAP or POP, the defaults are in cleartext. With more online applications enforcing encryption and the general consensus to protect your data, it's best to secure your email services with a Secure Sockets Layer/Transport Layer Security (SSL/TLS) security certificate. + +First, a quick review of email services and protocols. Email is sent via a service called Simple Mail Transport Protocol (SMTP) using TCP port 25. This protocol sends emails from server to server based on DNS mail exchanger (MX) record lookups. Once an email is on the email server, it is retrieved using one of two services: Internet Message Access Protocol (IMAP) using port TCP 143, or Post Office Protocol (POP3) using port TCP 110. All of these services, by default, send your email and authentication to/from these services in plain text—thus, it's very unprotected! + +To protect the email data and authentication, these services have added a security feature in which they can utilize an SSL/TLS certificate to wrap the data flow and communication with encryption. How SSL/TLS encryption secures information is beyond the scope of this article, but [Bryant Son's internet security article][2] covers it in great detail. At a high level, SSL/TLS encryption is a public/private encryption algorithm. + +By adding these security features into the services, they can listen on new TCP ports: + +Service | Default TCP Port | SSL/TLS Port +---|---|--- +SMTP | 25 | 587 +IMAP | 143 | 993 +POP3 | 110 | 995 + +### Generate SSL/TLS certificates + +SSL/TLS certificates can be generated for free using tools like [OpenSSL][3], or they can be purchased for a range of prices from public certificate authorities (CAs). In the past, generating your own certificate was easy and worked in most cases, but with the increasing demand for better security, most email clients don't trust self-generated SSL/TLS certificates without a manual exception. + +If your use case is private or for testing, then saving money with a self-generated certificate makes sense. But if you're rolling this out to a large group or have paying customers, then you're better served by purchasing a certificate from a public, trusted company that sells them. + +In either case, the process to start requesting a new certificate is to use the OpenSSL tooling on your Linux system to create a certificate signing request (CSR): + + +``` +`$ openssl req -new -newkey rsa:2048 -nodes -keyout mail.mydomain.key -out mail.mydomain.csr` +``` + +This command will create a new CSR and private key at the same time for the service you are trying to secure. The process will ask you a number of questions associated with the certificate: location details, server fully qualified domain name (FQDN), email contact information, etc. Once you have filled out the information, the key and CSR will be generated. + +#### If you generate your own certificate + +If you want to generate your own certificate, you must create your own [root CA][4] before issuing the CSR command above. You can create your own root CA with: + + +``` +`$ openssl genrsa -des3 -out myCA.key 2048` +``` + +It will prompt you to add a passphrase. Please give it a secure passphrase and don't lose it—this is your private root CA key, and as the name states, it's the root of all trust in your certificates. + +Next, generate the root CA certificate: + + +``` +`$ openssl req -x509 -new -nodes -key myCA.key -sha256 -days 1825 -out myCA.pem` +``` + +After answering a few more questions, you will generate a root CA certificate with a five-year lifespan. + +Using the CSR file from the steps above, you can request a new certificate to be generated and signed by the root CA you just created: + + +``` +`$ openssl x509 -req -in mail.mydomain.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out mail.mydomain.pem -days 1825 -sha256` +``` + +Enter your private root CA key passphrase to create and sign the certificate. + +Now you have the two files needed to configure your email services for enhanced security: the private key file, **mail.mydomain.key**, and the public certificate file, **mail.mydomain.pem**. + +#### If you purchase a certificate + +If you purchase a certificate from a vendor, it will ask you to upload that CSR to its system, as it is used as the input to generate the SSL/TLS certificate. The certificate will be accessible as a file (such as **mail.mydomain.pem**). Many SSL vendors also require you to download an intermediate certificate. If this is the case, you must combine the two certificate files into one, so the email service can process them both in combination. You can combine your certificate with a third-party intermediate certificate with: + + +``` +`$ cat mail.mydomain.pem gd_bundle-g2-g1.crt > mail.mydomain.pem` +``` + +Notice that the output's file extension is **.pem**, which stands for Privacy-Enhanced Mail. + +Now you have the two files you need to configure your email services for enhanced security: the private key file, **mail.mydomain.key**, and the public combined certificate file, **mail.mydomain.pem**. + +### Create a safe directory for your files + +Whether you created your own key or bought one from a vendor, create a safe, root-owned directory for the two files you created above. An example workflow to create a safe play would be: + + +``` +$ mkdir /etc/pki/tls +$ chown root:root /etc/pki/tls +$ chmod 700 /etc/pki/tls +``` + +Make sure to set the permissions on your files after you copy them into **/etc/pki/tls** with: + + +``` +`$ chmod 600 /etc/pki/tls/*` +``` + +### Configure your SMTP and IMAP services + +Next, configure both the SMTP and the IMAP services to use the new security certificates. The programs used in this example for SMTP and IMAP are **postfix** and **dovecot**. + +Edit ***/_****etc****_/*****postfix/main.cf** in your preferred text editor. Add the following lines: + + +``` +smtpd_use_tls = yes +smtpd_tls_cert_file = /etc/pki/tls/mail.mydomain.pem +smtpd_tls_key_file = /etc/pki/tls/mail.mydomain.key +``` + +### Customize your config + +The following options allow you to disable/enable different ciphers, protocols, etc.: + + +``` +smtpd_tls_eecdh_grade = strong +smtpd_tls_protocols= !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 +smtpd_tls_mandatory_protocols= !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 +smtpd_tls_mandatory_ciphers = high +smtpd_tls_security_level=may +smtpd_tls_ciphers = high +tls_preempt_cipherlist = yes +smtpd_tls_mandatory_exclude_ciphers = aNULL, MD5 , DES, ADH, RC4, PSD, SRP, 3DES, eNULL +smtpd_tls_exclude_ciphers = aNULL, MD5 , DES, ADH, RC4, PSD, SRP, 3DES, eNULL +smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 +smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 +``` + +Edit **/etc/dovecot/dovecot.conf** by adding these three lines: + + +``` +ssl = required +ssl_cert = </etc/pki/tls/mail.mydomain.pem +ssl_key = </etc/pki/tls/mail.mydomain.key +``` + +Add the following options to disable/enable different ciphers, protocols, and more (I'll leave understanding and considering these up to you): + + +``` +ssl_cipher_list = EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:ALL:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SSLv2 +ssl_prefer_server_ciphers = yes +ssl_protocols = !SSLv2 !SSLv3 !TLSv1 !TLSv1.1 +ssl_min_protocol = TLSv1.2 +``` + +### Set context for SELinux + +If your Linux distribution has SELinux enabled, set the correct SELinux context for your new certificate files. + +For Postfix SELinux: + + +``` +`$ chcon -u system_u -t cert_t mail.mydomain.*` +``` + +For Dovecot SELinux: + + +``` +`$ chcon -u system_u -t dovecot_cert_t mail.mydomain.*` +``` + +Restart both services and connect with your updated email client configurations. Some email clients will auto-detect the new port numbers; others will require you to update them. + +### Test your setup + +Quickly test from the command line with **openssl** and the **s_client** plugin: + + +``` +$ openssl s_client -connect mail.mydomain.com:993 +$ openssl s_client -starttls imap -connect mail.mydomain.com:143 +$ openssl s_client -starttls smtp -connect mail.mydomain.com:587 +``` + +These test commands will show a plethora of data about the connection, certificate, cipher, session, and protocol you're using. This is not only a good way to validate that the new configuration is working but also to confirm you're using the appropriate certificate and security settings you defined in the **postfix** or **dovecot** configuration files. + +Stay secure! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/securing-linux-email + +作者:[Marc Skinner][a] +选题:[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/marc-skinner +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/newsletter_email_mail_web_browser.jpg?itok=Lo91H9UH (email or newsletters via inbox and browser) +[2]: https://opensource.com/article/19/11/internet-security-tls-ssl-certificate-authority +[3]: https://www.openssl.org/ +[4]: https://en.wikipedia.org/wiki/Root_certificate From 3a0ea87cb0f427dc80d1393deee304b1b02b91bd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 28 Apr 2020 00:56:50 +0800 Subject: [PATCH 0481/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200427=20DevO?= =?UTF-8?q?ps=20vs.=20Agile:=20Do=20they=20have=20anything=20in=20common?= =?UTF-8?q?=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200427 DevOps vs. Agile- Do they have anything in common.md --- ... Agile- Do they have anything in common.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20200427 DevOps vs. Agile- Do they have anything in common.md diff --git a/sources/tech/20200427 DevOps vs. Agile- Do they have anything in common.md b/sources/tech/20200427 DevOps vs. Agile- Do they have anything in common.md new file mode 100644 index 0000000000..a8fcf422c6 --- /dev/null +++ b/sources/tech/20200427 DevOps vs. Agile- Do they have anything in common.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (DevOps vs. Agile: Do they have anything in common?) +[#]: via: (https://opensource.com/article/20/4/devops-vs-agile-common) +[#]: author: (Taz Brown https://opensource.com/users/heronthecli) + +DevOps vs. Agile: Do they have anything in common? +====== +Agile and DevOps have many differences, yet they both seek to address +complexity, improve quality, and innovate around software design. +![Women in tech boardroom][1] + +The topic of DevOps vs. Agile is almost like debating iPhone vs. Android—everyone has an opinion, and emotions can become heated, especially if people disagree. + +After writing _[DevOps v. Agile: What's the difference?][2]_ and reading the comments on the article, I wanted to add some more thoughts—including how some of my thinking has changed on the topic. + +My perspective comes from where I am now but also where I have been. I used to be a systems administrator and infrastructure engineer, and now I am a senior scrum master with a major utility company in Missouri. (I actually was a scrum master before I was an admin or engineer, but I digress.) + +My team consists of six frontend software engineers and IT programmer analysts, a business analyst, two product owners, and me. Recently, we learned that management wants our team to become a [DevSecOps][3] team, so our core scrum team is working with a DevSecOps team that is helping us make the transition. No one is naive to the fact that this will not be easy, but the DevSecOps team's experience gives us confidence that we can succeed. + +Our team's manager recently hired a senior software engineer who will drive the DevSecOps goal. As a scrum master, I will continue to focus on continuous improvement. The team is fairly young, so they don't have expansive work experience, but they are smart and driven, and there is much room for greatness. In addition, our entire organization is going through an Agile transformation, so most people are new to all things Agile, including the [Agile Manifesto][4] and the [Five Scrum Values][5]. + +![Spray paint on a container][6] + +Kyle Glenn on Unsplash + +### Agile, Scrum, DevOps, and more + +There is a clear relationship between DevOps and Agile. Agile is the methodology, Scrum is the framework, and DevOps falls under the agile [umbrella][7] along with kanban, lean, large-scale Scrum, Extreme Programming, Crystal, and more. For example, our Scrum team is an Agile team that will operate as a DevSecOps team. + +Neither DevOps nor Agile is about the tools. Rather, both are about the [mindset and culture][8]. When it is done right, teams think and act differently and achieve greater results, including faster software delivery, continuous integration (CI), continuous delivery (CD), continuous improvement, working software, faster solutions, more collaboration, and fewer silos. Additional results are seen in quality testing, better automation, and improved systems, processes, and practices. + +#### Common concepts + +Some of the Agile concepts they have in common are associated with the Agile Manifesto; the most familiar of the 12 principles are the first four: + + * Individual and interactions over processes and tools + * Working software over comprehensive documentation + * Customer collaboration over contract negotiations + * Responding to change over following a plan + + + +Some of the DevOps concepts they have in common are the CI/CD pipeline, optimizing software delivery and quality, a culture of innovation, service-level objectives and indicators (SLOs and SLIs), collaboration across teams, and automation. + +#### DevOps and Agile benefits + +DevOps speeds up things between developers and operations. Furthermore, even though DevOps isn't about the tools, the fact that the dev and ops teams use the same tech stack creates a shared language and empathy between the two. Our Scrum team uses Jira to track all bugs, enhancements, and team performance. Common DevOps tools are Jenkins, AWS, SonarQube, GitHub, Splunk, and Ansible. While the tools differ from team to team, the mindset and culture should be common across all. + +DevOps also creates less division between dev and ops and a sense of understanding of what it's like to walk in each other's shoes because now they function as one. + +Agile teams continuously deliver often and fast, adapting incrementally along the way. Working in two-week sprints appears to be the sweet spot for most software- or product-delivery teams. Agile teams may utilize DevOps principles in their work (e.g., implementing a CI/CD pipeline), and dev teams that work with ops are likely to work in the same two-week increments. + +DevOps traditionally leads to continuous deployment, delivery, and integration. Teamwork is integrated; problems and failures are jointly owned by development, operations, and other entities, such as quality assurance (QA), testing, automation, etc. + +### Summing up + +I believe that Agile and DevOps breathe the same air, with many concepts and theories crossing between them. + +While I have no doubts that there will be counter opinions and even some sharply worded disagreements with my opinions, I think we would all agree that Agile and DevOps seek to address complexity, improve quality, and innovate around software design. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/devops-vs-agile-common + +作者:[Taz Brown][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/heronthecli +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/christina-wocintechchat-com-rg1y72ekw6o-unsplash_1.jpg?itok=MoIv8HlK (Women in tech boardroom) +[2]: https://opensource.com/article/20/2/devops-vs-agile +[3]: https://opensource.com/article/19/1/what-devsecops +[4]: https://agilemanifesto.org/ +[5]: https://www.scrumalliance.org/about-scrum/values +[6]: https://opensource.com/sites/default/files/uploads/roomtogrow_kyleglenn.jpg (Spray paint on a container) +[7]: https://opensource.com/article/20/4/kanban-devops +[8]: https://opensource.com/article/19/5/values-devops-mindset From cbfd6769ce8bc91db18dbcc9f86b1b06e8e8b8e0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 28 Apr 2020 00:57:31 +0800 Subject: [PATCH 0482/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200427=20Comp?= =?UTF-8?q?aring=20subscription,=20pay-per-bug,=20and=20consulting=20softw?= =?UTF-8?q?are=20business=20models?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200427 Comparing subscription, pay-per-bug, and consulting software business models.md --- ...and consulting software business models.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/tech/20200427 Comparing subscription, pay-per-bug, and consulting software business models.md diff --git a/sources/tech/20200427 Comparing subscription, pay-per-bug, and consulting software business models.md b/sources/tech/20200427 Comparing subscription, pay-per-bug, and consulting software business models.md new file mode 100644 index 0000000000..c7d76c5590 --- /dev/null +++ b/sources/tech/20200427 Comparing subscription, pay-per-bug, and consulting software business models.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Comparing subscription, pay-per-bug, and consulting software business models) +[#]: via: (https://opensource.com/article/20/4/open-source-business) +[#]: author: (Jos Poortvliet https://opensource.com/users/jospoortvliet) + +Comparing subscription, pay-per-bug, and consulting software business models +====== +Learn how NextCloud achieves business revenue that is one-third +consulting and two-thirds subscription. +![A chair in a field.][1] + +At FOSS Backstage this year, I hosted a discussion on open source models and shared why I think subscriptions are a great way to support open source products. + +### Picking a business model + +The company I co-founded, Nextcloud, only offers its services to customers on a (per user) subscription model. Some customers ask us during the sales conversation why they cannot just get access to our engineers on an hourly basis as they get from third party consultants: pay for the bug fix or support case, and be done? + +When we discussed how to build our new company in 2016 during our very first "[hackweek][2]," our business model was an important conversation. The team discussed different approaches, and we decided to go for a subscription model. Such a model felt more in line with our mission and principles to [create a great product and run a trustworthy company.][3] + +Why? While hourly rates seem like an easy way to get a quick fix for a problem, getting paid for fixing issues creates an incentive to create more buggy software, which of course, was not how we want to run our business. + +Let's look a bit deeper at the choices. + +### Subscription + +As a customer, you want the most reliable software. And when (not if, when) things go wrong, you want them fixed as quickly as possible. Our company offers customers a subscription to our services. Such a subscription includes direct and unlimited access to our engineers the moment you run into a problem. These two points are very important. It means that a customer has the certainty of having the very best resources at their fingertips at the moment they need them, and as much as they need them, in a way that only the original software vendor can deliver. + +For that, they pay a fee that scales with the number of users. + +### Pay-per-bug + +What if, instead, you could pay per issue fixed? In a way, this choice is similar to insurance. Indeed, when you need cold medicine once a year, the cost of a health insurance policy with a monthly premium seems prohibitive. But when a car accident crushes your spine and your medical costs skyrocket, not having to sell your house makes up for that premium and then some. + +There is also the bigger picture: The incentives potentially created by a pay-per-bug model. It is a simple, albeit cynical calculation: If we got paid per bug we fix for customers, leaving more bugs in our product would increase our income. Now we're not saying every company offering product consulting by the hour is extorting their customers, merely that this backward incentive exists, even when most moral businesses would not give in to it. + +Conversely, now that we offer insurance, we lower our support costs by building a better product, just like art insurance providers do what they can to ensure the art kept at their customers' exhibition is secure to keep their costs low. Our support team deeply cares about how our customers use our product: a better setup and good security practices not only make happier customers; it saves them time. + +Or, in other words, it helps maximize the ROI or TEI the customer gains from deploying Nextcloud. + +That is what we'd call a win-win and a business model an open source company can be proud of. + +### Consulting + +Now I discuss this business model regularly with others, and I invariably get told: "You might be right, but most of my customers only want to pay for the bugs we fix, or for features. Consulting is our main source of income! And I have no illusions about changing that." + +Yes, that's an issue. We open source folk honestly have a sales and marketing issue. And yes, you might think that, as a marketing guy, I just see everything as a nail I can hit with my communications hammer. But really, communication is core to the issue—how you communicate your value—which, in turn, requires you to be aware of your value. + +Recently, I had some challenging discussions with users on our forums who were upset that our engineers had not fixed their issues quickly enough. These users were clearly business users, and giving free support on GitHub obviously isn't exactly a great advertisement for the need for a subscription. So some abuse was thrown our way, and I took the hit. When complaining about it all to a fellow entrepreneurial friend of mine, he remarked: "Isn't that good news? They were frustrated and angry because clearly, you have something to offer, they need it, and are annoyed that they are forced to pay you for it. A good place to be in if you want to sell something!" Right he was, of course. + +The lesson I want to share with this anecdote is: You have something to offer. Your current customers will certainly be upset if you tell them that, going forward, they can only get your services under a subscription. But the angrier they are, the more you know they _need_ you, and you should persist! + +But moving to subscription from consulting requires a great deal of discipline, including saying "no" often. We have hard, internal rules, and one of these is that sales can only sell consulting valued at up to 50% of the subscription value, and only for deals greater than $10,000. + +But it has worked. The breakdown of our business revenue is now about one-third consulting and two-thirds subscription. Engineering hours for consulting work are not the limiting factor for expanding our customer base; sales and sales engineering is. We doubled our order intake last year and plan to do the same this year. + +### Bottomline: Sustainability + +For us, a better product and more sustainable business follows from the subscription model. It also benefits software engineers, who prefer to build a better product and spend less time on debugging issues with customers. A pay-by-the-hour model, with all the time tracking and incentive to keep customers dependent, does not work for us. + +What has your experience been? Tell us in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/open-source-business + +作者:[Jos Poortvliet][a] +选题:[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/jospoortvliet +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_WorkInPublic_4618517_1110_CS_A.png?itok=RwVrWArk (A chair in a field.) +[2]: https://nextcloud.com/blog/invitation-to-our-hackweek-in-stuttgart/ +[3]: https://nextcloud.com/blog/the-nextcloud-mission-and-principles/ From 383bb876b7559bda0658f1ced1a979786fb2f999 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 28 Apr 2020 00:57:59 +0800 Subject: [PATCH 0483/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200426=206=20?= =?UTF-8?q?tips=20for=20securing=20your=20WordPress=20website?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200426 6 tips for securing your WordPress website.md --- ...ips for securing your WordPress website.md | 175 ++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 sources/tech/20200426 6 tips for securing your WordPress website.md diff --git a/sources/tech/20200426 6 tips for securing your WordPress website.md b/sources/tech/20200426 6 tips for securing your WordPress website.md new file mode 100644 index 0000000000..757ff42d30 --- /dev/null +++ b/sources/tech/20200426 6 tips for securing your WordPress website.md @@ -0,0 +1,175 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 tips for securing your WordPress website) +[#]: via: (https://opensource.com/article/20/4/wordpress-security) +[#]: author: (Lucy Carney https://opensource.com/users/lucy-carney) + +6 tips for securing your WordPress website +====== +Even beginners can—and should—take these steps to protect their +WordPress sites against cyberattacks. +![A lock on the side of a building][1] + +Already powering over 30% of the internet, WordPress is the fastest-growing content management system (CMS) in the world—and it's not hard to see why. With tons of customization available through coding and plugins, top-notch SEO, and a supreme reputation for blogging, WordPress has certainly earned its popularity. + +However, with popularity comes other, less appealing attention. WordPress is a common target for intruders, malware, and cyberattacks—in fact, WordPress accounted for around [90% of hacked CMS platforms][2] in 2019. + +Whether you're a first-time WordPress user or an experienced developer, there are important steps you can take to protect your WordPress website. The following six key tips will get you started. + +### 1\. Choose reliable hosting + +Hosting is the unseen foundation of all websites—without it, you can't publish your site online. But hosting does much more than simply host your site. It's also responsible for site speed, performance, and security. + +The first thing to do is to check if a host includes SSL security in its plans. + +SSL is an essential security feature for all websites, whether you're running a small blog or a large online store. You'll need a more [advanced SSL certificate][3] if you're accepting payments, but for most sites, the basic free SSL should be fine. + +Other security features to look out for include: + + * Frequent, automatic offsite backups + * Malware and antivirus scanning and removal + * Distributed denial of service (DDoS) protection + * Real-time network monitoring + * Advanced firewall protection + + + +In addition to these digital security features, it's worth thinking about your hosting provider's _physical_ security measures as well. These include limiting access to data centers with security guards, CCTV, and two-factor or biometric authentication. + +### 2\. Use security plugins + +One of the best—and easiest—ways of protecting your website's security is to install a security plugin, such as [Sucuri][4], which is an open source, GPLv2 licensed project. Security plugins are vitally important because they automate security, which means you can focus on running your site rather than committing all your time to fighting off online threats. + +These plugins detect and block malicious attacks and alert you about any issues that require your attention. In short, they constantly work in the background to protect your site, meaning you don't have to stay awake 24/7 to fight off hackers, bugs, and other digital nasties. + +A good security plugin will provide all the essential security features you need for free, but some advanced features require a paid subscription. For example, you'll need to pay if you want to unlock [Sucuri's website firewall][5]. Enabling a web application firewall (WAF) blocks common threats and adds an extra layer of security to your site, so it's a good idea to look for this feature when choosing a security plugin. + +### 3\. Choose trustworthy plugins and themes + +The joy of WordPress is that it is open source, so anyone and everyone can pitch in with themes and plugins that they've developed. This can also pose problems when it comes to picking a high-quality theme or plugin. + +It serves to be cautious when picking a free theme or plugin, as some are poorly designed—or worse, may hide malicious code. + +To avoid this, always source free themes and plugins from reputable sources, such as the WordPress library. Always read reviews and research the developer to see if they've built any other programs. + +Outdated or poorly designed themes and plugins can leave "backdoors" open for attackers or bugs to get into your site, which is why it pays to be careful in your choices. However, you should also be wary of nulled or cracked themes. These are premium themes that have been compromised by hackers and are for sale illegally. You might buy a nulled theme believing that it's all above-board—only to have your site damaged by hidden malicious code. + +To avoid nulled themes, don't get drawn in by discounted prices, and always stick to reputable stores, such as the official [WordPress directory][6]. If you're looking elsewhere, stick to large and trusted stores, such as [Themify][7], a theme and plugin store that has been running since 2010. Themify ensures all its WordPress themes pass the [Google Mobile-Friendly][8] test and are open source under the [GNU General Public License][9]. + +### 4\. Run regular updates + +It's a fundamental WordPress rule: _always keep your site up to date._ However, it's a rule not everyone sticks to—in fact, only [43% of WordPress sites][10] are running the latest version. + +The problem is that when your site becomes outdated, it becomes susceptible to glitches, bugs, intrusions, and crashes because it falls behind on security and performance fixes. Outdated sites can't fix bugs the same way as updated sites can, and attackers can tell which sites are outdated. This means they can search for the most vulnerable sites and attack accordingly. + +This is why you should always run your site on the latest version of WordPress. And in order to keep your security at its strongest, you must update your plugins and themes as well as your core WordPress software. + +If you choose a managed WordPress hosting plan, you might find that your provider will check and run updates for you—be clear whether your host offers software _and_ plugin updates. If not, you can install an open source plugin manager, such as the GPLv2-licensed [Easy Updates Manager plugin][11], as an alternative. + +### 5\. Strengthen your logins + +Aside from creating a secure WordPress website through carefully choosing your theme and installing security plugins, you also need to safeguard against unauthorized access through logins. + +#### Password protection + +The first and simplest way to strengthen your login security is to change your password—especially if you're using an [easily guessed phrase][12] such as "123456" or "qwerty." + +Instead, try to use a long passphrase rather than a password, as they are harder to crack. The best way is to use a series of unrelated words strung together that you find easy to remember. + +Here are some other tips: + + * Never reuse passwords + * Don't include obvious words such as family members' names or your favorite football team + * Never share your login details with anyone + * Include capitals and numbers to add complexity to your passphrase + * Don't write down or store your login details anywhere + * Use a [password manager][13] + + + +#### Change your login URL + +It's a good idea to change your default login web address from the standard format: yourdomain.com/wp-admin. This is because hackers know this is the default URL, so you risk brute-force attacks by not changing it. + +To avoid this, change the URL to something different. Use an open source plugin such as the GPLv2-licensed [WPS Hide Login][14] for safe, quick, and easy customization. + +#### Apply two-factor authentication + +For extra protection against unauthorized logins and brute-force attacks, you should add two-factor authentication. This means that even if someone _does_ get access to your login details, they'll need a code that's sent directly to your phone to gain access to your WordPress site's admin. + +Adding two-factor authentication is pretty easy. Simply install yet another plugin—this time, search the WordPress Plugin Directory for "two-factor authentication," and select the plugin you want. One option is [Two Factor][15], a popular GPLv2 licensed project that has over 10,000 active installations. + +#### Limit login attempts + +WordPress tries to be helpful by letting you guess your login details as many times as you like. However, this is also helpful to hackers trying to gain unauthorized access to your WordPress site to release malicious code. + +To combat brute-force attacks, install a plugin that limits login attempts and set how many guesses you want to allow. + +### 6\. Disable file editing + +This isn't such a beginner-friendly step, so don't attempt it unless you're a confident coder—and always back up your site first! + +That said, disabling file editing _is_ an important measure if you're really serious about protecting your WordPress website. If you don't hide your files, it means anyone can edit your theme and plugin code straight from the admin area—which is dangerous if an intruder gets in. + +To deny unauthorized access, go to your **wp-config.php** file and enter: + + +``` +<Files wp-config.php> +order allow,deny +deny from all +</Files> +``` + +Or, to remove the theme and plugin editing options from your WordPress admin area completely, edit your **wp-config.php** file by adding: + + +``` +`define( 'DISALLOW_FILE_EDIT', true );` +``` + +Once you've saved and reloaded the file, the plugin and theme editors will disappear from your menus within the WordPress admin area, stopping anyone from editing your theme or plugin code—including you**.** Should you need to restore access to your theme and plugin code, just delete the code you added to your **wp-config.php** file when you disabled editing. + +Whether you block unauthorized access or totally disable file editing, it's important to take action to protect your site's code. Otherwise, it's easy for unwelcome visitors to edit your files and add new code. This means an attacker could use the editor to gather data from your WordPress site or even use your site to launch attacks on others. + +For an easier way of hiding your files, you can use a security plugin that will do it for you, such as Sucuri. + +### WordPress security recap + +WordPress is an excellent open source platform that should be enjoyed by beginners and developers alike without the fear of becoming a victim of an attack. Sadly, these threats aren't going anywhere anytime soon, so it's vital to stay on top of your site's security. + +Using the measures outlined above, you can create a stronger, more secure level of protection for your WordPress site and ensure a much more enjoyable experience for yourself. + +Staying secure is an ongoing commitment rather than a one-time checklist, so be sure to revisit these steps regularly and stay alert when building and using your CMS. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/wordpress-security + +作者:[Lucy Carney][a] +选题:[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/lucy-carney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_3reasons.png?itok=k6F3-BqA (A lock on the side of a building) +[2]: https://cyberforces.com/en/wordpress-most-hacked-cms +[3]: https://opensource.com/article/19/11/internet-security-tls-ssl-certificate-authority +[4]: https://wordpress.org/plugins/sucuri-scanner/ +[5]: https://sucuri.net/website-firewall/ +[6]: https://wordpress.org/themes/ +[7]: https://themify.me/ +[8]: https://developers.google.com/search/mobile-sites/ +[9]: http://www.gnu.org/licenses/gpl.html +[10]: https://wordpress.org/about/stats/ +[11]: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/ +[12]: https://www.forbes.com/sites/kateoflahertyuk/2019/04/21/these-are-the-worlds-most-hacked-passwords-is-yours-on-the-list/#4f157c2f289c +[13]: https://opensource.com/article/16/12/password-managers +[14]: https://wordpress.org/plugins/wps-hide-login/ +[15]: https://en-gb.wordpress.org/plugins/two-factor/ From 06ff74321accae13a94eec3af4a27783f98c2815 Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Tue, 28 Apr 2020 08:37:54 +0800 Subject: [PATCH 0484/1809] translating --- .../20200424 16 Things to do After Installing Ubuntu 20.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {sources => source}/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md (99%) diff --git a/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md b/source/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md similarity index 99% rename from sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md rename to source/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md index cca31a0426..5637651850 100644 --- a/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md +++ b/source/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qfzy1233) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f624b93b436b8df0d8ca53185d38c9cd9e44faa5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 28 Apr 2020 08:43:08 +0800 Subject: [PATCH 0485/1809] translated --- ...v5- Why there is IPv4, IPv6 but no IPv5.md | 76 ------------------- ...v5- Why there is IPv4, IPv6 but no IPv5.md | 76 +++++++++++++++++++ 2 files changed, 76 insertions(+), 76 deletions(-) delete mode 100644 sources/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md create mode 100644 translated/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md diff --git a/sources/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md b/sources/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md deleted file mode 100644 index 4934186f76..0000000000 --- a/sources/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md +++ /dev/null @@ -1,76 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What Happened to IPv5? Why there is IPv4, IPv6 but no IPv5?) -[#]: via: (https://itsfoss.com/what-happened-to-ipv5/) -[#]: author: (John Paul https://itsfoss.com/author/john/) - -What Happened to IPv5? Why there is IPv4, IPv6 but no IPv5? -====== - -If you have spent any amount of time in the world of the internet, you should have heard about the IPv4 and IPv6 protocols that our computers use every day. - -One question that you might be asking is: Why there is no IPv5? Why IPv6 came after IPv4 and not IPv5? Was there ever a IPv5 and if yes, whatever happened to IPv5? - -The answer is yes, there was an IPv5…sort of. Let me quickly explain a few things around it. - -### The early history of the internet - -![ARPA Logical Map in 1977 | Image courtesy: Wikipedia][1] - -In the late 1960s, the US Department of Defense’s [Advanced Research Projects Agency][2] (ARPA) started a [project][3] to link computers across the country. The initial goal was to create a networked system of all of the ARPA-funded computers across the country. - -Since this was the first time a network of this scale was put together, they were also creating the technology and hardware as they went. One of the first things they worked was an internet protocol (IP) named [Transmission Control Protocol][4] (TCP). This protocol “reliable, ordered, and error-checked delivery of a stream of octets (bytes) between applications running on hosts communicating via an IP network”. Basically, it made sure data got where it needed to go safely. - -Originally, TCP was designed to be [“a host-level, end-to-end protocol and a packaging and routing protocol”][5]. However, they realized that they needed to split the protocol to make it more manageable. It was decided that IP would handle packaging and routing. - -By this time TCP had gone through three versions, so the new protocol became known as IPv4. - -### The birth of IPv5 - -IPv5 started life under a different name: Internet Stream Protocol (or ST). It was created to experiment with streaming voice and video [“by Apple, NeXT, and Sun Microsystems”][6]. - -This new protocol was capable of “transferring data packets on specific frequencies while maintaining communication”. - -### So what happened to IPv5? - -![][7] - -IPv5 was never accepted as an official internet protocol. This was mainly due to the 32-bit limitation. - -IPV5 used the same addressing system as IPv4. Each address was made up of four sets of numbers between 0 and 255. This limited the number of possible addresses to [4.3 billion][6]. - -In the early 1970s, that might have seemed like more than the world would ever need. However, the explosive growth of the Internet proved that idea wrong. In 2011, the world officially ran out of the IPv4 addresses. - -In the 1990s, a new project was started to work on the next generation of internet protocol (IPng). This led to the 128-bit IPv6. An IPv6 address contains a [“series of eight 4-character hexadecimal numbers”][6] that can contain numbers from 0 to 9 and letters from A to F. Unlike IPv4, IPv6 had trillions of possible addresses, so we should be safe for a while. - -Meanwhile, IPv5 laid the groundwork for the voice-over-IP technology that we use to communicate all over the world today. **So, I guess in some small way, you could say that IPv5 still survives to this day**. - -I hope you liked this anecdote about internet history. You may read some other [trivia article about Linux and tech in general][8]. - -If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][9]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/what-happened-to-ipv5/ - -作者:[John Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/john/ -[b]: https://github.com/lujun9972 -[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Arpa_internet.png?fit=800%2C573&ssl=1 -[2]: https://en.wikipedia.org/wiki/DARPA -[3]: https://en.wikipedia.org/wiki/ARPANET -[4]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol -[5]: https://fcw.com/articles/2006/07/31/what-ever-happened-to-ipv5.aspx -[6]: https://www.lifewire.com/what-happened-to-ipv5-3971327 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/what-happened-to-ipv5.png?ssl=1 -[8]: https://itsfoss.com/category/story/ -[9]: https://reddit.com/r/linuxusersgroup diff --git a/translated/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md b/translated/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md new file mode 100644 index 0000000000..71bfe2137a --- /dev/null +++ b/translated/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What Happened to IPv5? Why there is IPv4, IPv6 but no IPv5?) +[#]: via: (https://itsfoss.com/what-happened-to-ipv5/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +IPv5 发生了什么?为什么有 IPv4、IPv6 但没有 IPv5? +====== + +如果你花过很多时间在互联网上,那么你应该已经听说过计算机每天使用的 IPv4 和 IPv6 协议。 + +你可能会问的一个问题是:为什么没有 IPv5?为什么 IPv6 在 IPv4 之后而不是 IPv5 之后出现?是否有 IPv5,如果是,那么 IPv5 发生了什么? + +答案是肯定的,曾经有一个 IPv5。让我解释一下这里发生的事。 + +### 互联网的早期历史 + +![ARPA Logical Map in 1977 | Image courtesy: Wikipedia][1] + +在 1960 年代后期,美国国防部的[高级研究计划局][2] (ARPA) 发起了一个[项目][3]来连接全国的计算机。最初的目标是创建一个由全国 ARPA 资助的所有计算机组成的网络系统。 + +由于这是第一次将如此规模的网络整合在一起,因此他们也在不断发展自己的技术和硬件。他们的第一件工作是名为[传输控制协议][4] (TCP) 的互联网协议 (IP)。该协议“可靠、有序、并会对通过 IP 网络传输的八进制(字节)流错误检测”。基本上,它确保数据安全到达。 + +最初,TCP 被设计为[“主机级别的端到端协议以及打包和路由协议”][5]。但是,他们意识到他们需要拆分协议以使其更易于管理。于是决定由 IP 处理打包和路由。 + +那时,TCP 已经经历了三个版本,因此新协议被称为 IPv4。 + +### IPv5 的诞生 + +IPv5 以不同的名称开始使用:互联网流协议(或 ST)。它是[由 Apple、NeXT 和 Sun Microsystems][6] 创建用于实验流式传输语音和视频。 + +该新协议能够“在保持通信的同时在特定频率上传输数据包”。 + +### 那么 IPv5 发生了什么? + +![][7] + +IPv5 从未被接受为正式的互联网协议。这主要是由于 32 位限制。 + +IPV5 使用与 IPv4 相同的寻址系统。每个地址由 0 到 255 之间的四组数字组成。这将可能的地址数量限制为 [43 亿][6]。 + +在 1970 年代初,这似乎比全世界所需要的还要多。但是,互联网的爆炸性增长证明了这一想法是错误的。2011年,世界正式耗尽了 IPv4 地址。 + +在 1990 年代,一个新项目开始致力于下一代互联网协议 (IPng)。这导致了 128 位的 IPv6。IPv6 地址包含 [“8 组 4 字符的十六进制数字”][6],它可以包含从 0 到 9 的数字和从 A 到 F 的字母。与 IPv4 不同,IPv6 拥有数万亿个可能的地址,因此我们应该能安全一阵子。 + +同时,IPv5 奠定了 VoIP 的基础,而该技术已被我们用于当今世界范围内的通信。**因此,我想往小了说,你可以说 IPv5 仍然可以保留到了今天**。 + +希望你喜欢有关互联网历史的轶事。你可以阅读其他[关于 Linux 和技术的琐事文章] [8]。 + +如果你觉得这篇文章有趣,请花一点时间在社交媒体、Hacker News 或 [Reddit][9] 上分享它。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/what-happened-to-ipv5/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Arpa_internet.png?fit=800%2C573&ssl=1 +[2]: https://en.wikipedia.org/wiki/DARPA +[3]: https://en.wikipedia.org/wiki/ARPANET +[4]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol +[5]: https://fcw.com/articles/2006/07/31/what-ever-happened-to-ipv5.aspx +[6]: https://www.lifewire.com/what-happened-to-ipv5-3971327 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/what-happened-to-ipv5.png?ssl=1 +[8]: https://itsfoss.com/category/story/ +[9]: https://reddit.com/r/linuxusersgroup From ad862bdb1dcffac6e1a97fe6bc5d4939992d7ed8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 28 Apr 2020 08:50:47 +0800 Subject: [PATCH 0486/1809] translating --- ...ing Pixel Art With Free and Open Source Editor Pixelorama.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md b/sources/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md index fc3c4b7bab..b4b0949dab 100644 --- a/sources/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md +++ b/sources/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 78f8d77d2f68681f6d686c3c2a150d6dddae0ec9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Apr 2020 09:43:46 +0800 Subject: [PATCH 0487/1809] PRF @geekpi --- ...ings You Should Know About Ubuntu 20.04.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/translated/tech/20200422 Things You Should Know About Ubuntu 20.04.md b/translated/tech/20200422 Things You Should Know About Ubuntu 20.04.md index 30a3049bfe..c6679159bf 100644 --- a/translated/tech/20200422 Things You Should Know About Ubuntu 20.04.md +++ b/translated/tech/20200422 Things You Should Know About Ubuntu 20.04.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Things You Should Know About Ubuntu 20.04) @@ -10,13 +10,11 @@ 关于 Ubuntu 20.04 你应该了解的事情 ====== -[Ubuntu 20.04][1] 即将发布,你可能对升级、安装等有一些问题和疑问。 +[Ubuntu 20.04][1] 已经发布,你可能对升级、安装等有一些问题和疑问。 -我在各种社交媒体渠道上主持了一些问答环节,回答像你这样的读者的疑虑。 +我在各种社交媒体渠道上主持了一些问答环节,回答像你这样的读者的疑虑。我将列出这些关于 Ubuntu 20.04 的常见问题,并给出答案。我希望它能帮助你消除你的疑虑。如果你仍有问题,请随时在下面的评论栏提问。 -我将列出这些关于Ubuntu 20.04的常见问题,并给出答案。我希望它能帮助你消除你的疑虑。如果你仍有问题,请随时在下面的评论栏提问。 - -### Ubuntu 20.04: 已回复的问题 +### Ubuntu 20.04:已回复的问题 ![][2] @@ -28,25 +26,25 @@ Ubuntu 20.04 LTS 于 2020 年 4 月 23 日发布。所有变种,如 Kubuntu、 #### Ubuntu 20.04 的系统要求是什么? -对于默认的 GNOME 版本,应至少具有 4GB 的内存、2 GHz 双核处理器和至少 25GB 的磁盘空间。 +对于默认的 GNOME 版本,应至少具有 4GB 的内存、2GHz 双核处理器和至少 25GB 的磁盘空间。 其他 [Ubuntu 变种][3]可能有不同的系统要求。 #### 我可以在 32 位系统上使用 Ubuntu 20.04 吗? -完全不行。你不能在 32 位系统上使用 Ubuntu 20.04。即使你使用的是 32 位 Ubuntu 18.04,也不能升级到 Ubuntu 20.04。过去几年有 32 位的系统 ISO。 +完全不行。你不能在 32 位系统上使用 Ubuntu 20.04。即使你使用的是 32 位 Ubuntu 18.04,也不能升级到 Ubuntu 20.04。32 位的系统 ISO 是以前用的。 ![Error while upgrading 32-bit Ubuntu 18.04 to Ubuntu 20.04][4] -#### 我可以在Ubuntu 20.04上使用 Wine 吗? +#### 我可以在 Ubuntu 20.04 上使用 Wine 吗? -是的,你仍然可以在 Ubuntu 20.04 上使用 Wine,因为仍然有 32 位库,来用于 Wine 和 [Steam Play][5] 所需的软件包。 +是的,你仍然可以在 Ubuntu 20.04 上使用 Wine,因为仍然用于 Wine 和 [Steam Play][5] 软件包所需的 32 位库。 #### 我需要购买 Ubuntu 20.04 或许可证? -不,Ubuntu 是完全免费使用的。你不必像在 Windows 中那样购买许可证密钥或激活 Ubuntu。 +不,Ubuntu 完全可以免费使用。你不必像在 Windows 中那样购买许可证密钥或激活 Ubuntu。 -Ubuntu 的下载页会请求你捐赠一些资金,如果你想捐赠一些钱来帮助开发这个系统,这完全取决于你。 +Ubuntu 的下载页会请求你捐赠一些资金,如果你想为开发这个强大的操作系统捐钱,由你自己决定。 #### GNOME 版本是什么? @@ -54,21 +52,23 @@ Ubuntu 20.04 有 GNOME 3.36。 #### Ubuntu 20.04 的性能是否优于 Ubuntu 18.04? -是的,在几个方面。Ubuntu 20.04 安装速度更快,甚至加速更快。我在 4:40 的视频中展示了性能比较。 +是的,在几个方面。Ubuntu 20.04 系统速度更快,甚至超快。我在下面这个视频的 4:40 处展示了性能对比。 -在 GNOME 3.36 中,滚动、窗口动画和其他 UI 元素更加流畅,并提供了更流畅的体验。 +- [video](https://img.linux.net.cn/static/video/Top%207%20Best%20Features%20You%27ll%20Love%20in%20Ubuntu%2020.04-lpq8pm_xkSE.mp4) + +在 GNOME 3.36 中,滚动、窗口动画和其他 UI 元素更加流畅,提供了更流畅的体验。 #### Ubuntu 20.04 将支持多长时间? -它是一个长期支持 (LTS) 版本,与任何 LTS 版本一样,它将在五年内得到支持。这意味着 Ubuntu 20.04 将在 2025 年 4 月之前获得安全和维护更新。 +它是一个长期支持(LTS)版本,与任何 LTS 版本一样,它将在五年内得到支持。这意味着 Ubuntu 20.04 将在 2025 年 4 月之前获得安全和维护更新。 #### 升级到 Ubuntu 20.04 时,是否会丢失数据? -你可以从 Ubuntu 19.10 或 Ubuntu 18.04 升级到 Ubuntu 20.04。你无需创建 live USB 并从中安装。你所需要的是一个良好的互联网连接,来下载约1.5GB 的数据。 +你可以从 Ubuntu 19.10 或 Ubuntu 18.04 升级到 Ubuntu 20.04。你无需创建 live USB 并从中安装。你所需要的是一个良好的互联网连接,来下载约 1.5GB 的数据。 -从现有系统升级不会破坏你的文件。你应该会有所有文件,并且大多数现有软件应具有相同的版本或升级后的版本。 +从现有系统升级不会破坏你的文件。你应该会留有所有文件,并且大多数现有软件应具有相同的版本或升级后的版本。 -如果你使用了某些第三方工具或[其他 PPA][6],升级过程将禁用它们。如果 Ubuntu 20.04 适合这些其他存储库,那么可以再次启用它们。 +如果你使用了某些第三方工具或[其他 PPA][6],升级过程将禁用它们。如果 Ubuntu 20.04 可以使用这些其他存储库,那么可以再次启用它们。 升级大约需要一个小时,重启后,你将登录到新版本。 @@ -78,21 +78,21 @@ Ubuntu 20.04 有 GNOME 3.36。 ![][7] -如果你正在使用 Ubuntu 19.10 并有正确的更新设置(如前面部分所述),那么应在 Ubuntu 18.04 后的几天内通知你升级到 Ubuntu 20.04。 +如果你正在使用 Ubuntu 19.10 并有正确的更新设置(如前面部分所述),那么应在发布后的几天内通知你升级到 Ubuntu 20.04。 -对于 Ubuntu 18.04 用户,可能需要几周时间才能正式通知他们 Ubuntu 18.04 可用。可能,你可能会在第一个点版本 Ubuntu 20.04.1 后获得提示。 +对于 Ubuntu 18.04 用户,可能需要几周时间才能正式通知他们 Ubuntu 20.04 可用。可能,你可能会在第一个点版本 Ubuntu 20.04.1 后获得提示。 #### 如果我升级到 Ubuntu 20.04,我可以降级到 19.10 或 18.04 吗? -不行。虽然升级到新版本很容易,但无法选择降级。 如果你想回到 Ubuntu 18.04,你将重新[安装 Ubuntu18.04][8]。 +不行。虽然升级到新版本很容易,但无法选择降级。如果你想回到 Ubuntu 18.04,你需要重新[安装 Ubuntu 18.04][8]。 #### 我使用的是 Ubuntu 18.04 LTS。我应该升级到 Ubuntu 20.04 LTS 吗? 这取决于你。如果你对 Ubuntu 20.04 中的新功能印象深刻,并希望上手尝试,那么你应该升级。 -如果你想要一个更稳定的系统,我建议等待第一个点版本 Ubuntu 20.04.1,新版本将有 bug 修复。20.04.1 通常在 Ubuntu 20.04 发布后大约两个月到来。 +如果你想要一个更稳定的系统,我建议等待第一个点版本 Ubuntu 20.04.1,新版本会有 bug 修复。20.04.1 通常在 Ubuntu 20.04 发布后大约两个月到来。 -其他情况下,我建议尽早升级到 Ubuntu 20.04。Ubuntu 20.04 具有更新的内核、性能改进,尤其是仓库中有更新版本的软件。 +无论是那种情况,我都建议你或早或晚升级到 Ubuntu 20.04。Ubuntu 20.04 具有更新的内核、性能改进,尤其是仓库中有更新版本的软件。 在外部磁盘上进行备份,并且有良好的互联网连接,升级不应成为问题。 @@ -113,13 +113,13 @@ via: https://itsfoss.com/ubuntu-20-04-faq/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://itsfoss.com/author/abhishek/ [b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/ubuntu-20-04-release-features/ +[1]: https://linux.cn/article-12142-1.html [2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu_20_04_faq.jpg?ssl=1 [3]: https://itsfoss.com/which-ubuntu-install/ [4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-32-bit.jpg?ssl=1 From 6cb125fc9c54e0bfe75b5484b68ea65eb3e4af8b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Apr 2020 09:46:57 +0800 Subject: [PATCH 0488/1809] PUB @geekpi https://linux.cn/article-12158-1.html --- .../20200422 Things You Should Know About Ubuntu 20.04.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200422 Things You Should Know About Ubuntu 20.04.md (98%) diff --git a/translated/tech/20200422 Things You Should Know About Ubuntu 20.04.md b/published/20200422 Things You Should Know About Ubuntu 20.04.md similarity index 98% rename from translated/tech/20200422 Things You Should Know About Ubuntu 20.04.md rename to published/20200422 Things You Should Know About Ubuntu 20.04.md index c6679159bf..a6a56b25f2 100644 --- a/translated/tech/20200422 Things You Should Know About Ubuntu 20.04.md +++ b/published/20200422 Things You Should Know About Ubuntu 20.04.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12158-1.html) [#]: subject: (Things You Should Know About Ubuntu 20.04) [#]: via: (https://itsfoss.com/ubuntu-20-04-faq/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 517d740add3258ab448a75da02d182bc53ab4809 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 28 Apr 2020 14:32:02 +0800 Subject: [PATCH 0489/1809] =?UTF-8?q?Revert=20"=E7=94=B3=E9=A2=86=E5=8E=9F?= =?UTF-8?q?=E6=96=87"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20200424 16 Things to do After Installing Ubuntu 20.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {source => sources}/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md (99%) diff --git a/source/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md b/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md similarity index 99% rename from source/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md rename to sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md index 5637651850..cca31a0426 100644 --- a/source/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md +++ b/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (qfzy1233) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 34e3debb2bc3b4231736bc31b9cb2fa1196cb83f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 28 Apr 2020 14:37:57 +0800 Subject: [PATCH 0490/1809] Rename sources/tech/20200427 DevOps vs. Agile- Do they have anything in common.md to sources/talk/20200427 DevOps vs. Agile- Do they have anything in common.md --- .../20200427 DevOps vs. Agile- Do they have anything in common.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200427 DevOps vs. Agile- Do they have anything in common.md (100%) diff --git a/sources/tech/20200427 DevOps vs. Agile- Do they have anything in common.md b/sources/talk/20200427 DevOps vs. Agile- Do they have anything in common.md similarity index 100% rename from sources/tech/20200427 DevOps vs. Agile- Do they have anything in common.md rename to sources/talk/20200427 DevOps vs. Agile- Do they have anything in common.md From 4c5f404a98520faada11aed9869662a07163d4b6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 28 Apr 2020 14:43:44 +0800 Subject: [PATCH 0491/1809] Rename sources/tech/20200427 Comparing subscription, pay-per-bug, and consulting software business models.md to sources/talk/20200427 Comparing subscription, pay-per-bug, and consulting software business models.md --- ...ption, pay-per-bug, and consulting software business models.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200427 Comparing subscription, pay-per-bug, and consulting software business models.md (100%) diff --git a/sources/tech/20200427 Comparing subscription, pay-per-bug, and consulting software business models.md b/sources/talk/20200427 Comparing subscription, pay-per-bug, and consulting software business models.md similarity index 100% rename from sources/tech/20200427 Comparing subscription, pay-per-bug, and consulting software business models.md rename to sources/talk/20200427 Comparing subscription, pay-per-bug, and consulting software business models.md From 1f19b90198533641d6525b26574c628c2f5e2f85 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Apr 2020 15:17:31 +0800 Subject: [PATCH 0492/1809] APL --- .../20200421 Using Python to visualize COVID-19 projections.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200421 Using Python to visualize COVID-19 projections.md b/sources/tech/20200421 Using Python to visualize COVID-19 projections.md index 96fcb61521..a1ff4658fb 100644 --- a/sources/tech/20200421 Using Python to visualize COVID-19 projections.md +++ b/sources/tech/20200421 Using Python to visualize COVID-19 projections.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ff377d7295dedd255ef591344db484c003e53208 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Apr 2020 17:15:17 +0800 Subject: [PATCH 0493/1809] TSL --- ...ython to visualize COVID-19 projections.md | 255 ------------------ ...ython to visualize COVID-19 projections.md | 239 ++++++++++++++++ 2 files changed, 239 insertions(+), 255 deletions(-) delete mode 100644 sources/tech/20200421 Using Python to visualize COVID-19 projections.md create mode 100644 translated/tech/20200421 Using Python to visualize COVID-19 projections.md diff --git a/sources/tech/20200421 Using Python to visualize COVID-19 projections.md b/sources/tech/20200421 Using Python to visualize COVID-19 projections.md deleted file mode 100644 index a1ff4658fb..0000000000 --- a/sources/tech/20200421 Using Python to visualize COVID-19 projections.md +++ /dev/null @@ -1,255 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using Python to visualize COVID-19 projections) -[#]: via: (https://opensource.com/article/20/4/python-data-covid-19) -[#]: author: (AnuragGupta https://opensource.com/users/999anuraggupta) - -Using Python to visualize COVID-19 projections -====== -I'll demonstrate how to create two visualizations of the spread of a -virus across the globe, provided open data and using open source -libraries. -![Colorful sound wave graph][1] - -Using [Python][2] and some graphing libraries, you can project the total number of confirmed cases of COVID-19, and also display the total number of deaths for a country (this article uses India as an example) on a given date. Humans sometimes need help interpreting and processing the meaning of data, so this article also demonstrates how to create an animated horizontal bar graph for five countries, showing the variation of cases by date. - -### Projecting confirmed cases and deaths for India - -This is done in three steps. - -#### 1\. Download data - -Scientific data isn't always open, but fortunately, many modern science and healthcare organizations are eager to share information with each other and the public. Data about COVID-19 cases is available online, and it's updated frequently. - -To parse the data, you first must download it:  - -Load the data directly into a Pandas DataFrame. Pandas provides a function, **read_csv()**, which can take a URL and give back a DataFrame object, as shown below: - - -``` -import pycountry -import plotly.express as px -import pandas as pd -URL_DATASET = r'' -df1 = pd.read_csv(URL_DATASET) -print(df1.head(3))  # Get first 3 entries in the dataframe -print(df1.tail(3))  # Get last 3 entries in the dataframe -``` - -The top row of the data set contains column names: - - 1. Date - 2. Country - 3. Confirmed - 4. Recovered - 5. Deaths - - - -The output of the **head** query includes a unique identifier (not listed as a column) plus an entry for each column: - - -``` -0 2020-01-22 Afghanistan 0 0 0 -1 2020-01-22 Albania 0 0 0 -1 2020-01-22 Algeria 0 0 0 -``` - -The output of the **tail** query is similar but contains the tail end of the data set: - - -``` -12597 2020-03-31 West Bank and Gaza 119 18 1 -12598 2020-03-31 Zambia 35 0 0 -12599 2020-03-31 Zimbabwe 8 0 1 -``` - -From the output, you can see that the DataFrame (**df1**) has the following columns: - - 1. Date - 2. Country - 3. Confirmed - 4. Recovered - 5. Dead - - - -Further, you can see that the **Date** column has entries starting from January 22 to March 31. This database is updated daily, so you will have current values. - -#### 2\. Select data for India - -In this step, we will select only those rows in the DataFrame that include India. This is shown in the script below: - - -``` -#### ----- Step 2 (Select data for India)---- -df_india = df1[df1['Country'] == 'India'] -print(df_india.head(3)) -``` - -#### 3\. Plot data - -Here we create a bar chart. We will put the dates on the X-axis and the number of confirmed cases and the number of deaths on the Y-axis. There are a few noteworthy things about this part of the script which are as follows: - - * The line of code: **plt.rcParams["_figure.figsize"_]=20,20** is meant only for Jupyter. So remove it if you are using some other IDE. - - * Notice the line of code: **ax1 = plt.gca()**. To ensure that both the plots i.e. for confirmed cases as well as for deaths are plotted on the same graph, we need to give to the second graph the **ax** object of the plot. So we use **gca()** to do this. (By the way, 'gca' stands for 'get current axis'). - - - - -The complete script is given below: - - -``` -#  Author:- Anurag Gupta # email:- [999.anuraggupta@gmail.com][3] -%matplotlib inline -import matplotlib.pyplot as plt -import pandas as pd - -#### ----- Step 1 (Download data)---- -URL_DATASET = r'' -df1 = pd.read_csv(URL_DATASET) -# print(df1.head(3))  # Uncomment to see the dataframe - -#### ----- Step 2 (Select data for India)---- -df_india = df1[df1['Country'] == 'India'] -print(df_india.head(3)) - -#### ----- Step 3 (Plot data)---- -# Increase size of plot -plt.rcParams["figure.figsize"]=20,20  # Remove if not on Jupyter -# Plot column 'Confirmed' -df_india.plot(kind = 'bar', x = 'Date', y = 'Confirmed', color = 'blue') - -ax1 = plt.gca() -df_india.plot(kind = 'bar', x = 'Date', y = 'Deaths', color = 'red', ax = ax1) -plt.show() -``` - -The entire script is [available on GitHub][4]. - -### Creating an animated horizontal bar graph for five countries - -Note for Jupyter: To run this in Jupyter as a dynamic animation rather than as a static png, you need to add a magic command at the beginning of your cell, namely: **%matplotlib notebook**. This will keep the figure alive instead of displaying a static png file and can hence also show animations. If you are on another IDE, remove this line. - -#### 1\. Download the data - -This step is exactly the same as in the previous script, and therefore, it need not be repeated. - -#### 2\. Create a list of all dates - -If you examine the data you downloaded, you notice that it has a column **Date**. Now, this column has a date value for each country. So the same date is occurring a number of times. We need to create a list of dates with only unique values. This will be used on the X-axis of our bar charts. We have a line of code like: **list_dates = df[_‘Date’_].unique()**. The **unique()** method will pick up only the unique values for each date. - -#### 3\. Pick five countries and create an **ax** object - -Take a list of five countries. (You can choose whatever countries you prefer, or even increase or decrease the number of countries). I have also taken a list of five colors for the bars of each country. (You can change this too if you like). One important line of code here is: **fig, ax = plt.subplots(figsize=(15, 8))**. This is needed to create an **ax** object. - -#### 4\. Write the call back function - -If you want to do animation in Matplotlib, you need to create an object of a class called **matplotlib.animation.FuncAnimation**. The signature of this class is available online. The constructor of this class, apart from other parameters, also takes a parameter called **func**, and you have to give this parameter a callback function. So in this step, we will write the callback function, which is repeatedly called in order to render the animation. - -#### 5\. Create **FuncAnimation** object - -This step has partly been explained in the previous step. - -Our code to create an object of this class is: - - -``` -my_anim = animation.FuncAnimation(fig = fig, func = plot_bar, -                    frames= list_dates, blit=True, -                    interval=20) -``` - -The three important parameters to be given are: - - * **fig**, which must be given a fig object, which we created earlier. - * **func**, which must be the call back function. - * **frames**, which must contain the variable on which the animation is to be done. Here in our case, it will be the list of dates we created earlier. - - - -#### 6\. Save the animation to an mp4 file - -You can save the animation created into an mp4 file. But for this you need **ffmpeg**. You can download this using pip by **pip install ffmpeg-python**, or using conda (on Jupyter) **install -c conda-forge ffmpeg**. - -And finally, you can run the animation using **plt.show()**. Please note that on many platforms, the **ffmpeg** may not work properly and may require further "tweaking." - - -``` -%matplotlib notebook -#  Author:- Anurag Gupta # email:- [999.anuraggupta@gmail.com][3] -import pandas as pd -import matplotlib.pyplot as plt -import matplotlib.animation as animation -from time import sleep - -#### ---- Step 1:- Download data -URL_DATASET = r'' -df = pd.read_csv(URL_DATASET, usecols = ['Date', 'Country', 'Confirmed']) -# print(df.head(3)) # uncomment this to see output - -#### ---- Step 2:- Create list of all dates -list_dates = df['Date'].unique() -# print(list_dates) # Uncomment to see the dates - -#### --- Step 3:- Pick 5 countries. Also create ax object -fig, ax = plt.subplots(figsize=(15, 8)) -# We will animate for these 5 countries only -list_countries = ['India', 'China', 'US', 'Italy', 'Spain'] -# colors for the 5 horizontal bars -list_colors = ['black', 'red', 'green', 'blue', 'yellow'] - -### --- Step 4:- Write the call back function -# plot_bar() is the call back function used in FuncAnimation class object -def plot_bar(some_date): -    df2 = df[df['Date'].eq(some_date)] -    ax.clear() -    # Only take Confirmed column in descending order -    df3 = df2.sort_values(by = 'Confirmed', ascending = False) -    # Select the top 5 Confirmed countries -    df4 = df3[df3['Country'].isin(list_countries)] -    # print(df4)  # Uncomment to see that dat is only for 5 countries -    sleep(0.2)  # To slow down the animation -    # ax.barh() makes a horizontal bar plot. -    return ax.barh(df4['Country'], df4['Confirmed'], color= list_colors) - -###----Step 5:- Create FuncAnimation object--------- -my_anim = animation.FuncAnimation(fig = fig, func = plot_bar, -                    frames= list_dates, blit=True, -                    interval=20) - -### --- Step 6:- Save the animation to an mp4 -# Place where to save the mp4. Give your file path instead -path_mp4 = r'C:\Python-articles\population_covid2.mp4'   -# my_anim.save(path_mp4, fps=30, extra_args=['-vcodec', 'libx264']) -my_anim.save(filename = path_mp4, writer = 'ffmpeg', -             fps=30, -             extra_args= ['-vcodec', 'libx264', '-pix_fmt', 'yuv420p']) -plt.show() -``` - -The complete script is [available on GitHub][5]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/python-data-covid-19 - -作者:[AnuragGupta][a] -选题:[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/999anuraggupta -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/colorful_sound_wave.png?itok=jlUJG0bM (Colorful sound wave graph) -[2]: https://opensource.com/resources/python -[3]: mailto:999.anuraggupta@gmail.com -[4]: https://raw.githubusercontent.com/ag999git/jupyter_notebooks/master/corona_bar_india -[5]: https://raw.githubusercontent.com/ag999git/jupyter_notebooks/master/corona_bar_animated diff --git a/translated/tech/20200421 Using Python to visualize COVID-19 projections.md b/translated/tech/20200421 Using Python to visualize COVID-19 projections.md new file mode 100644 index 0000000000..3768686e8c --- /dev/null +++ b/translated/tech/20200421 Using Python to visualize COVID-19 projections.md @@ -0,0 +1,239 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Python to visualize COVID-19 projections) +[#]: via: (https://opensource.com/article/20/4/python-data-covid-19) +[#]: author: (AnuragGupta https://opensource.com/users/999anuraggupta) + +使用 Python 来可视化 COVID-19 预测 +====== + +> 我将演示如何使用开源库利用提供的全球病毒传播的开放数据来创建两个可视效果。 + +![Colorful sound wave graph][1] + +使用 [Python][2] 和一些图形库,你可以预测出 COVID-19 确诊病例的总数,也可以显示一个国家(本文以印度为例)在给定日期的死亡总数。人们有时需要帮助解释和处理数据的意义,所以本文还演示了如何为五个国家创建一个动画横条形图,以显示按日期显示病例的变化。 + +### 印度的确诊病例和死亡人数预测 + +这要分三步来完成。 + +#### 1、下载数据 + +科学数据并不总是开放的,但幸运的是,许多现代科学和医疗机构都乐于相互之间及与公众共享信息。关于 COVID-19 病例的数据可以在网上查到,并且经常更新。 + +要解析这些数据,首先必须先下载。 。 + +直接将数据加载到 Pandas `DataFrame` 中。Pandas 提供了一个函数 `read_csv()`,它可以获取一个 URL 并返回一个 `DataFrame` 对象,如下所示。 + + +``` +import pycountry +import plotly.express as px +import pandas as pd +URL_DATASET = r'https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv' +df1 = pd.read_csv(URL_DATASET) +print(df1.head(3)) # 获取数据帧中的前 3 项 +print(df1.tail(3)) # 获取数据帧中的后 3 项 +``` + +数据集的顶行包含列名。 + +1. `Date` +2. `Country` +3. `Confirmed` +4. `Recovered` +5. `Deaths` + +`head` 查询的输出包括一个唯一的标识符(不作为列列出)和每个列的条目。 + +``` +0 2020-01-22 Afghanistan 0 0 0 +1 2020-01-22 Albania 0 0 0 +1 2020-01-22 Algeria 0 0 0 +``` + +`tail` 查询的输出类似,但包含数据集的尾端。 + +``` +12597 2020-03-31 West Bank and Gaza 119 18 1 +12598 2020-03-31 Zambia 35 0 0 +12599 2020-03-31 Zimbabwe 8 0 1 +``` + +从输出中,可以看到 DataFrame(`df1`)有以下几个列: + +1. 日期 +2. 国家 +3. 确诊 +4. 康复 +5. 死亡 + +此外,你可以看到 `Date` 栏中的条目从 1 月 22 日开始到 3 月 31 日。这个数据库每天都会更新,所以你会有当前的值。 + +#### 2、选择印度的数据 + +在这一步中,我们将只选择 DataFrame 中包含印度的那些行。这在下面的脚本中可以看到。 + +``` +#### ----- Step 2 (Select data for India)---- +df_india = df1[df1['Country'] == 'India'] +print(df_india.head(3)) +``` + +#### 3、数据绘图 + +在这里,我们创建一个条形图。我们将把日期放在 X 轴上,把确诊的病例数和死亡人数放在 Y 轴上。这一部分的脚本有以下几个值得注意的地方。 + + * `plt.rcParams["_figure.figure.figsize"_]=20,20` 这一行代码只适用于 Jupyter。所以如果你使用其他 IDE,请删除它。 + * 注意这行代码:`ax1 = plt.gca()`。为了确保两个图,即确诊病例和死亡病例的图都被绘制在同一个图上,我们需要给第二个图的 `ax` 对象。所以我们使用 `gca()` 来完成这个任务。(顺便说一下,`gca` 代表“get current axis”) + +完整的脚本如下所示。 + +``` +# Author:- Anurag Gupta # email:- 999.anuraggupta@gmail.com +%matplotlib inline +import matplotlib.pyplot as plt +import pandas as pd + +#### ----- Step 1 (Download data)---- +URL_DATASET = r'https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv' +df1 = pd.read_csv(URL_DATASET) +# print(df1.head(3)) # Uncomment to see the dataframe + +#### ----- Step 2 (Select data for India)---- +df_india = df1[df1['Country'] == 'India'] +print(df_india.head(3)) + +#### ----- Step 3 (Plot data)---- +# Increase size of plot +plt.rcParams["figure.figsize"]=20,20 # Remove if not on Jupyter +# Plot column 'Confirmed' +df_india.plot(kind = 'bar', x = 'Date', y = 'Confirmed', color = 'blue') + +ax1 = plt.gca() +df_india.plot(kind = 'bar', x = 'Date', y = 'Deaths', color = 'red', ax = ax1) +plt.show() +``` + +整个脚本[可在 GitHub 上找到][4]。 + +#### 为五个国家创建一个动画水平条形图 + +关于 Jupyter 的注意事项:要在 Jupyter 中以动态动画的形式运行,而不是静态 png 的形式,你需要在单元格的开头添加一个神奇的命令,即: `%matplotlib notebook`。这将使图形保持动态,而不是显示静态的 png 文件,因此也可以显示动画。如果你在其他 IDE 上,请删除这一行。 + +#### 1、下载数据 + +这一步和前面的脚本完全一样,所以不需要重复。 + +#### 2、创建一个所有日期的列表 + +如果你检查你下载的数据,你会发现它有一列 `Date`。现在,这一列对每个国家都有一个日期值。因此,同一个日期会出现多次。我们需要创建一个只具有唯一值的日期列表。这会用在我们条形图的 X 轴上。我们有一行代码,如 `list_dates = df[_'Date'_].unique()`。`unique()` 方法将只提取每个日期的唯一值。 + +#### 3、挑选五个国家并创建一个 `ax` 对象。 + +做一个五个国家的名单。(你可以选择你喜欢的国家,甚至可以增加或减少国家的数量。)我也做了一个五个颜色的列表,每个国家的条形图的颜色对应一种。(如果你喜欢的话,也可以改一下。)这里有一行重要的代码是:`fig, ax = plt.subplots(figsize=(15, 8))`。这是创建一个 `ax` 对象所需要的。 + +#### 4、编写回调函数 + +如果你想在 Matplotlib 中做动画,你需要创建一个名为 `matplotlib.animation.FuncAnimation` 的类的对象。这个类的签名可以在网上查到。这个类的构造函数,除了其他参数外,还需要一个叫 `func` 的参数,你必须给这个参数一个回调函数。所以在这一步中,我们会写个回调函数,这个回调函数会被反复调用,以渲染动画。 + +#### 5、创建 `FuncAnimation` 对象 + +这一步在上一步中已经部分说明了。 + +我们创建这个类的对象的代码是: + +``` +my_anim = animation.FuncAnimation(fig = fig, func = plot_bar, + frames= list_dates, blit=True, + interval=20) +``` + +要给出的三个重要参数是: + +* `fig`,必须给出一个 fig 对象,也就是我们之前创建的 fig 对象。 +* `func`,必须是回调函数。 +* `frames`,必须包含要做动画的变量。在我们这里,它是我们之前创建的日期列表。 + +#### 6、将动画保存为 mp4 文件 + +你可以将创建的动画保存为 mp4 文件。但是,你需要 `ffmpeg`。你可以用 `pip` 下载:`pip install ffmpeg-python`,或者用 conda(在 Jupyter 上):`install -c conda-forge ffmpeg`。 + +最后,你可以使用 `plt.show()` 运行动画。请注意,在许多平台上,`ffmpeg` 可能无法正常工作,可能需要进一步“调整”。 + +``` +%matplotlib notebook +# Author:- Anurag Gupta # email:- 999.anuraggupta@gmail.com +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.animation as animation +from time import sleep + +#### ---- Step 1:- Download data +URL_DATASET = r'https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv' +df = pd.read_csv(URL_DATASET, usecols = ['Date', 'Country', 'Confirmed']) +# print(df.head(3)) # uncomment this to see output + +#### ---- Step 2:- Create list of all dates +list_dates = df['Date'].unique() +# print(list_dates) # Uncomment to see the dates + +#### --- Step 3:- Pick 5 countries. Also create ax object +fig, ax = plt.subplots(figsize=(15, 8)) +# We will animate for these 5 countries only +list_countries = ['India', 'China', 'US', 'Italy', 'Spain'] +# colors for the 5 horizontal bars +list_colors = ['black', 'red', 'green', 'blue', 'yellow'] + +### --- Step 4:- Write the call back function +# plot_bar() is the call back function used in FuncAnimation class object +def plot_bar(some_date): + df2 = df[df['Date'].eq(some_date)] + ax.clear() + # Only take Confirmed column in descending order + df3 = df2.sort_values(by = 'Confirmed', ascending = False) + # Select the top 5 Confirmed countries + df4 = df3[df3['Country'].isin(list_countries)] + # print(df4) # Uncomment to see that dat is only for 5 countries + sleep(0.2) # To slow down the animation + # ax.barh() makes a horizontal bar plot. + return ax.barh(df4['Country'], df4['Confirmed'], color= list_colors) + +###----Step 5:- Create FuncAnimation object--------- +my_anim = animation.FuncAnimation(fig = fig, func = plot_bar, + frames= list_dates, blit=True, + interval=20) + +### --- Step 6:- Save the animation to an mp4 +# Place where to save the mp4. Give your file path instead +path_mp4 = r'C:\Python-articles\population_covid2.mp4' +# my_anim.save(path_mp4, fps=30, extra_args=['-vcodec', 'libx264']) +my_anim.save(filename = path_mp4, writer = 'ffmpeg', + fps=30, + extra_args= ['-vcodec', 'libx264', '-pix_fmt', 'yuv420p']) +plt.show() +``` + +完整的脚本[可以在 GitHub 上找到][5]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/python-data-covid-19 + +作者:[AnuragGupta][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/999anuraggupta +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/colorful_sound_wave.png?itok=jlUJG0bM (Colorful sound wave graph) +[2]: https://opensource.com/resources/python +[3]: mailto:999.anuraggupta@gmail.com +[4]: https://raw.githubusercontent.com/ag999git/jupyter_notebooks/master/corona_bar_india +[5]: https://raw.githubusercontent.com/ag999git/jupyter_notebooks/master/corona_bar_animated From 0186888ddb45ff748be764b1f41eb9d95fe785bd Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Tue, 28 Apr 2020 21:05:34 +0800 Subject: [PATCH 0494/1809] TSL --- .../20200425 Inlining optimisations in Go.md | 215 ------------------ .../20200425 Inlining optimisations in Go.md | 211 +++++++++++++++++ 2 files changed, 211 insertions(+), 215 deletions(-) delete mode 100644 sources/tech/20200425 Inlining optimisations in Go.md create mode 100644 translated/tech/20200425 Inlining optimisations in Go.md diff --git a/sources/tech/20200425 Inlining optimisations in Go.md b/sources/tech/20200425 Inlining optimisations in Go.md deleted file mode 100644 index 0e29d0d178..0000000000 --- a/sources/tech/20200425 Inlining optimisations in Go.md +++ /dev/null @@ -1,215 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Inlining optimisations in Go) -[#]: via: (https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go) -[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) - -Inlining optimisations in Go -====== - -This is a post about how the Go compiler implements inlining and how this optimisation affects your Go code. - -_n.b._ This article focuses on _gc_, the de facto Go compiler from [golang.org][1]. The concepts discussed apply broadly to other Go compilers like gccgo and llgo but may differ in implementation and efficacy. - -### What is inlining? - -Inlining is the act of combining smaller functions into their respective callers. In the early days of computing this optimisation was typically performed by hand. Nowadays inlining is one of a class of fundamental optimisations performed automatically during the compilation process. - -### Why is inlining important? - -Inlining is important for two reasons. The first is it removes the overhead of the function call itself. The second is it permits the compiler to more effectively apply other optimisation strategies. - -#### Function call overhead - -Calling a function[1][2] in any language carries a cost. There are the overheads of marshalling parameters into registers or onto the stack (depending on the ABI) and reversing the process on return. Invoking a function call involves jumping the program counter from one point in the instruction stream to another which can cause a pipeline stall. Once inside the function there is usually some preamble required to prepare a new stack frame for the function to execute and a similar epilogue needed to retire the frame before returning to the caller. - -In Go a function call carries additional costs to support dynamic stack growth. On entry the amount of stack space available to the goroutine is compared to the amount required for the function. If insufficient stack space is available, the preamble jumps into the runtime logic that grows the stack by copying it to a new, larger, location. Once this is done the runtime jumps back to the start of the original function, the stack check is performed again, which now passes, and the call continues. In this way goroutines can start with a small stack allocation which grows only when needed.[2][3] - -This check is cheap–only a few instructions–and because goroutine stacks grows geometrically the check rarely fails. Thus, the branch prediction unit inside a modern processor can hide the cost of the stack check by assuming it will always be successful. In the case where the processor mis-predicts the stack check and has to discard the work done while it was executing speculatively, the cost of the pipeline stall is relatively small compared to the cost of the work needed for the runtime to grow a goroutines stack. - -While the overhead of the generic and Go specific components of each function call are well optimised by modern processors using speculative execution techniques, those overheads cannot be entirely eliminated, thus each function call carries with it a performance cost over and above the time it takes to perform useful work. As a function call’s overhead is fixed, smaller functions pay a larger cost relative to larger ones because they tend to do less useful work per invocation. - -The solution to eliminating these overheads must therefore be to eliminate the function call itself, which the Go compiler does, under certain conditions, by replacing the call to a function with the contents of the function. This is known as _inlining_ because it brings the body of the function in line with its caller. - -#### Improved optimisation opportunities - -Dr. Cliff Click describes inlining as _the_ optimisation performed by modern compilers as it forms the basis for optimisations like constant proportion and dead code elimination. In effect, inlining allows the compiler to _see_ _furthe_r, allowing it to observe, in the context that a particular function is being called, logic that can be further simplified or eliminated entirely. As inlining can be applied recursively optimisation decisions can be made not only in the context of each individual function, but also applied to the chain of functions in a call path. - -### Inlining in action - -The effects of inlining can be demonstrated with this small example - -``` -package main - -import "testing" - -//go:noinline -func max(a, b int) int { - if a > b { - return a - } - return b -} - -var Result int - -func BenchmarkMax(b *testing.B) { - var r int - for i := 0; i < b.N; i++ { - r = max(-1, i) - } - Result = r -} -``` - -Running this benchmark gives the following result:[3][4] - -``` -% go test -bench=.  -BenchmarkMax-4   530687617         2.24 ns/op -``` - -The cost of `max(-1, i)` is around 2.24 nanoseconds on my 2015 MacBook Air. Now let’s remove the `//go:noinline` pragma and see the result: - -``` -% go test -bench=.  -BenchmarkMax-4   1000000000         0.514 ns/op -``` - -From 2.24 ns to 0.51 ns, or according to `benchstat`, a 78% improvement. - -``` -% benchstat {old,new}.txt -name   old time/op  new time/op  delta -Max-4  2.21ns ± 1%  0.49ns ± 6%  -77.96%  (p=0.000 n=18+19) -``` - -Where did these improvements come from? - -First, the removal of the function call and associated preamble[4][5] was a major contributor. Pulling the contents of `max` into its caller reduced the number of instructions executed by the processor and eliminated several branches. - -Now the contents of `max` are visible to the compiler as it optimises `BenchmarkMax` it can make some additional improvements. Consider that once `max` is inlined, this is what the body of `BenchmarkMax` looks like to the compiler: - -``` -func BenchmarkMax(b *testing.B) { - var r int - for i := 0; i < b.N; i++ { - if -1 > i { - r = -1 - } else { - r = i - } - } - Result = r -} -``` - -Running the benchmark again we see our manually inlined version performs as well as the version inlined by the compiler - -``` -% benchstat {old,new}.txt -name   old time/op  new time/op  delta -Max-4  2.21ns ± 1%  0.48ns ± 3%  -78.14%  (p=0.000 n=18+18) -``` - -Now the compiler has access to the result of inlining `max` into `BenchmarkMax` it can apply optimisation passes which were not possible before. For example, the compiler has noted that `i` is initialised to `0` and only incremented so any comparison with `i` can assume `i` will never be negative. Thus, the condition `-1 > i` will never be true.[5][6] - -Having proved that `-1 > i` will never be true, the compiler can simplify the code to - -``` -func BenchmarkMax(b *testing.B) { - var r int - for i := 0; i < b.N; i++ { - if false { - r = -1 - } else { - r = i - } - } - Result = r -} -``` - -and because the branch is now a constant, the compiler can eliminate the unreachable path leaving it with - -``` -func BenchmarkMax(b *testing.B) { - var r int - for i := 0; i < b.N; i++ { - r = i - } - Result = r -} -``` - -Thus, through inlining and the optimisations it unlocks, the compiler has reduced the expression `r = max(-1, i)` to simply `r = i`. - -### The limits of inlining - -In this article I’ve discussed, so called, _leaf_ inlining; the act of inlining a function at the bottom of a call stack into its direct caller. Inlining is a recursive process, once a function has been inlined into its caller, the compiler may inline the resulting code into _its_ caller, as so on. For example, this code - -``` -func BenchmarkMaxMaxMax(b *testing.B) { - var r int - for i := 0; i < b.N; i++ { - r = max(max(-1, i), max(0, i)) - } - Result = r -} -``` - -runs as fast as the previous example as the compiler is able to repeatedly apply the optimisations outlined above to reduce the code to the same `r = i` expression. - -In the next article I’ll discuss an alternative inlining strategy when the Go compiler wishes to inline a function in the middle of a call stack. Finally I’ll discuss the limits that the compiler is prepared to go to to inline code, and which Go constructs are currently beyond its capability. - - 1. In Go, a method is just a function with a predefined formal parameter, the receiver. The relative costs of calling a free function vs a invoking a method, assuming that method is not called through an interface, are the same.[][7] - 2. Up until Go 1.14 the stack check preamble was also used by the garbage collector to stop the world by setting all active goroutine’s stacks to zero, forcing them to trap into the runtime the next time they made a function call. This system was [recently replaced][8] with a mechanism which allowed the runtime to pause an goroutine without waiting for it to make a function call.[][9] - 3. I’m using the `//go:noinline` pragma to prevent the compiler from inlining `max`. This is because I want to isolate the effects of inlining on `max` rather than disabling optimisations globally with `-gcflags='-l -N'`. I go into detail about the `//go:` comments in [this presentation][10].[][11] - 4. You can check this for yourself by comparing the output of `go test -bench=. -gcflags=-S` with and without the `//go:noinline` annotation.[][12] - 5. You can check this yourself with the `-gcflags=-d=ssa/prove/debug=on` flag.[][13] - - - -#### Related posts: - - 1. [Five things that make Go fast][14] - 2. [Why is a Goroutine’s stack infinite ?][15] - 3. [How to write benchmarks in Go][16] - 4. [Go’s hidden #pragmas][17] - - - --------------------------------------------------------------------------------- - -via: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go - -作者:[Dave Cheney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://dave.cheney.net/author/davecheney -[b]: https://github.com/lujun9972 -[1]: https://github.com/golang/go -[2]: tmp.gBQ2tEtMHc#easy-footnote-bottom-1-4053 (In Go, a method is just a function with a predefined formal parameter, the receiver. The relative costs of calling a free function vs a invoking a method, assuming that method is not called through an interface, are the same.) -[3]: tmp.gBQ2tEtMHc#easy-footnote-bottom-2-4053 (Up until Go 1.14 the stack check preamble was also used by the garbage collector to stop the world by setting all active goroutine’s stacks to zero, forcing them to trap into the runtime the next time they made a function call. This system was recently replaced with a mechanism which allowed the runtime to pause an goroutine without waiting for it to make a function call.) -[4]: tmp.gBQ2tEtMHc#easy-footnote-bottom-3-4053 (I’m using the //go:noinline pragma to prevent the compiler from inlining max. This is because I want to isolate the effects of inlining on max rather than disabling optimisations globally with -gcflags='-l -N'. I go into detail about the //go: comments in this presentation.) -[5]: tmp.gBQ2tEtMHc#easy-footnote-bottom-4-4053 (You can check this for yourself by comparing the output of go test -bench=. -gcflags=-S with and without the //go:noinline annotation.) -[6]: tmp.gBQ2tEtMHc#easy-footnote-bottom-5-4053 (You can check this yourself with the -gcflags=-d=ssa/prove/debug=on flag.) -[7]: tmp.gBQ2tEtMHc#easy-footnote-1-4053 -[8]: https://github.com/golang/proposal/blob/master/design/24543-non-cooperative-preemption.md -[9]: tmp.gBQ2tEtMHc#easy-footnote-2-4053 -[10]: https://dave.cheney.net/2018/01/08/gos-hidden-pragmas -[11]: tmp.gBQ2tEtMHc#easy-footnote-3-4053 -[12]: tmp.gBQ2tEtMHc#easy-footnote-4-4053 -[13]: tmp.gBQ2tEtMHc#easy-footnote-5-4053 -[14]: https://dave.cheney.net/2014/06/07/five-things-that-make-go-fast (Five things that make Go fast) -[15]: https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite (Why is a Goroutine’s stack infinite ?) -[16]: https://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go (How to write benchmarks in Go) -[17]: https://dave.cheney.net/2018/01/08/gos-hidden-pragmas (Go’s hidden #pragmas) diff --git a/translated/tech/20200425 Inlining optimisations in Go.md b/translated/tech/20200425 Inlining optimisations in Go.md new file mode 100644 index 0000000000..80f86ae47e --- /dev/null +++ b/translated/tech/20200425 Inlining optimisations in Go.md @@ -0,0 +1,211 @@ +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Inlining optimisations in Go) +[#]: via: (https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Go 中的内联优化 +====== + +本文讨论 Go 编译器是如何实现内联的以及这种优化方法如何影响你的 Go 代码。 + +*请注意:*本文重点讨论 *gc*,实际上是 [golang.org](https://github.com/golang/go) 的 Go 编译器。讨论到的概念可以广泛用于其他 Go 编译器,如 gccgo 和 llgo,但它们在实现方式和功能上可能有所差异。 + +### 内联是什么? + +内联就是把简短的函数在调用它的地方展开。在计算机发展历程的早期,这个优化是由程序员手动实现的。现在,内联已经成为编译过程中自动实现的基本优化过程的其中一步。 + +### 为什么内联很重要? + +有两个原因。第一个是它消除了函数调用本身的虚耗。第二个是它使得编译器能更高效地执行其他的优化策略。 + +#### 函数调用的虚耗 + +在任何语言中,调用一个函数 [1][2] 都会有消耗。把参数编组进寄存器或放入栈中(取决于 ABI),在返回结果时倒序取出时会有虚耗。引入一次函数调用会导致程序计数器从指令流的一点跳到另一点,这可能导致管道阻塞。函数内部通常有前置处理,需要为函数执行准备新的栈帧,还有与前置相似的后续处理,需要在返回给调用方之前释放栈帧空间。 + +在 Go 中函数调用会消耗额外的资源来支持栈的动态增长。在进入函数时,goroutine 可用的栈空间与函数需要的空间大小相等。如果可用空间不同,前置处理就会跳到把数据复制到一块新的、更大的空间的运行时逻辑,而这会导致栈空间变大。当这个复制完成后,运行时跳回到原来的函数入口,再执行栈空间检查,函数调用继续执行。这种方式下,goroutine 开始时可以申请很小的栈空间,在有需要时再申请更大的空间。[2][3] + +这个检查消耗很小 — 只有几个指令 — 而且由于 goroutine 是成几何级数增长的,因此这个检查很少失败。这样,现代处理器的分支预测单元会通过假定检查肯定会成功来隐藏栈空间检查的消耗。当处理器预测错了栈空间检查,必须要抛弃它推测性执行的操作时,与为了增加 goroutine 的栈空间运行时所需的操作消耗的资源相比,管道阻塞的代价更小。 + +虽然现代处理器可以用预测性执行技术优化每次函数调用中的泛型和 Go 特定的元素的虚耗,但那些虚耗不能被完全消除,因此在每次函数调用执行必要的工作过程中都会有性能消耗。一次函数调用本身的虚耗是固定的,与更大的函数相比,调用小函数的代价更大,因为在每次调用过程中它们做的有用的工作更少。 + +消除这些虚耗的方法必须是要消除函数调用本身,Go 的编译器就是这么做的,在某些条件下通过用函数的内容来替换函数调用来实现。这个过程被称为*内联*,因为它在函数调用处把函数体展开了。 + +#### 改进的优化机会 + +Cliff Click 博士把内联描述为现代编译器做的优化措施,像常量传播(译注:此处作者笔误,原文为 constant proportion,修正为 constant propagation)和死码消除一样,都是编译器的基本优化方法。实际上,内联可以让编译器看得更深,使编译器可以观察调用的特定函数的上下文内容,可以看到能继续简化或彻底消除的逻辑。由于可以递归地执行内联,因此不仅可以在每个独立的函数上下文处进行这种优化,也可以在整个函数调用链中进行。 + +### 实践中的内联 + +下面这个例子可以演示内联的影响: + +```go +package main + +import "testing" + +//go:noinline +func max(a, b int) int { + if a > b { + return a + } + return b +} + +var Result int + +func BenchmarkMax(b *testing.B) { + var r int + for i := 0; i < b.N; i++ { + r = max(-1, i) + } + Result = r +} +``` + +运行这个基准,会得到如下结果:[3](https://github.com/LCTT/TranslateProject/blob/master/sources/tech/tmp.gBQ2tEtMHc#easy-footnote-bottom-3-4053) + +```bash +% go test -bench=. +BenchmarkMax-4 530687617 2.24 ns/op +``` + +在我的 2015 MacBook Air 上 `max(-1, i)` 的耗时约为 2.24 纳秒。现在去掉 `//go:noinline` 编译指令,再看下结果: + +```bash +% go test -bench=. +BenchmarkMax-4 1000000000 0.514 ns/op +``` + +从 2.24 纳秒降到了 0.51 纳秒,或者从 `benchstat` 的结果可以看出,有 78% 的提升。 + +```bash +% benchstat {old,new}.txt +name old time/op new time/op delta +Max-4 2.21ns ± 1% 0.49ns ± 6% -77.96% (p=0.000 n=18+19) +``` + +这个提升是从哪儿来的呢? + +首先,移除掉函数调用以及与之关联的前置处理 [4](https://github.com/LCTT/TranslateProject/blob/master/sources/tech/tmp.gBQ2tEtMHc#easy-footnote-bottom-4-4053) 是主要因素。把 `max` 函数的函数体在调用处展开,减少了处理器执行的指令数量并且消除了一些分支。 + +现在由于编译器优化了 `BenchmarkMax`,因此它可以看到 `max` 函数的内容,进而可以做更多的提升。当 `max` 被内联后,`BenchmarkMax` 呈现给编译器的样子,看起来是这样的: + +```go +func BenchmarkMax(b *testing.B) { + var r int + for i := 0; i < b.N; i++ { + if -1 > i { + r = -1 + } else { + r = i + } + } + Result = r +} +``` + +再运行一次基准,我们看一下手动内联的版本和编译器内联的版本的表现: + +```bash +% benchstat {old,new}.txt +name old time/op new time/op delta +Max-4 2.21ns ± 1% 0.48ns ± 3% -78.14% (p=0.000 n=18+18) +``` + +现在编译器能看到在 `BenchmarkMax` 里内联 `max` 的结果,可以执行以前不能执行的优化措施。例如,编译器注意到 `i` 初始值为 `0`,仅做自增操作,因此所有与 `i` 的比较都可以假定 `i` 不是负值。这样条件表达式 `-1 > i` 永远不是 true。[5](https://github.com/LCTT/TranslateProject/blob/master/sources/tech/tmp.gBQ2tEtMHc#easy-footnote-bottom-5-4053) + +证明了 `-1 > i` 永远不为 true 后,编译器可以把代码简化为: + +```go +func BenchmarkMax(b *testing.B) { + var r int + for i := 0; i < b.N; i++ { + if false { + r = -1 + } else { + r = i + } + } + Result = r +} +``` + +并且因为分支里是个常量,编译器可以通过下面的方式移除不会走到的分支: + +```go +func BenchmarkMax(b *testing.B) { + var r int + for i := 0; i < b.N; i++ { + r = i + } + Result = r +} +``` + +这样,通过内联和由内联解锁的优化过程,编译器把表达式 `r = max(-1, i))` 简化为 `r = i`。 + +### 内联的限制 + +本文中我论述的内联称作*叶子*内联;把函数调用栈中最底层的函数在调用它的函数处展开的行为。内联是个递归的过程,当把函数内联到调用它的函数 A 处后,编译器会把内联后的结果代码再内联到 A 的调用方,这样持续内联下去。例如,下面的代码: + +```go +func BenchmarkMaxMaxMax(b *testing.B) { + var r int + for i := 0; i < b.N; i++ { + r = max(max(-1, i), max(0, i)) + } + Result = r +} +``` + +与之前的例子中的代码运行速度一样快,因为编译器可以对上面的代码重复地进行内联,也把代码简化到 `r = i` 表达式。 + +下一篇文章中,我会论述当 Go 编译器想要内联函数调用栈中间的某个函数时选用的另一种内联策略。最后我会论述编译器为了内联代码准备好要达到的极限,这个极限 Go 现在的能力还达不到。 + +1. 在 Go 中,一个方法就是一个有预先定义的形参和接受者的函数。假设这个方法不是通过接口调用的,调用一个无消耗的函数所消耗的代价与引入一个方法是相同的。 +2. 在 Go 1.14 以前,栈检查的前置处理也被 gc 用于 STW,通过把所有活跃的 goroutine 栈空间设为 0,来强制它们切换为下一次函数调用时的运行时状态。这个机制[最近被替换](https://github.com/golang/proposal/blob/master/design/24543-non-cooperative-preemption.md)为一种新机制,新机制下运行时可以不用等 goroutine 进行函数调用就可以暂停 goroutine。 +3. 我用 `//go:noinline` 编译指令来阻止编译器内联 `max`。这是因为我想把内联 `max` 的影响与其他影响隔离开,而不是用 `-gcflags='-l -N'` 选项在全局范围内禁止优化。 +4. 你可以自己通过比较 `go test -bench=. -gcflags=-S`有无 `//go:noinline` 注释时的不同结果来验证一下。 +5. 你可以用 `-gcflags=-d=ssa/prove/debug=on` 选项来自己验证一下。 + +#### 相关文章: + +1. [使 Go 变快的 5 件事](https://dave.cheney.net/2014/06/07/five-things-that-make-go-fast) +2. [为什么 Goroutine 的栈空间会无限增长?](https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite) +3. [Go 中怎么写基准测试](https://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go) +4. [Go 中隐藏的编译指令](https://dave.cheney.net/2018/01/08/gos-hidden-pragmas) + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://github.com/golang/go +[2]: tmp.gBQ2tEtMHc#easy-footnote-bottom-1-4053 (In Go, a method is just a function with a predefined formal parameter, the receiver. The relative costs of calling a free function vs a invoking a method, assuming that method is not called through an interface, are the same.) +[3]: tmp.gBQ2tEtMHc#easy-footnote-bottom-2-4053 (Up until Go 1.14 the stack check preamble was also used by the garbage collector to stop the world by setting all active goroutine’s stacks to zero, forcing them to trap into the runtime the next time they made a function call. This system was recently replaced with a mechanism which allowed the runtime to pause an goroutine without waiting for it to make a function call.) +[4]: tmp.gBQ2tEtMHc#easy-footnote-bottom-3-4053 (I’m using the //go:noinline pragma to prevent the compiler from inlining max. This is because I want to isolate the effects of inlining on max rather than disabling optimisations globally with -gcflags='-l -N'. I go into detail about the //go: comments in this presentation.) +[5]: tmp.gBQ2tEtMHc#easy-footnote-bottom-4-4053 (You can check this for yourself by comparing the output of go test -bench=. -gcflags=-S with and without the //go:noinline annotation.) +[6]: tmp.gBQ2tEtMHc#easy-footnote-bottom-5-4053 (You can check this yourself with the -gcflags=-d=ssa/prove/debug=on flag.) +[7]: tmp.gBQ2tEtMHc#easy-footnote-1-4053 +[8]: https://github.com/golang/proposal/blob/master/design/24543-non-cooperative-preemption.md +[9]: tmp.gBQ2tEtMHc#easy-footnote-2-4053 +[10]: https://dave.cheney.net/2018/01/08/gos-hidden-pragmas +[11]: tmp.gBQ2tEtMHc#easy-footnote-3-4053 +[12]: tmp.gBQ2tEtMHc#easy-footnote-4-4053 +[13]: tmp.gBQ2tEtMHc#easy-footnote-5-4053 +[14]: https://dave.cheney.net/2014/06/07/five-things-that-make-go-fast (Five things that make Go fast) +[15]: https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite (Why is a Goroutine’s stack infinite ?) +[16]: https://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go (How to write benchmarks in Go) +[17]: https://dave.cheney.net/2018/01/08/gos-hidden-pragmas (Go’s hidden #pragmas) From 711b86d8e1bd4020f0e59406d2db0484ac01c056 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Tue, 28 Apr 2020 21:21:03 +0800 Subject: [PATCH 0495/1809] modify --- .../20200425 Inlining optimisations in Go.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/translated/tech/20200425 Inlining optimisations in Go.md b/translated/tech/20200425 Inlining optimisations in Go.md index 80f86ae47e..dc13968c1d 100644 --- a/translated/tech/20200425 Inlining optimisations in Go.md +++ b/translated/tech/20200425 Inlining optimisations in Go.md @@ -66,7 +66,7 @@ func BenchmarkMax(b *testing.B) { } ``` -运行这个基准,会得到如下结果:[3](https://github.com/LCTT/TranslateProject/blob/master/sources/tech/tmp.gBQ2tEtMHc#easy-footnote-bottom-3-4053) +运行这个基准,会得到如下结果:[3][4] ```bash % go test -bench=. @@ -90,7 +90,7 @@ Max-4 2.21ns ± 1% 0.49ns ± 6% -77.96% (p=0.000 n=18+19) 这个提升是从哪儿来的呢? -首先,移除掉函数调用以及与之关联的前置处理 [4](https://github.com/LCTT/TranslateProject/blob/master/sources/tech/tmp.gBQ2tEtMHc#easy-footnote-bottom-4-4053) 是主要因素。把 `max` 函数的函数体在调用处展开,减少了处理器执行的指令数量并且消除了一些分支。 +首先,移除掉函数调用以及与之关联的前置处理 [4][5] 是主要因素。把 `max` 函数的函数体在调用处展开,减少了处理器执行的指令数量并且消除了一些分支。 现在由于编译器优化了 `BenchmarkMax`,因此它可以看到 `max` 函数的内容,进而可以做更多的提升。当 `max` 被内联后,`BenchmarkMax` 呈现给编译器的样子,看起来是这样的: @@ -116,7 +116,7 @@ name old time/op new time/op delta Max-4 2.21ns ± 1% 0.48ns ± 3% -78.14% (p=0.000 n=18+18) ``` -现在编译器能看到在 `BenchmarkMax` 里内联 `max` 的结果,可以执行以前不能执行的优化措施。例如,编译器注意到 `i` 初始值为 `0`,仅做自增操作,因此所有与 `i` 的比较都可以假定 `i` 不是负值。这样条件表达式 `-1 > i` 永远不是 true。[5](https://github.com/LCTT/TranslateProject/blob/master/sources/tech/tmp.gBQ2tEtMHc#easy-footnote-bottom-5-4053) +现在编译器能看到在 `BenchmarkMax` 里内联 `max` 的结果,可以执行以前不能执行的优化措施。例如,编译器注意到 `i` 初始值为 `0`,仅做自增操作,因此所有与 `i` 的比较都可以假定 `i` 不是负值。这样条件表达式 `-1 > i` 永远不是 true。[5][6] 证明了 `-1 > i` 永远不为 true 后,编译器可以把代码简化为: @@ -166,11 +166,11 @@ func BenchmarkMaxMaxMax(b *testing.B) { 下一篇文章中,我会论述当 Go 编译器想要内联函数调用栈中间的某个函数时选用的另一种内联策略。最后我会论述编译器为了内联代码准备好要达到的极限,这个极限 Go 现在的能力还达不到。 -1. 在 Go 中,一个方法就是一个有预先定义的形参和接受者的函数。假设这个方法不是通过接口调用的,调用一个无消耗的函数所消耗的代价与引入一个方法是相同的。 -2. 在 Go 1.14 以前,栈检查的前置处理也被 gc 用于 STW,通过把所有活跃的 goroutine 栈空间设为 0,来强制它们切换为下一次函数调用时的运行时状态。这个机制[最近被替换](https://github.com/golang/proposal/blob/master/design/24543-non-cooperative-preemption.md)为一种新机制,新机制下运行时可以不用等 goroutine 进行函数调用就可以暂停 goroutine。 -3. 我用 `//go:noinline` 编译指令来阻止编译器内联 `max`。这是因为我想把内联 `max` 的影响与其他影响隔离开,而不是用 `-gcflags='-l -N'` 选项在全局范围内禁止优化。 -4. 你可以自己通过比较 `go test -bench=. -gcflags=-S`有无 `//go:noinline` 注释时的不同结果来验证一下。 -5. 你可以用 `-gcflags=-d=ssa/prove/debug=on` 选项来自己验证一下。 +1. 在 Go 中,一个方法就是一个有预先定义的形参和接受者的函数。假设这个方法不是通过接口调用的,调用一个无消耗的函数所消耗的代价与引入一个方法是相同的。[][7] +2. 在 Go 1.14 以前,栈检查的前置处理也被 gc 用于 STW,通过把所有活跃的 goroutine 栈空间设为 0,来强制它们切换为下一次函数调用时的运行时状态。这个机制[最近被替换][8]为一种新机制,新机制下运行时可以不用等 goroutine 进行函数调用就可以暂停 goroutine。[][9] +3. 我用 `//go:noinline` 编译指令来阻止编译器内联 `max`。这是因为我想把内联 `max` 的影响与其他影响隔离开,而不是用 `-gcflags='-l -N'` 选项在全局范围内禁止优化。关于 `//go:` 注释在[这篇文章][10]中详细论述。[][11] +4. 你可以自己通过比较 `go test -bench=. -gcflags=-S`有无 `//go:noinline` 注释时的不同结果来验证一下。[][12] +5. 你可以用 `-gcflags=-d=ssa/prove/debug=on` 选项来自己验证一下。[][13] #### 相关文章: From 18324716b266335f6a4abff2998ae23bdcec4871 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Apr 2020 22:33:30 +0800 Subject: [PATCH 0496/1809] PRF @geekpi --- ...e and Open Source Audio-Video Converter.md | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/translated/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md b/translated/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md index 1c8c5e6fe4..f9e8e8cf16 100644 --- a/translated/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md +++ b/translated/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md @@ -1,26 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (MystiQ: A Free and Open Source Audio/Video Converter) [#]: via: (https://itsfoss.com/mystiq/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -MystiQ:一个免费开源音频/视频转换器 +MystiQ:一个自由开源的音视频转换器 ====== -_**简述:MystiQ 是可用于 Linux 和 Windows 的新开源视频转换器工具。它的底层使用 FFMPEG,并为你提供基于 Qt 的整洁干净的图形界面。**_ +![](https://img.linux.net.cn/data/attachment/album/202004/28/223258cr9rxzyrj344kh68.jpg) + +> MystiQ 是一款全新的开源视频转换工具,适用于 Linux 和 Windows。它的底层使用 FFMPEG,并为你提供了一个基于 Qt 的整洁干净的图形界面。 ### MystiQ,一个基于 QT 的 FFmpeg GUI 前端 ![][1] -一个音频/视频转换工具可为跨多个平台的每位计算机用户提供方便。 +音频/视频转换工具可为每位跨多个平台的计算机用户提供方便。 -出于同样的原因,我着重介绍 [MystiQ][2] 是个好主意,这是一个相对较新的视频/音频转换器工具,可用于 Linux 和 Windows。截至目前,它还不支持 macOS,但可能会在不久的将来出现。 +出于同样的原因,我想着重介绍 [MystiQ][2] 是个好主意,这是一个相对较新的视频/音频转换器工具,适用于 Linux 和 Windows。截至目前,它还不支持 macOS,但可能会在不久的将来支持。 -MystiQ 是基于 [Qt 5 界面][4]的 [FFmpeg][3] 图形前端。 现在,你可以随时[在 Linux 命令行中安装并使用 ffmpeg][5],但这不是很舒服,是吗? 这就是为什么 [Handbrake][6] 和 MystiQ 之类的工具可以使我们的生活更轻松的原因。 +MystiQ 是基于 [Qt 5 界面][4]的 [FFmpeg][3] 图形前端。现在,你可以随时[在 Linux 命令行中安装并使用 ffmpeg][5],但这不是很舒服,是吗?这就是为什么 [Handbrake][6] 和 MystiQ 之类的工具可以使我们的生活更方便的原因。 由于 MystiQ 基于 FFmpeg,因此你可以将其用于一些基本的视频编辑,例如修剪、旋转等。 @@ -34,36 +36,31 @@ MystiQ 是基于 [Qt 5 界面][4]的 [FFmpeg][3] 图形前端。 现在,你可 * 视频转换 * 音频转换(也可从视频中提取音频) - * 支持格式:MP4、WEBM、MKV、MP3、MOV、OGG、WAV、ASF、FLV、3GP、M4A 等。 + * 支持的格式:MP4、WEBM、MKV、MP3、MOV、OGG、WAV、ASF、FLV、3GP、M4A 等。 * 跨平台(Windows 和 Linux) * 适用于 32 位和 64 位系统的安装包 * 能够调整音频质量(采样率、比特率等)进行转换 - * **基本视频编辑功能**(剪辑视频、插入字幕、旋转视频、缩放视频等) + * 基本的视频编辑功能(剪辑视频、插入字幕、旋转视频、缩放视频等) * 将彩色视频转换为黑白 - * 可轻松转换视频的多个预设以获得最佳质量或获得最佳压缩效果。 - - -#### [在 Linux 中使用 SoundConverter 轻松转换音频文件格式][9] - -如果你想将音频文件格式转换为 wav、mp3、ogg 或任何其他格式,SoundConverter 是你在 Linux 中所需的工具。 + * 有几个预设方案,可轻松转换视频以获得最佳质量或获得最佳压缩效果。 ### 安装 MystiQ 你可能没有在软件中心中找到它,但将它安装在 Linux 发行版上非常容易。 -它提供了 **.AppImage** 文件和 **.deb/.rpm** 文件(32 位和 64 位软件包)。如果你好奇想使用的话,可以阅读[如何使用 AppImage 文件][10]。 +它提供了 .AppImage 文件和 .deb / .rpm 文件(32 位和 64 位软件包)。如果你不清楚如何使用的话,可以阅读[如何使用 AppImage 文件][10]。 如果你想帮助他们测试软件进行改进,你还可以找到他们的 [GitHub 页面][11],并查看源码或任何近期的预发布软件包。 你可以在其官方网站下载适用于 Linux 和 Windows 的安装程序文件。 -[下载 MystiQ][2] +- [下载 MystiQ][2] -**总结** +### 总结 -在本文中,我使用 [Pop!\_OS][12] 20.04 测试了 MytiQ 转换器,并且在转换视频和音频时没遇到问题。而且,对于像我这样的普通用户来说,它的转换速度足够快。 +在本文中,我使用 [Pop!_OS][12] 20.04 测试了 MytiQ 转换器,并且在转换视频和音频时没遇到任何问题。而且,对于像我这样的普通用户来说,它的转换速度足够快。 -请尝试一下,让我知道你对它的想法!另外,如果你在 Linux 上一直使用其他工具转换视频和音频,那它是什么? +欢迎尝试一下,让我知道你对它的想法!另外,如果你在 Linux 上一直使用其他工具转换视频和音频,那它是什么? -------------------------------------------------------------------------------- @@ -72,7 +69,7 @@ via: https://itsfoss.com/mystiq/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b186bf1620d39d846764aa952c4bf5768961975c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Apr 2020 22:34:15 +0800 Subject: [PATCH 0497/1809] PUB @geekpi https://linux.cn/article-12160-1.html --- ...21 MystiQ- A Free and Open Source Audio-Video Converter.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md (98%) diff --git a/translated/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md b/published/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md similarity index 98% rename from translated/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md rename to published/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md index f9e8e8cf16..c4c99dac95 100644 --- a/translated/tech/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md +++ b/published/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12160-1.html) [#]: subject: (MystiQ: A Free and Open Source Audio/Video Converter) [#]: via: (https://itsfoss.com/mystiq/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 80391aec594fe5c70820faf2e08a42b872344c9d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Apr 2020 00:55:21 +0800 Subject: [PATCH 0498/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200428=20Upgr?= =?UTF-8?q?ading=20Fedora=2031=20to=20Fedora=2032?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md --- ...200428 Upgrading Fedora 31 to Fedora 32.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md diff --git a/sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md b/sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md new file mode 100644 index 0000000000..1807d5e6a7 --- /dev/null +++ b/sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Upgrading Fedora 31 to Fedora 32) +[#]: via: (https://fedoramagazine.org/upgrading-fedora-31-to-fedora-32/) +[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) + +Upgrading Fedora 31 to Fedora 32 +====== + +![][1] + +Fedora 32 [is available now][2]. You’ll likely want to upgrade your system to get the latest features available in Fedora. Fedora Workstation has a graphical upgrade method. Alternatively, Fedora offers a command-line method for upgrading Fedora 30 to Fedora 31. + +Before upgrading, visit the [wiki page of common Fedora 32 bugs][3] to see if there’s an issue that might affect your upgrade. Although the Fedora community tries to ensure upgrades work well, there’s no way to guarantee this for every combination of hardware and software that users might have. + +### Upgrading Fedora 31 Workstation to Fedora 32 + +Soon after release time, a notification appears to tell you an upgrade is available. You can click the notification to launch the **GNOME Software** app. Or you can choose Software from GNOME Shell. + +Choose the _Updates_ tab in GNOME Software and you should see a screen informing you that Fedora 32 is Now Available. + +If you don’t see anything on this screen, try using the reload button at the top left. It may take some time after release for all systems to be able to see an upgrade available. + +Choose _Download_ to fetch the upgrade packages. You can continue working until you reach a stopping point, and the download is complete. Then use GNOME Software to restart your system and apply the upgrade. Upgrading takes time, so you may want to grab a coffee and come back to the system later. + +### Using the command line + +If you’ve upgraded from past Fedora releases, you are likely familiar with the _dnf upgrade_ plugin. This method is the recommended and supported way to upgrade from Fedora 31 to Fedora 32. Using this plugin will make your upgrade to Fedora 32 simple and easy. + +#### 1\. Update software and back up your system + +Before you do start the upgrade process, make sure you have the latest software for Fedora 31. This is particularly important if you have modular software installed; the latest versions of dnf and GNOME Software include improvements to the upgrade process for some modular streams. To update your software, use _GNOME Software_ or enter the following command in a terminal. + +``` +sudo dnf upgrade --refresh +``` + +Additionally, make sure you back up your system before proceeding. For help with taking a backup, see [the backup series][4] on the Fedora Magazine. + +#### 2\. Install the DNF plugin + +Next, open a terminal and type the following command to install the plugin: + +``` +sudo dnf install dnf-plugin-system-upgrade +``` + +#### 3\. Start the update with DNF + +Now that your system is up-to-date, backed up, and you have the DNF plugin installed, you can begin the upgrade by using the following command in a terminal: + +``` +sudo dnf system-upgrade download --releasever=32 +``` + +This command will begin downloading all of the upgrades for your machine locally to prepare for the upgrade. If you have issues when upgrading because of packages without updates, broken dependencies, or retired packages, add the _‐‐allowerasing_ flag when typing the above command. This will allow DNF to remove packages that may be blocking your system upgrade. + +#### 4\. Reboot and upgrade + +Once the previous command finishes downloading all of the upgrades, your system will be ready for rebooting. To boot your system into the upgrade process, type the following command in a terminal: + +``` +sudo dnf system-upgrade reboot +``` + +Your system will restart after this. Many releases ago, the _fedup_ tool would create a new option on the kernel selection / boot screen. With the _dnf-plugin-system-upgrade_ package, your system reboots into the current kernel installed for Fedora 31; this is normal. Shortly after the kernel selection screen, your system begins the upgrade process. + +Now might be a good time for a coffee break! Once it finishes, your system will restart and you’ll be able to log in to your newly upgraded Fedora 32 system. + +![][5] + +### Resolving upgrade problems + +On occasion, there may be unexpected issues when you upgrade your system. If you experience any issues, please visit the [DNF system upgrade quick docs][6] for more information on troubleshooting. + +If you are having issues upgrading and have third-party repositories installed on your system, you may need to disable these repositories while you are upgrading. For support with repositories not provided by Fedora, please contact the providers of the repositories. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/upgrading-fedora-31-to-fedora-32/ + +作者:[Adam Šamalík][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/asamalik/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/31-32-816x345.png +[2]: https://fedoramagazine.org/announcing-fedora-32/ +[3]: https://fedoraproject.org/wiki/Common_F32_bugs +[4]: https://fedoramagazine.org/taking-smart-backups-duplicity/ +[5]: https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot_f23-ws-upgrade-test_2016-06-10_110906-1024x768.png +[6]: https://docs.fedoraproject.org/en-US/quick-docs/dnf-system-upgrade/#Resolving_post-upgrade_issues From 3e7abc111a46ee3921a0aca1fc2fa0e22210c8db Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Apr 2020 00:56:11 +0800 Subject: [PATCH 0499/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200428=20Fedo?= =?UTF-8?q?ra=2032=20is=20officially=20here!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200428 Fedora 32 is officially here.md --- .../20200428 Fedora 32 is officially here.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20200428 Fedora 32 is officially here.md diff --git a/sources/tech/20200428 Fedora 32 is officially here.md b/sources/tech/20200428 Fedora 32 is officially here.md new file mode 100644 index 0000000000..67989780ea --- /dev/null +++ b/sources/tech/20200428 Fedora 32 is officially here.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora 32 is officially here!) +[#]: via: (https://fedoramagazine.org/announcing-fedora-32/) +[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) + +Fedora 32 is officially here! +====== + +![][1] + +It’s here! We’re proud to announce the release of Fedora 32. Thanks to the hard work of thousands of Fedora community members and contributors, we’re celebrating yet another on-time release. + +If you just want to get to the bits without delay, head over to right now. For details, read on! + +## **All of Fedora’s Flavors** + +Fedora Editions are targeted outputs geared toward specific “showcase” uses. + +Fedora Workstation focuses on the desktop. In particular, it’s geared toward software developers who want a “just works” Linux operating system experience. This release features [GNOME 3.36][2], which has plenty of great improvements as usual. My favorite is the new lock screen! + +Fedora Server brings the latest in cutting-edge open source server software to systems administrators in an easy-to-deploy fashion. For edge computing use cases, [Fedora IoT][3] provides a strong foundation for IoT ecosystems. + +Fedora CoreOS is an emerging Fedora Edition. It’s an automatically-updating, minimal operating system for running containerized workloads securely and at scale. It offers several [update streams][4] that can be followed for automatic updates that occur roughly every two weeks. Currently the **next** stream is based on Fedora 32, with the **testing** and **stable** streams to follow. You can find information about released artifacts that follow the **next** stream from [the download page][5] and information about how to use those artifacts in the [Fedora CoreOS Documentation][6]. + +Of course, we produce more than just the editions. [Fedora Spins][7] and [Labs][8] target a variety of audiences and use cases, including the [Fedora Astronomy Lab][9], which brings a complete open source toolchain to both amateur and professional astronomers, and desktop environments like [KDE Plasma][10] and [Xfce][11]. New in Fedora 32 is the [Comp Neuro Lab][12], developed by our Neuroscience Special Interest Group to enable computational neuroscience. + +And, don’t forget our alternate architectures: [ARM AArch64, Power, and S390x][13]. Of particular note, we have improved support for the Rockchip system-on-a-chip devices including the Rock960, RockPro64, and Rock64. + +**General improvements** + +No matter what variant of Fedora you use, you’re getting the latest the open source world has to offer. Following our “[First][14]” foundation, we’ve updated key programming language and system library packages, including GCC 10, Ruby 2.7, and Python 3.8. Of course, with Python 2 past end-of-life, we’ve removed most Python 2 packages from Fedora. A legacy python27 package is provided for developers and users who still need it. In Fedora Workstation, we’ve enabled the EarlyOOM service by default to improve the user experience in low-memory situations. + +We’re excited for you to try out the new release! Go to and download it now. Or if you’re already running a Fedora operating system, follow the easy [upgrade instructions][15]. + +## **In the unlikely event of a problem….** + +If you run into a problem, check out the [Fedora 32 Common Bugs][16] page, and if you have questions, visit our [Ask Fedora][17] user-support platform. + +## **Thank you everyone** + +Thanks to the thousands of people who contributed to the Fedora Project in this release cycle, and especially to those of you who worked extra hard to make this another on-time release during a pandemic. Fedora is a community, and it’s great to see how much we’ve supported each other. I invite you to join us in the [Red Hat Summit Virtual Experience][18] 28-29 April to learn more about Fedora and other communities. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/announcing-fedora-32/ + +作者:[Matthew Miller][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/mattdm/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/f32-final-816x345.png +[2]: https://www.gnome.org/news/2020/03/gnome-3-36-released/ +[3]: https://iot.fedoraproject.org/ +[4]: https://docs.fedoraproject.org/en-US/fedora-coreos/update-streams/ +[5]: https://getfedora.org/en/coreos/download?stream=next +[6]: https://docs.fedoraproject.org/en-US/fedora-coreos/getting-started/ +[7]: https://spins.fedoraproject.org/ +[8]: https://labs.fedoraproject.org/ +[9]: https://labs.fedoraproject.org/en/astronomy/ +[10]: https://spins.fedoraproject.org/en/kde/ +[11]: https://spins.fedoraproject.org/en/xfce/ +[12]: https://labs.fedoraproject.org/en/comp-neuro +[13]: https://alt.fedoraproject.org/alt/ +[14]: https://docs.fedoraproject.org/en-US/project/#_first +[15]: https://docs.fedoraproject.org/en-US/quick-docs/upgrading/ +[16]: https://fedoraproject.org/wiki/Common_F32_bugs +[17]: http://ask.fedoraproject.org +[18]: https://www.redhat.com/en/summit From b9a825004c3b4672ddcd66513f2f0fa8e34a921e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Apr 2020 00:56:44 +0800 Subject: [PATCH 0500/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200428=20What?= =?UTF-8?q?=E2=80=99s=20new=20in=20Fedora=2032=20Workstation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200428 What-s new in Fedora 32 Workstation.md --- ...428 What-s new in Fedora 32 Workstation.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/tech/20200428 What-s new in Fedora 32 Workstation.md diff --git a/sources/tech/20200428 What-s new in Fedora 32 Workstation.md b/sources/tech/20200428 What-s new in Fedora 32 Workstation.md new file mode 100644 index 0000000000..402a8e63a7 --- /dev/null +++ b/sources/tech/20200428 What-s new in Fedora 32 Workstation.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What’s new in Fedora 32 Workstation) +[#]: via: (https://fedoramagazine.org/whats-new-fedora-32-workstation/) +[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) + +What’s new in Fedora 32 Workstation +====== + +![][1] + +Fedora 32 Workstation is the [latest release][2] of our free, leading-edge operating system. You can download it from [the official website here][3] right now. There are several new and noteworthy changes in Fedora 32 Workstation. Read more details below. + +### GNOME 3.36 + +Fedora 32 Workstation includes the latest release of GNOME Desktop Environment for users of all types. GNOME 3.36 in Fedora 32 Workstation includes many updates and improvements, including: + +#### Redesigned Lock Screen + +The lock screen in Fedora 32 is a totally new experience. The new design removes the “window shade” metaphor used in previous releases, and focuses on ease and speed of use. + +![Unlock screen in Fedora 32][4] + +#### New Extensions Application + +Fedora 32 features the new Extensions application, to easily manage your GNOME Extensions. In the past, extensions were installed, configured, and enabled using either the Software application and / or the Tweak Tool. + +![The new Extensions application in Fedora 32][5] + +Note that the Extensions application is not installed by default on Fedora 32. To either use the Software application to search and install, or use the following command in the terminal: + +``` +sudo dnf install gnome-extensions-app +``` + +#### Reorganized Settings + +Eagle-eyed Fedora users will notice that the Settings application has been re-organized. The structure of the settings categories is a lot flatter, resulting in more settings being visible at a glance. + +Additionally, the **About** category now has a more information about your system, including which windowing system you are running (e.g. Wayland) + +![The reorganized settings application in Fedora 32][6] + +#### Redesigned Notifications / Calendar popover + +The Notifications / Calendar popover — toggled by clicking on the Date and Time at the top of your desktop — has had numerous small style tweaks. Additionally, the popover now has a **Do Not Disturb** switch to quickly disable all notifications. This quick access is useful when presenting your screen, and not wanting your personal notifications appearing. + +![The new Notification / Calendar popover in Fedora 32 ][7] + +#### Redesigned Clocks Application + +The Clocks application is totally redesigned in Fedora 32. It features a design that works better on smaller windows. + +![The Clocks application in Fedora 32][8] + +GNOME 3.36 also provides many additional features and enhancements. Check out the [GNOME 3.36 Release Notes][9] for further information + +* * * + +### Improved Out of Memory handling + +Previously, if a system encountered a low-memory situation, it may have encountered heavy swap usage (aka [swap thrashing][10])– sometimes resulting in the Workstation UI slowing down, or becoming unresponsive for periods of time. Fedora 32 Workstation now ships and enables EarlyOOM by default. EarlyOOM enables users to more quickly recover and regain control over their system in low-memory situations with heavy swap usage. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/whats-new-fedora-32-workstation/ + +作者:[Ryan Lerch][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/ryanlerch/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/fedora32workstation-816x345.jpg +[2]: https://fedoramagazine.org/announcing-fedora-32/ +[3]: https://getfedora.org/workstation +[4]: https://fedoramagazine.org/wp-content/uploads/2020/04/unlock.gif +[5]: https://fedoramagazine.org/wp-content/uploads/2020/04/extensions.png +[6]: https://fedoramagazine.org/wp-content/uploads/2020/04/settings.png +[7]: https://fedoramagazine.org/wp-content/uploads/2020/04/donotdisturb.png +[8]: https://fedoramagazine.org/wp-content/uploads/2020/04/clocks.png +[9]: https://help.gnome.org/misc/release-notes/3.36/ +[10]: https://en.wikipedia.org/wiki/Thrashing_(computer_science) From 480a6e2fe955db047b0a5d460390d1a8af643e3e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Apr 2020 01:04:33 +0800 Subject: [PATCH 0501/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200429=20Manj?= =?UTF-8?q?aro=2020=20Lysia=20Arrives=20with=20ZFS=20and=20Snap=20Support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md --- ...Lysia Arrives with ZFS and Snap Support.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md diff --git a/sources/tech/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md b/sources/tech/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md new file mode 100644 index 0000000000..377a58f34a --- /dev/null +++ b/sources/tech/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manjaro 20 Lysia Arrives with ZFS and Snap Support) +[#]: via: (https://itsfoss.com/manjaro-20-release/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Manjaro 20 Lysia Arrives with ZFS and Snap Support +====== + +_**Manjaro Linux has refreshed its ISO with Manjaro 20 “Lysia”. It now supports Snap and Flatpak packages in Pamac. ZFS option is added in Manjaro Architect installer and the latest kernel 5.6 is used as the base.**_ + +It’s raining new distribution releases. Ubuntu 20.04 LTS was released last week. Fedora 32 will be releasing shortly and [Manjaro has released version 20][1] codenamed Lysia. + +### What’s new in Manjaro 20 Lysia? + +Plenty actually. Let me show you some of the major new features in Manjaro 20. + +#### New Matcha theme + +Manjaro 20 has a new default theme called Matcha. It gives the desktop a more polished look. + +![][2] + +#### Snap and Flatpak support in Pamac and terminal + +Snap and Flatpak package support is improved. You can use them in command line if you want. + +You can also enable Snap and Flatpak support in the Pamac GUI package manager. + +![Enable Snap support in Pamac Manjaro][3] + +Once enabled, you can find and install Snap/Flatpak applications in the Pamac software manager. + +![Snap applications in Pamac][4] + +#### Pamac offers to install new software based on search (in GNOME) + +In the GNOME variant, if you search for something, Pamac software manager will now offer to install software that match the query. GNOME Software Center does that in other distributions that use GNOME desktop. + +#### ZFS support lands in Manjaro Architect + +You can now easily use ZFS as root in Manjaro Linux. The [ZFS file system][5] support is available in [Manjaro Architect][6]. + +Do note that I am saying Manjaro Architect, the terminal based installer. It’s not the same as the regular graphical [Calamares installer][7]. + +![][8] + +#### Linux kernel 5.6 + +The latest stable [Linux kernel 5.6][9] brings more hardware support for thunderbolt, Nvidia and USB4. You can also use [WireGuard VPN][10]. + +![][11] + +#### Miscellaneous other features + + * New desktop environment versions: Xfce 4.14, GNOME 3.36 and KDE Plasma 5.18 + * zsh is the new default shell + * Display-Profiles allows you to store one or more profiles for your preferred display configuration + * Improved Gnome-Layout-Switcher + * Latest drivers + * Improved and polished Manjaro tools + + + +### How to get Manjaro 20 Lysia? + +_**If you are already using it, just update your Manjaro Linux system and you should already be using version 20.**_ + +Manjaro uses a rolling release model which means you don’t have to manually upgrade from one version to another. You don’t have to reinstall as soon as there is a new version is released. + +If Manjaro is rolling release distribution, why does it release a new version every now and then? It’s because they have to refresh the ISO so that new users downloading Manjaro will not have to install updates for last few years. This is why Arch Linux also refreshes its ISO every month. + +Manjaro ‘ISO refreshes’ are codenamed and have a version because it helps the developers clearly mark each stage of development. + +So, the bottom line is that if you are already using it, just [update your Manjaro Linux system][12] using Pamac or command line. + +If you want to try Manjaro or if you want to use ZFS, then you can [install Manjaro][13] by downloading the ISO from its website: + +[Download Manjaro Linux][14] + +Enjoy the new release of Manjaro Linux. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/manjaro-20-release/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://forum.manjaro.org/t/manjaro-20-0-lysia-released/138633 +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/manjaro-20-lysia.jpeg?resize=800%2C440&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-snap-in-pamac-manjaro.jpg?resize=800%2C490&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/snap-app-pacman.jpg?resize=800%2C489&ssl=1 +[5]: https://itsfoss.com/what-is-zfs/ +[6]: https://itsfoss.com/manjaro-architect-review/ +[7]: https://calamares.io/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/pacman-prompts-install-apps.jpg?resize=800%2C331&ssl=1 +[9]: https://itsfoss.com/linux-kernel-5-6/ +[10]: https://itsfoss.com/wireguard/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/manjaro-20-neofetch-screen.jpg?resize=800%2C495&ssl=1 +[12]: https://itsfoss.com/update-arch-linux/ +[13]: https://itsfoss.com/install-manjaro-linux/ +[14]: https://manjaro.org/download/ From 8716d84eb3961d2b94e88e5b9943a1f5b7915dd6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Apr 2020 01:05:41 +0800 Subject: [PATCH 0502/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200428=20How?= =?UTF-8?q?=20I=20empower=20and=20reach=20millions=20through=20open=20sour?= =?UTF-8?q?ce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200428 How I empower and reach millions through open source.md --- ... and reach millions through open source.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/tech/20200428 How I empower and reach millions through open source.md diff --git a/sources/tech/20200428 How I empower and reach millions through open source.md b/sources/tech/20200428 How I empower and reach millions through open source.md new file mode 100644 index 0000000000..a3c23dd073 --- /dev/null +++ b/sources/tech/20200428 How I empower and reach millions through open source.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I empower and reach millions through open source) +[#]: via: (https://opensource.com/article/20/4/interview-Netha-Hussain) +[#]: author: (Jay Barber https://opensource.com/users/jaybarber) + +How I empower and reach millions through open source +====== +Learn how Netha Hussain, winner of the 2020 Women in Open Source +Academic Award, shares knowledge and inspires people. +![Lightbulb][1] + +"I wanted to link to a particular Wikipedia article on my blog, but I found there wasn't one on that topic, so I wrote it myself," says Netha Hussain, 2020 [Women in Open Source Academic Award][2] winner. "That's the beauty of open source; anyone can contribute." + +![Photo by Lvova Anastasiya \(Львова Анастасия, Lvova\), CC BY-SA][3] + +Practicality drove Netha's entry into open source culture, and it has continued to be at the center of her work in the ten years since. + +She received her first computer in high school, but it did not immediately spark her passion. She says she mostly used it for games and other diversions, as many teenagers do. It wasn't until she entered medical school and realized that technology could be a powerful tool to help her achieve her goals that Netha truly found her path. Taking stock of her many contributions to [Wikimedia][4], [Mozilla][5], and [TED][6], it's fair to say that once she engaged with open source culture, she never looked back. + +### Finding ways to help + +Growing up in India, Netha was initially drawn to mathematics but soon found herself pulled in other directions. "At the time, I would have expected to continue down that path, mathematics or maybe writing, but the thing that I've always most wanted to do is help people," Netha says. "Medicine seemed to be the most direct path to providing real, tangible assistance to those around me, so I became a doctor." + +That drive to help continues to guide her now as she prepares to defend her doctoral thesis in clinical neuroscience at the University of Gothenburg in Sweden. + +"At a certain point, I decided that rather than limiting myself to what I could do through treating patients, I could also contribute in a research capacity, working to discover new, better ways to help others. I came to all of this via an unexpected route, but I love the idea of exploring and finding my own ways to help. I'm so satisfied and fulfilled by the work I'm doing now. It has been a wonderful journey." + +As she nears the completion of her degree, Netha reflects upon what she's looking forward to next. An infectious smile appears as she remarks, "I'm really excited to have more time to contribute to projects in the open source community." + +Why is she so enamored with open source? It comes back to utility. "In open source practices, I found a philosophy that closely matched my own ideals and a way of doing things that allowed me to help more people. Open source is fueled by collaboration. I've seen the things that can be accomplished by people working together, and it makes me very excited to think where it will take us in the future." + +### Reaching millions, one edit at a time + +Her first article, written to help an international audience understand her blog post, was only the first of many. Netha has now written 300 articles (200 in English and 100 in Malayalam), contributed 13,000 edits for [Wikipedia][7], added 9,000 images to [Wikimedia Commons][8], and provided 120,000 edits to [Wikidata][9]. Her commitment to bringing useful information to others can also be seen in her five years spent volunteering to translate Mozilla projects and TED talks into the Malayalam language. + +Such prolific output was born out of a simple realization. "I had shared so much on my blog but was only reaching a select audience. On Wikipedia and elsewhere, I had access to a potential audience of millions. There's a lot of power in that." + +Many of the articles Netha has written center on issues relevant to women, and that is very much by design. "I find myself writing on topics that are important to women because I feel they are an underserved community, and it is important to me that Wikipedia, as such a vital repository of information, be reflective of all users, all voices. I care deeply about the visibility of women on Wikipedia." + +Netha's commitment to women's issues led her to organize edit-a-thon initiatives and other activities with women's groups. She was also able to leverage similar strategies to assist the LGBTQ+ community in India during the campaign to legalize gay marriage. + +"In India, there are a lot of taboos around homosexuality, and I saw an opportunity to utilize my experience to help another segment of the population. Together, we were able to generate a lot of awareness, whether through raising up biographical articles on famous members of the LGBTQ+ community or shining a spotlight on anti-LGBTQ+ laws. I'm very proud of the opportunities I've had to support such efforts." + +### A path to the future + +It's clear that Netha believes strongly in empowering people, especially other women who may wish to explore open source methodologies as she has. Her advice is simple, but powerful. "Believe in yourself, and know that you have the skills and talent to do whatever you'd like to do," she finds the words easily, as if she's been waiting to be asked the question. "Follow your passion, and do what you want. There will be times of uncertainty but always move forward. Keep studying. Keep learning new things. That's how you grow, both in your field and as a person." + +Having achieved so much already, it's no surprise that Netha is enthusiastic about new challenges on the horizon. "I've put in a lot of effort to get here, but as you learn new strategies and new ways of collaborating, the work gets easier. Now, I don't consider it work at all. It's mostly fun to me." + +_Also read Jay Barber's [interview with Megan Byrd-Sanicki][10], who won the 2020 Women in Open Source Community Award._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/interview-Netha-Hussain + +作者:[Jay Barber][a] +选题:[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/jaybarber +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lightbulb-idea-think-yearbook-lead.png?itok=5ZpCm0Jh (Lightbulb) +[2]: https://www.redhat.com/en/about/women-in-open-source +[3]: https://opensource.com/sites/default/files/uploads/netha_headshot.png (Photo by Lvova Anastasiya (Львова Анастасия, Lvova), CC BY-SA) +[4]: https://www.wikimedia.org/ +[5]: https://www.mozilla.org/en-US/ +[6]: https://www.ted.com/ +[7]: https://www.wikipedia.org/ +[8]: https://commons.wikimedia.org/wiki/Main_Page +[9]: https://www.wikidata.org/wiki/Wikidata:Main_Page +[10]: https://opensource.com/article/20/4/interview-Megan-Byrd-Sanicki From 247ae60e2a53605215cc15dfff0341c16aaf42b5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Apr 2020 01:06:34 +0800 Subject: [PATCH 0503/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200428=20Open?= =?UTF-8?q?=20source=20has=20room=20for=20everyone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200428 Open source has room for everyone.md --- ...00428 Open source has room for everyone.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20200428 Open source has room for everyone.md diff --git a/sources/tech/20200428 Open source has room for everyone.md b/sources/tech/20200428 Open source has room for everyone.md new file mode 100644 index 0000000000..bab55ddfbe --- /dev/null +++ b/sources/tech/20200428 Open source has room for everyone.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open source has room for everyone) +[#]: via: (https://opensource.com/article/20/4/interview-Megan-Byrd-Sanicki) +[#]: author: (Jay Barber https://opensource.com/users/jaybarber) + +Open source has room for everyone +====== +Learn how Megan Byrd-Sanicki, 2020 Women in Open Source Community Award +winner, brings people together. +![Dandelion held out over water][1] + +"Growing up, I was a bit of a field marshal," Megan Byrd-Sanicki, 2020 [Women in Open Source Community Award][2] winner, says with a smile. "I was always the one pulling classmates together. 'We're going to play a game. Come on, everyone, I'll teach you the rules.' I'd also have an eye to the sidelines, trying to identify who wasn't being included and how I could draw them in." + +![Photo by Megan Sanicki, Used with permission][3] + +That drive to bring people together and set up a structure for them to excel carries through much of her career and community work. "I look back on who I was in second-grade gym class and have to admit that it's still who I am today." + +Megan has been active in open source for a decade, first as Executive Director of the [Drupal Association][4], and now as the Manager of Research and Operations for Google's Open Source Program Office. "I'm fortunate in my current position because it offers a view into Google's more than 2000 open source projects with different objectives, different governance structures, and different strategies. It's been just a phenomenal learning opportunity." Megan was also recently elected to the [Open Source Initiative][5] Board of Directors, where she strives to strengthen the leadership in open source that the organization offers to projects and businesses around the globe. + +### Lessons from the basement steps + +Far from being set on technology, Megan originally thought she'd go into business. Sitting on the basement steps, listening to her father make sales calls, she knew his entire product line by age 16, but she also internalized other lessons. + +"I learned from him that doing business means solving problems and helping people," Megan says. "And I've kept that front-of-mind throughout my career. In some ways, I'm not surprised by this path; it's a natural extension of who I am, but it's also taken me places I would never have dreamed possible." + +Open source isn't just a career for Megan; she also uses the same strategies in her community involvement. "Right now, I'm working with a great group of engineers, data scientists, and epidemiologists at [Covid Act Now][6]. The team members are volunteering their expertise, collaborating openly to provide data modeling to public officials so that they can make informed decisions as quickly as possible." + +She's also active in [FOSS Responders][7], a group focused on shining a light on open source projects and community members affected by COVID-19-related event cancellations. "In times of turmoil, it can be difficult for projects to find the help they need. We help organizations and individuals who need assistance aggregate and amplify their requests." An important component of the organization is administering the [FOSS Responders Fund][7], a mechanism to capture some of the open source funding requests that may fall through the cracks otherwise. + +### Engaging people in a changing world + +The twin themes that influence Megan's community engagement are a clear commitment to the principles of open source and a drive to bring people together. "When people have dreams, things they're actively trying to accomplish, it creates a shared sense of purpose and a strong 'why.' People engage easily around why. I know I do," Megan says when asked what drives her in these efforts. + +"Whether helping raise funds for Drupal's mission or enabling open source projects to become more sustainable, there's a real human impact. I get really passionate about the butterfly effect that results from helping people meet their goals and realize their dreams and visions." + +As open source becomes a larger and larger part of the technology space, Megan is hopeful for the future. "The exciting thing is that the story isn't done. As a community, we're still figuring things out," she says. "There's so much we need to learn about open source, and it can evolve in so many ways, while the landscape changes around us. We need to have the right conversations and figure out how to evolve together, ensuring there's a place at the table for everyone." + +In her words, it's possible to hear those same lessons learned from listening to her father's business calls—doing business is about solving problems and helping people. "Helping more people understand how to use and contribute to open source to solve problems is really rewarding. Whether it is to drive innovation, accelerate velocity, or achieve business goals, there are lots of ways to gain value from open source." + +### Own your awesome + +When asked what advice she has for other women wanting to engage with the open source community, Megan lights up. "Remember that open source has room for everyone. It can be daunting, but in my experience, people want to help. Ask for help when you need it, but also be clear on where you can contribute, how you can contribute, and what your needs are." + +She also recognizes that among all the voices in open source, a lack of centralized leadership can sometimes be felt, but she cautions against looking at it as a privileged role, reserved for only a few. "Be the leader you need. When there's a void in leadership, each individual can fill that void for themselves. Every contributor to open source is a leader, whether they're leading others, leading the community, or just leading themselves. Don't wait to be given permission and own your awesome." + +The open source journey for Megan has been just that: a trek where her path wasn't always clear. She's never shied away from adventure or run from uncertainty, though. "I look at life as this beautiful tapestry that you're weaving, but day to day, you only get to see the threads in the back. If you could see the full picture, you'd realize that you've contributed to this wonderful work in countless ways just by doing your best every day." + +_Also read Jay Barber's [interview with Netha Hussain][8], who won the 2020 Women in Open Source Academic Award._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/interview-Megan-Byrd-Sanicki + +作者:[Jay Barber][a] +选题:[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/jaybarber +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/dandelion_blue_water_hand.jpg?itok=QggW8Wnw (Dandelion held out over water) +[2]: https://www.redhat.com/en/about/women-in-open-source +[3]: https://opensource.com/sites/default/files/uploads/megan_sanicki_headshot_small_0.png (Photo by Megan Sanicki, Used with permission) +[4]: https://www.drupal.org/association +[5]: https://opensource.org/ +[6]: https://www.covidactnow.org/ +[7]: https://fossresponders.com/ +[8]: https://opensource.com/article/20/4/interview-Netha-Hussain From 9460816ae1aa48d049d5b51fa02bbb940cf7454c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Apr 2020 01:07:55 +0800 Subject: [PATCH 0504/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200428=20Lear?= =?UTF-8?q?n=20Bash=20with=20this=20book=20of=20puzzles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200428 Learn Bash with this book of puzzles.md --- ...28 Learn Bash with this book of puzzles.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sources/tech/20200428 Learn Bash with this book of puzzles.md diff --git a/sources/tech/20200428 Learn Bash with this book of puzzles.md b/sources/tech/20200428 Learn Bash with this book of puzzles.md new file mode 100644 index 0000000000..08a07b93c5 --- /dev/null +++ b/sources/tech/20200428 Learn Bash with this book of puzzles.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learn Bash with this book of puzzles) +[#]: via: (https://opensource.com/article/20/4/bash-it-out-book) +[#]: author: (Carlos Aguayo https://opensource.com/users/hwmaster1) + +Learn Bash with this book of puzzles +====== +'Bash it out' covers basic, medium, and advanced Bash scripting using 16 +puzzles. +![Puzzle pieces coming together to form a computer screen][1] + +Computers are both my hobby and my profession. I have about 10 of them scattered around my apartment, all running Linux (including my Macs). Since I enjoy upgrading my computers and my computer skills, when I came across [_Bash it out_][2] by Sylvain Leroux, I jumped on the chance to buy it. I use the command line a lot on Debian Linux, and it seemed like a great opportunity to expand my Bash knowledge. I smiled when the author explained in the preface that he uses Debian Linux, which is one of my two favorite distributions. + +Bash lets you automate tasks, so it's a labor-saving, interesting, and useful tool. Before reading the book, I already had a fair amount of experience with Bash on Unix and Linux. I'm not an expert, in part because the scripting language is so extensive and powerful. I first became intrigued with Bash when I saw it on the welcome screen of [EndeavourOS][3], an Arch-based Linux distribution. + +The following screenshots show some options from EndeavourOS. Beleieve it or not, these panels just point to Bash scripts, each of which accomplish some relatively complex tasks. And because it's all open source, I can modify any of these scripts if I want. + +![EndeavourOS after install][4] + +![EndeavourOS install apps][5] + +### Always something to learn + +My impressions of this book are very favorable. It's not long, but it is well-thought-out. The author has very extensive knowledge of Bash and an uncanny ability to explain how to use it. The book covers basic, medium, and advanced Bash scripting using 16 puzzles, which he calls "challenges." This taught me to see Bash scripting as a programming puzzle to solve, which makes it more interesting to play with. + +An exciting aspect of Bash is that it's deeply integrated with the Linux system. While part of its power lies in its syntax, it's also powerful because it has access to so much. You can script repetitive tasks, or tasks that are easy but you're just tired of performing manually. Nothing is too great or too small, and _Bash it out_ helps you understand both what you can do, and how to achieve it. + +This review would not be complete if I didn't mention David Both's free resource [_A sysadmin's guide to Bash scripting_][6] on Opensource.com. This 17-page PDF guide is different from _Bash it out_, but together they make a winning combination for anyone who wants to learn about it. + +I am not a computer programmer, but _Bash it out_ has increased my desire to get into more advanced levels of Bash scripting—I might inadvertently end up as a computer programmer without planning to. + +One reason I love Linux is because of how powerful and versatile the operating system is. However much I know about Linux, there is always something new to learn that makes me appreciate Linux even more. + +In a competitive and ever-changing job market, it behooves all of us to continuously update our skills. This book helped me learn Bash in a very hands-on way. It almost felt as if the author was in the same room with me, patiently guiding me in my learning. + +The author, Leroux, has an uncanny ability to engage readers. This is a rare gift that I think is even more valuable than his technical expertise. In fact, I am writing this book review to thank the author for anticipating my own learning needs; although we have never met, I have benefited in real ways from his gifts. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/bash-it-out-book + +作者:[Carlos Aguayo][a] +选题:[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/hwmaster1 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) +[2]: https://www.amazon.com/Bash-Out-Strengthen-challenges-difficulties/dp/1521773262/ +[3]: https://endeavouros.com/ +[4]: https://opensource.com/sites/default/files/uploads/endeavouros-welcome.png (EndeavourOS after install) +[5]: https://opensource.com/sites/default/files/uploads/endeavouros-install-apps.png (EndeavourOS install apps) +[6]: https://opensource.com/downloads/bash-scripting-ebook From 7ca0289cffc81041571e36e25b34ebdf50a897ba Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Apr 2020 01:10:48 +0800 Subject: [PATCH 0505/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200427=20New?= =?UTF-8?q?=20zine:=20How=20Containers=20Work!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200427 New zine- How Containers Work.md --- .../20200427 New zine- How Containers Work.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20200427 New zine- How Containers Work.md diff --git a/sources/tech/20200427 New zine- How Containers Work.md b/sources/tech/20200427 New zine- How Containers Work.md new file mode 100644 index 0000000000..fa2198ebbc --- /dev/null +++ b/sources/tech/20200427 New zine- How Containers Work.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (New zine: How Containers Work!) +[#]: via: (https://jvns.ca/blog/2020/04/27/new-zine-how-containers-work/) +[#]: author: (Julia Evans https://jvns.ca/) + +New zine: How Containers Work! +====== + +On Friday I published a new zine: “How Containers Work!”. I also launched a fun redesign of [wizardzines.com][1]. + +You can get it for $12 at . If you buy it, you’ll get a PDF that you can either print out or read on your computer. Or you can get a pack of [all 8 zines][2] so far. + +Here’s the cover and table of contents: + +[![][3]][4] + +### why containers? + +I’ve spent a lot of time [figuring][5] [out][6] [how to][7] [run][8] [things][9] [in][10] [containers][11] over the last 3-4 years. And at the beginning I was really confused! I knew a bunch of things about Linux, and containers didn’t seem to fit in with anything I thought I knew (“is it a process? what’s a network namespace? what’s happening?“). The whole thing seemed really weird. + +It turns out that containers ARE actually pretty weird. They’re not just one thing, they’re what you get when you glue together 6 different features that were mostly designed to work together but have a bunch of confusing edge cases. + +As usual, the thing that helped me the most in my container adventures is a good understanding of the **fundamentals** – what exactly is actually happening on my server when I run a container? + +So that’s what this zine is about – cgroups, namespaces, pivot_root, seccomp-bpf, and all the other Linux kernel features that make containers work. + +Once I understood those ideas, it got a **lot** easier to debug when my containers were doing surprising things in production. I learned a couple of interesting and strange things about containers while writing this zine too – I’ll probably write a blog post about one of them later this week. + +### containers aren’t magic + +This picture (page 6 of the zine) shows you how to run a fish container image with only 15 lines of bash. This is heavily inspired by [bocker][12], which “implements” Docker in about 100 lines of bash. + + + +The main things I see missing from that script compared to what Docker actually does when running a container (other than using an actual container image and not just a tarball) are: + + * it doesn’t drop any capabilities – the container is still running as root and has full root privileges (just in a different mount + PID namespace) + * it doesn’t block any system calls with seccomp-bpf + + + +### container command line tools + +The zine also goes over a bunch of command line tools & files that you can use to inspect running containers or play with Linux container features. Here’s a list: + + * `mount -t overlay` (create and view overlay filesystems) + * `unshare` (create namespaces) + * `nsenter` (use an existing namespace) + * `getpcaps` (get a process’s capabilities) + * `capsh` (drop or add capabilities, etc) + * `cgcreate` (create a cgroup) + * `cgexec` (run a command in an existing cgroup) + * `chroot` (change root directory. not actually what containers use but interesting to play with anyway) + * `/sys/fs/cgroups` (for information about cgroups, like `memory.usage_in_bytes`) + * `/proc/PID/ns` (all a process’s namespaces) + * `lsns` (another way to view namespaces) + + + +I also made a short youtube video a while back called [ways to spy on a Docker container][13] that demos some of these command line tools. + +### container runtime agnostic + +I tried to keep this zine pretty container-runtime-agnostic – I mention Docker a couple of times because it’s so widely used, but it’s about the Linux kernel features that make containers work in general, not Docker or LXC or systemd-nspawn or Kubernetes or whatever. If you understand the fundamentals you can figure all those things out! + +### we redesigned wizardzines.com! + +On Friday I also launched a redesign of [wizardzines.com][1]! [Melody Starling][14] (who is amazing) did the design. I think now it’s better organized but the tiny touch that I’m most delighted by is that now the zines jump with joy when you hover over them. + +One cool thing about working with a designer is – they don’t just make things _look_ better, they help _organize_ the information better so the website makes more sense and it’s easier to find things! This is probably obvious to anyone who knows anything about design but I haven’t worked with designers very much (or maybe ever?) so it was really cool to see. + +One tiny example of this: Melody had the idea of adding a tiny FAQ on the landing page for each zine, where I can put the answers to all the questions people always ask! Here’s what the little FAQ box looks like: + +[![][15]][4] + +I probably want to edit those questions & answers over time but it’s SO NICE to have somewhere to put them. + +### what’s next: maybe debugging! or working more on flashcards! + +The two projects I’m thinking about the most right now are + + 1. a zine about debugging, which I started last summer and haven’t gotten around to finishing yet + 2. a [flashcards project][16] that I’ve been adding to slowly over the last couple of months. I think could become a nice way to explain basic ideas. + + + +Here’s a link to where to [get the zine][4] again :) + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2020/04/27/new-zine-how-containers-work/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://wizardzines.com +[2]: https://wizardzines.com/zines/all-the-zines/ +[3]: https://jvns.ca/images/containers-cover.jpg +[4]: https://wizardzines.com/zines/containers +[5]: https://stripe.com/en-ca/blog/operating-kubernetes +[6]: https://jvns.ca/blog/2016/09/15/whats-up-with-containers-docker-and-rkt/ +[7]: https://jvns.ca/blog/2016/10/10/what-even-is-a-container/ +[8]: https://jvns.ca/blog/2016/12/22/container-networking/ +[9]: https://jvns.ca/blog/2016/10/26/running-container-without-docker/ +[10]: https://jvns.ca/blog/2017/02/17/mystery-swap/ +[11]: https://jvns.ca/blog/2016/10/02/a-list-of-container-software/ +[12]: https://github.com/p8952/bocker +[13]: https://www.youtube.com/watch?v=YCVSdnYzH34&t=1s +[14]: https://melody.dev +[15]: https://jvns.ca/images/wizardzines-faq.png +[16]: https://flashcards.wizardzines.com From 08a4631d0d7b1c10131ba93bb1ab691acfd384c2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 29 Apr 2020 08:48:20 +0800 Subject: [PATCH 0506/1809] translated --- ...ox is an All-in-one Messenger for Linux.md | 98 ------------------- ...ox is an All-in-one Messenger for Linux.md | 98 +++++++++++++++++++ 2 files changed, 98 insertions(+), 98 deletions(-) delete mode 100644 sources/tech/20200331 Rambox is an All-in-one Messenger for Linux.md create mode 100644 translated/tech/20200331 Rambox is an All-in-one Messenger for Linux.md diff --git a/sources/tech/20200331 Rambox is an All-in-one Messenger for Linux.md b/sources/tech/20200331 Rambox is an All-in-one Messenger for Linux.md deleted file mode 100644 index 5e6a8a2d5c..0000000000 --- a/sources/tech/20200331 Rambox is an All-in-one Messenger for Linux.md +++ /dev/null @@ -1,98 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Rambox is an All-in-one Messenger for Linux) -[#]: via: (https://itsfoss.com/rambox/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Rambox is an All-in-one Messenger for Linux -====== - -_**Brief: Rambox is an all-in-one messenger that lets you combine multiple services like Discord, Slack, Facebook Messenger and hundreds of more such services in one place.**_ - -### Rambox: Add multiple messaging Services in a single app - -![][1] - -Rambox is one of the best ways to manage multiple services for communication through a single app installed. You can use [multiple messaging services][2] like Facebook Messenger, Gmail chats, AOL, Discord, Google Duo, [Viber][3] and a lot more from the same interface. - -This way, you don’t need to install individual apps or keep them opened in browser all the time. You can use a master password to lock the Rambox application. You can also use do not disturb feature. - -Rambox offers an [open source community edition][4] which is free to use. The paid pro version gives you access to 600+ apps while the community addition has 99+ apps. Pro version has additional features like themes, hibernation, ad-block, spell check and premium support. - -Don’t worry. The open source community edition itself is quite useful and you may not even need those pro features. - -### Features of Rambox - -![][5] - -While you should find most of the essential features in the open-source edition, you might notice some of them limited to the pro version. - -Here, I’ve mentioned all the essential features available: - - * You get about 100 apps/services to choose from in the open-source edition - * Ability to protect the app with a single Master password lock - * Ability to lock each session that you load up - * Do Not Disturb mode - * Ability to sync apps and configuration across multiple devices. - * You can create and add custom apps - * Support for keyboard shortcuts - * Ability to enable/disable apps without needing to delete them - * JS & CSS injection support to tweak the styling of apps - * Ad-block (**pro version**) - * Hibernation support (**pro version**) - * Theme support (**pro version**) - * Mobile view **(pro version)** - * Spell check **(pro version)** - * Work hours – to schedule a time for incoming notifications **(pro version)** - * Proxies support **(pro version)** - - - -In addition to what I’ve listed here, you might find some more features in the Rambox Pro edition. To know more about it, you can refer to the [official list of features][6]. - -It is also worth noting that you cannot have more than 3 active simultaneous device connections. - -### Installing Rambox on Linux - -You can easily get started using Rambox using the **.AppImage** file available on the [official download page][4]. If you’re curious, you can refer our guide on how to [use the AppImage file on Linux][7]. - -In either case, you can also get it from the [Snap store][8]. Also, feel free to check their [GitHub releases section][9] for **.deb / .rpm** or other packages. - -[Download Rambox Community Edition][4] - -### Wrapping Up - -It can be a little overwhelming to have a lot of apps installed using Rambox. So, I’d suggest you monitor the RAM usage when adding more apps and using them for work. - -There is also a similar app called [Franz][10] which is also part open source and part premium like Rambox. - -Even though solutions like Rambox or Franz are quite useful, they aren’t always resource-friendly, specially if you start using tens of services at the same time. So, keep an eye on your system resources (if you notice a performance impact). - -Otherwise, it’s an impressive app that does the work that you’d expect. Have you tried it out? Feel free to let me know your thoughts! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/rambox/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rambox-ce.jpg?ssl=1 -[2]: https://itsfoss.com/best-messaging-apps-linux/ -[3]: https://itsfoss.com/viber-linux-client-beta-install/ -[4]: https://rambox.pro/#ce -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rambox-preferences.png?ssl=1 -[6]: https://rambox.pro/#features -[7]: https://itsfoss.com/use-appimage-linux/ -[8]: https://snapcraft.io/rambox -[9]: https://github.com/ramboxapp/community-edition/releases -[10]: https://itsfoss.com/franz-messaging-app/ diff --git a/translated/tech/20200331 Rambox is an All-in-one Messenger for Linux.md b/translated/tech/20200331 Rambox is an All-in-one Messenger for Linux.md new file mode 100644 index 0000000000..28a57f2842 --- /dev/null +++ b/translated/tech/20200331 Rambox is an All-in-one Messenger for Linux.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Rambox is an All-in-one Messenger for Linux) +[#]: via: (https://itsfoss.com/rambox/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Rambox 是 Linux 中多合一的消息收发工具 +====== + +_**简介:Rambox 是一个多合一消息收发工具,允许你将多种服务(如 Discord、Slack、Facebook Messenger)和数百个此类服务结合在一起。**_ + +### Rambox:在单个应用中添加多个消息服务 + +![][1] + +Rambox 是通过安装单个应用管理多个通信服务的最佳方式之一。你可以在一个界面使用[多个消息服务][2],如 Facebook Messenger、Gmail chats、AOL、Discord、Google Duo、[Viber][3] 等。 + +这样,你就不需要安装单独的应用或者在浏览器中保持打开。你可以使用主密码锁定 Rambox 应用。你还可以使用"请勿打扰"功能。 + +Rambox 提供可免费使用的[开源社区版][4]。付费专业版允许你访问 600 多个应用,而社区版则包含 99 多个应用。专业版本具有额外的功能,如主题、休眠、ad-block、拼写检查和高级支持。 + +不用担心。开源社区版本身非常有用,你甚至不需要这些专业功能。 + +### Rambox 的功能 + +![][5] + +虽然你应该在开源版中找到大多数基本功能,但你可能会注意到其中一些功能仅限于专业版。 + +此处,我说下所有的基本功能: + + * 在开源版本中,你有大约 100 个应用/服务可供选择 + * 能够使用单个主密码锁保护应用 + * 能够锁定加载的每个会话 + * 请勿打扰模式 + * 能够跨多个设备同步应用和配置 + * 你可以创建和添加自定义应用 + * 支持键盘快捷键 + * 启用/禁用应用而无需删除它们 + * JS 和 CSS 注入支持,以调整应用的样式 + * Ad-block (**专业版**) + * 休眠支持 (**专业版**) + * 主题支持(**专业版**) + * 移动视图 (**专业版**) + * 拼写检查 (**专业版**) + * 工作时间 - 计划传入通知时间 (**专业版**) + * 代理支持 (**专业版**) + + + +除了我在这里列出的内容外,你还可以在 Rambox Pro 版本中找到更多功能。要了解有关它的更多信息,你可以参考[正式功能列表][6]。 + +还值得注意的是,你不能有超过 3 个活跃并发设备连接。 + +### 在 Linux 上安装 Rambox + +你可以在[官方下载页][4]获取 **.AppImage** 文件来运行 Rambox。如果你好奇,你可以参考我们的指南,了解如何[在 Linux 上使用 AppImage 文件][7]。 + +另外,你也可以从 [Snap 商店][8]获取它。此外,请查看其 [GitHub release][9] 部分的 **.deb / .rpm** 或其他包。 + +[Download Rambox Community Edition][4] + +### 总结 + +使用 Rambox 安装大量应用可能会有点让人不知所措。因此,我建议你在添加更多应用并将其用于工作时监视内存使用情况。 + +还有一个类似的应用称为 [Franz][10],它也像 Rambox 部分开源、部分高级版。 + +尽管像 Rambox 或 Franz 这样的解决方案非常有用,但它们并不总是资源友好,特别是如果你同时使用数十个服务。因此,请留意系统资源(如果你注意到对性能的影响)。 + +除此之外,这是一个令人印象深刻的应用。你有试过了么?欢迎随时让我知道你的想法! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/rambox/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rambox-ce.jpg?ssl=1 +[2]: https://itsfoss.com/best-messaging-apps-linux/ +[3]: https://itsfoss.com/viber-linux-client-beta-install/ +[4]: https://rambox.pro/#ce +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rambox-preferences.png?ssl=1 +[6]: https://rambox.pro/#features +[7]: https://itsfoss.com/use-appimage-linux/ +[8]: https://snapcraft.io/rambox +[9]: https://github.com/ramboxapp/community-edition/releases +[10]: https://itsfoss.com/franz-messaging-app/ From bbbc641a6619d6009d59675eeed8d027a40820f4 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 29 Apr 2020 09:03:15 +0800 Subject: [PATCH 0507/1809] translating --- ...00428 Using Files and Folders on Desktop Screen in Ubuntu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md b/sources/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md index 40105e3aed..32eeaa9c95 100644 --- a/sources/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md +++ b/sources/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 17709c477be42b43b7f6430e1629e2a77ab8153b Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Wed, 29 Apr 2020 09:25:21 +0800 Subject: [PATCH 0508/1809] qfzy1233 is translating --- .../20200424 16 Things to do After Installing Ubuntu 20.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md b/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md index cca31a0426..5637651850 100644 --- a/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md +++ b/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qfzy1233) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1f2fb8ee41e52ab2ccc6b7a9406489aa0b48b911 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Apr 2020 09:41:42 +0800 Subject: [PATCH 0509/1809] PRF @wxy --- ... DNF and YUM, Why is Yum Replaced by DNF.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/translated/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md b/translated/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md index f73a3e180b..98f6e0cefe 100644 --- a/translated/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md +++ b/translated/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md @@ -1,20 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (The Difference Between DNF and YUM, Why is Yum Replaced by DNF?) [#]: via: (https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -DNF 和 YUM 的区别,为什么 YUM 会被 DNF 取代? +DNF 和 Yum 的区别,为什么 Yum 会被 DNF 取代? ====== 由于 Yum 中许多长期存在的问题仍未得到解决,因此 [Yum 包管理器][1]已被 [DNF 包管理器][2]取代。这些问题包括性能差、内存占用过多、依赖解析速度变慢等。 -DNF 使用 `libsolv` 进行依赖解析,由 SUSE 开发和维护,旨在提高性能。DNF 主要是用 Python 编写的,它有自己的应对依赖解析的方法。 +DNF 使用 `libsolv` 进行依赖解析,由 SUSE 开发和维护,旨在提高性能。 -Yum 是 RPM 的前端工具,它管理依赖关系和资源库,然后使用 RPM 来安装、下载和删除包。它的 API 没有完整的文档,它的扩展系统只允许 Python 插件。 +Yum 主要是用 Python 编写的,它有自己的应对依赖解析的方法。它的 API 没有完整的文档,它的扩展系统只允许 Python 插件。 + +Yum 是 RPM 的前端工具,它管理依赖关系和资源库,然后使用 RPM 来安装、下载和删除包。 为什么他们要建立一个新的工具,而不是修复现有的问题呢? @@ -33,17 +35,17 @@ Ales Kozamblak 解释说,这个修复在技术上是不可行的,而且 Yum 2 | API 有完整的文档 | API 没有完整的文档 3 | 由 C、C++、Python 编写的 | 只用 Python 编写 4 | DNF 目前在 Fedora、RHEL 8、CentOS 8、OEL 8 和 Mageia 6/7 中使用 | YUM 目前在 RHEL 6/7、CentOS 6/7、OEL 6/7 中使用 -5 | DNf 支持各种扩展 | Yum 只支持基于 Python 的扩展 +5 | DNF 支持各种扩展 | Yum 只支持基于 Python 的扩展 6 | API 有良好的文档,因此很容易创建新的功能 | 因为 API 没有正确的文档化,所以创建新功能非常困难 7 | DNF 在同步存储库的元数据时,使用的内存较少 | 在同步存储库的元数据时,YUM 使用了过多的内存 8 | DNF 使用满足性算法来解决依赖关系解析(它是用字典的方法来存储和检索包和依赖信息)| 由于使用公开 API 的原因,Yum 依赖性解析变得迟钝 9 | 从内存使用量和版本库元数据的依赖性解析来看,性能都不错 | 总的来说,在很多因素的影响下,表现不佳 10 | DNF 更新:在 DNF 更新过程中,如果包中包含不相关的依赖,则不会更新 | YUM 将在没有验证的情况下更新软件包 -11 | 如果启用的存储库没有响应,DNF 将跳过它,并继续使用可用的存储库出来事务 | 如果有存储库不可用,YUM 会立即停止 +11 | 如果启用的存储库没有响应,DNF 将跳过它,并继续使用可用的存储库处理事务 | 如果有存储库不可用,YUM 会立即停止 12 | `dnf update` 和 `dnf upgrade` 是等价的 | 在 Yum 中则不同 13 | 安装包的依赖关系不更新 | Yum 为这种行为提供了一个选项 14 | 清理删除的包:当删除一个包时,DNF 会自动删除任何没有被用户明确安装的依赖包 | Yum 不会这样做 -15 | 存储库缓存更新计划:默认情况下,系统启动后 10 分钟后,DNF 每小时检查一次对配置的存储库的更新。这个动作由系统定时器单元 `/usr/lib/systemd/system/system/dnf-makecache.timer` 控制 | Yum 也会这样做 +15 | 存储库缓存更新计划:默认情况下,系统启动后 10 分钟后,DNF 每小时会对配置的存储库检查一次更新。这个动作由系统定时器单元 `dnf-makecache.timer` 控制 | Yum 也会这样做 16 | 内核包不受 DNF 保护。不像 Yum,你可以删除所有的内核包,包括运行中的内核包 | Yum 不允许你删除运行中的内核 17 | libsolv:用于解包和读取资源库。hawkey: 为 libsolv 提供简化的 C 和 Python API 库。librepo: 提供 C 和 Python(类似 libcURL)API 的库,用于下载 Linux 存储库元数据和软件包。libcomps: 是 yum.comps 库的替代品。它是用纯 C 语言编写的库,有 Python 2 和 Python 3 的绑定。| Yum 不使用单独的库来执行这些功能 18 | DNF 包含 29000 行代码 | Yum 包含 56000 行代码 @@ -56,7 +58,7 @@ via: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7d1f1683e0a6f1af8ade655a83dafa6d7289d8a2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Apr 2020 09:42:53 +0800 Subject: [PATCH 0510/1809] PUB @wxy https://linux.cn/article-12161-1.html --- ...ference Between DNF and YUM, Why is Yum Replaced by DNF.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md (98%) diff --git a/translated/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md b/published/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md similarity index 98% rename from translated/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md rename to published/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md index 98f6e0cefe..8521ab4291 100644 --- a/translated/tech/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md +++ b/published/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12161-1.html) [#]: subject: (The Difference Between DNF and YUM, Why is Yum Replaced by DNF?) [#]: via: (https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From b7f0e1f5f16340ca1cace9038c9ca98185dee42d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 29 Apr 2020 10:00:52 +0800 Subject: [PATCH 0511/1809] Rename sources/tech/20200428 Fedora 32 is officially here.md to sources/news/20200428 Fedora 32 is officially here.md --- sources/{tech => news}/20200428 Fedora 32 is officially here.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200428 Fedora 32 is officially here.md (100%) diff --git a/sources/tech/20200428 Fedora 32 is officially here.md b/sources/news/20200428 Fedora 32 is officially here.md similarity index 100% rename from sources/tech/20200428 Fedora 32 is officially here.md rename to sources/news/20200428 Fedora 32 is officially here.md From 1152c82f7e00ea69e60a93e896f7d325a23e063f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 29 Apr 2020 10:08:24 +0800 Subject: [PATCH 0512/1809] Rename sources/tech/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md to sources/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md --- ...20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md (100%) diff --git a/sources/tech/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md b/sources/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md similarity index 100% rename from sources/tech/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md rename to sources/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md From 8892869d68b62bd805f5a72617da4cb30750d486 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 29 Apr 2020 10:15:44 +0800 Subject: [PATCH 0513/1809] Rename sources/tech/20200428 How I empower and reach millions through open source.md to sources/talk/20200428 How I empower and reach millions through open source.md --- ...200428 How I empower and reach millions through open source.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200428 How I empower and reach millions through open source.md (100%) diff --git a/sources/tech/20200428 How I empower and reach millions through open source.md b/sources/talk/20200428 How I empower and reach millions through open source.md similarity index 100% rename from sources/tech/20200428 How I empower and reach millions through open source.md rename to sources/talk/20200428 How I empower and reach millions through open source.md From cad41935fea060af0eb836f1b0060f4bedab2423 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Apr 2020 11:24:47 +0800 Subject: [PATCH 0514/1809] APL --- sources/news/20200428 Fedora 32 is officially here.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20200428 Fedora 32 is officially here.md b/sources/news/20200428 Fedora 32 is officially here.md index 67989780ea..a3066f6ae1 100644 --- a/sources/news/20200428 Fedora 32 is officially here.md +++ b/sources/news/20200428 Fedora 32 is officially here.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 06f5b5082c96092be7b3d64385c52111fad1e4bd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Apr 2020 11:56:19 +0800 Subject: [PATCH 0515/1809] TSL&PRF --- .../20200428 Fedora 32 is officially here.md | 77 ------------------- .../20200428 Fedora 32 is officially here.md | 77 +++++++++++++++++++ 2 files changed, 77 insertions(+), 77 deletions(-) delete mode 100644 sources/news/20200428 Fedora 32 is officially here.md create mode 100644 translated/news/20200428 Fedora 32 is officially here.md diff --git a/sources/news/20200428 Fedora 32 is officially here.md b/sources/news/20200428 Fedora 32 is officially here.md deleted file mode 100644 index a3066f6ae1..0000000000 --- a/sources/news/20200428 Fedora 32 is officially here.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Fedora 32 is officially here!) -[#]: via: (https://fedoramagazine.org/announcing-fedora-32/) -[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) - -Fedora 32 is officially here! -====== - -![][1] - -It’s here! We’re proud to announce the release of Fedora 32. Thanks to the hard work of thousands of Fedora community members and contributors, we’re celebrating yet another on-time release. - -If you just want to get to the bits without delay, head over to right now. For details, read on! - -## **All of Fedora’s Flavors** - -Fedora Editions are targeted outputs geared toward specific “showcase” uses. - -Fedora Workstation focuses on the desktop. In particular, it’s geared toward software developers who want a “just works” Linux operating system experience. This release features [GNOME 3.36][2], which has plenty of great improvements as usual. My favorite is the new lock screen! - -Fedora Server brings the latest in cutting-edge open source server software to systems administrators in an easy-to-deploy fashion. For edge computing use cases, [Fedora IoT][3] provides a strong foundation for IoT ecosystems. - -Fedora CoreOS is an emerging Fedora Edition. It’s an automatically-updating, minimal operating system for running containerized workloads securely and at scale. It offers several [update streams][4] that can be followed for automatic updates that occur roughly every two weeks. Currently the **next** stream is based on Fedora 32, with the **testing** and **stable** streams to follow. You can find information about released artifacts that follow the **next** stream from [the download page][5] and information about how to use those artifacts in the [Fedora CoreOS Documentation][6]. - -Of course, we produce more than just the editions. [Fedora Spins][7] and [Labs][8] target a variety of audiences and use cases, including the [Fedora Astronomy Lab][9], which brings a complete open source toolchain to both amateur and professional astronomers, and desktop environments like [KDE Plasma][10] and [Xfce][11]. New in Fedora 32 is the [Comp Neuro Lab][12], developed by our Neuroscience Special Interest Group to enable computational neuroscience. - -And, don’t forget our alternate architectures: [ARM AArch64, Power, and S390x][13]. Of particular note, we have improved support for the Rockchip system-on-a-chip devices including the Rock960, RockPro64, and Rock64. - -**General improvements** - -No matter what variant of Fedora you use, you’re getting the latest the open source world has to offer. Following our “[First][14]” foundation, we’ve updated key programming language and system library packages, including GCC 10, Ruby 2.7, and Python 3.8. Of course, with Python 2 past end-of-life, we’ve removed most Python 2 packages from Fedora. A legacy python27 package is provided for developers and users who still need it. In Fedora Workstation, we’ve enabled the EarlyOOM service by default to improve the user experience in low-memory situations. - -We’re excited for you to try out the new release! Go to and download it now. Or if you’re already running a Fedora operating system, follow the easy [upgrade instructions][15]. - -## **In the unlikely event of a problem….** - -If you run into a problem, check out the [Fedora 32 Common Bugs][16] page, and if you have questions, visit our [Ask Fedora][17] user-support platform. - -## **Thank you everyone** - -Thanks to the thousands of people who contributed to the Fedora Project in this release cycle, and especially to those of you who worked extra hard to make this another on-time release during a pandemic. Fedora is a community, and it’s great to see how much we’ve supported each other. I invite you to join us in the [Red Hat Summit Virtual Experience][18] 28-29 April to learn more about Fedora and other communities. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/announcing-fedora-32/ - -作者:[Matthew Miller][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/mattdm/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/f32-final-816x345.png -[2]: https://www.gnome.org/news/2020/03/gnome-3-36-released/ -[3]: https://iot.fedoraproject.org/ -[4]: https://docs.fedoraproject.org/en-US/fedora-coreos/update-streams/ -[5]: https://getfedora.org/en/coreos/download?stream=next -[6]: https://docs.fedoraproject.org/en-US/fedora-coreos/getting-started/ -[7]: https://spins.fedoraproject.org/ -[8]: https://labs.fedoraproject.org/ -[9]: https://labs.fedoraproject.org/en/astronomy/ -[10]: https://spins.fedoraproject.org/en/kde/ -[11]: https://spins.fedoraproject.org/en/xfce/ -[12]: https://labs.fedoraproject.org/en/comp-neuro -[13]: https://alt.fedoraproject.org/alt/ -[14]: https://docs.fedoraproject.org/en-US/project/#_first -[15]: https://docs.fedoraproject.org/en-US/quick-docs/upgrading/ -[16]: https://fedoraproject.org/wiki/Common_F32_bugs -[17]: http://ask.fedoraproject.org -[18]: https://www.redhat.com/en/summit diff --git a/translated/news/20200428 Fedora 32 is officially here.md b/translated/news/20200428 Fedora 32 is officially here.md new file mode 100644 index 0000000000..5b9bfbf49d --- /dev/null +++ b/translated/news/20200428 Fedora 32 is officially here.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora 32 is officially here!) +[#]: via: (https://fedoramagazine.org/announcing-fedora-32/) +[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) + +Fedora 32 正式发布! +====== + +![][1] + +它来了! 我们很荣幸地宣布 Fedora 32 的发布。感谢成千上万的 Fedora 社区成员和贡献者的辛勤工作,我们又一次准时发布了。 + +如果你只想马上就能拿到它,请马上访问 。更多详情,请继续阅读本文。 + +### Fedora 的全部变种 + +Fedora Editions 是针对特定的“展示”用途输出的。 + +Fedora Workstation 专注于桌面系统。特别是,它面向的是那些希望获得“可以工作的” Linux 操作系统体验的软件开发者。这个版本采用了 [GNOME 3.36][2],一如既往地有很多很棒的改进。我最喜欢的是新的锁屏! + +Fedora Server 以一种易于部署的方式为系统管理员带来了新锐的开源服务器软件。对于边缘计算用例,[Fedora IoT][3] 为 IoT 生态系统提供了坚实的基础。 + +Fedora CoreOS 是一个新兴的 Fedora Edition。它是一个自动更新的、最小化的操作系统,用于安全地大规模运行容器化工作负载。它提供了几个[更新流][4],遵循大约每两周一次的自动更新。目前,next 流是基于 Fedora 32,后续还有 testing 流和 stable 流。你可以从[下载页面][5]中找到关于按 next 流发布的工件的信息,并在 [Fedora CoreOS 文档][6]中找到关于如何使用这些工件的信息。 + +当然,我们制作的不仅仅是 Editions。[Fedora Spins][7] 和[实验室][8]针对的是不同的受众和用例,包括[Fedora 天文学实验室][9],它为业余和专业的天文学家带来了完整的开源工具链,还有像 [KDE Plasma][10] 和 [Xfce][11] 这样的桌面环境。Fedora 32 中新增的 [计算神经科学实验室][12] 是由我们的神经科学特别兴趣小组开发的,它可以实现计算神经科学。 + +还有,别忘了我们的备用架构,[ARM AArch64、Power 和 S390x][13]。特别值得一提的是,我们改进了对 Rockchip 系统级芯片的支持,包括 Rock960、RockPro64 和 Rock64。 + +### 一般性的改进 + +无论你使用 Fedora 的哪个变体,你都能获得最新的开源世界。遵循我们的“[First][14]”理念,我们更新了关键的编程语言和系统库包,包括 GCC 10、Ruby 2.7 和 Python 3.8。当然,随着 Python 2 已经过了报废期,我们已经从 Fedora 中删除了大部分 Python 2 包,但我们为仍然需要它的开发者和用户提供了一个遗留的 python27 包。在 Fedora Workstation 中,我们默认启用了 EarlyOOM 服务,以改善低内存情况下的用户体验。 + +我们非常期待你能尝试一下新版本的使用体验! 现在就去 下载它。或者如果你已经在运行 Fedora 操作系统,请按照简单的[升级说明][15]进行升级。 + +### 万一出现问题…… + +如果你遇到问题,请查看[Fedora 32 常见错误][16]页面,如果有问题,请访问我们的 [Askedora][17] 用户支持平台。 + +### 谢谢大家 + +感谢在这个发布周期中为 Fedora 项目做出贡献的成千上万的人,特别是感谢那些在大流行期间为又一次准时发布而付出额外努力的人。Fedora 是一个社区,很高兴看到我们彼此之间的支持。我邀请大家参加 4 月28-29 日的[红帽峰会虚拟体验][18],了解更多关于 Fedora 和其他社区的信息。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/announcing-fedora-32/ + +作者:[Matthew Miller][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/mattdm/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/f32-final-816x345.png +[2]: https://www.gnome.org/news/2020/03/gnome-3-36-released/ +[3]: https://iot.fedoraproject.org/ +[4]: https://docs.fedoraproject.org/en-US/fedora-coreos/update-streams/ +[5]: https://getfedora.org/en/coreos/download?stream=next +[6]: https://docs.fedoraproject.org/en-US/fedora-coreos/getting-started/ +[7]: https://spins.fedoraproject.org/ +[8]: https://labs.fedoraproject.org/ +[9]: https://labs.fedoraproject.org/en/astronomy/ +[10]: https://spins.fedoraproject.org/en/kde/ +[11]: https://spins.fedoraproject.org/en/xfce/ +[12]: https://labs.fedoraproject.org/en/comp-neuro +[13]: https://alt.fedoraproject.org/alt/ +[14]: https://docs.fedoraproject.org/en-US/project/#_first +[15]: https://docs.fedoraproject.org/en-US/quick-docs/upgrading/ +[16]: https://fedoraproject.org/wiki/Common_F32_bugs +[17]: http://ask.fedoraproject.org +[18]: https://www.redhat.com/en/summit From 5d5cd0484d61b867d1b3d21cb394ed559b34b025 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Apr 2020 11:59:17 +0800 Subject: [PATCH 0516/1809] PUB @wxy https://linux.cn/article-12164-1.html --- .../20200428 Fedora 32 is officially here.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20200428 Fedora 32 is officially here.md (98%) diff --git a/translated/news/20200428 Fedora 32 is officially here.md b/published/20200428 Fedora 32 is officially here.md similarity index 98% rename from translated/news/20200428 Fedora 32 is officially here.md rename to published/20200428 Fedora 32 is officially here.md index 5b9bfbf49d..acad6862f5 100644 --- a/translated/news/20200428 Fedora 32 is officially here.md +++ b/published/20200428 Fedora 32 is officially here.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12164-1.html) [#]: subject: (Fedora 32 is officially here!) [#]: via: (https://fedoramagazine.org/announcing-fedora-32/) [#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) From 95109ddc9f3af37e04d426ff034d8c1bc5027d10 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Apr 2020 21:49:06 +0800 Subject: [PATCH 0517/1809] PRF @geekpi --- ...Addresses, and Interface Speed on Linux.md | 72 +++++++++---------- 1 file changed, 34 insertions(+), 38 deletions(-) diff --git a/translated/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md b/translated/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md index e586660e0c..10d95aab72 100644 --- a/translated/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md +++ b/translated/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md @@ -1,34 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux) [#]: via: (https://www.2daygeek.com/linux-unix-check-network-interfaces-names-nic-speed-ip-mac-address/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -如何在 Linux 上检查可用的网络接口、关联的 IP 地址、MAC 地址和接口速度 +如何在 Linux 上检查网卡信息 ====== -默认在设置服务器时,你将配置主网络接口。 +![](https://img.linux.net.cn/data/attachment/album/202004/29/214835m1ms3n00s6qbcycz.jpg) -这是每个人所做的构建工作的一部分。 +默认情况下,在设置服务器时你会配置主网络接口。这是每个人所做的构建工作的一部分。有时出于各种原因,你可能需要配置额外的网络接口。 -有时出于各种原因,你可能需要配置额外的网络接口。 +这可以是通过网络绑定bonding/协作teaming来提供高可用性,也可以是用于应用需求或备份的单独接口。 -这可以是网络绑定/团队合作或高可用性,也可以是用于应用需求或备份的单独接口。 +为此,你需要知道计算机有多少接口以及它们的速度来配置它们。 -为此,你需要知道计算机有多少接口以及它们的配置速度。 - -有许多命令可检查可用的网络接口,但是我们仅使用 IP 命令。 - -稍后,我们将使用所有这些工具编写单独的文章。 +有许多命令可检查可用的网络接口,但是我们仅使用 `ip` 命令。以后,我们会另外写一篇文章来全部介绍这些工具。 在本教程中,我们将向你显示可用网络网卡(NIC)信息,例如接口名称、关联的 IP 地址、MAC 地址和接口速度。 -### 什么是 IP 命令 +### 什么是 ip 命令 -**[IP 命令][1]**类似于 ifconfig, 用于分配静态 IP 地址、路由和默认网关等。 +[ip 命令][1] 类似于 `ifconfig`, 用于分配静态 IP 地址、路由和默认网关等。 ``` # ip a @@ -47,15 +43,15 @@ ### 什么是 ethtool 命令 -ethtool 用于查询或控制网络驱动或硬件设置。 +`ethtool` 用于查询或控制网络驱动或硬件设置。 ``` # ethtool eth0 ``` -### 1)如何在 Linux 上使用 IP 命令检查可用的网络接口 +### 1)如何在 Linux 上使用 ip 命令检查可用的网络接口 -在不带任何参数的情况下运行 IP 命令时,它会提供大量信息,但是,如果仅需要可用的网络接口,请使用以下定制的 IP 命令。 +在不带任何参数的情况下运行 `ip` 命令时,它会提供大量信息,但是,如果仅需要可用的网络接口,请使用以下定制的 `ip` 命令。 ``` # ip a |awk '/state UP/{print $2}' @@ -64,13 +60,13 @@ eth0: eth1: ``` -### 2)如何在 Linux 上使用 IP 命令检查网络接口的 IP 地址 +### 2)如何在 Linux 上使用 ip 命令检查网络接口的 IP 地址 -如果只想查看 IP 地址分配给了哪个接口,请使用以下定制的 IP 命令。 +如果只想查看 IP 地址分配给了哪个接口,请使用以下定制的 `ip` 命令。 ``` # ip -o a show | cut -d ' ' -f 2,7 -or +或 ip a |grep -i inet | awk '{print $7, $2}' lo 127.0.0.1/8 @@ -78,18 +74,18 @@ lo 127.0.0.1/8 192.168.1.102/24 ``` -### 3)如何在 Linux 上使用 IP 命令检查网卡的 MAC 地址 +### 3)如何在 Linux 上使用 ip 命令检查网卡的 MAC 地址 如果只想查看网络接口名称和相应的 MAC 地址,请使用以下格式。 -检查特定的网络接口的 MAC 地址。 +检查特定的网络接口的 MAC 地址: ``` # ip link show dev eth0 |awk '/link/{print $2}' 00:00:00:55:43:5c ``` -检查所有网络接口的 MAC 地址。 +检查所有网络接口的 MAC 地址,创建该脚本: ``` # vi /opt/scripts/mac-addresses.sh @@ -97,12 +93,12 @@ lo 127.0.0.1/8 #!/bin/sh ip a |awk '/state UP/{print $2}' | sed 's/://' | while read output; do -echo $output: -ethtool -P $output + echo $output: + ethtool -P $output done ``` -运行下面的 shell 脚本获取多个网络接口的 MAC 地址。 +运行该脚本获取多个网络接口的 MAC 地址: ``` # sh /opt/scripts/mac-addresses.sh @@ -115,9 +111,9 @@ Permanent address: 00:00:00:55:43:5d ### 4)如何在 Linux 上使用 ethtool 命令检查网络接口速度 -如果要在 Linux 上检查网络接口速度,请使用 ethtool 命令。 +如果要在 Linux 上检查网络接口速度,请使用 `ethtool` 命令。 -检查特定网络接口的速度。 +检查特定网络接口的速度: ``` # ethtool eth0 |grep "Speed:" @@ -125,7 +121,7 @@ Permanent address: 00:00:00:55:43:5d Speed: 10000Mb/s ``` -检查所有网络接口速度。 +检查所有网络接口速度,创建该脚本: ``` # vi /opt/scripts/port-speed.sh @@ -133,12 +129,12 @@ Speed: 10000Mb/s #!/bin/sh ip a |awk '/state UP/{print $2}' | sed 's/://' | while read output; do -echo $output: -ethtool $output |grep "Speed:" + echo $output: + ethtool $output |grep "Speed:" done ``` -运行以下 shell 脚本获取多个网络接口速度。 +运行该脚本获取多个网络接口速度: ``` # sh /opt/scripts/port-speed.sh @@ -151,7 +147,7 @@ Speed: 10000Mb/s ### 5)验证网卡信息的 Shell 脚本 -通过此 **[shell 脚本][2]**,你可以收集上述所有信息,例如网络接口名称、网络接口的 IP 地址,网络接口的 MAC 地址以及网络接口的速度。 +通过此 shell 脚本你可以收集上述所有信息,例如网络接口名称、网络接口的 IP 地址,网络接口的 MAC 地址以及网络接口的速度。创建该脚本: ``` # vi /opt/scripts/nic-info.sh @@ -161,14 +157,14 @@ hostname echo "-------------" for iname in $(ip a |awk '/state UP/{print $2}') do -echo "$iname" -ip a | grep -A2 $iname | awk '/inet/{print $2}' -ip a | grep -A2 $iname | awk '/link/{print $2}' -ethtool $iname |grep "Speed:" + echo "$iname" + ip a | grep -A2 $iname | awk '/inet/{print $2}' + ip a | grep -A2 $iname | awk '/link/{print $2}' + ethtool $iname |grep "Speed:" done ``` -运行以下 shell 脚本检查网卡信息。 +运行该脚本检查网卡信息: ``` # sh /opt/scripts/nic-info.sh @@ -192,7 +188,7 @@ via: https://www.2daygeek.com/linux-unix-check-network-interfaces-names-nic-spee 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d4649a859a8783f4009c79b60d5c39ebacac3e21 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Apr 2020 21:49:38 +0800 Subject: [PATCH 0518/1809] PUB @geekpi https://linux.cn/article-12165-1.html --- ... Addresses, MAC Addresses, and Interface Speed on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md (98%) diff --git a/translated/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md b/published/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md similarity index 98% rename from translated/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md rename to published/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md index 10d95aab72..8464da643e 100644 --- a/translated/tech/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md +++ b/published/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12165-1.html) [#]: subject: (How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux) [#]: via: (https://www.2daygeek.com/linux-unix-check-network-interfaces-names-nic-speed-ip-mac-address/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From a3a6873ca6a01afc1200612d2c4695acbc13e60a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Apr 2020 23:01:06 +0800 Subject: [PATCH 0519/1809] APL --- ...200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md b/sources/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md index 377a58f34a..dfa900d9cf 100644 --- a/sources/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md +++ b/sources/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5ca67f76337225ef128bf79ac114127056740d4b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Apr 2020 23:29:56 +0800 Subject: [PATCH 0520/1809] TSL&PRF --- ...Lysia Arrives with ZFS and Snap Support.md | 112 ------------------ ...Lysia Arrives with ZFS and Snap Support.md | 110 +++++++++++++++++ 2 files changed, 110 insertions(+), 112 deletions(-) delete mode 100644 sources/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md create mode 100644 translated/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md diff --git a/sources/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md b/sources/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md deleted file mode 100644 index dfa900d9cf..0000000000 --- a/sources/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md +++ /dev/null @@ -1,112 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Manjaro 20 Lysia Arrives with ZFS and Snap Support) -[#]: via: (https://itsfoss.com/manjaro-20-release/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Manjaro 20 Lysia Arrives with ZFS and Snap Support -====== - -_**Manjaro Linux has refreshed its ISO with Manjaro 20 “Lysia”. It now supports Snap and Flatpak packages in Pamac. ZFS option is added in Manjaro Architect installer and the latest kernel 5.6 is used as the base.**_ - -It’s raining new distribution releases. Ubuntu 20.04 LTS was released last week. Fedora 32 will be releasing shortly and [Manjaro has released version 20][1] codenamed Lysia. - -### What’s new in Manjaro 20 Lysia? - -Plenty actually. Let me show you some of the major new features in Manjaro 20. - -#### New Matcha theme - -Manjaro 20 has a new default theme called Matcha. It gives the desktop a more polished look. - -![][2] - -#### Snap and Flatpak support in Pamac and terminal - -Snap and Flatpak package support is improved. You can use them in command line if you want. - -You can also enable Snap and Flatpak support in the Pamac GUI package manager. - -![Enable Snap support in Pamac Manjaro][3] - -Once enabled, you can find and install Snap/Flatpak applications in the Pamac software manager. - -![Snap applications in Pamac][4] - -#### Pamac offers to install new software based on search (in GNOME) - -In the GNOME variant, if you search for something, Pamac software manager will now offer to install software that match the query. GNOME Software Center does that in other distributions that use GNOME desktop. - -#### ZFS support lands in Manjaro Architect - -You can now easily use ZFS as root in Manjaro Linux. The [ZFS file system][5] support is available in [Manjaro Architect][6]. - -Do note that I am saying Manjaro Architect, the terminal based installer. It’s not the same as the regular graphical [Calamares installer][7]. - -![][8] - -#### Linux kernel 5.6 - -The latest stable [Linux kernel 5.6][9] brings more hardware support for thunderbolt, Nvidia and USB4. You can also use [WireGuard VPN][10]. - -![][11] - -#### Miscellaneous other features - - * New desktop environment versions: Xfce 4.14, GNOME 3.36 and KDE Plasma 5.18 - * zsh is the new default shell - * Display-Profiles allows you to store one or more profiles for your preferred display configuration - * Improved Gnome-Layout-Switcher - * Latest drivers - * Improved and polished Manjaro tools - - - -### How to get Manjaro 20 Lysia? - -_**If you are already using it, just update your Manjaro Linux system and you should already be using version 20.**_ - -Manjaro uses a rolling release model which means you don’t have to manually upgrade from one version to another. You don’t have to reinstall as soon as there is a new version is released. - -If Manjaro is rolling release distribution, why does it release a new version every now and then? It’s because they have to refresh the ISO so that new users downloading Manjaro will not have to install updates for last few years. This is why Arch Linux also refreshes its ISO every month. - -Manjaro ‘ISO refreshes’ are codenamed and have a version because it helps the developers clearly mark each stage of development. - -So, the bottom line is that if you are already using it, just [update your Manjaro Linux system][12] using Pamac or command line. - -If you want to try Manjaro or if you want to use ZFS, then you can [install Manjaro][13] by downloading the ISO from its website: - -[Download Manjaro Linux][14] - -Enjoy the new release of Manjaro Linux. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/manjaro-20-release/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://forum.manjaro.org/t/manjaro-20-0-lysia-released/138633 -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/manjaro-20-lysia.jpeg?resize=800%2C440&ssl=1 -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-snap-in-pamac-manjaro.jpg?resize=800%2C490&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/snap-app-pacman.jpg?resize=800%2C489&ssl=1 -[5]: https://itsfoss.com/what-is-zfs/ -[6]: https://itsfoss.com/manjaro-architect-review/ -[7]: https://calamares.io/ -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/pacman-prompts-install-apps.jpg?resize=800%2C331&ssl=1 -[9]: https://itsfoss.com/linux-kernel-5-6/ -[10]: https://itsfoss.com/wireguard/ -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/manjaro-20-neofetch-screen.jpg?resize=800%2C495&ssl=1 -[12]: https://itsfoss.com/update-arch-linux/ -[13]: https://itsfoss.com/install-manjaro-linux/ -[14]: https://manjaro.org/download/ diff --git a/translated/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md b/translated/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md new file mode 100644 index 0000000000..80a2a95e10 --- /dev/null +++ b/translated/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md @@ -0,0 +1,110 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manjaro 20 Lysia Arrives with ZFS and Snap Support) +[#]: via: (https://itsfoss.com/manjaro-20-release/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Manjaro 20 Lysia 到来,支持 ZFS 和 Snap +====== + +![](https://img.linux.net.cn/data/attachment/album/202004/29/232925j8paomvp11pfu12v.jpg) + +> Manjaro Linux 刷新了其 Manjaro 20 “Lysia” 的 ISO。现在在 Pamac 中支持了 Snap 和 Flatpak 软件包。在 Manjaro Architect 安装程序中增加了 ZFS 选项,并使用最新的内核 5.6 作为基础。 + +最近新的发行版的发布像下雨一样。在上周发布了 [Ubuntu 20.04 LTS](https://linux.cn/article-12142-1.html) ,紧接着 [Fedora 32](https://linux.cn/article-12164-1.html) 也刚刚发布,而现在 [Manjaro 发布了版本 20][1],代号为 Lysia。 + +### Manjaro 20 Lysia 有什么新东西? + +其实有很多。让我给大家介绍一下 Manjaro 20 中的一些主要新功能。 + +#### 新的抹茶主题 + +Manjaro 20 有一个新的默认主题,名为 Matcha(抹茶)。它让桌面看起来更有质感。 + +![][2] + +#### 对 Snap 和 Flatpak 的支持 + +Snap 和 Flatpak 软件包的支持得到了改进。如果你愿意,你可以在命令行中使用它们。 + +你还可以在 Pamac 图形界面包管理器中启用 Snap 和 Flatpak 支持。 + +![Enable Snap support in Pamac Manjaro][3] + +启用后,你可以在 Pamac 软件管理器中找到并安装 Snap/Flatpak 应用程序。 + +![Snap applications in Pamac][4] + +#### Pamac 提供了基于搜索安装新软件的方式(在 GNOME 中) + +在 GNOME 变种中,如果你搜索某个东西,Pamac 软件管理器会提供安装符合查询的软件。在其他使用 GNOME 桌面的发行版中,GNOME 软件中心也会这样做。 + +#### ZFS 支持登陆了 Manjaro Architect + +现在,你可以在 Manjaro Linux 中轻松地使用 ZFS 作为根文件系统。在 [Manjaro Architect][6] 中提供了对 [ZFS 文件系统][5]的支持。 + +请注意,我说的是 Manjaro Architect,即基于终端的安装程序。它和普通的图形化的 [Calamares 安装程序][7]不一样。 + +![][8] + +#### Linux kernel 5.6 + +最新的稳定版 [Linux 内核 5.6][9] 带来了更多的硬件支持,如 thunderbolt、Nvidia 和 USB4。你也可以使用 [WireGuard VPN][10]。 + +![][11] + +#### 其他杂项变化 + + * 新的桌面环境版本:Xfce 4.14、GNOME 3.36 和 KDE Plasma 5.18。 + * 新的默认 shell 是 zsh。 + * Display-Profiles 允许你存储一个或多个配置文件,用于你的首选显示配置。 + * 改进后的 Gnome-Layout-Switcher。 + * 最新的驱动程序。 + * 改进和完善了 Manjaro 工具。 + +### 如何取得 Manjaro 20 Lysia? + +如果你已经在使用 Manjaro,只需更新你的 Manjaro Linux 系统,你就应该已经在使用 Lysia 了。 + +Manjaro 采用了滚动发布模式,这意味着你不必手动从一个版本升级到另一个版本。只要有新的版本发布,不需要重新安装就可以使用了。 + +既然 Manjaro 是滚动发布的,为什么每隔一段时间就会发布一个新版本呢?这是因为他们要刷新 ISO,这样下载 Manjaro 的新用户就不用再安装过去几年的更新了。这就是为什么 Arch Linux 也会每个月刷新一次 ISO 的原因。 + +Manjaro 的“ISO 刷新”是有代号和版本的,因为它可以帮助开发者清楚地标明每个开发阶段的发展方向。 + +所以,如果你已经在使用它,只需使用 Pamac 或命令行[更新你的 Manjaro Linux 系统][12]即可。 + +如果你想尝试 Manjaro 或者想使用 ZFS,那么你可以通过从它的网站上[下载 ISO][14] 来[安装 Manjaro][13]。 + +愿你喜欢新的 Manjaro Linux 发布。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/manjaro-20-release/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://forum.manjaro.org/t/manjaro-20-0-lysia-released/138633 +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/manjaro-20-lysia.jpeg?resize=800%2C440&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-snap-in-pamac-manjaro.jpg?resize=800%2C490&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/snap-app-pacman.jpg?resize=800%2C489&ssl=1 +[5]: https://itsfoss.com/what-is-zfs/ +[6]: https://itsfoss.com/manjaro-architect-review/ +[7]: https://calamares.io/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/pacman-prompts-install-apps.jpg?resize=800%2C331&ssl=1 +[9]: https://itsfoss.com/linux-kernel-5-6/ +[10]: https://itsfoss.com/wireguard/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/manjaro-20-neofetch-screen.jpg?resize=800%2C495&ssl=1 +[12]: https://itsfoss.com/update-arch-linux/ +[13]: https://itsfoss.com/install-manjaro-linux/ +[14]: https://manjaro.org/download/ From 8a93e2a3fcacdb959b7c30d197e6903435047286 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Apr 2020 23:38:43 +0800 Subject: [PATCH 0521/1809] PUB @wxy https://linux.cn/article-12166-1.html --- ...0429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md (98%) diff --git a/translated/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md b/published/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md similarity index 98% rename from translated/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md rename to published/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md index 80a2a95e10..2ed94dd0a8 100644 --- a/translated/news/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md +++ b/published/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12166-1.html) [#]: subject: (Manjaro 20 Lysia Arrives with ZFS and Snap Support) [#]: via: (https://itsfoss.com/manjaro-20-release/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 2927a899e506b40a719cb0b723d12708a8cfe5f7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Apr 2020 00:55:03 +0800 Subject: [PATCH 0522/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200430=20Thre?= =?UTF-8?q?e=20Methods=20Boot=20CentOS/RHEL=207/8=20Systems=20in=20Single?= =?UTF-8?q?=20User=20Mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md --- ...OS-RHEL 7-8 Systems in Single User Mode.md | 159 ++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 sources/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md diff --git a/sources/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md b/sources/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md new file mode 100644 index 0000000000..a3f3768533 --- /dev/null +++ b/sources/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md @@ -0,0 +1,159 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Three Methods Boot CentOS/RHEL 7/8 Systems in Single User Mode) +[#]: via: (https://www.2daygeek.com/boot-centos-7-8-rhel-7-8-single-user-mode/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Three Methods Boot CentOS/RHEL 7/8 Systems in Single User Mode +====== + +Single user mode, also referred to as maintenance mode, which allows a single super user to recover/repair system problems. + +Generally, these problems cannot be solved in a multi-user environment. The system can boot but will not function properly or you will not be able to log in. + +It uses `runlevel1.target` or `rescue.target` on **[Red Hat][1]** (RHEL) 7/8 based systems. + +In this mode, the system mount all local file systems, but does not activate network interfaces. + +It only enables certain services and minimal functionality to repair the system. + +This method is mostly useful when you want to run fsck to fix corrupted file systems, or to reset a forgotten root password, or to fix a mount point issue on the system. + +You can boot **[CentOS][2]**/**[RHEL][3]** 7/8 systems in single user mode using the below three methods. + + * **Method-1:** Boot CentOS/RHEL 7/8 systems in single user mode by adding the “rd.break” parameter to the kernel + * **Method-2:** Boot CentOS/RHEL 7/8 systems in single user mode by replacing the “rhgb quiet” word with the “init=/bin/bash or init=/bin/sh” parameter in the kernel + * **Method-3:** Boot CentOS/RHEL 7/8 systems in single user mode by replacing the “ro” word with the “rw init=/sysroot/bin/sh” parameter in the kernel + + + +### Method-1: Boot CentOS/RHEL 7/8 systems in single user mode by adding the “rd.break” parameter to the kernel + +Reboot your system, on the GRUB2 boot screen, press the `"e"` key to edit the selected kernel. You need to select the first line, the first one is the latest kernel whereas you can select the different one if you would like to boot your system with the older kernel. + +![][4] + +Depending on your RHEL/CentOS version, find the word **“linux16”** or **“linux”**, press the “End” button on the keyboard, go to the end of the line, and add the keyword **“rd.break”** as shown below in the screenshot, then press **“Ctrl+x”** or **“F10”** to boot into single-user mode. + +You need to find the word **`linux16`** for RHEL/CentOS 7 systems, while **`linux`** for RHEL/CentOS 8 systems. + +![][4] + +This change mount your root file system into **“read only (RO)”** mode. You can check this by running the command below. Also, the output below clearly shows that you are in **“Emergency Mode”**. + +``` +# mount | grep root +``` + +![][4] + +To make changes to the **“sysroot”** file system you need to remount it with READ and WRITE (RW) mode. + +``` +# mount -o remount,rw /sysroot +``` + +Run the below command to change the environment, commonly known as “jailed directory” or “chroot jail”. + +``` +# chroot /sysroot +``` + +![][4] + +Now, single-user mode is completely ready for use. Once you have fixed your problem to exit single user mode, perform the following steps. + +CentOS/RHEL 7/8 uses SELinux by default, so create the following hidden file, which will automatically perform a relabel of all files on next boot. + +``` +# touch /.autorelabel +``` + +Finally, run the below command to restart the system. Alternatively, type “exit” command twice to restart your system. + +``` +# reboot -f +``` + +### Method-2: Boot CentOS/RHEL 7/8 systems in single user mode by replacing the “rhgb quiet” word with the “init=/bin/bash or init=/bin/sh” parameters in the kernel + +Reboot your system, on the GRUB2 boot screen, press the `"e"` key to edit the selected kernel parameters. + +![][4] + +Find the word **“rhgb quiet”** and replace it with **“init=/bin/bash”** or **“init=/bin/sh”**, then press **“Ctrl+x”** or **“F10”** to boot in single user mode. + +Screenshot for **`init=/bin/bash`**. + +![][4] + +Screenshot for **`init=/bin/sh`**. + +![][4] + +By default, this will mount your “/” partition in read-only (RO) mode, so you will need to remount the “/” file system with READ and WRITE (RW) mode to make changes. + +``` +# mount -o remount,rw / +``` + +![][4] + +You can now perform any task that you want. When you are done, run the following command to enable SELinux relabeling on reboot. + +``` +# touch /.autorelabel +``` + +Finally reboot the system. + +``` +# exec /sbin/init 6 +``` + +### Method-3: Boot CentOS/RHEL 7/8 systems in single user mode by replacing the “ro” word with the “rw init=/sysroot/bin/sh” parameter in the kernel + +To interrupt the automatic boot, reboot your system and press any key on the GRUB2 splash screen. + +This will display the list of kernels available on your system and select the latest kernel and press the **`"e"`** key to edit the selected kernel parameters. + +Find the line that starts with the word **“linux”** or **“linux16”** and replace **“ro”** with **“rw init=/sysroot/bin/sh”**. When finished, press **“Ctrl+x”** or **“F10”** to boot in single user mode. + +Change the environment to “chroot jail” by running the below command. + +``` +# chroot /sysroot +``` + +Make any necessary changes to the system. Once done, run the below command to enable SELinux relabeling on reboot. + +``` +# touch /.autorelabel +``` + +Finally reboot the system. + +``` +# reboot -f +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/boot-centos-7-8-rhel-7-8-single-user-mode/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/category/red-hat/ +[2]: https://www.2daygeek.com/category/centos/ +[3]: https://www.2daygeek.com/category/rhel/ +[4]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 From fd5f92e2b1d0964bd33b91d67a2d94246185c34c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Apr 2020 00:58:02 +0800 Subject: [PATCH 0523/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200429=20Java?= =?UTF-8?q?=20security,=20mainframes=20having=20a=20moment,=20and=20more?= =?UTF-8?q?=20industry=20trends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200429 Java security, mainframes having a moment, and more industry trends.md --- ...ving a moment, and more industry trends.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20200429 Java security, mainframes having a moment, and more industry trends.md diff --git a/sources/tech/20200429 Java security, mainframes having a moment, and more industry trends.md b/sources/tech/20200429 Java security, mainframes having a moment, and more industry trends.md new file mode 100644 index 0000000000..beeac5df9d --- /dev/null +++ b/sources/tech/20200429 Java security, mainframes having a moment, and more industry trends.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Java security, mainframes having a moment, and more industry trends) +[#]: via: (https://opensource.com/article/20/4/java-mainframes-dev-skills-more-industry-trends) +[#]: author: (Tim Hildred https://opensource.com/users/thildred) + +Java security, mainframes having a moment, and more industry trends +====== +A weekly look at open source community and industry trends. +![Person standing in front of a giant computer screen with numbers, data][1] + +As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. + +## [How secure is Java compared to other languages?][2] + +> In this article, we'll look at how the most commonly used programming languages rank in terms of security. I'll explain some factors that make one language less secure than another, and why identified vulnerabilities have increased so much in the past few years. Finally, I'll suggest a few ways Java developers can reduce vulnerabilities in code.   + +**The impact**: If software is eating the world, then hackers are... I guess the thrush thriving in the gullet? Hyperbole aside, the more stuff made of software, the more incentive clever people have to try and figure out how to do things they probably shouldn't be able to. This applies to Java too. + +## [Mainframes are having a moment][3] + +> In addition to being abundant, mainframe jobs pay well, and so far, appear not to be as affected by the pandemic as other areas of tech employment. Salaries for entry-level enterprise computing jobs [average US $70,100 a year][4] [PDF], according to a 2019 report from tech analyst [Forrester Research][5] commissioned by IBM. As recently as this week, jobs boards such as [Indeed][6] and [Dice.com][7] listed hundreds or in some cases thousands of openings for mainframe positions at all levels. Advertised pay ranges from $30 to $35 an hour for a junior mainframe developer to well over $150,000 a year for a mainframe database administration manager. + +**The impact**: That is much, much better than a poke in the eye. + +## [The developer skills on the rise, and in decline][8] + +> Indeed.com analysed job postings using a list of 500 key technology skill terms to see which ones employers are looking for more these days and which are falling out of favour. Such research has helped identify cutting-edge skills over the past five years, with some previous years’ risers now well establish, thanks to explosive growth. + +**The impact**: The "on the rise" skills outnumber the "in decline" skills. Bad news for browser developers... + +## [The IT Pro Podcast: Building cloud-native apps][9] + +> The cloud is eating enterprise IT, and while on-premise applications are going to be around for a long time to come, the importance of being able to successfully take advantage of cloud technologies should not be understated. However, it’s one thing to simply port an existing application to the cloud, but developing software to be run in cloud environments is a different matter altogether. + +**The impact**: What is technology if not manifested mindset? + +## [Communication is key to culture change][10] + +> The outcome is staggering. Business teams feel invested in the development of the solution, they feel a sense of excitement and ownership. So much so, they go out into the corridors of the organisation to evangelise and promote the solution. Conversely, this improves the status of the developers within the business. It allows them to integrate with other stakeholders, contribute to new processes and help to achieve common goals.  + +**The impact**: As a communications person, I couldn't agree more. Communication is the difference between an organization and a movement. + +_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/java-mainframes-dev-skills-more-industry-trends + +作者:[Tim Hildred][a] +选题:[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/thildred +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) +[2]: https://www.javaworld.com/article/3537561/how-secure-is-java-compared-to-other-languages.html +[3]: https://spectrum.ieee.org/tech-talk/computing/software/mainframes-programming-language-cobol-news-coronavirus +[4]: https://www.ibm.com/downloads/cas/1EPYAP5D +[5]: https://go.forrester.com/ +[6]: https://www.indeed.com/q-Mainframe-jobs.html +[7]: https://www.dice.com/jobs/q-Mainframe-jobs +[8]: https://www.techcentral.ie/10-developer-skills-on-the-rise-and-five-on-the-decline/ +[9]: https://www.itpro.co.uk/cloud/355348/the-it-pro-podcast-building-cloud-native-apps +[10]: https://www.verdict.co.uk/culture-service-digital-enterprise/ From 4f376efa41c389b881e489cc1e28f64c61be54ec Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Apr 2020 00:58:47 +0800 Subject: [PATCH 0524/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200429=20Open?= =?UTF-8?q?=20source=20live=20streaming=20with=20Open=20Broadcaster=20Soft?= =?UTF-8?q?ware?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200429 Open source live streaming with Open Broadcaster Software.md --- ...treaming with Open Broadcaster Software.md | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 sources/tech/20200429 Open source live streaming with Open Broadcaster Software.md diff --git a/sources/tech/20200429 Open source live streaming with Open Broadcaster Software.md b/sources/tech/20200429 Open source live streaming with Open Broadcaster Software.md new file mode 100644 index 0000000000..748786de77 --- /dev/null +++ b/sources/tech/20200429 Open source live streaming with Open Broadcaster Software.md @@ -0,0 +1,137 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open source live streaming with Open Broadcaster Software) +[#]: via: (https://opensource.com/article/20/4/open-source-live-stream) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Open source live streaming with Open Broadcaster Software +====== +If you have something to say, a skill to teach, or just something fun to +share, broadcast it to the world with OBS. +![An old-fashioned video camera][1] + +If you have a talent you want to share with the world, whether it's making your favorite sourdough bread or speedrunning through a level of your favorite video game, live streaming is the modern show-and-tell. It's a powerful way to tell the world about your hobby through a medium once reserved for exclusive and expensive TV studios. Not only is the medium available to anyone with a relatively good internet connection, but the most popular software to make it happen is open source. + +[OBS][2] (Open Broadcaster Software) is a cross-platform application that serves as a control center for your live stream. A _stream_, strictly speaking, means _progressive and coherent data_. The data in a stream can be audio, video, graphics, text, or anything else you can represent as digital data. OBS is programmed to accept data as input, combine streams together (technically referred to as _mixing_) into one product, and then broadcast it. + +![OBS flowchart][3] + +A _broadcast_ is data that can be received by some target. If you're live streaming, your primary target is a streaming service that can host your stream, so other people can find it in a web browser or media player. A live stream is a live event, so people have to "tune in" to your stream when it's happening, or else they miss it. However, you can also target your own hard drive so you can record a presentation and then post it on the internet later for people to watch at their leisure. + +### Installing OBS + +To install OBS on Windows or macOS, download an installer package from [OBS's website][2]. + +To install OBS on Linux, either install it with your package manager (such as **dnf**, **zypper**, or **apt**) or [install it as a Flatpak][4]. + +### Join a streaming service + +In order to live stream, you must have a stream broker. That is, you need a central location on the internet for your stream to be delivered, so your viewers can get to what you're broadcasting. There are a few popular streaming services online, like YouTube and Twitch. You can also [set up your own video streaming server][5] using open source software. + +Regardless of which option you choose, before you begin streaming, you must have a destination for your stream. If you do use a streaming service, you must obtain a _streaming key_. A streaming key is a hash value (it usually looks something like **2ae2fad4e33c3a89c21**) that is private and unique to you. You use this key to authenticate yourself through your streaming software. Without it, the streaming service can't know you are who you say you are and won't let you broadcast over your user account. + +* * * + +* * * + +* * * + +**![Streaming key][6]** + + * In Twitch, your **Primary Stream Key** is available in the **Channel** panel of your **Creator Dashboard**. + * On YouTube, you must enable live streaming by verifying your account. Once you've done that, your **Stream Key** is in the **Other Features** menu option of your **Channel Dashboard**. + * If you're using your own server, there's no maze-like GUI to navigate. You just [create your own streaming key][7]. + + + +### Enter your streaming key + +Once you have a streaming key, launch OBS and go to the **File** > **Settings** menu. + +In the **Settings** window, click on the **Stream** category in the left column. Set the **Service** to your stream service (Custom, Twitch, YouTube, etc.), and enter your stream key. Click the **OK** button in the bottom right to save your changes. + +### Create sources + +In OBS, _sources_ represent any input signal you want to stream. By default, sources are listed at the bottom of the OBS window. + +![OBS sources][8] + +This might be a webcam, a microphone, an audio stream (such as the sound of a video game you're playing), a screen capture of your computer (a "screencast"), a slideshow you want to present, an image, and so on. Before you start streaming, you should define all the sources you plan on using for your stream. This means you have to do a little pre-production and consider what you anticipate for your show. Any camera you have set up must be defined as a source in OBS. Any extra media you plan on cutting to during your show must be defined as a source. Any sound effects or background music must be defined as a source. + +Not all sources "happen" at once. By adding media to your **Sources** panel in OBS, you're just assembling the raw components for your stream. Once you make devices and data available to OBS, you can create your **Scenes**. + +#### Setting up audio + +Computers have seemingly dozens of ways to route audio. Here's the workflow to follow when setting up sound for your stream: + + 1. Check your cables: verify that your microphone is plugged in. + 2. Go to your computer's sound control panel and set the input to whatever microphone you want OBS to treat as the main microphone. This might be a gaming headset or a boom mic or a desktop podcasting mic or a Bluetooth device or a fancy audio interface with XLR ports. Whatever it is, make sure your computer "hears" your main sound input. + 3. In OBS, create a source for your main microphone and name it something obvious (e.g., boom mic, master sound, or mic). + 4. Do a test. Make sure OBS "hears" your microphone by referring to the audio-level monitors at the bottom of the OBS window. If it's not responding to the input you believe you've set as input, check your cables, check your computer sound control panel, and check OBS. + + + +I've seen more people panic over audio sources than any other issue when streaming, and we've _all_ made the same dumb mistakes (several times each, probably!) when attempting to set a microphone for a live stream or videoconference call. Breathe deep, check your cables, check your inputs and outputs, and [get comfortable with audio][9]. It'll pay off in the end. + +### Create scenes + +A **Scene** in OBS is a screen layout and consists of one or more sources. + +![Scenes in OBS][10] + +For instance, you might create a scene called **Master shot** that shows you sitting at your desk in front of your computer or at the kitchen counter ready to mix ingredients together. The source could be a webcam mounted on a tripod a meter or two in front of you. Because you want to cut to a detail shot, you might create a second scene called **Close-up**, which uses the computer screen and audio as one input source and your microphone as another source, so you can narrate as you demonstrate what you're doing. If you're doing a baking show, you might want to mount a second webcam above the counter, so you can cut to an overhead shot of ingredients being mixed. Here, your source is a different webcam but probably the same microphone (to avoid making changes in the audio). + +A _scene_, in other words, is a lot like a _shot_ in traditional production vernacular, but it can be the combination of many shots. The fun thing about OBS is that you can mix and match a lot of different sources together, so when you're adding a **Scene**, you can resize and position different sources to achieve picture-in-picture, or split-screen, or any other effect you might want. It's common in video game "let's play" streams to have the video game in full-screen, with the player inset in the lower right or left. Or, if you're recording a panel or a multi-player game like D&D you might have several cameras covering several players in a _Brady Bunch_ grid. + +The possibilities are endless. During streaming, you can cut from one scene to another as needed. This is intended to be a dynamic system, so you can change scenes depending on what the viewer needs to see at any given moment. + +Generally, you want to have some preset scenes before you start to stream. Even if you have a friend willing to do video mixing as you stream, you always want a safe scene to fall back to, so take time beforehand to set up at least a master shot that shows you doing whatever it is you're doing. If all else fails, at least you'll have your main shot you can safely and reliably cut to. + +### Transitions + +When switching from one scene to another, OBS uses a transition. Once you have more than one scene, you can configure what kind of transition it uses in the **Transitions** panel. Simple transitions are usually best. By default, OBS uses a subtle crossfade, but you can experiment with others as you see fit. + +### Go live + +To start streaming, do your vocal exercises, find your motivation, and press the **Start Streaming** button. + +![Start streaming in OBS][11] + +As long as you've set up your streaming service correctly, you're on the air (or on the wires, anyway). + +If you're the talent (the person in front of the camera), it might be easiest to have someone control OBS during streaming. But if that's not possible, you can control it yourself as long as you've practiced a little in advance. If you're screencasting, it helps to have a two-monitor setup so you can control OBS without it being on screen. + +### Streaming for success + +Many of us take streaming for granted now that the internet exists and can broadcast media created by _anyone_. It's a hugely powerful means of communication, and we're all responsible for making the most of it. + +If you have something positive to say, a skill to teach, words of encouragement, or just something fun that you want to share, and you feel like you want to broadcast to the world, then take the time to learn OBS. You might not get a million viewers, but independent media is a vital part of [free culture][12]. The world can always use empowering and positive open source voices, and yours may be one of the most important of all. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/open-source-live-stream + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_film.png?itok=aElrLLrw (An old-fashioned video camera) +[2]: http://obsproject.com +[3]: https://opensource.com/sites/default/files/obs-flowchart.jpg (OBS flowchart) +[4]: https://flatpak.org/setup +[5]: https://opensource.com/article/19/1/basic-live-video-streaming-server +[6]: https://opensource.com/sites/default/files/twitch-key.jpg (Streaming key) +[7]: https://opensource.com/article/19/1/basic-live-video-streaming-server#obs +[8]: https://opensource.com/sites/default/files/uploads/obs-sources.jpg (OBS sources) +[9]: https://opensource.com/article/17/1/linux-plays-sound +[10]: https://opensource.com/sites/default/files/uploads/obs-scenes.jpg (Scenes in OBS) +[11]: https://opensource.com/sites/default/files/uploads/obs-stream-start.jpg (Start streaming in OBS) +[12]: https://opensource.com/article/18/1/creative-commons-real-world From 59e96957f7a828e876de1d425bf9fc5d86b710ca Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Apr 2020 01:00:25 +0800 Subject: [PATCH 0525/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200429=20The?= =?UTF-8?q?=20life-changing=20magic=20of=20git=20rebase=20-i?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200429 The life-changing magic of git rebase -i.md --- ...he life-changing magic of git rebase -i.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20200429 The life-changing magic of git rebase -i.md diff --git a/sources/tech/20200429 The life-changing magic of git rebase -i.md b/sources/tech/20200429 The life-changing magic of git rebase -i.md new file mode 100644 index 0000000000..8afb9d7f8e --- /dev/null +++ b/sources/tech/20200429 The life-changing magic of git rebase -i.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The life-changing magic of git rebase -i) +[#]: via: (https://opensource.com/article/20/4/git-rebase-i) +[#]: author: (Dave Neary https://opensource.com/users/dneary) + +The life-changing magic of git rebase -i +====== +Make everyone think you write perfect code the first time (and make your +patches easier to review and merge). +![Hands programming][1] + +Software development is messy. So many wrong turns, typos to fix, quick hacks and kludges to correct later, off-by-one errors you find late in the process. With version control, you have a pristine record of every wrong turn and correction made during the process of creating the "perfect" final product—a patch ready to submit upstream. Like the outtakes from movies, they are a little embarrassing and sometimes amusing. + +Wouldn't it be great if you could use version control to save your work regularly at waypoints, and then when you have something you are ready to submit for review, you could hide all of that private drafting work and just submit a single, perfect patch? Meet **git rebase -i**, the perfect way to rewrite history and make everyone think that you produce perfect code the first time! + +### What does git rebase do? + +In case you're not familiar with the intricacies of Git, here is a brief overview. Under the covers, Git associates different versions of your project with a unique identifier, which is made up of a hash of the parent node's unique identifier, and the difference between the new version and its parent node. This creates a tree of revisions, and each person who checks out the project gets their own copy. Different people can take the project in different directions, each starting from potentially different branch points. + +![Master branch vs. private branch][2] + +The master branch in the "origin" repo on the left and the private branch on your personal copy on the right. + +There are two ways to integrate your work back with the master branch in the original repository: one is to use **git merge**, and the other is to use **git rebase**. They work in very different ways. + +When you use **git merge**, a new commit is created on the master branch that includes all of the changes from origin plus all of your local changes. If there are any conflicts (for example, if someone else has changed a file you are also working with), these will be marked, and you have an opportunity to resolve the conflicts before committing this merge commit to your local repository. When you push your changes back to the parent repository, all of your local work will appear as a branch for other users of the Git repository. + +But **git rebase** works differently. It rewinds your commits and replays those commits again from the tip of the master branch. This results in two main changes. First, since your commits are now branching off a different parent node, their hashes will be recalculated, and anyone who has cloned your repository may now have a broken copy of the repository. Second, you do not have a merge commit, so any merge conflicts are identified as your changes are being replayed onto the master branch, and you need to fix them before proceeding with the rebase. When you push your changes now, your work does not appear on a branch, and it looks as though you wrote all of your changes off the very latest commit to the master branch. + +![Merge commits preserve history, and rebase rewrites history.][3] + +Merge commits (left) preserve history, while rebase (right) rewrites history. + +However, both of these options come with a downside: everyone can see all your scribbles and edits as you worked through problems locally before you were ready to share your code. This is where the **\--interactive** (or **-i** for short) flag to **git rebase** comes into the picture. + +### Introducing git rebase -i + +The big advantage of **git rebase** is that it rewrites history. But why stop at just pretending you branched off a later point? There is a way to go even further and rewrite how you arrived at your ready-to-propose code: **git rebase -i**, an interactive **git rebase**. + +This feature is the "magic time machine" function in Git. The flag allows you to make sophisticated changes to revision history while doing a rebase. You can hide your mistakes! Merge many small changes into one pristine feature patch! Reorder how things appear in revision history! + +![output of git rebase -i][4] + +When you run **git rebase -i**, you get an editor session listing all of the commits that are being rebased and a number of options for what you can do to them. The default choice is **pick**. + + * **Pick** maintains the commit in your history. + * **Reword** allows you to change a commit message, perhaps to fix a typo or add additional commentary. + * **Edit** allows you to make changes to the commit while in the process of replaying the branch. + * **Squash** merges multiple commits into one. + * You can reorder commits by moving them around in the file. + + + +When you are finished, simply save the final result, and the rebase will execute. At each stage where you have chosen to modify a commit (either with **reword**, **edit**, **squash**, or when there is a conflict), the rebase stops and allows you to make the appropriate changes before continuing. + +The example above results in "One-liner bug fix" and "Integrate new header everywhere" being merged into one commit, and "New header for docs website" and "D'oh - typo. Fixed" into another. Like magic, the work that went into the other commits is still there on your branch, but the associated commits have disappeared from your history! + +This makes it easy to submit a clean patch to an upstream project using **git send-email** or by creating a pull request against the parent repository with your newly tidied up patchset. This has a number of advantages, including that it makes your code easier to review, easier to accept, and easier to merge. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/git-rebase-i + +作者:[Dave Neary][a] +选题:[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/dneary +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop.png?itok=pGfEfu2S (Hands programming) +[2]: https://opensource.com/sites/default/files/uploads/master-private-branches.png (Master branch vs. private branch) +[3]: https://opensource.com/sites/default/files/uploads/merge-commit-vs-rebase.png (Merge commits preserve history, and rebase rewrites history.) +[4]: https://opensource.com/sites/default/files/uploads/git-rebase-i.png (output of git rebase -i) From 90c39408a7210b6e6f61f859cafaff0365dff783 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Apr 2020 01:01:29 +0800 Subject: [PATCH 0526/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200429=20Drop?= =?UTF-8?q?=20PNG=20and=20JPG=20for=20your=20online=20images:=20Use=20WebP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md --- ...nd JPG for your online images- Use WebP.md | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 sources/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md diff --git a/sources/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md b/sources/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md new file mode 100644 index 0000000000..d664a9fdfc --- /dev/null +++ b/sources/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md @@ -0,0 +1,144 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Drop PNG and JPG for your online images: Use WebP) +[#]: via: (https://opensource.com/article/20/4/webp-image-compression) +[#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas) + +Drop PNG and JPG for your online images: Use WebP +====== +Get started with this open source image editing tool to save time and +space. +![Painting art on a computer screen][1] + +WebP is an image format developed by Google in 2010 that provides superior lossless and lossy compression for images on the web. Using WebP, web developers can create smaller, richer images that improve site speed. A faster loading website is critical to the user experience and for the website's marketing effectiveness. + +For optimal loading across all devices and users, images on your site should not be larger than 500 KB in file size. + +WebP lossless images are often at least 25% smaller in size compared to PNGs. WebP lossy images are often anywhere from 25-34% smaller than comparable JPEG images at equivalent SSIM (structural similarity) quality index. + +Lossless WebP supports transparency, as well. For cases when lossy RGB compression is acceptable, lossy WebP also supports transparency, typically providing three times smaller file sizes compared to PNG. + +Google reports a 64% reduction in file size for images converted from animated GIFs to lossy WebP, and a 19% reduction when converted to lossless WebP. + +The WebP file format is based on the RIFF (resource interchange file format) document format. The file signature is **52 49 46 46** (RIFF), as you can see with [hexdump][2]: + + +``` +$ hexdump --canonical pixel.webp +00000000  52 49 46 46 26 00 00 00  [...]  |RIFF&...WEBPVP8 | +00000010  1a 00 00 00 30 01 00 9d  [...]  |....0....*......| +00000020  0e 25 a4 00 03 70 00 fe  [...]  |.%...p...`....| +0000002e +``` + +The standalone libwebp library serves as a reference implementation for the WebP specification and is available from Google's [Git repository][3] or as a tarball. + +The WebP format is compatible with 80% of the web browsers in use worldwide. At the time of this writing, it is not compatible with Apple's Safari browser. The workaround for this is to serve up a JPG/PNG alongside a WebP, and there are methods and Wordpress plugins to do that. + +### Why does this matter? + +Part of my job is to design and maintain our organization's website. Since the website is a marketing tool and site speed is a critical aspect of the user experience, I have been working to improve the speed, and reducing image sizes by converting them to WebP has been a good solution. + +To test the speed of one of the pages, I turned to **web.dev**, which is powered by Lighthouse, released under the Apache 2.0 license, and can be found at . + +According to its official description, "Lighthouse is an open source, automated tool for improving the quality of web pages. You can run it against any web page—public or requiring authentication. It has audits for performance, accessibility, progressive web apps, SEO, and more. You can run Lighthouse in Chrome DevTools, from the command line, or as a Node module. You give Lighthouse a URL to audit, it runs a series of audits against the page, and then it generates a report on how well the page did. From there, use the failing audits as indicators on how to improve the page. Each audit has a reference doc explaining why the audit is important, as well as how to fix it." + +### Creating a smaller WebP image + +The page I tested returned three images. In the report it generates, it provides recommendations and targets. I chose the "app-graphic" image, which, it reported, is 650 KB. By converting it to WebP, I should save 589 KB, reducing the image to 61 KB. I converted the image in Photoshop and saved it with the default WebP settings, and it returned a file size of 44.9 KB. Better than expected! As the screenshot from Photoshop shows, the images look identical in visual quality. + +![WebP vs JPG comparison][4] + +On the left: 650 KB (actual size). On the right: 589 KB (target size after conversion). + +Of course, the open source image editor [GIMP][5] also supports WebP as an export format. It offers several options for quality and compression profile: + +![GIMP dialog for exporting webp, as a webp][6] + +A zoomed-in look of another image: + +![WebP vs PNG comparison][7] + +PNG (left) and WebP (right), both converted from a JPG, shows the WebP, although smaller in size, is superior in visual quality. + +### Convert to an image to WebP + +To convert images on Linux from JPG/PNG to WebP, you can also use the command-line: + +Use **cwebp** on the command line to convert PNG or JPG image files to WebP format. You can convert a PNG image file to a WebP image with a quality range of 80 with the command: + + +``` +`cwebp -q 80 image.png -o image.webp` +``` + +Alternatively, you can also use [Image Magick][8], which is probably available in your distribution's software repository. The subcommand for conversion is **convert**, and all that's needed is an input and output file: + + +``` +`convert pixel.png pixel.webp` +``` + +### Convert an image to WebP with an editor + +To convert images to WebP with a photo editor, use [GIMP][9]. From version 2.10 on, it supports WebP natively. + +If you're a Photoshop user, you need a plugin to convert the files, as Photoshop does not include it natively. WebPShop 0.2.1, released under the Apache License 2.0 license, is a Photoshop module for opening and saving WebP images, including animations, and can be found at: . + +To use the plugin, put the file found in the **bin** folder inside your Photoshop plugin directory: + +Windows x64—C:\Program Files\Adobe\Adobe Photoshop\Plug-ins\WebPShop.8bi + +Mac—Applications/Adobe Photoshop/Plug-ins/WebPShop.plugin + +### WebP on Wordpress + +Many websites are built using Wordpress (that's what I use). So, how does Wordpress handle uploading WebP images? At the time of this writing, it doesn't. But, there are, of course, plugins to enable it so you can serve up both WebP alongside PNG/JPG images (for the Apple crowd). + +Or there are these [instructions][10] from [Marius Hosting][11]: + +"How about directly uploading WebP images to Wordpress? This is easy. Just add some text line on your theme functions.php file. Wordpress does not natively support viewing and uploading WebP files, but I will explain to you how you can make it work in a few simple steps. Log in to your Wordpress admin area and go to Appearance/Theme Editor and find functions.php. Copy and paste the code below at the end of the file and save it.  + + +``` +`//** *Enable upload for webp image files.*/ function webp_upload_mimes($existing_mimes) { $existing_mimes['webp'] = 'image/webp'; return $existing_mimes; } add_filter('mime_types', 'webp_upload_mimes');` +``` + +If you want to see the thumbnail image preview when you go to Media/Library, you have to add the code below in the same functions.php file. To find the functions.php file, go to Appearance/Theme Editor and find functions.php, then copy and paste the code below at the end of the file and save it." + + +``` +`//** * Enable preview / thumbnail for webp image files.*/ function webp_is_displayable($result, $path) { if ($result === false) { $displayable_image_types = array( IMAGETYPE_WEBP ); $info = @getimagesize( $path ); if (empty($info)) { $result = false; } elseif (!in_array($info[2], $displayable_image_types)) { $result = false; } else { $result = true; } } return $result; } add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2);` +``` + +### WebP and the future + +WebP is a robust and optimized format. It looks better, it has better compression ratio, and it has all the features of most other common image formats. There's no need to wait—start using it now. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/webp-image-compression + +作者:[Jeff Macharyas][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jeffmacharyas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/painting_computer_screen_art_design_creative.png?itok=LVAeQx3_ (Painting art on a computer screen) +[2]: https://opensource.com/article/19/8/dig-binary-files-hexdump +[3]: https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html +[4]: https://opensource.com/sites/default/files/uploads/webp-vs-jpg-app-graphic.png (WebP vs JPG comparison) +[5]: http://gimp.org +[6]: https://opensource.com/sites/default/files/webp-gimp.webp (GIMP dialog for exporting webp, as a webp) +[7]: https://opensource.com/sites/default/files/uploads/xcompare-png-left-webp-right.png (WebP vs PNG comparison) +[8]: https://imagemagick.org +[9]: https://en.wikipedia.org/wiki/GIMP +[10]: https://mariushosting.com/how-to-upload-webp-files-on-wordpress/ +[11]: https://mariushosting.com/ From b8504387469e63d3693bc749226552628ba01766 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Apr 2020 01:02:14 +0800 Subject: [PATCH 0527/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200429=20Why?= =?UTF-8?q?=20strace=20doesn't=20work=20in=20Docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200429 Why strace doesn-t work in Docker.md --- ...00429 Why strace doesn-t work in Docker.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20200429 Why strace doesn-t work in Docker.md diff --git a/sources/tech/20200429 Why strace doesn-t work in Docker.md b/sources/tech/20200429 Why strace doesn-t work in Docker.md new file mode 100644 index 0000000000..42414ad377 --- /dev/null +++ b/sources/tech/20200429 Why strace doesn-t work in Docker.md @@ -0,0 +1,161 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why strace doesn't work in Docker) +[#]: via: (https://jvns.ca/blog/2020/04/29/why-strace-doesnt-work-in-docker/) +[#]: author: (Julia Evans https://jvns.ca/) + +Why strace doesn't work in Docker +====== + +While editing the capabilities page of the [how containers work][1] zine, I found myself trying to explain why `strace` doesn’t work in a Docker container. + +The problem here is – if you run `strace` in a Docker container, this happens: + +``` +$ docker run -it ubuntu:18.04 /bin/bash +$ # ... install strace ... +[email protected]:/# strace ls +strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted +``` + +strace works using the `ptrace` system call, so if `ptrace` isn’t allowed, it’s definitely not gonna work! This is pretty easy to fix – on my machine, this fixes it: + +``` +docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash +``` + +But I wasn’t interested in fixing it, I wanted to know why it happens. So why does strace not work, and why does `--cap-add=SYS_PTRACE` fix it? + +### hypothesis 1: container processes are missing the `CAP_SYS_PTRACE` capability + +I always thought the reason was that Docker container processes by default didn’t have the `CAP_SYS_PTRACE` capability. This is consistent with it being fixed by `--cap-add=SYS_PTRACE`, right? + +But this actually doesn’t make sense for 2 reasons. + +**Reason 1**: Experimentally, as a regular user, I can strace on any process run by my user. But if I check if my current process has the `CAP_SYS_PTRACE` capability, I don’t: + +``` +$ getpcaps $$ +Capabilities for `11589': = +``` + +**Reason 2**: `man capabilities` says this about `CAP_SYS_PTRACE`: + +``` +CAP_SYS_PTRACE + * Trace arbitrary processes using ptrace(2); +``` + +So the point of `CAP_SYS_PTRACE` is to let you ptrace **arbitrary** processes owned by any user, the way that root usually can. You shouldn’t need it to just ptrace a regular process owned by your user. + +And I tested this a third way – I ran a Docker container with `docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash`, dropped the `CAP_SYS_PTRACE` capability, and I could still strace processes even though I didn’t have that capability anymore. What? Why? + +### hypothesis 2: something about user namespaces??? + +My next (much less well-founded) hypothesis was something along the lines of “um, maybe the process is in a different user namespace and strace doesn’t work because of… reasons?” This isn’t really coherent but here’s what happened when I looked into it. + +Is the container process in a different user namespace? Well, in the container: + +``` +[email protected]:/# ls /proc/$$/ns/user -l +... /proc/1/ns/user -> 'user:[4026531837]' +``` + +On the host: + +``` +[email protected]:~$ ls /proc/$$/ns/user -l +... /proc/12177/ns/user -> 'user:[4026531837]' +``` + +Because the user namespace ID (`4026531837`) is the same, the root user in the container is the exact same user as the root user on the host. So there’s definitely no reason it shouldn’t be able to strace processes that it created! + +This hypothesis doesn’t make much sense but I hadn’t realized that the root user in a Docker container is the same as the root user on the host, so I thought that was interesting. + +### hypothesis 3: the ptrace system call is being blocked by a seccomp-bpf rule + +I also knew that Docker uses seccomp-bpf to stop container processes from running a lot of system calls. And ptrace is in the [list of system calls blocked by Docker’s default seccomp profile][2]! (actually the list of allowed system calls is a whitelist, so it’s just that ptrace is not in the default whitelist. But it comes out to the same thing.) + +That easily explains why strace wouldn’t work in a Docker container – if the `ptrace` system call is totally blocked, then of course you can’t call it at all and strace would fail. + +Let’s verify this hypothesis – if we disable all seccomp rules, can we strace in a Docker container? + +``` +$ docker run --security-opt seccomp=unconfined -it ubuntu:18.04 /bin/bash +$ strace ls +execve("/bin/ls", ["ls"], 0x7ffc69a65580 /* 8 vars */) = 0 +... it works fine ... +``` + +Yes! It works! Great. Mystery solved, except… + +### why does `--cap-add=SYS_PTRACE` fix the problem? + +What we still haven’t explained is: why does `--cap-add=SYS_PTRACE` would fix the problem? + +The man page for `docker run` explains the `--cap-add` argument this way: + +``` +--cap-add=[] + Add Linux capabilities +``` + +That doesn’t have anything to do with seccomp rules! What’s going on? + +### let’s look at the Docker source code. + +When the documentation doesn’t help, the only thing to do is go look at the source. + +The nice thing about Go is, because dependencies are often vendored in a Go repository, you can just grep the repository to figure out where the code that does a thing is. So I cloned `github.com/moby/moby` and grepped for some things, like `rg CAP_SYS_PTRACE`. + +Here’s what I think is going on. In containerd’s seccomp implementation, in [contrib/seccomp/seccomp_default.go][3], there’s a bunch of code that makes sure that if a process has a capability, then it’s also given access (through a seccomp rule) to use the system calls that go with that capability. + +``` +case "CAP_SYS_PTRACE": + s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{ + Names: []string{ + "kcmp", + "process_vm_readv", + "process_vm_writev", + "ptrace", + }, + Action: specs.ActAllow, + Args: []specs.LinuxSeccompArg{}, + }) +``` + +There’s some other code that seems to do something very similar in [profiles/seccomp/seccomp.go][4] in moby and the [default seccomp profile][5], so it’s possible that that’s what’s doing it instead. + +So I think we have our answer! + +### `--cap-add` in Docker does a little more than what it says + +The upshot seems to be that `--cap-add` doesn’t do exactly what it says it does in the man page, it’s more like `--cap-add-and-also-whitelist-some-extra-system-calls-if-required`. Which makes sense! If you have a capability like `CAP_SYS_PTRACE` which is supposed to let you use the `process_vm_readv` system call but that system call is blocked by a seccomp profile, that’s not going to help you much! + +So allowing the `process_vm_readv` and `ptrace` system calls when you give the container `CAP_SYS_PTRACE` seems like a reasonable choice. + +### that’s all! + +This was a fun small thing to investigate, and I think it’s a nice example of how containers are made of lots of moving pieces that work together in not-completely-obvious ways. + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2020/04/29/why-strace-doesnt-work-in-docker/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://wizardzines.com/zines/containers +[2]: https://docs.docker.com/engine/security/seccomp/ +[3]: https://github.com/containerd/containerd/blob/4be98fa28b62e8a012491d655a4d6818ef87b080/contrib/seccomp/seccomp_default.go#L527-L537 +[4]: https://github.com/moby/moby/blob/cc0dfb6e7b22ad120c60a9ce770ea15415767cf9/profiles/seccomp/seccomp.go#L126-L132 +[5]: https://github.com/moby/moby/blob/master/profiles/seccomp/default.json#L723-L739 From 7cac16013bcdabb3f24f680debbc641cf4d46ee2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 30 Apr 2020 08:42:03 +0800 Subject: [PATCH 0528/1809] translated --- ... Free and Open Source Editor Pixelorama.md | 108 ------------------ ... Free and Open Source Editor Pixelorama.md | 107 +++++++++++++++++ 2 files changed, 107 insertions(+), 108 deletions(-) delete mode 100644 sources/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md create mode 100644 translated/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md diff --git a/sources/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md b/sources/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md deleted file mode 100644 index b4b0949dab..0000000000 --- a/sources/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md +++ /dev/null @@ -1,108 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Create Stunning Pixel Art With Free and Open Source Editor Pixelorama) -[#]: via: (https://itsfoss.com/pixelorama/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Create Stunning Pixel Art With Free and Open Source Editor Pixelorama -====== - -_**Brief: Pixelorama is a cross-platform, free and open source 2D sprite editor. It provides all the necessary tools to create pixel art in a neat user interface.**_ - -### Pixelorama: open source sprite editor - -[Pixelorama][1] is a tool created by young game developers at [Orama Interactive][2]. They have developed a few 2D games and a couple of them use pixel art. - -While Orama is primarily into game development, the developers are also creating utility tools that help them (and others) create those games. - -The free and open source sprite editor, Pixelorama is such a utility tool. It’s built on top of [Godot Engine][3] and is perfect for creating pixel art. - -![Pixelorama screenshot][4] - -You see the pixel art in the screenshot above? It’s been created using Pixelorama. This video shows a timelapse video of creating the above image. - -### Features of Pixelorama - -Here are the main features Pixelorama provides: - - * Multiple tools like penicl, erase, fill bucket color picker etc - * Multiple layer system that allows you to add, remove, move up and down, clone and merge as many layers as you like - * Support for spritesheets - * Import images and edit them inside Pixelorama - * Animation timeline with [Onion Skinning][5] - * Custom brushes - * Save and open your projects in Pixelorama’s custom file format, .pxo - * Horizontal & vertical mirrored drawing - * Tile Mode for pattern creation - * Split screen mode and mini canvas preview - * Zoom with mouse scroll wheel - * Unlimited undo and redo - * Scale, crop, flip, rotate, color invert and desaturate your images - * Keyboard shortcuts - * Available in several languages - * Supports Linux, Windows and macOS - - - -### Installing Pixelorama on Linux - -Pixelorama is available as a Snap application and if you are using Ubuntu, you can find it in the software center itself. - -![Pixelorama is available in Ubuntu Software Center][6] - -Alternatively, if you have [Snap support enabled on your Linux distribution][7], you can install it using this command: - -``` -sudo snap install pixelorama -``` - -If you don’t want to use Snap, no worries. You can download the latest release of Pixelorama from [their GitHub repository][8], [extract the zip file][9] and you’ll see an executable file. Give this file execute permission and double click on it to run the application. - -[Download Pixelorama][10] - -**Conclusion** - -![Pixelorama Welcome Screen][11] - -In the Pixeloaram features, it says that you can import images and edit them. I guess that’s only true for certain kind of files because when I tried to import PNG or JPEG files, the application crashed. - -However, I could easily doodle like a 3 year old and make random pixel art. I am not that into arts but I think this is a [useful tool for digital artists on Linux][12]. - -I liked the idea that despite being game developers, they are creating tools that could help other game developers and artists. That’s the spirit of open source. - -If you like the project and will be using it, consider supporting them by a donation. [It’s FOSS has made a humble donation][13] of $25 to thank their effort. - -[Donate to Pixelorama (personal Paypal account of the lead developer)][14] - -Do you like Pixelorama? Do you use some other open source sprite editor? Feel free to share your views in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/pixelorama/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://www.orama-interactive.com/pixelorama -[2]: https://www.orama-interactive.com/ -[3]: https://godotengine.org/ -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama-v6.jpg?ssl=1 -[5]: https://en.wikipedia.org/wiki/Onion_skinning -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama-ubuntu-software-center.jpg?ssl=1 -[7]: https://itsfoss.com/install-snap-linux/ -[8]: https://github.com/Orama-Interactive/Pixelorama -[9]: https://itsfoss.com/unzip-linux/ -[10]: https://github.com/Orama-Interactive/Pixelorama/releases -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama.jpg?ssl=1 -[12]: https://itsfoss.com/best-linux-graphic-design-software/ -[13]: https://itsfoss.com/donations-foss/ -[14]: https://www.paypal.me/erevos diff --git a/translated/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md b/translated/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md new file mode 100644 index 0000000000..530517a482 --- /dev/null +++ b/translated/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create Stunning Pixel Art With Free and Open Source Editor Pixelorama) +[#]: via: (https://itsfoss.com/pixelorama/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +使用免费和开源编辑器 Pixelorama 创建令人惊叹的像素艺术 +====== + +_**简介:Pixelorama 是一个跨平台、免费和开源的 2D Sprite 编辑器。它在干净的用户界面中提供了创建像素艺术所有必要工具。**_ + +### Pixelorama:开源 Sprite 编辑器 + +[Pixelorama][1] 是年轻游戏开发人员在 [Orama 互动][2]创建的工具。他们已经开发了一些 2D 游戏,其中一些使用了像素艺术。 + +虽然 Orama 主要投入游戏开发,但开发人员也在创建实用工具,帮助他们(和其他人)创建这些游戏。 + +免费开源的 Sprite 编辑器,Pixelorama 是这样一个实用工具。它构建在 [Godot 引擎][3]之上,非常适合创作像素艺术。 + +![Pixelorama screenshot][4] + +你在上面的截图中看到像素艺术了吗?它是使用 Pixelorama 创建的。此视频显示创建上面图像的延时视频。 + +### Pixelorama 的功能 + +以下是 Pixelorama 提供的主要功能: + + * 多种工具,如铅笔,擦除,填充桶颜色选择器等 + * 多层系统,你可以根据需要添加、删除、上下移动、克隆和合并尽可能多的层 + * 支持 Spritesheets + * 导入图像并在 Pixelorama 中编辑它们 + * 带有 [Onion Skinning][5] 的动画时间线 + * 自定义画笔 + * 以 Pixelorama 的自定义文件格式 .pxo 保存并打开你的项目 + * 水平和垂直镜像绘图 + * 用于图样创建的磁贴模式 + * 拆分屏幕模式和迷你画布预览 + * 使用鼠标滚轮缩放 + * 无限撤消和重做 + * 缩放、裁剪、翻转、旋转、颜色反转和去饱和图像 + * 键盘快捷键 + * 提供多种语言 + * 支持 Linux、Windows 和 macOS + + + +### 在 Linux 上安装 Pixelorama + +Pixelorama 提供 Snap 应用,如果你使用的是 Ubuntu,那么可以在软件中心找到它。 + +![Pixelorama is available in Ubuntu Software Center][6] + +或者,如果你在 [Linux 发行版上启用了 Snap 支持][7],那么可以使用此命令安装它: + +``` +sudo snap install pixelorama +``` + +如果你不想使用 Snap,不用担心。你可以从[他们的 GitHub 仓库]下载最新版本的 Pixelorama,[解压 zip 文件][9],你会看到一个可执行文件。授予此文件执行权限,并双击它运行应用。 + +[下载 Pixelorama][10] + +**总结** + +![Pixelorama Welcome Screen][11] + +在 Pixeloaram 的功能中,它说你可以导入图像并对其进行编辑。我想,这只是对某些类型的文件,因为当我尝试导入 PNG 或 JPEG 文件,程序崩溃了。 + +然而,我可以像一个 3 岁的孩子那样随意涂鸦并制作像素艺术。我并没有深入艺术,但我认为这是一个[在 Linux 上对数字艺术家有用的工具][12]。 + +我喜欢这样的想法:尽管是游戏开发人员,但他们创建的工具,可以帮助其他游戏开发人员和艺术家。这就是开源的精神。 + +如果你喜欢这个项目,并且会使用它,请考虑通过捐赠来支持他们。[FOSS 捐赠了][13] 25 美元,以感谢他们的努力。 + +[向 Pixelorama 捐赠(主要开发者的个人 Paypal 账户)][14] + +你喜欢 Pixelorama 吗?你是否使用其他开源 Sprite 编辑器?请随时在评论栏分享你的观点。 + +-------------------------------------------------------------------------------- + + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.orama-interactive.com/pixelorama +[2]: https://www.orama-interactive.com/ +[3]: https://godotengine.org/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama-v6.jpg?ssl=1 +[5]: https://en.wikipedia.org/wiki/Onion_skinning +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama-ubuntu-software-center.jpg?ssl=1 +[7]: https://itsfoss.com/install-snap-linux/ +[8]: https://github.com/Orama-Interactive/Pixelorama +[9]: https://itsfoss.com/unzip-linux/ +[10]: https://github.com/Orama-Interactive/Pixelorama/releases +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama.jpg?ssl=1 +[12]: https://itsfoss.com/best-linux-graphic-design-software/ +[13]: https://itsfoss.com/donations-foss/ +[14]: https://www.paypal.me/erevos From dd505050c66dd0b7765e8efe3147f85a64edfb1a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 30 Apr 2020 08:43:21 +0800 Subject: [PATCH 0529/1809] Rename sources/tech/20200429 Java security, mainframes having a moment, and more industry trends.md to sources/news/20200429 Java security, mainframes having a moment, and more industry trends.md --- ...urity, mainframes having a moment, and more industry trends.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200429 Java security, mainframes having a moment, and more industry trends.md (100%) diff --git a/sources/tech/20200429 Java security, mainframes having a moment, and more industry trends.md b/sources/news/20200429 Java security, mainframes having a moment, and more industry trends.md similarity index 100% rename from sources/tech/20200429 Java security, mainframes having a moment, and more industry trends.md rename to sources/news/20200429 Java security, mainframes having a moment, and more industry trends.md From 168f8315435b9851f2c37692d67d52555d2a48d1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 30 Apr 2020 08:49:27 +0800 Subject: [PATCH 0530/1809] translating --- sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md b/sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md index 1807d5e6a7..5dd426ccfc 100644 --- a/sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md +++ b/sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c5fa181b4e130158396d8864458ca0852c8f5fa2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Apr 2020 09:36:28 +0800 Subject: [PATCH 0531/1809] PRF @geekpi --- ...v5- Why there is IPv4, IPv6 but no IPv5.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md b/translated/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md index 71bfe2137a..b0715669ae 100644 --- a/translated/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md +++ b/translated/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What Happened to IPv5? Why there is IPv4, IPv6 but no IPv5?) @@ -20,19 +20,19 @@ IPv5 发生了什么?为什么有 IPv4、IPv6 但没有 IPv5? ![ARPA Logical Map in 1977 | Image courtesy: Wikipedia][1] -在 1960 年代后期,美国国防部的[高级研究计划局][2] (ARPA) 发起了一个[项目][3]来连接全国的计算机。最初的目标是创建一个由全国 ARPA 资助的所有计算机组成的网络系统。 +在 1960 年代后期,美国国防部的[高级研究计划局][2](ARPA)发起了一个[项目][3]来连接全国的计算机。最初的目标是创建一个由全国 ARPA 资助的所有计算机组成的网络系统。 -由于这是第一次将如此规模的网络整合在一起,因此他们也在不断发展自己的技术和硬件。他们的第一件工作是名为[传输控制协议][4] (TCP) 的互联网协议 (IP)。该协议“可靠、有序、并会对通过 IP 网络传输的八进制(字节)流错误检测”。基本上,它确保数据安全到达。 +由于这是第一次将如此规模的网络整合在一起,因此他们也在不断发展自己的技术和硬件。他们首先做的工作之一就是开发名为[传输控制协议][4]Transmission Control Protocol(TCP)的互联网协议Internet Protocol(IP)。该协议“可靠、有序,并会对运行于通过 IP 网络传输的主机上的应用的八进制(字节)流通讯进行错误检测”。简单来说,它可以确保数据安全到达。 -最初,TCP 被设计为[“主机级别的端到端协议以及打包和路由协议”][5]。但是,他们意识到他们需要拆分协议以使其更易于管理。于是决定由 IP 处理打包和路由。 +最初,TCP 被设计为[“主机级别的端到端协议以及封装和路由协议”][5]。但是,他们意识到他们需要拆分协议以使其更易于管理。于是决定由 IP 协议处理封装和路由。 那时,TCP 已经经历了三个版本,因此新协议被称为 IPv4。 ### IPv5 的诞生 -IPv5 以不同的名称开始使用:互联网流协议(或 ST)。它是[由 Apple、NeXT 和 Sun Microsystems][6] 创建用于实验流式传输语音和视频。 +IPv5 开始时有个不同的名字:互联网流协议Internet Stream Protocol(ST)。它是[由 Apple、NeXT 和 Sun Microsystems][6] 为试验流式语音和视频而创建的。 -该新协议能够“在保持通信的同时在特定频率上传输数据包”。 +该新协议能够“在保持通信的同时,以特定频率传输数据包”。 ### 那么 IPv5 发生了什么? @@ -40,15 +40,15 @@ IPv5 以不同的名称开始使用:互联网流协议(或 ST)。它是[ IPv5 从未被接受为正式的互联网协议。这主要是由于 32 位限制。 -IPV5 使用与 IPv4 相同的寻址系统。每个地址由 0 到 255 之间的四组数字组成。这将可能的地址数量限制为 [43 亿][6]。 +IPV5 使用与 IPv4 相同的寻址系统。每个地址由 0 到 255 之间的四组数字组成。这将可能的地址数量限制为 [43 亿][6]个。 -在 1970 年代初,这似乎比全世界所需要的还要多。但是,互联网的爆炸性增长证明了这一想法是错误的。2011年,世界正式耗尽了 IPv4 地址。 +在 1970 年代初,这似乎比全世界所需要的还要多。但是,互联网的爆炸性增长证明了这一想法是错误的。2011 年,世界上的IPv4地址正式用完了。 -在 1990 年代,一个新项目开始致力于下一代互联网协议 (IPng)。这导致了 128 位的 IPv6。IPv6 地址包含 [“8 组 4 字符的十六进制数字”][6],它可以包含从 0 到 9 的数字和从 A 到 F 的字母。与 IPv4 不同,IPv6 拥有数万亿个可能的地址,因此我们应该能安全一阵子。 +在 1990 年代,一个新项目开始致力于研究下一代互联网协议(IPng)。这形成了 128 位的 IPv6。IPv6 地址包含 [“8 组 4 字符的十六进制数字”][6],它可以包含从 0 到 9 的数字和从 A 到 F 的字母。与 IPv4 不同,IPv6 拥有数万亿个可能的地址,因此我们应该能安全一阵子。 -同时,IPv5 奠定了 VoIP 的基础,而该技术已被我们用于当今世界范围内的通信。**因此,我想往小了说,你可以说 IPv5 仍然可以保留到了今天**。 +同时,IPv5 奠定了 VoIP 的基础,而该技术已被我们用于当今世界范围内的通信。**因此,我想在某种程度上,你可以说 IPv5 仍然可以保留到了今天**。 -希望你喜欢有关互联网历史的轶事。你可以阅读其他[关于 Linux 和技术的琐事文章] [8]。 +希望你喜欢有关互联网历史的轶事。你可以阅读其他[关于 Linux 和技术的琐事文章][8]。 如果你觉得这篇文章有趣,请花一点时间在社交媒体、Hacker News 或 [Reddit][9] 上分享它。 @@ -59,7 +59,7 @@ via: https://itsfoss.com/what-happened-to-ipv5/ 作者:[John Paul][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6ba2b00a0204da854ba1b888e2cd02a401185af7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Apr 2020 09:37:51 +0800 Subject: [PATCH 0532/1809] PUB @geekpi https://linux.cn/article-12168-1.html --- ...t Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md (98%) diff --git a/translated/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md b/published/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md similarity index 98% rename from translated/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md rename to published/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md index b0715669ae..6dc822b7b6 100644 --- a/translated/tech/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md +++ b/published/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12168-1.html) [#]: subject: (What Happened to IPv5? Why there is IPv4, IPv6 but no IPv5?) [#]: via: (https://itsfoss.com/what-happened-to-ipv5/) [#]: author: (John Paul https://itsfoss.com/author/john/) From 986637082ec52753160022ab4aa39053f0275b3d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Apr 2020 10:31:01 +0800 Subject: [PATCH 0533/1809] PRF --- ...hat Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md b/published/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md index 6dc822b7b6..3a8ab6b8bd 100644 --- a/published/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md +++ b/published/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md @@ -20,7 +20,7 @@ IPv5 发生了什么?为什么有 IPv4、IPv6 但没有 IPv5? ![ARPA Logical Map in 1977 | Image courtesy: Wikipedia][1] -在 1960 年代后期,美国国防部的[高级研究计划局][2](ARPA)发起了一个[项目][3]来连接全国的计算机。最初的目标是创建一个由全国 ARPA 资助的所有计算机组成的网络系统。 +在 1960 年代后期,美国国防部的[高级研究计划局][2](DARPA)发起了一个[项目][3]来连接全国的计算机。最初的目标是创建一个由全国 ARPA 资助的所有计算机组成的网络系统。 由于这是第一次将如此规模的网络整合在一起,因此他们也在不断发展自己的技术和硬件。他们首先做的工作之一就是开发名为[传输控制协议][4]Transmission Control Protocol(TCP)的互联网协议Internet Protocol(IP)。该协议“可靠、有序,并会对运行于通过 IP 网络传输的主机上的应用的八进制(字节)流通讯进行错误检测”。简单来说,它可以确保数据安全到达。 From 80ae229a5ab081c126ca5bae69935ce266117225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Thu, 30 Apr 2020 13:48:03 +0800 Subject: [PATCH 0534/1809] Translated --- ...re SFTP Server with Chroot in Debian 10.md | 197 ------------------ ...re SFTP Server with Chroot in Debian 10.md | 197 ++++++++++++++++++ 2 files changed, 197 insertions(+), 197 deletions(-) delete mode 100644 sources/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md create mode 100644 translated/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md diff --git a/sources/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md b/sources/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md deleted file mode 100644 index 9d57192270..0000000000 --- a/sources/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md +++ /dev/null @@ -1,197 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Configure SFTP Server with Chroot in Debian 10) -[#]: via: (https://www.linuxtechi.com/configure-sftp-chroot-debian10/) -[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) - -How to Configure SFTP Server with Chroot in Debian 10 -====== - -**SFTP** stands for Secure File Transfer Protocol / SSH File Transfer Protocol, it is one of the most common method which is used to transfer files securely over ssh from our local system to remote server and vice-versa. The main advantage of sftp is that we don’t need to install any additional package except ‘**openssh-server**’, in most of the Linux distributions ‘openssh-server’ package is the part of default installation. Other benefit of sftp is that we can allow user to use sftp only not ssh. - -[![Configure-sftp-debian10][1]][2] - -Recently Debian 10, Code name ‘Buster’ has been released, in this article we will demonstrate how to configure sftp with Chroot ‘Jail’ like environment in Debian 10 System. Here Chroot Jail like environment means that user’s cannot go beyond from their respective home directories or users cannot change directories from their home directories.  Following are the lab details: - - * OS = Debian 10 - * IP Address = 192.168.56.151 - - - -Let’s jump into SFTP Configuration Steps, - -### Step:1) Create a Group for sftp using groupadd command - -Open the terminal, create a group with a name “**sftp_users**” using below groupadd command, - -``` -root@linuxtechi:~# groupadd sftp_users -``` - -### Step:2) Add Users to Group ‘sftp_users’ and set permissions - -In case you want to create new user and want to add that user to ‘sftp_users’ group, then run the following command, - -**Syntax:** #  useradd -m -G sftp_users <user_name> - -Let’s suppose user name is ’Jonathan’ - -``` -root@linuxtechi:~# useradd -m -G sftp_users jonathan -``` - -set the password using following chpasswd command, - -``` -root@linuxtechi:~# echo "jonathan:" | chpasswd -``` - -In case you want to add existing users to ‘sftp_users’ group then run beneath usermod command, let’s suppose already existing user name is ‘chris’ - -``` -root@linuxtechi:~# usermod -G sftp_users chris -``` - -Now set the required permissions on Users, - -``` -root@linuxtechi:~# chown root /home/jonathan /home/chris/ -``` - -Create an upload folder in both the user’s home directory and set the correct ownership, - -``` -root@linuxtechi:~# mkdir /home/jonathan/upload -root@linuxtechi:~# mkdir /home/chris/upload -root@linuxtechi:~# chown jonathan /home/jonathan/upload -root@linuxtechi:~# chown chris /home/chris/upload -``` - -**Note:** User like Jonathan and Chris can upload files and directories to upload folder from their local systems. - -### Step:3) Edit sftp configuration file (/etc/ssh/sshd_config) - -As we have already stated that sftp operations are done over the ssh, so it’s configuration file is “**/etc/ssh/sshd_config**“, Before making any changes I would suggest first take the backup and then edit this file and add the following content, - -``` -root@linuxtechi:~# cp /etc/ssh/sshd_config /etc/ssh/sshd_config-org -root@linuxtechi:~# vim /etc/ssh/sshd_config -……… -#Subsystem sftp /usr/lib/openssh/sftp-server -Subsystem sftp internal-sftp - -Match Group sftp_users - X11Forwarding no - AllowTcpForwarding no - ChrootDirectory %h - ForceCommand internal-sftp -………… -``` - -Save & exit the file. - -To make above changes into the affect, restart ssh service using following systemctl command - -``` -root@linuxtechi:~# systemctl restart sshd -``` - -In above ‘sshd_config’ file we have commented out the line which starts with “Subsystem” and added new entry “Subsystem       sftp    internal-sftp” and new lines like, - -“**Match Group sftp_users”**  –> It means if a user is a part of ‘sftp_users’ group then apply rules which are mentioned below to this entry. - -“**ChrootDierctory %h**” –> It means users can only change directories within their respective home directories, they cannot go beyond their home directories, or in other words we can say users are not permitted to change directories, they will get jai like environment within their directories and can’t access any other user’s and system’s directories. - -“**ForceCommand internal-sftp**” –> It means users are limited to sftp command only. - -### Step:4) Test and Verify sftp - -Login to any other Linux system which is on the same network of your sftp server and then try to ssh sftp server via the users that we have mapped in ‘sftp_users’ group. - -``` -[root@linuxtechi ~]# ssh root@linuxtechi -root@linuxtechi's password: -Write failed: Broken pipe -[root@linuxtechi ~]# ssh root@linuxtechi -root@linuxtechi's password: -Write failed: Broken pipe -[root@linuxtechi ~]# -``` - -Above confirms that users are not allowed to SSH , now try sftp using following commands, - -``` -[root@linuxtechi ~]# sftp root@linuxtechi -root@linuxtechi's password: -Connected to 192.168.56.151. -sftp> ls -l -drwxr-xr-x 2 root 1001 4096 Sep 14 07:52 debian10-pkgs --rw-r--r-- 1 root 1001 155 Sep 14 07:52 devops-actions.txt -drwxr-xr-x 2 1001 1002 4096 Sep 14 08:29 upload -``` - -Let’s try to download a file using sftp ‘**get**‘ command - -``` -sftp> get devops-actions.txt -Fetching /devops-actions.txt to devops-actions.txt -/devops-actions.txt 100% 155 0.2KB/s 00:00 -sftp> -sftp> cd /etc -Couldn't stat remote file: No such file or directory -sftp> cd /root -Couldn't stat remote file: No such file or directory -sftp> -``` - -Above output confirms that we are able to download file from our sftp server to local machine and apart from this we have also tested that users cannot change directories. - -Let’s try to upload a file under “**upload**” folder, - -``` -sftp> cd upload/ -sftp> put metricbeat-7.3.1-amd64.deb -Uploading metricbeat-7.3.1-amd64.deb to /upload/metricbeat-7.3.1-amd64.deb -metricbeat-7.3.1-amd64.deb 100% 38MB 38.4MB/s 00:01 -sftp> ls -l --rw-r--r-- 1 1001 1002 40275654 Sep 14 09:18 metricbeat-7.3.1-amd64.deb -sftp> -``` - -This confirms that we have successfully uploaded a file from our local system to sftp server. - -Now test the SFTP server with winscp tool, enter the sftp server ip address along user’s credentials, - -[![Winscp-sftp-debian10][1]][3] - -Click on Login and then try to download and upload files - -[![Download-file-winscp-debian10-sftp][1]][4] - -Now try to upload files in upload folder, - -[![Upload-File-using-winscp-Debian10-sftp][1]][5] - -Above window confirms that uploading is also working fine, that’s all from this article. If these steps help you to configure SFTP server with chroot environment in Debian 10 then please do share your feedback and comments. - --------------------------------------------------------------------------------- - -via: https://www.linuxtechi.com/configure-sftp-chroot-debian10/ - -作者:[Pradeep Kumar][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linuxtechi.com/author/pradeep/ -[b]: https://github.com/lujun9972 -[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[2]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Configure-sftp-debian10.jpg -[3]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Winscp-sftp-debian10.jpg -[4]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Download-file-winscp-debian10-sftp.jpg -[5]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Upload-File-using-winscp-Debian10-sftp.jpg diff --git a/translated/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md b/translated/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md new file mode 100644 index 0000000000..a30b6ee817 --- /dev/null +++ b/translated/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md @@ -0,0 +1,197 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Configure SFTP Server with Chroot in Debian 10) +[#]: via: (https://www.linuxtechi.com/configure-sftp-chroot-debian10/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +如何在 Debian 10 中使用 Chroot 配置 SFTP 服务 +====== + +**SFTP** 代表安全文件传输协议 / SSH 文件传输协议,它是最常用的一个方法,用于通过ssh将文件从本地系统安全地传输到远程服务器,反之亦然。sftp 的主要优点是,除 ‘**openssh-server**’ 之外,我们不需要安装任何额外的软件包,在大多数的 Linux 发行版中,‘openssh-server’ 软件包是默认安装的一部分。sftp 的另外一个好处是,我们可以允许用户使用 sftp ,而不允许使用 ssh 。 + +[![配置-sftp-debian10][1]][2] + +当前 Debian 10 ,代号‘Buster’,已经发布,在这篇文章中,我们将演示如何在 Debian 10 系统中使用 Chroot ‘Jail’ 类似的环境配置 sftp 。在这里,Chroot Jail 类似环境意味着,用户不能超出各自的 home 目录,或者用户不能从各自的 home 目录更改目录。下面实验的详细情况: + + * OS = Debian 10 + * IP 地址 = 192.168.56.151 + + + +让我们跳转到 SFTP 配置步骤, + +### 步骤:1) 为 sftp 使用 groupadd 命令创建一个组 + +打开终端,使用下面的 groupadd 命令创建一个名为的“**sftp_users**”组, + +``` +root@linuxtechi:~# groupadd sftp_users +``` + +### 步骤:2) 添加用户到组 ‘sftp_users’ 并设置权限 + +假设你想创建新的用户,并且想添加该用户到 ‘sftp_users’ 组中,那么运行下面的命令, + +**语法:** # useradd -m -G sftp_users + +让我们假设用户名是 ’Jonathan’ + +``` +root@linuxtechi:~# useradd -m -G sftp_users jonathan +``` + +使用下面的 chpasswd 命令设置密码, + +``` +root@linuxtechi:~# echo "jonathan:" | chpasswd +``` + +假设你想添加现有的用户到 ‘sftp_users’ 组中,那么运行下面的 usermod 命令,让我们假设已经存在的用户名称是 ‘chris’ + +``` +root@linuxtechi:~# usermod -G sftp_users chris +``` + +现在设置用户所需的权限, + +``` +root@linuxtechi:~# chown root /home/jonathan /home/chris/ +``` + +在各用户的 home 目录中都创建一个上传目录,并设置正确地所有权, + +``` +root@linuxtechi:~# mkdir /home/jonathan/upload +root@linuxtechi:~# mkdir /home/chris/upload +root@linuxtechi:~# chown jonathan /home/jonathan/upload +root@linuxtechi:~# chown chris /home/chris/upload +``` + +**注意:** 像 Jonathan 和 Chris 之类的用户可以从他们的本地系统上传文件和目录。 + +### 步骤:3) 编辑 sftp 配置文件 (/etc/ssh/sshd_config) + +正如我们已经陈述的,sftp 操作是通过 ssh 完成的,所以它的配置文件是 “**/etc/ssh/sshd_config**“, 在做任何更改前,我建议首先备份文件,然后再编辑该文件,接下来添加下面的内容, + +``` +root@linuxtechi:~# cp /etc/ssh/sshd_config /etc/ssh/sshd_config-org +root@linuxtechi:~# vim /etc/ssh/sshd_config +……… +#Subsystem sftp /usr/lib/openssh/sftp-server +Subsystem sftp internal-sftp + +Match Group sftp_users + X11Forwarding no + AllowTcpForwarding no + ChrootDirectory %h + ForceCommand internal-sftp +………… +``` + +保存并退出文件。 + +为使上述更改生效,使用下面的 systemctl 命令来重新启动 ssh 服务 + +``` +root@linuxtechi:~# systemctl restart sshd +``` + +在上面的 ‘sshd_config’ 文件中,我们已经注释掉了以 “Subsystem”开头的行,并添加了新的条目 “Subsystem sftp internal-sftp” 和新的行,像, + +“**Match Group sftp_users”** –> 它意味着如果用户是 ‘sftp_users’ 组中的一员,那么将应用下面提到的规则到这个条目。 + +“**ChrootDierctory %h**” –> 它意味着用户只能在他们自己各自的 home 目录中更改目录,而不能超出他们各自的 home 目录。或者换句话说,我们可以说用户是不允许更改目录的。他们将在他们的目录中获得 jai 类似环境,并且不能访问其他用户的目录和系统的目录。 + +“**ForceCommand internal-sftp**” –> 它意味着用户仅被限制到 sftp 命令。 + +### 步骤:4) 测试和验证 sftp + +登录到你的 sftp 服务器的同一个网络上的任何其它的 Linux 系统,然后通过我们在 ‘sftp_users’ 组中映射的用户来尝试 ssh sftp 服务。 + +``` +[root@linuxtechi ~]# ssh root@linuxtechi +root@linuxtechi's password: +Write failed: Broken pipe +[root@linuxtechi ~]# ssh root@linuxtechi +root@linuxtechi's password: +Write failed: Broken pipe +[root@linuxtechi ~]# +``` + +以上操作证实用户不允许 SSH ,现在使用下面的命令尝试 sftp , + +``` +[root@linuxtechi ~]# sftp root@linuxtechi +root@linuxtechi's password: +Connected to 192.168.56.151. +sftp> ls -l +drwxr-xr-x 2 root 1001 4096 Sep 14 07:52 debian10-pkgs +-rw-r--r-- 1 root 1001 155 Sep 14 07:52 devops-actions.txt +drwxr-xr-x 2 1001 1002 4096 Sep 14 08:29 upload +``` + +让我们使用 sftp ‘**get**‘ 命令来尝试下载一个文件 + +``` +sftp> get devops-actions.txt +Fetching /devops-actions.txt to devops-actions.txt +/devops-actions.txt 100% 155 0.2KB/s 00:00 +sftp> +sftp> cd /etc +Couldn't stat remote file: No such file or directory +sftp> cd /root +Couldn't stat remote file: No such file or directory +sftp> +``` + +上面的输出证实我们能从我们的 sftp 服务器下载文件到本地机器,除此之外,我们也必需测试用户不能更改目录。 + +让我们在 **upload**”目录下尝试上传一个文件, + +``` +sftp> cd upload/ +sftp> put metricbeat-7.3.1-amd64.deb +Uploading metricbeat-7.3.1-amd64.deb to /upload/metricbeat-7.3.1-amd64.deb +metricbeat-7.3.1-amd64.deb 100% 38MB 38.4MB/s 00:01 +sftp> ls -l +-rw-r--r-- 1 1001 1002 40275654 Sep 14 09:18 metricbeat-7.3.1-amd64.deb +sftp> +``` + +这证实我们已经成功地从我们的本地系统上传一个文件到 sftp 服务中。 + +现在使用 winscp 工具来测试 SFTP 服务,输入 sftp 服务器 ip 地址和用户的凭证, + +[![Winscp-sftp-debian10][1]][3] + +在 Login 上单击,然后尝试下载和上传文件 + +[![下载-文件-winscp-debian10-sftp][1]][4] + +现在,在 upload 文件夹中尝试上传文件, + +[![使用-winscp-Debian10-sftp-上传-文件][1]][5] + +上面的窗口证实上传是完好地工作的,这就是这篇文章的全部。如果这些步骤能帮助你在 Debian 10 中使用 chroot 环境配置 SFTP 服务器s,那么请分享你的反馈和评论。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/configure-sftp-chroot-debian10/ + +作者:[Pradeep Kumar][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lujun9972 +[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Configure-sftp-debian10.jpg +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Winscp-sftp-debian10.jpg +[4]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Download-file-winscp-debian10-sftp.jpg +[5]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Upload-File-using-winscp-Debian10-sftp.jpg From e9e66c2a0d1a310249a687ef170345a0b93a004f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Thu, 30 Apr 2020 13:54:18 +0800 Subject: [PATCH 0535/1809] Translating --- sources/tech/20200417 How to compress files on Linux 5 ways.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200417 How to compress files on Linux 5 ways.md b/sources/tech/20200417 How to compress files on Linux 5 ways.md index 5ce33cd18c..f71e90f9fc 100644 --- a/sources/tech/20200417 How to compress files on Linux 5 ways.md +++ b/sources/tech/20200417 How to compress files on Linux 5 ways.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2273b6a022ac9d3428ea8939372d0a560e39dd60 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Apr 2020 21:56:47 +0800 Subject: [PATCH 0536/1809] PRF @wxy --- ...3 Difference Between YUM and RPM Package Manager.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/translated/tech/20200423 Difference Between YUM and RPM Package Manager.md b/translated/tech/20200423 Difference Between YUM and RPM Package Manager.md index c0bf8b7352..b882a842db 100644 --- a/translated/tech/20200423 Difference Between YUM and RPM Package Manager.md +++ b/translated/tech/20200423 Difference Between YUM and RPM Package Manager.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Difference Between YUM and RPM Package Manager) @@ -10,6 +10,8 @@ YUM 和 RPM 包管理器的不同之处 ====== +![](https://img.linux.net.cn/data/attachment/album/202004/30/215525o4e88nen85d8dzd7.jpg) + 软件包管理器在 Linux 系统中扮演着重要的角色。它允许你安装、更新、查看、搜索和删除软件包,以满足你的需求。 每个发行版都有自己的一套包管理器,依据你的 Linux 发行版来分别使用它们。 @@ -18,7 +20,7 @@ RPM 是最古老的传统软件包管理器之一,它是为基于 Red Hat 的 > 如果你想知道 [YUM 和 DNF 包管理器的区别][1]请参考该文章。 -这意味着 yum 可以自动下载并安装所有需要的依赖项,但 rpm 会告诉你安装一个依赖项列表,然后你必须手动安装。 +这意味着 `yum` 可以自动下载并安装所有需要的依赖项,但 `rpm` 会告诉你安装一个依赖项列表,然后你必须手动安装。 当你想用 [rpm 命令][2] 安装一组包时,这实际上是不可能的,而且很费时间。 @@ -76,13 +78,13 @@ via: https://www.2daygeek.com/comparison-difference-between-yum-vs-rpm/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/magesh/ [b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/ +[1]: https://linux.cn/article-12161-1.html [2]: https://www.2daygeek.com/linux-rpm-command-examples-manage-packages-fedora-centos-rhel-systems/ [3]: https://www.2daygeek.com/linux-yum-command-examples-manage-packages-rhel-centos-systems/ [4]: https://www.2daygeek.com/list-of-command-line-package-manager-for-linux/ From 4073d0b6af97a6fe973a6f244e1e0abc7efb1ada Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Apr 2020 21:57:31 +0800 Subject: [PATCH 0537/1809] PUB @wxy https://linux.cn/article-12170-1.html --- ...20200423 Difference Between YUM and RPM Package Manager.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200423 Difference Between YUM and RPM Package Manager.md (98%) diff --git a/translated/tech/20200423 Difference Between YUM and RPM Package Manager.md b/published/20200423 Difference Between YUM and RPM Package Manager.md similarity index 98% rename from translated/tech/20200423 Difference Between YUM and RPM Package Manager.md rename to published/20200423 Difference Between YUM and RPM Package Manager.md index b882a842db..bf916108e1 100644 --- a/translated/tech/20200423 Difference Between YUM and RPM Package Manager.md +++ b/published/20200423 Difference Between YUM and RPM Package Manager.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12170-1.html) [#]: subject: (Difference Between YUM and RPM Package Manager) [#]: via: (https://www.2daygeek.com/comparison-difference-between-yum-vs-rpm/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From cc55978baf5e4de22a8fb5bc546c42be16165a8b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Apr 2020 22:36:28 +0800 Subject: [PATCH 0538/1809] PRF --- ...ox is an All-in-one Messenger for Linux.md | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/translated/tech/20200331 Rambox is an All-in-one Messenger for Linux.md b/translated/tech/20200331 Rambox is an All-in-one Messenger for Linux.md index 28a57f2842..93a73f4a54 100644 --- a/translated/tech/20200331 Rambox is an All-in-one Messenger for Linux.md +++ b/translated/tech/20200331 Rambox is an All-in-one Messenger for Linux.md @@ -1,16 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12171-1.html) [#]: subject: (Rambox is an All-in-one Messenger for Linux) [#]: via: (https://itsfoss.com/rambox/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -Rambox 是 Linux 中多合一的消息收发工具 +Rambox:Linux 中多合一的消息收发工具 ====== -_**简介:Rambox 是一个多合一消息收发工具,允许你将多种服务(如 Discord、Slack、Facebook Messenger)和数百个此类服务结合在一起。**_ +> Rambox 是一个多合一消息收发工具,允许你将多种服务(如 Discord、Slack、Facebook Messenger)和数百个此类服务结合在一起。 ### Rambox:在单个应用中添加多个消息服务 @@ -18,7 +18,7 @@ _**简介:Rambox 是一个多合一消息收发工具,允许你将多种服 Rambox 是通过安装单个应用管理多个通信服务的最佳方式之一。你可以在一个界面使用[多个消息服务][2],如 Facebook Messenger、Gmail chats、AOL、Discord、Google Duo、[Viber][3] 等。 -这样,你就不需要安装单独的应用或者在浏览器中保持打开。你可以使用主密码锁定 Rambox 应用。你还可以使用"请勿打扰"功能。 +这样,你就不需要安装单独的应用或者在浏览器中一直打开着。你可以使用主密码锁定 Rambox 应用。你还可以使用“请勿打扰”功能。 Rambox 提供可免费使用的[开源社区版][4]。付费专业版允许你访问 600 多个应用,而社区版则包含 99 多个应用。专业版本具有额外的功能,如主题、休眠、ad-block、拼写检查和高级支持。 @@ -44,24 +44,22 @@ Rambox 提供可免费使用的[开源社区版][4]。付费专业版允许你 * Ad-block (**专业版**) * 休眠支持 (**专业版**) * 主题支持(**专业版**) - * 移动视图 (**专业版**) + * 移动设备视图 (**专业版**) * 拼写检查 (**专业版**) - * 工作时间 - 计划传入通知时间 (**专业版**) - * 代理支持 (**专业版**) - - + * 工作时间 - 计划传入通知的时间 (**专业版**) + * 支持代理 (**专业版**) 除了我在这里列出的内容外,你还可以在 Rambox Pro 版本中找到更多功能。要了解有关它的更多信息,你可以参考[正式功能列表][6]。 -还值得注意的是,你不能有超过 3 个活跃并发设备连接。 +还值得注意的是,你不能超过 3 个活跃并发设备的连接。 ### 在 Linux 上安装 Rambox -你可以在[官方下载页][4]获取 **.AppImage** 文件来运行 Rambox。如果你好奇,你可以参考我们的指南,了解如何[在 Linux 上使用 AppImage 文件][7]。 +你可以在[官方下载页][4]获取 .AppImage 文件来运行 Rambox。如果你不清楚,你可以参考我们的指南,了解如何[在 Linux 上使用 AppImage 文件][7]。 -另外,你也可以从 [Snap 商店][8]获取它。此外,请查看其 [GitHub release][9] 部分的 **.deb / .rpm** 或其他包。 +另外,你也可以从 [Snap 商店][8]获取它。此外,请查看其 [GitHub release][9] 部分的 .deb / .rpm 或其他包。 -[Download Rambox Community Edition][4] +- [下载 Rambox 社区版][4] ### 总结 @@ -69,7 +67,7 @@ Rambox 提供可免费使用的[开源社区版][4]。付费专业版允许你 还有一个类似的应用称为 [Franz][10],它也像 Rambox 部分开源、部分高级版。 -尽管像 Rambox 或 Franz 这样的解决方案非常有用,但它们并不总是资源友好,特别是如果你同时使用数十个服务。因此,请留意系统资源(如果你注意到对性能的影响)。 +尽管像 Rambox 或 Franz 这样的解决方案非常有用,但它们并不总是节约资源,特别是如果你同时使用数十个服务。因此,请留意系统资源(如果你注意到对性能的影响)。 除此之外,这是一个令人印象深刻的应用。你有试过了么?欢迎随时让我知道你的想法! @@ -80,7 +78,7 @@ via: https://itsfoss.com/rambox/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1696a7b3369362dfd2db3ef57cdba92cb4bf7e02 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Apr 2020 22:36:53 +0800 Subject: [PATCH 0539/1809] PUB @geekpi https://linux.cn/article-12171-1.html --- .../20200331 Rambox is an All-in-one Messenger for Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20200331 Rambox is an All-in-one Messenger for Linux.md (100%) diff --git a/translated/tech/20200331 Rambox is an All-in-one Messenger for Linux.md b/published/20200331 Rambox is an All-in-one Messenger for Linux.md similarity index 100% rename from translated/tech/20200331 Rambox is an All-in-one Messenger for Linux.md rename to published/20200331 Rambox is an All-in-one Messenger for Linux.md From 3124f64e0addc3396e83f8c3af28cf699d33e97e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 1 May 2020 01:04:02 +0800 Subject: [PATCH 0540/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200501=20How?= =?UTF-8?q?=20to=20Handle=20Automatic=20Updates=20in=20Ubuntu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200501 How to Handle Automatic Updates in Ubuntu.md --- ...w to Handle Automatic Updates in Ubuntu.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sources/tech/20200501 How to Handle Automatic Updates in Ubuntu.md diff --git a/sources/tech/20200501 How to Handle Automatic Updates in Ubuntu.md b/sources/tech/20200501 How to Handle Automatic Updates in Ubuntu.md new file mode 100644 index 0000000000..b62af6da74 --- /dev/null +++ b/sources/tech/20200501 How to Handle Automatic Updates in Ubuntu.md @@ -0,0 +1,125 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Handle Automatic Updates in Ubuntu) +[#]: via: (https://itsfoss.com/auto-updates-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Handle Automatic Updates in Ubuntu +====== + +_**Brief: This tutorial teaches you how to handle the unattended upgrade i.e. the automatic system updates in Ubuntu Linux.**_ + +Sometimes, when you try to [shutdown your Ubuntu system][1], you may come across this screen that stops you from shutting down: + +**Unattended-upgrade in progress during shutdown, please don’t turn off the computer.** + +![Unattended Upgrade In Progress In Ubuntu][2] + +You might wonder what is this “unattended upgrade” and how come it is running without your knowledge. + +The reason is that [Ubuntu][3] takes your system’s security very seriously. By default, it automatically checks for system updates daily and if it finds any security updates, it downloads those updates and install them on its own. For normal system and application updates, it notifies you via the Software Updater tool. + +Since all this happens in the background, you don’t even realize it until you try to shutdown your system or try to install applications on your own. + +Trying to install a new software when these unattended upgrades are in progress leads to the famous [could not get lock error][4]. + +![][5] + +As you can see, the automatic updates present a couple of minor annoyance. You may choose to disable the auto updates but that would mean that you’ll have to check and [update your Ubuntu system][6] manually all the time. + +Do you really need to disable auto updates? + +Please note that this is a security feature. Linux allows you to do practically everything in your system even disabling these security features. +But in my opinion, as a regular user, _**you should not disable the automatic updates**_. It keeps your system safe after all. +For the sake of your system’s security, you may tolerate the minor annoyances that come with the automatic updates. + +Now that you have been warned and you think it is better to take up the additional task of manually updating your system, let’s see how to handle the auto updates. + +As always, there are two ways to do it: GUI and command line. I’ll show you both methods. + +I have used Ubuntu 20.04 here but the steps are valid for Ubuntu 18.04 and any other Ubuntu version. + +### Method 1: Disable automatic updates in Ubuntu graphically + +Go to the menu and look for ‘software & updates’ tool. + +![Software & Updates Settings][7] + +In here, go to Updates tab. Now look for the “Automatically check for updates”. By default it is set to Daily. + +You can change it to Never and your system will never check for updates on its own again. And if it won’t check for updates, it won’t find new updates to install. + +![Disable Auto Updates in Ubuntu Completely][8] + +If you do this, you must manually update your system from time to time. But that’s an additional chore to do and you may not remember it all the time. + +#### Slightly better way to handle auto updates in Ubuntu + +Personally, I would suggest to let it check for updates on its own. If you don’t want it installing the updates automatically, you can change that behavior to get notified about the availability of security updates. + +Keep “Automatically check for updates” to Daily and change “When there are security updates” option to “Display immediately” instead of “Download and install automatically”. + +![Get notified for security updates instead of automatically installing them][9] + +This way, it checks for updates and if there are updates, instead of installing them automatically in the background, the Software Updater tool notifies you that updates are available for your system. Your system already does that for normal system and software updates. + +![Get notified about security updates][10] + +With this setup, you won’t see the “unattended upgrades in progress” when you shutdown your system However, you may still encounter the ‘could not get lock’ error because two separate processes cannot use apt package manager at the same time. + +I believe this is a better solution, don’t you you think? + +As I promised both GUI and command line methods, let me show you how to disable unattended upgrades in the terminal. + +### How to disable automatic updates in Ubuntu using command line + +You’ll find the auto-upgrades settings in the **/etc/apt/apt.conf.d/20auto-upgrades** file. The default text editor in Ubuntu terminal is Nano so you can use this command to edit this configuration file: + +``` +sudo nano /etc/apt/apt.conf.d/20auto-upgrades +``` + +Now, if you don’t want your system to check for updates automatically, you can change the value of APT::Periodic::Update-Package-Lists to 0. + +``` +APT::Periodic::Update-Package-Lists "0"; +APT::Periodic::Unattended-Upgrade "0"; +``` + +If you want it to check for updates but don’t install the unattended-upgrades automatically, you can choose to set it like this: + +``` +APT::Periodic::Update-Package-Lists "1"; +APT::Periodic::Unattended-Upgrade "0"; +``` + +**In the end…** + +The automatic security updates are enabled automatically for a reason and I recommend you keep it like this. A couple of minor annoyances are not really worth risking the security of your system. What do you think? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/auto-updates-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/schedule-shutdown-ubuntu/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/unattended-upgrade-in-progress-in-ubuntu.png?ssl=1 +[3]: https://ubuntu.com/ +[4]: https://itsfoss.com/could-not-get-lock-error/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/Could_not_get_lock.jpg?ssl=1 +[6]: https://itsfoss.com/update-ubuntu/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-updates-settings-ubuntu-20-04.jpg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/disable-auto-updates-ubuntu.jpg?ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/handle-auto-updates-ubuntu.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/updates-available-ubuntu.png?ssl=1 From e6d0a79cfef742d1486846b160770f08e40c1094 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 1 May 2020 01:07:37 +0800 Subject: [PATCH 0541/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200430=2010?= =?UTF-8?q?=20ways=20to=20analyze=20binary=20files=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200430 10 ways to analyze binary files on Linux.md --- ...0 ways to analyze binary files on Linux.md | 321 ++++++++++++++++++ 1 file changed, 321 insertions(+) create mode 100644 sources/tech/20200430 10 ways to analyze binary files on Linux.md diff --git a/sources/tech/20200430 10 ways to analyze binary files on Linux.md b/sources/tech/20200430 10 ways to analyze binary files on Linux.md new file mode 100644 index 0000000000..7e05f87298 --- /dev/null +++ b/sources/tech/20200430 10 ways to analyze binary files on Linux.md @@ -0,0 +1,321 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 ways to analyze binary files on Linux) +[#]: via: (https://opensource.com/article/20/4/linux-binary-analysis) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) + +10 ways to analyze binary files on Linux +====== +These simple commands and tools can help you sail through the task of +analyzing binary files. +![Tux with binary code background][1] + +"There are 10 types of people in this world: those who understand binary and those who don't." + +We work with binaries daily, yet we understand so little about them. By binaries, I mean the executable files that you run daily, right from your command line tools to full-fledged applications. + +Linux provides a rich set of tools that makes analyzing binaries a breeze! Whatever might be your job role, if you are working on Linux, knowing the basics about these tools will help you understand your system better. + +In this article, we will cover some of the most popular of these Linux tools and commands, most of which will be available natively as part of your Linux distribution. If not, you can always use your package manager to install and explore them. Remember: learning to use the right tool at the right occasion requires plenty of patience and practice. + +### file + +What it does: Help to determine the file type. + +This will be your starting point for binary analysis. We work with files daily. Not everything is an executable type; there is a whole wide range of file types out there. Before you start, you need to understand the type of file that is being analyzed. Is it a binary file, a library file, an ASCII text file, a video file, a picture file, a PDF, a data file, etc.? + +The **file** command will help you identify the exact file type that you are dealing with. + + +``` +$ file /bin/ls +/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=94943a89d17e9d373b2794dcb1f7e38c95b66c86, stripped +$ +$ file /etc/passwd +/etc/passwd: ASCII text +$ +``` + +### ldd + +What it does: Print shared object dependencies. + +If you have already used the **file** command above on an executable binary, you can't miss the "dynamically linked" message in the output. What does it mean? + +When software is being developed, we try not to reinvent the wheel. There are a set of common tasks that most software programs require, like printing output or reading from standard in, or opening files, etc. All of these common tasks are abstracted away in a set of common functions that everybody can then use instead of writing their own variants. These common functions are put in a library called **libc** or **glibc**. + +How does one find which libraries the executable is dependent on? That’s where **ldd** command comes into the picture. Running it against a dynamically linked binary shows all its dependent libraries and their paths. + + +``` +$ ldd /bin/ls +        linux-vdso.so.1 =>  (0x00007ffef5ba1000) +        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fea9f854000) +        libcap.so.2 => /lib64/libcap.so.2 (0x00007fea9f64f000) +        libacl.so.1 => /lib64/libacl.so.1 (0x00007fea9f446000) +        libc.so.6 => /lib64/libc.so.6 (0x00007fea9f079000) +        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fea9ee17000) +        libdl.so.2 => /lib64/libdl.so.2 (0x00007fea9ec13000) +        /lib64/ld-linux-x86-64.so.2 (0x00007fea9fa7b000) +        libattr.so.1 => /lib64/libattr.so.1 (0x00007fea9ea0e000) +        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fea9e7f2000) +$ +``` + +### ltrace + +What it does: A library call tracer. + +We now know how to find the libraries an executable program is dependent on using the **ldd** command. However, a library can contain hundreds of functions. Out of those hundreds, which are the actual functions being used by our binary? + +The **ltrace** command displays all the functions that are being called at run time from the library. In the below example, you can see the function names being called, along with the arguments being passed to that function. You can also see what was returned by those functions on the far right side of the output. + + +``` +$ ltrace ls +__libc_start_main(0x4028c0, 1, 0x7ffd94023b88, 0x412950 <unfinished ...> +strrchr("ls", '/')                                                                  = nil +setlocale(LC_ALL, "")                                                               = "en_US.UTF-8" +bindtextdomain("coreutils", "/usr/share/locale")                                    = "/usr/share/locale" +textdomain("coreutils")                                                             = "coreutils" +__cxa_atexit(0x40a930, 0, 0, 0x736c6974756572)                                      = 0 +isatty(1)                                                                           = 1 +getenv("QUOTING_STYLE")                                                             = nil +getenv("COLUMNS")                                                                   = nil +ioctl(1, 21523, 0x7ffd94023a50)                                                     = 0 +<< snip >> +fflush(0x7ff7baae61c0)                                                              = 0 +fclose(0x7ff7baae61c0)                                                              = 0 ++++ exited (status 0) +++ +$ +``` + +### Hexdump + +What it does: Display file contents in ASCII, decimal, hexadecimal, or octal. + +Often, it happens that you open a file with an application that doesn’t know what to do with that file. Try opening an executable file or a video file using vim; all you will see is gibberish thrown on the screen. + +Opening unknown files in Hexdump helps you see what exactly the file contains. You can also choose to see the ASCII representation of the data present in the file using some command-line options. This might help give you some clues to what kind of file it is. + + +``` +$ hexdump -C /bin/ls | head +00000000  7f 45 4c 46 02 01 01 00  00 00 00 00 00 00 00 00  |.ELF............| +00000010  02 00 3e 00 01 00 00 00  d4 42 40 00 00 00 00 00  |..>......B@.....| +00000020  40 00 00 00 00 00 00 00  f0 c3 01 00 00 00 00 00  |@...............| +00000030  00 00 00 00 40 00 38 00  09 00 40 00 1f 00 1e 00  |....@.8...@.....| +00000040  06 00 00 00 05 00 00 00  40 00 00 00 00 00 00 00  |........@.......| +00000050  40 00 40 00 00 00 00 00  40 00 40 00 00 00 00 00  |@.@.....@.@.....| +00000060  f8 01 00 00 00 00 00 00  f8 01 00 00 00 00 00 00  |................| +00000070  08 00 00 00 00 00 00 00  03 00 00 00 04 00 00 00  |................| +00000080  38 02 00 00 00 00 00 00  38 02 40 00 00 00 00 00  |8.......8.@.....| +00000090  38 02 40 00 00 00 00 00  1c 00 00 00 00 00 00 00  |8.@.............| +$ +``` + +### strings + +What it does: Print the strings of printable characters in files. + +If Hexdump seems a bit like overkill for your use case and you are simply looking for printable characters within a binary, you can use the **strings** command. + +When software is being developed, a variety of text/ASCII messages are added to it, like printing info messages, debugging info, help messages, errors, and so on. Provided all this information is present in the binary, it will be dumped to screen using **strings**. + + +``` +`$ strings /bin/ls` +``` + +### readelf + +What it does: Display information about ELF files. + +ELF (Executable and Linkable File Format) is the dominant file format for executable or binaries, not just on Linux but a variety of UNIX systems as well. If you have utilized tools like file command, which tells you that the file is in ELF format, the next logical step will be to use the **readelf** command and its various options to analyze the file further. + +Having a reference of the actual ELF specification handy when using **readelf** can be very useful. You can find the specification [here][2].  + + +``` +$ readelf -h /bin/ls +ELF Header: +  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 +  Class:                             ELF64 +  Data:                              2's complement, little endian +  Version:                           1 (current) +  OS/ABI:                            UNIX - System V +  ABI Version:                       0 +  Type:                              EXEC (Executable file) +  Machine:                           Advanced Micro Devices X86-64 +  Version:                           0x1 +  Entry point address:               0x4042d4 +  Start of program headers:          64 (bytes into file) +  Start of section headers:          115696 (bytes into file) +  Flags:                             0x0 +  Size of this header:               64 (bytes) +  Size of program headers:           56 (bytes) +  Number of program headers:         9 +  Size of section headers:           64 (bytes) +  Number of section headers:         31 +  Section header string table index: 30 +$ +``` + +### objdump + +What it does: Display information from an object file. + +Binaries are created when you write source code which gets compiled using a tool called, unsurprisingly, a compiler. This compiler generates machine language instructions equivalent to the source code, which can then be executed by the CPU to perform a given task. This machine language code can be interpreted via mnemonics called an assembly language. An assembly language is a set of instructions that help you understand the operations being performed by the program and ultimately being executed on the CPU. + +**objdump** utility reads the binary or executable file and dumps the assembly language instructions on the screen. Knowledge of assembly is critical to understand the output of the **objdump** command. + +Remember: assembly language is architecture-specific. + + +``` +$ objdump -d /bin/ls | head + +/bin/ls:     file format elf64-x86-64 + +Disassembly of section .init: + +0000000000402150 <_init@@Base>: +  402150:       48 83 ec 08             sub    $0x8,%rsp +  402154:       48 8b 05 6d 8e 21 00    mov    0x218e6d(%rip),%rax        # 61afc8 <__gmon_start__> +  40215b:       48 85 c0                test   %rax,%rax +$ +``` + +### strace + +What it does: Trace system calls and signals. + +If you have used **ltrace**, mentioned earlier, think of **strace** being similar. The only difference is that, instead of calling a library, the **strace** utility traces system calls. System calls are how you interface with the kernel to get work done. + +To give an example, if you want to print something to the screen, you will use the **printf** or **puts** function from the standard library **libc**; however, under the hood, ultimately, a system call named **write** will be made to actually print something to the screen. + + +``` +$ strace -f /bin/ls +execve("/bin/ls", ["/bin/ls"], [/* 17 vars */]) = 0 +brk(NULL)                               = 0x686000 +mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f967956a000 +access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory) +open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 +fstat(3, {st_mode=S_IFREG|0644, st_size=40661, ...}) = 0 +mmap(NULL, 40661, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9679560000 +close(3)                                = 0 +<< snip >> +fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0 +mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9679569000 +write(1, "R2  RH\n", 7R2  RH +)                 = 7 +close(1)                                = 0 +munmap(0x7f9679569000, 4096)            = 0 +close(2)                                = 0 +exit_group(0)                           = ? ++++ exited with 0 +++ +$ +``` + +### nm + +What it does: List symbols from object files. + +If you are working with a binary that is not stripped, the **nm** command will provide you with the valuable information that was embedded in the binary during compilation. **nm** can help you identify variables and functions from the binary. You can imagine how useful this would be if you don't have access to the source code of the binary being analyzed. + +To showcase **nm**, we will quickly write a small program and compile it with the **-g** option, and we will also see that the binary is not stripped by using the file command. + + +``` +$ cat hello.c +#include <stdio.h> + +int main() { +    printf("Hello world!"); +    return 0; +} +$ +$ gcc -g hello.c -o hello +$ +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=3de46c8efb98bce4ad525d3328121568ba3d8a5d, not stripped +$ +$ ./hello +Hello world!$ +$ + +$ nm hello | tail +0000000000600e20 d __JCR_END__ +0000000000600e20 d __JCR_LIST__ +00000000004005b0 T __libc_csu_fini +0000000000400540 T __libc_csu_init +                 U __libc_start_main@@GLIBC_2.2.5 +000000000040051d T main +                 U printf@@GLIBC_2.2.5 +0000000000400490 t register_tm_clones +0000000000400430 T _start +0000000000601030 D __TMC_END__ +$ +``` + +### gdb + +What it does: The GNU debugger. + +Well, not everything in the binary can be statically analyzed. We did execute some commands which ran the binary, like **ltrace** and **strace**; however, software consists of a variety of conditions that could lead to various alternate paths being executed. + +The only way to analyze these paths is at run time by having the ability to stop or pause the program at any given location and being able to analyze information and then move further down. +That is where debuggers come into the picture, and on Linux, **gdb** is the defacto debugger. It helps you load a program, set breakpoints at specific places, analyze memory and CPU register, and do much more. It complements the other tools mentioned above and allows you to do much more runtime analysis. + +One thing to notice is, once you load a program using **gdb**, you will be presented with its own **(gdb)** prompt. All further commands will be run in this **gdb** command prompt until you exit. + +We will use the "hello" program that we compiled earlier and use **gdb** to see how it works. + + +``` +$ gdb -q ./hello +Reading symbols from /home/flash/hello...done. +(gdb) break main +Breakpoint 1 at 0x400521: file hello.c, line 4. +(gdb) info break +Num     Type           Disp Enb Address            What +1       breakpoint     keep y   0x0000000000400521 in main at hello.c:4 +(gdb) run +Starting program: /home/flash/./hello + +Breakpoint 1, main () at hello.c:4 +4           printf("Hello world!"); +Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.6.x86_64 +(gdb) bt +#0  main () at hello.c:4 +(gdb) c +Continuing. +Hello world![Inferior 1 (process 29620) exited normally] +(gdb) q +$ +``` + +### Conclusion + +Once you are comfortable with using these native Linux binary analysis tools and understanding the output they provide, you can then move onto more advanced and professional open source binary analysis tools like [radare2][3]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/linux-binary-analysis + +作者:[Gaurav Kamathe][a] +选题:[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/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tux_linux_penguin_code_binary.jpg?itok=TxGxW0KY (Tux with binary code background) +[2]: http://www.skyfree.org/linux/references/ELF_Format.pdf +[3]: https://github.com/radareorg/radare2 From 5be54b8611613430dfccaae341d33b2c19ef4abf Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 1 May 2020 01:08:33 +0800 Subject: [PATCH 0542/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200430=20Edit?= =?UTF-8?q?=20music=20recordings=20with=20Audacity=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200430 Edit music recordings with Audacity on Linux.md --- ...music recordings with Audacity on Linux.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20200430 Edit music recordings with Audacity on Linux.md diff --git a/sources/tech/20200430 Edit music recordings with Audacity on Linux.md b/sources/tech/20200430 Edit music recordings with Audacity on Linux.md new file mode 100644 index 0000000000..be6f68f062 --- /dev/null +++ b/sources/tech/20200430 Edit music recordings with Audacity on Linux.md @@ -0,0 +1,161 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Edit music recordings with Audacity on Linux) +[#]: via: (https://opensource.com/article/20/4/audacity) +[#]: author: (David Both https://opensource.com/users/dboth) + +Edit music recordings with Audacity on Linux +====== +How COVID-19 caused me to learn Audacity on the fly and learn to love +it. +![Bird singing and music notes][1] + +In this strange and difficult time of a global pandemic, we are all called upon to do things differently, to change our routines, and to learn new things. + +I have worked from home for many years, so that is nothing new to me. Even though I am allegedly retired, I write articles for Opensource.com and [Enable Sysadmin][2] and books. I also manage my own home network, which is larger than you might think, and my church's network and Linux hosts, and I help a few friends with Linux. All of this keeps me busy doing what I like to do, and all of it is usually well within my comfort zone. + +But COVID-19 has changed all of that. And, like many other types of organizations, my church had to move quickly to a new service-delivery paradigm. And that is what churches do—deliver a specific kind of service. As the church sysadmin and with some knowledge of audio recording and editing (back in the '70s, I mixed the sound and was the only roadie for a couple of regional folk-rock groups in Toledo, Ohio), I decided to learn the open source audio recording and editing software [Audacity][3] to help meet this challenge. + +This is not a comprehensive how-to article about using Audacity. It is about my experiences getting started with this powerful audio-editing tool, but there should be enough information here to help you get started. + +I have learned just what I need to know in order to accomplish my task: combining several separate audio clips into a single MP3 audio file. If you already know Audacity and do things differently or know things that I don't, that is expected. And if you have any suggestions to help me accomplish my task more easily, please share them in the comments. + +### The old way + +I try not to use the term "normal" now because it is hard to know exactly what that is—if such a state even exists. But our old method of producing recordings for our shut-ins, members who are traveling, and anyone else was to record the sermon portion of our regular, in-person church services and post them on our website. + +To do this, I installed a TASCAM SS-R100 solid-state recorder that stores the sermons as MP3 files on a thumb drive. We uploaded the recordings to a special directory of our website so people could download them. The recordings are uploaded using a Bash [program][4] I wrote for the task. _Automate everything!_ I trained a couple of others to perform these tasks using sudo in case I was not available. + +This all worked very well. Until it didn't. + +### The new way + +As soon as the first restrictions on large gatherings occurred, we made some changes. We could still have small gatherings, so four of us met Sunday mornings and recorded an abbreviated service using our in-house recorder and doing the upload the usual way. This worked, but as the crisis deepened and it became more of a risk to meet with even a few people, we had to make more changes. + +Like a huge number of other organizations, we realized we each needed to perform our parts of creating services in separate locations from our own homes. + +Now, depending upon the structure of the service, I receive several recordings that I need to combine to create the full church service. Our music director records each anthem and interlude using her iPhone and sends me the recordings in the M4A (MPEG-4 audio) format. They each range in length from seconds to five minutes and are up to 3MB in size. Likewise, our rector sends me two to six recordings, also in M4A format, that contains his portion of the service. Sometimes, other musicians in our church send solos or duets recorded with their significant others; these can be in MP3 or M4A formats. + +Then, I pull all of this together into a single recording that can be uploaded to our server for people to download. I use Audacity for this because it was available in my repo, and it was easy to get started. + +### Getting started with Audacity + +I had never used [Audacity][5] before this, so, like many others these days, I needed to learn something new just in time to accomplish what I needed to do. I struggled a bit at first, but it turned out to be fun and very enlightening. + +Audacity was easy to install on my Fedora 31 workstation because, as in many distros, it is available from the Fedora repository. + +The first time I opened Audacity with the program launcher icon, the application's window was empty with no projects nor tracks present. Audacity projects have an AUP extension, so if you have an existing project, you could click on the file in your favorite file manager and launch Audacity that way. + +### Convert M4A to MP3 + +As installed by Fedora, Audacity does not recognize M4A files. Regardless of how you proceed, you need to install the [LAME][6] MP3 encoder and [FFmpeg][7] import/export library, both of which are available from the Fedora repository and, most likely, any other distro's repository. + +There are websites that explain how to configure Audacity to use these tools to import and convert audio files from M4A to other types (such as MP3), but I decided to write a script to do it from the command line. For one reason, using a script is faster than doing a lot of extra clicking in a GUI interface, and for another, the file names need some work, so I already needed a script to rename the files. Many people use non-alphanumeric characters to name files, but I don't like dealing with special keyboard characters from the command line. It's easier to manage files with simple alphanumeric names, so my script removes all non-alphanumeric characters from the file names and then converts the files to MP3 format. + +You may choose a different approach, but I like the scripted solution. It is fast, and I only need to run the script once, no matter how many files need to be renamed and converted to MP3. + +### Create a new project + +You can create a new project whether or not any audio tracks are loaded. I recommend creating the project first, before importing any audio files (aka "clips"). From the Menu bar, select **File > Save Project > Save Project As**. This opens a warning dialog window that says, _"'Save project' is for an Audacity project, not an audio file."_ Click the **OK** button to continue to a standard file-save dialog. + +I found that I needed to do this twice. The first time, the warning dialog did not display any buttons, so I had to close the dialog using the window menu or the x icon in the Title bar. + +Name the project whatever you like, and Audacity automatically adds the AUP extension. You now have an empty project. + +### Add audio files to your project + +The first step is to add your audio files to the project. Using the Menu bar, open **File > Import > Audio** and then use the file dialog to select one or more files to import. For my first test project, I loaded all the files at once without sorting the tracks nor aligning the clips in the desired sequence along the timeline. This time, I started by loading the audio files one at a time in the sequence I wanted them from top to bottom. As each file is imported, it is placed into a new track below any existing tracks. The following image shows the files loaded all at one time in the sequence they appear in the working directory. + +![Tracks loaded in Audacity][8] + +There is a timeline across the top of the window's track area. There is also a scroll bar at the bottom of the window, so you can scroll along the timeline when the tracks extend beyond the width of the Audacity window. There is also a vertical scroll bar if there are more tracks than fit into the window. + +Notice the names in the upper-left corner of the waveform section of each track—they are the file names of each track without the extension. These are not there by default, but I find them helpful. To display these names, use the Menu bar to select **Edit > Preferences** and place a check in the **Show Audio Track Name As Overlay** box. + +### Order your audio clips + +Once you have some files loaded into the Audacity workspace, you can start manipulating them. To order your audio clips, select one and use the **Time-Shift** tool (↔︎) to slide them horizontally along the tracks; continue doing this until all the clips line up end to end in the order you want them. Note that the clip you are moving is book-ended by a pair of vertical alignment lines. When they line up perfectly, the end lines of the two aligned tracks change color to alert you. + +You can hover the mouse pointer over the tool icons in the Audacity toolbars to see a pop-up that displays the name of that tool. This helps beginners understand what each tool does. + +![Audacity toolbox][9] + +Here, the **Selection** tool** **is selected in the Audacity toolbar. The **Time-Shift** tool is second from the left on the bottom row. + +The following image shows what happens when you slide the audio clips into place on the project timeline without sorting the tracks into a particular sequence. This may not be optimal for how you like to work. It is not for me. + +![Audio clips in Audacity][10] + +To remove segments of (or complete) audio clips, select them with the **Selection** tool—you can also select multiple adjacent tracks. Then you can press the **Delete** button on your keyboard to delete the selected segment(s). + +In the image above, you can see a vertical black line in track 1 and a vertical green line crossing all the tracks. These are the audio cursors that show the playback positions of a track or the entire project. Choose the **Selection** tool and click the desired position within a track, then click the **Play** button on the transport controls (in the upper-left of the Audacity window) to begin playback. Playback will continue past the end of the selected track and all the way to the end of the project. If tracks overlap on the timeline, they will play simultaneously. + +To begin playback immediately, click the desired starting point on the timeline. To play part of a track, hold down the Left mouse button to select a short segment of the track, and then click the **Play** button. The other transport buttons—Pause, Stop, and so—on are identified with universal icons and work as you would expect. + +You can also click the **Silence Audio Selection** button—the fifth button from the left on the **Edit** toolbar (shown below)—to completely silence a selected segment while leaving it in place for timing purposes. This is how I silenced a number of background clicks and noises. + +![Audacity edit tools][11] + +It took me a while to figure out how to sort the tracks vertically, and it turns out there are a few different ways to accomplish the task. + +You can use the track menu to reorder arrangement. Each track has its own Control Panel on the left side (shown below). The track drop-down Menu bar at the top of the Control Panel opens a menu that provides several track-sequencing options to move a track up, down, to the top, or to the bottom. + +![Moving tracks in Audacity][12] + +The items to move a track up or down move the track one position at a time, so you have to select it as many times as necessary to get the track in the desired position. + +To drag and drop tracks, you must click on the space occupied by the track details. In this screenshot, that's "Mono, 48000Hz 32 bit float". It can be tricky, because if you click too high, you adjust the panning (the left and right stereo position) and if you click too low, you may collapse or select the track. Target the "Mono" or "Stereo" label (whatever your track happens to be) label, and then click and drag the track up or down to reposition it in your workspace. + +### Apply amplification and noise reduction effects + +Some tracks need the overall volume to be adjusted. I used the **Selection** tool to double-click and select the entire track (but you could also select a portion of a track). On the Menu bar, select **Effect > Amplify** to display a small dialog window. You can use the slider or enter a value to specify the amount of amplification. Negative numbers decrease the volume. If you try to increase the volume, you need to place a check in the **Allow Clipping** box. Then click OK. + +I found that amplification is a bit tricky; it is easy to use too much or too little. Start by using small numbers to see the results. You can always use **Ctrl+Z** to undo your changes if you go too far in either direction. + +Another effect I find useful is noise reduction. One of the tracks was recorded with a noticeable 60Hz hum, which is usually due to poor grounding of the microphone or recorder. Fortunately, there were only several seconds of hum and no other sound at the beginning of the recording. + +Applying the noise reduction effect was a little confusing at first. First, I selected a few samples of the humming sound to tell Audacity what sound needed to be reduced, and then I navigated to **Effect > Noise Reduction**. This opens the **Noise Reduction** dialog. I clicked on the **Get Noise Profile** button in the Step 1 section of the dialog, which uses the selected sample as the basis for a set of filter presets. After it gathers the selected sample, though, the dialog disappeared (this is by design). I re-opened the dialog, used the slider to select the noise reduction level in decibels (I set it to 15dB and left the other sliders alone), and then clicked **OK**. + +This worked well—you can hear the residual hum only if you know it is there. I need to experiment with this some more, but since the result was acceptable, so I did not play with the settings any further. + +The reason the dialog box closes after getting a noise profile is actually for the sake of expediency. If you're processing many tracks or segments of audio, each with a different noise profile, you can open the **Noise Reduction** effect, get the current noise profile, and then select the audio you want to clean. You can then run the Noise Reduction filter using **Ctrl+R**, the keyboard shortcut for running the most recent filter. Instead of getting a new noise profile, however, Audacity uses the one you've just stored, and performs the filter instead. This way, you can get a sample with a few clicks but clean lots of audio with just one keyboard shortcut. + +### And so much more + +I have only worked with a few of the basics and have not even begun to scratch the surface of Audacity. I can already see that it has so many more features and tools that will enable me to create even more professional-sounding projects. + +For example, in addition to working with existing audio files, Audacity can make recordings from line inputs, the desktop sound stream, and microphone inputs. It can do special effects like fade in and out and cross-fades. And I have not even tried to figure out what many of the other effects and tools are capable of. + +I have a feeling I will need to learn more in the near future. Hopefully, this story of my very limited experience with Audacity will prompt you to check it out. For much more information, you can find the [Audacity manual][13] online. + +Using Audacity, you can quickly clean up audio file so that any background noise becomes tolerable. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/audacity + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/music-birds-recording-520.png?itok=UoM7brl0 (Bird singing and music notes) +[2]: https://www.redhat.com/sysadmin/ +[3]: https://www.audacityteam.org/ +[4]: https://opensource.com/article/17/12/using-sudo-delegate +[5]: https://opensource.com/education/16/9/audacity-classroom +[6]: https://manual.audacityteam.org/man/installing_and_updating_audacity_on_linux.html#linlame +[7]: https://manual.audacityteam.org/man/installing_and_updating_audacity_on_linux.html#linff +[8]: https://opensource.com/sites/default/files/uploads/audacity1_tracksloaded.png (Tracks loaded in Audacity) +[9]: https://opensource.com/sites/default/files/uploads/audacity2_tools.png (Audacity toolbox) +[10]: https://opensource.com/sites/default/files/uploads/audacity3_audioclips.png (Audio clips in Audacity) +[11]: https://opensource.com/sites/default/files/uploads/audacity4_edittoolbar.png (Audacity edit tools) +[12]: https://opensource.com/sites/default/files/uploads/audacity5_trackmovement.png (Moving tracks in Audacity) +[13]: https://manual.audacityteam.org/# From 79f7456fc5834d2761be91d0ba272b041d7ef035 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 1 May 2020 01:11:55 +0800 Subject: [PATCH 0543/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200430=20Indu?= =?UTF-8?q?strial=20robots=20could=20'eat=20metal'=20to=20power=20themselv?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200430 Industrial robots could -eat metal- to power themselves.md --- ...s could -eat metal- to power themselves.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/talk/20200430 Industrial robots could -eat metal- to power themselves.md diff --git a/sources/talk/20200430 Industrial robots could -eat metal- to power themselves.md b/sources/talk/20200430 Industrial robots could -eat metal- to power themselves.md new file mode 100644 index 0000000000..45995a9660 --- /dev/null +++ b/sources/talk/20200430 Industrial robots could -eat metal- to power themselves.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Industrial robots could 'eat metal' to power themselves) +[#]: via: (https://www.networkworld.com/article/3540194/industrial-robots-could-eat-metal-to-power-themselves.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Industrial robots could 'eat metal' to power themselves +====== +Scavenging energy by foraging for metal could power Internet of Things electronics and robots, suggest researchers at University of Pennsylvania. +Jiraroj Praditcharoenkul / Getty Images + +A fundamental manufacturing shift is on the horizon, some say. It's where robots run all elements of our future factories. The machines will operate using brain-copying artificial intelligence and handle not only manufacturing processes, but also supply-chain logistics, planning, and other roles formerly performed by humans. + +This vision of the future anticipates an industrial workplace where Internet-connected machines will mimic humans, yet do the jobs more precisely, faster and cheaper than humans. + +And the human-copying element may not end there. Researchers at the University of Pennsylvania are suggesting that robots could end up eating like humans, too. + +Robots will "eat metal for energy," according to a [news article][1] published in Medium. The researchers' vision for a "metal-air scavenger" could solve one of the quandaries of future IoT-enabled factories. That quandary is how to power a device that moves without adding mass and weight, as one does by adding bulky batteries. + +The answer, according to the University of Pennsylvania researchers, is to try to electromechanically forage for energy from the metal surfaces that a robot or IoT device traverses, thus converting material garnered, using a chemical reaction, into power. + +"Robots and electronics [would] extract energy from large volumes of energy dense material without having to carry the material on-board," the researchers say in a paper they've published in [ACS Energy Letters][2]. + +It would be like "eating metal, breaking down its chemical bonds for energy like humans do with food." Batteries work by repeatedly breaking and creating chemical bonds. + +The research references the dichotomy between computing and power storage. Computing is well suited to miniaturization, and processers have been progressively reduced in size while performance has increased, but battery storage hasn't. You need a bigger battery for more energy. + +Even if swarming, industrial robots became the size of insects (I've [written about][3] the possibility), there's an issue powering the nano devices – the required size of the power source would defeat the object of the miniaturization. The battery alone could crush the device, and even if it didn't, the machine would need excessive amounts of energy to move, because of the battery mass. This conundrum is one of the reasons there's an emphasis in IoT development to find ways to harvest energy ambiently. + +However, with ambient power – such as is found in [solar or potentially magnetism][4], for example – power density comes into play. That's where the harvesting technology can't pull enough energy out of the environment, or it does it so slowly that it's not as power-effective as traditional batteries. + +Enter the metal-eating robot. The University of Pennsylvania researchers' form of harvesting efficiently replicates a power-dense battery. Metal is more dense than the battery chemistry. + +The group performs their foraging energy production with a hydrogel electrolyte sponge towed by the robot. It uses a cathode, dragged over the surface, to extract amperages from the metal fuel source, such as steel or aluminum. + +"Our [metal-air scavenger] has a power density that's ten times better than the best harvesters, to the point that we can compete against batteries," said James Pikul, an assistant professor in the University of Pennsylvania's Department of Mechanical Engineering and Applied Mechanics and one of the paper authors, in the Medium post. "It's using battery chemistry, but doesn't have the associated weight, because it's taking those chemicals from the environment." + +This method is also potentially better than existing lithium-ion battery chemistry, according to Pikul. + +"One day, a robot that needs to recharge its batteries will just need to find some aluminum to 'eat,'" Pikul said. + +The robot, although ultimately likely to be a better worker than the human, is a messy eater. As it oxidizes the metal it passes over, it leaves a "microscopic layer of rust in its wake," according to the article. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3540194/industrial-robots-could-eat-metal-to-power-themselves.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://medium.com/penn-engineering/penn-engineerings-new-scavenger-technology-allows-robots-to-eat-metal-for-energy-bd12f3b83893 +[2]: https://pubs.acs.org/doi/10.1021/acsenergylett.9b02661 +[3]: https://www.networkworld.com/article/3429200/self-organizing-micro-robots-may-soon-swarm-the-industrial-iot.html +[4]: https://www.networkworld.com/article/3536697/harvesting-ambient-energy-will-power-iot-scientists-say.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 4018bc654c3bb6e82e7ef5953a04fd966701aa93 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 1 May 2020 08:21:17 +0800 Subject: [PATCH 0544/1809] APL --- .../tech/20200430 10 ways to analyze binary files on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200430 10 ways to analyze binary files on Linux.md b/sources/tech/20200430 10 ways to analyze binary files on Linux.md index 7e05f87298..f43ae83efa 100644 --- a/sources/tech/20200430 10 ways to analyze binary files on Linux.md +++ b/sources/tech/20200430 10 ways to analyze binary files on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 533ffb6e1152b567d4628e642b7f468f125f01c6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 1 May 2020 09:10:29 +0800 Subject: [PATCH 0545/1809] TSL --- ...0 ways to analyze binary files on Linux.md | 321 ------------------ ...0 ways to analyze binary files on Linux.md | 314 +++++++++++++++++ 2 files changed, 314 insertions(+), 321 deletions(-) delete mode 100644 sources/tech/20200430 10 ways to analyze binary files on Linux.md create mode 100644 translated/tech/20200430 10 ways to analyze binary files on Linux.md diff --git a/sources/tech/20200430 10 ways to analyze binary files on Linux.md b/sources/tech/20200430 10 ways to analyze binary files on Linux.md deleted file mode 100644 index f43ae83efa..0000000000 --- a/sources/tech/20200430 10 ways to analyze binary files on Linux.md +++ /dev/null @@ -1,321 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (10 ways to analyze binary files on Linux) -[#]: via: (https://opensource.com/article/20/4/linux-binary-analysis) -[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) - -10 ways to analyze binary files on Linux -====== -These simple commands and tools can help you sail through the task of -analyzing binary files. -![Tux with binary code background][1] - -"There are 10 types of people in this world: those who understand binary and those who don't." - -We work with binaries daily, yet we understand so little about them. By binaries, I mean the executable files that you run daily, right from your command line tools to full-fledged applications. - -Linux provides a rich set of tools that makes analyzing binaries a breeze! Whatever might be your job role, if you are working on Linux, knowing the basics about these tools will help you understand your system better. - -In this article, we will cover some of the most popular of these Linux tools and commands, most of which will be available natively as part of your Linux distribution. If not, you can always use your package manager to install and explore them. Remember: learning to use the right tool at the right occasion requires plenty of patience and practice. - -### file - -What it does: Help to determine the file type. - -This will be your starting point for binary analysis. We work with files daily. Not everything is an executable type; there is a whole wide range of file types out there. Before you start, you need to understand the type of file that is being analyzed. Is it a binary file, a library file, an ASCII text file, a video file, a picture file, a PDF, a data file, etc.? - -The **file** command will help you identify the exact file type that you are dealing with. - - -``` -$ file /bin/ls -/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=94943a89d17e9d373b2794dcb1f7e38c95b66c86, stripped -$ -$ file /etc/passwd -/etc/passwd: ASCII text -$ -``` - -### ldd - -What it does: Print shared object dependencies. - -If you have already used the **file** command above on an executable binary, you can't miss the "dynamically linked" message in the output. What does it mean? - -When software is being developed, we try not to reinvent the wheel. There are a set of common tasks that most software programs require, like printing output or reading from standard in, or opening files, etc. All of these common tasks are abstracted away in a set of common functions that everybody can then use instead of writing their own variants. These common functions are put in a library called **libc** or **glibc**. - -How does one find which libraries the executable is dependent on? That’s where **ldd** command comes into the picture. Running it against a dynamically linked binary shows all its dependent libraries and their paths. - - -``` -$ ldd /bin/ls -        linux-vdso.so.1 =>  (0x00007ffef5ba1000) -        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fea9f854000) -        libcap.so.2 => /lib64/libcap.so.2 (0x00007fea9f64f000) -        libacl.so.1 => /lib64/libacl.so.1 (0x00007fea9f446000) -        libc.so.6 => /lib64/libc.so.6 (0x00007fea9f079000) -        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fea9ee17000) -        libdl.so.2 => /lib64/libdl.so.2 (0x00007fea9ec13000) -        /lib64/ld-linux-x86-64.so.2 (0x00007fea9fa7b000) -        libattr.so.1 => /lib64/libattr.so.1 (0x00007fea9ea0e000) -        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fea9e7f2000) -$ -``` - -### ltrace - -What it does: A library call tracer. - -We now know how to find the libraries an executable program is dependent on using the **ldd** command. However, a library can contain hundreds of functions. Out of those hundreds, which are the actual functions being used by our binary? - -The **ltrace** command displays all the functions that are being called at run time from the library. In the below example, you can see the function names being called, along with the arguments being passed to that function. You can also see what was returned by those functions on the far right side of the output. - - -``` -$ ltrace ls -__libc_start_main(0x4028c0, 1, 0x7ffd94023b88, 0x412950 <unfinished ...> -strrchr("ls", '/')                                                                  = nil -setlocale(LC_ALL, "")                                                               = "en_US.UTF-8" -bindtextdomain("coreutils", "/usr/share/locale")                                    = "/usr/share/locale" -textdomain("coreutils")                                                             = "coreutils" -__cxa_atexit(0x40a930, 0, 0, 0x736c6974756572)                                      = 0 -isatty(1)                                                                           = 1 -getenv("QUOTING_STYLE")                                                             = nil -getenv("COLUMNS")                                                                   = nil -ioctl(1, 21523, 0x7ffd94023a50)                                                     = 0 -<< snip >> -fflush(0x7ff7baae61c0)                                                              = 0 -fclose(0x7ff7baae61c0)                                                              = 0 -+++ exited (status 0) +++ -$ -``` - -### Hexdump - -What it does: Display file contents in ASCII, decimal, hexadecimal, or octal. - -Often, it happens that you open a file with an application that doesn’t know what to do with that file. Try opening an executable file or a video file using vim; all you will see is gibberish thrown on the screen. - -Opening unknown files in Hexdump helps you see what exactly the file contains. You can also choose to see the ASCII representation of the data present in the file using some command-line options. This might help give you some clues to what kind of file it is. - - -``` -$ hexdump -C /bin/ls | head -00000000  7f 45 4c 46 02 01 01 00  00 00 00 00 00 00 00 00  |.ELF............| -00000010  02 00 3e 00 01 00 00 00  d4 42 40 00 00 00 00 00  |..>......B@.....| -00000020  40 00 00 00 00 00 00 00  f0 c3 01 00 00 00 00 00  |@...............| -00000030  00 00 00 00 40 00 38 00  09 00 40 00 1f 00 1e 00  |....@.8...@.....| -00000040  06 00 00 00 05 00 00 00  40 00 00 00 00 00 00 00  |........@.......| -00000050  40 00 40 00 00 00 00 00  40 00 40 00 00 00 00 00  |@.@.....@.@.....| -00000060  f8 01 00 00 00 00 00 00  f8 01 00 00 00 00 00 00  |................| -00000070  08 00 00 00 00 00 00 00  03 00 00 00 04 00 00 00  |................| -00000080  38 02 00 00 00 00 00 00  38 02 40 00 00 00 00 00  |8.......8.@.....| -00000090  38 02 40 00 00 00 00 00  1c 00 00 00 00 00 00 00  |8.@.............| -$ -``` - -### strings - -What it does: Print the strings of printable characters in files. - -If Hexdump seems a bit like overkill for your use case and you are simply looking for printable characters within a binary, you can use the **strings** command. - -When software is being developed, a variety of text/ASCII messages are added to it, like printing info messages, debugging info, help messages, errors, and so on. Provided all this information is present in the binary, it will be dumped to screen using **strings**. - - -``` -`$ strings /bin/ls` -``` - -### readelf - -What it does: Display information about ELF files. - -ELF (Executable and Linkable File Format) is the dominant file format for executable or binaries, not just on Linux but a variety of UNIX systems as well. If you have utilized tools like file command, which tells you that the file is in ELF format, the next logical step will be to use the **readelf** command and its various options to analyze the file further. - -Having a reference of the actual ELF specification handy when using **readelf** can be very useful. You can find the specification [here][2].  - - -``` -$ readelf -h /bin/ls -ELF Header: -  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 -  Class:                             ELF64 -  Data:                              2's complement, little endian -  Version:                           1 (current) -  OS/ABI:                            UNIX - System V -  ABI Version:                       0 -  Type:                              EXEC (Executable file) -  Machine:                           Advanced Micro Devices X86-64 -  Version:                           0x1 -  Entry point address:               0x4042d4 -  Start of program headers:          64 (bytes into file) -  Start of section headers:          115696 (bytes into file) -  Flags:                             0x0 -  Size of this header:               64 (bytes) -  Size of program headers:           56 (bytes) -  Number of program headers:         9 -  Size of section headers:           64 (bytes) -  Number of section headers:         31 -  Section header string table index: 30 -$ -``` - -### objdump - -What it does: Display information from an object file. - -Binaries are created when you write source code which gets compiled using a tool called, unsurprisingly, a compiler. This compiler generates machine language instructions equivalent to the source code, which can then be executed by the CPU to perform a given task. This machine language code can be interpreted via mnemonics called an assembly language. An assembly language is a set of instructions that help you understand the operations being performed by the program and ultimately being executed on the CPU. - -**objdump** utility reads the binary or executable file and dumps the assembly language instructions on the screen. Knowledge of assembly is critical to understand the output of the **objdump** command. - -Remember: assembly language is architecture-specific. - - -``` -$ objdump -d /bin/ls | head - -/bin/ls:     file format elf64-x86-64 - -Disassembly of section .init: - -0000000000402150 <_init@@Base>: -  402150:       48 83 ec 08             sub    $0x8,%rsp -  402154:       48 8b 05 6d 8e 21 00    mov    0x218e6d(%rip),%rax        # 61afc8 <__gmon_start__> -  40215b:       48 85 c0                test   %rax,%rax -$ -``` - -### strace - -What it does: Trace system calls and signals. - -If you have used **ltrace**, mentioned earlier, think of **strace** being similar. The only difference is that, instead of calling a library, the **strace** utility traces system calls. System calls are how you interface with the kernel to get work done. - -To give an example, if you want to print something to the screen, you will use the **printf** or **puts** function from the standard library **libc**; however, under the hood, ultimately, a system call named **write** will be made to actually print something to the screen. - - -``` -$ strace -f /bin/ls -execve("/bin/ls", ["/bin/ls"], [/* 17 vars */]) = 0 -brk(NULL)                               = 0x686000 -mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f967956a000 -access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory) -open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 -fstat(3, {st_mode=S_IFREG|0644, st_size=40661, ...}) = 0 -mmap(NULL, 40661, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9679560000 -close(3)                                = 0 -<< snip >> -fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0 -mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9679569000 -write(1, "R2  RH\n", 7R2  RH -)                 = 7 -close(1)                                = 0 -munmap(0x7f9679569000, 4096)            = 0 -close(2)                                = 0 -exit_group(0)                           = ? -+++ exited with 0 +++ -$ -``` - -### nm - -What it does: List symbols from object files. - -If you are working with a binary that is not stripped, the **nm** command will provide you with the valuable information that was embedded in the binary during compilation. **nm** can help you identify variables and functions from the binary. You can imagine how useful this would be if you don't have access to the source code of the binary being analyzed. - -To showcase **nm**, we will quickly write a small program and compile it with the **-g** option, and we will also see that the binary is not stripped by using the file command. - - -``` -$ cat hello.c -#include <stdio.h> - -int main() { -    printf("Hello world!"); -    return 0; -} -$ -$ gcc -g hello.c -o hello -$ -$ file hello -hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=3de46c8efb98bce4ad525d3328121568ba3d8a5d, not stripped -$ -$ ./hello -Hello world!$ -$ - -$ nm hello | tail -0000000000600e20 d __JCR_END__ -0000000000600e20 d __JCR_LIST__ -00000000004005b0 T __libc_csu_fini -0000000000400540 T __libc_csu_init -                 U __libc_start_main@@GLIBC_2.2.5 -000000000040051d T main -                 U printf@@GLIBC_2.2.5 -0000000000400490 t register_tm_clones -0000000000400430 T _start -0000000000601030 D __TMC_END__ -$ -``` - -### gdb - -What it does: The GNU debugger. - -Well, not everything in the binary can be statically analyzed. We did execute some commands which ran the binary, like **ltrace** and **strace**; however, software consists of a variety of conditions that could lead to various alternate paths being executed. - -The only way to analyze these paths is at run time by having the ability to stop or pause the program at any given location and being able to analyze information and then move further down. -That is where debuggers come into the picture, and on Linux, **gdb** is the defacto debugger. It helps you load a program, set breakpoints at specific places, analyze memory and CPU register, and do much more. It complements the other tools mentioned above and allows you to do much more runtime analysis. - -One thing to notice is, once you load a program using **gdb**, you will be presented with its own **(gdb)** prompt. All further commands will be run in this **gdb** command prompt until you exit. - -We will use the "hello" program that we compiled earlier and use **gdb** to see how it works. - - -``` -$ gdb -q ./hello -Reading symbols from /home/flash/hello...done. -(gdb) break main -Breakpoint 1 at 0x400521: file hello.c, line 4. -(gdb) info break -Num     Type           Disp Enb Address            What -1       breakpoint     keep y   0x0000000000400521 in main at hello.c:4 -(gdb) run -Starting program: /home/flash/./hello - -Breakpoint 1, main () at hello.c:4 -4           printf("Hello world!"); -Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.6.x86_64 -(gdb) bt -#0  main () at hello.c:4 -(gdb) c -Continuing. -Hello world![Inferior 1 (process 29620) exited normally] -(gdb) q -$ -``` - -### Conclusion - -Once you are comfortable with using these native Linux binary analysis tools and understanding the output they provide, you can then move onto more advanced and professional open source binary analysis tools like [radare2][3]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/linux-binary-analysis - -作者:[Gaurav Kamathe][a] -选题:[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/gkamathe -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tux_linux_penguin_code_binary.jpg?itok=TxGxW0KY (Tux with binary code background) -[2]: http://www.skyfree.org/linux/references/ELF_Format.pdf -[3]: https://github.com/radareorg/radare2 diff --git a/translated/tech/20200430 10 ways to analyze binary files on Linux.md b/translated/tech/20200430 10 ways to analyze binary files on Linux.md new file mode 100644 index 0000000000..80577dfbcf --- /dev/null +++ b/translated/tech/20200430 10 ways to analyze binary files on Linux.md @@ -0,0 +1,314 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 ways to analyze binary files on Linux) +[#]: via: (https://opensource.com/article/20/4/linux-binary-analysis) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) + +在 Linux 上分析二进制文件的 10 种方法 +====== + +> 这些简单的命令和工具可以帮助你轻松完成分析二进制文件的任务。 + +![Tux with binary code background][1] + +“这个世界上有 10 种人:懂二进制的人和不懂二进制的人。” + +我们每天都在与二进制文件打交道,但我们对二进制文件却知之甚少。我所说的二进制,是指你每天运行的可执行文件,从你的命令行工具到成熟的应用程序都是。 + +Linux 提供了一套丰富的工具,让分析二进制文件变得轻而易举。无论你的工作角色是什么,如果你在 Linux 上工作,了解这些工具的基本知识将帮助你更好地理解你的系统。 + +在这篇文章中,我们将介绍其中一些最流行的 Linux 工具和命令,其中大部分都是 Linux 发行版的一部分。如果没有找到,你可以随时使用你的软件包管理器来安装和探索它们。请记住:学习在正确的场合使用正确的工具需要大量的耐心和练习。 + +### file + +它的作用:帮助确定文件类型。 + +这将是你进行二进制分析的出发点。我们每天都在与文件打交道。并非所有的文件都是可执行类型,除此之外还有各种各样的文件类型。在你开始之前,你需要了解要分析的文件类型。它是二进制文件、库文件、ASCII 文本文件、视频文件、图片文件、PDF、数据文件等等。 + +`file` 命令将帮助你确定你所处理的文件类型。 + +``` +$ file /bin/ls +/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=94943a89d17e9d373b2794dcb1f7e38c95b66c86, stripped +$ +$ file /etc/passwd +/etc/passwd: ASCII text +$ +``` + +### ldd + +它的作用:打印共享对象依赖关系。 + +如果你已经在一个可执行的二进制文件上使用了上面的 `file` 命令,你肯定会看到输出中的“动态链接dynamically linked”信息。它是什么意思呢? + +在开发软件的时候,我们尽量不要重造轮子。有一组常见的任务是大多数软件程序需要的,比如打印输出或从标准输入/打开的文件中读取等。所有这些常见的任务都被抽象成一组通用的函数,然后每个人都可以使用,而不是写出自己的变体。这些常用的函数被放在一个叫 `libc` 或 `glibc` 的库中。 + +如何找到可执行程序所依赖的库?这就是 `ldd` 命令的作用了。对动态链接的二进制文件运行该命令会显示出所有依赖库和它们的路径。 + +``` +$ ldd /bin/ls + linux-vdso.so.1 => (0x00007ffef5ba1000) + libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fea9f854000) + libcap.so.2 => /lib64/libcap.so.2 (0x00007fea9f64f000) + libacl.so.1 => /lib64/libacl.so.1 (0x00007fea9f446000) + libc.so.6 => /lib64/libc.so.6 (0x00007fea9f079000) + libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fea9ee17000) + libdl.so.2 => /lib64/libdl.so.2 (0x00007fea9ec13000) + /lib64/ld-linux-x86-64.so.2 (0x00007fea9fa7b000) + libattr.so.1 => /lib64/libattr.so.1 (0x00007fea9ea0e000) + libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fea9e7f2000) +$ +``` + +### ltrace + +它的作用:一个库调用跟踪器。 + +我们现在知道如何使用 `ldd` 命令找到一个可执行程序所依赖的库。然而,一个库可以包含数百个函数。在这几百个函数中,哪些是我们的二进制程序正在使用的实际函数? + +`ltrace` 命令可以显示在运行时从库中调用的所有函数。在下面的例子中,你可以看到被调用的函数名称,以及传递给该函数的参数。你也可以在输出的最右边看到这些函数返回的内容。 + +``` +$ ltrace ls +__libc_start_main(0x4028c0, 1, 0x7ffd94023b88, 0x412950 +strrchr("ls", '/') = nil +setlocale(LC_ALL, "") = "en_US.UTF-8" +bindtextdomain("coreutils", "/usr/share/locale") = "/usr/share/locale" +textdomain("coreutils") = "coreutils" +__cxa_atexit(0x40a930, 0, 0, 0x736c6974756572) = 0 +isatty(1) = 1 +getenv("QUOTING_STYLE") = nil +getenv("COLUMNS") = nil +ioctl(1, 21523, 0x7ffd94023a50) = 0 +<< snip >> +fflush(0x7ff7baae61c0) = 0 +fclose(0x7ff7baae61c0) = 0 ++++ exited (status 0) +++ +$ +``` + +### hexdump + +它的作用:以 ASCII、十进制、十六进制或八进制显示文件内容。 + +通常情况下,当你用一个应用程序打开一个文件,而它不知道如何处理该文件时,就会出现这种情况。尝试用 `vim` 打开一个可执行文件或视频文件,你会看到的只是屏幕上抛出的乱码。 + +在 `hexdump` 中打开未知文件,可以帮助你看到文件的具体内容。你也可以选择使用一些命令行选项来查看用 ASCII 表示的文件数据。这可能会帮助你了解到它是什么类型的文件。 + +``` +$ hexdump -C /bin/ls | head +00000000  7f 45 4c 46 02 01 01 00  00 00 00 00 00 00 00 00  |.ELF............| +00000010  02 00 3e 00 01 00 00 00  d4 42 40 00 00 00 00 00  |..>......B@.....| +00000020  40 00 00 00 00 00 00 00  f0 c3 01 00 00 00 00 00  |@...............| +00000030  00 00 00 00 40 00 38 00  09 00 40 00 1f 00 1e 00  |....@.8...@.....| +00000040  06 00 00 00 05 00 00 00  40 00 00 00 00 00 00 00  |........@.......| +00000050  40 00 40 00 00 00 00 00  40 00 40 00 00 00 00 00  |@.@.....@.@.....| +00000060  f8 01 00 00 00 00 00 00  f8 01 00 00 00 00 00 00  |................| +00000070  08 00 00 00 00 00 00 00  03 00 00 00 04 00 00 00  |................| +00000080  38 02 00 00 00 00 00 00  38 02 40 00 00 00 00 00  |8.......8.@.....| +00000090  38 02 40 00 00 00 00 00  1c 00 00 00 00 00 00 00  |8.@.............| +$ +``` + +### strings + +它的作用:打印文件中的可打印字符的字符串。 + +如果你只是在二进制中寻找可打印的字符,那么 `hexdump` 对于你的使用场景来说似乎有点矫枉过正,你可以使用 `strings` 命令。 + +在开发软件的时候,各种文本/ASCII 信息会被添加到其中,比如打印信息、调试信息、帮助信息、错误等。只要这些信息都存在于二进制文件中,就可以用 `strings` 命令将其转储到屏幕上。 + +``` +$ strings /bin/ls +``` + +### readelf + +它的作用:显示有关 ELF 文件的信息。 + +ELF(可执行和可链接文件格式Executable and Linkable File Format)是可执行文件或二进制文件的主流格式,不仅是 Linux 系统,也是各种 UNIX 系统的主流文件格式。如果你已经使用了像 `file` 命令这样的工具,它告诉你文件是 ELF 格式,那么下一步就是使用 `readelf` 命令和它的各种选项来进一步分析文件。 + +在使用 `readelf` 命令时,有一个实际的 ELF 规范的参考是非常有用的。你可以在[这里][2]找到规范。  + +``` +$ readelf -h /bin/ls +ELF Header: +  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 +  Class:                             ELF64 +  Data:                              2's complement, little endian +  Version:                           1 (current) +  OS/ABI:                            UNIX - System V +  ABI Version:                       0 +  Type:                              EXEC (Executable file) +  Machine:                           Advanced Micro Devices X86-64 +  Version:                           0x1 +  Entry point address:               0x4042d4 +  Start of program headers:          64 (bytes into file) +  Start of section headers:          115696 (bytes into file) +  Flags:                             0x0 +  Size of this header:               64 (bytes) +  Size of program headers:           56 (bytes) +  Number of program headers:         9 +  Size of section headers:           64 (bytes) +  Number of section headers:         31 +  Section header string table index: 30 +$ +``` + +### objdump + +它的作用:从对象文件中显示信息。 + +二进制文件是通过你编写源码的创建的,这些源码会通过一个叫做编译器的工具进行编译。这个编译器会生成相当于源代码的机器语言指令,然后由 CPU 执行,以执行特定的任务。这些机器语言代码可以通过被称为汇编语言的助记词来解读。汇编语言是一组指令,它可以帮助你理解由程序所进行并最终在 CPU 上执行的操作。 + +`objdump` 实用程序读取二进制或可执行文件,并将汇编语言指令转储到屏幕上。汇编语言知识对于理解 `objdump` 命令的输出是至关重要的。 + +请记住:汇编语言是特定于体系结构的。 + +``` +$ objdump -d /bin/ls | head + +/bin/ls: file format elf64-x86-64 + + +Disassembly of section .init: + +0000000000402150 <_init@@Base>: + 402150: 48 83 ec 08 sub $0x8,%rsp + 402154: 48 8b 05 6d 8e 21 00 mov 0x218e6d(%rip),%rax # 61afc8 <__gmon_start__> + 40215b: 48 85 c0 test %rax,%rax +$ +``` + +### strace + +它的作用:跟踪系统调用和信号。 + +如果你用过前面提到的 `ltrace`,那就把 `strace` 想成是类似的。唯一的区别是,`strace` 工具不是追踪调用的库,而是追踪系统调用。系统调用是你与内核对接来完成工作的。 + +举个例子,如果你想把一些东西打印到屏幕上,你会使用标准库 `libc` 中的 `printf` 或 `puts` 函数;但是,在底层,最终会有一个名为 `write` 的系统调用来实际把东西打印到屏幕上。 + +``` +$ strace -f /bin/ls +execve("/bin/ls", ["/bin/ls"], [/* 17 vars */]) = 0 +brk(NULL) = 0x686000 +mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f967956a000 +access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) +open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 +fstat(3, {st_mode=S_IFREG|0644, st_size=40661, ...}) = 0 +mmap(NULL, 40661, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9679560000 +close(3) = 0 +<< snip >> +fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0 +mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9679569000 +write(1, "R2 RH\n", 7R2 RH +) = 7 +close(1) = 0 +munmap(0x7f9679569000, 4096) = 0 +close(2) = 0 +exit_group(0) = ? ++++ exited with 0 +++ +$ +``` + +### nm + +它的作用:列出对象文件中的符号。 + +如果你所使用的二进制文件没有被剥离,`nm` 命令将为你提供在编译过程中嵌入到二进制文件中的有价值的信息。`nm` 可以帮助你从二进制文件中识别变量和函数。你可以想象一下,如果你无法访问二进制文件的源代码,这将是多么有用。 + +为了展示 `nm`,我们快速编写了一个小程序,用 `-g` 选项编译,我们会看到这个二进制文件没有被剥离。 + +``` +$ cat hello.c +#include + +int main() { + printf("Hello world!"); + return 0; +} +$ +$ gcc -g hello.c -o hello +$ +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=3de46c8efb98bce4ad525d3328121568ba3d8a5d, not stripped +$ +$ ./hello +Hello world!$ +$ + + +$ nm hello | tail +0000000000600e20 d __JCR_END__ +0000000000600e20 d __JCR_LIST__ +00000000004005b0 T __libc_csu_fini +0000000000400540 T __libc_csu_init + U __libc_start_main@@GLIBC_2.2.5 +000000000040051d T main + U printf@@GLIBC_2.2.5 +0000000000400490 t register_tm_clones +0000000000400430 T _start +0000000000601030 D __TMC_END__ +$ +``` + +### gdb + +它的作用:GNU 调试器。 + +好吧,不是所有的二进制文件中的东西都可以进行静态分析。我们确实执行了一些运行二进制文件(进行分析)的命令,比如 `ltrace` 和 `strace`;然而,软件由各种条件组成,这些条件可能会导致执行不同的替代路径。 + +分析这些路径的唯一方法是在运行时环境,在任何给定的位置停止或暂停程序,并能够分析信息,然后再往下执行。 + +这就是调试器的作用,在 Linux 上,`gdb` 就是调试器的事实标准。它可以帮助你加载程序,在特定的地方设置断点,分析内存和 CPU 的寄存器,还有更多的功能。它是对上面提到的其他工具的补充,可以让你做更多的运行时分析。 + +有一点需要注意的是,一旦你使用 `gdb` 加载一个程序,你会看到它自己的 `(gdb)` 提示符。所有进一步的命令都将在这个 `gdb` 命令提示符中运行,直到你退出。 + +我们将使用我们之前编译的 `hello` 程序,使用 `gdb` 来看看它的工作原理。 + +``` +$ gdb -q ./hello +Reading symbols from /home/flash/hello...done. +(gdb) break main +Breakpoint 1 at 0x400521: file hello.c, line 4. +(gdb) info break +Num Type Disp Enb Address What +1 breakpoint keep y 0x0000000000400521 in main at hello.c:4 +(gdb) run +Starting program: /home/flash/./hello + +Breakpoint 1, main () at hello.c:4 +4 printf("Hello world!"); +Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.6.x86_64 +(gdb) bt +#0 main () at hello.c:4 +(gdb) c +Continuing. +Hello world![Inferior 1 (process 29620) exited normally] +(gdb) q +$``` + +### 结语 + +一旦你习惯了使用这些原生的 Linux 二进制分析工具,并理解了它们提供的输出,你就可以转向更高级和专业的开源二进制分析工具,比如 [radare2][3]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/linux-binary-analysis + +作者:[Gaurav Kamathe][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tux_linux_penguin_code_binary.jpg?itok=TxGxW0KY (Tux with binary code background) +[2]: http://www.skyfree.org/linux/references/ELF_Format.pdf +[3]: https://github.com/radareorg/radare2 From 4329ba8022652a95dac36fd077841d42f802d404 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Fri, 1 May 2020 10:28:45 +0800 Subject: [PATCH 0546/1809] Update 20200401 The ins and outs of high-performance computing as a service.md --- ...uts of high-performance computing as a service.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md index 45d258e08c..0f60833aa4 100644 --- a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md +++ b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md @@ -11,22 +11,24 @@ The ins and outs of high-performance computing as a service 高性能计算即 ====== HPC services can be a way to meet expanding supercomputing needs, but depending on the use case, they’re not necessarily better than on-premises supercomputers. Dell EMC -HPC服务可以满足不断扩展的超级计算需求,但根据使用情况,它们不一定比本地超级计算机更好。 戴尔EMC +高性能计算(HPC)服务可能是一种满足不断增长的超级计算需求的方式,但依赖于使用场景,它们不一定比使用本地超级计算机好。 Electronics on missiles and military helicopters need to survive extreme conditions. Before any of that physical hardware can be deployed, defense contractor McCormick Stevenson Corp. simulates the real-world conditions it will endure, relying on finite element analysis software like Ansys, which requires significant computing power. -导弹和军用直升机上的电子设备需要在极端条件下生存。 在部署任何物理硬件之前,国防承包商麦考密克·史蒂文森公司(McCormick Stevenson Corp.)都依赖于像Ansys这样的有限元素分析软件来模拟它会承受的现实条件,该软件需要强大的计算能力。 +戴尔EMC +导弹和军用直升机上的电子设备需要工作在极端条件下。国防承包商麦考密克·史蒂文森公司(McCormick Stevenson Corp.)在部署任何物理设备之前都会事先模拟它所能承受的真实条件。模拟依赖于像Ansys这样的有限元素分析软件,该软件需要强大的算力。 Then one day a few years ago, it unexpectedly ran up against its computing limits. 几年前的一天,它出乎意料地超出了计算极限。 [10 of the world's fastest supercomputers][1] +[世界上最快的10个超级计算机][1] "We had some jobs that would have overwhelmed the computers that we had in office," says Mike Krawczyk, principal engineer at McCormick Stevenson. "It did not make economic or schedule sense to buy a machine and install software." Instead, the company contracted with Rescale, which could sell them cycles on a supercomputer-class system for a tiny fraction of what they would've spent on new hardware. -麦考密克·史蒂文森(McCormick Stevenson)的首席工程师迈克·克劳奇奇(Mike Krawczyk)说:“我们从事的某些工作会使我们在办公室使用的计算机不堪重负。” “购买机器并安装软件在经济上或计划上都不合理。”取而代之的是,该公司与Rescale签约,可以在超级计算机级系统上向他们出售自行车的周期,而这只花费了他们在新硬件上花费的一小部分。 +麦考密克·史蒂文森(McCormick Stevenson)的首席工程师迈克·克劳奇奇(Mike Krawczyk)说:“我们的一些工作会使办公室的计算机不堪重负。” “购买机器并安装软件在经济上或计划上都不划算。” 相反,该公司与Rescale签约,从其购买在超级计算机系统上运行的周期(cycles),而这只花费了他们购买新硬件上所需的一小部分。 McCormick Stevenson had become an early adopter in a market known as supercomputing as a service or high-performance computing (HPC) as a service – two terms that are closely related. HPC is the application of supercomputers to computationally complex problems, while supercomputers are those computers at the cutting edge of processing capacity, according to the National Institute for Computational Sciences. -麦考密克·史蒂文森(McCormick Stevenson)已成为市场上的早期采用者,该市场被称为超级计算即服务或高性能计算(HPC)即服务–这两个紧密相关的术语。根据国家计算科学研究所的说法,HPC是超级计算机在计算复杂问题上的应用,而超级计算机是处理能力最先进的那些计算机。 +麦考密克·史蒂文森(McCormick Stevenson)已成为被称为超级计算即服务或高性能计算(HPC)即服务(两个紧密相关的术语)市场的早期采用者之一。根据国家计算科学研究所(的定义),HPC是超级计算机在计算复杂问题上的应用,而超级计算机是处理能力最先进的那些计算机。 Whatever it's called, these services are upending the traditional supercomputing market and bringing HPC power to customers who could never afford it before. But it's no panacea, and it's definitely not plug-and-play – at least not yet. -无论以何种方式称呼,这些服务都在颠覆传统的超级计算市场,并将HPC功能带给以前买不起的客户。但这不是万能药,而且绝对不是即插即用的,至少现在还没有。 +无论叫它什么,这些服务都在颠覆传统的超级计算市场,并将HPC能力带给以前买不起的客户。但这不是万能的,而且绝对不是即插即用的,至少现在还不是。 ### HPC services in practice HPC服务实践 From 548d4b7a2e4780b5773fe1a50ca43aed5a12cae0 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Fri, 1 May 2020 11:13:36 +0800 Subject: [PATCH 0547/1809] APL 20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode --- ... Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md b/sources/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md index a3f3768533..5e2fb84c2b 100644 --- a/sources/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md +++ b/sources/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8f276cb52bf4914db548b9a9fdb5b9fac427ffb7 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Fri, 1 May 2020 18:21:24 +0800 Subject: [PATCH 0548/1809] Update 20200401 The ins and outs of high-performance computing as a service.md --- ...high-performance computing as a service.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md index 0f60833aa4..fc36ff7082 100644 --- a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md +++ b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md @@ -33,52 +33,52 @@ Whatever it's called, these services are upending the traditional supercomputing ### HPC services in practice HPC服务实践 From the end user's perspective, HPC as a service resembles the batch-processing model that dates back to the early mainframe era. "We create an Ansys batch file and send that up, and after it runs, we pull down the result files and import them locally here," Krawczyk says. -从最终用户的角度来看,HPC即服务类似于可追溯到大型机早期的批处理模型。 “我们创建一个Ansys批处理文件并将其发送出去,然后运行它,我们将结果文件下拉并在此处本地导入,” Krawczyk说。 +从最终用户的角度来看,HPC即服务类似于早期大型机时代的批处理模型。 “我们创建一个Ansys批处理文件并将其发送过去,运行它,然后将结果文件取下来并在本地导入它们,” Krawczyk说。 Behind the scenes, cloud providers are running the supercomputing infrastructure in their own data centers – though that doesn't necessarily imply the sort of cutting-edge hardware you might be visualizing when you hear "supercomputer." As Dave Turek, Vice President of Technical Computing at IBM OpenPOWER, explains it, HPC services at their core are "a collection of servers that are strung together with an interconnect. You have the ability to invoke this virtual computing infrastructure that allows you to bring a lot of different servers to work together in a parallel construct to solve the problem when you present it." -在幕后,云提供商正在其自己的数据中心中运行超级计算基础结构,尽管这不一定意味着您在听到“超级计算机”时可能会看到的最先进的硬件。正如IBM OpenPOWER技术计算副总裁Dave Turek解释说的那样,HPC服务的核心是“由互连串在一起的服务器的集合。您可以调用此虚拟计算基础结构,使您能够当您提出问题时,许多不同的服务器可以并行构造在一起以解决问题。” +在HPC服务背后,云提供商在其自己的数据中心中运行超级计算基础设施,尽管这不一定意味着当您听到“超级计算机”时你就会看到最先进的硬件。正如IBM OpenPOWER计算技术副总裁Dave Turek解释的那样,HPC服务的核心是“相互互连的服务器集合。您可以调用该虚拟计算基础设施,它能够在您提出问题时,使得许多不同的服务器并行工作来解决问题。” [][2] Sounds simple in theory. But making it viable in practice required some chipping away at technical problems, according to Theo Lynn, Professor of Digital Business at Dublin City University. What differentiates ordinary computing from HPC is those interconnects – high-speed, low-latency, and expensive – so those needed to be brought to the world of cloud infrastructure. Storage performance and data transport also needed to be brought up to a level at least in the same ballpark as on-prem HPC before HPC services could be viable. -理论上听起来很简单。都柏林城市大学数字业务教授西奥·林恩(Theo Lynn)表示,但要使其在实践中可行,需要解决一些技术问题。普通计算与HPC的区别在于那些互连-高速,低延迟和昂贵-因此需要将这些互连引入云基础架构领域。在HPC服务可行之前,还至少需要将存储性能和数据传输提升到与本地HPC相同的水平。 +理论上听起来很简单。但都柏林城市大学数字业务教授西奥·林恩(Theo Lynn)表示,要使其在实践中可行,需要解决一些技术问题。普通计算与HPC的区别在于那些互连-高速的,低延时的而且昂贵的-因此需要将这些互连引入云基础设施领域。在HPC服务可行之前,至少需要将存储性能和数据传输也提升到与本地HPC相同的水平。 But Lynn says that some of the innovations that have helped HPC services take off have been more institutional than technological. In particular, "we are now seeing more and more traditional HPC applications adopting cloud-friendly licensing models – a barrier to adoption in the past." -但是林恩说,一些帮助高性能计算服务起飞的创新比技术更具有制度性。特别是,“我们现在看到越来越多的传统HPC应用程序采用云友好型许可模式-过去是采用这种模式的障碍。” +但是林恩说,一些制度创新相比技术更好的帮助了HPC服务的起飞。特别是,“我们现在看到越来越多的传统HPC应用采用云友好的许可模式-过去是采用这种模式的障碍。” And the economics have also shifted the potential customer base, he says. "Cloud service providers have opened up the market more by targeting low-end HPC buyers who couldn’t afford the capex associated with traditional HPC and opening up the market to new users. As the markets open up, the hyperscale economic model becomes more and more feasible, costs start coming down." -他说,经济也改变了潜在的客户群。 “云服务提供商通过针对那些负担不起与传统HPC相关的资本支出的低端HPC买家,并向新用户开放市场,进一步开放了市场。随着市场的开放,超大规模经济模型变得越来越多,更可行,成本开始下降。” +他说,经济也改变了潜在的客户群。 “云服务提供商通过向那些负担不起传统HPC所需的投资成本的低端HPC买家开放,进一步开放了市场。随着市场的开放,超大规模经济模型变得越来越多,更可行,成本开始下降。” -Avoid on-premises CAPEX** 避免内部资本支出** +Avoid on-premises CAPEX** 避免本地资本支出** ** HPC services are attractive to private-sector customers in the same fields where traditional supercomputing has long held sway. These include sectors that rely heavily on complex mathematical modeling, including defense contractors like McCormick Stevenson, along with oil and gas companies, financial services firms, and biotech companies. Dublin City University's Lynn adds that loosely coupled workloads are a particularly good use case, which meant that many early adopters used it for 3D image rendering and related applications. -在传统超级计算长期占据主导地位的相同领域,HPC服务对私营部门客户具有吸引力。这些行业包括严重依赖复杂数学模型的行业,包括麦考密克·史蒂文森(McCormick Stevenson)等国防承包商,以及石油和天然气公司,金融服务公司和生物技术公司。都柏林城市大学的Lynn补充说,松散耦合的工作负载是一个特别好的用例,这意味着许多早期采用者将其用于3D图像渲染和相关应用程序。 +HPC服务对有志于传统超级计算长期把持的领域的私营行业客户具有吸引力。这些客户包括严重依赖复杂数学模型的行业,包括麦考密克·史蒂文森(McCormick Stevenson)等国防承包商,以及油气公司,金融服务公司和生物技术公司。都柏林城市大学的Lynn补充说,松耦合的工作负载是一个特别好的用例,这意味着许多早期采用者将其用于3D图像渲染和相关应用。 But when does it make sense to consider HPC services over on-premises HPC? For hhpberlin, a German company that simulates smoke propagation in and fire damage to structural components of buildings, the move came as it outgrew its current resources. -但是,何时在本地HPC上考虑HPC服务才有意义?对于德国的hhpberlin公司,该公司模拟烟雾在建筑物中的传播和火灾对建筑物结构部件的破坏,此举是因为它超出了其现有资源。 +但是,何时考虑HPC服务而不是本地HPC才有意义?对于德国的模拟烟雾在建筑物中的蔓延和火灾对建筑物结构部件的破坏的hhpberlin公司来说,答案是在它超出了其现有资源时。 "For several years, we had run our own small cluster with up to 80 processor cores," says Susanne Kilian, hhpberlin's scientific head of numerical simulation. "With the rise in application complexity, however, this constellation has increasingly proven to be inadequate; the available capacity was not always sufficient to handle projects promptly." -hhpberlin数值模拟的科学负责人Susanne Kilian说:“几年来,我们一直在运行自己的小型集群,该集群具有多达80个处理器内核。” “但是,随着应用程序复杂性的提高,这种架构已经越来越不足够;可用容​​量并不总是足够迅速地处理项目。” +Hpberlin公司数值模拟的科学负责人Susanne Kilian说:“几年来,我们一直在运行自己的小型集群,该集群具有多达80个处理器核。” “但是,随着应用复杂性的提高,这种架构(constellation)已经越来越不足以支撑;可用容量并不总是够快速地处理项目。” But just spending money on a new cluster wasn't an ideal solution, she says: "In view of the size and administrative environment of our company, the necessity of constant maintenance of this cluster (regular software and hardware upgrades) turned out to be impractical. Plus, the number of required simulation projects is subject to significant fluctuations, such that the utilization of the cluster was not really predictable. Typically, phases with very intensive use alternate with phases with little to no use." By moving to an HPC service model, hhpberlin shed that excess capacity and the need to pay up front for upgrades. -她说:“但是,仅仅花钱买一个新的集群并不是一个理想的解决方案:鉴于我们公司的规模和管理环境,持续维护该集群(定期进行软件和硬件升级)的必要性非常明显。另外,所需的模拟项目的数量会出现很大的波动,因此群集的使用情况并不是真正可预测的。通常,使用率很高的阶段与很少使用或不使用的阶段交替出现。”通过转换为HPC服务模式,hhpberlin消除了过剩的容量,无需支付升级费用。 +她说:“但是,仅仅花钱买一个新的集群并不是一个理想的解决方案:鉴于我们公司的规模和管理环境,强制持续维护该集群(定期进行软件和硬件升级)是不现实的。另外,需要模拟的项目数量会出现很大的波动,因此集群的利用率并不是真正可预测的。通常,使用率很高的阶段与很少使用或不使用的阶段交替出现。”通过转换为HPC服务模式,hhpberlin释放了过剩的容量,并无需支付升级费用。 IBM's Turek explains the calculus that different companies go through while assessing their needs. For a biosciences startup with 30 people, "you need computing, but you really can't afford to have 15% of your staff dedicated to it. It's just like you might also say you don't want to have on-staff legal representation, so you'll get that as a service as well." For a bigger company, though, it comes down to weighing the operational expense of an HPC service against the capacity expense of buying an in-house supercomputer or HPC cluster. -IBM的Turek解释了不同公司在评估其需求时所经历的计算过程。对于拥有30名员工的生物科学初创公司来说,“您需要计算,但您实在负担不起15%的员工专心致志。这就像您可能还说过,您不想拥有在职法律代表,因此您也可以将其作为服务获得。”但是,对于一家较大的公司而言,归结为权衡HPC服务的运营费用与购买内部超级计算机或HPC集群的容量费用。 +IBM的Turek解释了不同公司在评估其需求时所经历的计算过程。对于拥有30名员工的生物科学初创公司来说,“您需要计算,但您实在负担不起15%的员工专门从事它。这就像您可能也说过,您不想拥有在职法律代表,因此您也可以通过服务获得它。”但是,对于一家较大的公司而言,最终归结为权衡HPC服务的运营费用与购买内部超级计算机或HPC集群的费用。 So far, those are the same sorts of arguments you'd have over adopting any cloud service. But the opex vs. capex dilemma can be weighted towards the former by some of the specifics of the HPC market. Supercomputers aren't commodity hardware like storage or x86 servers; they're very expensive, and technological advances can swiftly render them obsolete. As McCormick Stevenson's Krawczyk puts it, "It's like buying a car: as soon as you drive off the lot it starts to depreciate." And for many companies –especially larger and less nimble ones – the process of buying a supercomputer can get hopelessly bogged down. "You're caught up in planning issues, building issues, construction issues, training issues, and then you have to execute an RFP," says IBM's Turek. "You have to work through the CIO. You have to work with your internal customers to make sure there's continuity of service. It's a very, very complex process and not something that a lot of institutions are really excellent at executing." -到目前为止,这些都是您采用任何云服务时都会遇到的相同类型的争论。但是,可以通过HPC市场的某些细节将运营支出与资本支出的困境加权为前者。超级计算机不是诸如存储或x86服务器之类的商用硬件;它们非常昂贵,技术进步会很快使其过时。正如麦考密克·史蒂文森(McCormick Stevenson)的克拉维奇(Krawczyk)所说,“这就像在买车:开车一走,它就会开始贬值。”对于许多公司,尤其是规模较大,灵活性较差的公司,购买超级计算机的过程可能会陷入无望的泥潭。 IBM的Turek说:“您陷入了计划问题,建筑问题,施工问题,培训问题,然后必须执行RFP。” “您必须通过CIO进行工作。您必须与内部客户合作以确保服务的连续性。这是一个非常非常复杂的过程,并不是很多机构在执行方面都非常出色。” +到目前为止,这些都是您采用任何云服务时都会遇到的类似的争论。但是,可以HPC市场的某些特点将使得衡量运营支出与资本支出时选择前者。超级计算机不是诸如存储或x86服务器之类的商用硬件;它们非常昂贵,技术进步很快会使其过时。正如麦考密克·史蒂文森(McCormick Stevenson)的克拉维奇(Krawczyk)所说,“这就像买车:只要车一开走,它就会开始贬值。”对于许多公司,尤其是规模较大,灵活性较差的公司,购买超级计算机的过程可能会陷入无望的泥潭。 IBM的Turek说:“您陷入了计划问题,建筑问题,施工问题,培训问题,然后必须执行RFP。” “您必须得到CIO的支持。您必须与内部客户合作以确保服务的连续性。这是一个非常非常复杂的过程,并没有很多机构有非常出色的执行力。” -Once you choose to go down the services route for HPC, you'll find you get many of the advantages you expect from cloud services, particularly the ability to pay only for HPC power when you need it, which results in an efficient use of resources. Chirag Dekate, Senior Director and Analyst at Gartner, says bursty workloads, when you have short-term needs for high-performance computing, are a key use case driving adoption of HPC  services. -选择了HPC的服务路线后,您会发现您将从云服务中获得了许多期望,特别是仅在需要时才需要为HPC功能付费的能力,从而可以有效利用资源。 Gartner高级总监兼分析师Chirag Dekate表示,当您对高性能计算有短期需求时,突发性工作负载是推动HPC服务采用的关键用例。 +Once you choose to go down the services route for HPC, you'll find you get many of the advantages you expect from cloud services, particularly the ability to pay only for HPC power when you need it, which results in an efficient use of resources. Chirag Dekate, Senior Director and Analyst at Gartner, says bursty workloads, when you have short-term needs for high-performance computing, are a key use case driving adoption of HPC services. +一旦您选择了HPC服务的路线后,您会发现您会得到您期望从云服务中得到的许多好处,特别是仅在业务需要时才需付费的能力,从而可以带来资源的高效利用。 Gartner高级总监兼分析师Chirag Dekate表示,当您对高性能计算有短期需求时的突发性负载是推动选择HPC服务的关键用例。 "In the manufacturing industry, you tend to have a high peak of HPC activity around the product design stage," he says. "But once the product is designed, HPC resources are less utilized during the rest of the product-development cycle." In contrast, he says, "when you have large, long-running jobs, the economics of the cloud wear down." 他说:“在制造业中,在产品设计阶段,HPC活动往往会达到很高的峰值。” “但是,一旦产品设计完成,在其余产品开发周期中,HPC资源的利用率就会降低。” 相比之下,他说:“当您拥有大量长期运行的工作时,云的经济就会逐渐减弱。” With clever system design, you can integrate those HPC-services bursts of activity with your own in-house conventional computing. Teresa Tung, managing director in Accenture Labs, gives an example: "Accessing HPC via APIs makes it seamless to mix with traditional computing. A traditional AI pipeline might have its training done on a high-end supercomputer at the stage when the model is being developed, but then the resulting trained model that runs predictions over and over would be deployed on other services in the cloud or even devices at the edge." -通过巧妙的系统设计,您可以将这些HPC服务突发事件与您自己的内部常规计算集成在一起。 埃森哲实验室常务董事董德丽举了一个例子:“通过API访问HPC可以无缝地与传统计算混合。在模型构建阶段,传统的AI管道可能会在高端超级计算机上进行培训。 开发出来的软件,但是最终生成的经过反复训练的模型将部署在云中的其他服务上,甚至部署在边缘设备上。” +通过巧妙的系统设计,您可以将这些HPC服务突发活动与您自己的内部常规计算集成在一起。 埃森哲(Accenture)实验室常务董事Teresa Tung举了一个例子:“通过API访问HPC可以无缝地与传统计算混合。在模型构建阶段,传统的AI流水线可能会在高端超级计算机上进行训练,但是最终经过反复按预期运行的训练好的模型将部署在云中的其他服务上,甚至部署在边缘设备上。” -### It's not for all use cases** +### It's not for all use cases** 它并不适合所有的应用场景 ** From e241cfe3b2eae7841b3adb1014e6cf9820b77c75 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 1 May 2020 19:37:10 +0800 Subject: [PATCH 0549/1809] PRF @wxy --- ...ython to visualize COVID-19 projections.md | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/translated/tech/20200421 Using Python to visualize COVID-19 projections.md b/translated/tech/20200421 Using Python to visualize COVID-19 projections.md index 3768686e8c..af82cbd349 100644 --- a/translated/tech/20200421 Using Python to visualize COVID-19 projections.md +++ b/translated/tech/20200421 Using Python to visualize COVID-19 projections.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using Python to visualize COVID-19 projections) @@ -10,11 +10,11 @@ 使用 Python 来可视化 COVID-19 预测 ====== -> 我将演示如何使用开源库利用提供的全球病毒传播的开放数据来创建两个可视效果。 +> 我将演示如何利用提供的全球病毒传播的开放数据,使用开源库来创建两个可视效果。 -![Colorful sound wave graph][1] +![](https://img.linux.net.cn/data/attachment/album/202005/01/193624a2p2osojyf0yg4go.jpg) -使用 [Python][2] 和一些图形库,你可以预测出 COVID-19 确诊病例的总数,也可以显示一个国家(本文以印度为例)在给定日期的死亡总数。人们有时需要帮助解释和处理数据的意义,所以本文还演示了如何为五个国家创建一个动画横条形图,以显示按日期显示病例的变化。 +使用 [Python][2] 和一些图形库,你可以预测 COVID-19 确诊病例总数,也可以显示一个国家(本文以印度为例)在给定日期的死亡总数。人们有时需要帮助解释和处理数据的意义,所以本文还演示了如何为五个国家创建一个动画横条形图,以显示按日期显示病例的变化。 ### 印度的确诊病例和死亡人数预测 @@ -28,7 +28,6 @@ 直接将数据加载到 Pandas `DataFrame` 中。Pandas 提供了一个函数 `read_csv()`,它可以获取一个 URL 并返回一个 `DataFrame` 对象,如下所示。 - ``` import pycountry import plotly.express as px @@ -87,8 +86,8 @@ print(df_india.head(3)) 在这里,我们创建一个条形图。我们将把日期放在 X 轴上,把确诊的病例数和死亡人数放在 Y 轴上。这一部分的脚本有以下几个值得注意的地方。 - * `plt.rcParams["_figure.figure.figsize"_]=20,20` 这一行代码只适用于 Jupyter。所以如果你使用其他 IDE,请删除它。 - * 注意这行代码:`ax1 = plt.gca()`。为了确保两个图,即确诊病例和死亡病例的图都被绘制在同一个图上,我们需要给第二个图的 `ax` 对象。所以我们使用 `gca()` 来完成这个任务。(顺便说一下,`gca` 代表“get current axis”) + * `plt.rcParams["figure.figsize"]=20,20` 这一行代码只适用于 Jupyter。所以如果你使用其他 IDE,请删除它。 + * 注意这行代码:`ax1 = plt.gca()`。为了确保两个图,即确诊病例和死亡病例的图都被绘制在同一个图上,我们需要给第二个图的 `ax` 对象。所以我们使用 `gca()` 来完成这个任务。(顺便说一下,`gca` 代表 “获取当前坐标轴get current axis”) 完整的脚本如下所示。 @@ -120,9 +119,9 @@ plt.show() 整个脚本[可在 GitHub 上找到][4]。 -#### 为五个国家创建一个动画水平条形图 +### 为五个国家创建一个动画水平条形图 -关于 Jupyter 的注意事项:要在 Jupyter 中以动态动画的形式运行,而不是静态 png 的形式,你需要在单元格的开头添加一个神奇的命令,即: `%matplotlib notebook`。这将使图形保持动态,而不是显示静态的 png 文件,因此也可以显示动画。如果你在其他 IDE 上,请删除这一行。 +关于 Jupyter 的注意事项:要在 Jupyter 中以动态动画的形式运行,而不是静态 png 的形式,你需要在单元格的开头添加一个神奇的命令,即: `%matplotlib notebook`。这将使图形保持动态,而不是显示为静态的 png 文件,因此也可以显示动画。如果你在其他 IDE 上,请删除这一行。 #### 1、下载数据 @@ -130,11 +129,11 @@ plt.show() #### 2、创建一个所有日期的列表 -如果你检查你下载的数据,你会发现它有一列 `Date`。现在,这一列对每个国家都有一个日期值。因此,同一个日期会出现多次。我们需要创建一个只具有唯一值的日期列表。这会用在我们条形图的 X 轴上。我们有一行代码,如 `list_dates = df[_'Date'_].unique()`。`unique()` 方法将只提取每个日期的唯一值。 +如果你检查你下载的数据,你会发现它有一列 `Date`。现在,这一列对每个国家都有一个日期值。因此,同一个日期会出现多次。我们需要创建一个只具有唯一值的日期列表。这会用在我们条形图的 X 轴上。我们有一行代码,如 `list_dates = df[‘Date’].unique()`。`unique()` 方法将只提取每个日期的唯一值。 #### 3、挑选五个国家并创建一个 `ax` 对象。 -做一个五个国家的名单。(你可以选择你喜欢的国家,甚至可以增加或减少国家的数量。)我也做了一个五个颜色的列表,每个国家的条形图的颜色对应一种。(如果你喜欢的话,也可以改一下。)这里有一行重要的代码是:`fig, ax = plt.subplots(figsize=(15, 8))`。这是创建一个 `ax` 对象所需要的。 +做一个五个国家的名单。(你可以选择你喜欢的国家,也可以增加或减少国家的数量。)我也做了一个五个颜色的列表,每个国家的条形图的颜色对应一种。(如果你喜欢的话,也可以改一下。)这里有一行重要的代码是:`fig, ax = plt.subplots(figsize=(15, 8))`。这是创建一个 `ax` 对象所需要的。 #### 4、编写回调函数 @@ -148,7 +147,7 @@ plt.show() ``` my_anim = animation.FuncAnimation(fig = fig, func = plot_bar, - frames= list_dates, blit=True, + frames = list_dates, blit = True, interval=20) ``` @@ -226,7 +225,7 @@ via: https://opensource.com/article/20/4/python-data-covid-19 作者:[AnuragGupta][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 47b50990ea772269e11c728ad114ba528ce89b0c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 1 May 2020 19:39:56 +0800 Subject: [PATCH 0550/1809] PUB @wxy https://linux.cn/article-12172-1.html --- ...20200421 Using Python to visualize COVID-19 projections.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200421 Using Python to visualize COVID-19 projections.md (99%) diff --git a/translated/tech/20200421 Using Python to visualize COVID-19 projections.md b/published/20200421 Using Python to visualize COVID-19 projections.md similarity index 99% rename from translated/tech/20200421 Using Python to visualize COVID-19 projections.md rename to published/20200421 Using Python to visualize COVID-19 projections.md index af82cbd349..aaf5fc72d0 100644 --- a/translated/tech/20200421 Using Python to visualize COVID-19 projections.md +++ b/published/20200421 Using Python to visualize COVID-19 projections.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12172-1.html) [#]: subject: (Using Python to visualize COVID-19 projections) [#]: via: (https://opensource.com/article/20/4/python-data-covid-19) [#]: author: (AnuragGupta https://opensource.com/users/999anuraggupta) From bdaa3f168a7d09f38a496e2e09ccb4c277109d6a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 1 May 2020 23:19:22 +0800 Subject: [PATCH 0551/1809] PRF @geekpi --- ... Free and Open Source Editor Pixelorama.md | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/translated/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md b/translated/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md index 530517a482..93fa31a461 100644 --- a/translated/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md +++ b/translated/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md @@ -1,52 +1,50 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Create Stunning Pixel Art With Free and Open Source Editor Pixelorama) [#]: via: (https://itsfoss.com/pixelorama/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -使用免费和开源编辑器 Pixelorama 创建令人惊叹的像素艺术 +使用 Pixelorama 创建令人惊叹的像素艺术 ====== -_**简介:Pixelorama 是一个跨平台、免费和开源的 2D Sprite 编辑器。它在干净的用户界面中提供了创建像素艺术所有必要工具。**_ +> Pixelorama 是一个跨平台、自由开源的 2D 精灵编辑器。它在一个整洁的用户界面中提供了创建像素艺术所有必要工具。 ### Pixelorama:开源 Sprite 编辑器 -[Pixelorama][1] 是年轻游戏开发人员在 [Orama 互动][2]创建的工具。他们已经开发了一些 2D 游戏,其中一些使用了像素艺术。 +[Pixelorama][1] 是 [Orama 互动][2]公司的年轻游戏开发人员创建的一个工具。他们已经开发了一些 2D 游戏,其中一些使用了像素艺术。 -虽然 Orama 主要投入游戏开发,但开发人员也在创建实用工具,帮助他们(和其他人)创建这些游戏。 +虽然 Orama 主要从事于游戏开发,但开发人员也创建实用工具,帮助他们(和其他人)创建这些游戏。 -免费开源的 Sprite 编辑器,Pixelorama 是这样一个实用工具。它构建在 [Godot 引擎][3]之上,非常适合创作像素艺术。 +自由开源的精灵Sprite编辑器 Pixelorama 就是这样一个实用工具。它构建在 [Godot 引擎][3]之上,非常适合创作像素艺术。 ![Pixelorama screenshot][4] -你在上面的截图中看到像素艺术了吗?它是使用 Pixelorama 创建的。此视频显示创建上面图像的延时视频。 +你看到上面截图中的像素艺术了吗?它是使用 Pixelorama 创建的。这段视频展示了制作上述图片的时间推移视频。 ### Pixelorama 的功能 以下是 Pixelorama 提供的主要功能: - * 多种工具,如铅笔,擦除,填充桶颜色选择器等 - * 多层系统,你可以根据需要添加、删除、上下移动、克隆和合并尽可能多的层 + * 多种工具,如铅笔、橡皮擦、填充桶、取色器等 + * 多层系统,你可以根据需要添加、删除、上下移动、克隆和合并多个层 * 支持 Spritesheets * 导入图像并在 Pixelorama 中编辑它们 * 带有 [Onion Skinning][5] 的动画时间线 * 自定义画笔 * 以 Pixelorama 的自定义文件格式 .pxo 保存并打开你的项目 * 水平和垂直镜像绘图 - * 用于图样创建的磁贴模式 + * 用于创建图样的磁贴模式 * 拆分屏幕模式和迷你画布预览 * 使用鼠标滚轮缩放 - * 无限撤消和重做 + * 无限次撤消和重做 * 缩放、裁剪、翻转、旋转、颜色反转和去饱和图像 * 键盘快捷键 * 提供多种语言 * 支持 Linux、Windows 和 macOS - - ### 在 Linux 上安装 Pixelorama Pixelorama 提供 Snap 应用,如果你使用的是 Ubuntu,那么可以在软件中心找到它。 @@ -59,33 +57,33 @@ Pixelorama 提供 Snap 应用,如果你使用的是 Ubuntu,那么可以在 sudo snap install pixelorama ``` -如果你不想使用 Snap,不用担心。你可以从[他们的 GitHub 仓库]下载最新版本的 Pixelorama,[解压 zip 文件][9],你会看到一个可执行文件。授予此文件执行权限,并双击它运行应用。 +如果你不想使用 Snap,不用担心。你可以从[他们的 GitHub 仓库][8]下载最新版本的 Pixelorama,[解压 zip 文件][9],你会看到一个可执行文件。授予此文件执行权限,并双击它运行应用。 -[下载 Pixelorama][10] +- [下载 Pixelorama][10] -**总结** +### 总结 ![Pixelorama Welcome Screen][11] 在 Pixeloaram 的功能中,它说你可以导入图像并对其进行编辑。我想,这只是对某些类型的文件,因为当我尝试导入 PNG 或 JPEG 文件,程序崩溃了。 -然而,我可以像一个 3 岁的孩子那样随意涂鸦并制作像素艺术。我并没有深入艺术,但我认为这是一个[在 Linux 上对数字艺术家有用的工具][12]。 +然而,我可以像一个 3 岁的孩子那样随意涂鸦并制作像素艺术。我对艺术不是很感兴趣,但我认为这[对 Linux 上的数字艺术家是个有用的工具][12]。 我喜欢这样的想法:尽管是游戏开发人员,但他们创建的工具,可以帮助其他游戏开发人员和艺术家。这就是开源的精神。 -如果你喜欢这个项目,并且会使用它,请考虑通过捐赠来支持他们。[FOSS 捐赠了][13] 25 美元,以感谢他们的努力。 +如果你喜欢这个项目,并且会使用它,请考虑通过捐赠来支持他们。[It’s FOSS 捐赠了][13] 25 美元,以感谢他们的努力。 -[向 Pixelorama 捐赠(主要开发者的个人 Paypal 账户)][14] +- [向 Pixelorama 捐赠(主要开发者的个人 Paypal 账户)][14] -你喜欢 Pixelorama 吗?你是否使用其他开源 Sprite 编辑器?请随时在评论栏分享你的观点。 +你喜欢 Pixelorama 吗?你是否使用其他开源精灵编辑器?请随时在评论栏分享你的观点。 -------------------------------------------------------------------------------- - +via: https://itsfoss.com/pixelorama/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8cc7dc8871ef32efb5770a18c488daf23bda8448 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 1 May 2020 23:22:46 +0800 Subject: [PATCH 0552/1809] PUB @geekpi https://linux.cn/article-12173-1.html --- ...g Pixel Art With Free and Open Source Editor Pixelorama.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md (98%) diff --git a/translated/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md b/published/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md similarity index 98% rename from translated/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md rename to published/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md index 93fa31a461..7a267a672e 100644 --- a/translated/tech/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md +++ b/published/20200317 Create Stunning Pixel Art With Free and Open Source Editor Pixelorama.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12173-1.html) [#]: subject: (Create Stunning Pixel Art With Free and Open Source Editor Pixelorama) [#]: via: (https://itsfoss.com/pixelorama/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From c7d4f93bfee652f09c6696f133f19ea562d97917 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 2 May 2020 00:52:31 +0800 Subject: [PATCH 0553/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200501=20Usin?= =?UTF-8?q?g=20mergerfs=20to=20increase=20your=20virtual=20storage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200501 Using mergerfs to increase your virtual storage.md --- ...rgerfs to increase your virtual storage.md | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 sources/tech/20200501 Using mergerfs to increase your virtual storage.md diff --git a/sources/tech/20200501 Using mergerfs to increase your virtual storage.md b/sources/tech/20200501 Using mergerfs to increase your virtual storage.md new file mode 100644 index 0000000000..06f26abf51 --- /dev/null +++ b/sources/tech/20200501 Using mergerfs to increase your virtual storage.md @@ -0,0 +1,147 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using mergerfs to increase your virtual storage) +[#]: via: (https://fedoramagazine.org/using-mergerfs-to-increase-your-virtual-storage/) +[#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/) + +Using mergerfs to increase your virtual storage +====== + +![][1] + +What happens if you have multiple disks or partitions that you’d like to use for a media project and you don’t want to lose any of your existing data, but you’d like to have everything located or mounted under one drive. That’s where mergerfs can come to your rescue! + +[mergerfs][2] is a union filesystem geared towards simplifying storage and management of files across numerous commodity storage devices. + +You will need to grab the latest RPM from their github page [here][3]. The releases for Fedora have _**fc**_ and the version number in the name. For example here is the version for Fedora 31: + +[mergerfs-2.29.0-1.fc31.x86_64.rpm][4] + +### Installing and configuring mergerfs + +Install the mergerfs package that you’ve downloaded using sudo: + +``` +$ sudo dnf install mergerfs-2.29.0-1.fc31.x86_64.rpm +``` + +You will now be able to mount multiple disks as one drive. This comes in handy if you have a media server and you’d like all of your media files to show up under one location. If you upload new files to your system, you can copy them to your mergerfs directory and mergerfs will automatically copy them to which ever drive has enough free space available. + +Here is an example to make it easier to understand: + +``` +$ df -hT | grep disk +/dev/sdb1 ext4 23M 386K 21M 2% /disk1 +/dev/sdc1 ext4 44M 1.1M 40M 3% /disk2 + +$ ls -l /disk1/Videos/ +total 1 +-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Our Wedding.mkv + +$ ls -l /disk2/Videos/ +total 2 +-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Baby's first Xmas.mkv +-rw-rw-r--. 1 curt curt 0 Mar 8 17:21 Halloween hijinks.mkv +``` + +In this example there are two disks mounted as _disk1_ and _disk2_. Both drives have a _**Videos**_ directory with existing files. + +Now we’re going to mount those drives using mergerfs to make them appear as one larger drive. + +``` +$ sudo mergerfs -o defaults,allow_other,use_ino,category.create=mfs,moveonenospc=true,minfreespace=1M /disk1:/disk2 /media +``` + +The mergerfs man page is quite extensive and complex so we’ll break down the options that were specified. + + * _defaults_: This will use the default settings unless specified. + * _allow_other_: allows users besides sudo or root to see the filesystem. + * _use_ino_: Causes mergerfs to supply file/directory inodes rather than libfuse. While not a default it is recommended it be enabled so that linked files share the same inode value. + * _category.create=mfs_: Spreads files out across your drives based on available space. + * _moveonenospc=true_: If enabled, if writing fails, a scan will be done looking for the drive with the most free space. + * _minfreespace=1M_: The minimum space value used. + * _disk1_: First hard drive. + * _disk2_: Second hard drive. + * _/media_: The directory folder where the drives are mounted. + + + +Here is what it looks like: + +``` +$ df -hT | grep disk +/dev/sdb1 ext4 23M 386K 21M 2% /disk1 +/dev/sdc1 ext4 44M 1.1M 40M 3% /disk2 + +$ df -hT | grep media +1:2 fuse.mergerfs 66M 1.4M 60M 3% /media +``` + +You can see that the mergerfs mount now shows a total capacity of 66M which is the combined total of the two hard drives. + +Continuing with the example: + +There is a 30Mb video called _Baby’s second Xmas.mkv_. Let’s copy it to the _/media_ folder which is the mergerfs mount. + +``` +$ ls -lh "Baby's second Xmas.mkv" +-rw-rw-r--. 1 curt curt 30M Apr 20 08:45 Baby's second Xmas.mkv +$ cp "Baby's second Xmas.mkv" /media/Videos/ +``` + +Here is the end result: + +``` +$ df -hT | grep disk +/dev/sdb1 ext4 23M 386K 21M 2% /disk1 +/dev/sdc1 ext4 44M 31M 9.8M 76% /disk2 + +$ df -hT | grep media +1:2 fuse.mergerfs 66M 31M 30M 51% /media +``` + +You can see from the disk space utilization that mergerfs automatically copied the file to disk2 because disk1 did not have enough free space. + +Here is a breakdown of all of the files: + +``` +$ ls -l /disk1/Videos/ +total 1 +-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Our Wedding.mkv + +$ ls -l /disk2/Videos/ +total 30003 +-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Baby's first Xmas.mkv +-rw-rw-r--. 1 curt curt 30720000 Apr 20 08:47 Baby's second Xmas.mkv +-rw-rw-r--. 1 curt curt 0 Mar 8 17:21 Halloween hijinks.mkv + +$ ls -l /media/Videos/ +total 30004 +-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Baby's first Xmas.mkv +-rw-rw-r--. 1 curt curt 30720000 Apr 20 08:47 Baby's second Xmas.mkv +-rw-rw-r--. 1 curt curt 0 Mar 8 17:21 Halloween hijinks.mkv +-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Our Wedding.mkv +``` + +When you copy files to your mergerfs mount, it will always copy the files to the hard disk that has enough free space. If none of the drives in the pool have enough free space, then you won’t be able to copy them. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/using-mergerfs-to-increase-your-virtual-storage/ + +作者:[Curt Warfield][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/rcurtiswarfield/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/mergerfs-816x346.png +[2]: https://github.com/trapexit/mergerfs +[3]: https://github.com/trapexit/mergerfs/releases +[4]: https://github.com/trapexit/mergerfs/releases/download/2.29.0/mergerfs-2.29.0-1.fc31.x86_64.rpm From ebf9e99900df30f8e0718e4808baca61585d9ae3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 2 May 2020 00:57:44 +0800 Subject: [PATCH 0554/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200430=20Linu?= =?UTF-8?q?x=20and=20Kubernetes:=20Serving=20The=20Common=20Goals=20of=20E?= =?UTF-8?q?nterprises?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200430 Linux and Kubernetes- Serving The Common Goals of Enterprises.md --- ...Serving The Common Goals of Enterprises.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20200430 Linux and Kubernetes- Serving The Common Goals of Enterprises.md diff --git a/sources/tech/20200430 Linux and Kubernetes- Serving The Common Goals of Enterprises.md b/sources/tech/20200430 Linux and Kubernetes- Serving The Common Goals of Enterprises.md new file mode 100644 index 0000000000..c3c0c36b66 --- /dev/null +++ b/sources/tech/20200430 Linux and Kubernetes- Serving The Common Goals of Enterprises.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux and Kubernetes: Serving The Common Goals of Enterprises) +[#]: via: (https://www.linux.com/articles/linux-and-kubernetes-serving-the-common-goals-of-enterprises/) +[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) + +Linux and Kubernetes: Serving The Common Goals of Enterprises +====== + +[![][1]][2] + +For [Stefanie Chiras,][3] VP & GM, Red Hat Enterprise Linux (RHEL) Business Unit at [Red Hat][4], aspects such as security and resiliency have always been important for Red Hat. More so, in the current situation when everyone has gone fully remote and it’s much harder to get people in front of the hardware for carrying out updates, patching, etc. + +“As we look at our current situation, never has it been more important to have an operating system that is resilient and secure, and we’re focused on that,” she said. + +The recently released version of [Red Hat Enterprise Linux (RHEL) 8.2][5] inadvertently address these challenge as it makes it easier for technology leaders to embrace the latest, production-ready innovations swiftly which offering security and resilience that their IT teams need. + +RHEL’s embrace of a predictable 6-month minor release cycle also helped customers plan upgrades more efficiently. + +“There is value for customers in having predictability of minor releases on a six-month cycle. Without knowing when they were coming was causing disruptions for them. The launch of 8.2 is now the second time we have delivered on our commitment of having minor releases every six months,” said Stefanie Chiras. + +In addition to offering security updates, the new version adds insights capabilities and forays into newer areas of innovation. + +The upgrade has expanded the earlier capability called ‘Adviser’ dramatically. Additional functionalities such as drift monitoring and CVE coverage allow for a much deeper granularity into how the infrastructure is running. + +“It really amplifies the skills that are already present in ops and sysadmin teams, and this provides a Red Hat consultation, if you will, directly into the data center,” claimed Charis. + +As containers are increasingly being leveraged for digital transformation, RHEL 8.2 offers an updated application stream of Red Hat’s container tools. It also has new, containerized versions of Buildah and Skopeo. + +[Skopeo][6] is an open-source image copying tool, while Buildah is a tool for building Docker- and Kubernetes-compatible images easily and quickly. + +RHEL has also ensured in-place upgrades in the new version. Customers can now directly in-place upgrade from version 7 to version 8.2. + +Chiras believes Linux has emerged as the go-to-platform for innovations such as Machine Learning, Deep Learning, and Artificial Intelligence. + +“Linux has now become the springboard of innovation,” she argued. “AI, machine learning, and deep learning are driving a real change in not just the software but also the hardware. In the context of these emerging technologies, it’s all about making them consumable into an enterprise.” + +“We’re very focused on our ecosystem, making sure that we’re working in the right upstream communities with the right ISVs, with the right hardware partners to make all of that magic come together,” Chiras said. + +Towards this end, Red Hat has been partnering with multiple architectures for a long time — be it an x86 architecture, ARM, Power, or mainframe with IBM Z. Its partnership with Nvidia pulls in capabilities such as FPGAs, and GPU. + +**Synergizing Kubernetes and Linux ** + +Kubernetes is fast finding favor in enterprises.  So how do Linux and Kubernetes serve the common goals of enterprises? + +“Kubernetes is a new way to deploy Linux. We’re very focused on providing operational consistency by leveraging our technology in RHEL and then bringing in that incredible capability of Kubernetes within our OpenShift product line,” Chiras said. + +The deployment of Linux within a Kubernetes environment is much more complicated than in a traditional deployment. RHEL, therefore, made some key changes. The company created Red Hat Enterprise Linux CoreOS — an optimized version of RHEL for the OpenShift experience. + +“It’s deployed as an immutable. It’s tailored, narrow, and gets updated as part of your OpenShift update to provide consistent user experience and comprehensive security. + +The launch of the Red Hat Universal Base Image (UBI) offers users greater security, reliability, and performance of official Red Hat container images where OCI-compliant Linux containers run. + +“Kubernetes is a new way to deploy Linux. It really is a tight collaboration but what we’re really focused on is the customer experience. We want them to get easy updates with consistency and reliability, resilience and security. We’re pulling all of that together. With such advancements going on, it’s a fascinating space to watch,” added Chiras. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/linux-and-kubernetes-serving-the-common-goals-of-enterprises/ + +作者:[Swapnil Bhartiya][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/author/swapnil/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2019/12/computer-2930704_1280-1068x634.jpg (computer-2930704_1280) +[2]: https://www.linux.com/wp-content/uploads/2019/12/computer-2930704_1280.jpg +[3]: https://www.linkedin.com/in/stefanie-chiras-9022144/ +[4]: https://www.redhat.com/en +[5]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/8.2_release_notes/index +[6]: https://github.com/containers/skopeo From 19fc1b2822309a15529af2bf18f3bde65eeee79d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 2 May 2020 00:58:34 +0800 Subject: [PATCH 0555/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200502=20Pop?= =?UTF-8?q?=20OS=2020.04=20Review:=20Best=20Ubuntu-based=20Distribution=20?= =?UTF-8?q?Just=20Got=20Better?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md --- ...untu-based Distribution Just Got Better.md | 232 ++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md diff --git a/sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md b/sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md new file mode 100644 index 0000000000..760307eeb1 --- /dev/null +++ b/sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md @@ -0,0 +1,232 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Pop OS 20.04 Review: Best Ubuntu-based Distribution Just Got Better) +[#]: via: (https://itsfoss.com/pop-os-20-04-review/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Pop OS 20.04 Review: Best Ubuntu-based Distribution Just Got Better +====== + +_**Brief: Pop OS 20.04 is an impressive Linux distribution based on Ubuntu. I review the major new features in this review and share my experience with the latest release.**_ + +Now that Ubuntu 20.04 LTS and its official flavours are here – it’s time to take a look at one of best Ubuntu-based distro i.e Pop!_OS 20.04 by [System76][1]. + +To be honest, Pop!_OS is my favorite Linux distro that I primarily use for everything I do. + +Now that Pop!_OS 20.04 has finally arrived. It’s time to take a look at what it offers and whether you should upgrade or not? + +### What’s New In Pop!_OS 20.04 LTS? + +![][2] + +Visually, Pop!_OS 20.04 LTS isn’t really very different from Pop!_OS 19.10. However, you can find several new features and improvements. + +But, if you were using **Pop!_OS 18.04 LTS**, you have a lot of things to try. + +With [GNOME 3.36][3] onboard along with some newly added features, Pop!_OS 20.04 is an exciting release. + +Overall, to give you an overview here are some key highlights: + + * Automatic Window Tiling + * New Application Switcher and Launcher + * Flatpack support added in Pop!_Shop + * GNOME 3.36 + * Linux Kernel 5.4 + * Improved hybrid graphics support + + + +While this sounds fun, let us take a look at a detailed look on what has changed and how’s the experience of Pop!_OS 20.04 so far. + +### User Experience Improvements in Pop OS 20.04 + +Undoubtedly, a lot of Linux distros offer a pleasant user experience out of the box. Likewise, [Ubuntu 20.04 LTS has had top-notch improvements and features][4] as well. + +And, when it comes to Pop!_OS by System 76, they always try to go a mile further. And, the majority of new features aim to improve the user experience by providing useful functionalities. + +Here, I’m going to take a look at some of the improvements that include [GNOME 3.36][3] and Pop!_OS-specific features. + +#### Support For System Tray Icons + +Finally! This may not be a big change – but Pop!_OS did not have the support for system tray icons (or applet icons). + +![][5] + +With 20.04 LTS release, it’s here by default. No need of any extension. + +There may not be a whole lot of programs depending on system tray icons – but it is still something important to have. + +In my case, I wasn’t able to use [ActivityWatch][6] on Pop!_OS 19.10 – but now I can. + +#### Automatic Window Tiling + +![][7] + +**Automatic Window Tiling** is something I always wanted to try – but never invested any time to set it up using a [tiling window manager][8] like [i3][9], not even with [Regolith Desktop][10]. + +With Pop!_OS 20.04, you don’t need to do that anyway. The automatic window tiling feature comes baked in without needing you to set it up. + +It also features an option to **Show Active Hint** i.e it will highlight the active window to avoid confusion. And, you can also adjust the gap between the windows. + +![][11] + +You can see it in action in their official video: + +[Subscribe to our YouTube channel for more Linux videos][12] + +And, I must say that it is one of the biggest additions on Pop!_OS 20.04 that could potentially help you multi-task more efficiently. + +Even though the feature comes in handy everytime you use it. To make the most out of it, a display screen bigger than 21-inches (at least) should be the best way to go! And, for this reason – I’m really tempted to upgrade my monitor as well! + +#### New Extensions App + +![][13] + +Pop!_OS comes baked in with some unique GNOME extensions. But, you don’t need GNOME Tweaks the manage the extension anymore. + +The newly added **Extensions** app lets you configure and manage the extensions on Pop!_OS 20.04. + +#### Improved Notification Center + +![][14] + +With the new GNOME 3.36 release, the notification center includes a revamped look. Here, I have the dark mode enabled. + +#### New Application Switcher & Launcher + +![][15] + +You can still **ALT+TAB** or **Super key + TAB** to go through the running applications. + +But, that’s time-consuming when you have a lot of things going on. So, on Pop!_OS 20.04, you get an application switcher and launcher which you can activate using **Super key + /** + +Once you get used to the keyboard shortcut, it will be very convenient thing to have. + +In addition to this, you may find numerous other subtle improvements visually with the icons/windows on Pop!_OS 20.04. + +#### New Login Screen + +Well, with GNOME 3.36, it’s an obvious change. But, it does look good! + +![][16] + +### Flatpak Support on Pop!_Shop + +Normally, Pop!_Shop is already something useful with a huge repository along with [Pop!_OS’s own repositories.][17] + +Now, with Pop!_OS 20.04, you can choose to install either Flatpak (via Flathub) or the Debian package of any available software on Pop!_Shop. Of course, only if a Flatpak package exists for the particular software. + +You might want to check [how to use Flatpak on Linux][18] if you don’t have Pop!_OS 20.04. + +![][19] + +Personally, I’m not a fan of Flatpak but some applications like GIMP requires you to install the Flatpak package to get the latest version. So, it is definitely a good thing to have the support for Flatpak on Pop!_Shop baked right into it. + +### Keyboard Shortcut Changes + +This can be annoying if you’re comfortable with the existing keyboard shortcuts on Pop!_OS 19.10 or older. + +In either case, there are a few important keyboard shortcut changes to potentially improve your experience, here they are: + + * Lock Screen: **Super + L** _changed to_ **Super + Escape** + * Move Workspace: **Super + Up/Down Arrow** _changed to_ **Super + CTRL + Up/Down Arrow** + * Close Window: **Super + W** _changed_ to **Super + Q** + * Toggle Maximize: **Super + Up Arrow** _changed to_ **Super + M** + + + +### Linux Kernel 5.4 + +Similar to most of the other latest Linux distros, Pop!_OS 20.04 comes loaded with [Linux Kernel 5.4][20]. + +So, obviously, you can expect the [exFAT support][21] and an improved AMD graphics compatibility along with all the other features that come with it. + +### Performance Improvements + +Even though Pop!_OS doesn’t pitch itself as a lightweight Linux distro, it is still a resource-efficient distro. And, with GNOME 3.36 onboard, it should be fast enough. + +Considering that I’ve been using Pop!_OS as my primary distro for about a year, I’ve never had any performance issues. And, this is how the resource usage will probably look like (depending on your system configuration) after you install Pop!_OS 20.04. + +![][22] + +To give you an idea, my desktop configuration involves an i5-7400 processor, 16 GB RAM (2400 MHz), NVIDIA GTX 1050ti graphics card, and an SSD. + +I’m not really a fan of system benchmarks because it does not really give you the idea of how a specific application or a game would perform unless you try it. + +You can try the [Phoronix Test Suite][23] to analyze how your system performs. But, Pop!_OS 20.04 LTSshould be a snappy experience! + +### Package Updates & Other Improvements + +While every Ubuntu-based distro benefits from the [improvements in Ubuntu 20.04 LTS][4], there are some Pop OS specific bug fixes and improvements as well. + +In addition to it, some major apps/packages like **Firefox 75.0** have been updated to their latest version. + +As of now, there should be no critical bugs present and at least none for me. + +You can check out their [development progress on GitHub][24] to check the details of issues they’ve already fixed during the beta testing and the issues they will be fixing right after the release. + +### Download & Support Pop!_OS 20.04 + +![][25] + +With this release, System76 has finally added a subscription model (optional) to support Pop!_OS development. + +You can download **Pop!_OS 20.04** for free – but if you want to support them I’d suggest you go for the subscription with just **$1/month**. + +[Pop!_OS 20.04][26] + +### My Thoughts on Pop OS 20.04 + +I must mention that I was rooting for a fresh new wallpaper with the latest 20.04 release. But, that’s not a big deal. + +With the window tiling feature, flatpak support, and numerous other improvements, my experience with Pop!_OS 20.04 has been top-notch so far. Also, it’s great to see that they are highlighting their focus on creative professionals with out-of-the-box support for some popular software. + +![][27] + +All the good things about Ubuntu 20.04 and some extra toppings on it by System76, I’m impressed! + +_**Have you tried the Pop!_OS 20.04 yet? Let me know your thoughts in the comments below.**_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/pop-os-20-04-review/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://system76.com +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/pop_os_20_04_review.jpg?ssl=1 +[3]: https://itsfoss.com/gnome-3-36-release/ +[4]: https://itsfoss.com/ubuntu-20-04-release-features/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/system-tray-icons-pop-os.jpg?ssl=1 +[6]: https://activitywatch.net/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/pop-os-automatic-screen-tiling.png?ssl=1 +[8]: https://en.wikipedia.org/wiki/Tiling_window_manager +[9]: https://i3wm.org/ +[10]: https://itsfoss.com/regolith-linux-desktop/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/tile-feature-options-popos.jpg?ssl=1 +[12]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/pop-os-extensions.jpg?ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/notification-center-pop-os.jpg?ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/pop-os-application-launcher.jpg?ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/pop-os-20-04-lock-screen.jpg?ssl=1 +[17]: https://launchpad.net/~system76/+archive/ubuntu/pop +[18]: https://itsfoss.com/flatpak-guide/ +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/pop-os-flatpak-deb.jpg?ssl=1 +[20]: https://itsfoss.com/linux-kernel-5-4/ +[21]: https://itsfoss.com/mount-exfat/ +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/pop-os-20-04-performance.jpg?ssl=1 +[23]: https://www.phoronix-test-suite.com/ +[24]: https://github.com/orgs/pop-os/projects/13 +[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/support-pop-os.jpg?ssl=1 +[26]: https://pop.system76.com/ +[27]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/pop-os-stem-focus.jpg?ssl=1 From 432ad8d1c6a54c315091b14fbb7d5e88afc5272d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 2 May 2020 01:00:57 +0800 Subject: [PATCH 0556/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200501=20Tran?= =?UTF-8?q?sparent,=20open=20source=20alternative=20to=20Google=20Analytic?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200501 Transparent, open source alternative to Google Analytics.md --- ... source alternative to Google Analytics.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/tech/20200501 Transparent, open source alternative to Google Analytics.md diff --git a/sources/tech/20200501 Transparent, open source alternative to Google Analytics.md b/sources/tech/20200501 Transparent, open source alternative to Google Analytics.md new file mode 100644 index 0000000000..d4ce222a39 --- /dev/null +++ b/sources/tech/20200501 Transparent, open source alternative to Google Analytics.md @@ -0,0 +1,123 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Transparent, open source alternative to Google Analytics) +[#]: via: (https://opensource.com/article/20/5/plausible-analytics) +[#]: author: (Marko Saric https://opensource.com/users/markosaric) + +Transparent, open source alternative to Google Analytics +====== +Plausible Analytics is a leaner, more transparent option, with the +essential data you need but without all the privacy baggage. +![Digital creative of a browser on the internet][1] + +Google Analytics is the most popular website analytics tool. Millions of developers and creators turn to it to collect and analyze their website statistics. + +More than 53% of all sites on the web track their visitors using Google Analytics. [84%][2] of sites that do use a known analytics script use Google Analytics. + +Google Analytics has, for years, been one of the first tools I installed on a newly launched site. It is a powerful and useful analytics tool. Installing Google Analytics was a habit I didn't think much about until the introduction of the [GDPR][3] (General Data Protection Regulation) and other privacy regulations. + +Using Google Analytics these days comes with several pitfalls, including the need for a privacy policy, the need for cookie banners, and the need for a GDPR consent prompt. All these may negatively impact the site loading time and visitor experience. + +This has made me try to [de-Google-ify websites][4] that I work on, and it's made me start working on independent solutions that are open source and more privacy-friendly. This is where Plausible Analytics enters the story. + +[Plausible Analytics][5] is an open source and lightweight alternative to Google Analytics. It doesn't use cookies and it doesn't collect any personal data, so you don't need to show any cookie banners or get GDPR or CCPA consent. Let's take a closer look. + +### Main differences between Google Analytics and Plausible + +Plausible Analytics is not designed to be a clone of Google Analytics. It is meant as a simple-to-use replacement and a privacy-friendly alternative. Here are the main differences between the two web analytics tools: + +#### Open source vs. closed source + +Google Analytics may be powerful and useful, but it is closed source. It is a proprietary tool run by one of the largest companies in the world, a company that is a key player in the ad-tech industry. There's simply no way of knowing what's going on behind the scenes. You have to put your trust in Google. + +Plausible is a fully open source tool. You can read our code [on GitHub][6]. We're "open" in other ways, too, such as our [public roadmap][7], which is based around the feedback and features submitted by the members of our community. + +#### Privacy of your website visitors + +Google Analytics places [several cookies][8] on the devices of your visitors, and it tracks and collects a lot of data. This means that there are several requirements if you want to use Google Analytics and be compliant with the different regulations: + + * You need to have a privacy policy about analytics + * You need to show a cookie banner + * You need to obtain a GDPR/CCPA consent + + + +Plausible is made to be fully compliant with the privacy regulations. No cookies are used, and no personal data is collected. This means that you don't need to display the cookie banner, you don't need a privacy policy, and you don't need to ask for the GDPR/CCPA consent when using Plausible. + +#### Page weight and loading time + +The recommended way of installing Google Analytics is to use the Google Tag Manager. Google Tag Manager script weights 28 KB, and it downloads another JavaScript file called the Google Analytics tag, which adds an additional 17.7 KB to your page size. That's 45.7 KB of page weight combined. + +Plausible script weights only 1.4 KB. That's 33 times smaller than the Google Analytics Global Site Tag. Every KB matters when you want to keep your site fast to load. + +#### Accuracy of visitor stats + +Google Analytics is being blocked by an increasing number of web users. It's blocked by those who use open source browsers such as [Firefox][9] and [Brave][10]. It's also blocked by those who use open source browser add-ons such as the [uBlock Origin][11]. It's not uncommon to see 40% or more of the audience on a tech site blocking Google Analytics. + +Plausible is a new player on this market and it's privacy-friendly by default, so it doesn't see the same level of blockage. + +#### Simple vs. complex web analytics + +[Google Analytics is overkill][12] for many website owners. It's a complex tool that takes time to understand and requires training. Google Analytics presents hundreds of different reports and metrics for you to get insights from. Many users end up creating custom dashboards while ignoring all the rest. + +Plausible cuts through all the noise that Google Analytics creates. It presents everything you need to know on one single page—all the most valuable metrics at a glance. You can get an overview of the most actionable insights about your website in one minute. + +### A guided tour of Plausible Analytics + +Plausible Analytics is not a full-blown replacement and a feature-by-feature reproduction of Google Analytics. It's not designed for all the different use-cases of Google Analytics. + +It's built with simplicity and speed in mind. There is no navigational menu. There are no additional sub-menus. There is no need to create custom reports. You get one simple and useful web analytics dashboard out of the box. + +Rather than tracking every metric imaginable, many of them that you will never find a use for, Plausible focuses on the essential website stats only. It is easy to use and understand with no training or prior experience: + +![Plausible analytics in action][13] + + * Choose the time range that you want to analyze. The visitor numbers are automatically presented on an hourly, daily, or monthly graph. The default time frame is set at the last 30 days. + * See the number of unique visitors, total page views, and the bounce rate. These metrics include a percentage comparison to the previous time period, so you understand if the trends are going up or down. + * See all the referral sources of traffic and all the most visited pages on your site. Bounce rates of the individual referrals and pages are included too. + * See the list of countries your traffic is coming from. You can also see the device, browser, and operating system your visitors are using. + * Track events and goals to identify the number of converted visitors, the conversion rate, and the referral sites that send the best quality traffic. + + + +Take a look at the [live demo][14] where you can follow the traffic to the Plausible website. + +### Give Plausible Analytics a chance + +With Plausible Analytics, you get all the important web analytics at a glance so you can focus on creating a better site without needing to annoy your visitors with all the different banners and prompts. + +You can try Plausible Analytics on your site alongside Google Analytics. [Register today][15] to try it out, and see what you like and what you don't. Share your feedback with the community. This helps us learn and improve. We'd love to hear from you. + +Take a look at five great open source alternatives to Google Docs. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/plausible-analytics + +作者:[Marko Saric][a] +选题:[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/markosaric +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://w3techs.com/technologies/details/ta-googleanalytics +[3]: https://gdpr-info.eu/ +[4]: https://markosaric.com/degoogleify/ +[5]: https://plausible.io/ +[6]: https://github.com/plausible-insights/plausible +[7]: https://feedback.plausible.io/roadmap +[8]: https://developers.google.com/analytics/devguides/collection/analyticsjs/cookie-usage +[9]: https://www.mozilla.org/en-US/firefox/new/ +[10]: https://brave.com/ +[11]: https://github.com/gorhill/uBlock +[12]: https://plausible.io/vs-google-analytics +[13]: https://opensource.com/sites/default/files/plausible-analytics.png (Plausible analytics in action) +[14]: https://plausible.io/plausible.io +[15]: https://plausible.io/register From b994526987b2789220543819caf9c654ce35110a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 2 May 2020 01:04:15 +0800 Subject: [PATCH 0557/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200501=20Red?= =?UTF-8?q?=20Hat=20Summit=202020=20virtual=20experience?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200501 Red Hat Summit 2020 virtual experience.md --- ... Red Hat Summit 2020 virtual experience.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/talk/20200501 Red Hat Summit 2020 virtual experience.md diff --git a/sources/talk/20200501 Red Hat Summit 2020 virtual experience.md b/sources/talk/20200501 Red Hat Summit 2020 virtual experience.md new file mode 100644 index 0000000000..334c52c1f9 --- /dev/null +++ b/sources/talk/20200501 Red Hat Summit 2020 virtual experience.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Red Hat Summit 2020 virtual experience) +[#]: via: (https://www.networkworld.com/article/3541289/red-hat-summit-2020-virtual-experience.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Red Hat Summit 2020 virtual experience +====== + +[Virginiambe][1] [(CC BY-SA 3.0)][2] + +In the last couple days, Red Hat was able to demonstrate that an online technical conference can succeed. The Summit, normally held in Boston or San Francisco, was held online thanks to the Covid-19 pandemic still gripping the world. + +The fact that 80,000 people attended the online event warrants a huge applause. By comparison, last year’s in-person conference broke the record with only 8,900 attendees. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +### **Being “there”** + +The experience of attending the conference was in many ways what you would expect when attending a large conference in person. There were keynotes, general sessions and breakout sessions. There were many opportunities to ask questions. And it was often difficult but necessary to choose between parallel sessions. I attended both days and was very impressed. + +I also enjoyed some nostalgia about how we’ve all arrived at the places we are today with respect to Linux. It was clear that many attendees were overwhelmed by the progress that has been made just since last year. Linux, and [RHEL][4] in particular, is becoming more innovative, more clever in the ways that it can detect and respond to problems and yet in some important ways easier to manage because of the way the tools have evolved. + +Announcements at the conference included Red Hat OpenShift 4.4, OpenShift virtualization and Red Hat Advanced Container Management for Kubernetes. + +What was novel about attending a technical conference online was that we didn’t have to leave our home or office and that we could review sessions that we missed by selecting them later from the session layout pages. In fact, the sessions are still online and may well be for the coming year. If you didn’t participate in Red Hat Summit 2020, you can still sign up and you can still watch the sessions at your convenience. Just go to the [summit site][5]. And, did I mention, that it's free? + +### Catching up + +Once you’re signed up, you can click on the Watch and Learn at the top of the page and choose General Sessions or Sessions and Labs. The presentations will now all be labeled On Demand though they once displayed upcoming time slots. The individuals presenting information are excellent and the material is exciting. Even if you’re not working with Red Hat Enterprise Linux, you will learn a lot about Linux in general and how open source has evolved over the decades and is still evolving in important and critical ways. + +Topics covered at the conference include OpenShift, open hybrid cloud, future technologies, robotics and automation, advances on the edge and the power of open source. Red Hat Summit also includes joint sessions with both Red Hat and technology collaborators such as Ford, Verizon, Intel, Microsoft and Credit Suisse. + +### What’s next? + +Watching the conference online at a time when I can't leave my home was informative, but also encouraging and comforting. Linux has been an important part of my life for decades. It felt good to be connected to the larger community and to sense the currents of progress through my desktop system. + +While there’s no way to know at this point whether future Red Hat Summits or other Linux conferences will be held or made available online, the fact that Red Hat Summit 2020 was available online when so many of us are still huddled up at home wondering when our world will reopen was a testament not just to great technology but to the deep-seated conviction that it is critical that we work together and that open source can make that happen in ways that nothing else can. + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3541289/red-hat-summit-2020-virtual-experience.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://commons.wikimedia.org/wiki/File:Red_hat_with_bow2.JPG +[2]: https://creativecommons.org/licenses/by-sa/3.0/legalcode +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.networkworld.com/article/3540189/red-hat-enterprise-linux-82-hits-the-stage.html +[5]: https://www.redhat.com/summit +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From 374267ef01a8658d23a722ab96b6a0a88c4f90d8 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sat, 2 May 2020 10:08:12 +0800 Subject: [PATCH 0558/1809] Almost done --- ...high-performance computing as a service.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md index fc36ff7082..cb7e33856a 100644 --- a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md +++ b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md @@ -83,42 +83,42 @@ With clever system design, you can integrate those HPC-services bursts of activi ** Use of HPC services lends itself to batch-processing and loosely-coupled use cases. That ties into a common HPC downside: data transfer issues. High-performance computing by its very nature often involves huge data sets, and sending all that information over the internet to a cloud service provider is no simple thing. "We have clients I talk to in the biotech industry who spend $10 million a month on just the data charges," says IBM's Turek. -HPC服务的使用适合批处理和松散耦合的用例。这与HPC的常见缺点有关:数据传输问题。从本质上讲,高性能计算通常涉及庞大的数据集,而将所有这些信息通过Internet发送到云服务提供商并不是一件容易的事。 IBM的Turek说:“我们与生物技术行业的客户交流,他们每月仅在数据费用上就花费1000万美元。” +HPC服务适合批处理和松耦合的场景。这与HPC的普遍缺点有关:数据传输问题。高性能计算本身通常涉及庞大的数据集,而将所有这些信息通过Internet发送到云服务提供商并不容易。IBM的Turek说:“我们与生物技术行业的客户交流,他们每月仅在数据费用上就花费1000万美元。” And money isn't the only potential problem. Building a workflow that makes use of your data can challenge you to work around the long times required for data transfer. "When we had our own HPC cluster, local access to the simulation results already produced – and thus an interactive interim evaluation — was of course possible at any time," says hhpberlin's Kilian. "We're currently working on being able to access and evaluate the data produced in the cloud even more efficiently and interactively at any desired time of the simulation without the need to download large amounts of simulation data." -金钱并不是唯一的潜在问题。建立一个利用您的数据的工作流程可能会挑战您在数据传输所需的长时间内工作。 hhpberlin的Kilian说:“当我们拥有自己的HPC集群时,当然可以随时本地访问已经产生的仿真结果,从而进行交互式的临时评估。” “我们目前正在努力,能够在任何所需的模拟时间更高效,交互地访问和评估云中生成的数据,而无需下载大量的模拟数据。” +钱并不是唯一的潜在问题。已制定的需要使用数据的工作流可能会使您在数据传输所需的时间内无法工作。hhpberlin的Kilian说:“当我们拥有自己的HPC集群时,当然可以随时访问已经产生的仿真结果,从而进行交互式的临时评估。” “我们目前正努力达到在仿真的任意时刻都可以更高效地,交互地访问和评估云中生成的数据,而无需下载大量的模拟数据。” Mike Krawczyk cites another stumbling block: compliance issues. Any service a defense contractor uses needs to be complaint with the International Traffic in Arms Regulations (ITAR), and McCormick Stevenson went with Rescale in part because it was the only vendor they found that checked that box. While more do today, any company looking to use cloud services should be aware of the legal and data-protection issues involved in living on someone else's infrastructure, and the sensitive nature of many of HPC's use cases makes this doubly true for HPC as a service. -Mike Krawczyk提到了另一个绊脚石:合规性问题。国防承包商使用的任何服务都需要向《国际武器交易条例》(ITAR)进行投诉,麦考密克·史蒂文森(McCormick Stevenson)之所以选择Rescale,部分原因是这是他们发现该复选框的唯一供应商。如今,尽管有更多的公司这样做,但任何希望使用云服务的公司都应该意识到生活在其他人的基础架构上所涉及的法律和数据保护问题,而且许多HPC用例的敏感性质使得这对于HPC即服务而言是双重事实。 。 +Mike Krawczyk提到了另一个绊脚石:合规性问题。国防承包商使用的任何服务都需要遵从(原文是complaint, 应该是笔误)《国际武器交易条例》(ITAR),麦考密克·史蒂文森(McCormick Stevenson)之所以选择Rescale,部分原因是因为这是他们发现的唯一符合的供应商。如今,尽管有更多的公司(使用云服务),但任何希望使用云服务的公司都应该意识到使用其他人的基础设施时所涉及的法律和数据保护问题,而且许多HPC场景的敏感性使得更HPC即服务的这个问题更加突出。 In addition, the IT governance that HPC services require goes beyond regulatory needs. For instance, you'll need to keep track of whether your software licenses permit cloud use ­– especially with specialized software packages written to run on an on-premises HPC cluster. And in general, you need to keep track of how you use HPC services, which can be a tempting resource, especially if you've transitioned from in-house systems where staff was used to having idle HPC capabilities available. For instance, Ron Gilpin, senior director and Azure Platform Services global lead at Avanade, suggests dialing back how many processing cores you use for tasks that aren't time sensitive. "If a job only needs to be completed in an hour instead of ten minutes," he says, "that might use 165 processors instead of 1,000, a savings of thousands of dollars." -此外,HPC服务所需的IT治理超出了监管需求。例如,您需要跟踪您的软件许可证是否允许云使用­ –尤其是针对专门编写在本地HPC群集上运行的软件包。通常,您需要跟踪HPC服务的使用方式,这可能是一个诱人的资源,尤其是当您从习惯于工作人员的内部系统过渡到具有可用的空闲HPC功能时。例如,Avanade全球平台高级主管兼Azure平台服务全球负责人Ron Gilpin建议,回拨您用于非时间敏感任务的处理核心数量。他说:“如果一项工作只需要一个小时而不是十分钟就可以完成,那么它可以使用165个处理器而不是1,000个,从而节省了数千美元。” +此外,HPC服务所需的IT治理超出了目前的监管范围。例如,您需要跟踪您的软件许可证是否允许云使用­ –尤其是专门为本地HPC群集上运行而编写的软件包。通常,您需要跟踪HPC服务的使用方式,它可能是一个诱人的资源,尤其是当您从员工习惯的内部系统过渡到有可用的空闲的HPC能力时。例如,Avanade全球平台高级主管兼Azure平台服务全球负责人Ron Gilpin建议,回调您用于时间不敏感任务的处理核心数量。他说:“如果一项工作只需要用一小时来完成而不需要在十分钟内就完成,那么它可以使用165个处理器而不是1,000个,从而节省了数千美元。” -### A premium on HPC skills** +### A premium on HPC skills** 独特的HPC技能 ** One of the biggest barriers to HPC adoption has always been the unique in-house skills it requires, and HPC services don't magically make that barrier vanish. "Many CIOs have migrated a lot of their workloads into the cloud and they have seen cost savings and increased agility and efficiency, and believe that they can achieve similar results in HPC ecosystems," says Gartner's Dekate. "And a common misperception is that they can somehow optimize human resource cost by essentially moving away from system admins and hiring new cloud experts who can solve their HPC workloads." -一直以来,采用HPC的最大障碍之一就是其所需的独特内部技能,而HPC服务并不能使这种障碍消失。 Gartner的Dekate表示:“许多CIO将许多工作负载迁移到了云中,他们看到了节省成本,提高敏捷性和效率的信念,并且相信他们可以在HPC生态系统中实现类似的结果。” “一个普遍的误解是,他们可以从本质上远离系统管理员,并聘用可以解决其HPC工作负载的新云专家,从而以某种方式优化人力资源成本。” +一直以来,采用HPC的最大障碍之一就是其所需的独特的内部技能,而HPC服务并不能使这种障碍消失。Gartner的Dekate表示:“许多CIO将许多工作负载迁移到了云上,他们看到了成本的节约,敏捷性和效率的提升,因此相信在HPC生态中也可以达成类似的效果。” “一个普遍的误解是,他们可以通过彻底地免去系统管理员,并聘用能解决其HPC工作负载的新的云专家,从而以某种方式优化人力成本。” "But HPC is not one of the main enterprise environments," he says. "You're dealing with high-end compute nodes interconnected with high-bandwidth, low-latency networking stacks, along with incredibly complicated application and middleware stacks. Even the filesystem layers in many cases are unique to HPC environments. Not having the right skills can be destabilizing." -他说:“但是HPC并不是主要的企业环境之一。” “您正在处理与高带宽,低延迟网络堆栈以及难以置信的复杂应用程序和中间件堆栈互连的高端计算节点。在许多情况下,甚至文件系统层也是HPC环境所独有的。没有适当的技能 可能会破坏稳定。” +“但是HPC并不是主流的企业环境之一。” 他说。“您正在处理通过高带宽,低延迟的网络互联的高端计算节点,以及相当复杂的应用和中间件技术栈。许多情况下,甚至连文件系统层也是HPC环境所独有的。没有对应的技能可能会破坏稳定性。” But supercomputing skills are in shortening supply, something Dekate refers to as the workforce "greying," in the wake of a generation of developers going to splashy startups rather than academia or the more staid firms where HPC is in use. As a result, vendors of HPC services are doing what they can to bridge the gap. IBM's Turek says that many HPC vets will always want to roll their own exquisitely fine-tuned code and will need specialized debuggers and other tools to help them do that for the cloud. But even HPC newbies can make calls to code libraries built by vendors to exploit supercomputing's parallel processing. And third-party software providers sell turnkey software packages that abstract away much of HPC's complication. -但是超级计算技术却在缩短供应,Dekate将其称为劳动力“灰色”,这是因为一代开发人员将目光投向了新兴的初创公司,而不是学术界或使用HPC的更老套的公司。结果,HPC服务的供应商正在尽其所能弥合差距。 IBM的Turek表示,许多HPC兽医将始终希望推出他们自己精心调整过的代码,并且将需要专门的调试器和其他工具来帮助他们在云中实现这一目标。但是,即使是HPC新手也可以调用供应商构建的代码库,以利用超级计算的并行处理。第三方软件提供商出售的交钥匙软件包可以消除许多HPC复杂性。 +但是超级计算技能的供给却在减少,Dekate将其称为劳动力“灰化”,这是因为一代开发人员将目光投向了新兴的初创公司,而不是学术界或使用HPC的更老套的公司。因此,HPC服务供应商正在尽其所能地弥补差距。 IBM的Turek表示,许多HPC老手将总是想运行他们自己精心调整过的代码,将需要专门的调试器和其他工具来帮助他们在云上实现这一目标。但是,即使是HPC新手也可以调用供应商构建的代码库,以利用超级计算的并行处理能力。第三方软件提供商出售的交钥匙软件包可以减少HPC的许多复杂性。 Accenture's Tung says the sector needs to lean further into this in order to truly prosper. "HPCaaS has created dramatically impactful new capability, but what needs to happen is making this easy to apply for the data scientist, the enterprise architect, or the software developer," she says. "This includes easy to use APIs, documentation, and sample code. It includes user support to answer questions. It’s not enough to provide an API; that API needs to be fit-for-purpose. For a data scientist this should likely be in Python and easily change out for the frameworks she is already using. The value comes from enabling these users who ultimately will have their jobs improved through new efficiencies and performance, if only they can access the new capabilities." If vendors can pull that off, HPC services might truly bring supercomputing to the masses. -埃森哲的董先生表示,该行业需要进一步倾斜才能真正繁荣。她说:“ ​​HPCaaS已经创建了具有重大影响力的新功能,但是需要做的是使它易于应用于数据科学家,企业架构师或软件开发人员。” “这包括易于使用的API,文档和示例代码。它包含用户回答问题的支持。仅提供API是不够的; API需要适合特定用途。对于数据科学家而言,这可能应该包含在其中。使用Python并轻松地更改她已经在使用的框架。其价值来自使这些用户能够获得新的效率和性能,只要他们能够使用新功能,他们最终将通过新的效率和性能来改善他们的工作。”如果供应商能够做到这一点,那么HPC服务可能真正将超级计算带入大众。 +埃森哲的Tung表示,该行业需要进一步加大投入才能真正繁荣。她说:“HPCaaS已经创建了具有重大影响力的新功能,但还需要做的是使它易于被数据科学家,企业架构师或软件开发人员使用。这包括易用的API,文档和示例代码。它包括用户支持来解答问题。仅仅提供API是不够的,API需要适合特定的用途。对于数据科学家而言,这可能是以python形式提供,并容易更换她已经在使用的框架。其价值来自使这些用户最综只有在使用新功能时才能够改进效率和性能。” 如果供应商能够做到这一点,那么HPC服务才能真正将超级计算带给大众。 Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. -加入[Facebook] [3]和[LinkedIn] [4]上的Network World社区,以评论最重要的主题。 +加入[Facebook][3]和[LinkedIn][4]上的Network World社区,探讨最前沿的话题。 -------------------------------------------------------------------------------- via: https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html 作者:[Josh Fruhlinger][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[messon007](https://github.com/messon007) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 251b38d0bbfe2711b498dfd2832e7dfd7756f2a7 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sat, 2 May 2020 10:15:45 +0800 Subject: [PATCH 0559/1809] Remove original --- ...high-performance computing as a service.md | 54 +++++-------------- 1 file changed, 12 insertions(+), 42 deletions(-) diff --git a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md index cb7e33856a..df2c6debd3 100644 --- a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md +++ b/sources/talk/20200401 The ins and outs of high-performance computing as a service.md @@ -7,110 +7,80 @@ [#]: via: (https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html) [#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) -The ins and outs of high-performance computing as a service 高性能计算即服务的来龙去脉 +高性能计算即服务的来龙去脉 ====== -HPC services can be a way to meet expanding supercomputing needs, but depending on the use case, they’re not necessarily better than on-premises supercomputers. -Dell EMC 高性能计算(HPC)服务可能是一种满足不断增长的超级计算需求的方式,但依赖于使用场景,它们不一定比使用本地超级计算机好。 -Electronics on missiles and military helicopters need to survive extreme conditions. Before any of that physical hardware can be deployed, defense contractor McCormick Stevenson Corp. simulates the real-world conditions it will endure, relying on finite element analysis software like Ansys, which requires significant computing power. + 戴尔EMC 导弹和军用直升机上的电子设备需要工作在极端条件下。国防承包商麦考密克·史蒂文森公司(McCormick Stevenson Corp.)在部署任何物理设备之前都会事先模拟它所能承受的真实条件。模拟依赖于像Ansys这样的有限元素分析软件,该软件需要强大的算力。 -Then one day a few years ago, it unexpectedly ran up against its computing limits. 几年前的一天,它出乎意料地超出了计算极限。 -[10 of the world's fastest supercomputers][1] [世界上最快的10个超级计算机][1] -"We had some jobs that would have overwhelmed the computers that we had in office," says Mike Krawczyk, principal engineer at McCormick Stevenson. "It did not make economic or schedule sense to buy a machine and install software." Instead, the company contracted with Rescale, which could sell them cycles on a supercomputer-class system for a tiny fraction of what they would've spent on new hardware. 麦考密克·史蒂文森(McCormick Stevenson)的首席工程师迈克·克劳奇奇(Mike Krawczyk)说:“我们的一些工作会使办公室的计算机不堪重负。” “购买机器并安装软件在经济上或计划上都不划算。” 相反,该公司与Rescale签约,从其购买在超级计算机系统上运行的周期(cycles),而这只花费了他们购买新硬件上所需的一小部分。 -McCormick Stevenson had become an early adopter in a market known as supercomputing as a service or high-performance computing (HPC) as a service – two terms that are closely related. HPC is the application of supercomputers to computationally complex problems, while supercomputers are those computers at the cutting edge of processing capacity, according to the National Institute for Computational Sciences. 麦考密克·史蒂文森(McCormick Stevenson)已成为被称为超级计算即服务或高性能计算(HPC)即服务(两个紧密相关的术语)市场的早期采用者之一。根据国家计算科学研究所(的定义),HPC是超级计算机在计算复杂问题上的应用,而超级计算机是处理能力最先进的那些计算机。 -Whatever it's called, these services are upending the traditional supercomputing market and bringing HPC power to customers who could never afford it before. But it's no panacea, and it's definitely not plug-and-play – at least not yet. 无论叫它什么,这些服务都在颠覆传统的超级计算市场,并将HPC能力带给以前买不起的客户。但这不是万能的,而且绝对不是即插即用的,至少现在还不是。 -### HPC services in practice HPC服务实践 +### HPC服务实践 -From the end user's perspective, HPC as a service resembles the batch-processing model that dates back to the early mainframe era. "We create an Ansys batch file and send that up, and after it runs, we pull down the result files and import them locally here," Krawczyk says. 从最终用户的角度来看,HPC即服务类似于早期大型机时代的批处理模型。 “我们创建一个Ansys批处理文件并将其发送过去,运行它,然后将结果文件取下来并在本地导入它们,” Krawczyk说。 -Behind the scenes, cloud providers are running the supercomputing infrastructure in their own data centers – though that doesn't necessarily imply the sort of cutting-edge hardware you might be visualizing when you hear "supercomputer." As Dave Turek, Vice President of Technical Computing at IBM OpenPOWER, explains it, HPC services at their core are "a collection of servers that are strung together with an interconnect. You have the ability to invoke this virtual computing infrastructure that allows you to bring a lot of different servers to work together in a parallel construct to solve the problem when you present it." 在HPC服务背后,云提供商在其自己的数据中心中运行超级计算基础设施,尽管这不一定意味着当您听到“超级计算机”时你就会看到最先进的硬件。正如IBM OpenPOWER计算技术副总裁Dave Turek解释的那样,HPC服务的核心是“相互互连的服务器集合。您可以调用该虚拟计算基础设施,它能够在您提出问题时,使得许多不同的服务器并行工作来解决问题。” [][2] -Sounds simple in theory. But making it viable in practice required some chipping away at technical problems, according to Theo Lynn, Professor of Digital Business at Dublin City University. What differentiates ordinary computing from HPC is those interconnects – high-speed, low-latency, and expensive – so those needed to be brought to the world of cloud infrastructure. Storage performance and data transport also needed to be brought up to a level at least in the same ballpark as on-prem HPC before HPC services could be viable. -理论上听起来很简单。但都柏林城市大学数字业务教授西奥·林恩(Theo Lynn)表示,要使其在实践中可行,需要解决一些技术问题。普通计算与HPC的区别在于那些互连-高速的,低延时的而且昂贵的-因此需要将这些互连引入云基础设施领域。在HPC服务可行之前,至少需要将存储性能和数据传输也提升到与本地HPC相同的水平。 +理论听起来很简单。但都柏林城市大学数字业务教授西奥·林恩(Theo Lynn)表示,要使其在实践中可行,需要解决一些技术问题。普通计算与HPC的区别在于那些互连-高速的,低延时的而且昂贵的-因此需要将这些互连引入云基础设施领域。在HPC服务可行之前,至少需要将存储性能和数据传输也提升到与本地HPC相同的水平。 -But Lynn says that some of the innovations that have helped HPC services take off have been more institutional than technological. In particular, "we are now seeing more and more traditional HPC applications adopting cloud-friendly licensing models – a barrier to adoption in the past." 但是林恩说,一些制度创新相比技术更好的帮助了HPC服务的起飞。特别是,“我们现在看到越来越多的传统HPC应用采用云友好的许可模式-过去是采用这种模式的障碍。” -And the economics have also shifted the potential customer base, he says. "Cloud service providers have opened up the market more by targeting low-end HPC buyers who couldn’t afford the capex associated with traditional HPC and opening up the market to new users. As the markets open up, the hyperscale economic model becomes more and more feasible, costs start coming down." 他说,经济也改变了潜在的客户群。 “云服务提供商通过向那些负担不起传统HPC所需的投资成本的低端HPC买家开放,进一步开放了市场。随着市场的开放,超大规模经济模型变得越来越多,更可行,成本开始下降。” -Avoid on-premises CAPEX** 避免本地资本支出** +避免本地资本支出** ** -HPC services are attractive to private-sector customers in the same fields where traditional supercomputing has long held sway. These include sectors that rely heavily on complex mathematical modeling, including defense contractors like McCormick Stevenson, along with oil and gas companies, financial services firms, and biotech companies. Dublin City University's Lynn adds that loosely coupled workloads are a particularly good use case, which meant that many early adopters used it for 3D image rendering and related applications. HPC服务对有志于传统超级计算长期把持的领域的私营行业客户具有吸引力。这些客户包括严重依赖复杂数学模型的行业,包括麦考密克·史蒂文森(McCormick Stevenson)等国防承包商,以及油气公司,金融服务公司和生物技术公司。都柏林城市大学的Lynn补充说,松耦合的工作负载是一个特别好的用例,这意味着许多早期采用者将其用于3D图像渲染和相关应用。 -But when does it make sense to consider HPC services over on-premises HPC? For hhpberlin, a German company that simulates smoke propagation in and fire damage to structural components of buildings, the move came as it outgrew its current resources. 但是,何时考虑HPC服务而不是本地HPC才有意义?对于德国的模拟烟雾在建筑物中的蔓延和火灾对建筑物结构部件的破坏的hhpberlin公司来说,答案是在它超出了其现有资源时。 -"For several years, we had run our own small cluster with up to 80 processor cores," says Susanne Kilian, hhpberlin's scientific head of numerical simulation. "With the rise in application complexity, however, this constellation has increasingly proven to be inadequate; the available capacity was not always sufficient to handle projects promptly." Hpberlin公司数值模拟的科学负责人Susanne Kilian说:“几年来,我们一直在运行自己的小型集群,该集群具有多达80个处理器核。” “但是,随着应用复杂性的提高,这种架构(constellation)已经越来越不足以支撑;可用容量并不总是够快速地处理项目。” -But just spending money on a new cluster wasn't an ideal solution, she says: "In view of the size and administrative environment of our company, the necessity of constant maintenance of this cluster (regular software and hardware upgrades) turned out to be impractical. Plus, the number of required simulation projects is subject to significant fluctuations, such that the utilization of the cluster was not really predictable. Typically, phases with very intensive use alternate with phases with little to no use." By moving to an HPC service model, hhpberlin shed that excess capacity and the need to pay up front for upgrades. 她说:“但是,仅仅花钱买一个新的集群并不是一个理想的解决方案:鉴于我们公司的规模和管理环境,强制持续维护该集群(定期进行软件和硬件升级)是不现实的。另外,需要模拟的项目数量会出现很大的波动,因此集群的利用率并不是真正可预测的。通常,使用率很高的阶段与很少使用或不使用的阶段交替出现。”通过转换为HPC服务模式,hhpberlin释放了过剩的容量,并无需支付升级费用。 -IBM's Turek explains the calculus that different companies go through while assessing their needs. For a biosciences startup with 30 people, "you need computing, but you really can't afford to have 15% of your staff dedicated to it. It's just like you might also say you don't want to have on-staff legal representation, so you'll get that as a service as well." For a bigger company, though, it comes down to weighing the operational expense of an HPC service against the capacity expense of buying an in-house supercomputer or HPC cluster. IBM的Turek解释了不同公司在评估其需求时所经历的计算过程。对于拥有30名员工的生物科学初创公司来说,“您需要计算,但您实在负担不起15%的员工专门从事它。这就像您可能也说过,您不想拥有在职法律代表,因此您也可以通过服务获得它。”但是,对于一家较大的公司而言,最终归结为权衡HPC服务的运营费用与购买内部超级计算机或HPC集群的费用。 -So far, those are the same sorts of arguments you'd have over adopting any cloud service. But the opex vs. capex dilemma can be weighted towards the former by some of the specifics of the HPC market. Supercomputers aren't commodity hardware like storage or x86 servers; they're very expensive, and technological advances can swiftly render them obsolete. As McCormick Stevenson's Krawczyk puts it, "It's like buying a car: as soon as you drive off the lot it starts to depreciate." And for many companies –especially larger and less nimble ones – the process of buying a supercomputer can get hopelessly bogged down. "You're caught up in planning issues, building issues, construction issues, training issues, and then you have to execute an RFP," says IBM's Turek. "You have to work through the CIO. You have to work with your internal customers to make sure there's continuity of service. It's a very, very complex process and not something that a lot of institutions are really excellent at executing." -到目前为止,这些都是您采用任何云服务时都会遇到的类似的争论。但是,可以HPC市场的某些特点将使得衡量运营支出与资本支出时选择前者。超级计算机不是诸如存储或x86服务器之类的商用硬件;它们非常昂贵,技术进步很快会使其过时。正如麦考密克·史蒂文森(McCormick Stevenson)的克拉维奇(Krawczyk)所说,“这就像买车:只要车一开走,它就会开始贬值。”对于许多公司,尤其是规模较大,灵活性较差的公司,购买超级计算机的过程可能会陷入无望的泥潭。 IBM的Turek说:“您陷入了计划问题,建筑问题,施工问题,培训问题,然后必须执行RFP。” “您必须得到CIO的支持。您必须与内部客户合作以确保服务的连续性。这是一个非常非常复杂的过程,并没有很多机构有非常出色的执行力。” +到目前为止,这些都是您采用任何云服务时都会遇到的类似的争论。但是,可以HPC市场的某些特点将使得衡量运营支出与资本支出时选择前者。超级计算机不是诸如存储或x86服务器之类的商用硬件;它们非常昂贵,技术进步很快会使其过时。正如麦考密克·史蒂文森(McCormick Stevenson)的克拉维奇(Krawczyk)所说,“这就像买车:只要车一开走,它就会开始贬值。”对于许多公司,尤其是规模较大,灵活性较差的公司,购买超级计算机的过程可能会陷入无望的泥潭。 IBM的Turek说:“您陷入了计划问题,建筑问题,施工问题,培训问题,然后必须执行RFP。您必须得到CIO的支持。您必须与内部客户合作以确保服务的连续性。这是一个非常非常复杂的过程,并没有很多机构有非常出色的执行力。” -Once you choose to go down the services route for HPC, you'll find you get many of the advantages you expect from cloud services, particularly the ability to pay only for HPC power when you need it, which results in an efficient use of resources. Chirag Dekate, Senior Director and Analyst at Gartner, says bursty workloads, when you have short-term needs for high-performance computing, are a key use case driving adoption of HPC services. 一旦您选择了HPC服务的路线后,您会发现您会得到您期望从云服务中得到的许多好处,特别是仅在业务需要时才需付费的能力,从而可以带来资源的高效利用。 Gartner高级总监兼分析师Chirag Dekate表示,当您对高性能计算有短期需求时的突发性负载是推动选择HPC服务的关键用例。 -"In the manufacturing industry, you tend to have a high peak of HPC activity around the product design stage," he says. "But once the product is designed, HPC resources are less utilized during the rest of the product-development cycle." In contrast, he says, "when you have large, long-running jobs, the economics of the cloud wear down." -他说:“在制造业中,在产品设计阶段,HPC活动往往会达到很高的峰值。” “但是,一旦产品设计完成,在其余产品开发周期中,HPC资源的利用率就会降低。” 相比之下,他说:“当您拥有大量长期运行的工作时,云的经济就会逐渐减弱。” +他说:“在制造业中,在产品设计阶段,HPC活动往往会达到很高的峰值。但是,一旦产品设计完成,在其余产品开发周期中,HPC资源的利用率就会降低。” 相比之下,他说:“当您拥有大量长期运行的工作时,云的经济性就会逐渐减弱。” -With clever system design, you can integrate those HPC-services bursts of activity with your own in-house conventional computing. Teresa Tung, managing director in Accenture Labs, gives an example: "Accessing HPC via APIs makes it seamless to mix with traditional computing. A traditional AI pipeline might have its training done on a high-end supercomputer at the stage when the model is being developed, but then the resulting trained model that runs predictions over and over would be deployed on other services in the cloud or even devices at the edge." 通过巧妙的系统设计,您可以将这些HPC服务突发活动与您自己的内部常规计算集成在一起。 埃森哲(Accenture)实验室常务董事Teresa Tung举了一个例子:“通过API访问HPC可以无缝地与传统计算混合。在模型构建阶段,传统的AI流水线可能会在高端超级计算机上进行训练,但是最终经过反复按预期运行的训练好的模型将部署在云中的其他服务上,甚至部署在边缘设备上。” -### It's not for all use cases** 它并不适合所有的应用场景 +### 它并不适合所有的应用场景 ** ** -Use of HPC services lends itself to batch-processing and loosely-coupled use cases. That ties into a common HPC downside: data transfer issues. High-performance computing by its very nature often involves huge data sets, and sending all that information over the internet to a cloud service provider is no simple thing. "We have clients I talk to in the biotech industry who spend $10 million a month on just the data charges," says IBM's Turek. HPC服务适合批处理和松耦合的场景。这与HPC的普遍缺点有关:数据传输问题。高性能计算本身通常涉及庞大的数据集,而将所有这些信息通过Internet发送到云服务提供商并不容易。IBM的Turek说:“我们与生物技术行业的客户交流,他们每月仅在数据费用上就花费1000万美元。” -And money isn't the only potential problem. Building a workflow that makes use of your data can challenge you to work around the long times required for data transfer. "When we had our own HPC cluster, local access to the simulation results already produced – and thus an interactive interim evaluation — was of course possible at any time," says hhpberlin's Kilian. "We're currently working on being able to access and evaluate the data produced in the cloud even more efficiently and interactively at any desired time of the simulation without the need to download large amounts of simulation data." -钱并不是唯一的潜在问题。已制定的需要使用数据的工作流可能会使您在数据传输所需的时间内无法工作。hhpberlin的Kilian说:“当我们拥有自己的HPC集群时,当然可以随时访问已经产生的仿真结果,从而进行交互式的临时评估。” “我们目前正努力达到在仿真的任意时刻都可以更高效地,交互地访问和评估云中生成的数据,而无需下载大量的模拟数据。” +钱并不是唯一的潜在问题。已制定的需要使用数据的工作流可能会使您在数据传输所需的时间内无法工作。hhpberlin的Kilian说:“当我们拥有自己的HPC集群时,当然可以随时访问已经产生的仿真结果,从而进行交互式的临时评估。我们目前正努力达到在仿真的任意时刻都可以更高效地,交互地访问和评估云中生成的数据,而无需下载大量的模拟数据。” -Mike Krawczyk cites another stumbling block: compliance issues. Any service a defense contractor uses needs to be complaint with the International Traffic in Arms Regulations (ITAR), and McCormick Stevenson went with Rescale in part because it was the only vendor they found that checked that box. While more do today, any company looking to use cloud services should be aware of the legal and data-protection issues involved in living on someone else's infrastructure, and the sensitive nature of many of HPC's use cases makes this doubly true for HPC as a service. Mike Krawczyk提到了另一个绊脚石:合规性问题。国防承包商使用的任何服务都需要遵从(原文是complaint, 应该是笔误)《国际武器交易条例》(ITAR),麦考密克·史蒂文森(McCormick Stevenson)之所以选择Rescale,部分原因是因为这是他们发现的唯一符合的供应商。如今,尽管有更多的公司(使用云服务),但任何希望使用云服务的公司都应该意识到使用其他人的基础设施时所涉及的法律和数据保护问题,而且许多HPC场景的敏感性使得更HPC即服务的这个问题更加突出。 -In addition, the IT governance that HPC services require goes beyond regulatory needs. For instance, you'll need to keep track of whether your software licenses permit cloud use ­– especially with specialized software packages written to run on an on-premises HPC cluster. And in general, you need to keep track of how you use HPC services, which can be a tempting resource, especially if you've transitioned from in-house systems where staff was used to having idle HPC capabilities available. For instance, Ron Gilpin, senior director and Azure Platform Services global lead at Avanade, suggests dialing back how many processing cores you use for tasks that aren't time sensitive. "If a job only needs to be completed in an hour instead of ten minutes," he says, "that might use 165 processors instead of 1,000, a savings of thousands of dollars." 此外,HPC服务所需的IT治理超出了目前的监管范围。例如,您需要跟踪您的软件许可证是否允许云使用­ –尤其是专门为本地HPC群集上运行而编写的软件包。通常,您需要跟踪HPC服务的使用方式,它可能是一个诱人的资源,尤其是当您从员工习惯的内部系统过渡到有可用的空闲的HPC能力时。例如,Avanade全球平台高级主管兼Azure平台服务全球负责人Ron Gilpin建议,回调您用于时间不敏感任务的处理核心数量。他说:“如果一项工作只需要用一小时来完成而不需要在十分钟内就完成,那么它可以使用165个处理器而不是1,000个,从而节省了数千美元。” -### A premium on HPC skills** 独特的HPC技能 +### 独特的HPC技能** ** -One of the biggest barriers to HPC adoption has always been the unique in-house skills it requires, and HPC services don't magically make that barrier vanish. "Many CIOs have migrated a lot of their workloads into the cloud and they have seen cost savings and increased agility and efficiency, and believe that they can achieve similar results in HPC ecosystems," says Gartner's Dekate. "And a common misperception is that they can somehow optimize human resource cost by essentially moving away from system admins and hiring new cloud experts who can solve their HPC workloads." -一直以来,采用HPC的最大障碍之一就是其所需的独特的内部技能,而HPC服务并不能使这种障碍消失。Gartner的Dekate表示:“许多CIO将许多工作负载迁移到了云上,他们看到了成本的节约,敏捷性和效率的提升,因此相信在HPC生态中也可以达成类似的效果。” “一个普遍的误解是,他们可以通过彻底地免去系统管理员,并聘用能解决其HPC工作负载的新的云专家,从而以某种方式优化人力成本。” +一直以来,采用HPC的最大障碍之一就是其所需的独特的内部技能,而HPC服务并不能使这种障碍消失。Gartner的Dekate表示:“许多CIO将许多工作负载迁移到了云上,他们看到了成本的节约,敏捷性和效率的提升,因此相信在HPC生态中也可以达成类似的效果。一个普遍的误解是,他们可以通过彻底地免去系统管理员,并聘用能解决其HPC工作负载的新的云专家,从而以某种方式优化人力成本。” -"But HPC is not one of the main enterprise environments," he says. "You're dealing with high-end compute nodes interconnected with high-bandwidth, low-latency networking stacks, along with incredibly complicated application and middleware stacks. Even the filesystem layers in many cases are unique to HPC environments. Not having the right skills can be destabilizing." -“但是HPC并不是主流的企业环境之一。” 他说。“您正在处理通过高带宽,低延迟的网络互联的高端计算节点,以及相当复杂的应用和中间件技术栈。许多情况下,甚至连文件系统层也是HPC环境所独有的。没有对应的技能可能会破坏稳定性。” +“但是HPC并不是一个主流的企业环境。” 他说。“您正在处理通过高带宽,低延迟的网络互联的高端计算节点,以及相当复杂的应用和中间件技术栈。许多情况下,甚至连文件系统层也是HPC环境所独有的。没有对应的技能可能会破坏稳定性。” -But supercomputing skills are in shortening supply, something Dekate refers to as the workforce "greying," in the wake of a generation of developers going to splashy startups rather than academia or the more staid firms where HPC is in use. As a result, vendors of HPC services are doing what they can to bridge the gap. IBM's Turek says that many HPC vets will always want to roll their own exquisitely fine-tuned code and will need specialized debuggers and other tools to help them do that for the cloud. But even HPC newbies can make calls to code libraries built by vendors to exploit supercomputing's parallel processing. And third-party software providers sell turnkey software packages that abstract away much of HPC's complication. 但是超级计算技能的供给却在减少,Dekate将其称为劳动力“灰化”,这是因为一代开发人员将目光投向了新兴的初创公司,而不是学术界或使用HPC的更老套的公司。因此,HPC服务供应商正在尽其所能地弥补差距。 IBM的Turek表示,许多HPC老手将总是想运行他们自己精心调整过的代码,将需要专门的调试器和其他工具来帮助他们在云上实现这一目标。但是,即使是HPC新手也可以调用供应商构建的代码库,以利用超级计算的并行处理能力。第三方软件提供商出售的交钥匙软件包可以减少HPC的许多复杂性。 -Accenture's Tung says the sector needs to lean further into this in order to truly prosper. "HPCaaS has created dramatically impactful new capability, but what needs to happen is making this easy to apply for the data scientist, the enterprise architect, or the software developer," she says. "This includes easy to use APIs, documentation, and sample code. It includes user support to answer questions. It’s not enough to provide an API; that API needs to be fit-for-purpose. For a data scientist this should likely be in Python and easily change out for the frameworks she is already using. The value comes from enabling these users who ultimately will have their jobs improved through new efficiencies and performance, if only they can access the new capabilities." If vendors can pull that off, HPC services might truly bring supercomputing to the masses. 埃森哲的Tung表示,该行业需要进一步加大投入才能真正繁荣。她说:“HPCaaS已经创建了具有重大影响力的新功能,但还需要做的是使它易于被数据科学家,企业架构师或软件开发人员使用。这包括易用的API,文档和示例代码。它包括用户支持来解答问题。仅仅提供API是不够的,API需要适合特定的用途。对于数据科学家而言,这可能是以python形式提供,并容易更换她已经在使用的框架。其价值来自使这些用户最综只有在使用新功能时才能够改进效率和性能。” 如果供应商能够做到这一点,那么HPC服务才能真正将超级计算带给大众。 -Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. 加入[Facebook][3]和[LinkedIn][4]上的Network World社区,探讨最前沿的话题。 -------------------------------------------------------------------------------- From f087cd01bb522381699f6168319653c51b3983f3 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Sat, 2 May 2020 10:17:29 +0800 Subject: [PATCH 0560/1809] Done --- ...e ins and outs of high-performance computing as a service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {sources => translated}/talk/20200401 The ins and outs of high-performance computing as a service.md (97%) diff --git a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md b/translated/talk/20200401 The ins and outs of high-performance computing as a service.md similarity index 97% rename from sources/talk/20200401 The ins and outs of high-performance computing as a service.md rename to translated/talk/20200401 The ins and outs of high-performance computing as a service.md index df2c6debd3..948d985765 100644 --- a/sources/talk/20200401 The ins and outs of high-performance computing as a service.md +++ b/translated/talk/20200401 The ins and outs of high-performance computing as a service.md @@ -17,7 +17,7 @@ 几年前的一天,它出乎意料地超出了计算极限。 [世界上最快的10个超级计算机][1] -麦考密克·史蒂文森(McCormick Stevenson)的首席工程师迈克·克劳奇奇(Mike Krawczyk)说:“我们的一些工作会使办公室的计算机不堪重负。” “购买机器并安装软件在经济上或计划上都不划算。” 相反,该公司与Rescale签约,从其购买在超级计算机系统上运行的周期(cycles),而这只花费了他们购买新硬件上所需的一小部分。 +麦考密克·史蒂文森(McCormick Stevenson)的首席工程师迈克·克劳奇奇(Mike Krawczyk)说:“我们的一些工作会使办公室的计算机不堪重负。购买机器并安装软件在经济上或计划上都不划算。” 相反,该公司与Rescale签约,从其购买在超级计算机系统上运行的周期(cycles),而这只花费了他们购买新硬件上所需的一小部分。 麦考密克·史蒂文森(McCormick Stevenson)已成为被称为超级计算即服务或高性能计算(HPC)即服务(两个紧密相关的术语)市场的早期采用者之一。根据国家计算科学研究所(的定义),HPC是超级计算机在计算复杂问题上的应用,而超级计算机是处理能力最先进的那些计算机。 From 1eed92f4ad672398553c5375dba27f35e63d39d5 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Sat, 2 May 2020 11:48:40 +0800 Subject: [PATCH 0561/1809] TSL 20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode --- ...OS-RHEL 7-8 Systems in Single User Mode.md | 159 ------------------ ...OS-RHEL 7-8 Systems in Single User Mode.md | 159 ++++++++++++++++++ 2 files changed, 159 insertions(+), 159 deletions(-) delete mode 100644 sources/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md create mode 100644 translated/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md diff --git a/sources/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md b/sources/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md deleted file mode 100644 index 5e2fb84c2b..0000000000 --- a/sources/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md +++ /dev/null @@ -1,159 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Three Methods Boot CentOS/RHEL 7/8 Systems in Single User Mode) -[#]: via: (https://www.2daygeek.com/boot-centos-7-8-rhel-7-8-single-user-mode/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -Three Methods Boot CentOS/RHEL 7/8 Systems in Single User Mode -====== - -Single user mode, also referred to as maintenance mode, which allows a single super user to recover/repair system problems. - -Generally, these problems cannot be solved in a multi-user environment. The system can boot but will not function properly or you will not be able to log in. - -It uses `runlevel1.target` or `rescue.target` on **[Red Hat][1]** (RHEL) 7/8 based systems. - -In this mode, the system mount all local file systems, but does not activate network interfaces. - -It only enables certain services and minimal functionality to repair the system. - -This method is mostly useful when you want to run fsck to fix corrupted file systems, or to reset a forgotten root password, or to fix a mount point issue on the system. - -You can boot **[CentOS][2]**/**[RHEL][3]** 7/8 systems in single user mode using the below three methods. - - * **Method-1:** Boot CentOS/RHEL 7/8 systems in single user mode by adding the “rd.break” parameter to the kernel - * **Method-2:** Boot CentOS/RHEL 7/8 systems in single user mode by replacing the “rhgb quiet” word with the “init=/bin/bash or init=/bin/sh” parameter in the kernel - * **Method-3:** Boot CentOS/RHEL 7/8 systems in single user mode by replacing the “ro” word with the “rw init=/sysroot/bin/sh” parameter in the kernel - - - -### Method-1: Boot CentOS/RHEL 7/8 systems in single user mode by adding the “rd.break” parameter to the kernel - -Reboot your system, on the GRUB2 boot screen, press the `"e"` key to edit the selected kernel. You need to select the first line, the first one is the latest kernel whereas you can select the different one if you would like to boot your system with the older kernel. - -![][4] - -Depending on your RHEL/CentOS version, find the word **“linux16”** or **“linux”**, press the “End” button on the keyboard, go to the end of the line, and add the keyword **“rd.break”** as shown below in the screenshot, then press **“Ctrl+x”** or **“F10”** to boot into single-user mode. - -You need to find the word **`linux16`** for RHEL/CentOS 7 systems, while **`linux`** for RHEL/CentOS 8 systems. - -![][4] - -This change mount your root file system into **“read only (RO)”** mode. You can check this by running the command below. Also, the output below clearly shows that you are in **“Emergency Mode”**. - -``` -# mount | grep root -``` - -![][4] - -To make changes to the **“sysroot”** file system you need to remount it with READ and WRITE (RW) mode. - -``` -# mount -o remount,rw /sysroot -``` - -Run the below command to change the environment, commonly known as “jailed directory” or “chroot jail”. - -``` -# chroot /sysroot -``` - -![][4] - -Now, single-user mode is completely ready for use. Once you have fixed your problem to exit single user mode, perform the following steps. - -CentOS/RHEL 7/8 uses SELinux by default, so create the following hidden file, which will automatically perform a relabel of all files on next boot. - -``` -# touch /.autorelabel -``` - -Finally, run the below command to restart the system. Alternatively, type “exit” command twice to restart your system. - -``` -# reboot -f -``` - -### Method-2: Boot CentOS/RHEL 7/8 systems in single user mode by replacing the “rhgb quiet” word with the “init=/bin/bash or init=/bin/sh” parameters in the kernel - -Reboot your system, on the GRUB2 boot screen, press the `"e"` key to edit the selected kernel parameters. - -![][4] - -Find the word **“rhgb quiet”** and replace it with **“init=/bin/bash”** or **“init=/bin/sh”**, then press **“Ctrl+x”** or **“F10”** to boot in single user mode. - -Screenshot for **`init=/bin/bash`**. - -![][4] - -Screenshot for **`init=/bin/sh`**. - -![][4] - -By default, this will mount your “/” partition in read-only (RO) mode, so you will need to remount the “/” file system with READ and WRITE (RW) mode to make changes. - -``` -# mount -o remount,rw / -``` - -![][4] - -You can now perform any task that you want. When you are done, run the following command to enable SELinux relabeling on reboot. - -``` -# touch /.autorelabel -``` - -Finally reboot the system. - -``` -# exec /sbin/init 6 -``` - -### Method-3: Boot CentOS/RHEL 7/8 systems in single user mode by replacing the “ro” word with the “rw init=/sysroot/bin/sh” parameter in the kernel - -To interrupt the automatic boot, reboot your system and press any key on the GRUB2 splash screen. - -This will display the list of kernels available on your system and select the latest kernel and press the **`"e"`** key to edit the selected kernel parameters. - -Find the line that starts with the word **“linux”** or **“linux16”** and replace **“ro”** with **“rw init=/sysroot/bin/sh”**. When finished, press **“Ctrl+x”** or **“F10”** to boot in single user mode. - -Change the environment to “chroot jail” by running the below command. - -``` -# chroot /sysroot -``` - -Make any necessary changes to the system. Once done, run the below command to enable SELinux relabeling on reboot. - -``` -# touch /.autorelabel -``` - -Finally reboot the system. - -``` -# reboot -f -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/boot-centos-7-8-rhel-7-8-single-user-mode/ - -作者:[Magesh Maruthamuthu][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.2daygeek.com/author/magesh/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/category/red-hat/ -[2]: https://www.2daygeek.com/category/centos/ -[3]: https://www.2daygeek.com/category/rhel/ -[4]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 diff --git a/translated/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md b/translated/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md new file mode 100644 index 0000000000..c5eaa1dc84 --- /dev/null +++ b/translated/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md @@ -0,0 +1,159 @@ +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Three Methods Boot CentOS/RHEL 7/8 Systems in Single User Mode) +[#]: via: (https://www.2daygeek.com/boot-centos-7-8-rhel-7-8-single-user-mode/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +在单用户模式下启动 CentOS/RHEL 7/8 的三种方法 +====== + +单用户模式,也被称为维护模式,超级用户可以在此模式下恢复/修复系统问题。 + +通常情况下,这些问题在多用户环境中修复不了。系统可以启动但功能不能正常运行或者你登录不了系统。 + +在基于 **[Red Hat][1]** (RHEL) 7/8 的系统中,使用 `runlevel1.target` 或 `rescue.target` 来实现。 + +在此模式下,系统会挂载所有的本地文件系统,但不开启网络接口。 + +系统仅启动特定的几个服务和修复系统必要的尽可能少的功能。 + +当你想运行文件系统一致性检查来修复损坏的文件系统,或忘记 root 密码后重置密码,或修复系统上的一个挂载点问题时,这个方法会很有用。 + +你可以用下面三种方法以单用户模式启动 **[CentOS][2]**/**[RHEL][3]** 7/8 系统。 + + * **方法 1:** 通过向内核添加 “rd.break” 参数来以单用户模式启动 CentOS/RHEL 7/8 系统 + * **方法 2:** 通过用 “init=/bin/bash“ 或 ”init=/bin/sh” 替换内核中的 “rhgb quiet” 语句来以单用户模式启动 CentOS/RHEL 7/8 系统 + * **方法 3:** 通过用 “rw init=/sysroot/bin/sh” 参数替换内核中的 “ro” 语句以单用户模式启动 CentOS/RHEL 7/8 系统 + + + +### 方法 1: 通过向内核添加 “rd.break” 参数来以单用户模式启动 CentOS/RHEL 7/8 系统 + +重启你的系统,在 GRUB2 启动界面,按下 `e` 键来编辑选中的内核。你需要选中第一行,第一个是最新的内核,然而如果你想用旧的内核启动系统你也可以选择其他的行。 + +![][4] + +根据你的 RHEL/CentOS 版本,找到 **“linux16”** 或 **“linux”** 语句,按下键盘上的 ”End“ 按钮,跳到行末,像下面截图中展示的那样添加关键词 **“rd.break”**,按下 **“Ctrl+x”** 或 **“F10”** 来进入单用户模式。 + +如果你的系统是 RHEL/CentOS 7,你需要找 **`linux16`**,如果你的系统是 RHEL/CentOS 8,那么你需要找 **`linux`**。 + +![][4] + +这个修改会让你的 root 文件系统以 **“只读 (RO)”** 模式挂载。你可以用下面的命令来验证下。下面的输出也明确地告诉你当前是在 **“紧急模式”**。 + +``` +# mount | grep root +``` + +![][4] + +为了修改 **“sysroot”** 文件系统,你需要用 RW 模式重新挂载它。 + +``` +# mount -o remount,rw /sysroot +``` + +运行下面的命令修改环境,这就是大家熟知的 “jailed directory” 或 “chroot jail”。 + +``` +# chroot /sysroot +``` + +![][4] + +现在,单用户模式的前期准备已经完成了。当你修复了你的问题要退出单用户模式时,执行下面的步骤。 + +CentOS/RHEL 7/8 默认使用 SELinux,因此创建下面的隐藏文件,这个文件会在下一次启动时重新确认所有文件。 + +``` +# touch /.autorelabel +``` + +最后,用下面的命令重启系统。你也可以输入两次 “exit” 命令来重启你的系统。 + +``` +# reboot -f +``` + +### 方法 2: 通过用 “init=/bin/bash“ 或 ”init=/bin/sh” 替换内核中的 “rhgb quiet” 语句来以单用户模式启动 CentOS/RHEL 7/8 系统 + +重启你的系统,在 GRUB2 启动界面,按下 `e` 键来编辑选中的内核。 + +![][4] + +找到语句 **“rhgb quiet”**,用 **“init=/bin/bash”** 或 **“init=/bin/sh”** 替换它,然后按下 **“Ctrl+x”** 或 **“F10”** 来进入单用户模式。 + +**`init=/bin/bash`** 的截图。 + +![][4] + +**`init=/bin/sh`** 的截图。 + +![][4] + +默认情况下,上面的操作会以只读(RO)模式挂载你的 “/” 分区,因此你需要以读写(RW)模式重新挂载 “/” 文件系统,这样才能修改它。 + +``` +# mount -o remount,rw / +``` + +![][4] + +现在你可以执行你的任务了。当结束时,执行下面的命令来开启重启时的 SELinux 重新确认。 + +``` +# touch /.autorelabel +``` + +最后,重启系统。 + +``` +# exec /sbin/init 6 +``` + +### 方法 3: 通过用 “rw init=/sysroot/bin/sh” 参数替换内核中的 “ro” 语句以单用户模式启动 CentOS/RHEL 7/8 系统 + +为了中断自动启动的过程,重启你的系统并在 GRUB2 启动界面按下任意键。 + +现在会展示你系统上所有可用的内核,选择最新的内核,按下 `e` 键来编辑选中的内核参数。 + +找到以 **“linux”** 或 **“linux16”** 开头的语句,用 **“rw init=/sysroot/bin/sh”** 替换 **“ro”**。替换完后按下 **“Ctrl+x”** 或 **“F10”** 来进入单用户模式。 + +运行下面的命令把环境切换为 “chroot jail”。 + +``` +# chroot /sysroot +``` + +如果需要,做出必要的修改。修改完后,执行下面的命令来开启重启时的 SELinux 重新确认。 + +``` +# touch /.autorelabel +``` + +最后,重启系统。 + +``` +# reboot -f +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/boot-centos-7-8-rhel-7-8-single-user-mode/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/category/red-hat/ +[2]: https://www.2daygeek.com/category/centos/ +[3]: https://www.2daygeek.com/category/rhel/ +[4]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 From 4595af0d9587cfd3a9b133598a0dbb66ce1c54d1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 May 2020 12:49:09 +0800 Subject: [PATCH 0562/1809] APL --- ...04 Review- Best Ubuntu-based Distribution Just Got Better.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md b/sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md index 760307eeb1..acba85fe58 100644 --- a/sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md +++ b/sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 841f19a2d63a81b2bc303fb896b6cdeeab5bc8d3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 May 2020 20:14:02 +0800 Subject: [PATCH 0563/1809] TSL&PRF --- ...untu-based Distribution Just Got Better.md | 168 +++++++++--------- 1 file changed, 82 insertions(+), 86 deletions(-) diff --git a/sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md b/sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md index acba85fe58..1760e313d1 100644 --- a/sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md +++ b/sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md @@ -7,188 +7,184 @@ [#]: via: (https://itsfoss.com/pop-os-20-04-review/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -Pop OS 20.04 Review: Best Ubuntu-based Distribution Just Got Better +Pop!_OS 20.04 点评:最好的基于 Ubuntu 的发行版越来越好了 ====== -_**Brief: Pop OS 20.04 is an impressive Linux distribution based on Ubuntu. I review the major new features in this review and share my experience with the latest release.**_ +> Pop!_OS 20.04 是一款令人印象深刻的基于 Ubuntu 的 Linux 发行版。我在这篇评论中回顾了其主要的新功能,并分享了我对最新版本的体验。 -Now that Ubuntu 20.04 LTS and its official flavours are here – it’s time to take a look at one of best Ubuntu-based distro i.e Pop!_OS 20.04 by [System76][1]. +现在,Ubuntu 20.04 LTS 及其官方变体版本已经发布了 - 是时候看看 [System76][1] 的 Pop!_OS 20.04 了,这是基于 Ubuntu 的最好的发行版之一。 -To be honest, Pop!_OS is my favorite Linux distro that I primarily use for everything I do. +老实说,Pop!_OS 是我最喜欢的 Linux 发行版,主要用于我做的所有事情。 -Now that Pop!_OS 20.04 has finally arrived. It’s time to take a look at what it offers and whether you should upgrade or not? +现在,Pop!_OS 20.04 终于来了。是时候来看看它提供了哪些功能,以及你是否应该升级? -### What’s New In Pop!_OS 20.04 LTS? +### Pop!_OS 20.04 LTS 中有什么新东西? ![][2] -Visually, Pop!_OS 20.04 LTS isn’t really very different from Pop!_OS 19.10. However, you can find several new features and improvements. +从视觉上看,Pop!\_OS 20.04 LTS 与 Pop!\_OS 19.10 并没有太大的区别。然而,你可以发现几个新功能和改进。 -But, if you were using **Pop!_OS 18.04 LTS**, you have a lot of things to try. +但是,如果你之前使用的是 Pop!_OS 18.04 LTS,则可以发现有很多东西可以尝试。 -With [GNOME 3.36][3] onboard along with some newly added features, Pop!_OS 20.04 is an exciting release. +随着 [GNOME 3.36][3] 的到来,及其带来的一些新功能,Pop!_OS 20.04 成为了一个令人激动的版本。 -Overall, to give you an overview here are some key highlights: +总的来说,以下是一些主要的亮点。 - * Automatic Window Tiling - * New Application Switcher and Launcher - * Flatpack support added in Pop!_Shop + * 自动窗口平铺 + * 新的应用程序切换器和启动器 + * 在 Pop!_Shop 中增加了对 Flatpack 的支持。 * GNOME 3.36 - * Linux Kernel 5.4 - * Improved hybrid graphics support + * Linux 内核 5.4 + * 改进的混合图形支持 +虽然听起来很有趣,但我们还是来了解一下详细的变化,以及到目前为止 Pop!_OS 20.04 的体验如何。 +#### Pop!_OS 20.04 中的用户体验提升 -While this sounds fun, let us take a look at a detailed look on what has changed and how’s the experience of Pop!_OS 20.04 so far. +毫无疑问,很多 Linux 发行版都提供了开箱即用的用户体验。同样的,[Ubuntu 20.04 LTS 也有一流的改进和功能][4]。 -### User Experience Improvements in Pop OS 20.04 +而对于 System76 的 Pop!_OS,他们总是试图更进一步。并且,大多数新功能旨在通过提供有用的功能来改善用户体验。 -Undoubtedly, a lot of Linux distros offer a pleasant user experience out of the box. Likewise, [Ubuntu 20.04 LTS has had top-notch improvements and features][4] as well. +在这里,我将介绍一些改进,其中包括 [GNOME 3.36][3] 和 Pop!_OS 特有的一些功能。 -And, when it comes to Pop!_OS by System 76, they always try to go a mile further. And, the majority of new features aim to improve the user experience by providing useful functionalities. +#### 支持系统托盘图标 -Here, I’m going to take a look at some of the improvements that include [GNOME 3.36][3] and Pop!_OS-specific features. - -#### Support For System Tray Icons - -Finally! This may not be a big change – but Pop!_OS did not have the support for system tray icons (or applet icons). +总算是有了!这可能不是什么大的改变 —— 但 Pop!_OS 以前没有支持系统托盘图标(或小程序图标)。 ![][5] -With 20.04 LTS release, it’s here by default. No need of any extension. +随着 20.04 LTS 的发布,默认情况就有了系统托盘,不需要任何扩展。 -There may not be a whole lot of programs depending on system tray icons – but it is still something important to have. +依靠系统托盘图标的程序可能并不多 —— 但它仍然是重要的东西。 -In my case, I wasn’t able to use [ActivityWatch][6] on Pop!_OS 19.10 – but now I can. +就我而言,我以前无法在 Pop!_OS 19.10 上使用 [ActivityWatch][6] —— 但现在可以了。 -#### Automatic Window Tiling +#### 自动窗口平铺 ![][7] -**Automatic Window Tiling** is something I always wanted to try – but never invested any time to set it up using a [tiling window manager][8] like [i3][9], not even with [Regolith Desktop][10]. +自动窗口平铺是我一直想尝试的东西 —— 但从来没花时间使用过 [i3][9] 这样的[平铺窗口管理器][8]来设置它,更别说是 [Regolith 桌面][10]了。 -With Pop!_OS 20.04, you don’t need to do that anyway. The automatic window tiling feature comes baked in without needing you to set it up. +在 Pop!_OS 20.04 中,你就不需要这样做了。自动窗口平铺功能已经内置,无需设置。 -It also features an option to **Show Active Hint** i.e it will highlight the active window to avoid confusion. And, you can also adjust the gap between the windows. +它还提供了“显示活动提示”的选项,也就是说,它将高亮显示活动窗口以避免混淆。而且,你还可以调整窗口之间的间隙。 ![][11] -You can see it in action in their official video: +你可以在他们的官方视频中看到它是如何工作的: -[Subscribe to our YouTube channel for more Linux videos][12] +- [System76 Pop!_OS 20.04 - Auto Tiling](https://youtu.be/-fltwBKsMY0) -And, I must say that it is one of the biggest additions on Pop!_OS 20.04 that could potentially help you multi-task more efficiently. +而且,我得说,这是 Pop!_OS 20.04 上最大的新增功能之一,有可能帮助你更有效地进行多任务处理。 -Even though the feature comes in handy everytime you use it. To make the most out of it, a display screen bigger than 21-inches (at least) should be the best way to go! And, for this reason – I’m really tempted to upgrade my monitor as well! +即使每次使用该功能都很方便,但为了最大程度地利用它,最好是使用一个大于 21 英寸的显示屏(至少)! 而且,因为这个原因 —— 我真的很想把我的显示器也升级一下! -#### New Extensions App +#### 新的扩展应用 ![][13] -Pop!_OS comes baked in with some unique GNOME extensions. But, you don’t need GNOME Tweaks the manage the extension anymore. +Pop!_OS 内置了一些独特的 GNOME 扩展。但是,你不需要用 GNOME Tweaks 来管理扩展。 -The newly added **Extensions** app lets you configure and manage the extensions on Pop!_OS 20.04. +新增加的 “Extensions” 应用可以让你在 Pop!_OS 20.04 上配置和管理扩展程序。 -#### Improved Notification Center +#### 改进的通知中心 ![][14] -With the new GNOME 3.36 release, the notification center includes a revamped look. Here, I have the dark mode enabled. +在新的 GNOME 3.36 中,通知中心的外观经过了改进。这里,我启用了黑暗模式。 -#### New Application Switcher & Launcher +#### 新的应用程序切换器 & 启动器 ![][15] -You can still **ALT+TAB** or **Super key + TAB** to go through the running applications. +你仍然可以用 `ALT+TAB` 或 `Super+TAB` 来浏览正在运行的应用程序。 -But, that’s time-consuming when you have a lot of things going on. So, on Pop!_OS 20.04, you get an application switcher and launcher which you can activate using **Super key + /** +但是,当你有很多事情要做的时候,这很耗时。所以,在 Pop!_OS 20.04上,你可以使用 `Super+ /` 激活应用程序切换器和启动器。 -Once you get used to the keyboard shortcut, it will be very convenient thing to have. +一旦你习惯了这个快捷键,它将是非常方便的东西。 -In addition to this, you may find numerous other subtle improvements visually with the icons/windows on Pop!_OS 20.04. +除此以外,你可能会发现 Pop!_OS 20.04 上的图标/窗口在视觉上有许多其它细微的改进。 -#### New Login Screen +#### 新的登录界面 -Well, with GNOME 3.36, it’s an obvious change. But, it does look good! +嗯,这是 GNOME 3.36 带来的一个明显的变化。但是,它看起来确实很不错! ![][16] -### Flatpak Support on Pop!_Shop +#### Pop!_Shop 支持 Flatpak -Normally, Pop!_Shop is already something useful with a huge repository along with [Pop!_OS’s own repositories.][17] +通常,Pop!_Shop 已经是一个非常有用的东西了,包括它自有的在内,它带有一个巨大的软件仓库。 -Now, with Pop!_OS 20.04, you can choose to install either Flatpak (via Flathub) or the Debian package of any available software on Pop!_Shop. Of course, only if a Flatpak package exists for the particular software. +现在,在 Pop!\_OS 20.04 中,你可以用 Pop!_Shop 安装任何可用软件的 Debian 包或 Flatpak(通过 Flathub) —— 当然,前提是某个软件有 Flatpak 软件包。 -You might want to check [how to use Flatpak on Linux][18] if you don’t have Pop!_OS 20.04. +如果你没有使用 Pop!_OS 20.04,你可能要看看[如何在 Linux 上使用 Flatpak][18]。 ![][19] -Personally, I’m not a fan of Flatpak but some applications like GIMP requires you to install the Flatpak package to get the latest version. So, it is definitely a good thing to have the support for Flatpak on Pop!_Shop baked right into it. +就我个人而言,我并不是 Flatpak 的粉丝,但有些应用如 GIMP 需要你安装 Flatpak 包才能获得最新版本。所以,在 Pop!_Shop 上直接支持了 Flatpak 绝对是一件好事。 -### Keyboard Shortcut Changes +#### 键盘快捷键更改 -This can be annoying if you’re comfortable with the existing keyboard shortcuts on Pop!_OS 19.10 or older. +如果你习惯了 Pop!_OS 19.10 或更早的版本上现有的键盘快捷键,这可能会让你很烦。 -In either case, there are a few important keyboard shortcut changes to potentially improve your experience, here they are: +不管是哪种情况,有几个重要的键盘快捷键变化可能会改善你的体验,如下: - * Lock Screen: **Super + L** _changed to_ **Super + Escape** - * Move Workspace: **Super + Up/Down Arrow** _changed to_ **Super + CTRL + Up/Down Arrow** - * Close Window: **Super + W** _changed_ to **Super + Q** - * Toggle Maximize: **Super + Up Arrow** _changed to_ **Super + M** + * 锁定屏幕:`Super + L` 改为 `Super + Escape`。 + * 移动工作区:`Super + 上/下箭头键` 改为 `Super + CTRL + 上/下箭头键`。 + * 关闭窗口:`Super + W` 变更为 `Super + Q`。 + * 切换最大化:`Super +向上箭头` 改为 `Super + M`。 +#### Linux 内核 5.4 +与其他大多数最新的 Linux 发行版相似,Pop!_OS 20.04 搭载了 [Linux 内核 5.4][20]。 -### Linux Kernel 5.4 +所以,很明显,你可以期望获得对 [exFAT 支持][21]、改进的 AMD 图形兼容性以及它附带所有其他功能。 -Similar to most of the other latest Linux distros, Pop!_OS 20.04 comes loaded with [Linux Kernel 5.4][20]. +#### 性能提升 -So, obviously, you can expect the [exFAT support][21] and an improved AMD graphics compatibility along with all the other features that come with it. +尽管 Pop!_OS 并不称自己是轻量级的 Linux 发行版,但它仍然是一个资源节约型的发行版。而且,有了 GNOME 3.36 的支持,它的速度应该足够快了。 -### Performance Improvements - -Even though Pop!_OS doesn’t pitch itself as a lightweight Linux distro, it is still a resource-efficient distro. And, with GNOME 3.36 onboard, it should be fast enough. - -Considering that I’ve been using Pop!_OS as my primary distro for about a year, I’ve never had any performance issues. And, this is how the resource usage will probably look like (depending on your system configuration) after you install Pop!_OS 20.04. +考虑到我已经将 Pop!\_OS 作为主要发行版使用已经一年多了,我从来没有遇到过性能问题。这就是你安装了 Pop!_OS 20.04 之后的资源使用情况(取决于你的系统配置)。 ![][22] -To give you an idea, my desktop configuration involves an i5-7400 processor, 16 GB RAM (2400 MHz), NVIDIA GTX 1050ti graphics card, and an SSD. +给你一个作为参考,我的台式机配置包括 i5-7400 处理器、16GB 内存(2400MHz)、NVIDIA GTX 1050ti 显卡和 SSD。 -I’m not really a fan of system benchmarks because it does not really give you the idea of how a specific application or a game would perform unless you try it. +我不是一个系统基准测试的忠实拥护者,因为除非你去尝试,否则它并不能让你知道特定的应用或游戏的性能。 -You can try the [Phoronix Test Suite][23] to analyze how your system performs. But, Pop!_OS 20.04 LTSshould be a snappy experience! +你可以试试 [Phoronix 测试套件][23]来分析你的系统表现。但是,Pop!_OS 20.04 LTS 应该是一个很爽快的体验! -### Package Updates & Other Improvements +#### 软件包更新 & 其他改进 -While every Ubuntu-based distro benefits from the [improvements in Ubuntu 20.04 LTS][4], there are some Pop OS specific bug fixes and improvements as well. +尽管每个基于Ubuntu的发行版都受益于Ubuntu 20.04 LTS的改进,但也有一些 Pop!_OS 特有的错误修复和改进。 -In addition to it, some major apps/packages like **Firefox 75.0** have been updated to their latest version. +除此之外,一些主要的应用程序/包(如 Firefox 75.0)也已经更新到了最新版本。 -As of now, there should be no critical bugs present and at least none for me. +到现在为止,应该没有任何严重的错误,至少对我来说没有。 -You can check out their [development progress on GitHub][24] to check the details of issues they’ve already fixed during the beta testing and the issues they will be fixing right after the release. +你可以在 [GitHub 上查看他们的开发进度][24],以了解他们在测试期间已经修复的问题和发布后即将修复的问题。 -### Download & Support Pop!_OS 20.04 +### 下载 & 支持 Pop!_OS 20.04 ![][25] -With this release, System76 has finally added a subscription model (optional) to support Pop!_OS development. +在这个版本中,System76 终于增加了一个可选的订阅模式来支持 Pop!_OS 的开发。 -You can download **Pop!_OS 20.04** for free – but if you want to support them I’d suggest you go for the subscription with just **$1/month**. +你可以免费下载 Pop!_OS 20.04 —— 但如果你想支持他们,我建议你只需要 \$1/月就可以订阅。 -[Pop!_OS 20.04][26] +- [Pop!_OS 20.04][26] -### My Thoughts on Pop OS 20.04 +### 我对 Pop OS 20.04 的看法 -I must mention that I was rooting for a fresh new wallpaper with the latest 20.04 release. But, that’s not a big deal. +我必须提到的是,我正在为最新的 20.04 版本提供全新的墙纸。但是,这没什么大不了的。 -With the window tiling feature, flatpak support, and numerous other improvements, my experience with Pop!_OS 20.04 has been top-notch so far. Also, it’s great to see that they are highlighting their focus on creative professionals with out-of-the-box support for some popular software. +有了窗口平铺功能、支持 flatpak,以及众多其他改进,到目前为止,我对 Pop!_OS 20.04 的体验是一流的。另外,很高兴看到他们在一些流行软件的开箱即用支持上突出了他们对创意专业人士的关注。 ![][27] -All the good things about Ubuntu 20.04 and some extra toppings on it by System76, I’m impressed! +Ubuntu 20.04 的所有优点,再加上 System76 的一些额外的加料,让我印象深刻! -_**Have you tried the Pop!_OS 20.04 yet? Let me know your thoughts in the comments below.**_ +你试过 Pop!_OS 20.04 吗?请在下面的评论中告诉我你的想法。 -------------------------------------------------------------------------------- @@ -196,8 +192,8 @@ via: https://itsfoss.com/pop-os-20-04-review/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bc9b9b48abfb8de73106ba25975db4b800ce1fbf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 May 2020 20:16:44 +0800 Subject: [PATCH 0564/1809] PRF --- ...eview- Best Ubuntu-based Distribution Just Got Better.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {sources => translated}/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md (99%) diff --git a/sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md b/translated/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md similarity index 99% rename from sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md rename to translated/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md index 1760e313d1..731c14fa0b 100644 --- a/sources/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md +++ b/translated/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12175-1.html) [#]: subject: (Pop OS 20.04 Review: Best Ubuntu-based Distribution Just Got Better) [#]: via: (https://itsfoss.com/pop-os-20-04-review/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From c8edffef9b6330dfe962050897db8b12d699ce1a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 May 2020 20:18:30 +0800 Subject: [PATCH 0565/1809] PUB @wxy https://linux.cn/article-12175-1.html --- ...0.04 Review- Best Ubuntu-based Distribution Just Got Better.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md (100%) diff --git a/translated/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md b/published/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md similarity index 100% rename from translated/tech/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md rename to published/20200502 Pop OS 20.04 Review- Best Ubuntu-based Distribution Just Got Better.md From 2178dc85001508a499ad94941a34e5c53617ed26 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 May 2020 20:53:34 +0800 Subject: [PATCH 0566/1809] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20202004?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190107 Different Ways To Update Linux Kernel For Ubuntu.md | 0 published/{ => 202004}/20190116 Best Audio Editors For Linux.md | 0 ... Installing Kali Linux on VirtualBox- Quickest - Safest Way.md | 0 .../{ => 202004}/20190429 10 moments that shaped Linux history.md | 0 .../20190523 Run your blog on GitHub Pages with Python.md | 0 published/{ => 202004}/20190605 What is GraphQL.md | 0 published/{ => 202004}/20190612 How to write a loop in Bash.md | 0 published/{ => 202004}/20190612 Why use GraphQL.md | 0 published/{ => 202004}/20190712 What is Silverblue.md | 0 .../20190814 9 open source cloud native projects to consider.md | 0 .../{ => 202004}/20190822 How the Linux desktop has grown.md | 0 .../20191014 How to make a Halloween lantern with Inkscape.md | 0 ...191209 Use the Fluxbox Linux desktop as your window manager.md | 0 .../20191216 Relive Linux history with the ROX desktop.md | 0 ... Difference Between DNF and YUM, Why is Yum Replaced by DNF.md | 0 .../20191224 Why your Python code should be flat and sparse.md | 0 published/{ => 202004}/20200211 Navigating man pages in Linux.md | 0 ...Manage complex Git workspaces with Great Teeming Workspaces.md | 0 .../{ => 202004}/20200228 Getting started with Linux firewalls.md | 0 .../{ => 202004}/20200309 Fish - A Friendly Interactive Shell.md | 0 .../20200311 Directing Kubernetes traffic with Traefik.md | 0 .../20200311 What you need to know about variables in Emacs.md | 0 published/{ => 202004}/20200312 Make SSL certs easy with k3s.md | 0 .../20200313 What is the internet backbone and how it works.md | 0 ...20200320 Build a private social network with a Raspberry Pi.md | 0 .../20200320 Control the firewall at the command line.md | 0 ...ow to Check Password Expiration Date for All Users on Linux.md | 0 .../{ => 202004}/20200323 Don-t love diff- Use Meld instead.md | 0 published/{ => 202004}/20200325 Linux firewall basics with ufw.md | 0 .../20200326 3 open source tools for sticking to a budget.md | 0 ...d a private chat server with a Raspberry Pi and Rocket.Chat.md | 0 ...tall Microsoft TrueType Fonts on Ubuntu-based Distributions.md | 0 ...Oracle Announces Java 14- How to Install it on Ubuntu Linux.md | 0 ...The Keyring Concept in Ubuntu- What is It and How to Use it.md | 0 ...n Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md | 0 ...20200330 Using data from spreadsheets in Fedora with Python.md | 0 .../{ => 202004}/20200331 5 ways to level up your Vim skills.md | 0 ...200401 How to Find Which Graphics Card do You Have in Linux.md | 0 ... Association Launches an Open Source Collaboration Platform.md | 0 ...0402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md | 0 .../20200403 Scheduling tasks on Linux using the at command.md | 0 .../{ => 202004}/20200403 Take back your dotfiles with Chezmoi.md | 0 ...odhi Linux 5.1 Review- Slightly Different Lightweight Linux.md | 0 ... Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md | 0 ... 15 years of Git- How to get started or learn something new.md | 0 .../20200407 Bitwarden- A Free - Open Source Password Manager.md | 0 ...ion UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md | 0 .../20200408 Create web tutorials with Reveal.js and Git.md | 0 ...lates in LibreOffice to Save Time and Increase Productivity.md | 0 ...e-s How to Find Out Which Desktop Environment You are Using.md | 0 ...-m using AI to translate -wash your hands- in 500 languages.md | 0 .../20200410 How to Go Full Dark Mode in Ubuntu 20.04.md | 0 ...13 A handy utility for creating Raspberry Pi SD card images.md | 0 .../20200413 How to Add Multiple Time Zones in Ubuntu.md | 0 published/{ => 202004}/20200413 How to install Python on Linux.md | 0 ... Folders as Administrator in Nautilus File Manager in Linux.md | 0 .../20200416 How to package Python applications for Linux.md | 0 ...20200417 12 Linux Commands to Have Some Fun in the Terminal.md | 0 ...418 Ethernet consortium announces completion of 800GbE spec.md | 0 ...200421 MystiQ- A Free and Open Source Audio-Video Converter.md | 0 ...d IP Addresses, MAC Addresses, and Interface Speed on Linux.md | 0 .../20200422 Things You Should Know About Ubuntu 20.04.md | 0 .../20200424 Ubuntu 20.04 LTS Released. Download Now.md | 0 ...0200424 What you need to know about open source ad blockers.md | 0 ... What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md | 0 published/{ => 202004}/20200428 Fedora 32 is officially here.md | 0 ...20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md | 0 67 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 202004}/20190107 Different Ways To Update Linux Kernel For Ubuntu.md (100%) rename published/{ => 202004}/20190116 Best Audio Editors For Linux.md (100%) rename published/{ => 202004}/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md (100%) rename published/{ => 202004}/20190429 10 moments that shaped Linux history.md (100%) rename published/{ => 202004}/20190523 Run your blog on GitHub Pages with Python.md (100%) rename published/{ => 202004}/20190605 What is GraphQL.md (100%) rename published/{ => 202004}/20190612 How to write a loop in Bash.md (100%) rename published/{ => 202004}/20190612 Why use GraphQL.md (100%) rename published/{ => 202004}/20190712 What is Silverblue.md (100%) rename published/{ => 202004}/20190814 9 open source cloud native projects to consider.md (100%) rename published/{ => 202004}/20190822 How the Linux desktop has grown.md (100%) rename published/{ => 202004}/20191014 How to make a Halloween lantern with Inkscape.md (100%) rename published/{ => 202004}/20191209 Use the Fluxbox Linux desktop as your window manager.md (100%) rename published/{ => 202004}/20191216 Relive Linux history with the ROX desktop.md (100%) rename published/{ => 202004}/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md (100%) rename published/{ => 202004}/20191224 Why your Python code should be flat and sparse.md (100%) rename published/{ => 202004}/20200211 Navigating man pages in Linux.md (100%) rename published/{ => 202004}/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md (100%) rename published/{ => 202004}/20200228 Getting started with Linux firewalls.md (100%) rename published/{ => 202004}/20200309 Fish - A Friendly Interactive Shell.md (100%) rename published/{ => 202004}/20200311 Directing Kubernetes traffic with Traefik.md (100%) rename published/{ => 202004}/20200311 What you need to know about variables in Emacs.md (100%) rename published/{ => 202004}/20200312 Make SSL certs easy with k3s.md (100%) rename published/{ => 202004}/20200313 What is the internet backbone and how it works.md (100%) rename published/{ => 202004}/20200320 Build a private social network with a Raspberry Pi.md (100%) rename published/{ => 202004}/20200320 Control the firewall at the command line.md (100%) rename published/{ => 202004}/20200320 How to Check Password Expiration Date for All Users on Linux.md (100%) rename published/{ => 202004}/20200323 Don-t love diff- Use Meld instead.md (100%) rename published/{ => 202004}/20200325 Linux firewall basics with ufw.md (100%) rename published/{ => 202004}/20200326 3 open source tools for sticking to a budget.md (100%) rename published/{ => 202004}/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md (100%) rename published/{ => 202004}/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md (100%) rename published/{ => 202004}/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md (100%) rename published/{ => 202004}/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md (100%) rename published/{ => 202004}/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md (100%) rename published/{ => 202004}/20200330 Using data from spreadsheets in Fedora with Python.md (100%) rename published/{ => 202004}/20200331 5 ways to level up your Vim skills.md (100%) rename published/{ => 202004}/20200401 How to Find Which Graphics Card do You Have in Linux.md (100%) rename published/{ => 202004}/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md (100%) rename published/{ => 202004}/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md (100%) rename published/{ => 202004}/20200403 Scheduling tasks on Linux using the at command.md (100%) rename published/{ => 202004}/20200403 Take back your dotfiles with Chezmoi.md (100%) rename published/{ => 202004}/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md (100%) rename published/{ => 202004}/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md (100%) rename published/{ => 202004}/20200407 15 years of Git- How to get started or learn something new.md (100%) rename published/{ => 202004}/20200407 Bitwarden- A Free - Open Source Password Manager.md (100%) rename published/{ => 202004}/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md (100%) rename published/{ => 202004}/20200408 Create web tutorials with Reveal.js and Git.md (100%) rename published/{ => 202004}/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md (100%) rename published/{ => 202004}/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md (100%) rename published/{ => 202004}/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md (100%) rename published/{ => 202004}/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md (100%) rename published/{ => 202004}/20200413 A handy utility for creating Raspberry Pi SD card images.md (100%) rename published/{ => 202004}/20200413 How to Add Multiple Time Zones in Ubuntu.md (100%) rename published/{ => 202004}/20200413 How to install Python on Linux.md (100%) rename published/{ => 202004}/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md (100%) rename published/{ => 202004}/20200416 How to package Python applications for Linux.md (100%) rename published/{ => 202004}/20200417 12 Linux Commands to Have Some Fun in the Terminal.md (100%) rename published/{ => 202004}/20200418 Ethernet consortium announces completion of 800GbE spec.md (100%) rename published/{ => 202004}/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md (100%) rename published/{ => 202004}/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md (100%) rename published/{ => 202004}/20200422 Things You Should Know About Ubuntu 20.04.md (100%) rename published/{ => 202004}/20200424 Ubuntu 20.04 LTS Released. Download Now.md (100%) rename published/{ => 202004}/20200424 What you need to know about open source ad blockers.md (100%) rename published/{ => 202004}/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md (100%) rename published/{ => 202004}/20200428 Fedora 32 is officially here.md (100%) rename published/{ => 202004}/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md (100%) diff --git a/published/20190107 Different Ways To Update Linux Kernel For Ubuntu.md b/published/202004/20190107 Different Ways To Update Linux Kernel For Ubuntu.md similarity index 100% rename from published/20190107 Different Ways To Update Linux Kernel For Ubuntu.md rename to published/202004/20190107 Different Ways To Update Linux Kernel For Ubuntu.md diff --git a/published/20190116 Best Audio Editors For Linux.md b/published/202004/20190116 Best Audio Editors For Linux.md similarity index 100% rename from published/20190116 Best Audio Editors For Linux.md rename to published/202004/20190116 Best Audio Editors For Linux.md diff --git a/published/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md b/published/202004/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md similarity index 100% rename from published/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md rename to published/202004/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md diff --git a/published/20190429 10 moments that shaped Linux history.md b/published/202004/20190429 10 moments that shaped Linux history.md similarity index 100% rename from published/20190429 10 moments that shaped Linux history.md rename to published/202004/20190429 10 moments that shaped Linux history.md diff --git a/published/20190523 Run your blog on GitHub Pages with Python.md b/published/202004/20190523 Run your blog on GitHub Pages with Python.md similarity index 100% rename from published/20190523 Run your blog on GitHub Pages with Python.md rename to published/202004/20190523 Run your blog on GitHub Pages with Python.md diff --git a/published/20190605 What is GraphQL.md b/published/202004/20190605 What is GraphQL.md similarity index 100% rename from published/20190605 What is GraphQL.md rename to published/202004/20190605 What is GraphQL.md diff --git a/published/20190612 How to write a loop in Bash.md b/published/202004/20190612 How to write a loop in Bash.md similarity index 100% rename from published/20190612 How to write a loop in Bash.md rename to published/202004/20190612 How to write a loop in Bash.md diff --git a/published/20190612 Why use GraphQL.md b/published/202004/20190612 Why use GraphQL.md similarity index 100% rename from published/20190612 Why use GraphQL.md rename to published/202004/20190612 Why use GraphQL.md diff --git a/published/20190712 What is Silverblue.md b/published/202004/20190712 What is Silverblue.md similarity index 100% rename from published/20190712 What is Silverblue.md rename to published/202004/20190712 What is Silverblue.md diff --git a/published/20190814 9 open source cloud native projects to consider.md b/published/202004/20190814 9 open source cloud native projects to consider.md similarity index 100% rename from published/20190814 9 open source cloud native projects to consider.md rename to published/202004/20190814 9 open source cloud native projects to consider.md diff --git a/published/20190822 How the Linux desktop has grown.md b/published/202004/20190822 How the Linux desktop has grown.md similarity index 100% rename from published/20190822 How the Linux desktop has grown.md rename to published/202004/20190822 How the Linux desktop has grown.md diff --git a/published/20191014 How to make a Halloween lantern with Inkscape.md b/published/202004/20191014 How to make a Halloween lantern with Inkscape.md similarity index 100% rename from published/20191014 How to make a Halloween lantern with Inkscape.md rename to published/202004/20191014 How to make a Halloween lantern with Inkscape.md diff --git a/published/20191209 Use the Fluxbox Linux desktop as your window manager.md b/published/202004/20191209 Use the Fluxbox Linux desktop as your window manager.md similarity index 100% rename from published/20191209 Use the Fluxbox Linux desktop as your window manager.md rename to published/202004/20191209 Use the Fluxbox Linux desktop as your window manager.md diff --git a/published/20191216 Relive Linux history with the ROX desktop.md b/published/202004/20191216 Relive Linux history with the ROX desktop.md similarity index 100% rename from published/20191216 Relive Linux history with the ROX desktop.md rename to published/202004/20191216 Relive Linux history with the ROX desktop.md diff --git a/published/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md b/published/202004/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md similarity index 100% rename from published/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md rename to published/202004/20191220 The Difference Between DNF and YUM, Why is Yum Replaced by DNF.md diff --git a/published/20191224 Why your Python code should be flat and sparse.md b/published/202004/20191224 Why your Python code should be flat and sparse.md similarity index 100% rename from published/20191224 Why your Python code should be flat and sparse.md rename to published/202004/20191224 Why your Python code should be flat and sparse.md diff --git a/published/20200211 Navigating man pages in Linux.md b/published/202004/20200211 Navigating man pages in Linux.md similarity index 100% rename from published/20200211 Navigating man pages in Linux.md rename to published/202004/20200211 Navigating man pages in Linux.md diff --git a/published/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md b/published/202004/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md similarity index 100% rename from published/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md rename to published/202004/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md diff --git a/published/20200228 Getting started with Linux firewalls.md b/published/202004/20200228 Getting started with Linux firewalls.md similarity index 100% rename from published/20200228 Getting started with Linux firewalls.md rename to published/202004/20200228 Getting started with Linux firewalls.md diff --git a/published/20200309 Fish - A Friendly Interactive Shell.md b/published/202004/20200309 Fish - A Friendly Interactive Shell.md similarity index 100% rename from published/20200309 Fish - A Friendly Interactive Shell.md rename to published/202004/20200309 Fish - A Friendly Interactive Shell.md diff --git a/published/20200311 Directing Kubernetes traffic with Traefik.md b/published/202004/20200311 Directing Kubernetes traffic with Traefik.md similarity index 100% rename from published/20200311 Directing Kubernetes traffic with Traefik.md rename to published/202004/20200311 Directing Kubernetes traffic with Traefik.md diff --git a/published/20200311 What you need to know about variables in Emacs.md b/published/202004/20200311 What you need to know about variables in Emacs.md similarity index 100% rename from published/20200311 What you need to know about variables in Emacs.md rename to published/202004/20200311 What you need to know about variables in Emacs.md diff --git a/published/20200312 Make SSL certs easy with k3s.md b/published/202004/20200312 Make SSL certs easy with k3s.md similarity index 100% rename from published/20200312 Make SSL certs easy with k3s.md rename to published/202004/20200312 Make SSL certs easy with k3s.md diff --git a/published/20200313 What is the internet backbone and how it works.md b/published/202004/20200313 What is the internet backbone and how it works.md similarity index 100% rename from published/20200313 What is the internet backbone and how it works.md rename to published/202004/20200313 What is the internet backbone and how it works.md diff --git a/published/20200320 Build a private social network with a Raspberry Pi.md b/published/202004/20200320 Build a private social network with a Raspberry Pi.md similarity index 100% rename from published/20200320 Build a private social network with a Raspberry Pi.md rename to published/202004/20200320 Build a private social network with a Raspberry Pi.md diff --git a/published/20200320 Control the firewall at the command line.md b/published/202004/20200320 Control the firewall at the command line.md similarity index 100% rename from published/20200320 Control the firewall at the command line.md rename to published/202004/20200320 Control the firewall at the command line.md diff --git a/published/20200320 How to Check Password Expiration Date for All Users on Linux.md b/published/202004/20200320 How to Check Password Expiration Date for All Users on Linux.md similarity index 100% rename from published/20200320 How to Check Password Expiration Date for All Users on Linux.md rename to published/202004/20200320 How to Check Password Expiration Date for All Users on Linux.md diff --git a/published/20200323 Don-t love diff- Use Meld instead.md b/published/202004/20200323 Don-t love diff- Use Meld instead.md similarity index 100% rename from published/20200323 Don-t love diff- Use Meld instead.md rename to published/202004/20200323 Don-t love diff- Use Meld instead.md diff --git a/published/20200325 Linux firewall basics with ufw.md b/published/202004/20200325 Linux firewall basics with ufw.md similarity index 100% rename from published/20200325 Linux firewall basics with ufw.md rename to published/202004/20200325 Linux firewall basics with ufw.md diff --git a/published/20200326 3 open source tools for sticking to a budget.md b/published/202004/20200326 3 open source tools for sticking to a budget.md similarity index 100% rename from published/20200326 3 open source tools for sticking to a budget.md rename to published/202004/20200326 3 open source tools for sticking to a budget.md diff --git a/published/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md b/published/202004/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md similarity index 100% rename from published/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md rename to published/202004/20200327 Build a private chat server with a Raspberry Pi and Rocket.Chat.md diff --git a/published/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md b/published/202004/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md similarity index 100% rename from published/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md rename to published/202004/20200329 How to install Microsoft TrueType Fonts on Ubuntu-based Distributions.md diff --git a/published/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md b/published/202004/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md similarity index 100% rename from published/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md rename to published/202004/20200329 Oracle Announces Java 14- How to Install it on Ubuntu Linux.md diff --git a/published/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md b/published/202004/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md similarity index 100% rename from published/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md rename to published/202004/20200329 The Keyring Concept in Ubuntu- What is It and How to Use it.md diff --git a/published/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md b/published/202004/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md similarity index 100% rename from published/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md rename to published/202004/20200329 Turn Your Regular TV into a Smart TV With KDE Plasma Bigscreen.md diff --git a/published/20200330 Using data from spreadsheets in Fedora with Python.md b/published/202004/20200330 Using data from spreadsheets in Fedora with Python.md similarity index 100% rename from published/20200330 Using data from spreadsheets in Fedora with Python.md rename to published/202004/20200330 Using data from spreadsheets in Fedora with Python.md diff --git a/published/20200331 5 ways to level up your Vim skills.md b/published/202004/20200331 5 ways to level up your Vim skills.md similarity index 100% rename from published/20200331 5 ways to level up your Vim skills.md rename to published/202004/20200331 5 ways to level up your Vim skills.md diff --git a/published/20200401 How to Find Which Graphics Card do You Have in Linux.md b/published/202004/20200401 How to Find Which Graphics Card do You Have in Linux.md similarity index 100% rename from published/20200401 How to Find Which Graphics Card do You Have in Linux.md rename to published/202004/20200401 How to Find Which Graphics Card do You Have in Linux.md diff --git a/published/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md b/published/202004/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md similarity index 100% rename from published/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md rename to published/202004/20200401 IEEE Standards Association Launches an Open Source Collaboration Platform.md diff --git a/published/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md b/published/202004/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md similarity index 100% rename from published/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md rename to published/202004/20200402 How to Upgrade to Ubuntu 20.04 Beta from 18.04 - 19.10.md diff --git a/published/20200403 Scheduling tasks on Linux using the at command.md b/published/202004/20200403 Scheduling tasks on Linux using the at command.md similarity index 100% rename from published/20200403 Scheduling tasks on Linux using the at command.md rename to published/202004/20200403 Scheduling tasks on Linux using the at command.md diff --git a/published/20200403 Take back your dotfiles with Chezmoi.md b/published/202004/20200403 Take back your dotfiles with Chezmoi.md similarity index 100% rename from published/20200403 Take back your dotfiles with Chezmoi.md rename to published/202004/20200403 Take back your dotfiles with Chezmoi.md diff --git a/published/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md b/published/202004/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md similarity index 100% rename from published/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md rename to published/202004/20200404 Bodhi Linux 5.1 Review- Slightly Different Lightweight Linux.md diff --git a/published/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md b/published/202004/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md similarity index 100% rename from published/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md rename to published/202004/20200404 What is Arch User Repository (AUR)- How to Use AUR on Arch and Manjaro Linux.md diff --git a/published/20200407 15 years of Git- How to get started or learn something new.md b/published/202004/20200407 15 years of Git- How to get started or learn something new.md similarity index 100% rename from published/20200407 15 years of Git- How to get started or learn something new.md rename to published/202004/20200407 15 years of Git- How to get started or learn something new.md diff --git a/published/20200407 Bitwarden- A Free - Open Source Password Manager.md b/published/202004/20200407 Bitwarden- A Free - Open Source Password Manager.md similarity index 100% rename from published/20200407 Bitwarden- A Free - Open Source Password Manager.md rename to published/202004/20200407 Bitwarden- A Free - Open Source Password Manager.md diff --git a/published/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md b/published/202004/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md similarity index 100% rename from published/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md rename to published/202004/20200407 New Linux Distribution UbuntuDDE Brings The Beautiful Deepin Desktop to Ubuntu.md diff --git a/published/20200408 Create web tutorials with Reveal.js and Git.md b/published/202004/20200408 Create web tutorials with Reveal.js and Git.md similarity index 100% rename from published/20200408 Create web tutorials with Reveal.js and Git.md rename to published/202004/20200408 Create web tutorials with Reveal.js and Git.md diff --git a/published/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md b/published/202004/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md similarity index 100% rename from published/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md rename to published/202004/20200408 How to Create Templates in LibreOffice to Save Time and Increase Productivity.md diff --git a/published/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md b/published/202004/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md similarity index 100% rename from published/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md rename to published/202004/20200409 Here-s How to Find Out Which Desktop Environment You are Using.md diff --git a/published/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md b/published/202004/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md similarity index 100% rename from published/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md rename to published/202004/20200410 How I-m using AI to translate -wash your hands- in 500 languages.md diff --git a/published/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md b/published/202004/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md similarity index 100% rename from published/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md rename to published/202004/20200410 How to Go Full Dark Mode in Ubuntu 20.04.md diff --git a/published/20200413 A handy utility for creating Raspberry Pi SD card images.md b/published/202004/20200413 A handy utility for creating Raspberry Pi SD card images.md similarity index 100% rename from published/20200413 A handy utility for creating Raspberry Pi SD card images.md rename to published/202004/20200413 A handy utility for creating Raspberry Pi SD card images.md diff --git a/published/20200413 How to Add Multiple Time Zones in Ubuntu.md b/published/202004/20200413 How to Add Multiple Time Zones in Ubuntu.md similarity index 100% rename from published/20200413 How to Add Multiple Time Zones in Ubuntu.md rename to published/202004/20200413 How to Add Multiple Time Zones in Ubuntu.md diff --git a/published/20200413 How to install Python on Linux.md b/published/202004/20200413 How to install Python on Linux.md similarity index 100% rename from published/20200413 How to install Python on Linux.md rename to published/202004/20200413 How to install Python on Linux.md diff --git a/published/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md b/published/202004/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md similarity index 100% rename from published/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md rename to published/202004/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md diff --git a/published/20200416 How to package Python applications for Linux.md b/published/202004/20200416 How to package Python applications for Linux.md similarity index 100% rename from published/20200416 How to package Python applications for Linux.md rename to published/202004/20200416 How to package Python applications for Linux.md diff --git a/published/20200417 12 Linux Commands to Have Some Fun in the Terminal.md b/published/202004/20200417 12 Linux Commands to Have Some Fun in the Terminal.md similarity index 100% rename from published/20200417 12 Linux Commands to Have Some Fun in the Terminal.md rename to published/202004/20200417 12 Linux Commands to Have Some Fun in the Terminal.md diff --git a/published/20200418 Ethernet consortium announces completion of 800GbE spec.md b/published/202004/20200418 Ethernet consortium announces completion of 800GbE spec.md similarity index 100% rename from published/20200418 Ethernet consortium announces completion of 800GbE spec.md rename to published/202004/20200418 Ethernet consortium announces completion of 800GbE spec.md diff --git a/published/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md b/published/202004/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md similarity index 100% rename from published/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md rename to published/202004/20200421 MystiQ- A Free and Open Source Audio-Video Converter.md diff --git a/published/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md b/published/202004/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md similarity index 100% rename from published/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md rename to published/202004/20200422 How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux.md diff --git a/published/20200422 Things You Should Know About Ubuntu 20.04.md b/published/202004/20200422 Things You Should Know About Ubuntu 20.04.md similarity index 100% rename from published/20200422 Things You Should Know About Ubuntu 20.04.md rename to published/202004/20200422 Things You Should Know About Ubuntu 20.04.md diff --git a/published/20200424 Ubuntu 20.04 LTS Released. Download Now.md b/published/202004/20200424 Ubuntu 20.04 LTS Released. Download Now.md similarity index 100% rename from published/20200424 Ubuntu 20.04 LTS Released. Download Now.md rename to published/202004/20200424 Ubuntu 20.04 LTS Released. Download Now.md diff --git a/published/20200424 What you need to know about open source ad blockers.md b/published/202004/20200424 What you need to know about open source ad blockers.md similarity index 100% rename from published/20200424 What you need to know about open source ad blockers.md rename to published/202004/20200424 What you need to know about open source ad blockers.md diff --git a/published/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md b/published/202004/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md similarity index 100% rename from published/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md rename to published/202004/20200425 What Happened to IPv5- Why there is IPv4, IPv6 but no IPv5.md diff --git a/published/20200428 Fedora 32 is officially here.md b/published/202004/20200428 Fedora 32 is officially here.md similarity index 100% rename from published/20200428 Fedora 32 is officially here.md rename to published/202004/20200428 Fedora 32 is officially here.md diff --git a/published/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md b/published/202004/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md similarity index 100% rename from published/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md rename to published/202004/20200429 Manjaro 20 Lysia Arrives with ZFS and Snap Support.md From 992c5660edc8f257524e87dce01515310ed3cb22 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 May 2020 22:23:20 +0800 Subject: [PATCH 0567/1809] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lxbwolf 这篇翻译的不错。 --- .../20200425 Inlining optimisations in Go.md | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/translated/tech/20200425 Inlining optimisations in Go.md b/translated/tech/20200425 Inlining optimisations in Go.md index dc13968c1d..0e28421308 100644 --- a/translated/tech/20200425 Inlining optimisations in Go.md +++ b/translated/tech/20200425 Inlining optimisations in Go.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Inlining optimisations in Go) @@ -10,33 +10,35 @@ Go 中的内联优化 ====== -本文讨论 Go 编译器是如何实现内联的以及这种优化方法如何影响你的 Go 代码。 +> 本文讨论 Go 编译器是如何实现内联的,以及这种优化方法如何影响你的 Go 代码。 -*请注意:*本文重点讨论 *gc*,实际上是 [golang.org](https://github.com/golang/go) 的 Go 编译器。讨论到的概念可以广泛用于其他 Go 编译器,如 gccgo 和 llgo,但它们在实现方式和功能上可能有所差异。 +![](https://img.linux.net.cn/data/attachment/album/202005/02/222202e3v3pppkhnndpbpn.jpg) + +*请注意:*本文重点讨论 *gc*,这是来自 [golang.org](https://github.com/golang/go) 的事实标准的 Go 编译器。讨论到的概念可以广泛适用于其它 Go 编译器,如 gccgo 和 llgo,但它们在实现方式和功效上可能有所差异。 ### 内联是什么? -内联就是把简短的函数在调用它的地方展开。在计算机发展历程的早期,这个优化是由程序员手动实现的。现在,内联已经成为编译过程中自动实现的基本优化过程的其中一步。 +内联inlining就是把简短的函数在调用它的地方展开。在计算机发展历程的早期,这个优化是由程序员手动实现的。现在,内联已经成为编译过程中自动实现的基本优化过程的其中一步。 ### 为什么内联很重要? -有两个原因。第一个是它消除了函数调用本身的虚耗。第二个是它使得编译器能更高效地执行其他的优化策略。 +有两个原因。第一个是它消除了函数调用本身的开销。第二个是它使得编译器能更高效地执行其他的优化策略。 -#### 函数调用的虚耗 +#### 函数调用的开销 -在任何语言中,调用一个函数 [1][2] 都会有消耗。把参数编组进寄存器或放入栈中(取决于 ABI),在返回结果时倒序取出时会有虚耗。引入一次函数调用会导致程序计数器从指令流的一点跳到另一点,这可能导致管道阻塞。函数内部通常有前置处理,需要为函数执行准备新的栈帧,还有与前置相似的后续处理,需要在返回给调用方之前释放栈帧空间。 +在任何语言中,调用一个函数 [^1] 都会有消耗。把参数编组进寄存器或放入栈中(取决于 ABI),在返回结果时的逆反过程都会有开销。引入一次函数调用会导致程序计数器从指令流的一点跳到另一点,这可能导致管道滞后。函数内部通常有前置处理preamble,需要为函数执行准备新的栈帧,还有与前置相似的后续处理epilogue,需要在返回给调用方之前释放栈帧空间。 -在 Go 中函数调用会消耗额外的资源来支持栈的动态增长。在进入函数时,goroutine 可用的栈空间与函数需要的空间大小相等。如果可用空间不同,前置处理就会跳到把数据复制到一块新的、更大的空间的运行时逻辑,而这会导致栈空间变大。当这个复制完成后,运行时跳回到原来的函数入口,再执行栈空间检查,函数调用继续执行。这种方式下,goroutine 开始时可以申请很小的栈空间,在有需要时再申请更大的空间。[2][3] +在 Go 中函数调用会消耗额外的资源来支持栈的动态增长。在进入函数时,goroutine 可用的栈空间与函数需要的空间大小进行比较。如果可用空间不同,前置处理就会跳到运行时runtime的逻辑中,通过把数据复制到一块新的、更大的空间的来增长栈空间。当这个复制完成后,运行时就会跳回到原来的函数入口,再执行栈空间检查,现在通过了检查,函数调用继续执行。这种方式下,goroutine 开始时可以申请很小的栈空间,在有需要时再申请更大的空间。[^2] -这个检查消耗很小 — 只有几个指令 — 而且由于 goroutine 是成几何级数增长的,因此这个检查很少失败。这样,现代处理器的分支预测单元会通过假定检查肯定会成功来隐藏栈空间检查的消耗。当处理器预测错了栈空间检查,必须要抛弃它推测性执行的操作时,与为了增加 goroutine 的栈空间运行时所需的操作消耗的资源相比,管道阻塞的代价更小。 +这个检查消耗很小,只有几个指令,而且由于 goroutine 的栈是成几何级数增长的,因此这个检查很少失败。这样,现代处理器的分支预测单元可以通过假定检查肯定会成功来隐藏栈空间检查的消耗。当处理器预测错了栈空间检查,不得不放弃它在推测性执行所做的操作时,与为了增加 goroutine 的栈空间运行时所需的操作消耗的资源相比,管道滞后的代价更小。 -虽然现代处理器可以用预测性执行技术优化每次函数调用中的泛型和 Go 特定的元素的虚耗,但那些虚耗不能被完全消除,因此在每次函数调用执行必要的工作过程中都会有性能消耗。一次函数调用本身的虚耗是固定的,与更大的函数相比,调用小函数的代价更大,因为在每次调用过程中它们做的有用的工作更少。 +虽然现代处理器可以用预测性执行技术优化每次函数调用中的泛型和 Go 特定的元素的开销,但那些开销不能被完全消除,因此在每次函数调用执行必要的工作过程中都会有性能消耗。一次函数调用本身的开销是固定的,与更大的函数相比,调用小函数的代价更大,因为在每次调用过程中它们做的有用的工作更少。 -消除这些虚耗的方法必须是要消除函数调用本身,Go 的编译器就是这么做的,在某些条件下通过用函数的内容来替换函数调用来实现。这个过程被称为*内联*,因为它在函数调用处把函数体展开了。 +因此,消除这些开销的方法必须是要消除函数调用本身,Go 的编译器就是这么做的,在某些条件下通过用函数的内容来替换函数调用来实现。这个过程被称为*内联*,因为它在函数调用处把函数体展开了。 #### 改进的优化机会 -Cliff Click 博士把内联描述为现代编译器做的优化措施,像常量传播(译注:此处作者笔误,原文为 constant proportion,修正为 constant propagation)和死码消除一样,都是编译器的基本优化方法。实际上,内联可以让编译器看得更深,使编译器可以观察调用的特定函数的上下文内容,可以看到能继续简化或彻底消除的逻辑。由于可以递归地执行内联,因此不仅可以在每个独立的函数上下文处进行这种优化,也可以在整个函数调用链中进行。 +Cliff Click 博士把内联描述为现代编译器做的优化措施,像常量传播(LCTT 译注:此处作者笔误,原文为 constant proportion,修正为 constant propagation)和死代码消除一样,都是编译器的基本优化方法。实际上,内联可以让编译器看得更深,使编译器可以观察调用的特定函数的上下文内容,可以看到能继续简化或彻底消除的逻辑。由于可以递归地执行内联,因此不仅可以在每个独立的函数上下文处进行这种优化决策,也可以在整个函数调用链中进行。 ### 实践中的内联 @@ -66,14 +68,14 @@ func BenchmarkMax(b *testing.B) { } ``` -运行这个基准,会得到如下结果:[3][4] +运行这个基准,会得到如下结果:[^3] ```bash % go test -bench=. BenchmarkMax-4 530687617 2.24 ns/op ``` -在我的 2015 MacBook Air 上 `max(-1, i)` 的耗时约为 2.24 纳秒。现在去掉 `//go:noinline` 编译指令,再看下结果: +在我的 2015 MacBook Air 上 `max(-1, i)` 的耗时约为 2.24 纳秒。现在去掉 `//go:noinline` 编译指令,再看下结果: ```bash % go test -bench=. @@ -90,7 +92,7 @@ Max-4 2.21ns ± 1% 0.49ns ± 6% -77.96% (p=0.000 n=18+19) 这个提升是从哪儿来的呢? -首先,移除掉函数调用以及与之关联的前置处理 [4][5] 是主要因素。把 `max` 函数的函数体在调用处展开,减少了处理器执行的指令数量并且消除了一些分支。 +首先,移除掉函数调用以及与之关联的前置处理 [^4] 是主要因素。把 `max` 函数的函数体在调用处展开,减少了处理器执行的指令数量并且消除了一些分支。 现在由于编译器优化了 `BenchmarkMax`,因此它可以看到 `max` 函数的内容,进而可以做更多的提升。当 `max` 被内联后,`BenchmarkMax` 呈现给编译器的样子,看起来是这样的: @@ -116,7 +118,7 @@ name old time/op new time/op delta Max-4 2.21ns ± 1% 0.48ns ± 3% -78.14% (p=0.000 n=18+18) ``` -现在编译器能看到在 `BenchmarkMax` 里内联 `max` 的结果,可以执行以前不能执行的优化措施。例如,编译器注意到 `i` 初始值为 `0`,仅做自增操作,因此所有与 `i` 的比较都可以假定 `i` 不是负值。这样条件表达式 `-1 > i` 永远不是 true。[5][6] +现在编译器能看到在 `BenchmarkMax` 里内联 `max` 的结果,可以执行以前不能执行的优化措施。例如,编译器注意到 `i` 初始值为 `0`,仅做自增操作,因此所有与 `i` 的比较都可以假定 `i` 不是负值。这样条件表达式 `-1 > i` 永远不是 `true`。[^5] 证明了 `-1 > i` 永远不为 true 后,编译器可以把代码简化为: @@ -150,7 +152,7 @@ func BenchmarkMax(b *testing.B) { ### 内联的限制 -本文中我论述的内联称作*叶子*内联;把函数调用栈中最底层的函数在调用它的函数处展开的行为。内联是个递归的过程,当把函数内联到调用它的函数 A 处后,编译器会把内联后的结果代码再内联到 A 的调用方,这样持续内联下去。例如,下面的代码: +本文中我论述的内联称作叶子内联leaf inlining:把函数调用栈中最底层的函数在调用它的函数处展开的行为。内联是个递归的过程,当把函数内联到调用它的函数 A 处后,编译器会把内联后的结果代码再内联到 A 的调用方,这样持续内联下去。例如,下面的代码: ```go func BenchmarkMaxMaxMax(b *testing.B) { @@ -166,11 +168,11 @@ func BenchmarkMaxMaxMax(b *testing.B) { 下一篇文章中,我会论述当 Go 编译器想要内联函数调用栈中间的某个函数时选用的另一种内联策略。最后我会论述编译器为了内联代码准备好要达到的极限,这个极限 Go 现在的能力还达不到。 -1. 在 Go 中,一个方法就是一个有预先定义的形参和接受者的函数。假设这个方法不是通过接口调用的,调用一个无消耗的函数所消耗的代价与引入一个方法是相同的。[][7] -2. 在 Go 1.14 以前,栈检查的前置处理也被 gc 用于 STW,通过把所有活跃的 goroutine 栈空间设为 0,来强制它们切换为下一次函数调用时的运行时状态。这个机制[最近被替换][8]为一种新机制,新机制下运行时可以不用等 goroutine 进行函数调用就可以暂停 goroutine。[][9] -3. 我用 `//go:noinline` 编译指令来阻止编译器内联 `max`。这是因为我想把内联 `max` 的影响与其他影响隔离开,而不是用 `-gcflags='-l -N'` 选项在全局范围内禁止优化。关于 `//go:` 注释在[这篇文章][10]中详细论述。[][11] -4. 你可以自己通过比较 `go test -bench=. -gcflags=-S`有无 `//go:noinline` 注释时的不同结果来验证一下。[][12] -5. 你可以用 `-gcflags=-d=ssa/prove/debug=on` 选项来自己验证一下。[][13] +[^1]: 在 Go 中,一个方法就是一个有预先定义的形参和接受者的函数。假设这个方法不是通过接口调用的,调用一个无消耗的函数所消耗的代价与引入一个方法是相同的。 +[^2]: 在 Go 1.14 以前,栈检查的前置处理也被垃圾回收器用于 STW,通过把所有活跃的 goroutine 栈空间设为 0,来强制它们切换为下一次函数调用时的运行时状态。这个机制[最近被替换][8]为一种新机制,新机制下运行时可以不用等 goroutine 进行函数调用就可以暂停 goroutine。 +[^3]: 我用 `//go:noinline` 编译指令来阻止编译器内联 `max`。这是因为我想把内联 `max` 的影响与其他影响隔离开,而不是用 `-gcflags='-l -N'` 选项在全局范围内禁止优化。关于 `//go:` 注释在[这篇文章][10]中详细论述。 +[^4]: 你可以自己通过比较 `go test -bench=. -gcflags=-S` 有无 `//go:noinline` 注释时的不同结果来验证一下。 +[^5]: 你可以用 `-gcflags=-d=ssa/prove/debug=on` 选项来自己验证一下。 #### 相关文章: @@ -186,7 +188,7 @@ via: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go 作者:[Dave Cheney][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 748e253520ef62031e1dd71cd2925bededaebf2f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 May 2020 22:24:03 +0800 Subject: [PATCH 0568/1809] PUB @lxbwolf https://linux.cn/article-12176-1.html --- .../20200425 Inlining optimisations in Go.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200425 Inlining optimisations in Go.md (99%) diff --git a/translated/tech/20200425 Inlining optimisations in Go.md b/published/20200425 Inlining optimisations in Go.md similarity index 99% rename from translated/tech/20200425 Inlining optimisations in Go.md rename to published/20200425 Inlining optimisations in Go.md index 0e28421308..12f1cb67b7 100644 --- a/translated/tech/20200425 Inlining optimisations in Go.md +++ b/published/20200425 Inlining optimisations in Go.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12176-1.html) [#]: subject: (Inlining optimisations in Go) [#]: via: (https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go) [#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) From b87a3977819e510ed01b8289ed34442498420839 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 3 May 2020 00:58:43 +0800 Subject: [PATCH 0569/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200502=20Mid-?= =?UTF-8?q?stack=20inlining=20in=20Go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200502 Mid-stack inlining in Go.md --- .../tech/20200502 Mid-stack inlining in Go.md | 211 ++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 sources/tech/20200502 Mid-stack inlining in Go.md diff --git a/sources/tech/20200502 Mid-stack inlining in Go.md b/sources/tech/20200502 Mid-stack inlining in Go.md new file mode 100644 index 0000000000..e6172566ab --- /dev/null +++ b/sources/tech/20200502 Mid-stack inlining in Go.md @@ -0,0 +1,211 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Mid-stack inlining in Go) +[#]: via: (https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Mid-stack inlining in Go +====== + +In the [previous post][1] I discussed how leaf inlining allows the Go compiler to reduce the overhead of function calls and extend optimisation opportunities across function boundaries. In this post I’ll discuss the limits of inlining and leaf vs mid-stack inlining. + +### The limits of inlining + +Inlining a function into its caller removes the call’s overhead and increases the opportunity for the compiler to apply additional optimisations so the question should be asked, if some inlining is good, would more be better, _why not inline as much as possible?_ + +Inlining trades possibly larger program sizes for potentially faster execution time. The main reason to limit inlining is creating many inlined copies of a function can increase compile time and result in larger binaries for marginal gain. Even taking into account the opportunities for further optimisation, aggressive inlining tends to increase the size of, and the time too compile, the resulting binary. + +Inlining works best for [small functions][2] that do relatively little work compared to the overhead of calling them. As the size of a function grows, the time saved avoiding the call’s overhead diminishes relative to the work done inside the function. Larger functions tend to be more complex, thus the benefits of optimising their inlined forms vs in situ are reduced. + +### Inlining budget + +During compilation each function’s inlineabilty is calculated using what is known as the _inlining budget_[1][3]. The cost calculation can tricky too internalise but is broadly one unit per node in the AST for simple things like unary and binary operations but can be higher for complex operations like `make`. Consider this example: + +``` +package main + +func small() string { + s := "hello, " + "world!" + return s +} + +func large() string { + s := "a" + s += "b" + s += "c" + s += "d" + s += "e" + s += "f" + s += "g" + s += "h" + s += "i" + s += "j" + s += "k" + s += "l" + s += "m" + s += "n" + s += "o" + s += "p" + s += "q" + s += "r" + s += "s" + s += "t" + s += "u" + s += "v" + s += "w" + s += "x" + s += "y" + s += "z" + return s +} + +func main() { + small() + large() +} +``` + +Compiling this function with `-gcflags=-m=2` allows us to see the cost the compiler assigns to each function. + +``` +% go build -gcflags=-m=2 inl.go +# command-line-arguments +./inl.go:3:6: can inline small with cost 7 as: func() string { s := "hello, world!"; return s } +./inl.go:8:6: cannot inline large: function too complex: cost 82 exceeds budget 80 +./inl.go:38:6: can inline main with cost 68 as: func() { small(); large() } +./inl.go:39:7: inlining call to small func() string { s := "hello, world!"; return s } +``` + +The compiler determined that `func small()` can be inlined due to its cost of 7. `func large()` was determined to be too expensive. `func main()`has been marked as eligable and assigned a cost of 68; 7 from the body of `small`, 57 from the function call to `small` and the remainder in its own overhead. + +The inlining budget can be controlled to some degree with the `-gcflag=-l` flag. Currently the values that apply are: + + * `-gcflags=-l=0` is the default level of inlining. + * `-gcflags=-l` (or `-gcflags=-l=1`) disables inlining. + * `-gcflags=-l=2` and `-gcflags=-l=3` are currently unused and have no effect over `-gcflags=-l=0` + * `-gcflags=-l=4` reduces the cost for inlining non-leaf functions and calls through interfaces.[2][4] + + + +#### Hairy optimisations + +Some functions with a relatively low inlining cost may be ineligible because of their complexity. This is known as the function’s hairiness as the semantics of some operations are hard to reason about once inlined, for example `recover`, `break`. Others, like `select` and `go`, involve co-ordination with the runtime so the extra effort of inlining doesn’t pay for itself. + +The list of hairy statements also includes things like `for `and `range` which don’t have an inherently large cost, but simply haven’t been optimised yet. + +### Mid stack inlining + +Historically the Go compiler only performed leaf inlining–only functions which did not call other functions were eligible. In the context of the hairiness discussion previously, a function call would disqualify the function from being inlined. + +Enter mid stack inlining which, as its name implies, allows functions in the middle of a call stack to be inlined without requiring everything below them to be eligible. Mid stack inlining was introduced by David Lazar in Go 1.9 and improved in subsequent releases. [This presentation][5] goes into some of the difficulties with retaining the behaviour of stack traces and `runtime.Callers` in code paths that had been heavily inlined. + +We see an example of mid-stack inlining in the previous example. After inlining, `func main()` contains the body of `func small()` and a call to `func large()`, thus it is considered a non-leaf function. Historically this would have prevented it from being further inlined even though its combined cost was less than the inlining budget. + +The primary use case for mid stack inlining is to reduce the overhead of a path through the call stack. Consider this example: + +``` +package main + +import ( + "fmt" + "strconv" +) + +type Rectangle struct {} + +//go:noinline +func (r *Rectangle) Height() int { + h, _ := strconv.ParseInt("7", 10, 0) + return int(h) +} + +func (r *Rectangle) Width() int { + return 6 +} + +func (r *Rectangle) Area() int { return r.Height() * r.Width() } + +func main() { + var r Rectangle + fmt.Println(r.Area()) +} +``` + +In this example `r.Area()` is a simple function which calls two others. `r.Width()` can be inlined while `r.Height()`, simulated here with the `//go:noinline` annotation, cannot. [3][6] + +``` +% go build -gcflags='-m=2' square.go +# command-line-arguments +./square.go:12:6: cannot inline (*Rectangle).Height: marked go:noinline +./square.go:17:6: can inline (*Rectangle).Width with cost 2 as: method(*Rectangle) func() int { return 6 } +./square.go:21:6: can inline (*Rectangle).Area with cost 67 as: method(*Rectangle) func() int { return r.Height() * r.Width() } ./square.go:21:61: inlining call to (*Rectangle).Width method(*Rectangle) func() int { return 6 } +./square.go:23:6: cannot inline main: function too complex: cost 150 exceeds budget 80 +./square.go:25:20: inlining call to (*Rectangle).Area method(*Rectangle) func() int { return r.Height() * r.Width() } +./square.go:25:20: inlining call to (*Rectangle).Width method(*Rectangle) func() int { return 6 } +``` + +As the multiplication performed by `r.Area()` is cheap compared to the overhead of calling it, inlining `r.Area()`‘s single expression is a net win even if its downstream caller to `r.Height()` remains ineligible. + +#### Fast path inlining + +The most startling example of the power of mid-stack inlining comes from 2019 when [Carlo Alberto Ferraris improved the performance][7] of `sync.Mutex.Lock()` by allowing the fast path of the lock–the uncontended case–to be inlined into its caller. Prior to this change `sync.Mutex.Lock()` was a large function containing many hairy conditions which made it ineligible to be inlined. Even in the case where the lock was available, the caller had to pay the overhead of calling `sync.Mutex.Lock()`. + +Carlo’s change split `sync.Mutex.Lock()` into two functions (a process he dubbed _outlining_). The outer `sync.Mutex.Lock()` method now calls `sync/atomic.CompareAndSwapInt32()` and returns to the caller immediately if the CAS succeeds. If not, the function falls through to `sync.Mutex.lockSlow()` which handles the slow path required to register interest on the lock and park the goroutine.[4][8] + +``` +% go build -gcflags='-m=2 -l=0' sync 2>&1 | grep '(*Mutex).Lock' +../go/src/sync/mutex.go:72:6: can inline (*Mutex).Lock with cost 69 as: method(*Mutex) func() { if "sync/atomic".CompareAndSwapInt32(&m.state, 0, mutexLocked) { if race.Enabled {  }; return  }; m.lockSlow() } +``` + +By splitting the function into an easily inalienable outer function, falling through to a complex inner function to handle the slow path Carlo’s combined mid stack inlining and the [compiler’s support for intrinsic operations][9] to reduce the cost of an uncontended lock by 14%. Then he repeated the trick for an additional 9% saving in `sync.RWMutex.Unlock()`. + + 1. The budget the Go compiler applies to each function when considering if it is eligible for inlining changes release to release.[][10] + 2. Keep in mind that the compiler authors warn that “[Additional levels of inlining (beyond -l) may be buggy and are not supported”][11]. Caveat emptor.[][12] + 3. The compiler is powerful enough that it can inline complex functions like `strconv.ParseInt`. As a experiment, try removing the `//go:noinline` annotation and observe the result with `-gcflags=-m=2`.[][13] + 4. The expression `race.Enable` is a constant controlled by the `-race` flag passed to the `go` tool. It is `false` for normal builds which allows the compiler to elide those code paths entirely.[][14] + + + +#### Related posts: + + 1. [Inlining optimisations in Go][15] + 2. [Why is a Goroutine’s stack infinite ?][16] + 3. [Stack traces and the errors package][17] + 4. [What is the zero value, and why is it useful?][18] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go +[2]: https://medium.com/@joshsaintjacque/small-functions-considered-awesome-c95b3fd1812f +[3]: tmp.FyRthF1bbF#easy-footnote-bottom-1-4076 (The budget the Go compiler applies to each function when considering if it is eligible for inlining changes release to release.) +[4]: tmp.FyRthF1bbF#easy-footnote-bottom-2-4076 (Keep in mind that the compiler authors warn that “Additional levels of inlining (beyond -l) may be buggy and are not supported”. Caveat emptor.) +[5]: https://docs.google.com/presentation/d/1Wcblp3jpfeKwA0Y4FOmj63PW52M_qmNqlQkNaLj0P5o/edit#slide=id.p +[6]: tmp.FyRthF1bbF#easy-footnote-bottom-3-4076 (The compiler is powerful enough that it can inline complex functions like strconv.ParseInt. As a experiment, try removing the //go:noinline annotation and observe the result with -gcflags=-m=2.) +[7]: https://go-review.googlesource.com/c/go/+/148959 +[8]: tmp.FyRthF1bbF#easy-footnote-bottom-4-4076 (The expression race.Enable is a constant controlled by the -race flag passed to the go tool. It is false for normal builds which allows the compiler to elide those code paths entirely.) +[9]: https://dave.cheney.net/2019/08/20/go-compiler-intrinsics +[10]: tmp.FyRthF1bbF#easy-footnote-1-4076 +[11]: https://github.com/golang/go/blob/be08e10b3bc07f3a4e7b27f44d53d582e15fd6c7/src/cmd/compile/internal/gc/inl.go#L11 +[12]: tmp.FyRthF1bbF#easy-footnote-2-4076 +[13]: tmp.FyRthF1bbF#easy-footnote-3-4076 +[14]: tmp.FyRthF1bbF#easy-footnote-4-4076 +[15]: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go (Inlining optimisations in Go) +[16]: https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite (Why is a Goroutine’s stack infinite ?) +[17]: https://dave.cheney.net/2016/06/12/stack-traces-and-the-errors-package (Stack traces and the errors package) +[18]: https://dave.cheney.net/2013/01/19/what-is-the-zero-value-and-why-is-it-useful (What is the zero value, and why is it useful?) From 7d57f4e9f2ccc8a4f4ccb3f475230eb9c675056b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 3 May 2020 01:04:28 +0800 Subject: [PATCH 0570/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200502=20The?= =?UTF-8?q?=20real=20impact=20of=20canceling=20PyCon=20due=20to=20COVID-19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200502 The real impact of canceling PyCon due to COVID-19.md --- ...pact of canceling PyCon due to COVID-19.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20200502 The real impact of canceling PyCon due to COVID-19.md diff --git a/sources/tech/20200502 The real impact of canceling PyCon due to COVID-19.md b/sources/tech/20200502 The real impact of canceling PyCon due to COVID-19.md new file mode 100644 index 0000000000..aebbbf28c4 --- /dev/null +++ b/sources/tech/20200502 The real impact of canceling PyCon due to COVID-19.md @@ -0,0 +1,129 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The real impact of canceling PyCon due to COVID-19) +[#]: via: (https://opensource.com/article/20/5/pycon-covid-19) +[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg) + +The real impact of canceling PyCon due to COVID-19 +====== +An interview with Ewa Jodlowska on how the Python Software Foundation is +responding to the cancelation of in-person events. +![A dollar sign in a network][1] + +The Python Software Foundation (PSF) had to [cancel its popular PyCon US][2] event in response to COVID-19. I interviewed [Ewa Jodlowska][3], Executive Director of the PSF, to talk about the experience and see what we all can learn, and how we can be supportive of the non-profit that supports one of my favorite programming languages. + +### The impact on PSF employees + +I asked Jodlowska "how have you had to adjust your work in light of COVID-19?" + +In her response, the day-to-day didn't sound like much of a change. PSF staff "have always worked remotely." The organization practices a [fully remote work][4] culture and doesn’t have an office. The small staff of seven employees is well versed in collaborating outside of an office. + +Familiarity aside, the emotional impact of needing to cancel an event they put a year’s worth of planning into hurt. + +> **"We all believe in what we do. Which is particularly why we’re such a great small team. So it really impacted us emotionally and mentally. And it continues to."** + +We spoke about how the team is reliving what the days would have looked like if PyCon wasn't interrupted by COVID-19–keynotes would start _now_, the sponsor booths would be in full motion right _now_–and just how emotionally taxing it all was. Throughout the discussion, Jodlowska always came back to recognizing the staff for their resiliency and energy to pivot the event online. + +### The cascading impact of event cancellation + +Jodlowska has been incredibly transparent about the experience. In her March 31st [article on the financial outcome][5], she outlines it clearly: the Python Software Foundation would take a hit from the event cancelation.  + +Jodlowska notes that part of the challenge is that PyCon accounts for too much of the organization’s financial health. About 63% of the 2020 revenue was projected to come from the show. While that number is down from the [2017 estimate of 80%][6], it’s still a concern when in-person events will remain limited to keep attendees safe during the COVID-19 outbreak. + +> **"We don’t want to rely on one event**–**or events in general**–**to operate and provide community support."** + +The PSF board of directors is hard at work to look into the diversification of funding. In the meantime, PyCon remains essential to sustainability running the organization. + +### Community support makes all the difference + +It's at this point that Jodlowska again recognizes the incredible work of the PSF staff. They quickly pivoted the vision of the event, and the community of attendees, sponsors, and speakers were all supportive of the move. + +> **"[We] have been brought to tears many times by the generosity of our sponsors and our individual donors."** + +Jodlowska noted that the generosity of so many resulted in reducing the financial impact on the PSF. An incredible amount of Individual attendees are donating their registration costs to the PSF. They are also showing up across social media sites to participate in their own distributed virtual experience of PyCon.  + +Another important part of the community, the corporate sponsors of the show, are also showing up to support the non-profit. Many sponsors had already canceled physical presence at the show before the event was officially moved online. Some of them were kind enough, as Jodlowska noted, to donate the cost of sponsorship to the PSF. In a huge turn of events, the list of sponsors **grew** as the online event came together. + +> **[M]any sponsors have opted into participating in PyCon 2020 online. Because of this we have decreased the amount needed from our reserve by 77%! The PSF will now only need $141,713 from its financial reserve to get through 2020.** + +For more on the data side, see Jodlowska’s article _[Thank you to donors & sponsors][7]_. + +Support in all its forms led to the conference feeling like it is well on its way. Some sponsors are even moving to a virtual booth experience. + +> Since our sponsors can’t be with you in person, we’ve created a place to provide their content online - . [#PyCon2020][8] Gold Sponsor Weekly Python Exercise shared this video to introduce you to their offerings: . +> +> — PyCon US (@pycon) [April 18, 2020][9] + +Maybe most impressively, many speakers and tutorial instructors made the effort of recording their sessions. That’s helped PyCon to [gradually unfold online][10] with incredible educational content. The audience is still able to interact as well: YouTube comments are open for moderation so speakers can interact with their audience. + +Lastly, there remains an army of volunteers who shifted their in-person plans online and continue to help in any way possible. + +### Some of the surprising positives from this difficult change + +While it is without a doubt a challenging time for the organization, Jodlowska noted a number of positives that are unfolding due to this move to virtual. + +To start, the staff of the PSF “have never been closer,” as they bond over the experience and spend more time getting to know each other through weekly video calls and baking competitions. + +Jodlowska was inspired to get involved in another open source effort, [FOSS responders][11], who are helping organizations respond to the cancelation of events due to COVID-19. (If you’ve been affected as well, they are there to help.) + +The generosity mentioned above is a silver lining to the experience and encouraging to the hardworking team that uplifts the popular Python programming language. + +There is also a broader impact on participation in PyCon. While the final numbers are not in yet, an international audience has access to all of PyCon as it unfolds, which gives the entire world a chance to be part of an excellent event [I got to attend][12] last year. On the development side, Jodlowska mentioned that the [core-dev team][13] that maintains Python, who would normally meet in person, shifted to a virtual meeting. As a result of that shift, some participants got to attend that otherwise would not have had the opportunity to join in person. + +### How you can help the Python Software Foundation + +I reached out to Jodlowska because I am impressed with and supportive of their mission to support the Python community. If you want to support them as well, you have options: + + * Become a [free or supporting member][14] of the PSF to get involved in our future. + * [Sign up for the PSF’s free newsletter][15] to stay up to date. + * [Donate][16] directly to the PSF (and thank you to those that already have). + * Ask your employer to [sponsor the PSF][17]. + * Ask your employer if they match donations to 501(c)(3) non-profits, and ask for your donations to the PSF to be matched. + + + +Last but not least, participate in PyCon over the next few weeks. You can learn from all kinds of smart people on a range of topics like [Matt Harrison][18]’s [Hands-on Python for Programmers][19] that guides attendees through analyzing COVID-19 data to [Katie McLaughlin][20]’s thoughtful talk on [What is deployment, anyway?][21] + +Be sure to [review the full][10] list and engage with the amazing lineup of speakers. + +* * * + +_Are you part of a non-profit looking to connect with your open source community at this time of social distancing? Let me know at matt @ opensource.com._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/pycon-covid-19 + +作者:[Matthew Broberg][a] +选题:[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/mbbroberg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_whitehurst_money.png?itok=ls-SOzM0 (A dollar sign in a network) +[2]: https://pycon.blogspot.com/2020/03/pycon-us-2020-in-pittsburgh.html +[3]: https://www.python.org/psf/records/staff/ +[4]: https://opensource.com/tags/wfh +[5]: http://pyfound.blogspot.com/2020/03/psfs-projected-2020-financial-outcome.html +[6]: https://www.youtube.com/watch?v=79AIzbjLzdk +[7]: http://pyfound.blogspot.com/2020/04/thank-you-to-donors-sponsors.html +[8]: https://twitter.com/hashtag/PyCon2020?src=hash&ref_src=twsrc%5Etfw +[9]: https://twitter.com/pycon/status/1251563142641000455?ref_src=twsrc%5Etfw +[10]: https://us.pycon.org/2020/online/ +[11]: https://fossresponders.com/ +[12]: https://opensource.com/article/19/5/jupyterlab-python-developers-magic +[13]: https://devguide.python.org/coredev/ +[14]: https://www.python.org/psf/membership/ +[15]: https://www.python.org/psf/newsletter/ +[16]: https://www.python.org/psf/donations/ +[17]: https://www.python.org/psf/sponsorship/ +[18]: https://us.pycon.org/2020/speaker/profile/454/ +[19]: https://youtu.be/fuJcSNUMrW0 +[20]: https://opensource.com/users/glasnt +[21]: https://youtu.be/8vstov3Y7uE From 7b0dc6070f908efb5f530ff0402f989e22e18701 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 3 May 2020 08:05:15 +0800 Subject: [PATCH 0571/1809] Rename sources/tech/20200502 The real impact of canceling PyCon due to COVID-19.md to sources/talk/20200502 The real impact of canceling PyCon due to COVID-19.md --- ...20200502 The real impact of canceling PyCon due to COVID-19.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200502 The real impact of canceling PyCon due to COVID-19.md (100%) diff --git a/sources/tech/20200502 The real impact of canceling PyCon due to COVID-19.md b/sources/talk/20200502 The real impact of canceling PyCon due to COVID-19.md similarity index 100% rename from sources/tech/20200502 The real impact of canceling PyCon due to COVID-19.md rename to sources/talk/20200502 The real impact of canceling PyCon due to COVID-19.md From a1263fe89a6e2cfe11ad0b23b16a9a5a50f1818c Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Sun, 3 May 2020 09:41:50 +0800 Subject: [PATCH 0572/1809] APL --- sources/tech/20200502 Mid-stack inlining in Go.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200502 Mid-stack inlining in Go.md b/sources/tech/20200502 Mid-stack inlining in Go.md index e6172566ab..f34c7070d5 100644 --- a/sources/tech/20200502 Mid-stack inlining in Go.md +++ b/sources/tech/20200502 Mid-stack inlining in Go.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From de32773584c1cb37a129e405535b809a46b87bfb Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Sun, 3 May 2020 14:27:03 +0800 Subject: [PATCH 0573/1809] TSL --- .../tech/20200502 Mid-stack inlining in Go.md | 211 ------------------ .../tech/20200502 Mid-stack inlining in Go.md | 211 ++++++++++++++++++ 2 files changed, 211 insertions(+), 211 deletions(-) delete mode 100644 sources/tech/20200502 Mid-stack inlining in Go.md create mode 100644 translated/tech/20200502 Mid-stack inlining in Go.md diff --git a/sources/tech/20200502 Mid-stack inlining in Go.md b/sources/tech/20200502 Mid-stack inlining in Go.md deleted file mode 100644 index f34c7070d5..0000000000 --- a/sources/tech/20200502 Mid-stack inlining in Go.md +++ /dev/null @@ -1,211 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Mid-stack inlining in Go) -[#]: via: (https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go) -[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) - -Mid-stack inlining in Go -====== - -In the [previous post][1] I discussed how leaf inlining allows the Go compiler to reduce the overhead of function calls and extend optimisation opportunities across function boundaries. In this post I’ll discuss the limits of inlining and leaf vs mid-stack inlining. - -### The limits of inlining - -Inlining a function into its caller removes the call’s overhead and increases the opportunity for the compiler to apply additional optimisations so the question should be asked, if some inlining is good, would more be better, _why not inline as much as possible?_ - -Inlining trades possibly larger program sizes for potentially faster execution time. The main reason to limit inlining is creating many inlined copies of a function can increase compile time and result in larger binaries for marginal gain. Even taking into account the opportunities for further optimisation, aggressive inlining tends to increase the size of, and the time too compile, the resulting binary. - -Inlining works best for [small functions][2] that do relatively little work compared to the overhead of calling them. As the size of a function grows, the time saved avoiding the call’s overhead diminishes relative to the work done inside the function. Larger functions tend to be more complex, thus the benefits of optimising their inlined forms vs in situ are reduced. - -### Inlining budget - -During compilation each function’s inlineabilty is calculated using what is known as the _inlining budget_[1][3]. The cost calculation can tricky too internalise but is broadly one unit per node in the AST for simple things like unary and binary operations but can be higher for complex operations like `make`. Consider this example: - -``` -package main - -func small() string { - s := "hello, " + "world!" - return s -} - -func large() string { - s := "a" - s += "b" - s += "c" - s += "d" - s += "e" - s += "f" - s += "g" - s += "h" - s += "i" - s += "j" - s += "k" - s += "l" - s += "m" - s += "n" - s += "o" - s += "p" - s += "q" - s += "r" - s += "s" - s += "t" - s += "u" - s += "v" - s += "w" - s += "x" - s += "y" - s += "z" - return s -} - -func main() { - small() - large() -} -``` - -Compiling this function with `-gcflags=-m=2` allows us to see the cost the compiler assigns to each function. - -``` -% go build -gcflags=-m=2 inl.go -# command-line-arguments -./inl.go:3:6: can inline small with cost 7 as: func() string { s := "hello, world!"; return s } -./inl.go:8:6: cannot inline large: function too complex: cost 82 exceeds budget 80 -./inl.go:38:6: can inline main with cost 68 as: func() { small(); large() } -./inl.go:39:7: inlining call to small func() string { s := "hello, world!"; return s } -``` - -The compiler determined that `func small()` can be inlined due to its cost of 7. `func large()` was determined to be too expensive. `func main()`has been marked as eligable and assigned a cost of 68; 7 from the body of `small`, 57 from the function call to `small` and the remainder in its own overhead. - -The inlining budget can be controlled to some degree with the `-gcflag=-l` flag. Currently the values that apply are: - - * `-gcflags=-l=0` is the default level of inlining. - * `-gcflags=-l` (or `-gcflags=-l=1`) disables inlining. - * `-gcflags=-l=2` and `-gcflags=-l=3` are currently unused and have no effect over `-gcflags=-l=0` - * `-gcflags=-l=4` reduces the cost for inlining non-leaf functions and calls through interfaces.[2][4] - - - -#### Hairy optimisations - -Some functions with a relatively low inlining cost may be ineligible because of their complexity. This is known as the function’s hairiness as the semantics of some operations are hard to reason about once inlined, for example `recover`, `break`. Others, like `select` and `go`, involve co-ordination with the runtime so the extra effort of inlining doesn’t pay for itself. - -The list of hairy statements also includes things like `for `and `range` which don’t have an inherently large cost, but simply haven’t been optimised yet. - -### Mid stack inlining - -Historically the Go compiler only performed leaf inlining–only functions which did not call other functions were eligible. In the context of the hairiness discussion previously, a function call would disqualify the function from being inlined. - -Enter mid stack inlining which, as its name implies, allows functions in the middle of a call stack to be inlined without requiring everything below them to be eligible. Mid stack inlining was introduced by David Lazar in Go 1.9 and improved in subsequent releases. [This presentation][5] goes into some of the difficulties with retaining the behaviour of stack traces and `runtime.Callers` in code paths that had been heavily inlined. - -We see an example of mid-stack inlining in the previous example. After inlining, `func main()` contains the body of `func small()` and a call to `func large()`, thus it is considered a non-leaf function. Historically this would have prevented it from being further inlined even though its combined cost was less than the inlining budget. - -The primary use case for mid stack inlining is to reduce the overhead of a path through the call stack. Consider this example: - -``` -package main - -import ( - "fmt" - "strconv" -) - -type Rectangle struct {} - -//go:noinline -func (r *Rectangle) Height() int { - h, _ := strconv.ParseInt("7", 10, 0) - return int(h) -} - -func (r *Rectangle) Width() int { - return 6 -} - -func (r *Rectangle) Area() int { return r.Height() * r.Width() } - -func main() { - var r Rectangle - fmt.Println(r.Area()) -} -``` - -In this example `r.Area()` is a simple function which calls two others. `r.Width()` can be inlined while `r.Height()`, simulated here with the `//go:noinline` annotation, cannot. [3][6] - -``` -% go build -gcflags='-m=2' square.go -# command-line-arguments -./square.go:12:6: cannot inline (*Rectangle).Height: marked go:noinline -./square.go:17:6: can inline (*Rectangle).Width with cost 2 as: method(*Rectangle) func() int { return 6 } -./square.go:21:6: can inline (*Rectangle).Area with cost 67 as: method(*Rectangle) func() int { return r.Height() * r.Width() } ./square.go:21:61: inlining call to (*Rectangle).Width method(*Rectangle) func() int { return 6 } -./square.go:23:6: cannot inline main: function too complex: cost 150 exceeds budget 80 -./square.go:25:20: inlining call to (*Rectangle).Area method(*Rectangle) func() int { return r.Height() * r.Width() } -./square.go:25:20: inlining call to (*Rectangle).Width method(*Rectangle) func() int { return 6 } -``` - -As the multiplication performed by `r.Area()` is cheap compared to the overhead of calling it, inlining `r.Area()`‘s single expression is a net win even if its downstream caller to `r.Height()` remains ineligible. - -#### Fast path inlining - -The most startling example of the power of mid-stack inlining comes from 2019 when [Carlo Alberto Ferraris improved the performance][7] of `sync.Mutex.Lock()` by allowing the fast path of the lock–the uncontended case–to be inlined into its caller. Prior to this change `sync.Mutex.Lock()` was a large function containing many hairy conditions which made it ineligible to be inlined. Even in the case where the lock was available, the caller had to pay the overhead of calling `sync.Mutex.Lock()`. - -Carlo’s change split `sync.Mutex.Lock()` into two functions (a process he dubbed _outlining_). The outer `sync.Mutex.Lock()` method now calls `sync/atomic.CompareAndSwapInt32()` and returns to the caller immediately if the CAS succeeds. If not, the function falls through to `sync.Mutex.lockSlow()` which handles the slow path required to register interest on the lock and park the goroutine.[4][8] - -``` -% go build -gcflags='-m=2 -l=0' sync 2>&1 | grep '(*Mutex).Lock' -../go/src/sync/mutex.go:72:6: can inline (*Mutex).Lock with cost 69 as: method(*Mutex) func() { if "sync/atomic".CompareAndSwapInt32(&m.state, 0, mutexLocked) { if race.Enabled {  }; return  }; m.lockSlow() } -``` - -By splitting the function into an easily inalienable outer function, falling through to a complex inner function to handle the slow path Carlo’s combined mid stack inlining and the [compiler’s support for intrinsic operations][9] to reduce the cost of an uncontended lock by 14%. Then he repeated the trick for an additional 9% saving in `sync.RWMutex.Unlock()`. - - 1. The budget the Go compiler applies to each function when considering if it is eligible for inlining changes release to release.[][10] - 2. Keep in mind that the compiler authors warn that “[Additional levels of inlining (beyond -l) may be buggy and are not supported”][11]. Caveat emptor.[][12] - 3. The compiler is powerful enough that it can inline complex functions like `strconv.ParseInt`. As a experiment, try removing the `//go:noinline` annotation and observe the result with `-gcflags=-m=2`.[][13] - 4. The expression `race.Enable` is a constant controlled by the `-race` flag passed to the `go` tool. It is `false` for normal builds which allows the compiler to elide those code paths entirely.[][14] - - - -#### Related posts: - - 1. [Inlining optimisations in Go][15] - 2. [Why is a Goroutine’s stack infinite ?][16] - 3. [Stack traces and the errors package][17] - 4. [What is the zero value, and why is it useful?][18] - - - --------------------------------------------------------------------------------- - -via: https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go - -作者:[Dave Cheney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://dave.cheney.net/author/davecheney -[b]: https://github.com/lujun9972 -[1]: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go -[2]: https://medium.com/@joshsaintjacque/small-functions-considered-awesome-c95b3fd1812f -[3]: tmp.FyRthF1bbF#easy-footnote-bottom-1-4076 (The budget the Go compiler applies to each function when considering if it is eligible for inlining changes release to release.) -[4]: tmp.FyRthF1bbF#easy-footnote-bottom-2-4076 (Keep in mind that the compiler authors warn that “Additional levels of inlining (beyond -l) may be buggy and are not supported”. Caveat emptor.) -[5]: https://docs.google.com/presentation/d/1Wcblp3jpfeKwA0Y4FOmj63PW52M_qmNqlQkNaLj0P5o/edit#slide=id.p -[6]: tmp.FyRthF1bbF#easy-footnote-bottom-3-4076 (The compiler is powerful enough that it can inline complex functions like strconv.ParseInt. As a experiment, try removing the //go:noinline annotation and observe the result with -gcflags=-m=2.) -[7]: https://go-review.googlesource.com/c/go/+/148959 -[8]: tmp.FyRthF1bbF#easy-footnote-bottom-4-4076 (The expression race.Enable is a constant controlled by the -race flag passed to the go tool. It is false for normal builds which allows the compiler to elide those code paths entirely.) -[9]: https://dave.cheney.net/2019/08/20/go-compiler-intrinsics -[10]: tmp.FyRthF1bbF#easy-footnote-1-4076 -[11]: https://github.com/golang/go/blob/be08e10b3bc07f3a4e7b27f44d53d582e15fd6c7/src/cmd/compile/internal/gc/inl.go#L11 -[12]: tmp.FyRthF1bbF#easy-footnote-2-4076 -[13]: tmp.FyRthF1bbF#easy-footnote-3-4076 -[14]: tmp.FyRthF1bbF#easy-footnote-4-4076 -[15]: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go (Inlining optimisations in Go) -[16]: https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite (Why is a Goroutine’s stack infinite ?) -[17]: https://dave.cheney.net/2016/06/12/stack-traces-and-the-errors-package (Stack traces and the errors package) -[18]: https://dave.cheney.net/2013/01/19/what-is-the-zero-value-and-why-is-it-useful (What is the zero value, and why is it useful?) diff --git a/translated/tech/20200502 Mid-stack inlining in Go.md b/translated/tech/20200502 Mid-stack inlining in Go.md new file mode 100644 index 0000000000..3d5bb1ee15 --- /dev/null +++ b/translated/tech/20200502 Mid-stack inlining in Go.md @@ -0,0 +1,211 @@ +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Mid-stack inlining in Go" +[#]: via: "https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go" +[#]: author: "Dave Cheney https://dave.cheney.net/author/davecheney" + +Go 中对栈中函数进行内联 +====== + +[上一篇文章][1]中我论述了叶子内联是怎样让 Go 编译器减少函数调用的开销的,以及延伸出了跨函数边界的优化的机会。本文中,我要论述内联的限制以及叶子与栈中内联的对比。 + +### 内联的限制 + +把函数内联到它的调用处消除了调用的开销,为编译器进行其他的优化提供了更好的机会,那么问题来了,既然内联这么好,内联得越多开销就越少,_为什么不尽可能多地内联呢?_ + +内联用可能的增加程序大小换来了更快的执行时间。限制内联的最主要原因是,创建太多的函数内联的备份会增加编译时间,并且作为边际效应会增加生成的二进制文件的大小。即使把内联带来的进一步的优化机会考虑在内,太激进的内联也可能会增加生成的二进制文件的大小和编译时间。 + +内联收益最大的是[小函数][2],相对于调用它们的开销来说,这些函数做很少的工作。随着函数大小的增长,函数内部做的工作与函数调用的开销相比省下的时间越来越少。函数越大通常越复杂,因此对它们内联后进行优化与不内联相比的收益没有(对小函数进行内联)那么大。 + +### 内联预算 + +在编译过程中,每个函数的内联能力是用_内联预算_计算的。开销的计算过程可以巧妙地内化,像一元和二元等简单操作,在抽象语法数(Abstract Syntax Tree,AST)中通常是每个节点一个单元,更复杂的操作如 `make` 可能单元更多。考虑下面的例子: + +```go +package main + +func small() string { + s := "hello, " + "world!" + return s +} + +func large() string { + s := "a" + s += "b" + s += "c" + s += "d" + s += "e" + s += "f" + s += "g" + s += "h" + s += "i" + s += "j" + s += "k" + s += "l" + s += "m" + s += "n" + s += "o" + s += "p" + s += "q" + s += "r" + s += "s" + s += "t" + s += "u" + s += "v" + s += "w" + s += "x" + s += "y" + s += "z" + return s +} + +func main() { + small() + large() +} +``` + +使用 `-gcflags=-m=2` 参数编译这个函数能让我们看到编译器分配给每个函数的开销: + +```bash +% go build -gcflags=-m=2 inl.go +# command-line-arguments +./inl.go:3:6: can inline small with cost 7 as: func() string { s := "hello, world!"; return s } +./inl.go:8:6: cannot inline large: function too complex: cost 82 exceeds budget 80 +./inl.go:38:6: can inline main with cost 68 as: func() { small(); large() } +./inl.go:39:7: inlining call to small func() string { s := "hello, world!"; return s } +``` + +编译器根据函数 `func small()` 的开销(7)决定可以对它内联,而`func large()` 的开销太大,编译器决定不进行内联。`func main()` 被标记为适合内联的,分配了 68 的开销;其中 `small` 占用 7,调用 `small` 函数占用 57,剩余的(4)是它自己的开销。 + +可以用 `-gcflag=-l` 参数控制内联预算的等级。下面是可使用的值: + + * `-gcflags=-l=0` 默认的内联等级。 + * `-gcflags=-l` (或 `-gcflags=-l=1`) 取消内联。 + * `-gcflags=-l=2` 和 `-gcflags=-l=3` 现在已经不使用了。不影响 `-gcflags=-l=0` + * `-gcflags=-l=4` 减少非叶子函数和通过接口调用的函数的开销。[2][4] + + + +#### 难以理解的优化 + +一些函数虽然内联的开销很小,但由于太复杂它们仍不适合进行内联。这就是函数的不确定性,因为一些操作的语义在内联后很难去推导,如 `recover`,`break`。其他的操作,如 `select` 和 `go` 涉及运行时的协调,因此内联后引入的额外的开销不能抵消内联带来的收益。 + +难理解的语句也包括 `for` 和 `range`,这些语句不一定开销很大,但目前为止还没有对它们进行优化。 + +### 栈中函数优化 + +在过去,Go 编译器只对叶子函数进行内联 — 只有那些不调用其他函数的函数才有资格。在上一段难以理解的的语句的探讨内容中,一次函数调用会让这个函数失去内联的资格。 + +进入栈中进行内联,就像它的名字一样,能内联在函数调用栈中间的函数,不需要先让它下面的所有的函数都被标记为有资格内联的。栈中内联是 David Lazar 在 Go 1.9 中引入的,并在随后的版本中做了改进。[这篇文章][5]深入探究保留栈追踪的表现和被深度内联后的代码路径里的 `runtime.Caller` 们的难点。 + +在前面的例子中我们看到了栈中函数内联。内联后,`func main()` 包含了 `func small()` 的函数体和对 `func large()` 的一次调用,因此它被判定为非叶子函数。在过去,这会阻止它被继续内联,虽然它的联合开销小于内联预算。 + +栈中内联的最主要的应用案例就是减少贯穿函数调用栈的开销。考虑下面的例子: + +```go +package main + +import ( + "fmt" + "strconv" +) + +type Rectangle struct {} + +//go:noinline +func (r *Rectangle) Height() int { + h, _ := strconv.ParseInt("7", 10, 0) + return int(h) +} + +func (r *Rectangle) Width() int { + return 6 +} + +func (r *Rectangle) Area() int { return r.Height() * r.Width() } + +func main() { + var r Rectangle + fmt.Println(r.Area()) +} +``` + +在这个例子中, `r.Area()` 是个简单的函数,调用了两个函数。`r.Width()` 可以被内联,`r.Height()` 这里用 `//go:noinline` 指令标注了,不能被内联。[3][6] + +```bash +% go build -gcflags='-m=2' square.go +# command-line-arguments +./square.go:12:6: cannot inline (*Rectangle).Height: marked go:noinline +./square.go:17:6: can inline (*Rectangle).Width with cost 2 as: method(*Rectangle) func() int { return 6 } +./square.go:21:6: can inline (*Rectangle).Area with cost 67 as: method(*Rectangle) func() int { return r.Height() * r.Width() } ./square.go:21:61: inlining call to (*Rectangle).Width method(*Rectangle) func() int { return 6 } +./square.go:23:6: cannot inline main: function too complex: cost 150 exceeds budget 80 +./square.go:25:20: inlining call to (*Rectangle).Area method(*Rectangle) func() int { return r.Height() * r.Width() } +./square.go:25:20: inlining call to (*Rectangle).Width method(*Rectangle) func() int { return 6 } +``` + +由于 `r.Area()` 中的乘法与调用它的开销相比并不大,因此内联它的表达式是纯收益,即使它的调用的下游 `r.Height()` 仍是没有内联资格的。 + +#### 快速路径内联 + +关于栈中内联的效果最令人吃惊的例子是 2019 年 [Carlo Alberto Ferraris][7] 通过允许把 `sync.Mutex.Lock()` 的快速路径,非竞争的情况,内联到它的调用方来[提升它的性能][7]。在这个修改之前,`sync.Mutex.Lock()` 是个很大的函数,包含很多难以理解的条件,使得它没有资格被内联。即使锁可用时,调用者也要付出调用 `sync.Mutex.Lock()` 的代价。 + +Carlo 把 `sync.Mutex.Lock()` 分成了两个函数(他自己称为*外联*)。外部的 `sync.Mutex.Lock()` 方法现在调用 `sync/atomic.CompareAndSwapInt32()` 且如果 CAS(Compare and Swap)成功了之后立即返回给调用者。如果 CAS 失败,函数会走到 `sync.Mutex.lockSlow()` 慢速路径,需要对锁进行注册,暂停 goroutine。[4][8] + +```bash +% go build -gcflags='-m=2 -l=0' sync 2>&1 | grep '(*Mutex).Lock' +../go/src/sync/mutex.go:72:6: can inline (*Mutex).Lock with cost 69 as: method(*Mutex) func() { if "sync/atomic".CompareAndSwapInt32(&m.state, 0, mutexLocked) { if race.Enabled {  }; return  }; m.lockSlow() } +``` + +通过把函数分割成一个简单的不能再被分割的外部函数,和(如果没走到外部函数就走到的)一个处理慢速路径的复杂的内部函数,Carlo 组合了栈中函数内联和[编译器对基础操作的支持][9],减少了非竞争锁 14% 的开销。之后他在 `sync.RWMutex.Unlock()` 重复这个技巧,节省了另外 9% 的开销。 + + 1. 不同发布版本中,在考虑该函数是否适合内联时,Go 编译器对同一函数的预算是不同的。[][10] + 2. 时刻记着编译器的作者警告过[“更高的内联等级(比 -l 更高)可能导致 bug 或不被支持”][11]。 Caveat emptor。[][12] + 3. 编译器有足够的能力来内联像 `strconv.ParseInt` 的复杂函数。作为一个实验,你可以尝试去掉 `//go:noinline` 注释,使用 `-gcflags=-m=2` 编译后观察。[][13] + 4. `race.Enable` 表达式是通过传递给 `go` 工具的 `-race` 参数控制的一个常量。对于普通编译,它的值是 `false`,此时编译器可以完全省略代码路径。[][14] + + + +#### 相关文章: + + 1. [Go 中的内联优化][15] + 2. [goroutine 的栈为什么会无限增长?][16] + 3. [栈追踪和 errors 包][17] + 4. [零值是什么,为什么它很有用?][18] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go +[2]: https://medium.com/@joshsaintjacque/small-functions-considered-awesome-c95b3fd1812f +[3]: tmp.FyRthF1bbF#easy-footnote-bottom-1-4076 "The budget the Go compiler applies to each function when considering if it is eligible for inlining changes release to release." +[4]: tmp.FyRthF1bbF#easy-footnote-bottom-2-4076 "Keep in mind that the compiler authors warn that “Additional levels of inlining (beyond -l) may be buggy and are not supported”. Caveat emptor." +[5]: https://docs.google.com/presentation/d/1Wcblp3jpfeKwA0Y4FOmj63PW52M_qmNqlQkNaLj0P5o/edit#slide=id.p +[6]: tmp.FyRthF1bbF#easy-footnote-bottom-3-4076 "The compiler is powerful enough that it can inline complex functions like strconv.ParseInt. As a experiment, try removing the //go:noinline annotation and observe the result with -gcflags=-m=2." +[7]: https://go-review.googlesource.com/c/go/+/148959 +[8]: tmp.FyRthF1bbF#easy-footnote-bottom-4-4076 "The expression race.Enable is a constant controlled by the -race flag passed to the go tool. It is false for normal builds which allows the compiler to elide those code paths entirely." +[9]: https://dave.cheney.net/2019/08/20/go-compiler-intrinsics +[10]: tmp.FyRthF1bbF#easy-footnote-1-4076 +[11]: https://github.com/golang/go/blob/be08e10b3bc07f3a4e7b27f44d53d582e15fd6c7/src/cmd/compile/internal/gc/inl.go#L11 +[12]: tmp.FyRthF1bbF#easy-footnote-2-4076 +[13]: tmp.FyRthF1bbF#easy-footnote-3-4076 +[14]: tmp.FyRthF1bbF#easy-footnote-4-4076 +[15]: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go "Inlining optimisations in Go" +[16]: https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite "Why is a Goroutine’s stack infinite ?" +[17]: https://dave.cheney.net/2016/06/12/stack-traces-and-the-errors-package "Stack traces and the errors package" +[18]: https://dave.cheney.net/2013/01/19/what-is-the-zero-value-and-why-is-it-useful "What is the zero value, and why is it useful?" From 3af05630e965137ceec70d80d00915149c699e41 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Sun, 3 May 2020 14:29:59 +0800 Subject: [PATCH 0574/1809] TSL --- .../tech/20200502 Mid-stack inlining in Go.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/tech/20200502 Mid-stack inlining in Go.md b/translated/tech/20200502 Mid-stack inlining in Go.md index 3d5bb1ee15..9d8edcab43 100644 --- a/translated/tech/20200502 Mid-stack inlining in Go.md +++ b/translated/tech/20200502 Mid-stack inlining in Go.md @@ -1,11 +1,11 @@ -[#]: collector: "lujun9972" -[#]: translator: "lxbwolf" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " -[#]: subject: "Mid-stack inlining in Go" -[#]: via: "https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go" -[#]: author: "Dave Cheney https://dave.cheney.net/author/davecheney" +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Mid-stack inlining in Go) +[#]: via: (https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) Go 中对栈中函数进行内联 ====== @@ -184,7 +184,7 @@ via: https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go 作者:[Dave Cheney][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[lxbwolf](https://github.com/lxbwolf) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -193,19 +193,19 @@ via: https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go [b]: https://github.com/lujun9972 [1]: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go [2]: https://medium.com/@joshsaintjacque/small-functions-considered-awesome-c95b3fd1812f -[3]: tmp.FyRthF1bbF#easy-footnote-bottom-1-4076 "The budget the Go compiler applies to each function when considering if it is eligible for inlining changes release to release." -[4]: tmp.FyRthF1bbF#easy-footnote-bottom-2-4076 "Keep in mind that the compiler authors warn that “Additional levels of inlining (beyond -l) may be buggy and are not supported”. Caveat emptor." +[3]: tmp.FyRthF1bbF#easy-footnote-bottom-1-4076 (The budget the Go compiler applies to each function when considering if it is eligible for inlining changes release to release.) +[4]: tmp.FyRthF1bbF#easy-footnote-bottom-2-4076 (Keep in mind that the compiler authors warn that “Additional levels of inlining (beyond -l) may be buggy and are not supported”. Caveat emptor.) [5]: https://docs.google.com/presentation/d/1Wcblp3jpfeKwA0Y4FOmj63PW52M_qmNqlQkNaLj0P5o/edit#slide=id.p -[6]: tmp.FyRthF1bbF#easy-footnote-bottom-3-4076 "The compiler is powerful enough that it can inline complex functions like strconv.ParseInt. As a experiment, try removing the //go:noinline annotation and observe the result with -gcflags=-m=2." +[6]: tmp.FyRthF1bbF#easy-footnote-bottom-3-4076 (The compiler is powerful enough that it can inline complex functions like strconv.ParseInt. As a experiment, try removing the //go:noinline annotation and observe the result with -gcflags=-m=2.) [7]: https://go-review.googlesource.com/c/go/+/148959 -[8]: tmp.FyRthF1bbF#easy-footnote-bottom-4-4076 "The expression race.Enable is a constant controlled by the -race flag passed to the go tool. It is false for normal builds which allows the compiler to elide those code paths entirely." +[8]: tmp.FyRthF1bbF#easy-footnote-bottom-4-4076 (The expression race.Enable is a constant controlled by the -race flag passed to the go tool. It is false for normal builds which allows the compiler to elide those code paths entirely.) [9]: https://dave.cheney.net/2019/08/20/go-compiler-intrinsics [10]: tmp.FyRthF1bbF#easy-footnote-1-4076 [11]: https://github.com/golang/go/blob/be08e10b3bc07f3a4e7b27f44d53d582e15fd6c7/src/cmd/compile/internal/gc/inl.go#L11 [12]: tmp.FyRthF1bbF#easy-footnote-2-4076 [13]: tmp.FyRthF1bbF#easy-footnote-3-4076 [14]: tmp.FyRthF1bbF#easy-footnote-4-4076 -[15]: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go "Inlining optimisations in Go" -[16]: https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite "Why is a Goroutine’s stack infinite ?" -[17]: https://dave.cheney.net/2016/06/12/stack-traces-and-the-errors-package "Stack traces and the errors package" -[18]: https://dave.cheney.net/2013/01/19/what-is-the-zero-value-and-why-is-it-useful "What is the zero value, and why is it useful?" +[15]: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go (Inlining optimisations in Go) +[16]: https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite (Why is a Goroutine’s stack infinite ?) +[17]: https://dave.cheney.net/2016/06/12/stack-traces-and-the-errors-package (Stack traces and the errors package) +[18]: https://dave.cheney.net/2013/01/19/what-is-the-zero-value-and-why-is-it-useful (What is the zero value, and why is it useful?) From 6fbca396bde6e561ed89989d89194f3b424f3188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sun, 3 May 2020 14:50:41 +0800 Subject: [PATCH 0575/1809] Translated --- ...7 How to compress files on Linux 5 ways.md | 207 ------------------ ...7 How to compress files on Linux 5 ways.md | 207 ++++++++++++++++++ 2 files changed, 207 insertions(+), 207 deletions(-) delete mode 100644 sources/tech/20200417 How to compress files on Linux 5 ways.md create mode 100644 translated/tech/20200417 How to compress files on Linux 5 ways.md diff --git a/sources/tech/20200417 How to compress files on Linux 5 ways.md b/sources/tech/20200417 How to compress files on Linux 5 ways.md deleted file mode 100644 index f71e90f9fc..0000000000 --- a/sources/tech/20200417 How to compress files on Linux 5 ways.md +++ /dev/null @@ -1,207 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to compress files on Linux 5 ways) -[#]: via: (https://www.networkworld.com/article/3538471/how-to-compress-files-on-linux-5-ways.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -How to compress files on Linux 5 ways -====== -There are a number of tools that you use to compress files on Linux systems, but they don't all behave the same way or yield the same level of compression. In this post, we compare five of them. -Getty Images - -There are quite a few commands on Linux for compressing files. One of the newest and most effective is **xz**, but they all have advantages for both saving disk space and preserving files for later use. In this post, we compare the compression commands and point out the significant differences. - -### tar - -The tar command is not specifically a compression command. It’s generally used to pull a number of files into a single file for easy transport to another system or to back the files up as a related group. It also provides compression as a feature, which makes a lot of sense, and the addition of the **z** compression option is available to make this happen. - -When compression is added to a **tar** command with the **z** option, tar uses **gzip** to do the compressing. - -You can use **tar** to compress a single file as easily as a group though this offers no particular advantage over using **gzip** directly. To use **tar** for this, just identify the file as you would a group of files with a “tar cfz newtarfile filename” command like this: - -``` -$ tar cfz bigfile.tgz bigfile - ^ ^ - | | - +- new file +- file to be compressed - -$ ls -l bigfile* --rw-rw-r-- 1 shs shs 103270400 Apr 16 16:09 bigfile --rw-rw-r-- 1 shs shs 21608325 Apr 16 16:08 bigfile.tgz -``` - -Note the significant reduction in the file size. - -If you prefer, you can use the **tar.gz** extension which might make the character of the file a bit more obvious, but most Linux users will probably recognize **tgz** as meaning the same thing – the combination of **tar** and **gz** to indicate that the file is a compressed tar file. You will be left with both the original file and the compressed file once the compression is complete. - -To collect a number of files together and compress the resultant “tar ball” in one command, use the same basic syntax, but specify the files to be included as a group in place of the single file. Here’s an example: - -[][1] - -``` -$ tar cfz bin.tgz bin/* - ^ ^ - | +-- files to include - + new file -``` - -### zip - -The **zip** command creates a compressed file while leaving the original file intact. The syntax is straightforward except that, as with **tar**, you have to remember that your original file should be the last argument on the command line. - -``` -$ zip ./bigfile.zip bigfile -updating: bigfile (deflated 79%) -$ ls -l bigfile bigfile.zip --rw-rw-r-- 1 shs shs 103270400 Apr 16 11:18 bigfile --rw-rw-r-- 1 shs shs 21606889 Apr 16 11:19 bigfile.zip -``` - -### gzip - -The **gzip** command is very simple to use. You just type "gzip" followed by the name of the file you want to compress. Unlike the commands described above, **gzip** will encrypt the files "in place". In other words, the original file will be replaced by the encrypted file. - -``` -$ gzip bigfile -$ ls -l bigfile* --rw-rw-r-- 1 shs shs 21606751 Apr 15 17:57 bigfile.gz -``` - -### bzip2 - -As with the **gzip** command, **bzip2** will compress the file that you select "in place", leaving only the original file. - -``` -$ bzip bigfile -$ ls -l bigfile* --rw-rw-r-- 1 shs shs 18115234 Apr 15 17:57 bigfile.bz2 -``` - -### xz - -A relative newcomer to the compression command team, **xz** is a front runner in terms of how well it compresses files. Like the two previous commands, you only need to supply the file name to the command. Again, the original file is compressed in place. - -``` -$ xz bigfile -$ ls -l bigfile* --rw-rw-r-- 1 shs shs 13427236 Apr 15 17:30 bigfile.xz -``` - -For large files, you are likely to notice that **xz** takes longer to run than other compression commands, but the compression results are very impressive. - -### Comparisons to consider - -Most people have heard it said that "size isn't everything". So, let's compare file size as well as some other issues to be considered when you make plans for how you want to compress your files. - -The stats shown below all relate to compressing the single file – bigfile – used in the example commands shown above. This file is a large and fairly random text file. Compression rates will depend to some extent on the content of the files. - -#### Size reduction - -When compared, the various compression commands shown above yielded the following results. The percentages represent how the compressed files compare with the original file. - -``` --rw-rw-r-- 1 shs shs 103270400 Apr 16 14:01 bigfile ------------------------------------------------------- --rw-rw-r-- 1 shs shs 18115234 Apr 16 13:59 bigfile.bz2 ~17% --rw-rw-r-- 1 shs shs 21606751 Apr 16 14:00 bigfile.gz ~21% --rw-rw-r-- 1 shs shs 21608322 Apr 16 13:59 bigfile.tgz ~21% --rw-rw-r-- 1 shs shs 13427236 Apr 16 14:00 bigfile.xz ~13% --rw-rw-r-- 1 shs shs 21606889 Apr 16 13:59 bigfile.zip ~21% -``` - -The **xz** commands wins, ending up at only 13% the size of the original file, but all of these compression commands reduced the original file size quite significantly. - -#### Whether the original files are replaced - -The **bzip2**, **gzip** and **xz** commands all replace the original files with compressed versions. The **tar** and **zip** commands to not. - -#### Run time - -The **xz** command seems to take more time than the other commands to encrypt the files. For bigfile, the approximate times were: - -``` -command run-time -tar 4.9 seconds -zip 5.2 seconds -bzip2 22.8 seconds -gzip 4.8 seconds -xz 50.4 seconds -``` - -Decompression times are likely to be considerably smaller than compression times. - -#### File permissions - -Regardless of what permissions you have set on your original file, permissions for the compressed file will be based on your **umask** setting, except for **bzip2** which retains the original file's permissions. - -#### Compatibility with Windows - -The **zip** command creates a file which can be used (i.e., decompressed) on Windows systems as well as Linux and other Unix systems without having to install other tools which may or may not be available. - -### Decompressing files - -The commands for decompressing files are similar to those used to compress the files. These commands would work for decompressing bigfile after the compression commands shown above were run. - - * tar: **tar xf bigfile.tgz** - * zip: **unzip bigfile.zip** - * gzip: **gunzip bigfile.gz** - * bzip2: **bunzip2 bigfile.gz2** - * xz: **xz -d bigfile.xz** or **unxz bigfile.xz** - - - -### Running your own compression comparisons - -If you'd like to run some tests on your own, grab a large but replaceable file and compress it using each of the commands shown above – preferably using a new subdirectory. You might have to first install **xz** if you want to include it in the tests.This script can make the comparison easier, but will likely take a few minutes to complete. - -``` -#!/bin/bash - -# ask user for filename -echo -n "filename> " -read filename - -# you need this because some commands will replace the original file -cp $filename $filename-2 - -# clean up first (in case previous results are still available) -rm $filename.* - -tar cvfz ./$filename.tgz $filename > /dev/null -zip $filename.zip $filename > /dev/null -bzip2 $filename -# recover original file -cp $filename-2 $filename -gzip $filename -# recover original file -cp $filename-2 $filename -xz $filename - -# show results -ls -l $filename.* - -# replace the original file -mv $filename-2 $filename -``` - -Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3538471/how-to-compress-files-on-linux-5-ways.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) -[2]: https://www.facebook.com/NetworkWorld/ -[3]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20200417 How to compress files on Linux 5 ways.md b/translated/tech/20200417 How to compress files on Linux 5 ways.md new file mode 100644 index 0000000000..e9ef6af572 --- /dev/null +++ b/translated/tech/20200417 How to compress files on Linux 5 ways.md @@ -0,0 +1,207 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to compress files on Linux 5 ways) +[#]: via: (https://www.networkworld.com/article/3538471/how-to-compress-files-on-linux-5-ways.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +在 Linux 上压缩文件的 5 种方法 +====== +在 Linux 系统上有很多可以用于压缩文件的工具,但是它们表现的行为或产生相同程度的压缩等级并不相同,在这篇文章中,我们比较其中的五个工具。 +Getty Images + +在 Linux 上有不少用于压缩文件的命令。最新最有效的一个方法是 **xz** ,但是所有的方法都有节省磁盘空间和为后期使用维护备份文件的优点。在这篇文章中,我们将比较压缩命令并指出显著的不同 。 + +### tar + +tar 命令不是专门的压缩命令。它通常用于将多个文件拉入一单个文件中,以便容易地传输到另一个系统,或者备份文件为一个相关的组。它也提供压缩作为一个功能,这是很明智的,附加的 **z** 压缩选项能够实现压缩文件。 + +当压缩过程被附加到一个使用 **z** 选项的 **tar** 命令时,tar 使用 **gzip** 来进行压缩。 + +你可以使用 **tar** 来压缩一个单个文件,就像压缩一个组一样容易,尽管这种操作与直接使用 **gzip** 相比没有特别的优势。为此,要使用 **tar** ,只需要使用一个 “tar cfz newtarfile filename” 命令来像你标识一个组一样标识文件,像这样: + +``` +$ tar cfz bigfile.tgz bigfile + ^ ^ + | | + +- 新的文件 +- 将被压缩的文件 + +$ ls -l bigfile* +-rw-rw-r-- 1 shs shs 103270400 Apr 16 16:09 bigfile +-rw-rw-r-- 1 shs shs 21608325 Apr 16 16:08 bigfile.tgz +``` + +注意,文件的大小显著减少。 + +如果你喜欢,你可以使用 **tar.gz** 扩展名,这可能会使文件的特征更加明显,但是大多数的 Linux 用户将很可能会意识到与 **tgz** 的意思是相同的东西 – **tar** 和 **gz** 的组合来显示文件是一个压缩的 tar 文件。在压缩完成后,将留下原始文件和压缩文件。 + +为收集很多文件在一起并在一个命令中压缩生成的 “tar ball” ,使用相同的语法,但是要指明将要被包含的文件来作为一个组,而不是单个文件。这里有一个示例: + +[][1] + +``` +$ tar cfz bin.tgz bin/* + ^ ^ + | +-- 将被包含的文件 + + 新的文件 +``` + +### zip + +**zip** 命令创建一个压缩文件,与此同时保留原始文件的完整性。语法像使用 **tar** 一样简单,只是你必需记住,你的原始文件名称应该是命令行上的最后一个参数。 + +``` +$ zip ./bigfile.zip bigfile +updating: bigfile (deflated 79%) +$ ls -l bigfile bigfile.zip +-rw-rw-r-- 1 shs shs 103270400 Apr 16 11:18 bigfile +-rw-rw-r-- 1 shs shs 21606889 Apr 16 11:19 bigfile.zip +``` + +### gzip + +**gzip** 命令非常容易使用。你只需要键入 "gzip" ,紧随其后的是你想要压缩的文件名称。不像上述描述的命令,**gzip** 将“就地”加密文件。换句话说,原始文件将被加密文件替换。 + +``` +$ gzip bigfile +$ ls -l bigfile* +-rw-rw-r-- 1 shs shs 21606751 Apr 15 17:57 bigfile.gz +``` + +### bzip2 + +像使用 **gzip** 命令一样,**bzip2** 将在你选的“合适位置”压缩文件,只留下原始文件保持原样离开。 + +``` +$ bzip bigfile +$ ls -l bigfile* +-rw-rw-r-- 1 shs shs 18115234 Apr 15 17:57 bigfile.bz2 +``` + +### xz + +压缩命令组中的一个相对较新的成员,**xz** 就如何更好的压缩文件而言是领跑者。像先前的两个命令一样,你只需要将文件名称补给到命令中。再强调一次,原始文件被就地压缩。 + +``` +$ xz bigfile +$ ls -l bigfile* +-rw-rw-r-- 1 shs shs 13427236 Apr 15 17:30 bigfile.xz +``` + +对于大文件来说,你可能会注意到 **xz** 将比其它的压缩命令花费更多的运行时间,但是压缩的结果却是非常令人赞叹的。 + +### 考虑对比性 + +大多数人都听说过 "文件大小不是万能的"。所以,让我们比较一下文件大小以及一些当你计划如何压缩文件时的问题。 + +下面显示的统计数据都与压缩单个文件相关,在上面显示的示例中使用 – bigfile – 。这个文件是一个大的且相当随机的文本文件。压缩率在一定程度上取决于文件的内容。 + +#### 大小减缩率 + +在比较期间,上面显示的各种压缩命产生下面的结果。百分比表示压缩文件对比原始文件。 + +``` +-rw-rw-r-- 1 shs shs 103270400 Apr 16 14:01 bigfile +------------------------------------------------------ +-rw-rw-r-- 1 shs shs 18115234 Apr 16 13:59 bigfile.bz2 ~17% +-rw-rw-r-- 1 shs shs 21606751 Apr 16 14:00 bigfile.gz ~21% +-rw-rw-r-- 1 shs shs 21608322 Apr 16 13:59 bigfile.tgz ~21% +-rw-rw-r-- 1 shs shs 13427236 Apr 16 14:00 bigfile.xz ~13% +-rw-rw-r-- 1 shs shs 21606889 Apr 16 13:59 bigfile.zip ~21% +``` + +**xz** 命令获胜,最终只有压缩文件大小的13%,但是这些所有的压缩命令都相当显著地减少原始文件的大小。 + +#### 是否替换原始文件 + +**bzip2**,**gzip** 和 **xz** 命令都将使用压缩文件替换原始文件。**tar** 和 **zip** 命令不替换。 + +#### 运行时间 + +**xz** 命令似乎比其它命令需要花费更多的时间来加密文件。对于 bigfile 来说,近似时间是: + +``` +命令 运行时间 +tar 4.9 秒 +zip 5.2 秒 +bzip2 22.8 秒 +gzip 4.8 秒 +xz 50.4 秒 +``` + +解压缩文件很可能比压缩时间要短得多。 + +#### 文件权限 + +不管你对压缩文件设置什么权限,压缩文件的权限将基于你的 **umask** 设置,除 **bzip2** 维持原始文件的权限外。 + +#### 与 Windows 的兼容性 + +**zip** 命令将创建一个可被使用的文件(例如,解压缩),在 Windows 系统上以及 Linux 和其它 Unix 系统上,无需安装其它可能可用或不可用的工具。 + +### 解压缩文件 + +解压缩文件的命令类似于这些压缩文件的命令。这些命令将在我们运行上述压缩命令后用于解压缩 bigfile 。 + + * tar: **tar xf bigfile.tgz** + * zip: **unzip bigfile.zip** + * gzip: **gunzip bigfile.gz** + * bzip2: **bunzip2 bigfile.gz2** + * xz: **xz -d bigfile.xz** 或 **unxz bigfile.xz** + + + +### 对比你自己运行的压缩 + +如果你想自己运行一些测试,抓取一个大的且可以替换的文件,并使用上面显示的每个命令来压缩它 – 最好使用一个新的子目录。你可能必需先安装 **xz** ,如果你想在测试中包含它的话。这个脚本可能更容易地压缩,但是将可能花费几分钟来完成。 + +``` +#!/bin/bash + +# 询问用户文件名称 +echo -n "filename> " +read filename + +# 你需要这个,因为一些命令将替换原始文件 +cp $filename $filename-2 + +# 先清理(以免先前的结果仍然可用) +rm $filename.* + +tar cvfz ./$filename.tgz $filename > /dev/null +zip $filename.zip $filename > /dev/null +bzip2 $filename +# 恢复原始文件 +cp $filename-2 $filename +gzip $filename +# 恢复原始文件 +cp $filename-2 $filename +xz $filename + +# 显示结果 +ls -l $filename.* + +# 替换原始文件 +mv $filename-2 $filename +``` + +加入 [Facebook][2] 和 [LinkedIn][3] 网络世界社区来评论那些最重要的话题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3538471/how-to-compress-files-on-linux-5-ways.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[2]: https://www.facebook.com/NetworkWorld/ +[3]: https://www.linkedin.com/company/network-world From 8e065c91dc13e4121408bfd8e1dcf28ee04bf11f Mon Sep 17 00:00:00 2001 From: "qfzy1233@163.com" Date: Sun, 3 May 2020 16:32:03 +0800 Subject: [PATCH 0576/1809] Update 20200424 16 Things to do After Installing Ubuntu 20.04.md --- ...ngs to do After Installing Ubuntu 20.04.md | 196 +++++++++--------- 1 file changed, 98 insertions(+), 98 deletions(-) diff --git a/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md b/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md index 5637651850..1b5d5ef5c3 100644 --- a/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md +++ b/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md @@ -7,218 +7,218 @@ [#]: via: (https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -16 Things to do After Installing Ubuntu 20.04 +安装完 Ubuntu 20.04 后要做的 16 件事 ====== -_**Here is a list of tweaks and things to do after installing Ubuntu 20.04, to get a smoother and better desktop Linux experience.**_ +_**以下是安装 Ubuntu 20.04 之后需要做的一些调整和事情,它将使你获得更流畅、更好的桌面 Linux 体验。**_ -[Ubuntu 20.04 LTS brings plenty of new features][1] and visual changes. If you choose to install Ubuntu 20.04, let me show you a few recommended steps that you can follow to get started with it. +[Ubuntu 20.04 LTS (长期支持版)带来了许多新的特性][1] 和观感上的变化。 如果你要安装 Ubuntu 20.04 ,让我向你展示一些推荐步骤便于你的使用。 -### 16 Things to do after installing Ubuntu 20.04 LTS “Focal Fossa” +### 安装完 Ubuntu 20.04 LTS “Focal Fossa”后要做的 16 件事 ![][2] -The steps I am going to mention here are my recommendation. You may ignore a few customization or tweaks if they don’t suit your need and interest. +我在这里要提到的步骤仅是我的建议。如果一些定制或调整不适合你的需要和兴趣,你可以忽略它们。 -Similarly, some steps may seem too simple but essential for someone completely new to Ubuntu. +同样的,有些步骤看起来很简单,但是对于一个 Ubuntu 新手来说是必要的。 -A number of suggestions here are suited for the default Ubuntu 20.04 with GNOME desktop. So please check [which Ubuntu version][3] and [which desktop environment][4] you are using. +这里的一些建议适用于启用 GNOME 作为默认桌面Ubuntu 20.04。所以请检查[Ubuntu版本][3]和[桌面环境][4]。 -Let’s get started with the list of things to do after installing Ubuntu 20.04 LTS codenamed Focal Fossa. +以下列表便是安装了代号为 Focal Fossa 的 Ubuntu 20.04 LTS 之后要做的事。 -#### 1\. Get your system ready by updating and enabling additional repos +#### 1\. 通过更新和启用额外的 repos 来准备您的系统 -The first thing you should do after installing Ubuntu or any other Linux distribution is to update it. Linux works on a local database of available packages. And this cache needs to be synced in order for you to be able to install any software. +安装Ubuntu或任何其他Linux发行版之后,你应该做的第一件事就是更新它。Linux 的可用包数据库工作于本地。这个缓存需要同步以便你能够安装任何软件。 -It is very easy to update Ubuntu. You can run the software updater from the menu (press Windows key and search for software updater): +升级Ubuntu非常简单。你可以运行软件更新从菜单( 按 Win 键并搜索软件更新): -![Software Updater in Ubuntu 20.04][5] +![Ubuntu 20.04 的软件升级中心][5] -You may also use the following command in the terminal to update your system: +你也可以在终端使用以下命令更新你的系统: ``` sudo apt update && sudo apt upgrade ``` -Next, you should make sure that you have [universe and multiverse repositories enabled][6]. You’ll have access to a lot more software with these repositories. I also recommend reading about [Ubuntu repositories][6] to learn the basic concept behind it. +接下来,您应该确保启用了[universe和multiverse存储库][6]。使用这些存储库,你可以访问更多的软件。我还推荐阅读关于[Ubuntu软件库][6]的书籍,以了解它背后的基本概念。 -Search for Software & Updates in the menu: +搜索软件和放大器;更新菜单: -![Software & Updates Settings][7] +![软件及更新设置项][7] -Make sure to check the boxes in front of the repositories: +请务必选中存储库前面的方框: -![Enable additional repositories][8] +![启用额外的存储库][8] -#### 2\. Install media codecs to play MP3, MPEG4 and other media files +#### 2\. 安装媒体解码器来播放MP3、MPEG4和其他格式媒体文件 -If you want to play media files like MP3, MPEG4, AVI etc, you’ll need to install media codecs. Ubuntu doesn’t install it by default because of copyright issues in various countries. +如果你想播放媒体文件,如MP3, MPEG4, AVI等,你需要安装媒体解码器。由于不同国家的版权问题,Ubuntu在默认情况下不会安装它。 -As an individual, you can install these media codecs easily [using the Ubuntu Restricted Extra package][9]. This will install media codecs, Adobe Flash player and [Microsoft True Type Fonts in your Ubuntu system][10]. +作为个人,你可以很容易地安装这些媒体编解码器[使用 Ubuntu 额外安装包][9]。这将安装媒体编解码器,Adobe Flash播放器和[微软 True Type 字体在您的Ubuntu系统][10]。 -You can install it by [clicking this link][11] (it will asked to be open in software center) or use this command: +你可以通过[点击这个链接][11](它将要求打开软件中心)来安装它,或者使用以下命令: ``` sudo apt install ubuntu-restricted-extras ``` -If you encounter the EULA or the license screen, remember to use the tab key to select between the options and then hit enter to confirm your choice. +如果遇到EULA或许可证界面,请记住使用tab键在选项之间进行选择,然后按enter键确认你的选择。 -![Press tab to select OK and press enter][12] +![按tab键选择OK并按enter键][12] -#### 3\. Install software from the software center or the web +#### 3\. 从软件中心或网络上安装软件 -Now that you have set up the repositories and updated the package cache, you should start installing software that you need. +现在已经设置了存储库并更新了包缓存,应该开始安装所需的软件了。 -There are several ways of [installing applications in Ubuntu][13]. The easiest and the official way is to use the Software Center. +有几种方法可以在Ubuntu中安装应用程序。最简单和正式的方法是使用软件中心。 -![Ubuntu Software Center][14] +![Ubuntu 软件中心][14] -If you want some recommendation about software, please refer to this extensive [list of Ubuntu applications for different purposes][15]. +如果你想要一些关于软件的建议,请参考这个扩展的[不同用途的Ubuntu应用程序列表][15]。 -Some software vendors provide .deb files to easily install their application. You may get the deb files from their website. For example, to [install Google Chrome on Ubuntu][16], you can get the deb file from its website and double click on it to start the installation. +一些软件供应商提供 .deb 文件来方便地安装他们的应用程序。你可以从他们的网站获得 deb 文件。例如,要[在 Ubuntu 上安装谷歌 Chrome ][16],你可以从它的网站上获得 deb 文件,双击它开始安装。 -#### 4\. Enjoy gaming with Steam Proton and GameMode +#### 4\. 享受 Steam Proton 和 GameModeEnjoy 上的游戏 -[Gaming on Linux][17] has come a long way. You are not restricted to a handful of games included by default. You can [install Steam on Ubuntu][18] and enjoy a good number of games. +[ Linux 上的游戏][17] 已经有了长足的发展。你不受限于自带的少数游戏。你可以[在 Ubuntu 上安装 Steam ][18]并享受许多游戏。 -[Steam’s new P][19][r][19][oton project][19] enables you to play a number of Windows-only games on Linux. In addition to that, Ubuntu 20.04 comes with [Feral Interactive’s GameMode][20] installed by default. +[Steam 新的 Proton 项目][19]可以让你在Linux上玩许多只适用于windows的游戏。除此之外,Ubuntu 20.04还默认安装了[Feral Interactive的游戏][20]。 -The GameMode automatically adjust Linux system performance to give more priority to games than other background processes. +游戏模式会自动调整Linux系统的性能,使游戏具有比其他后台进程更高的优先级。 -This means some games that support the GameMode (like [Rise of Tomb Raiders][21]) should have improved performance on Ubuntu. +这意味着一些支持游戏模式的游戏(如[古墓丽影崛起][21])在 Ubuntu 上的性能应该有所提高。 -#### 5\. Manage auto-updates (for intermediate and experts) +#### 5\. 管理自动更新(适用于进阶和专家) -Recently, Ubuntu has started to automatically download and install security updates that are essential to your system. This is a security feature as a regular user, you should leave it as it is, +最近,Ubuntu 已经开始自动下载和安装对你的系统至关重要的安全更新。这是一个安全功能,作为一个普通用户,你应该让它保持默认, -But if you like to do everything on your own and this auto-update is frequently leading you to [“Unable to lock the administration directory” error][22], maybe you can change the auto updates behavior. +但是,如果你喜欢自己进行配置更新,而这个自动更新经常导致你[“无法锁定管理目录”错误][22],也许你可以改变自动更新行为。 -You can opt for the Show immediately so that it notifies you of security updates as soon as they are available instead of automatically installing. +你可以选择更新是提示,以便它通知你的安全更新是否可用,而不是自动安装。 -![Control the auto updates settings][23] +![管理自动更新设置][23] -#### 6\. Control automatic suspend and screenlock for laptops +#### 6\. 控制电脑的自动挂起和屏幕锁定 -If you are using Ubuntu 20.04 on a laptop then you may want to pay attention to a few power and screenlock settings. +如果你在笔记本电脑上使用Ubuntu 20.04,那么你可能需要注意一些电源和屏幕锁定设置。 -If your laptop is on battery mode, Ubuntu will suspend the system after 20 minutes of inactivity. This is done to save battery power. Personally, I don’t like it and thus I disable it. +如果你的笔记本电脑是电池模式,Ubuntu会在20分钟不工作后休眠系统。这样做是为了节省电池电量。就我个人而言,我不喜欢它,因此我禁用了它。 -Similarly, if you leave your system for a few minutes, it automatically locks the screen. I don’t like this behavior as well so I prefer disabling it. +类似地,如果您离开系统几分钟,它会自动锁定屏幕。我也不喜欢这种行为,所以我宁愿禁用它。 -![Power Settings in Ubuntu 20.04][24] +![Ubuntu 20.04的电源设置][24] -#### 7\. Enjoy dark mode +#### 7\. 享受夜间模式 -One of the [most talked about features of Ubuntu 20.04][25] is the dark mode. You can enable the dark mode by going into Settings and selecting it under Appearance section. +一个[谈论最多的 Ubuntu 20.04 特性][25]是夜间模式。你可以通过进入设置并在外观部分中选择它来启用夜间模式。 -![Enable Dark Theme Ubuntu][26] +![开启夜间主题 Ubuntu ][26] -You may have to do some [additional tweaking to get full dark mode in Ubuntu 20.04][27]. +你可能需要做一些额外的调整来启用 Ubuntu 20.04 的深度夜间模式。 -#### 8\. Control desktop icons and launcher +#### 8\. 控制桌面图标和启动程序 -If you want a minimal looking desktop, you can disable the icons on the desktop. You can also disable the launcher from the left side and the appindicators in the top panel. +如果你想要一个最简的桌面,你可以禁用桌面上的图标。您还可以从左侧禁用启动程序,并在顶部面板中禁用软件状态栏。 -All this can be controlled via the new GNOME Extensions that is already available by default. +所有这些都可以通过默认的新 GNOME 扩展来控制。 ![][28] -By the way, you can also change the position of the launcher to the bottom or to the right by going to the Settings->Appearance. +顺便说一下,你也可以通过设置-外观来改变启动栏的位置到底部或者右边。 -#### 9\. Use emojis (smileys) and special characters or disable it from the search +#### 9\. 使用emojis(表情)和特殊字符,或从搜索中禁用它 -Ubuntu provides an easy way to use smiley or the emoticons. There is a dedicated application called Characters installed by default. It basically gives you [Unicode][29] of the emojis. +Ubuntu提供了一个使用 emojis 或表情符号的简单方法。在默认情况下,有一个专用的应用程序叫做 Characters。它可以给你基本表情符号的[Unicode][29]码。 -Not only emojis, you can use it to get the unicode for French, German, Russian and Latin characters. Clicking on the symbol gives you the opportunity to copy the unicode and when you paste this code, your chosen symbol should be typed. +不仅是表情符号,你还可以使用它来获得法语、德语、俄语和拉丁语字符的 unicode 。单击符号你可以复制 unicode ,当你粘贴这段代码时,你所选择的符号便被插入。 -![Emoji Ubuntu][30] +! [Emoji Ubuntu] [30] -You’ll find these special characters and emoticons appearing in the desktop search as well. You can copy them from the search results as well. +你也能在桌面搜索中找到这些特殊的字符和表情符号。也可以从搜索结果中复制它们。 -![Emojis appear in desktop search][31] +![Emojis 出现在桌面搜索中][31] -If you don’t want to see them in search results, you should disable their access to the search feature. The next section discuss how to do that. +如果你不想在搜索结果中看到它们,你应该禁用搜索功能对它们的访问。下一节将讨论如何做到这一点。 -#### 10\. Master the desktop search +#### 10\. 掌握桌面搜索 -The GNOME desktop has a powerful search feature. Most people use it for searching installed applications but it is more than just that. +GNOME桌面拥有强大的搜索功能。大多数人使用它来搜索已安装的应用程序,但它不仅限于此。 -Press the super key (Windows key) and search for something. It will show any applications that matches that search term, followed by system settings and matching applications available in the software center. +按超级键(Win键)并搜索一些东西。它将显示与搜索词匹配的任何应用程序,然后是系统设置和软件中心提供的匹配应用程序。 -![Desktop search][32] +![桌面搜索][32] -Not only that, the search can also find text inside files. If you are using the calendar, it can also find your meetings and reminders. You can even do quick calculations in the search and copy its result. +不仅如此,搜索还可以找到文件中的文本。如果你正在使用日历,它也可以找到你的会议和提醒。你甚至可以在搜索中进行快速计算并复制其结果。 -![Quick Calculations Ubuntu Search][33] +![Ubuntu搜索的快速计算][33] -You can control what can be searched and in which order by going into Settings. +你可以通过进入设置来控制搜索的内容和顺序。 ![][34] -#### 11\. Use nightlight feature to reduce eye strain at night +#### 11\. 使用夜灯功能,减少夜间眼睛疲劳 -If you use your computer or smartphone at night, you should use the night light feature to reduce eye strain. I feel that it helps a lot. +如果你在晚上使用电脑或智能手机,你应该使用夜灯功能来减少眼睛疲劳。我觉得这很有帮助。 -The night light feature adds a yellow tint to the screen which is less pinching than the white light. +夜灯的特点是在屏幕上增加了一种黄色的色调,比白光少了一些挤压感。 -You can enable night light in the Settings -> Displays and switching to Night Light tab. You can set the ‘yellowness’ as per your liking. +你可以在设置->显示并切换到夜灯选项卡。你可以根据自己的喜好设置“黄色”。 -![Nightlight feature][35] +![夜灯功能][35] -#### 12\. Got a 2K/4K screen? Use fractional scaling to get bigger icons and fonts +#### 12\.使用 2K/4K 显示器? 使用分辨率缩放得到更大的图标和字体 -If you feel that the icons, fonts, folders everything looks too small on your HiDPI screen, you can take advantage of the fractional scaling. +如果你觉得图标、字体、文件夹在你的高分辨率屏幕上看起来都太小了,你可以利用分辨率缩放。 -Enabling fractional scaling gives you more options to increase the size between 100% to 200%. You can choose the scaling size that suits your preference. +启用分级缩放可以让你有更多的选项来从100%增加到200%。你可以选择适合自己喜好的缩放尺寸。 -![Enable fractional scaling from Settings -> Displays][36] +![启用高分缩放从设置->显示][36] -#### 13\. Explore GNOME Extensions to extend the usability of GNOME desktop +#### 13\. 探索GNOME扩展以扩展GNOME桌面的可用性 -The GNOME desktop has tiny plugins or add-ons called Extensions. You should [learn to use GNOME extensions][37] to extend the usability of your system. +GNOME桌面有称为扩展的小插件或附加组件。你应该[学习使用 GNOM E扩展][37]来扩展系统的可用性。 -As you can see in the image below, the weather extension shows the weather information in the top panel. A tiny but useful thing. You may also take a look at some of [best GNOME extensions][38] here. Don’t install all of them, use only those that are useful to you. +如下图所示,天气扩展顶部面板中显示了天气信息。不起眼但十分有用。您也可以在这里查看一些[最佳 GNOME 扩展][38]。不要全部安装,只使用那些对你有用的。 -![Weather Extension][39] +![天气 扩展][39] -#### 14\. Enable ‘do not disturb’ mode and focus on work +#### 14\.启用“勿扰”模式,专注于工作 -If you want to concentrate on work, disabling desktop notifications would come handy. You can easily enable ‘do not disturb’ mode and mute all notifications. +如果你想专注于工作,禁用桌面通知会很方便。你可以轻松地启用“勿扰”模式,并静音所有通知。 -![Enable ‘Do Not Disturb’ to get rid of desktop notifications][40] +![启用“请勿打扰”清除桌面通知][40] -These notifications will still be in the message tray so that you can read them later but they won’t pop up on the desktop anymore. +这些通知仍然会在消息栏中,以便您以后可以阅读它们,但是它们不会在桌面上弹出。 -#### 15\. Clean your system +#### 15\. 清理你的系统 -This is something you don’t need to do right after installing Ubuntu. But keeping it in mind will help you. +这是你安装Ubuntu后不需要马上做的事情。但是记住它会对你有帮助。 -Over the time, your system will have significant amount of packages that won’t be needed anymore. You can remove them all in one go with this command: +随着时间的推移,你的系统将有大量不再需要的包。你可以用这个命令一次性删除它们: ``` sudo apt autoremove ``` -There are other [ways to clean Ubuntu to free disk space][41] but this is the easiest and safest. +还有其他[清理 Ubuntu 以释放磁盘空间的方法][41],但这是最简单和最安全的。 -#### 16\. Tweak and customize the GNOME desktop to your liking +#### 16\. 根据您的喜好调整和定制 GNOME 桌面 -I highly recommend [installing GNOME Tweaks tool][42]. This will give you access to a few additional settings to tweak. +我强烈推荐[安装 GNOME 设置工具][42]。这将让你可以通过额外的设置来进行定制。 -![Gnome Tweaks Tool][43] +![Gnome 设置工具][43] -For example, you can [display battery percentage][44], [fix right click in touchpad issue][45], change shell theme, change mouse pointer speed, display date and week numbers, change application window behavior etc. +比如,你可以[以百分比形式显示电池容量][44],[修正在touchpad中右键问题][45],改变 Shell 主题,改变鼠标指针速度,显示日期和星期数,改变应用程序窗口行为等。 -There is no end to customization and I cannot probably most of them here. This is why I recommend [reading these articles][42] about [customizing GNOME desktop][46]. +定制是没有尽头的,我可能仅使用了它的一小部分功能。这就是为什么我推荐[阅读这些文章]关于[自定义GNOME桌面][46]的[42]。 -You can also [install new themes in Ubuntu][47] though personally, I like the default theme in this release. This is the first time that I have stuck with the default icons and theme in an Ubuntu release. +你也可以[在Ubuntu中安装新主题][47],不过就我个人而言,我喜欢这个版本的默认主题。这是我第一次在Ubuntu发行版中使用默认的图标和主题。 -#### What do you do after installing Ubuntu? +#### 安装 Ubuntu 之后你会做什么? -If you are an Ubuntu beginner, I recommend [going through this collection of Ubuntu tutorials][48] to get started with it. +如果你是Ubuntu的初学者,我建议你[阅读这一系列Ubuntu教程][48]开始学习。 -So these were my recommendations. What are the steps you follow after installing Ubuntu? Share your favorite things and I might update this article with your suggestions. +这就是我的建议。安装Ubuntu之后你要做什么?分享你最喜欢的东西,我可能根据你的建议来更新这篇文章。 -------------------------------------------------------------------------------- @@ -226,7 +226,7 @@ via: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[qfzy1233](https://github.com/qfzy1233) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c837414cf1a1b6b87613972a6ee083d4c736410d Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Sun, 3 May 2020 16:33:20 +0800 Subject: [PATCH 0577/1809] Update and rename sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md to translated/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md --- .../20200424 16 Things to do After Installing Ubuntu 20.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {sources => translated}/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md (99%) diff --git a/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md b/translated/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md similarity index 99% rename from sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md rename to translated/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md index 1b5d5ef5c3..a221ef6a34 100644 --- a/sources/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md +++ b/translated/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md @@ -10,7 +10,7 @@ 安装完 Ubuntu 20.04 后要做的 16 件事 ====== -_**以下是安装 Ubuntu 20.04 之后需要做的一些调整和事情,它将使你获得更流畅、更好的桌面 Linux 体验。**_ +_**以下是安装 Ubuntu 20.04 之后需要做的一些调整和事项,它将使你获得更流畅、更好的桌面 Linux 体验。**_ [Ubuntu 20.04 LTS (长期支持版)带来了许多新的特性][1] 和观感上的变化。 如果你要安装 Ubuntu 20.04 ,让我向你展示一些推荐步骤便于你的使用。 From 81ee0f92303689fbaea59804ae2df4567a44af24 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 3 May 2020 21:15:13 +0800 Subject: [PATCH 0578/1809] PRF @wxy --- ...0420 4 Git scripts I can-t live without.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/translated/tech/20200420 4 Git scripts I can-t live without.md b/translated/tech/20200420 4 Git scripts I can-t live without.md index 089c81e20f..782cb082ce 100644 --- a/translated/tech/20200420 4 Git scripts I can-t live without.md +++ b/translated/tech/20200420 4 Git scripts I can-t live without.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (4 Git scripts I can't live without) @@ -12,11 +12,11 @@ > Git Extras 版本库包含了 60 多个脚本,它们是 Git 基本功能的补充。以下是如何安装、使用和贡献的方法。 -![Person using a laptop][1] +![](https://img.linux.net.cn/data/attachment/album/202005/03/211446dshwbzoh235b3gre.jpg) -2005 年,[Linus Torvalds][2] 创建了 [Git][3],以取代他之前用于维护 Linux 内核的专有的分布式源码控制管理解决方案。从那时起,Git 已经成为开源和云原生开发团队的主流版本控制解决方案。 +2005 年,[Linus Torvalds][2] 创建了 [Git][3],以取代他之前用于维护 Linux 内核的分布式源码控制管理的专有解决方案。从那时起,Git 已经成为开源和云原生开发团队的主流版本控制解决方案。 -但即使是像 Git 这样功能丰富的应用程序,也没有人们想要或需要的每个功能,所以人们会花大力气去创建这些功能。就 Git 而言,这个人就是 [TJ Holowaychuk][4]。他的 [Git Extras][5] 项目承载了 60 多个“附加功能”,这些功能扩展了 Git 的基本功能。 +但即使是像 Git 这样功能丰富的应用程序,也没有人们想要或需要的每个功能,所以会有人花大力气去创建这些缺少的功能。就 Git 而言,这个人就是 [TJ Holowaychuk][4]。他的 [Git Extras][5] 项目承载了 60 多个“附加功能”,这些功能扩展了 Git 的基本功能。 ### 使用 Git 附加功能 @@ -24,9 +24,9 @@ #### git-ignore -`git ignore` 是一个方便的附加功能,它可以让你手动添加文件类型和注释到 `.git-ignore` 文件中,而不需要打开文本编辑器。它可以操作你的个人用户帐户的全局忽略文件和单独用于你正在工作的版本库的忽略文件。 +`git ignore` 是一个方便的附加功能,它可以让你手动添加文件类型和注释到 `.git-ignore` 文件中,而不需要打开文本编辑器。它可以操作你的个人用户帐户的全局忽略文件和单独用于你正在工作的版本库中的忽略文件。 -在没有参数的情况下执行 `git ignore` 会先列出全局忽略文件,然后是本地的忽略文件。 +在不提供参数的情况下执行 `git ignore` 会先列出全局忽略文件,然后是本地的忽略文件。 ``` $ git ignore @@ -105,7 +105,7 @@ branch.master.merge=refs/heads/master * `git mr` 检出来自 GitLab 的合并请求。 * `git pr` 检出来自 GitHub 的拉取请求。 -无论是哪种情况,你只需要合并请求号、拉取请求号或完整的 URL,它就会抓取远程引用,检出分支,并调整配置,这样 Git 就知道要替换哪个分支了。 +无论是哪种情况,你只需要合并请求号/拉取请求号或完整的 URL,它就会抓取远程引用,检出分支,并调整配置,这样 Git 就知道要替换哪个分支了。 ``` $ git mr 51 @@ -142,7 +142,7 @@ $ git extras --help $ brew install git-extras ``` -在 Linux 上,每个平台的原生包管理器中都有 Git Extras。有时,你需要启用一个额外的仓库,比如在 CentOS 上的 [EPEL][10],然后运行一条命令。 +在 Linux 上,每个平台原生的包管理器中都包含有 Git Extras。有时,你需要启用额外的仓库,比如在 CentOS 上的 [EPEL][10],然后运行一条命令。 ``` $ sudo yum install git-extras @@ -152,9 +152,9 @@ $ sudo yum install git-extras ### 贡献 -你是否你认为 Git 中有缺少的功能,并且已经构建了一个脚本来处理它?为什么不把它作为 Git Extras 发布版的一部分,与全世界分享呢? +你是否认为 Git 中有缺少的功能,并且已经构建了一个脚本来处理它?为什么不把它作为 Git Extras 发布版的一部分,与全世界分享呢? -要做到这一点,请将该功能贡献到 Git Extras 仓库中。更多具体细节请参见仓库中的 [CONTRIBUTING.md][12] 文件,但基本的操作方法很简单。 +要做到这一点,请将该功能贡献到 Git Extras 仓库中。更多具体细节请参见仓库中的 [CONTRIBUTING.md][12] 文件,但基本的操作方法很简单: 1. 创建一个处理该功能的 Bash 脚本。 2. 创建一个基本的 man 文件,让大家知道如何使用它。 @@ -171,7 +171,7 @@ via: https://opensource.com/article/20/4/git-extras 作者:[Vince Power][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2790846b4c68ca7550819e9432138e464190ffc7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 3 May 2020 21:16:14 +0800 Subject: [PATCH 0579/1809] PUB @wxy https://linux.cn/article-12180-1.html --- .../20200420 4 Git scripts I can-t live without.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200420 4 Git scripts I can-t live without.md (98%) diff --git a/translated/tech/20200420 4 Git scripts I can-t live without.md b/published/20200420 4 Git scripts I can-t live without.md similarity index 98% rename from translated/tech/20200420 4 Git scripts I can-t live without.md rename to published/20200420 4 Git scripts I can-t live without.md index 782cb082ce..43102c69e6 100644 --- a/translated/tech/20200420 4 Git scripts I can-t live without.md +++ b/published/20200420 4 Git scripts I can-t live without.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12180-1.html) [#]: subject: (4 Git scripts I can't live without) [#]: via: (https://opensource.com/article/20/4/git-extras) [#]: author: (Vince Power https://opensource.com/users/vincepower) From 4ad888c0c2ddebd6c0e809238c4f950d3a9d8f5e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 3 May 2020 23:04:49 +0800 Subject: [PATCH 0580/1809] PRF @lxbwolf --- ...OS-RHEL 7-8 Systems in Single User Mode.md | 82 ++++++++++--------- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/translated/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md b/translated/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md index c5eaa1dc84..a54892c575 100644 --- a/translated/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md +++ b/translated/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md @@ -1,108 +1,112 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Three Methods Boot CentOS/RHEL 7/8 Systems in Single User Mode) [#]: via: (https://www.2daygeek.com/boot-centos-7-8-rhel-7-8-single-user-mode/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -在单用户模式下启动 CentOS/RHEL 7/8 的三种方法 +以单用户模式启动 CentOS/RHEL 7/8 的三种方法 ====== +![](https://img.linux.net.cn/data/attachment/album/202005/03/230109uw1f9zvv9upbhwv8.jpg) + 单用户模式,也被称为维护模式,超级用户可以在此模式下恢复/修复系统问题。 -通常情况下,这些问题在多用户环境中修复不了。系统可以启动但功能不能正常运行或者你登录不了系统。 +通常情况下,这类问题在多用户环境中修复不了。系统可以启动但功能不能正常运行或者你登录不了系统。 -在基于 **[Red Hat][1]** (RHEL) 7/8 的系统中,使用 `runlevel1.target` 或 `rescue.target` 来实现。 +在基于 [Red Hat][1](RHEL)7/8 的系统中,使用 `runlevel1.target` 或 `rescue.target` 来实现。 在此模式下,系统会挂载所有的本地文件系统,但不开启网络接口。 系统仅启动特定的几个服务和修复系统必要的尽可能少的功能。 -当你想运行文件系统一致性检查来修复损坏的文件系统,或忘记 root 密码后重置密码,或修复系统上的一个挂载点问题时,这个方法会很有用。 +当你想运行文件系统一致性检查来修复损坏的文件系统,或忘记 root 密码后重置密码,或要修复系统上的一个挂载点问题时,这个方法会很有用。 -你可以用下面三种方法以单用户模式启动 **[CentOS][2]**/**[RHEL][3]** 7/8 系统。 +你可以用下面三种方法以单用户模式启动 [CentOS][2]/[RHEL][3] 7/8 系统。 - * **方法 1:** 通过向内核添加 “rd.break” 参数来以单用户模式启动 CentOS/RHEL 7/8 系统 - * **方法 2:** 通过用 “init=/bin/bash“ 或 ”init=/bin/sh” 替换内核中的 “rhgb quiet” 语句来以单用户模式启动 CentOS/RHEL 7/8 系统 - * **方法 3:** 通过用 “rw init=/sysroot/bin/sh” 参数替换内核中的 “ro” 语句以单用户模式启动 CentOS/RHEL 7/8 系统 + * 方法 1:通过向内核添加 `rd.break` 参数来以单用户模式启动 CentOS/RHEL 7/8 系统 + * 方法 2:通过用 `init=/bin/bash` 或 `init=/bin/sh` 替换内核中的 `rhgb quiet` 语句来以单用户模式启动 CentOS/RHEL 7/8 系统 + * 方法 3:通过用 `rw init=/sysroot/bin/sh` 参数替换内核中的 `ro` 语句以单用户模式启动 CentOS/RHEL 7/8 系统 +### 方法 1 - -### 方法 1: 通过向内核添加 “rd.break” 参数来以单用户模式启动 CentOS/RHEL 7/8 系统 +通过向内核添加 `rd.break` 参数来以单用户模式启动 CentOS/RHEL 7/8 系统。 重启你的系统,在 GRUB2 启动界面,按下 `e` 键来编辑选中的内核。你需要选中第一行,第一个是最新的内核,然而如果你想用旧的内核启动系统你也可以选择其他的行。 -![][4] +![](https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-2.png) -根据你的 RHEL/CentOS 版本,找到 **“linux16”** 或 **“linux”** 语句,按下键盘上的 ”End“ 按钮,跳到行末,像下面截图中展示的那样添加关键词 **“rd.break”**,按下 **“Ctrl+x”** 或 **“F10”** 来进入单用户模式。 +根据你的 RHEL/CentOS 版本,找到 `linux16` 或 `linux` 语句,按下键盘上的 `End` 键,跳到行末,像下面截图中展示的那样添加关键词 `rd.break`,按下 `Ctrl+x` 或 `F10` 来进入单用户模式。 -如果你的系统是 RHEL/CentOS 7,你需要找 **`linux16`**,如果你的系统是 RHEL/CentOS 8,那么你需要找 **`linux`**。 +如果你的系统是 RHEL/CentOS 7,你需要找 `linux16`,如果你的系统是 RHEL/CentOS 8,那么你需要找 `linux`。 -![][4] +![](https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-3.png) -这个修改会让你的 root 文件系统以 **“只读 (RO)”** 模式挂载。你可以用下面的命令来验证下。下面的输出也明确地告诉你当前是在 **“紧急模式”**。 +这个修改会让你的 root 文件系统以 “只读(`ro`)” 模式挂载。你可以用下面的命令来验证下。下面的输出也明确地告诉你当前是在 “紧急模式Emergency Mode”。 ``` # mount | grep root ``` -![][4] +![](https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-5.png) -为了修改 **“sysroot”** 文件系统,你需要用 RW 模式重新挂载它。 +为了修改 `sysroot` 文件系统,你需要用读写模式(`rw`)重新挂载它。 ``` # mount -o remount,rw /sysroot ``` -运行下面的命令修改环境,这就是大家熟知的 “jailed directory” 或 “chroot jail”。 +运行下面的命令修改环境,这就是大家熟知的 “监禁目录” 或 “chroot 监狱”。 ``` # chroot /sysroot ``` -![][4] +![](https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-8.png) -现在,单用户模式的前期准备已经完成了。当你修复了你的问题要退出单用户模式时,执行下面的步骤。 +现在,单用户模式已经完全准备好了。当你修复了你的问题要退出单用户模式时,执行下面的步骤。 -CentOS/RHEL 7/8 默认使用 SELinux,因此创建下面的隐藏文件,这个文件会在下一次启动时重新确认所有文件。 +CentOS/RHEL 7/8 默认使用 SELinux,因此创建下面的隐藏文件,这个文件会在下一次启动时重新标记所有文件。 ``` # touch /.autorelabel ``` -最后,用下面的命令重启系统。你也可以输入两次 “exit” 命令来重启你的系统。 +最后,用下面的命令重启系统。你也可以输入两次 `exit` 命令来重启你的系统。 ``` # reboot -f ``` -### 方法 2: 通过用 “init=/bin/bash“ 或 ”init=/bin/sh” 替换内核中的 “rhgb quiet” 语句来以单用户模式启动 CentOS/RHEL 7/8 系统 +### 方法 2 + +通过用 `init=/bin/bash` 或 `init=/bin/sh` 替换内核中的 `rhgb quiet` 语句来以单用户模式启动 CentOS/RHEL 7/8 系统。 重启你的系统,在 GRUB2 启动界面,按下 `e` 键来编辑选中的内核。 -![][4] +![](https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-2.png) -找到语句 **“rhgb quiet”**,用 **“init=/bin/bash”** 或 **“init=/bin/sh”** 替换它,然后按下 **“Ctrl+x”** 或 **“F10”** 来进入单用户模式。 +找到语句 `rhgb quiet`,用 `init=/bin/bash` 或 `init=/bin/sh` 替换它,然后按下 `Ctrl+x` 或 `F10` 来进入单用户模式。 -**`init=/bin/bash`** 的截图。 +`init=/bin/bash` 的截图。 -![][4] +![](https://www.2daygeek.com/wp-content/uploads/2018/12/method-reset-forgotten-root-password-on-rhel-7-centos-7-1.png) -**`init=/bin/sh`** 的截图。 +`init=/bin/sh` 的截图。 -![][4] +![](https://www.2daygeek.com/wp-content/uploads/2018/12/method-reset-forgotten-root-password-on-rhel-7-centos-7-1a.png) -默认情况下,上面的操作会以只读(RO)模式挂载你的 “/” 分区,因此你需要以读写(RW)模式重新挂载 “/” 文件系统,这样才能修改它。 +默认情况下,上面的操作会以只读(`ro`)模式挂载你的 `/` 分区,因此你需要以读写(`rw`)模式重新挂载 `/` 文件系统,这样才能修改它。 ``` # mount -o remount,rw / ``` -![][4] +![](https://www.2daygeek.com/wp-content/uploads/2018/12/method-reset-forgotten-root-password-on-rhel-7-centos-7-4.png) -现在你可以执行你的任务了。当结束时,执行下面的命令来开启重启时的 SELinux 重新确认。 +现在你可以执行你的任务了。当结束时,执行下面的命令来开启重启时的 SELinux 重新标记。 ``` # touch /.autorelabel @@ -114,21 +118,23 @@ CentOS/RHEL 7/8 默认使用 SELinux,因此创建下面的隐藏文件,这 # exec /sbin/init 6 ``` -### 方法 3: 通过用 “rw init=/sysroot/bin/sh” 参数替换内核中的 “ro” 语句以单用户模式启动 CentOS/RHEL 7/8 系统 +### 方法 3 + +通过用 `rw init=/sysroot/bin/sh` 参数替换内核中的 `ro` 单词,以单用户模式启动 CentOS/RHEL 7/8 系统。 为了中断自动启动的过程,重启你的系统并在 GRUB2 启动界面按下任意键。 现在会展示你系统上所有可用的内核,选择最新的内核,按下 `e` 键来编辑选中的内核参数。 -找到以 **“linux”** 或 **“linux16”** 开头的语句,用 **“rw init=/sysroot/bin/sh”** 替换 **“ro”**。替换完后按下 **“Ctrl+x”** 或 **“F10”** 来进入单用户模式。 +找到以 `linux` 或 `linux16` 开头的语句,用 `rw init=/sysroot/bin/sh` 替换 `ro`。替换完后按下 `Ctrl+x` 或 `F10` 来进入单用户模式。 -运行下面的命令把环境切换为 “chroot jail”。 +运行下面的命令把环境切换为 “chroot 监狱”。 ``` # chroot /sysroot ``` -如果需要,做出必要的修改。修改完后,执行下面的命令来开启重启时的 SELinux 重新确认。 +如果需要,做出必要的修改。修改完后,执行下面的命令来开启重启时的 SELinux 重新标记。 ``` # touch /.autorelabel @@ -147,7 +153,7 @@ via: https://www.2daygeek.com/boot-centos-7-8-rhel-7-8-single-user-mode/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4e0e7c3ea7de5e9d00b0d76eeb3429669056f06f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 3 May 2020 23:09:22 +0800 Subject: [PATCH 0581/1809] PUB @lxbwolf https://linux.cn/article-12181-1.html --- ...ethods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md (98%) diff --git a/translated/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md b/published/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md similarity index 98% rename from translated/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md rename to published/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md index a54892c575..4b7edb67e9 100644 --- a/translated/tech/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md +++ b/published/20200430 Three Methods Boot CentOS-RHEL 7-8 Systems in Single User Mode.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12181-1.html) [#]: subject: (Three Methods Boot CentOS/RHEL 7/8 Systems in Single User Mode) [#]: via: (https://www.2daygeek.com/boot-centos-7-8-rhel-7-8-single-user-mode/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From fc7fc45fe2732f67cb11524709dc40ef74d4cc87 Mon Sep 17 00:00:00 2001 From: Acceleratorrrr <542383480@qq.com> Date: Sun, 3 May 2020 16:41:24 +0100 Subject: [PATCH 0582/1809] Update 20200427 How to secure your Linux email services with SSL-TLS.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申请翻译。 --- ...427 How to secure your Linux email services with SSL-TLS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20200427 How to secure your Linux email services with SSL-TLS.md b/sources/tech/20200427 How to secure your Linux email services with SSL-TLS.md index 163e6b017f..3dcd2a5dc6 100644 --- a/sources/tech/20200427 How to secure your Linux email services with SSL-TLS.md +++ b/sources/tech/20200427 How to secure your Linux email services with SSL-TLS.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Acceleratorrrr) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -7,6 +7,7 @@ [#]: via: (https://opensource.com/article/20/4/securing-linux-email) [#]: author: (Marc Skinner https://opensource.com/users/marc-skinner) + How to secure your Linux email services with SSL/TLS ====== Protect your Linux email services by understanding security From 84362af14f979d83445e0987e65aa3518566d98b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 4 May 2020 00:55:28 +0800 Subject: [PATCH 0583/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200503=2013?= =?UTF-8?q?=20tips=20for=20getting=20your=20talk=20accepted=20at=20a=20tec?= =?UTF-8?q?h=20conference?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200503 13 tips for getting your talk accepted at a tech conference.md --- ...your talk accepted at a tech conference.md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20200503 13 tips for getting your talk accepted at a tech conference.md diff --git a/sources/tech/20200503 13 tips for getting your talk accepted at a tech conference.md b/sources/tech/20200503 13 tips for getting your talk accepted at a tech conference.md new file mode 100644 index 0000000000..b260116fb6 --- /dev/null +++ b/sources/tech/20200503 13 tips for getting your talk accepted at a tech conference.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (13 tips for getting your talk accepted at a tech conference) +[#]: via: (https://opensource.com/article/20/5/tips-conference-proposals) +[#]: author: (Todd Lewis https://opensource.com/users/toddlewis) + +13 tips for getting your talk accepted at a tech conference +====== +Before you respond to an event's call for papers, make sure your talk's +proposal aligns with these best practices. +![All Things Open check-in at registration booth][1] + +As tech conference organizers ramp up for the fall season, you may be seeing calls for papers (CFP) landing in your email box or social media feeds. We at [All Things Open][2] (ATO) have seen a lot of presentation proposals over the years, and we've learned a few things about what makes them successful. + +As we prepare for the eighth annual ATO in October 2020, we thought we'd offer a few best practices for writing successful CFP responses. If you're considering submitting a talk to ATO or another tech event, we hope these tips will help improve the chances that your proposal will be accepted. + +### 1\. Know the event you're submitting a talk to + +This seems like the proverbial _no-brainer_, but some people don't take the time to research an event before they submit a talk. Peruse the conference's website and review the talks, speakers, topics, etc. featured in the last couple of years. You can also find a lot of information simply by googling. The time you invest here will help you avoid a submission that is completely out of context for the event. + +### 2\. Understand what the event is looking for + +Look for information about what the event is looking for and what types of topics or talks it expects will be a good fit. We try to provide as much information as possible about the [ATO conference][3], [why someone would want to speak][4], and [what we're looking for][5] (both general and special interest topics). We also try to make the submission process as easy as possible (no doubt, there is room for improvement), in part because we believe this improves the quality of submissions and makes our review process go more smoothly. + +### 3\. Reach out to the organizer and ask questions + +If you're considering submitting a talk, don't hesitate to reach out and ask the event organizers any questions you have and for guidance specific to the event. If there is no or little response, that should be a red flag. If you have any questions about All Things Open, please reach out directly at [info@allthingsopen.org][6]. + +### 4\. Be clear about what attendees will learn from your talk + +This is one of the most common mistakes we see. Only about 25% of the proposals we receive clearly explain the proposed talk's takeaways. One reason you should include this is that nearly every event attendee makes their schedule based on what they will learn if they go to a session. But for organizers and proposal reviewers, having this information clearly stated upfront is pure gold. It simplifies and speeds up the assessment process, which gets you one step closer to being accepted as a speaker. A paragraph titled "Attendee Takeaways" with bullet points is the holy grail for everyone involved. + +### 5\. Keep recommended word counts in mind + +This is another mistake we see a lot. Many talks are submitted with either a single sentence description in the abstract or an extraordinary long volume of text. Neither is a good idea. The only exception we can think of is when a topic is very popular or topical, and that alone is enough to win the day even if the abstract is extremely short (but this is rare). Most abstracts should be between 75 and 250 words, and perhaps more for an extended workshop with prerequisites (e.g., preexisting knowledge or required downloads). Even then, try to keep your proposal as sharp, concise, and on-point as possible. + +Disregard this advice at your own risk; otherwise, there's a high likelihood that your proposal will be met with one of these reactions from reviewers: "They didn't take the time to write any more than this?" or "Sheesh, there's no way I have the time to read all that. I'm going to give it the lowest score and move on." + +### 6\. Choose a good title + +This is a debate we see all the time: Should a talk's title describe what the talk is about, or should it be written to stand out and get attention (e.g., evoking emotion, anchoring to a popular pop culture topic, or asking a compelling question)? There isn't a single correct answer to this question, but we definitely know when a title "works" and when it doesn't. We've seen some very creative titles work well and generate interest, and we've seen very straightforward titles work well, also. + +Here is our rule of thumb: If the talk covers a topic that has been around a while and is not particularly _hot_ right now, try getting creative and spicing it up a bit. If the topic is newer, a more straightforward title describing the talk in plain terms should be good. + +Titles on an event schedule may be the only thing attendees use to decide what talks to attend. So, run your potential talk titles by colleagues and friends, and seek their opinions. Ask: "If you were attending an event and saw this title on the schedule, would it pique your interest?" + +### 7\. Know the basic criteria that reviewers and organizers use to make decisions + +While this isn't a comprehensive list of review criteria, most reviewers and organizers consider one or more of the following when evaluating talk proposals. Therefore, at minimum, consider this list when you're creating a talk and the components that go with it. + + 1. **Timeliness of and estimated interest in the topic:** Is the topic applicable to the session's target audience? Will it deliver value? Is it timely? + 2. **Educational value:** Based on the abstract and speaker, is it clear that attendees will learn something from the talk? As mentioned in item 4 above, including an "Attendee Takeaways" section is really helpful to establish educational value. + 3. **Technical value:** Is the technology you intend to showcase applicable, unique, or being used in a new and creative way? Is there a live demo or a hands-on component? While some topics don't lend themselves to a demo, most people are visual learners and are better off if a presentation includes one (if it's relevant). For this reason, we place a lot of value on demos and hands-on content. + 4. **Diversity:** Yes, there are exceptions, but the majority of events, reviewers, and organizers agree that having a diverse speaker lineup is optimal and results in a better overall event in multiple ways. A topic delivered from a different perspective can often lead to creative breakthroughs for attendees, which is a huge value-add. See item 10 below for more on this. + 5. **Talk difficulty level:** We identify All Things Open talks as introductory, intermediate, or advanced. Having a good mix of talk levels ensures everyone in attendance can access applicable content. See item 9 below for more on this, but in general, it's smart to indicate your talk's level, whether or not the CFP requests it. + + + +### 8\. Stay current on the event's industry or sector + +Submitting a proposal on a relevant topic increases the probability your talk will be accepted. But how do you know what topics are of interest, especially if the CFP doesn't spell it out in simple terms? The best way to know what's timely and interesting is to deeply understand the sector the event focuses on. + +Yes, this requires time and effort, and it implies you enjoy the sector enough to stay current on it, but it will pay off. This knowledge will result in a higher _sector IQ_, which will be reflected in your topic, title, and abstract. It will be recognized by reviewers and immediately set you apart from others. At All Things Open, we spend the majority of our time reading about and staying current on the "open" space so that we can feature relevant, substantive, and informed content. Submitting a talk that is relevant, substantive, and informed greatly enhances the chance it will be accepted. + +### 9\. Describe whether the talk is introductory, intermediate, or advanced + +Some CFPs don't ask for this information, but you should offer it anyway. It will make the reviewers and organizer very happy for multiple reasons, including these: + + 1. Unless the event targets attendees with a certain skill or experience level (and most do not), organizers must include content that is appealing to a wide audience, including people of all skill, experience, and expertise levels. Even if an event focuses on a specific type of attendee (perhaps people with higher levels of experience or skills), most want to offer something a little different. Listing the talk level makes this much easier for organizers. + 2. News flash: Reviewers and organizers don't know everything and are not experts in every possible topic area. As a result, reviewers will sometimes look for a few keywords or other criteria, and adding the talk level can "seal the deal" and get your talk confirmed. + + + +### 10\. Tell organizers if you're a member of a historically underrepresented group + +A growing number of events are getting better at recognizing the value of diversity and ensuring their speaker lineup reflects it. If you're part of a group that hasn't typically been included in tech events and leadership, look to see if there is a place to indicate that on the submission form. If not, mention it in a conspicuous place somewhere in the abstract. This does not guarantee approval in any way—your proposal must still be well-written and relevant—but it does give reviewers and organizers pertinent information they may value and take into consideration. + +### 11\. Don't be ashamed of your credentials or speaking experience if it is light + +We talk to a lot of people who would like to deliver a presentation and have a lot to offer, but they never submit a talk because they don't feel they're qualified to speak. _Not true._ Some of the best talks we've seen are from first-time speakers or those very early in their speaking careers. Go ahead and submit the talk, and be honest when discussing your background. Most reviewers and organizers will focus on the substance of the submission over your experience and recognize that new ways of approaching and using technology often come from newbies rather than industry veterans. + +One caveat here: It still pays to know yourself. By this, we mean if you absolutely hate public speaking, have no desire to do it, and are only considering submitting a talk due to, for example, pressure from an employer, the talk is not likely to go well. It's better, to be honest, on the frontend than force something you have no desire to do. + +### 12\. Consider panel sessions carefully + +If you've got an idea for a panel session, please consider it carefully. In more than 10 years of hosting events we've seen some really good panel sessions, but we've seen far more that didn't go so well. Perhaps too many people were on the panel and not everyone had a chance to speak, perhaps a single panel member dominated the entire conversation, or perhaps the moderator didn't keep the dialogue and engagement flowing smoothly. Regardless of the issue, panels have the potential to go very wrong. + +That said, panels can still work and deliver a lot of value to attendees. If you do submit a panel session be sure to keep in mind the amount of time allotted for the session and confirm the number of panel members accordingly. Remember, less is always more when it comes to the panel format. Also, be sure the moderator understands the subject matter being discussed and doesn't mind enforcing format parameters and speaking time limits. Finally, let organizers know panel members and the moderator will engage in a pre-conference walk-through/preparation call before the event to ensure a smooth process in front of a live audience. Remember, organizers are well aware panels can be terrific but can also go in the opposite direction and very easily lead to a lot of negative feedback. + +### 13\. This is not an opportunity to sell  + +This is a sensitive topic, but one that absolutely must be mentioned. Over the years we've seen literally hundreds of talks "disqualified" by reviewers because they viewed the talk as a sales pitch. Few things evoke such a visceral response. Yes, there are events, tracks, and session slots where a sales pitch is appropriate (and maybe even required by the company paying your costs). However, make it a priority to know when and where this is appropriate and acceptable. And always, and we mean always, err on the side of making substance the focus of the talk rather than a sales angle.  + +It might sound like a cliche, but when a talk is delivered effectively with a focus on substance, people will **want** to buy what you're selling. And if you're not selling anything, they'll want to follow you on social media and generally engage with you—because you delivered value to them. Meaning: You gave them something they can apply themselves (education) or because your delivery style was entertaining and engaging. With rare exceptions, always focus any abstract on substance, and the rest will take care of itself.  + +### Go for it! + +We greatly admire and respect anyone who submits a talk for consideration—it takes a lot of time, thought, and courage. Therefore, we go to great lengths to thank everyone who goes through the process; we give free event passes to everyone who applies (regardless of approval or rejection), and we make every effort to host Q&A sessions to provide as much guidance as possible on the front end. Again, the more time and consideration speakers put into the submission process, the easier the lives of reviewers and organizers. We need to make all of this as easy as possible. + +While this is not a comprehensive list of best practices, it includes some of the things we think people can benefit from knowing before submitting a talk. There are a lot of people out there with more knowledge and experience, so please share your best tips for submitting conference proposals in the comments, so we can all learn from you. + +* * * + +_[All Things Open][2] is a universe of platforms and events focusing on open source, open tech, and the open web. It hosts the [All Things Open conference][3], the largest open source/tech/web event on the US East Coast. The conference regularly hosts thousands of attendees and many of the world's most influential companies from a wide variety of industries and sectors. In 2019, nearly 5,000 people attended from 41 US states and 24 countries. Please direct inquiries about ATO to the team at [info@allthingsopen.org][6]._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/tips-conference-proposals + +作者:[Todd Lewis][a] +选题:[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/toddlewis +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ato2016_checkin_conference.jpg?itok=DJtoSS6t (All Things Open check-in at registration booth) +[2]: https://www.allthingsopen.org/ +[3]: https://2020.allthingsopen.org/ +[4]: https://2020.allthingsopen.org/call-for-speakers +[5]: https://www.allthingsopen.org/what-were-looking-for/ +[6]: mailto:info@allthingsopen.org From b6944f93a7459127c3cd0582224702aaef849cbf Mon Sep 17 00:00:00 2001 From: tinyeyeser Date: Mon, 4 May 2020 15:01:11 +0800 Subject: [PATCH 0584/1809] =?UTF-8?q?=E5=B7=B2=E7=BF=BB=E8=AF=91=20by=20?= =?UTF-8?q?=E5=B0=8F=E7=9C=BC=E5=84=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o avoid man-in-the-middle cyber attacks.md | 94 ------------------- ...o avoid man-in-the-middle cyber attacks.md | 84 +++++++++++++++++ 2 files changed, 84 insertions(+), 94 deletions(-) delete mode 100644 sources/tech/20200407 How to avoid man-in-the-middle cyber attacks.md create mode 100644 translated/tech/20200407 How to avoid man-in-the-middle cyber attacks.md diff --git a/sources/tech/20200407 How to avoid man-in-the-middle cyber attacks.md b/sources/tech/20200407 How to avoid man-in-the-middle cyber attacks.md deleted file mode 100644 index c8a72579ef..0000000000 --- a/sources/tech/20200407 How to avoid man-in-the-middle cyber attacks.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tinyeyeser ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to avoid man-in-the-middle cyber attacks) -[#]: via: (https://opensource.com/article/20/4/mitm-attacks) -[#]: author: (Jackie Lam https://opensource.com/users/beenverified) - -How to avoid man-in-the-middle cyber attacks -====== -Understanding MITM attacks is the first step in not being a victim of -this high-tech style of eavesdropping. -![Security monster][1] - -Whether you're sending data on your computer or talking to someone online, you want to assume some level of security and privacy. - -But what if a third party is eavesdropping online, unbeknownst to you? And worse, what if they're impersonating someone from a business you trust in order to gain damaging information? This could put your personal data into the hands of dangerous, would-be thieves. - -Welcome to what's called a man-in-the-middle (MITM) attack. - -### What are man-in-the-middle attacks? - -A man-in-the-middle attack occurs when a cybercriminal inserts themselves into communications between you, the targeted victim, and a device in order to steal sensitive information that can be used for a variety of criminal purposes—most notably identity theft, says Steve J. J. Weisman, founder of Scamicide. - -"A man-in-the-middle-attack can also occur when the victim believes he or she is communicating with a legitimate app or website," says Weisman, "when the truth is that the victim is communicating with a phony website or app and thereby providing sensitive information to the criminal." - -One of the oldest forms of cyberattacks, MITM attacks have been around since the 1980s. What's more, they're quite common. As Weisman explains, there are a handful of ways a MITM attack can happen: - - * **Attacking a WiFi router that is not properly secured:** This typically occurs when someone is using public WiFi. "While home routers might be vulnerable, it's more common for criminals to attack public WiFi networks," says Weisman. The goal is to spy on unsuspecting people who are handling sensitive information, such as their online bank accounts, he adds. - * **Hacking email accounts of banks, financial advisers, and other companies:** "Once [the criminals] have hacked these email systems, they send out emails that appear to come from the legitimate bank or other company," Weisman says. "[They ask] for personal information, such as usernames and passwords, under the guise of an emergency. The targeted victim is lured into providing that information." - * **Sending phishing emails:** Thieves might also send emails pretending to be legitimate companies that the targeted victim does business with, asking the recipient for their personal information. "In many instances, the spear-phishing emails will direct the victim to a counterfeit website that appears to be that of a legitimate company with which the victim does business," says Weisman. - * **Using malicious code in legitimate websites:** Attackers can also place malicious code—usually JavaScript—into a legitimate website by way of a web application. "When the victim loads the legitimate page, the malicious code just sits in the background until the user enters sensitive information, such as account login or credit card details, which the malicious code then copies and sends to the attackers' servers," says Nicholas McBride, a cybersecurity consultant. - - - -### What is an example of an MITM attack? - -The Lenovo case is a well-known example of an MITM attack. In 2014 and 2015, the major computer manufacturer sold consumer laptops with preinstalled software that meddled with how a user's browser communicated with websites. Whenever the user's cursor hovered over a product, this software, called VisualDiscovery, sent pop-up ads from retail partners that sold similar products. - -Here's the kicker: This MITM attack allowed VisualDiscovery to access all of the user's personal data, including social security numbers, info about financial transactions, medical info, and logins and passwords. All without the user knowing or granting permission beforehand. The FTC deemed this a deceptive and unfair online scam. Lenovo agreed to pay $8.3 million in a class-action settlement in 2019. - -### How can I protect myself from an online attack? - - * **Avoid using public WiFi:** Weisman recommends never using public WiFi for financial transactions unless you've installed a reliable virtual private network (VPN) client on your device and have a VPN host you can use and trust. Over a VPN connection, your communications are encrypted, so your information can't be stolen. - - * **Be on the lookout:** Be wary of emails or text messages that ask you to update your password or provide your username or personal information. These methods can be used to steal your identity. - -If you are unsure of the actual identity of the party sending you the email, you can use tools such as a reverse phone or email search. With a reverse phone number lookup, you may be able to find out more about the identity of an unknown texter. And with a reverse email lookup, you can try to determine who might have sent you a message. - -Generally, if something's actually a problem, you'll hear from someone you know and trust within your company, or from someone you can also go and meet, in person, at your bank or school or other organization. Important account information is never the purview of an unknown technician. - - * **Don't click on links contained in emails:** If someone sends you an email telling you that you need to sign into an account, don't click on the link provided in the email. Instead, navigate to the site yourself, log in as you normally would, and look for an alert there. If you don't see an alert message in your account settings, contact a representative by phone using contact information on the site and _not_ from the email. - - * **Install reliable security software:** If you're on Windows, install good open source antivirus like [ClamAV][2]. On all platforms, keep your software up to date with the latest security patches. - - * **Take alerts seriously:** If you're visiting a site that starts with HTTPS, your browser might alert you to an issue, says McBride. For instance, if the domain name on the site's certificate doesn't match the one you're trying to visit. Don't ignore the alert. Heed it and navigate away from the site for now. Verify that you haven't [mistyped it][3], and if the problem persists, contact the site owner if you can. - - * **Use an ad blocker:** Pop-up ads (also known as _adware attacks_) can be used to intercept your personal information, so use an ad blocker. "The truth is, as an individual user, it's hard to protect against a MITM attack," says McBride, "as it is designed to leave the victim in the dark and to prevent them from noticing that there is anything wrong." - -A good open source ad blocker (or "wide-spectrum blocker," in the developer's words) is [uBlock origin][4]. It's available for both Firefox and Chromium (and all Chromium-based browsers, such as Chrome, Brave, Vivaldi, Edge, and so on), and even Safari. - - - - -### Stay alert - -Remember, you don't have to click anything online right away, and you don't have to follow random people's instructions, no matter how urgent they may seem. The internet will still be there after you step away from the computer and verify the identity of a person or site demanding your attention. - -While MITM attacks can happen to anyone, understanding what they are, knowing how they happen, and actively taking steps to prevent them can safeguard you from being a victim. - -* * * - -_This article was originally published on [BeenVerified.com][5] under a [CC BY-SA 2.0][6] license._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/mitm-attacks - -作者:[Jackie Lam][a] -选题:[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/beenverified -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security_password_chaos_engineer_monster.png?itok=J31aRccu (Security monster) -[2]: https://www.clamav.net -[3]: https://opensource.com/article/20/1/stop-typosquatting-attacks -[4]: https://github.com/gorhill/uBlock -[5]: https://www.beenverified.com/crime/what-is-a-man-in-the-middle-attack/ -[6]: https://creativecommons.org/licenses/by-sa/2.0/ diff --git a/translated/tech/20200407 How to avoid man-in-the-middle cyber attacks.md b/translated/tech/20200407 How to avoid man-in-the-middle cyber attacks.md new file mode 100644 index 0000000000..7ccce7c3bd --- /dev/null +++ b/translated/tech/20200407 How to avoid man-in-the-middle cyber attacks.md @@ -0,0 +1,84 @@ +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "How to avoid man-in-the-middle cyber attacks" +[#]: via: "https://opensource.com/article/20/4/mitm-attacks" +[#]: author: "Jackie Lam https://opensource.com/users/beenverified" + +如何避免中间人攻击 +====== + +首先搞明白到底什么是中间人攻击,才能避免成为此类高科技窃听的受害者。 + +![Security monster][1] + +当你使用电脑发送数据或与某人在线通话的时候,你一定采取了某种程度的安全隐私手段。 + +但如果有第三方在你不知情的情况下窃听,甚至冒充某个你信任的商业伙伴窃取破坏性的信息呢?你的私人数据就这样被放在了危险分子的手中。 + +这就是臭名昭著的中间人攻击。 + +### 到底什么是中间人攻击? + +黑客潜入到你与受害者或是某个设备间的通信过程中,窃取敏感信息——多数是身份信息——进而从事各种违法行为的过程,就是一次中间人攻击。Scamicide公司创始人Steve J. J. Weisman介绍说: + +“中间人攻击也可以发生在受害者与某个合法app或网页中间。当受害者以为自己面对的是正常app或网页时,其实Ta 正在与一个仿冒的app或网页互动,将自己的敏感信息透露给不法分子。” + +中间人攻击诞生于1980年代,是最古老的网络攻击形式之一。但它却更为常见。Weisman解释道,发生中间人攻击的场景有很多种: + + * **攻陷一个未有效加密的WiFi路由器**:该场景多见于人们使用公共WiFi的时候。“虽然家用路由器也很脆弱,但黑客攻击公共WiFi网络的情况更为常见。”Weisman说,“黑客的目标就是从毫无戒心的人们那里窃取在线银行账户这样的敏感信息。” + * **攻陷银行、金融顾问等机构的电子邮件账户**:“一旦黑客攻陷了这些电子邮件系统,他们就会冒充银行或此类公司给受害者发邮件”,Weisman说,”他们以紧急情况的名义索要个人信息,诸如用户名和密码。受害者很容易被诱骗交出这些信息。“ + * **发送钓鱼邮件**:窃贼们还可能冒充成与受害者有合作关系的公司,向其索要个人信息。”在多个案例中,钓鱼邮件会引导受害者访问一个伪造的网页,这个伪造的网页看起来就和受害者常常访问的合法公司网页一模一样。“Weisman说道。 + * **在合法网页中嵌入恶意代码**:攻击者还会把恶意代码——通常是JavaScript——嵌入到一个合法的网页中。”当受害者加载这个合法网页时,恶意代码首先按兵不动,直到用户输入账户登录或是信用卡信息时,恶意代码就会复制这些信息并将其发送至攻击者的服务器。“网络安全专家Nicholas McBride介绍说。 + +### 有哪些中间人攻击的著名案例? + +联想作为主流的计算机制造厂商,在2014到2015年售卖的消费级笔记本电脑中预装了一款叫做 VisualDiscovery 的软件,拦截用户的网页浏览行为。当用户的鼠标在某个产品页面经过时,这款软件就会弹出一个来自合作伙伴的类似产品的广告。 + +这起中间人攻击事件的关键在于:VisualDiscovery 拥有访问用户所有私人数据的权限,包括身份证号、金融交易信息、医疗信息、登录名和密码等等。所有这些访问行为都是在用户不知情和未获得授权的情况下进行的。联邦交易委员会(FTC)认定此次事件为欺诈与不公平竞争。2019年,联想同意为此支付8300万美元的集体诉讼罚款。 + +### 我如何才能避免遭受中间人攻击? + + * **避免使用公共WiFi:**Weisman建议,从来都不要使用公开的WiFi进行金融交易,除非你安装了可靠的VPN客户端并连接至可信任的VPN服务器。通过VPN连接,你的通信是加密的,信息也就不会失窃。 + * **时刻注意:**对要求你更新密码或是提供用户名等私人信息的邮件或文本消息要时刻保持警惕。这些手段很可能被用来窃取你的身份信息。 + +如果不确定收到的邮件来自于确切哪一方,你可以使用诸如电话反查或是邮件反查等工具。通过电话反查,你可以找出未知发件人的更多身份信息。通过邮件反查,你可以尝试确定谁给你发来了这条消息。 + +通常来讲,如果发现某些方面确实有问题,你可以听从公司中某个你认识或是信任的人的意见。或者,你也可以去你的银行、学校或其他某个组织,当面寻求他们的帮助。总之,重要的账户信息绝对不要透露给不认识的“技术人员”。 + + * **不要点击邮件中的链接:**如果有人给你发了一封邮件,说你需要登录某个账户,不要点击邮件中的链接。相反,要通过平常习惯的方式自行去访问,并留意是否有告警信息。如果在账户设置中没有看到告警信息,给客服打电话的时候也_不要_联系邮件中留的电话,而是站点页面中的联系人信息。 + * **安装可靠的安全软件:**如果你使用的是Windows操作系统,安装开源的杀毒软件,如[ClamAV][2]。如果使用的是其他平台,要保持你的软件安装有最新的安全补丁。 + * **认真对待告警信息:**如果你正在访问的页面以HTTPS开头,浏览器可能会出现一则告警信息。例如,站点证书的域名与你尝试访问的站点域名不相匹配。千万不要忽视此类告警信息。听从告警建议,迅速关掉页面。确认域名没有输入错误的情况下,如果情况依旧,要立刻联系站点所有者。 + * **使用广告屏蔽软件:**弹窗广告(也叫广告软件攻击)可被用于窃取个人信息,因此你还可以使用广告屏蔽类软件。对个人用户来说,中间人攻击其实是很难防范的,因为它被设计出来的时候,就是为了让受害者始终蒙在鼓里,意识不到任何异常。有一款不错的开源广告屏蔽软件叫 [uBlock origin][4]。可以同时支持Firefox和Chromium(以及所有基于Chromium的浏览器,例如Chrome、Brave、Vivaldi、Edge等),甚至还支持Safari。 + +### 保持警惕 + +要时刻记住,你并不需要立刻就点击某些链接,你也并不需要跟随某个陌生人的建议,无论这些信息看起来有多么紧急。互联网始终都在。你大可以先离开电脑,去证实一下这些人的真实身份,看看这些”无比紧急“的页面到底是真是假。 + +尽管任何人都可能遭遇中间人攻击,只要弄明白何为中间人攻击,理解中间人攻击如何发生,并采取有效的防范措施,就可以保护自己避免成为其受害者。 + +* * * + +_This article was originally published on [BeenVerified.com][5] under a [CC BY-SA 2.0][6] license._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/mitm-attacks + +作者:[Jackie Lam][a] +选题:[lujun9972][b] +译者:[tinyeyeser](https://github.com/tinyeyeser) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/beenverified +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security_password_chaos_engineer_monster.png?itok=J31aRccu "Security monster" +[2]: https://www.clamav.net +[3]: https://opensource.com/article/20/1/stop-typosquatting-attacks +[4]: https://github.com/gorhill/uBlock +[5]: https://www.beenverified.com/crime/what-is-a-man-in-the-middle-attack/ +[6]: https://creativecommons.org/licenses/by-sa/2.0/ From 8ea914515c6c9a403688b8f5ad02c9ba854d4c45 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Mon, 4 May 2020 17:52:23 +0800 Subject: [PATCH 0585/1809] Translated (#18330) * Update 20200416 Learning to love systemd.md * Update 20200416 Learning to love systemd.md * Update 20200416 Learning to love systemd.md * Update 20200416 Learning to love systemd.md * Update 20200416 Learning to love systemd.md * Update 20200416 Learning to love systemd.md * Almost Done * Done * Update 20200416 Learning to love systemd.md --- .../tech/20200416 Learning to love systemd.md | 328 ------------------ .../tech/20200416 Learning to love systemd.md | 325 +++++++++++++++++ 2 files changed, 325 insertions(+), 328 deletions(-) delete mode 100644 sources/tech/20200416 Learning to love systemd.md create mode 100644 translated/tech/20200416 Learning to love systemd.md diff --git a/sources/tech/20200416 Learning to love systemd.md b/sources/tech/20200416 Learning to love systemd.md deleted file mode 100644 index 70243db915..0000000000 --- a/sources/tech/20200416 Learning to love systemd.md +++ /dev/null @@ -1,328 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (messon007) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Learning to love systemd) -[#]: via: (https://opensource.com/article/20/4/systemd) -[#]: author: (David Both https://opensource.com/users/dboth) - -Learning to love systemd -====== -systemd is the mother of all processes, responsible for bringing the -Linux host up to a state where productive work can be done. -![Penguin driving a car with a yellow background][1] - -systemd—yes, all lower-case, even at the beginning of a sentence—is the modern replacement for init and SystemV init scripts. It is also much more. - -Like most sysadmins, when I think of the init program and SystemV, I think of Linux startup and shutdown and not really much else, like managing services once they are up and running. Like init, systemd is the mother of all processes, and it is responsible for bringing the Linux host up to a state in which productive work can be done. Some of the functions assumed by systemd, which is far more extensive than the old init program, are to manage many aspects of a running Linux host, including mounting filesystems, managing hardware, handling timers, and starting and managing the system services that are required to have a productive Linux host. - -This series of articles, which is based in part on excerpts from my three-volume Linux training course, [_Using and administering Linux: zero to sysadmin_][2], explores systemd's functions both at startup and beginning after startup finishes. - -### Linux boot - -The complete process that takes a Linux host from an off state to a running state is complex, but it is open and knowable. Before getting into the details, I'll give a quick overview from when the host hardware is turned on until the system is ready for a user to log in. Most of the time, "the boot process" is discussed as a single entity, but that is not accurate. There are, in fact, three major parts to the full boot and startup process: - - * **Hardware boot:** Initializes the system hardware - * **Linux boot:** Loads the Linux kernel and then systemd - * **Linux startup:** Where systemd prepares the host for productive work - - - -The Linux startup sequence begins after the kernel has loaded either init or systemd, depending upon whether the distribution uses the old or new startup, respectively. The init and systemd programs start and manage all the other processes and are both known as the "mother of all processes" on their respective systems. - -It is important to separate the hardware boot from the Linux boot from the Linux startup and to explicitly define the demarcation points between them. Understanding these differences and what part each plays in getting a Linux system to a state where it can be productive makes it possible to manage these processes and better determine where a problem is occurring during what most people refer to as "boot." - -The startup process follows the three-step boot process and brings the Linux computer up to an operational state in which it is usable for productive work. The startup process begins when the kernel transfers control of the host to systemd. - -### systemd controversy - -systemd can evoke a wide range of reactions from sysadmins and others responsible for keeping Linux systems up and running. The fact that systemd is taking over so many tasks in many Linux systems has engendered pushback and discord among certain groups of developers and sysadmins. - -SystemV and systemd are two different methods of performing the Linux startup sequence. SystemV start scripts and the init program are the old methods, and systemd using targets is the new method. Although most modern Linux distributions use the newer systemd for startup, shutdown, and process management, there are still some that do not. One reason is that some distribution maintainers and some sysadmins prefer the older SystemV method over the newer systemd. - -I think both have advantages. - -#### Why I prefer SystemV - -I prefer SystemV because it is more open. Startup is accomplished using Bash scripts. After the kernel starts the init program, which is a compiled binary, init launches the **rc.sysinit** script, which performs many system initialization tasks. After **rc.sysinit** completes, init launches the **/etc/rc.d/rc** script, which in turn starts the various services defined by the SystemV start scripts in the **/etc/rc.d/rcX.d**, where "X" is the number of the runlevel being started. - -Except for the init program itself, all these programs are open and easily knowable scripts. It is possible to read through these scripts and learn exactly what is taking place during the entire startup process, but I don't think many sysadmins actually do that. Each start script is numbered so that it starts its intended service in a specific sequence. Services are started serially, and only one service starts at a time. - -systemd, developed by Red Hat's Lennart Poettering and Kay Sievers, is a complex system of large, compiled binary executables that are not understandable without access to the source code. It is open source, so "access to the source code" isn't hard, just less convenient. systemd appears to represent a significant refutation of multiple tenets of the Linux philosophy. As a binary, systemd is not directly open for the sysadmin to view or make easy changes. systemd tries to do everything, such as managing running services, while providing significantly more status information than SystemV. It also manages hardware, processes, and groups of processes, filesystem mounts, and much more. systemd is present in almost every aspect of the modern Linux host, making it the one-stop tool for system management. All of this is a clear violation of the tenets that programs should be small and that each program should do one thing and do it well. - -#### Why I prefer systemd - -I prefer systemd as my startup mechanism because it starts as many services as possible in parallel, depending upon the current stage in the startup process. This speeds the overall startup and gets the host system to a login screen faster than SystemV. - -systemd manages almost every aspect of a running Linux system. It can manage running services while providing significantly more status information than SystemV. It also manages hardware, processes and groups of processes, filesystem mounts, and much more. systemd is present in almost every aspect of the modern Linux operating system, making it the one-stop tool for system management. (Does this sound familiar?) - -The systemd tools are compiled binaries, but the tool suite is open because all the configuration files are ASCII text files. Startup configuration can be modified through various GUI and command-line tools, as well as adding or modifying various configuration files to suit the needs of the specific local computing environment. - -#### The real issue - -Did you think I could not like both startup systems? I do, and I can work with either one. - -In my opinion, the real issue and the root cause of most of the controversy between SystemV and systemd is that there is [no choice][3] on the sysadmin level. The choice of whether to use SystemV or systemd has already been made by the developers, maintainers, and packagers of the various distributions—but with good reason. Scooping out and replacing an init system, by its extreme, invasive nature, has a lot of consequences that would be hard to tackle outside the distribution design process. - -Despite the fact that this choice is made for me, my Linux hosts boot up and work, which is what I usually care the most about. As an end user and even as a sysadmin, my primary concern is whether I can get my work done, work such as writing my books and this article, installing updates, and writing scripts to automate everything. So long as I can do my work, I don't really care about the start sequence used on my distro. - -I do care when there is a problem during startup or service management. Regardless of which startup system is used on a host, I know enough to follow the sequence of events to find the failure and fix it. - -#### Replacing SystemV - -There have been previous attempts at replacing SystemV with something a bit more modern. For about two releases, Fedora used a thing called Upstart to replace the aging SystemV, but it did not replace init and provided no changes that I noticed. Because Upstart provided no significant changes to the issues surrounding SystemV, efforts in this direction were quickly dropped in favor of systemd. - -Despite the fact that most Linux developers agree that replacing the old SystemV startup is a good idea, many developers and sysadmins dislike systemd for that. Rather than rehash all the so-called issues that people have—or had—with systemd, I will refer you to two good, if somewhat old, articles that should cover most everything. Linus Torvalds, the creator of the Linux kernel, seems disinterested. In a 2014 ZDNet article, _[Linus Torvalds and others on Linux's systemd][4]_, Linus is clear about his feelings. - -> "I don't actually have any particularly strong opinions on systemd itself. I've had issues with some of the core developers that I think are much too cavalier about bugs and compatibility, and I think some of the design details are insane (I dislike the binary logs, for example), but those are details, not big issues." - -In case you don't know much about Linus, I can tell you that if he does not like something, he is very outspoken, explicit, and quite clear about that dislike. He has become more socially acceptable in his manner of addressing his dislike about things. - -In 2013, Poettering wrote a long blog post in which he debunks the [myths about systemd][5] while providing insight into some of the reasons for creating it. This is a very good read, and I highly recommend it. - -### systemd tasks - -Depending upon the options used during the compile process (which are not considered in this series), systemd can have as many as 69 binary executables that perform the following tasks, among others: - - * The systemd program runs as PID 1 and provides system startup of as many services in parallel as possible, which, as a side effect, speeds overall startup times. It also manages the shutdown sequence. - * The systemctl program provides a user interface for service management. - * Support for SystemV and LSB start scripts is offered for backward compatibility. - * Service management and reporting provide more service status data than SystemV. - * It includes tools for basic system configuration, such as hostname, date, locale, lists of logged-in users, running containers and virtual machines, system accounts, runtime directories and settings, daemons to manage simple network configuration, network time synchronization, log forwarding, and name resolution. - * It offers socket management. - * systemd timers provide advanced cron-like capabilities to include running a script at times relative to system boot, systemd startup, the last time the timer was started, and more. - * It provides a tool to analyze dates and times used in timer specifications. - * Mounting and unmounting of filesystems with hierarchical awareness allows safer cascading of mounted filesystems. - * It enables the positive creation and management of temporary files, including deletion. - * An interface to D-Bus provides the ability to run scripts when devices are plugged in or removed. This allows all devices, whether pluggable or not, to be treated as plug-and-play, which considerably simplifies device handling. - * Its tool to analyze the startup sequence can be used to locate the services that take the most time. - * It includes journals for storing system log messages and tools for managing the journals. - - - -### Architecture - -Those tasks and more are supported by a number of daemons, control programs, and configuration files. Figure 1 shows many of the components that belong to systemd. This is a simplified diagram designed to provide a high-level overview, so it does not include all of the individual programs or files. Nor does it provide any insight into data flow, which is so complex that it would be a useless exercise in the context of this series of articles. - -![systemd architecture][6] - -A full exposition of systemd would take a book on its own. You do not need to understand the details of how the systemd components in Figure 1 fit together; it's enough to know about the programs and components that enable managing various Linux services and deal with log files and journals. But it's clear that systemd is not the monolithic monstrosity it is purported to be by some of its critics. - -### systemd as PID 1 - -systemd is PID 1. Some of its functions, which are far more extensive than the old SystemV3 init program, are to manage many aspects of a running Linux host, including mounting filesystems and starting and managing system services required to have a productive Linux host. Any of systemd's tasks that are not related to the startup sequence are outside the scope of this article (but some will be explored later in this series). - -First, systemd mounts the filesystems defined by **/etc/fstab**, including any swap files or partitions. At this point, it can access the configuration files located in **/etc**, including its own. It uses its configuration link, **/etc/systemd/system/default.target**, to determine which state or target it should boot the host into. The **default.target** file is a symbolic link to the true target file. For a desktop workstation, this is typically going to be the **graphical.target**, which is equivalent to runlevel 5 in SystemV. For a server, the default is more likely to be the **multi-user.target**, which is like runlevel 3 in SystemV. The **emergency.target** is similar to single-user mode. Targets and services are systemd units. - -The table below (Figure 2) compares the systemd targets with the old SystemV startup runlevels. systemd provides the systemd target aliases for backward compatibility. The target aliases allow scripts—and many sysadmins—to use SystemV commands like **init 3** to change runlevels. Of course, the SystemV commands are forwarded to systemd for interpretation and execution. - -**systemd targets** | **SystemV runlevel** | **target aliases** | **Description** ----|---|---|--- -default.target | | | This target is always aliased with a symbolic link to either **multi-user.target** or **graphical.target**. systemd always uses the **default.target** to start the system. The **default.target** should never be aliased to **halt.target**, **poweroff.target**, or **reboot.target**. -graphical.target | 5 | runlevel5.target | **Multi-user.target** with a GUI -| 4 | runlevel4.target | Unused. Runlevel 4 was identical to runlevel 3 in the SystemV world. This target could be created and customized to start local services without changing the default **multi-user.target**. -multi-user.target | 3 | runlevel3.target | All services running, but command-line interface (CLI) only -| 2 | runlevel2.target | Multi-user, without NFS, but all other non-GUI services running -rescue.target | 1 | runlevel1.target | A basic system, including mounting the filesystems with only the most basic services running and a rescue shell on the main console -emergency.target | S | | Single-user mode—no services are running; filesystems are not mounted. This is the most basic level of operation with only an emergency shell running on the main console for the user to interact with the system. -halt.target | | | Halts the system without powering it down -reboot.target | 6 | runlevel6.target | Reboot -poweroff.target | 0 | runlevel0.target | Halts the system and turns the power off - -Each target has a set of dependencies described in its configuration file. systemd starts the required dependencies, which are the services required to run the Linux host at a specific level of functionality. When all the dependencies listed in the target configuration files are loaded and running, the system is running at that target level. In Figure 2, the targets with the most functionality are at the top of the table, with functionality declining towards the bottom of the table. - -systemd also looks at the legacy SystemV init directories to see if any startup files exist there. If so, systemd uses them as configuration files to start the services described by the files. The deprecated network service is a good example of one that still uses SystemV startup files in Fedora. - -Figure 3 (below) is copied directly from the bootup man page. It shows a map of the general sequence of events during systemd startup and the basic ordering requirements to ensure a successful startup. - - -``` -                                         cryptsetup-pre.target -                                                   | - (various low-level                                v -     API VFS mounts:                 (various cryptsetup devices...) -  mqueue, configfs,                                |    | -  debugfs, ...)                                    v    | -  |                                  cryptsetup.target  | -  |  (various swap                                 |    |    remote-fs-pre.target -  |   devices...)                                  |    |     |        | -  |    |                                           |    |     |        v -  |    v                       local-fs-pre.target |    |     |  (network file systems) -  |  swap.target                       |           |    v     v                 | -  |    |                               v           |  remote-cryptsetup.target  | -  |    |  (various low-level  (various mounts and  |             |              | -  |    |   services: udevd,    fsck services...)   |             |    remote-fs.target -  |    |   tmpfiles, random            |           |             |             / -  |    |   seed, sysctl, ...)          v           |             |            / -  |    |      |                 local-fs.target    |             |           / -  |    |      |                        |           |             |          / -  \\____|______|_______________   ______|___________/             |         / -                              \ /                                |        / -                               v                                 |       / -                        sysinit.target                           |      / -                               |                                 |     / -        ______________________/|\\_____________________           |    / -       /              |        |      |               \          |   / -       |              |        |      |               |          |  / -       v              v        |      v               |          | / -  (various       (various      |  (various            |          |/ -   timers...)      paths...)   |   sockets...)        |          | -       |              |        |      |               |          | -       v              v        |      v               |          | - timers.target  paths.target   |  sockets.target      |          | -       |              |        |      |               v          | -       v              \\_______ | _____/         rescue.service   | -                              \|/                     |          | -                               v                      v          | -                           basic.target         rescue.target    | -                               |                                 | -                       ________v____________________             | -                      /              |              \            | -                      |              |              |            | -                      v              v              v            | -                  display-    (various system   (various system  | -              manager.service     services        services)      | -                      |         required for        |            | -                      |        graphical UIs)       v            v -                      |              |            multi-user.target - emergency.service    |              |              | -         |            \\_____________ | _____________/ -         v                          \|/ - emergency.target                    v -                              graphical.target -``` - -The **sysinit.target** and **basic.target** targets can be considered checkpoints in the startup process. Although one of systemd's design goals is to start system services in parallel, certain services and functional targets must be started before other services and targets can start. These checkpoints cannot be passed until all of the services and targets required by that checkpoint are fulfilled. - -The **sysinit.target** is reached when all of the units it depends on are completed. All of those units, mounting filesystems, setting up swap files, starting udev, setting the random generator seed, initiating low-level services, and setting up cryptographic services (if one or more filesystems are encrypted), must be completed but, within the **sysinit.target**, those tasks can be performed in parallel. - -The **sysinit.target** starts up all of the low-level services and units required for the system to be marginally functional and that are required to enable moving onto the **basic.target**. - -After the **sysinit.target** is fulfilled, systemd then starts all the units required to fulfill the next target. The basic target provides some additional functionality by starting units that are required for all of the next targets. These include setting up things like paths to various executable directories, communication sockets, and timers. - -Finally, the user-level targets, **multi-user.target** or **graphical.target**, can be initialized. The **multi-user.target** must be reached before the graphical target dependencies can be met. The underlined targets in Figure 3 are the usual startup targets. When one of these targets is reached, startup has completed. If the **multi-user.target** is the default, then you should see a text-mode login on the console. If **graphical.target** is the default, then you should see a graphical login; the specific GUI login screen you see depends on your default display manager. - -The bootup man page also describes and provides maps of the boot into the initial RAM disk and the systemd shutdown process. - -systemd also provides a tool that lists dependencies of a complete startup or for a specified unit. A unit is a controllable systemd resource entity that can range from a specific service, such as httpd or sshd, to timers, mounts, sockets, and more. Try the following command and scroll through the results. - - -``` -`systemctl list-dependencies graphical.target` -``` - -Notice that this fully expands the top-level target units list required to bring the system up to the graphical target run mode. Use the **\--all** option to expand all of the other units as well. - - -``` -`systemctl list-dependencies --all graphical.target` -``` - -You can search for strings such as "target," "slice," and "socket" using the search tools of the **less** command. - -So now, try the following. - - -``` -`systemctl list-dependencies multi-user.target` -``` - -and - - -``` -`systemctl list-dependencies rescue.target` -``` - -and - - -``` -`systemctl list-dependencies local-fs.target` -``` - -and - - -``` -`systemctl list-dependencies dbus.service` -``` - -This tool helps me visualize the specifics of the startup dependencies for the host I am working on. Go ahead and spend some time exploring the startup tree for one or more of your Linux hosts. But be careful because the systemctl man page contains this note: - -> _"Note that this command only lists units currently loaded into memory by the service manager. In particular, this command is not suitable to get a comprehensive list at all reverse dependencies on a specific unit, as it won't list the dependencies declared by units currently not loaded."_ - -### Final thoughts - -Even before getting very deep into systemd, it's obvious that it is both powerful and complex. It is also apparent that systemd is not a single, huge, monolithic, and unknowable binary file. Rather, it is composed of a number of smaller components and subcommands that are designed to perform specific tasks. - -The next article in this series will explore systemd startup in more detail, as well as systemd configuration files, changing the default target, and how to create a simple service unit. - -### Resources - -There is a great deal of information about systemd available on the internet, but much is terse, obtuse, or even misleading. In addition to the resources mentioned in this article, the following webpages offer more detailed and reliable information about systemd startup. - - * The Fedora Project has a good, practical [guide][7] [to systemd][7]. It has pretty much everything you need to know in order to configure, manage, and maintain a Fedora computer using systemd. - * The Fedora Project also has a good [cheat sheet][8] that cross-references the old SystemV commands to comparable systemd ones. - * For detailed technical information about systemd and the reasons for creating it, check out [Freedesktop.org][9]'s [description of systemd][10]. - * [Linux.com][11]'s "More systemd fun" offers more advanced systemd [information and tips][12]. - - - -There is also a series of deeply technical articles for Linux sysadmins by Lennart Poettering, the designer and primary developer of systemd. These articles were written between April 2010 and September 2011, but they are just as relevant now as they were then. Much of everything else good that has been written about systemd and its ecosystem is based on these papers. - - * [Rethinking PID 1][13] - * [systemd for Administrators, Part I][14] - * [systemd for Administrators, Part II][15] - * [systemd for Administrators, Part III][16] - * [systemd for Administrators, Part IV][17] - * [systemd for Administrators, Part V][18] - * [systemd for Administrators, Part VI][19] - * [systemd for Administrators, Part VII][20] - * [systemd for Administrators, Part VIII][21] - * [systemd for Administrators, Part IX][22] - * [systemd for Administrators, Part X][23] - * [systemd for Administrators, Part XI][24] - - - -Alison Chiaken, a Linux kernel and systems programmer at Mentor Graphics, offers a preview of her... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/systemd - -作者:[David Both][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/dboth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) -[2]: http://www.both.org/?page_id=1183 -[3]: http://www.osnews.com/story/28026/Editorial_Thoughts_on_Systemd_and_the_Freedom_to_Choose -[4]: https://www.zdnet.com/article/linus-torvalds-and-others-on-linuxs-systemd/ -[5]: http://0pointer.de/blog/projects/the-biggest-myths.html -[6]: https://opensource.com/sites/default/files/uploads/systemd-architecture.png (systemd architecture) -[7]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html -[8]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet -[9]: http://Freedesktop.org -[10]: http://www.freedesktop.org/wiki/Software/systemd -[11]: http://Linux.com -[12]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ -[13]: http://0pointer.de/blog/projects/systemd.html -[14]: http://0pointer.de/blog/projects/systemd-for-admins-1.html -[15]: http://0pointer.de/blog/projects/systemd-for-admins-2.html -[16]: http://0pointer.de/blog/projects/systemd-for-admins-3.html -[17]: http://0pointer.de/blog/projects/systemd-for-admins-4.html -[18]: http://0pointer.de/blog/projects/three-levels-of-off.html -[19]: http://0pointer.de/blog/projects/changing-roots -[20]: http://0pointer.de/blog/projects/blame-game.html -[21]: http://0pointer.de/blog/projects/the-new-configuration-files.html -[22]: http://0pointer.de/blog/projects/on-etc-sysinit.html -[23]: http://0pointer.de/blog/projects/instances.html -[24]: http://0pointer.de/blog/projects/inetd.html diff --git a/translated/tech/20200416 Learning to love systemd.md b/translated/tech/20200416 Learning to love systemd.md new file mode 100644 index 0000000000..34bc8ea314 --- /dev/null +++ b/translated/tech/20200416 Learning to love systemd.md @@ -0,0 +1,325 @@ +[#]: collector: (lujun9972) +[#]: translator: (messon007) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learning to love systemd) +[#]: via: (https://opensource.com/article/20/4/systemd) +[#]: author: (David Both https://opensource.com/users/dboth) + +学会爱上systemd +====== + +systemd是所有进程的源头,负责将Linux主机启动到可以做生产性任务的状态。 +![Penguin driving a car with a yellow background][1] + +systemd(是的,全小写,即使在句子开头也是小写),是init和SystemV init脚本的现代替代者。它还有更多功能。 + +当我想到init和SystemV时,像大多数系统管理员一样,我想到的是Linux的启动和关闭,而没有太多其他的,例如在服务启动和运行后对其进行管理。像init一样,systemd是所有进程的源头,它负责使Linux主机启动到可以做生产性任务的状态。 systemd设定的一些功能比老的init要广泛得多,它要管理正在运行的Linux主机的许多方面,包括挂载文件系统,管理硬件,处理定时器以及启动和管理生产性主机所需的系统服务。 + +本系列文章是基于我的部分三期Linux培训课程[_使用和管理Linux:从零开始进行学习系统管理_][2]的摘录,探讨了systemd在启动和启动完成后的功能。 + +### Linux启动 + +Linux主机从关机状态到运行状态的完整启动过程很复杂,但它是开放的并且是可知的。在详细介绍之前,我将简要介绍一下从主机硬件被上电到系统准备好用户登录(的过程)。大多数时候,“启动过程”被作为单个概念来讨论,但这是不准确的。实际上,完整的引导和启动过程包含三个主要部分: + +   * **硬件引导:** 初始化系统硬件 + * **Linux引导:** 加载Linux内核和systemd + * **Linux启动:** systemd启动, 为生产工作做准备 + + +Linux启动阶段在内核加载了init或systemd(取决于具体发行版使用的是旧的方式还是还是新的方式)之后开始。init和systemd程序启动并管理所有其他进程,他们在各自的系统上都被称为“所有进程之母”。 + +将硬件引导与Linux引导及Linux启动区分开,并明确定义它们之间的分界点是很重要的。理解他们的差异以及他们每一个在使Linux系统进入生产准备状态所起的作用,才能够管理这些进程并更好地确定大部分人所谓的“启动”问题出在哪里。 + +启动过程按照三步引导流程使Linux计算机进入可进行生产工作的状态。当内核将主机的控制权转移到systemd时,启动环节开始。 + +### systemd之争 + +systemd引起了系统管理员和其他负责维护Linux系统正常运行人员的广泛回应。systemd正在许多Linux系统中接管大量任务的事实造成了某些开发人群和系统管理员群组之间的阻挠和争议。 + +SystemV和systemd是执行Linux启动环节的两种不同的方法。 SystemV启动脚本和init程序是老的方法,而使用目标(targets)的systemd是新方法。尽管大多数现代Linux发行版都使用较新的systemd进行启动,关机和进程管理,但仍有一些发行版未采用。原因之一是某些发行版维护者和系统管理员喜欢老的SystemV方法,而不是新的systemd。 + +我认为两者都有其优势。 + +#### 为何我更喜欢SystemV + +我更喜欢SystemV,因为它更开放。使用Bash脚本来完成启动。内核启动init程序(编译后的二进制)后,init启动 **rc.sysinit** 脚本,该脚本执行许多系统初始化任务。 **rc.sysinit** 执行完后,init启动 **/etc/rc.d/rc** 脚本,该脚本依次启动 **/etc/rc.d/rcX.d** 中由SystemV启动脚本定义的各种服务。 其中“ X”是待启动的运行级别号。 + +除了init程序本身之外,所有这些程序都是开放且易于理解的脚本。可以通读这些脚本并确切了解整个启动过程中发生的事情,但是我不认为有太多系统管理员会实际这样做。每个启动脚本都被编了号,以便按特定顺序启动预期的服务。服务是串行启动的,一次只能启动一个服务。 + +由Red Hat的Lennart Poettering和Kay Sievers开发的systemd是一个由大的已编译的二进制可执行文件构成的复杂系统,不访问其源码就无法理解。它是开源的,因此“访问其源代码”并不难,只是不太方便。systemd似乎表现出对Linux哲学多个原则的重大驳斥。作为二进制文件,systemd无法被直接打开供系统管理员查看或进行简单更改。systemd试图做所有事情,例如管理正在运行的服务,同时提供比SystemV更多的状态信息。它还管理硬件,进程,进程组,文件系统挂载等。 systemd几乎涉足于现代Linux主机的每方面,使它成为系统管理的一站式工具。所有这些都明显违反了"程序应该小且每个程序都应该只做一件事并且做好"的原则。 + +#### 为何我更喜欢systemd + +我更喜欢用systemd作为启动机制,因为它会根据启动阶段并行地启动尽可能多的服务。这样可以加快整个的启动速度,使得主机系统比SystemV更快地到达登录屏幕。 + +systemd几乎可以管理正在运行的Linux系统的各个方面。它可以管理正在运行的服务,同时提供比SystemV多得多的状态信息。它还管理硬件,进程和进程组,文件系统挂载等。 systemd几乎涉足于现代Linux操作系统的每方面,使其成为系统管理的一站式工具。(听起来熟悉吧?) + +systemd工具是编译后的二进制文件,但该工具包是开放的,因为所有配置文件都是ASCII文本文件。可以通过各种GUI和命令行工具来修改启动配置,也可以添加或修改各种配置文件来满足特定的本地计算环境的需求。 + +#### 真正的问题 + +您认为我不能喜欢两种启动系统吗?我能,我会用它们中的任何一个。 + +我认为,SystemV和systemd之间大多数争议的真正问题和根本原因在于,系统管理阶段[没有选择权][3]。使用SystemV还是systemd已经由各种发行版的开发人员,维护人员和打包人员选择了(但有充分的理由)。由于init极端的侵入性, 挖出(scooping out)并替换init系统会带来很多影响,发行版设计过程之外(的环节)很难处理这些影响。 + +尽管该选择实际上是为我而选的,我通常最关心的是我的Linux主机仍然可以启动并正常工作。作为最终用户,甚至是系统管理员,我主要关心的是我是否可以完成我的工作,例如写我的书和这篇文章,安装更新以及编写脚本来自动化所有事情。只要我能做我的工作,我就不会真正在意发行版中使用的启动系统。 + +在启动或服务管理出现问题时,我会在意。无论主机上使用哪种启动系统,我都足够了解如何沿着事件顺序来查找故障并进行修复。 + +#### 替换SystemV + +以前曾有过用更现代的东西替代SystemV的尝试。在大约两个版本中,Fedora使用了一个叫作Upstart的东西来替换老化的SystemV,但是它没有替换init并且没有我能感知到的变化。由于Upstart并未对SystemV的问题进行任何重大更改,因此这个方向的努力很快就被systemd放弃了。 + +尽管大部分Linux开发人员都认可替换旧的SystemV启动系统是个好主意,但许多开发人员和系统管理员并不喜欢systemd。与其重新讨论人们在systemd中遇到的或曾经遇到过的所有所谓的问题,不如带您去看两篇好文章,尽管有些陈旧,但它们涵盖了大多数内容。Linux内核的创建者Linus Torvalds对systemd似乎不感兴趣。在2014年ZDNet的文章_[Linus Torvalds和其他人对Linux上的systemd的看法][4]_中,Linus清楚地表达了他的感受。 + +>“实际上我对systemd本身没有任何特别强烈的意见。我对一些核心开发人员有一些意见,我认为它们在对待bugs和兼容性方面过于轻率,而且我认为某些设计细节是疯狂的(例如,我不喜欢二进制日志),但这只是细节,不是大问题。” + +如果您对Linus不太了解,我可以告诉您,如果他不喜欢某事,那么他非常直率,坦率,并且非常清楚这种不喜欢。他解决自己对事物不满的方式已经被社会更好地接受了。 + +2013年,Poettering写了一篇很长的博客,其中他在揭穿[systemd的神话][5]的同时透露了创建它的一些原因。这是一本很好的读物,我强烈建议您阅读。 + +### systemd任务 + +根据编译过程中使用的选项(不在本系列中介绍),systemd可以有多达69个二进制可执行文件用于执行任务,其中包括: + + * systemd程序以1号进程(PID 1)运行,并提供使尽可能多服务并行启动的系统启动能力,它额外加快了总体启动时间。它还管理关机顺序。 + * systemctl程序提供了服务管理的用户接口。 + * 支持SystemV和LSB启动脚本,以便向后兼容。 +  * 服务管理和报告提供了比SystemV更多的服务状态数据。 + * 提供基本的系统配置工具,例如主机名,日期,语言环境,已登录用户的列表,正在运行的容器和虚拟机,系统帐户,运行时目录和设置;用于简易网络配置,网络时间同步,日志转发和名称解析的守护程序。 +  * 提供套接字管理。 + * systemd定时器提供类似cron的高级功能,包括在相对于系统启动,systemd启动,定时器上次启动时刻的某个时间点运行脚本。 + * 提供了一个工具来分析定时器规格中使用的日期和时间。 + * 能感知层次的文件系统挂载和卸载可以更安全地级联挂载的文件系统。 + * 允许主动的创建和管理临时文件,包括删除文件。 + * D-Bus的接口提供在插入或移除设备时运行脚本的能力。这允许将所有设备(无论是否可插拔)都被视为即插即用,从而大大简化了设备的处理。 + * 分析启动顺序的工具可用于查找耗时最多的服务。 +  * 包括用于存储系统消息的日志以及管理日志的工具。 + + +### 架构 + +这些和更多的任务通过许多守护程序,控制程序和配置文件来支持。图1显示了许多属于systemd的组件。这是一个简化的图,旨在提供概要描述,因此它并不包括所有独立的程序或文件。它也不提供数据流的视角,数据流是如此复杂,因此在本系列文章的背景下没用。 + +![系统架构][6] + +完整的systemd讲解就需要一本书。您不需要了解图1中的systemd组件是如何组合在一起的细节。了解支持各种Linux服务管理以及日志文件和日志处理的程序和组件就够了。 但是很明显,systemd并不是某些批评者所说的那样的庞然大物。 + +### 作为1号进程的systemd + +systemd是1号进程(PID 1)。它的一些功能(比老的SystemV3 init要广泛得多)用于管理正在运行的Linux主机的许多方面,包括挂载文件系统以及启动和管理Linux生产主机所需的系统服务。与启动顺序无关的任何systemd任务都不在本文讨论范围之内(但本系列后面的一些文章将探讨其中的一些任务)。 + +首先,systemd挂载 **/etc/fstab** 所定义的文件系统,包括所有交换文件或分区。此时,它可以访问位于 **/etc** 中的配置文件,包括它自己的配置文件。它使用其配置链接 **/etc/systemd/system/default.target** 来确定将主机引导至哪个状态或目标。 **default.target** 文件是指向真实目标文件的符号链接。对于桌面工作站,通常是 **graphical.target**,它相当于SystemV中的运行级别5。对于服务器,默认值更可能是 **multi-user.target**,相当于SystemV中的运行级别3。 **emergency.target** 类似于单用户模式。目标(targets)和服务(services)是systemd的单位。 + +下表(图2)将systemd目标与老的SystemV启动运行级别进行了比较。systemd提供systemd目标别名以便向后兼容。目标别名允许脚本(以及许多系统管理员)使用SystemV命令(如**init 3**)更改运行级别。当然,SystemV命令被转发给systemd进行解释和执行。 + +**systemd目标** | **SystemV运行级别** | **目标别名** | **描述** +--- | --- | ---- |- +default.target | | |此目标总是通过符号连接的方式成为“多用户目标”或“图形化目标”的别名。systemd始终使用 **default.target** 来启动系统。 ** default.target** 绝不应该设为 **halt.target**,**poweroff.target** 或 **reboot.target** 的别名 +graphic.target | 5 | runlevel5.target |带有GUI的 **Multi-user.target** +| 4 | runlevel4.target |未用。在SystemV中运行级别4与运行级别3相同。可以创建并自定义此目标以启动本地服务,而无需更改默认的 **multi-user.target** +multi-user.target | 3 | runlevel3.target |所有服务在运行,但仅有命令行界面(CLI) +| 2 | runlevel2.target |多用户,没有NFS,其他所有非GUI服务在运行 +rescue.target | 1 | runlevel1.target |基本系统,包括挂载文件系统,运行最基本的服务和主控制台的恢复shell +Emergency.target | S | |单用户模式-没有服务运行;不挂载文件系统。这是最基本的工作级别,只有主控制台上运行的一个紧急Shell供用户与系统交互 +halt.target | | |在不关电源的情况下停止系统 +reboot.target | 6 | runlevel6.target |重启 +poweroff.target | 0 | runlevel0.target |停止系统并关闭电源 + +每个目标在其配置文件中都描述了一个依赖集。systemd启动必须的依赖,这些依赖是运行Linux主机到特定功能级别所需的服务。当目标配置文件中列出的所有依赖项被加载并运行后,系统就在该目标级别运行了。 在图2中,功能最多的目标位于表的顶部,从顶向下,功能逐步递减。 + +systemd还会检查老的SystemV init目录,以确认是否存在任何启动文件。如果有,systemd会将它们作为配置文件以启动它们描述的服务。网络服务是一个很好的例子,在Fedora中它仍然使用SystemV启动文件。 + +图3(如下)是直接从启动手册页复制来的。它显示了systemd启动期间普遍的事件顺序以及确保成功启动的基本顺序要求。 + +``` +                                         cryptsetup-pre.target +                                                   | + (various low-level                                v +     API VFS mounts:                 (various cryptsetup devices...) +  mqueue, configfs,                                |    | +  debugfs, ...)                                    v    | +  |                                  cryptsetup.target  | +  |  (various swap                                 |    |    remote-fs-pre.target +  |   devices...)                                  |    |     |        | +  |    |                                           |    |     |        v +  |    v                       local-fs-pre.target |    |     |  (network file systems) +  |  swap.target                       |           |    v     v                 | +  |    |                               v           |  remote-cryptsetup.target  | +  |    |  (various low-level  (various mounts and  |             |              | +  |    |   services: udevd,    fsck services...)   |             |    remote-fs.target +  |    |   tmpfiles, random            |           |             |             / +  |    |   seed, sysctl, ...)          v           |             |            / +  |    |      |                 local-fs.target    |             |           / +  |    |      |                        |           |             |          / +  \\____|______|_______________   ______|___________/             |         / +                              \ /                                |        / +                               v                                 |       / +                        sysinit.target                           |      / +                               |                                 |     / +        ______________________/|\\_____________________           |    / +       /              |        |      |               \          |   / +       |              |        |      |               |          |  / +       v              v        |      v               |          | / +  (various       (various      |  (various            |          |/ +   timers...)      paths...)   |   sockets...)        |          | +       |              |        |      |               |          | +       v              v        |      v               |          | + timers.target  paths.target   |  sockets.target      |          | +       |              |        |      |               v          | +       v              \\_______ | _____/         rescue.service   | +                              \|/                     |          | +                               v                      v          | +                           basic.target         rescue.target    | +                               |                                 | +                       ________v____________________             | +                      /              |              \            | +                      |              |              |            | +                      v              v              v            | +                  display-    (various system   (various system  | +              manager.service     services        services)      | +                      |         required for        |            | +                      |        graphical UIs)       v            v +                      |              |            multi-user.target + emergency.service    |              |              | +         |            \\_____________ | _____________/ +         v                          \|/ + emergency.target                    v +                              graphical.target +``` + +**sysinit.target** 和 **basic.target** 目标可以看作启动过程中的检查点。尽管systemd的设计目标之一是并行启动系统服务,但是某些服务和功能目标必须先启动,然后才能启动其他服务和目标。直到该检查点所需的所有服务和目标被满足后才能通过这些检查点。 + +当它依赖的所有单元都完成时,将到达 **sysinit.target**。所有这些单元,挂载文件系统,设置交换文件,启动udev,设置随机数生成器种子,启动低层服务以及配置安全服务(如果一个或多个文件系统是加密的)都必须被完成,但 **sysinit.target** 的这些任务可以并行执行。 + +**sysinit.target** 将启动系统接近正常运行所需的所有低层服务和单元,以及转移到 **basic.target** 所需的服务和单元。 + +在完成 **sysinit.target** 目标之后,systemd会启动实现下一个目标所需的所有单元。基本目标通过启动所有下一目标所需的单元来提供一些其他功能。包括设置如PATHs为各种可执行程序的路径,设置通信套接字和计时器之类。 + +最后,用户级目标 **multi-user.target** 或 **graphical.target** 被初始化。要满足图形目标的依赖必须先达到**multi-user.target**。图3中带下划线的目标是通常的启动目标。当达到这些目标之一时,启动就完成了。如果 **multi-user.target** 是默认设置,那么您应该在控制台上看到文本模式的登录界面。如果 **graphical.target** 是默认设置,那么您应该看到图形的登录界面。您看到的特定的GUI登录界面取决于您默认的显示管理器。 + +引导手册页还描述并提供了引导到初始RAM磁盘和systemd关机过程的地图。 + +systemd还提供了一个工具,该工具列出了完整启动或指定单元的依赖。单元是可控制的systemd资源实体,其范围从特定服务(例如httpd或sshd)到计时器,挂载,套接字等。尝试以下命令并滚动查看结果。 + +``` +`systemctl list-dependencies graphical.target` +``` + +注意,这完全展开了使系统进入图形目标运行模式所需的顶层目标单元列表。 也可以使用 **\-all** 选项来展开所有其他单元。 + +``` +`systemctl list-dependencies --all graphical.target` +``` + +您可以使用 **less** 命令来搜索诸如“target”,“slice”和“ socket”之类的字符串。 + +现在尝试下面的方法。 + +``` +`systemctl list-dependencies multi-user.target` +``` + +和 + + +``` +`systemctl list-dependencies rescue.target` +``` + +和 + + +``` +`systemctl list-dependencies local-fs.target` +``` + +和 + + +``` +`systemctl list-dependencies dbus.service` +``` +``` +`systemctl list-dependencies graphic.target` +``` + + + +这个工具帮助我可视化我正用的主机的启动依赖细节。继续花一些时间探索一个或多个Linux主机的启动树。但是要小心,因为systemctl手册页包含以下注释: + +> _“请注意,此命令仅列出当前被服务管理器加载到内存的单元。尤其是,此命令根本不适合用于获取特定单元的全部反向依赖列表,因为它不会列出被单元声明了但是未加载的依赖项。” _ + +### 结尾语 + +即使在深入研究systemd之前,很明显能看出它既强大又复杂。显然,systemd不是单一,庞大,整体且不可知的二进制文件。相反,它是由许多较小的组件和旨在执行特定任务的子命令组成。 + +本系列的下一篇文章将更详细地探讨systemd的启动,以及systemd的配置文件,更改默认的目标以及如何创建简单服务单元。 + +### 资源 + +互联网上有大量关于systemd的信息,但是很多都简短,晦涩甚至是误导。除了本文提到的资源外,以下网页还提供了有关systemd启动的更详细和可靠的信息。 + + * Fedora项目有一个很好的,实用的[guide to systemd][7]。它有你需要知道的通过systemd来配置,管理和维护Fedora主机所需的几乎所有知识。 + * Fedora项目还有一个不错的[cheat sheet][8],将老的SystemV命令与对比的systemd命令相互关联。 +  * 有关systemd及其创建原因的详细技术信息,请查看[Freedesktop.org][9]的[systemd描述][10]。 + * [Linux.com][11]的“systemd的更多乐趣”提供了更高级的systemd [信息和技巧][12]。 + + +还有systemd的设计师和主要开发者Lennart Poettering撰写的针对Linux系统管理员的一系列技术文章。这些文章是在2010年4月至2011年9月之间撰写的,但它们现在和那时一样有用。关于systemd及其生态的其他许多好文都基于这些论文。 + + * [重新思考1号进程][13] + * [systemd之系统管理员, I][14] + * [systemd之系统管理员, II][15] + * [systemd之系统管理员, III][16] + * [systemd之系统管理员, IV][17] + * [systemd之系统管理员, V][18] + * [systemd之系统管理员, VI][19] + * [systemd之系统管理员, VII][20] + * [systemd之系统管理员, VIII][21] + * [systemd之系统管理员, IX][22] + * [systemd之系统管理员, X][23] + * [systemd之系统管理员, XI][24] + + + +Mentor Graphics的Linux内核和系统程序员Alison Chiaken预览了此文... +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/systemd + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[messon007](https://github.com/messon007) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) +[2]: http://www.both.org/?page_id=1183 +[3]: http://www.osnews.com/story/28026/Editorial_Thoughts_on_Systemd_and_the_Freedom_to_Choose +[4]: https://www.zdnet.com/article/linus-torvalds-and-others-on-linuxs-systemd/ +[5]: http://0pointer.de/blog/projects/the-biggest-myths.html +[6]: https://opensource.com/sites/default/files/uploads/systemd-architecture.png (systemd architecture) +[7]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html +[8]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet +[9]: http://Freedesktop.org +[10]: http://www.freedesktop.org/wiki/Software/systemd +[11]: http://Linux.com +[12]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ +[13]: http://0pointer.de/blog/projects/systemd.html +[14]: http://0pointer.de/blog/projects/systemd-for-admins-1.html +[15]: http://0pointer.de/blog/projects/systemd-for-admins-2.html +[16]: http://0pointer.de/blog/projects/systemd-for-admins-3.html +[17]: http://0pointer.de/blog/projects/systemd-for-admins-4.html +[18]: http://0pointer.de/blog/projects/three-levels-of-off.html +[19]: http://0pointer.de/blog/projects/changing-roots +[20]: http://0pointer.de/blog/projects/blame-game.html +[21]: http://0pointer.de/blog/projects/the-new-configuration-files.html +[22]: http://0pointer.de/blog/projects/on-etc-sysinit.html +[23]: http://0pointer.de/blog/projects/instances.html +[24]: http://0pointer.de/blog/projects/inetd.html From 9a52a7fe5c3b5855d0dd88bfbd7bcdc0ff5b08db Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Mon, 4 May 2020 19:43:48 +0800 Subject: [PATCH 0586/1809] 20180612 --- ...12 Systemd Services- Reacting to Change.md | 67 +++++++++++++++++-- 1 file changed, 63 insertions(+), 4 deletions(-) diff --git a/sources/tech/20180612 Systemd Services- Reacting to Change.md b/sources/tech/20180612 Systemd Services- Reacting to Change.md index 125b871602..740b695f08 100644 --- a/sources/tech/20180612 Systemd Services- Reacting to Change.md +++ b/sources/tech/20180612 Systemd Services- Reacting to Change.md @@ -1,35 +1,49 @@ -//messon007 translating -Systemd Services: Reacting to Change +Systemd Services: Reacting to Change Systemd服务:响应变更 ====== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/webcam.png?itok=zzYUs5VK) [I have one of these Compute Sticks][1] (Figure 1) and use it as an all-purpose server. It is inconspicuous and silent and, as it is built around an x86 architecture, I don't have problems getting it to work with drivers for my printer, and that’s what it does most days: it interfaces with the shared printer and scanner in my living room. +[我有其中一个计算棒] [1](图1),并将其用作通用服务器。 它不起眼且安静,并且由于它是基于x86架构构建的,因此我可以将其与打印机驱动程序配合使用时没有任何问题,这就是大多数日子所做的事情:它与我的共享打印机和扫描仪接口 客厅。 ![ComputeStick][3] An Intel ComputeStick. Euro coin for size. +英特尔计算棒。 大小的欧洲硬币。 [Used with permission][4] Most of the time it is idle, especially when we are out, so I thought it would be good idea to use it as a surveillance system. The device doesn't come with its own camera, and it wouldn't need to be spying all the time. I also didn't want to have to start the image capturing by hand because this would mean having to log into the Stick using SSH and fire up the process by writing commands in the shell before rushing out the door. +大多数情况下,它处于空闲状态,尤其是当我们外出时,因此我认为将其用作监视系统是个好主意。 该设备没有自带的摄像头,也不需要一直监视。 我也不想手动开始图像捕获,因为这意味着必须使用SSH登录到Stick,并在冲出门之前在shell中编写命令来启动该过程。 + So I thought that the thing to do would be to grab a USB webcam and have the surveillance system fire up automatically just by plugging it in. Bonus points if the surveillance system fired up also after the Stick rebooted, and it found that the camera was connected. +因此,我认为要做的就是抓住USB网络摄像头,然后仅通过将其插入即可自动启动监视系统。如果在Stick重新启动后监视系统也启动,则奖励积分。 连接的。 + In prior installments, we saw that [systemd services can be started or stopped by hand][5] or [when certain conditions are met][6]. Those conditions are not limited to when the OS reaches a certain state in the boot up or powerdown sequence but can also be when you plug in new hardware or when things change in the filesystem. You do that by combining a Udev rule with a systemd service. +在先前的文章中,我们看到[可以手动启动或停止系统服务] [5]或[在满足某些条件时] [6]。 这些条件不仅限于操作系统在启动或关机顺序中达到某种状态时,还可以在您插入新硬件或文件系统发生变化时进行。 您可以通过将Udev规则与systemd服务相结合来实现。 ### Hotplugging with Udev Udev rules live in the _/etc/udev/rules_ directory and are usually a single line containing _conditions_ and _assignments_ that lead to an _action_. That was a bit cryptic. Let's try again: +Udev规则位于_ / etc / udev / rules_目录中,通常是包含_conditions_和_assignments_的单行,它们导致_action_。 + +那有点神秘。让我们再试一次: Typically, in a Udev rule, you tell systemd what to look for when a device is connected. For example, you may want to check if the make and model of a device you just plugged in correspond to the make and model of the device you are telling Udev to wait for. Those are the _conditions_ mentioned earlier. +通常,在Udev规则中,您告诉systemd连接设备时要查找什么。例如,您可能要检查刚插入的设备的品牌和型号是否与您要让Udev等待的设备的品牌和型号相对应。这些是前面提到的条件。 Then you may want to change some stuff so you can use the device easily later. An example of that would be to change the read and write permissions to a device: if you plug in a USB printer, you're going to want users to be able to read information from the printer (the user's printing app would want to know the model, make, and whether it is ready to receive print jobs or not) and write to it, that is, send stuff to print. Changing the read and write permissions for a device is done using one of the _assignments_ you read about earlier. +然后,您可能需要更改一些内容,以便以后可以轻松使用该设备。例如,更改对设备的读写权限:如果插入USB打印机,您将希望用户能够从打印机中读取信息(用户的打印应用程序希望了解模型,制造商,以及是否准备好接受打印作业)并向其写入内容,即发送要打印的内容。更改设备的读写权限是使用您之前阅读的_assignments_之一完成的。 + Finally, you will probably want the system to do something when the conditions mentioned above are met, like start a backup application to copy important files when a certain external hard disk drive is plugged in. That is an example of an _action_ mentioned above. +最后,您可能希望系统在满足上述条件时执行某些操作,例如在插入某个外部硬盘驱动器时启动备份应用程序以复制重要文件。这就是上述_action_的示例。 + With that in mind, ponder this: ``` @@ -45,9 +59,12 @@ ATTRS{idProduct}=="e207" [etc... ] ``` shows the conditions that the device has to meet before doing any of the other stuff you want the system to do. The device has to be added (`ACTION=="add"`) to the machine, it has to be integrated into the `video4linux` subsystem. To make sure the rule is applied only when the correct device is plugged in, you have to make sure Udev correctly identifies the manufacturer (`ATTRS{idVendor}=="03f0"`) and a model (`ATTRS{idProduct}=="e207"`) of the device. +显示在执行系统要执行的其他任何操作之前设备必须满足的条件。 必须将设备添加到(ACTION ==“ add”)机器上,并且必须将其集成到video4linux子系统中。 为了确保仅在插入正确的设备时才应用该规则,您必须确保Udev正确标识制造商(`ATTRS {idVendor} ==“ 03f0”`)和型号(`ATTRS {idProduct} == 设备的“ e207”`)。 In this case, we're talking about this device (Figure 2): +在这种情况下,我们正在讨论此设备(图2): + ![webcam][8] The HP webcam used in this experiment. @@ -55,13 +72,19 @@ The HP webcam used in this experiment. [Used with permission][4] Notice how you use `==` to indicate that these are a logical operation. You would read the above snippet of the rule like this: +注意如何使用“ ==”来表示这些是逻辑操作。 您将阅读以下规则的摘要: ``` if the device is added and the device controlled by the video4linux subsystem and the manufacturer of the device is 03f0 and the model is e207, then... ``` +``` +如果添加了设备并且该设备由video4linux子系统控制 +而设备的制造商是03f0,型号是e207,则... +``` But where do you get all this information? Where do you find the action that triggers the event, the manufacturer, model, and so on? You will probably have to use several sources. The `IdVendor` and `idProduct` you can get by plugging the webcam into your machine and running `lsusb`: +但是,您从哪里获得所有这些信息? 您在哪里找到触发事件的动作,制造商,模型等? 您可能必须使用多个资源。 您可以通过将摄像头插入计算机并运行`lsusb`来获得`IdVendor`和`idProduct`: ``` lsusb @@ -76,11 +99,16 @@ Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub ``` The webcam I’m using is made by HP, and you can only see one HP device in the list above. The `ID` gives you the manufacturer and the model numbers separated by a colon (`:`). If you have more than one device by the same manufacturer and not sure which is which, unplug the webcam, run `lsusb` again and check what's missing. +我正在使用的网络摄像头是由HP制造的,并且您在上面的列表中只能看到一台HP设备。 “ ID”为您提供制造商和型号,以冒号(`:`)分隔。 如果同一制造商提供的设备不止一个,并且不确定是哪个设备,请拔下网络摄像头,再次运行`lsusb`并检查缺少的内容。 OR... Unplug the webcam, wait a few seconds, run the command `udevadmin monitor --environment` and then plug the webcam back in again. When you do that with the HP webcam, you get: +要么... + +拔下网络摄像头,等待几秒钟,运行命令“ udevadmin monitor --environment”,然后重新插入网络摄像头。 使用HP网络摄像头进行操作时,您将获得: + ``` udevadmin monitor --environment UDEV [35776.495221] add /devices/pci0000:00/0000:00:1c.3/0000:04:00.0 @@ -124,25 +152,38 @@ XKBVARIANT= That may look like a lot to process, but, check this out: the `ACTION` field early in the list tells you what event just happened, i.e., that a device got added to the system. You can also see the name of the device spelled out on several of the lines, so you can be pretty sure that it is the device you are looking for. The output also shows the manufacturer's ID number (`ID_VENDOR_ID=03f0`) and the model number (`ID_VENDOR_ID=03f0`). +可能要处理很多事情,但是,请检查一下:列表前面的“ ACTION”字段告诉您刚刚发生了什么事件,即设备已添加到系统中。您还可以在几行中看到设备名称的拼写,因此可以确定它是您要查找的设备。输出还显示制造商的ID号(ID_VENDOR_ID = 03f0)和型号(ID_VENDOR_ID = 03f0)。 + This gives you three of the four values the condition part of the rule needs. You may be tempted to think that it a gives you the fourth, too, because there is also a line that says: +这为您提供了规则条件部分需要的四个值中的三个。您可能会想起它也给您第四,因为还有一行这样写: + ``` SUBSYSTEM=input ``` +``` +SUBSYSTEM =输入 +``` Be careful! Although it is true that a USB webcam is a device that provides input (as does a keyboard and a mouse), it is also belongs to the _usb_ subsystem, and several others. This means that your webcam gets added to several subsystems and looks like several devices. If you pick the wrong subsystem, your rule may not work as you want it to, or, indeed, at all. +小心!尽管USB网络摄像头确实是提供输入的设备(键盘和鼠标也是如此),但它也属于_usb_子系统和其他几个子系统。这意味着您的网络摄像头已添加到多个子系统,并且看起来像多个设备。如果选择了错误的子系统,则您的规则可能无法按您希望的那样工作,或者甚至根本无法工作。 So, the third thing you have to check is all the subsystems the webcam has got added to and pick the correct one. To do that, unplug your webcam again and run: +因此,您需要检查的第三件事是网络摄像头已添加到的所有子系统中,并选择了正确的子系统。为此,请再次拔下网络摄像头,然后运行: + ``` ls /dev/video* ``` This will show you all the video devices connected to the machine. If you are using a laptop, most come with a built-in webcam and it will probably show up as `/dev/video0`. Plug your webcam back in and run `ls /dev/video*` again. +这将向您显示连接到本机的所有视频设备。 如果您使用的是笔记本电脑,则大多数笔记本电脑都带有内置摄像头,它可能会显示为`/ dev / video0`。 重新插入网络摄像头,然后再次运行`ls / dev / video *`。 Now you should see one more video device (probably `/dev/video1`). +现在,您应该再看到一个视频设备(可能是“ / dev / video1”)。 Now you can find out all the subsystems it belongs to by running `udevadm info -a /dev/video1`: +现在,您可以通过运行`udevadm info -a / dev / video1`找出它所属的所有子系统: ``` udevadm info -a /dev/video1 @@ -166,20 +207,29 @@ and the attributes from one single parent device. ``` The output goes on for quite a while, but what you're interested is right at the beginning: `SUBSYSTEM=="video4linux"`. This is a line you can literally copy and paste right into your rule. The rest of the output (not shown for brevity) gives you a couple more nuggets, like the manufacturer and mode IDs, again in a format you can copy and paste into your rule. +输出持续了一段时间,但是您感兴趣的只是开始:`SUBSYSTEM ==“ video4linux”`。您可以按实际情况将这行复制并粘贴到规则中。输出的其余部分(为简便起见未显示)为您提供了更多的块,例如制造商和模式ID,它们的格式也可以复制并粘贴到规则中。 Now you have a way of identifying the device and what event should trigger the action univocally, it is time to tinker with the device. +现在,您有了一种识别设备的方式,什么事件应该明确触发该操作,现在该对设备进行修改了。 The next section in the rule, `SYMLINK+="mywebcam", TAG+="systemd", MODE="0666"` tells Udev to do three things: First, you want to create symbolic link from the device to (e.g. _/dev/video1_ ) to _/dev/mywebcam_. This is because you cannot predict what the system is going to call the device by default. When you have an in-built webcam and you hotplug a new one, the in-built webcam will usually be _/dev/video0_ while the external one will become _/dev/video1_. However, if you boot your computer with the external USB webcam plugged in, that could be reversed and the internal webcam can become _/dev/video1_ and the external one _/dev/video0_. What this is telling you is that, although your image-capturing script (which you will see later on) always needs to point to the external webcam device, you can't rely on it being _/dev/video0_ or _/dev/video1_. To solve this problem, you tell Udev to create a symbolic link which will never change in the moment the device is added to the _video4linux_ subsystem and you will make your script point to that. +规则的下一部分,`SYMLINK + =“ mywebcam”,TAG + =“ systemd”,MODE =“ 0666”`告诉Udev做三件事:首先,您要创建从设备到的符号链接(例如_ / dev / video1_)到_ / dev / mywebcam_。这是因为您无法预测默认情况下系统将调用什么设备。当您拥有内置摄像头并热插拔新摄像头时,内置摄像头通常为_ / dev / video0_,而外部摄像头通常为_ / dev / video1_。但是,如果您在插入外部USB网络摄像头的情况下引导计算机,则可能会相反,并且内部网络摄像头可能会变成_ / dev / video1_,而外部网络摄像头会变成_ / dev / video0_。这告诉您的是,尽管您的图像捕获脚本(稍后将看到)始终需要指向外部网络摄像头设备,但是您不能依靠它是_ / dev / video0_或_ / dev / video1_。为了解决这个问题,您告诉Udev创建一个符号链接,该链接在将设备添加到_video4linux_子系统的那一刻就不会改变,并且您将使脚本指向该链接。 The second thing you do is add `"systemd"` to the list of Udev tags associated with this rule. This tells Udev that the action that the rule will trigger will be managed by systemd, that is, it will be some sort of systemd service. +您要做的第二件事是将“ systemd”添加到与此规则关联的Udev标记列表中。这告诉Udev,该规则将触发的操作将由systemd管理,即它将是某种systemd服务。 Notice how in both cases you use `+=` operator. This adds the value to a list, which means you can add more than one value to `SYMLINK` and `TAG`. +注意在两种情况下如何使用“ + =”运算符。这会将值添加到列表中,这意味着您可以向“ SYMLINK”和“ TAG”添加多个值。 The `MODE` values, on the other hand, can only contain one value (hence you use the simple `=` assignment operator). What `MODE` does is tell Udev who can read from or write to the device. If you are familiar with `chmod` (and, if you are reading this, you should be), you will also be familiar of [how you can express permissions using numbers][9]. That is what this is: `0666` means " _give read and write privileges to the device to everybody_ ". +另一方面,“ MODE”值只能包含一个值(因此,您可以使用简单的“ =”赋值运算符)。 MODE的作用是告诉Udev谁可以读取或写入设备。如果您熟悉`chmod`(并且应该阅读),那么您还将熟悉[如何使用数字表示权限] [9]。这就是它的意思:“ 0666”的意思是“向所有人授予对设备的读写特权”。 At last, `ENV{SYSTEMD_WANTS}="webcam.service"` tells Udev what systemd service to run. +最后,`ENV {SYSTEMD_WANTS} =“ webcam.service”`告诉Udev要运行什么systemd服务。 + Save this rule into file called _90-webcam.rules_ (or something like that) in _/etc/udev/rules.d_ and you can load it either by rebooting your machine, or by running: +将此规则保存到_ / etc / udev / rules.d_中名为_90-webcam.rules_(或类似名称)的文件中,您可以通过重新启动计算机或运行以下命令来加载它: ``` sudo udevadm control --reload-rules && udevadm trigger @@ -188,7 +238,7 @@ sudo udevadm control --reload-rules && udevadm trigger ## Service at Last The service the Udev rule triggers is ridiculously simple: - +Udev规则触发的服务非常简单: ``` # webcam.service @@ -198,8 +248,10 @@ ExecStart=/home/[user name]/bin/checkimage.sh ``` Basically, it just runs the _checkimage.sh_ script stored in your personal _bin/_ and pushes it the background. [This is something you saw how to do in prior installments][5]. It may seem something little, but just because it is called by a Udev rule, you have just created a special kind of systemd unit called a _device_ unit. Congratulations. +基本上,它只运行存储在您个人_bin / _中的_checkimage.sh_脚本并将其推入后台。 [这是您在先前的部分中看到的操作方法] [5]。 它看起来似乎很少,但是仅由于它是由Udev规则调用的,因此您刚刚创建了一种特殊的systemd单元,称为_device_ unit。 恭喜你 As for the _checkimage.sh_ script _webcam.service_ calls, there are several ways of grabbing an image from a webcam and comparing it to a prior one to check for changes (which is what _checkimage.sh_ does), but this is how I did it: +至于_checkimage.sh_脚本_webcam.service_调用,有几种方法可以从网络摄像头获取图像并将其与前一个图像进行比较以检查更改(_checkimage.sh_所做的工作),但这就是我的方法 它: ``` #!/bin/bash @@ -226,29 +278,36 @@ done ``` Start by using [MPlayer][10] to grab a frame ( _00000001.png_ ) from the webcam. Notice how we point `mplayer` to the `mywebcam` symbolic link we created in our Udev rule, instead of to `video0` or `video1`. Then you transfer the image to the _monitor/_ directory in your home directory. Then run an infinite loop that does the same thing again and again, but also uses [Image Magick's _compare_ tool][11] to see if there any differences between the last image captured and the one that is already in the _monitor/_ directory. +首先使用[MPlayer] [10]从摄像头抓取一个帧(_00000001.png_)。 注意,我们如何将mplayer指向在Udev规则中创建的mywebcam符号链接,而不是指向video0或video1。 然后,将映像传输到主目录中的_monitor / _目录。 然后运行一个无限循环,一次又一次地执行相同的操作,但是还使用[Image Magick的_compare_工具] [11]来查看最后捕获的图像与_monitor / _目录中的图像之间是否存在差异。 If the images are different, it means something has moved within the webcam's frame. The script overwrites the original image with the new image and continues comparing waiting for some more movement. +如果图像不同,则表示网络摄像头框架内已移动了某些东西。 该脚本将新图像覆盖原始图像,并继续比较以等待更多移动。 ### Plugged With all the bits and pieces in place, when you plug your webcam in, your Udev rule will be triggered and will start the _webcam.service_. The _webcam.service_ will execute _checkimage.sh_ in the background, and _checkimage.sh_ will start taking pictures every half a second. You will know because your webcam's LED will start flashing indicating every time it takes a snap. +一切零碎,将网络摄像头插入电源后,您的Udev规则将被触发并启动_webcam.service_。 _webcam.service_将在后台执行_checkimage.sh_,而_checkimage.sh_将每半秒开始拍照。 您会知道,因为网络摄像头的LED指示灯将开始闪烁,表明每次需要快照。 As always, if something goes wrong, run +与往常一样,如果出现问题,请运行 ``` systemctl status webcam.service ``` to check what your service and script are up to. +检查您的服务和脚本正在做什么。 ### Coming up You may be wondering: Why overwrite the original image? Surely you would want to see what's going on if the system detects any movement, right? You would be right, but as you will see in the next installment, leaving things as they are and processing the images using yet another type of systemd unit makes things nice, clean and easy. +您可能想知道:为什么要覆盖原始图像? 当然,如果系统检测到任何移动,您肯定想知道发生了什么,对吗? 您将是对的,但是如您在下一部分中将看到的那样,将它们保持原样,并使用另一种类型的systemd单元处理图像将使事情变得更好,干净和容易。 Just wait and see. +请稍等。 Learn more about Linux through the free ["Introduction to Linux" ][12]course from The Linux Foundation and edX. - +通过Linux基金会和edX的免费[[Linux简介]] [12]课程了解有关Linux的更多信息。 -------------------------------------------------------------------------------- via: https://www.linux.com/blog/intro-to-linux/2018/6/systemd-services-reacting-change From 02bfb14a066651c49f9a0b42e3f6137a11755803 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Mon, 4 May 2020 19:52:10 +0800 Subject: [PATCH 0587/1809] APL --- ...0200429 Drop PNG and JPG for your online images- Use WebP.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md b/sources/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md index d664a9fdfc..f4e6711933 100644 --- a/sources/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md +++ b/sources/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f07a211ab2f50ef80293164cf8752557f61a4c27 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 4 May 2020 22:03:06 +0800 Subject: [PATCH 0588/1809] PRF @qfzy1223 --- ...ngs to do After Installing Ubuntu 20.04.md | 170 +++++++++--------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/translated/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md b/translated/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md index a221ef6a34..e16ba06e54 100644 --- a/translated/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md +++ b/translated/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (qfzy1233) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (16 Things to do After Installing Ubuntu 20.04) @@ -10,29 +10,29 @@ 安装完 Ubuntu 20.04 后要做的 16 件事 ====== -_**以下是安装 Ubuntu 20.04 之后需要做的一些调整和事项,它将使你获得更流畅、更好的桌面 Linux 体验。**_ +> 以下是安装 Ubuntu 20.04 之后需要做的一些调整和事项,它将使你获得更流畅、更好的桌面 Linux 体验。 -[Ubuntu 20.04 LTS (长期支持版)带来了许多新的特性][1] 和观感上的变化。 如果你要安装 Ubuntu 20.04 ,让我向你展示一些推荐步骤便于你的使用。 +[Ubuntu 20.04 LTS(长期支持版)带来了许多新的特性][1]和观感上的变化。如果你要安装 Ubuntu 20.04,让我向你展示一些推荐步骤便于你的使用。 -### 安装完 Ubuntu 20.04 LTS “Focal Fossa”后要做的 16 件事 +### 安装完 Ubuntu 20.04 LTS “Focal Fossa” 后要做的 16 件事 ![][2] -我在这里要提到的步骤仅是我的建议。如果一些定制或调整不适合你的需要和兴趣,你可以忽略它们。 +我在这里提到的步骤仅是我的建议。如果一些定制或调整不适合你的需要和兴趣,你可以忽略它们。 同样的,有些步骤看起来很简单,但是对于一个 Ubuntu 新手来说是必要的。 -这里的一些建议适用于启用 GNOME 作为默认桌面Ubuntu 20.04。所以请检查[Ubuntu版本][3]和[桌面环境][4]。 +这里的一些建议适用于启用 GNOME 作为默认桌面 Ubuntu 20.04,所以请检查 [Ubuntu 版本][3]和[桌面环境][4]。 以下列表便是安装了代号为 Focal Fossa 的 Ubuntu 20.04 LTS 之后要做的事。 -#### 1\. 通过更新和启用额外的 repos 来准备您的系统 +#### 1、通过更新和启用额外的软件仓库来准备你的系统 -安装Ubuntu或任何其他Linux发行版之后,你应该做的第一件事就是更新它。Linux 的可用包数据库工作于本地。这个缓存需要同步以便你能够安装任何软件。 +安装 Ubuntu 或任何其他 Linux 发行版之后,你应该做的第一件事就是更新它。Linux 的运作是建立在本地的可用软件包数据库上,而这个缓存需要同步以便你能够安装软件。 -升级Ubuntu非常简单。你可以运行软件更新从菜单( 按 Win 键并搜索软件更新): +升级 Ubuntu 非常简单。你可以运行软件更新从菜单(按 `Super` 键并搜索 “software updater”): -![Ubuntu 20.04 的软件升级中心][5] +![Ubuntu 20.04 的软件升级器][5] 你也可以在终端使用以下命令更新你的系统: @@ -40,111 +40,111 @@ _**以下是安装 Ubuntu 20.04 之后需要做的一些调整和事项,它将 sudo apt update && sudo apt upgrade ``` -接下来,您应该确保启用了[universe和multiverse存储库][6]。使用这些存储库,你可以访问更多的软件。我还推荐阅读关于[Ubuntu软件库][6]的书籍,以了解它背后的基本概念。 +接下来,你应该确保启用了 [universe(宇宙)和 multiverse(多元宇宙)软件仓库][6]。使用这些软件仓库,你可以访问更多的软件。我还推荐阅读关于 [Ubuntu 软件仓库][6]的文章,以了解它背后的基本概念。 -搜索软件和放大器;更新菜单: +在菜单中搜索 “Software & Updates”: ![软件及更新设置项][7] -请务必选中存储库前面的方框: +请务必选中软件仓库前面的勾选框: -![启用额外的存储库][8] +![启用额外的软件仓库][8] -#### 2\. 安装媒体解码器来播放MP3、MPEG4和其他格式媒体文件 +#### 2、安装媒体解码器来播放 MP3、MPEG4 和其他格式媒体文件 -如果你想播放媒体文件,如MP3, MPEG4, AVI等,你需要安装媒体解码器。由于不同国家的版权问题,Ubuntu在默认情况下不会安装它。 +如果你想播放媒体文件,如 MP3、MPEG4、AVI 等,你需要安装媒体解码器。由于各个国家的版权问题, Ubuntu 在默认情况下不会安装它。 -作为个人,你可以很容易地安装这些媒体编解码器[使用 Ubuntu 额外安装包][9]。这将安装媒体编解码器,Adobe Flash播放器和[微软 True Type 字体在您的Ubuntu系统][10]。 +作为个人,你可以[使用 Ubuntu Restricted Extra 安装包][9]很轻松地安装这些媒体编解码器。这将[在你的 Ubuntu 系统安装][10]媒体编解码器、Adobe Flash 播放器和微软 True Type 字体等。 -你可以通过[点击这个链接][11](它将要求打开软件中心)来安装它,或者使用以下命令: +你可以通过[点击这个链接][11]来安装它(它会要求在软件中心打开它),或者使用以下命令: ``` sudo apt install ubuntu-restricted-extras ``` -如果遇到EULA或许可证界面,请记住使用tab键在选项之间进行选择,然后按enter键确认你的选择。 +如果遇到 EULA 或许可证界面,请记住使用 `tab` 键在选项之间进行选择,然后按回车键确认你的选择。 -![按tab键选择OK并按enter键][12] +![按 tab 键选择 OK 并按回车键][12] -#### 3\. 从软件中心或网络上安装软件 +#### 3、从软件中心或网络上安装软件 -现在已经设置了存储库并更新了包缓存,应该开始安装所需的软件了。 +现在已经设置好了软件仓库并更新了软件包缓存,应该开始安装所需的软件了。 -有几种方法可以在Ubuntu中安装应用程序。最简单和正式的方法是使用软件中心。 +在 Ubuntu 中安装应用程序有几种方法,最简单和正式的方法是使用软件中心。 ![Ubuntu 软件中心][14] -如果你想要一些关于软件的建议,请参考这个扩展的[不同用途的Ubuntu应用程序列表][15]。 +如果你想要一些关于软件的建议,请参考这个[丰富的各种用途的 Ubuntu 应用程序列表][15]。 -一些软件供应商提供 .deb 文件来方便地安装他们的应用程序。你可以从他们的网站获得 deb 文件。例如,要[在 Ubuntu 上安装谷歌 Chrome ][16],你可以从它的网站上获得 deb 文件,双击它开始安装。 +一些软件供应商提供了 .deb 文件来方便地安装他们的应用程序。你可以从他们的网站获得 .deb 文件。例如,要[在 Ubuntu 上安装谷歌 Chrome][16],你可以从它的网站上获得 .deb 文件,双击它开始安装。 -#### 4\. 享受 Steam Proton 和 GameModeEnjoy 上的游戏 +#### 4、享受 Steam Proton 和 GameModeEnjoy 上的游戏 -[ Linux 上的游戏][17] 已经有了长足的发展。你不受限于自带的少数游戏。你可以[在 Ubuntu 上安装 Steam ][18]并享受许多游戏。 +[在 Linux 上进行游戏][17]已经有了长足的发展。你不再受限于自带的少数游戏。你可以[在 Ubuntu 上安装 Steam][18]并享受许多游戏。 -[Steam 新的 Proton 项目][19]可以让你在Linux上玩许多只适用于windows的游戏。除此之外,Ubuntu 20.04还默认安装了[Feral Interactive的游戏][20]。 +[Steam 新的 Proton 项目][19]可以让你在 Linux 上玩许多只适用于 Windows 的游戏。除此之外,Ubuntu 20.04 还默认安装了 [Feral Interactive 的 GameMode][20]。 -游戏模式会自动调整Linux系统的性能,使游戏具有比其他后台进程更高的优先级。 +GameMode 会自动调整 Linux 系统的性能,使游戏具有比其他后台进程更高的优先级。 -这意味着一些支持游戏模式的游戏(如[古墓丽影崛起][21])在 Ubuntu 上的性能应该有所提高。 +这意味着一些支持 GameMode 的游戏(如[古墓丽影·崛起][21])在 Ubuntu 上的性能应该有所提高。 -#### 5\. 管理自动更新(适用于进阶和专家) +#### 5、管理自动更新(适用于进阶用户和专家) -最近,Ubuntu 已经开始自动下载和安装对你的系统至关重要的安全更新。这是一个安全功能,作为一个普通用户,你应该让它保持默认, +最近,Ubuntu 已经开始自动下载并安装对你的系统至关重要的安全更新。这是一个安全功能,作为一个普通用户,你应该让它保持默认开启。 但是,如果你喜欢自己进行配置更新,而这个自动更新经常导致你[“无法锁定管理目录”错误][22],也许你可以改变自动更新行为。 -你可以选择更新是提示,以便它通知你的安全更新是否可用,而不是自动安装。 +你可以选择“立即显示”,这样一有安全更新就会立即通知你,而不是自动安装。 ![管理自动更新设置][23] -#### 6\. 控制电脑的自动挂起和屏幕锁定 +#### 6、控制电脑的自动挂起和屏幕锁定 -如果你在笔记本电脑上使用Ubuntu 20.04,那么你可能需要注意一些电源和屏幕锁定设置。 +如果你在笔记本电脑上使用 Ubuntu 20.04,那么你可能需要注意一些电源和屏幕锁定设置。 -如果你的笔记本电脑是电池模式,Ubuntu会在20分钟不工作后休眠系统。这样做是为了节省电池电量。就我个人而言,我不喜欢它,因此我禁用了它。 +如果你的笔记本电脑处于电池模式,Ubuntu 会在 20 分钟不活动后休眠系统。这样做是为了节省电池电量。就我个人而言,我不喜欢它,因此我禁用了它。 -类似地,如果您离开系统几分钟,它会自动锁定屏幕。我也不喜欢这种行为,所以我宁愿禁用它。 +类似地,如果你离开系统几分钟,它会自动锁定屏幕。我也不喜欢这种行为,所以我宁愿禁用它。 -![Ubuntu 20.04的电源设置][24] +![Ubuntu 20.04 的电源设置][24] -#### 7\. 享受夜间模式 +#### 7、享受夜间模式 -一个[谈论最多的 Ubuntu 20.04 特性][25]是夜间模式。你可以通过进入设置并在外观部分中选择它来启用夜间模式。 +[Ubuntu 20.04 中最受关注的特性][25]之一是夜间模式。你可以通过进入设置并在外观部分中选择它来启用夜间模式。 -![开启夜间主题 Ubuntu ][26] +![开启夜间主题 Ubuntu][26] -你可能需要做一些额外的调整来启用 Ubuntu 20.04 的深度夜间模式。 +你可能需要做一些[额外的调整来获得完整的 Ubuntu 20.04 夜间模式][27]。 -#### 8\. 控制桌面图标和启动程序 +#### 8、控制桌面图标和启动程序 -如果你想要一个最简的桌面,你可以禁用桌面上的图标。您还可以从左侧禁用启动程序,并在顶部面板中禁用软件状态栏。 +如果你想要一个最简的桌面,你可以禁用桌面上的图标。你还可以从左侧禁用启动程序,并在顶部面板中禁用软件状态栏。 -所有这些都可以通过默认的新 GNOME 扩展来控制。 +所有这些都可以通过默认的新 GNOME 扩展来控制,该程序默认情况下已经可用。 -![][28] +![禁用 Ubuntu 20 04 的 Dock][28] -顺便说一下,你也可以通过设置-外观来改变启动栏的位置到底部或者右边。 +顺便说一下,你也可以通过“设置”->“外观”来将启动栏的位置改变到底部或者右边。 -#### 9\. 使用emojis(表情)和特殊字符,或从搜索中禁用它 +#### 9、使用表情符和特殊字符,或从搜索中禁用它 -Ubuntu提供了一个使用 emojis 或表情符号的简单方法。在默认情况下,有一个专用的应用程序叫做 Characters。它可以给你基本表情符号的[Unicode][29]码。 +Ubuntu 提供了一个使用表情符号的简单方法。在默认情况下,有一个专用的应用程序叫做“字符”。它基本上可以为你提供表情符号的 [Unicode][29]。 -不仅是表情符号,你还可以使用它来获得法语、德语、俄语和拉丁语字符的 unicode 。单击符号你可以复制 unicode ,当你粘贴这段代码时,你所选择的符号便被插入。 +不仅是表情符号,你还可以使用它来获得法语、德语、俄语和拉丁语字符的 unicode。单击符号你可以复制 unicode,当你粘贴该代码时,你所选择的符号便被插入。 -! [Emoji Ubuntu] [30] +![Ubuntu 表情符][30] 你也能在桌面搜索中找到这些特殊的字符和表情符号。也可以从搜索结果中复制它们。 -![Emojis 出现在桌面搜索中][31] +![表情符出现在桌面搜索中][31] 如果你不想在搜索结果中看到它们,你应该禁用搜索功能对它们的访问。下一节将讨论如何做到这一点。 -#### 10\. 掌握桌面搜索 +#### 10、掌握桌面搜索 -GNOME桌面拥有强大的搜索功能。大多数人使用它来搜索已安装的应用程序,但它不仅限于此。 +GNOME 桌面拥有强大的搜索功能,大多数人使用它来搜索已安装的应用程序,但它不仅限于此。 -按超级键(Win键)并搜索一些东西。它将显示与搜索词匹配的任何应用程序,然后是系统设置和软件中心提供的匹配应用程序。 +按 `Super` 键并搜索一些东西,它将显示与搜索词匹配的任何应用程序,然后是系统设置和软件中心提供的匹配应用程序。 ![桌面搜索][32] @@ -152,47 +152,47 @@ GNOME桌面拥有强大的搜索功能。大多数人使用它来搜索已安装 ![Ubuntu搜索的快速计算][33] -你可以通过进入设置来控制搜索的内容和顺序。 +你可以进入“设置”中来控制可以搜索的内容和顺序。 ![][34] -#### 11\. 使用夜灯功能,减少夜间眼睛疲劳 +#### 11、使用夜灯功能,减少夜间眼睛疲劳 如果你在晚上使用电脑或智能手机,你应该使用夜灯功能来减少眼睛疲劳。我觉得这很有帮助。 夜灯的特点是在屏幕上增加了一种黄色的色调,比白光少了一些挤压感。 -你可以在设置->显示并切换到夜灯选项卡。你可以根据自己的喜好设置“黄色”。 +你可以在“设置”->“显示”切换到夜灯选项卡来开启夜光功能。你可以根据自己的喜好设置“黄度”。 ![夜灯功能][35] -#### 12\.使用 2K/4K 显示器? 使用分辨率缩放得到更大的图标和字体 +#### 12、使用 2K/4K 显示器?使用分辨率缩放得到更大的图标和字体 如果你觉得图标、字体、文件夹在你的高分辨率屏幕上看起来都太小了,你可以利用分辨率缩放。 -启用分级缩放可以让你有更多的选项来从100%增加到200%。你可以选择适合自己喜好的缩放尺寸。 +启用分辨率缩放可以让你有更多的选项来从 100% 增加到 200%。你可以选择适合自己喜好的缩放尺寸。 -![启用高分缩放从设置->显示][36] +![在设置->显示中启用高分缩放][36] -#### 13\. 探索GNOME扩展以扩展GNOME桌面的可用性 +#### 13、探索 GNOME 扩展功能以扩展 GNOME 桌面可用性 -GNOME桌面有称为扩展的小插件或附加组件。你应该[学习使用 GNOM E扩展][37]来扩展系统的可用性。 +GNOME 桌面有称为“扩展”的小插件或附加组件。你应该[学会使用 GNOME 扩展][37]来扩展系统的可用性。 -如下图所示,天气扩展顶部面板中显示了天气信息。不起眼但十分有用。您也可以在这里查看一些[最佳 GNOME 扩展][38]。不要全部安装,只使用那些对你有用的。 +如下图所示,天气扩展顶部面板中显示了天气信息。不起眼但十分有用。你也可以在这里查看一些[最佳 GNOME 扩展][38]。不需要全部安装,只使用那些对你有用的。 -![天气 扩展][39] +![天气扩展][39] -#### 14\.启用“勿扰”模式,专注于工作 +#### 14、启用“勿扰”模式,专注于工作 如果你想专注于工作,禁用桌面通知会很方便。你可以轻松地启用“勿扰”模式,并静音所有通知。 ![启用“请勿打扰”清除桌面通知][40] -这些通知仍然会在消息栏中,以便您以后可以阅读它们,但是它们不会在桌面上弹出。 +这些通知仍然会在消息栏中,以便你以后可以阅读它们,但是它们不会在桌面上弹出。 -#### 15\. 清理你的系统 +#### 15、清理你的系统 -这是你安装Ubuntu后不需要马上做的事情。但是记住它会对你有帮助。 +这是你安装 Ubuntu 后不需要马上做的事情。但是记住它会对你有帮助。 随着时间的推移,你的系统将有大量不再需要的包。你可以用这个命令一次性删除它们: @@ -202,23 +202,23 @@ sudo apt autoremove 还有其他[清理 Ubuntu 以释放磁盘空间的方法][41],但这是最简单和最安全的。 -#### 16\. 根据您的喜好调整和定制 GNOME 桌面 +#### 16、根据你的喜好调整和定制 GNOME 桌面 我强烈推荐[安装 GNOME 设置工具][42]。这将让你可以通过额外的设置来进行定制。 ![Gnome 设置工具][43] -比如,你可以[以百分比形式显示电池容量][44],[修正在touchpad中右键问题][45],改变 Shell 主题,改变鼠标指针速度,显示日期和星期数,改变应用程序窗口行为等。 +比如,你可以[以百分比形式显示电池容量][44]、[修正在触摸板右键问题][45]、改变 Shell 主题、改变鼠标指针速度、显示日期和星期数、改变应用程序窗口行为等。 -定制是没有尽头的,我可能仅使用了它的一小部分功能。这就是为什么我推荐[阅读这些文章]关于[自定义GNOME桌面][46]的[42]。 +定制是没有尽头的,我可能仅使用了它的一小部分功能。这就是为什么我推荐[阅读这些][42]关于[自定义 GNOME 桌面][46]的文章。 -你也可以[在Ubuntu中安装新主题][47],不过就我个人而言,我喜欢这个版本的默认主题。这是我第一次在Ubuntu发行版中使用默认的图标和主题。 +你也可以[在 Ubuntu 中安装新主题][47],不过就我个人而言,我喜欢这个版本的默认主题。这是我第一次在 Ubuntu 发行版中使用默认的图标和主题。 #### 安装 Ubuntu 之后你会做什么? -如果你是Ubuntu的初学者,我建议你[阅读这一系列Ubuntu教程][48]开始学习。 +如果你是 Ubuntu 的初学者,我建议你[阅读这一系列 Ubuntu 教程][48]开始学习。 -这就是我的建议。安装Ubuntu之后你要做什么?分享你最喜欢的东西,我可能根据你的建议来更新这篇文章。 +这就是我的建议。安装 Ubuntu 之后你要做什么?分享你最喜欢的东西,我可能根据你的建议来更新这篇文章。 -------------------------------------------------------------------------------- @@ -227,31 +227,31 @@ via: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[qfzy1233](https://github.com/qfzy1233) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://itsfoss.com/author/abhishek/ [b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/ubuntu-20-04-release-features/ +[1]: https://linux.cn/article-12146-1.html [2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/things-to-do-after-installing-ubuntu-20-04.jpg?ssl=1 -[3]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ -[4]: https://itsfoss.com/find-desktop-environment/ +[3]: https://linux.cn/article-9872-1.html +[4]: https://linux.cn/article-12124-1.html [5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-updater-ubuntu-20-04.jpg?ssl=1 [6]: https://itsfoss.com/ubuntu-repositories/ [7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-updates-settings-ubuntu-20-04.jpg?ssl=1 [8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/extra-repositories-ubuntu-20.jpg?ssl=1 -[9]: https://itsfoss.com/install-media-codecs-ubuntu/ -[10]: https://itsfoss.com/install-microsoft-fonts-ubuntu/ -[11]: https://ubuntu-restricted-extras/ +[9]: https://linux.cn/article-11906-1.html +[10]: https://linux.cn/article-12074-1.html +[11]: //ubuntu-restricted-extras/ [12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/installing_ubuntu_restricted_extras.jpg?ssl=1 [13]: https://itsfoss.com/remove-install-software-ubuntu/ [14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-center-ubuntu-20.png?resize=800%2C509&ssl=1 [15]: https://itsfoss.com/best-ubuntu-apps/ [16]: https://itsfoss.com/install-chrome-ubuntu/ -[17]: https://itsfoss.com/linux-gaming-guide/ +[17]: https://linux.cn/article-7316-1.html [18]: https://itsfoss.com/install-steam-ubuntu-linux/ -[19]: https://itsfoss.com/steam-play/ +[19]: https://linux.cn/article-10054-1.html [20]: https://github.com/FeralInteractive/gamemode [21]: https://en.wikipedia.org/wiki/Rise_of_the_Tomb_Raider [22]: https://itsfoss.com/could-not-get-lock-error/ @@ -259,7 +259,7 @@ via: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/ [24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/power-settings-ubuntu-20-04.png?fit=800%2C591&ssl=1 [25]: https://www.youtube.com/watch?v=lpq8pm_xkSE [26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-dark-theme-ubuntu.png?ssl=1 -[27]: https://itsfoss.com/dark-mode-ubuntu/ +[27]: https://linux.cn/article-12098-1.html [28]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/disable-dock-ubuntu-20-04.png?ssl=1 [29]: https://en.wikipedia.org/wiki/List_of_Unicode_characters [30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/emoji-ubuntu.jpg?ssl=1 From 93b384eaa29d5444203f9c5cbf354acee5fe4a42 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 4 May 2020 22:04:01 +0800 Subject: [PATCH 0589/1809] PUB @qfzy1223 https://linux.cn/article-12183-1.html --- .../20200424 16 Things to do After Installing Ubuntu 20.04.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200424 16 Things to do After Installing Ubuntu 20.04.md (99%) diff --git a/translated/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md b/published/20200424 16 Things to do After Installing Ubuntu 20.04.md similarity index 99% rename from translated/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md rename to published/20200424 16 Things to do After Installing Ubuntu 20.04.md index e16ba06e54..ded221ab6c 100644 --- a/translated/tech/20200424 16 Things to do After Installing Ubuntu 20.04.md +++ b/published/20200424 16 Things to do After Installing Ubuntu 20.04.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (qfzy1233) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12183-1.html) [#]: subject: (16 Things to do After Installing Ubuntu 20.04) [#]: via: (https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 894a99a02162444c101b9d653bf24f94c1c57ddc Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Mon, 4 May 2020 22:42:37 +0800 Subject: [PATCH 0590/1809] 20180612 --- ...12 Systemd Services- Reacting to Change.md | 106 +++++++++--------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/sources/tech/20180612 Systemd Services- Reacting to Change.md b/sources/tech/20180612 Systemd Services- Reacting to Change.md index 740b695f08..bdb7d7c44c 100644 --- a/sources/tech/20180612 Systemd Services- Reacting to Change.md +++ b/sources/tech/20180612 Systemd Services- Reacting to Change.md @@ -4,54 +4,53 @@ Systemd Services: Reacting to Change Systemd服务:响应变更 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/webcam.png?itok=zzYUs5VK) [I have one of these Compute Sticks][1] (Figure 1) and use it as an all-purpose server. It is inconspicuous and silent and, as it is built around an x86 architecture, I don't have problems getting it to work with drivers for my printer, and that’s what it does most days: it interfaces with the shared printer and scanner in my living room. -[我有其中一个计算棒] [1](图1),并将其用作通用服务器。 它不起眼且安静,并且由于它是基于x86架构构建的,因此我可以将其与打印机驱动程序配合使用时没有任何问题,这就是大多数日子所做的事情:它与我的共享打印机和扫描仪接口 客厅。 +[我有一个这样的电脑棒][1](图1),并将其用作通用服务器。它很小且安静,由于它是基于x86架构,因此我为我的打印机安装驱动没有任何问题,而且这就是它大多数时候干的事:与客厅的共享打印机和扫描仪通信。 ![ComputeStick][3] An Intel ComputeStick. Euro coin for size. -英特尔计算棒。 大小的欧洲硬币。 +一个英特尔电脑棒。欧元硬币大小。 [Used with permission][4] Most of the time it is idle, especially when we are out, so I thought it would be good idea to use it as a surveillance system. The device doesn't come with its own camera, and it wouldn't need to be spying all the time. I also didn't want to have to start the image capturing by hand because this would mean having to log into the Stick using SSH and fire up the process by writing commands in the shell before rushing out the door. -大多数情况下,它处于空闲状态,尤其是当我们外出时,因此我认为将其用作监视系统是个好主意。 该设备没有自带的摄像头,也不需要一直监视。 我也不想手动开始图像捕获,因为这意味着必须使用SSH登录到Stick,并在冲出门之前在shell中编写命令来启动该过程。 +大多数时候,它都闲着,尤其是当我们外出时,因此我认为用它作监视系统是个好主意。该设备没有自带的摄像头,也不需要一直监视。我也不想手动启动图像捕获,因为这样就意味着在出门前必须通过SSH登录,并在shell中编写命令来启动该进程。 So I thought that the thing to do would be to grab a USB webcam and have the surveillance system fire up automatically just by plugging it in. Bonus points if the surveillance system fired up also after the Stick rebooted, and it found that the camera was connected. -因此,我认为要做的就是抓住USB网络摄像头,然后仅通过将其插入即可自动启动监视系统。如果在Stick重新启动后监视系统也启动,则奖励积分。 连接的。 +因此,我以为应该这么做:抓住USB摄像头,然后只需插入它即可自动启动监视系统。如果Stick重启后发现连接了摄像头也启动监视系统就更加分了。 In prior installments, we saw that [systemd services can be started or stopped by hand][5] or [when certain conditions are met][6]. Those conditions are not limited to when the OS reaches a certain state in the boot up or powerdown sequence but can also be when you plug in new hardware or when things change in the filesystem. You do that by combining a Udev rule with a systemd service. -在先前的文章中,我们看到[可以手动启动或停止系统服务] [5]或[在满足某些条件时] [6]。 这些条件不仅限于操作系统在启动或关机顺序中达到某种状态时,还可以在您插入新硬件或文件系统发生变化时进行。 您可以通过将Udev规则与systemd服务相结合来实现。 +在先前的文章中,我们看到[systemd服务可以手动启动或停止][5]或[在满足某些条件时][6]。这些条件不限于操作系统在启动或关机时序中达到某种状态,还可以在您插入新硬件或文件系统发生变化时进行。您可以通过将Udev规则与systemd服务结合起来实现。 -### Hotplugging with Udev +### Hotplugging with Udev 有Udev(支持)的热插拔 Udev rules live in the _/etc/udev/rules_ directory and are usually a single line containing _conditions_ and _assignments_ that lead to an _action_. +Udev规则位于 _/etc/udev/rules_ 目录中,通常是由导致一个 _动作(action)_ 的 _条件(conditions)_ 和 _赋值(assignments)_ 的单行语句来描述。 That was a bit cryptic. Let's try again: -Udev规则位于_ / etc / udev / rules_目录中,通常是包含_conditions_和_assignments_的单行,它们导致_action_。 - -那有点神秘。让我们再试一次: +有点神秘。让我们再试一次: Typically, in a Udev rule, you tell systemd what to look for when a device is connected. For example, you may want to check if the make and model of a device you just plugged in correspond to the make and model of the device you are telling Udev to wait for. Those are the _conditions_ mentioned earlier. -通常,在Udev规则中,您告诉systemd连接设备时要查找什么。例如,您可能要检查刚插入的设备的品牌和型号是否与您要让Udev等待的设备的品牌和型号相对应。这些是前面提到的条件。 +通常,在Udev规则中,您告诉systemd当连接一个设备时需要查看什么信息。例如,您可能想检查刚插入的设备的品牌和型号是否与您让Udev等待的设备的品牌和型号相对应。这些就是前面提到的条件。 Then you may want to change some stuff so you can use the device easily later. An example of that would be to change the read and write permissions to a device: if you plug in a USB printer, you're going to want users to be able to read information from the printer (the user's printing app would want to know the model, make, and whether it is ready to receive print jobs or not) and write to it, that is, send stuff to print. Changing the read and write permissions for a device is done using one of the _assignments_ you read about earlier. - -然后,您可能需要更改一些内容,以便以后可以轻松使用该设备。例如,更改对设备的读写权限:如果插入USB打印机,您将希望用户能够从打印机中读取信息(用户的打印应用程序希望了解模型,制造商,以及是否准备好接受打印作业)并向其写入内容,即发送要打印的内容。更改设备的读写权限是使用您之前阅读的_assignments_之一完成的。 +然后,您可能想要更改一些内容,以便以后可以轻松使用该设备。例如,更改设备的读写权限:如果插入USB打印机,您将希望用户能够从打印机读取信息(用户的打印应用程序需要知道其模型,制造商,以及是否准备好接受打印作业)并向其写入内容,即发送要打印的内容。更改设备的读写权限是通过您之前阅读的 _赋值(assignments)_ 之一完成的。 Finally, you will probably want the system to do something when the conditions mentioned above are met, like start a backup application to copy important files when a certain external hard disk drive is plugged in. That is an example of an _action_ mentioned above. - -最后,您可能希望系统在满足上述条件时执行某些操作,例如在插入某个外部硬盘驱动器时启动备份应用程序以复制重要文件。这就是上述_action_的示例。 +最后,您可能希望系统在满足上述条件时执行某些动作,例如在插入某个外接硬盘时启动备份程序以复制重要文件。这就是上面提到的 _动作(action)_ 的例子。 With that in mind, ponder this: +了解这些之后, 来看看以下几点: ``` ACTION=="add", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="e207", SYMLINK+="mywebcam", TAG+="systemd", MODE="0666", ENV{SYSTEMD_WANTS}="webcam.service" ``` -The first part of the rule, +The first part of the rule, +规则的第一部分, ``` ACTION=="add", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="03f0", @@ -59,32 +58,32 @@ ATTRS{idProduct}=="e207" [etc... ] ``` shows the conditions that the device has to meet before doing any of the other stuff you want the system to do. The device has to be added (`ACTION=="add"`) to the machine, it has to be integrated into the `video4linux` subsystem. To make sure the rule is applied only when the correct device is plugged in, you have to make sure Udev correctly identifies the manufacturer (`ATTRS{idVendor}=="03f0"`) and a model (`ATTRS{idProduct}=="e207"`) of the device. -显示在执行系统要执行的其他任何操作之前设备必须满足的条件。 必须将设备添加到(ACTION ==“ add”)机器上,并且必须将其集成到video4linux子系统中。 为了确保仅在插入正确的设备时才应用该规则,您必须确保Udev正确标识制造商(`ATTRS {idVendor} ==“ 03f0”`)和型号(`ATTRS {idProduct} == 设备的“ e207”`)。 +表明了执行您想让系统执行的其他动作之前设备必须满足的条件。设备必须被添加到(`ACTION=="add"`)机器上,并且必须添加到 `video4linux` 子系统中。为了确保仅在插入正确的设备时才应用该规则,您必须确保Udev正确识别设备的制造商(`ATTRS{idVendor}=="03f0"`)和型号(`ATTRS{idProduct}=="e207"`)。 In this case, we're talking about this device (Figure 2): - -在这种情况下,我们正在讨论此设备(图2): +在本例中,我们讨论的是这个设备(图2): ![webcam][8] The HP webcam used in this experiment. +这个试验使用的是HP的摄像头。 [Used with permission][4] Notice how you use `==` to indicate that these are a logical operation. You would read the above snippet of the rule like this: -注意如何使用“ ==”来表示这些是逻辑操作。 您将阅读以下规则的摘要: +注意怎样用`==`来表示这是一个逻辑操作。您应该像这样阅读上面的简要规则: ``` if the device is added and the device controlled by the video4linux subsystem and the manufacturer of the device is 03f0 and the model is e207, then... ``` ``` -如果添加了设备并且该设备由video4linux子系统控制 -而设备的制造商是03f0,型号是e207,则... +如果添加了一个设备并且该设备由video4linux子系统控制 +而且该设备的制造商是03f0,型号是e207,那么... ``` But where do you get all this information? Where do you find the action that triggers the event, the manufacturer, model, and so on? You will probably have to use several sources. The `IdVendor` and `idProduct` you can get by plugging the webcam into your machine and running `lsusb`: -但是,您从哪里获得所有这些信息? 您在哪里找到触发事件的动作,制造商,模型等? 您可能必须使用多个资源。 您可以通过将摄像头插入计算机并运行`lsusb`来获得`IdVendor`和`idProduct`: +但是,您从哪里获取的这些信息? 您在哪里找到触发事件的动作,制造商,模型等等?您可能必须使用多个来源。您可以通过将摄像头插入机器并运行`lsusb`来获得`IdVendor`和`idProduct`: ``` lsusb @@ -99,15 +98,15 @@ Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub ``` The webcam I’m using is made by HP, and you can only see one HP device in the list above. The `ID` gives you the manufacturer and the model numbers separated by a colon (`:`). If you have more than one device by the same manufacturer and not sure which is which, unplug the webcam, run `lsusb` again and check what's missing. -我正在使用的网络摄像头是由HP制造的,并且您在上面的列表中只能看到一台HP设备。 “ ID”为您提供制造商和型号,以冒号(`:`)分隔。 如果同一制造商提供的设备不止一个,并且不确定是哪个设备,请拔下网络摄像头,再次运行`lsusb`并检查缺少的内容。 +我用的摄像头是HP的,您在上面的列表中只能看到一个HP设备。`ID`告诉了制造商和型号,它们以冒号(`:`)分隔。如果您有同一制造商的多个设备,不确定哪个是哪个设备,请拔下摄像头,再次运行`lsusb`, 看看少了什么。 OR... Unplug the webcam, wait a few seconds, run the command `udevadmin monitor --environment` and then plug the webcam back in again. When you do that with the HP webcam, you get: -要么... +或者... -拔下网络摄像头,等待几秒钟,运行命令“ udevadmin monitor --environment”,然后重新插入网络摄像头。 使用HP网络摄像头进行操作时,您将获得: +拔下摄像头,等待几秒钟,运行命令`udevadmin monitor --environment`,然后重新插入摄像头。当您使用的是HP摄像头时,您将看到: ``` udevadmin monitor --environment @@ -152,38 +151,35 @@ XKBVARIANT= That may look like a lot to process, but, check this out: the `ACTION` field early in the list tells you what event just happened, i.e., that a device got added to the system. You can also see the name of the device spelled out on several of the lines, so you can be pretty sure that it is the device you are looking for. The output also shows the manufacturer's ID number (`ID_VENDOR_ID=03f0`) and the model number (`ID_VENDOR_ID=03f0`). -可能要处理很多事情,但是,请检查一下:列表前面的“ ACTION”字段告诉您刚刚发生了什么事件,即设备已添加到系统中。您还可以在几行中看到设备名称的拼写,因此可以确定它是您要查找的设备。输出还显示制造商的ID号(ID_VENDOR_ID = 03f0)和型号(ID_VENDOR_ID = 03f0)。 +可能看起来有很多信息要处理,但是,看一下这个:列表前面的`ACTION`字段, 它告诉您刚刚发生了什么事件,即一个设备被添加到系统中。您还可以在几行中看到设备名称的拼写,因此可以非常确定它就是您要找的设备。输出里还显示了制造商的ID(`ID_VENDOR_ID = 03f0`)和型号(`ID_VENDOR_ID = 03f0`)。 This gives you three of the four values the condition part of the rule needs. You may be tempted to think that it a gives you the fourth, too, because there is also a line that says: -这为您提供了规则条件部分需要的四个值中的三个。您可能会想起它也给您第四,因为还有一行这样写: +这为您提供了规则条件部分需要的四个值中的三个。您可能也会想到它还给了您第四个,因为还有一行这样写道: ``` SUBSYSTEM=input ``` -``` -SUBSYSTEM =输入 -``` Be careful! Although it is true that a USB webcam is a device that provides input (as does a keyboard and a mouse), it is also belongs to the _usb_ subsystem, and several others. This means that your webcam gets added to several subsystems and looks like several devices. If you pick the wrong subsystem, your rule may not work as you want it to, or, indeed, at all. -小心!尽管USB网络摄像头确实是提供输入的设备(键盘和鼠标也是如此),但它也属于_usb_子系统和其他几个子系统。这意味着您的网络摄像头已添加到多个子系统,并且看起来像多个设备。如果选择了错误的子系统,则您的规则可能无法按您希望的那样工作,或者甚至根本无法工作。 +小心!尽管USB摄像头确实是提供输入的设备(键盘和鼠标也是),但它也属于 _usb_ 子系统和其他几个子系统。这意味着您的摄像头被添加到了多个子系统,并且看起来像多个设备。如果您选择了错误的子系统,那么您的规则可能无法按您期望的那样工作,或者根本无法工作。 So, the third thing you have to check is all the subsystems the webcam has got added to and pick the correct one. To do that, unplug your webcam again and run: -因此,您需要检查的第三件事是网络摄像头已添加到的所有子系统中,并选择了正确的子系统。为此,请再次拔下网络摄像头,然后运行: +因此,您必须检查的第三件事是摄像头添加到的所有子系统,并选择正确的那个。为此,请再次拔下摄像头,然后运行: ``` ls /dev/video* ``` This will show you all the video devices connected to the machine. If you are using a laptop, most come with a built-in webcam and it will probably show up as `/dev/video0`. Plug your webcam back in and run `ls /dev/video*` again. -这将向您显示连接到本机的所有视频设备。 如果您使用的是笔记本电脑,则大多数笔记本电脑都带有内置摄像头,它可能会显示为`/ dev / video0`。 重新插入网络摄像头,然后再次运行`ls / dev / video *`。 +这将向您显示连接到本机的所有视频设备。如果您使用的是笔记本,大多数笔记本都带有内置摄像头,它可能会显示为`/dev/video0`。重新插入摄像头,然后再次运行`ls /dev/video*`。 Now you should see one more video device (probably `/dev/video1`). -现在,您应该再看到一个视频设备(可能是“ / dev / video1”)。 +现在,您应该看到多一个视频设备(可能是`/dev/video1`)。 Now you can find out all the subsystems it belongs to by running `udevadm info -a /dev/video1`: -现在,您可以通过运行`udevadm info -a / dev / video1`找出它所属的所有子系统: +现在,您可以通过运行`udevadm info -a /dev/video1`找出它所属的所有子系统: ``` udevadm info -a /dev/video1 @@ -207,35 +203,36 @@ and the attributes from one single parent device. ``` The output goes on for quite a while, but what you're interested is right at the beginning: `SUBSYSTEM=="video4linux"`. This is a line you can literally copy and paste right into your rule. The rest of the output (not shown for brevity) gives you a couple more nuggets, like the manufacturer and mode IDs, again in a format you can copy and paste into your rule. -输出持续了一段时间,但是您感兴趣的只是开始:`SUBSYSTEM ==“ video4linux”`。您可以按实际情况将这行复制并粘贴到规则中。输出的其余部分(为简便起见未显示)为您提供了更多的块,例如制造商和模式ID,它们的格式也可以复制并粘贴到规则中。 +输出持续了一段时间,但是您感兴趣的只是开始:`SUBSYSTEM =="video4linux"`。您可以将这行按文本复制并粘贴到规则中。输出的其余部分(为简便起见未显示)为您提供了更多的块,例如制造商和模型ID,您也可以以同样的格式复制并粘贴到规则中。 Now you have a way of identifying the device and what event should trigger the action univocally, it is time to tinker with the device. -现在,您有了一种识别设备的方式,什么事件应该明确触发该操作,现在该对设备进行修改了。 +现在,您有了识别设备的方式并明确了什么事件应该触发该动作,该对设备进行修改了。 The next section in the rule, `SYMLINK+="mywebcam", TAG+="systemd", MODE="0666"` tells Udev to do three things: First, you want to create symbolic link from the device to (e.g. _/dev/video1_ ) to _/dev/mywebcam_. This is because you cannot predict what the system is going to call the device by default. When you have an in-built webcam and you hotplug a new one, the in-built webcam will usually be _/dev/video0_ while the external one will become _/dev/video1_. However, if you boot your computer with the external USB webcam plugged in, that could be reversed and the internal webcam can become _/dev/video1_ and the external one _/dev/video0_. What this is telling you is that, although your image-capturing script (which you will see later on) always needs to point to the external webcam device, you can't rely on it being _/dev/video0_ or _/dev/video1_. To solve this problem, you tell Udev to create a symbolic link which will never change in the moment the device is added to the _video4linux_ subsystem and you will make your script point to that. -规则的下一部分,`SYMLINK + =“ mywebcam”,TAG + =“ systemd”,MODE =“ 0666”`告诉Udev做三件事:首先,您要创建从设备到的符号链接(例如_ / dev / video1_)到_ / dev / mywebcam_。这是因为您无法预测默认情况下系统将调用什么设备。当您拥有内置摄像头并热插拔新摄像头时,内置摄像头通常为_ / dev / video0_,而外部摄像头通常为_ / dev / video1_。但是,如果您在插入外部USB网络摄像头的情况下引导计算机,则可能会相反,并且内部网络摄像头可能会变成_ / dev / video1_,而外部网络摄像头会变成_ / dev / video0_。这告诉您的是,尽管您的图像捕获脚本(稍后将看到)始终需要指向外部网络摄像头设备,但是您不能依靠它是_ / dev / video0_或_ / dev / video1_。为了解决这个问题,您告诉Udev创建一个符号链接,该链接在将设备添加到_video4linux_子系统的那一刻就不会改变,并且您将使脚本指向该链接。 + +规则的下一部分,`SYMLINK+="mywebcam", TAG+="systemd", MODE="0666"`告诉Udev做三件事:首先,您要创建设备的符号链接(例如_/dev/video1_)到_/dev/mywebcam_。这是因为您无法预测系统默认情况下会把那个设备叫什么。当您拥有内置摄像头并热插拔一个新的时,内置摄像头通常为_/dev/video0_,而外部摄像头通常为_/dev/video1_。但是,如果您在插入外部USB摄像头的情况下重启计算机,则可能会相反,内部摄像头可能会变成_/dev/video1_,而外部摄像头会变成_/dev/video0_。这想告诉您的是,尽管您的图像捕获脚本(稍后将看到)总是需要指向外部摄像头设备,但是您不能依赖它是_/dev/video0_或_/dev/video1_。为了解决这个问题,您告诉Udev创建一个符号链接,该链接在设备被添加到 _video4linux_ 子系统的那一刻起就不会再变,您将使您的脚本指向该链接。 The second thing you do is add `"systemd"` to the list of Udev tags associated with this rule. This tells Udev that the action that the rule will trigger will be managed by systemd, that is, it will be some sort of systemd service. -您要做的第二件事是将“ systemd”添加到与此规则关联的Udev标记列表中。这告诉Udev,该规则将触发的操作将由systemd管理,即它将是某种systemd服务。 +您要做的第二件事是将`"systemd"`添加到与此规则关联的Udev标记列表中。这告诉Udev,该规则触发的动作将由systemd管理,即它将是某种systemd服务。 Notice how in both cases you use `+=` operator. This adds the value to a list, which means you can add more than one value to `SYMLINK` and `TAG`. -注意在两种情况下如何使用“ + =”运算符。这会将值添加到列表中,这意味着您可以向“ SYMLINK”和“ TAG”添加多个值。 +注意在两种情况下该如何使用 `+=` 运算符。这会将值添加到列表中,这意味着您可以向 `SYMLINK` 和 `TAG` 添加多个值。 The `MODE` values, on the other hand, can only contain one value (hence you use the simple `=` assignment operator). What `MODE` does is tell Udev who can read from or write to the device. If you are familiar with `chmod` (and, if you are reading this, you should be), you will also be familiar of [how you can express permissions using numbers][9]. That is what this is: `0666` means " _give read and write privileges to the device to everybody_ ". -另一方面,“ MODE”值只能包含一个值(因此,您可以使用简单的“ =”赋值运算符)。 MODE的作用是告诉Udev谁可以读取或写入设备。如果您熟悉`chmod`(并且应该阅读),那么您还将熟悉[如何使用数字表示权限] [9]。这就是它的意思:“ 0666”的意思是“向所有人授予对设备的读写特权”。 +另一方面,`MODE` 值只能包含一个值(因此,您可以使用简单的 `=` 赋值运算符)。`MODE` 的作用是告诉Udev谁可以读或写该设备。如果您熟悉 `chmod`(您读到此文, 应该会熟悉),您就也会熟悉[如何用数字表示权限][9]。这就是它的含义: `0666` 的含义是 “ _向所有人授予对设备的读写权限_ ”。 At last, `ENV{SYSTEMD_WANTS}="webcam.service"` tells Udev what systemd service to run. -最后,`ENV {SYSTEMD_WANTS} =“ webcam.service”`告诉Udev要运行什么systemd服务。 +最后, `ENV{SYSTEMD_WANTS}="webcam.service"` 告诉Udev要运行什么systemd服务。 Save this rule into file called _90-webcam.rules_ (or something like that) in _/etc/udev/rules.d_ and you can load it either by rebooting your machine, or by running: -将此规则保存到_ / etc / udev / rules.d_中名为_90-webcam.rules_(或类似名称)的文件中,您可以通过重新启动计算机或运行以下命令来加载它: +将此规则保存到 _/etc/udev/rules.d_ 目录名为 _90-webcam.rules_ (或类似的名称)的文件中,您可以通过重启机器或运行以下命令来加载它: ``` sudo udevadm control --reload-rules && udevadm trigger ``` -## Service at Last +## Service at Last 最后描述服务 The service the Udev rule triggers is ridiculously simple: Udev规则触发的服务非常简单: @@ -248,10 +245,10 @@ ExecStart=/home/[user name]/bin/checkimage.sh ``` Basically, it just runs the _checkimage.sh_ script stored in your personal _bin/_ and pushes it the background. [This is something you saw how to do in prior installments][5]. It may seem something little, but just because it is called by a Udev rule, you have just created a special kind of systemd unit called a _device_ unit. Congratulations. -基本上,它只运行存储在您个人_bin / _中的_checkimage.sh_脚本并将其推入后台。 [这是您在先前的部分中看到的操作方法] [5]。 它看起来似乎很少,但是仅由于它是由Udev规则调用的,因此您刚刚创建了一种特殊的systemd单元,称为_device_ unit。 恭喜你 +基本上,它只是运行存储在您个人 _bin/_ 中的 _checkimage.sh_ 脚本并将其放到后台。 [这是您在先前的部分中看过的内容][5]。 它看起来似乎很小,但那只是因为它是被Udev规则调用的,您刚刚创建了一种特殊的systemd单元,称为 _device_ 单元。 恭喜。 As for the _checkimage.sh_ script _webcam.service_ calls, there are several ways of grabbing an image from a webcam and comparing it to a prior one to check for changes (which is what _checkimage.sh_ does), but this is how I did it: -至于_checkimage.sh_脚本_webcam.service_调用,有几种方法可以从网络摄像头获取图像并将其与前一个图像进行比较以检查更改(_checkimage.sh_所做的工作),但这就是我的方法 它: +至于 _webcam.service_ 调用的 _checkimage.sh_ 脚本,有几种方法从摄像头抓取图像并将其与前一个图像进行比较以检查变化(这是 _checkimage.sh_ 所做的事),但这是我的方法: ``` #!/bin/bash @@ -278,15 +275,16 @@ done ``` Start by using [MPlayer][10] to grab a frame ( _00000001.png_ ) from the webcam. Notice how we point `mplayer` to the `mywebcam` symbolic link we created in our Udev rule, instead of to `video0` or `video1`. Then you transfer the image to the _monitor/_ directory in your home directory. Then run an infinite loop that does the same thing again and again, but also uses [Image Magick's _compare_ tool][11] to see if there any differences between the last image captured and the one that is already in the _monitor/_ directory. -首先使用[MPlayer] [10]从摄像头抓取一个帧(_00000001.png_)。 注意,我们如何将mplayer指向在Udev规则中创建的mywebcam符号链接,而不是指向video0或video1。 然后,将映像传输到主目录中的_monitor / _目录。 然后运行一个无限循环,一次又一次地执行相同的操作,但是还使用[Image Magick的_compare_工具] [11]来查看最后捕获的图像与_monitor / _目录中的图像之间是否存在差异。 +首先使用[MPlayer][10]从摄像头抓取一帧(_00000001.png_)。注意,我们怎样将 `mplayer` 指向Udev规则中创建的 `mywebcam` 符号链接,而不是指向 `video0` 或 `video1` 。然后,将图像传输到主目录中的 _monitor/_ 目录。然后执行一个无限循环,一次又一次地执行相同的操作,但还使用了[Image Magick的_compare_工具][11]来查看最后捕获的图像与 _monitor/_ 目录中已有的图像之间是否存在差异。 If the images are different, it means something has moved within the webcam's frame. The script overwrites the original image with the new image and continues comparing waiting for some more movement. -如果图像不同,则表示网络摄像头框架内已移动了某些东西。 该脚本将新图像覆盖原始图像,并继续比较以等待更多移动。 +如果图像不同,则表示摄像头的镜框里某些东西动了。该脚本将新图像覆盖原始图像,并继续比较以等待更多变动。 -### Plugged +### Plugged 插线 With all the bits and pieces in place, when you plug your webcam in, your Udev rule will be triggered and will start the _webcam.service_. The _webcam.service_ will execute _checkimage.sh_ in the background, and _checkimage.sh_ will start taking pictures every half a second. You will know because your webcam's LED will start flashing indicating every time it takes a snap. -一切零碎,将网络摄像头插入电源后,您的Udev规则将被触发并启动_webcam.service_。 _webcam.service_将在后台执行_checkimage.sh_,而_checkimage.sh_将每半秒开始拍照。 您会知道,因为网络摄像头的LED指示灯将开始闪烁,表明每次需要快照。 + +所有东西准备好后,当您插入摄像头后,您的Udev规则将被触发并启动 _webcam.service_ 。 _webcam.service_ 将在后台执行 _checkimage.sh_ ,而 _checkimage.sh_ 将开始每半秒拍一次照。您会感觉到,因为摄像头的LED在每次拍照时将开始闪。 As always, if something goes wrong, run 与往常一样,如果出现问题,请运行 @@ -298,23 +296,23 @@ systemctl status webcam.service to check what your service and script are up to. 检查您的服务和脚本正在做什么。 -### Coming up +### Coming up 接下来 You may be wondering: Why overwrite the original image? Surely you would want to see what's going on if the system detects any movement, right? You would be right, but as you will see in the next installment, leaving things as they are and processing the images using yet another type of systemd unit makes things nice, clean and easy. -您可能想知道:为什么要覆盖原始图像? 当然,如果系统检测到任何移动,您肯定想知道发生了什么,对吗? 您将是对的,但是如您在下一部分中将看到的那样,将它们保持原样,并使用另一种类型的systemd单元处理图像将使事情变得更好,干净和容易。 +您可能想知道:为什么要覆盖原始图像? 当然,系统检测到任何动静,您都想知道发生了什么,对吗?您是对的,但是如您在下一部分中将看到的那样,将它们保持原样,并使用另一种类型的systemd单元处理图像将更好,更清晰和更简单。 Just wait and see. 请稍等。 Learn more about Linux through the free ["Introduction to Linux" ][12]course from The Linux Foundation and edX. -通过Linux基金会和edX的免费[[Linux简介]] [12]课程了解有关Linux的更多信息。 +通过Linux基金会和edX的免费["Linux简介"][12]课程了解有关Linux的更多信息。 -------------------------------------------------------------------------------- via: https://www.linux.com/blog/intro-to-linux/2018/6/systemd-services-reacting-change 作者:[Paul Brown][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[messon007](https://github.com/messon007) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5f8264ce45fa65af7206005dffc7793b98ce4eb5 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Mon, 4 May 2020 22:51:40 +0800 Subject: [PATCH 0591/1809] Almost done --- ...12 Systemd Services- Reacting to Change.md | 86 +++---------------- 1 file changed, 13 insertions(+), 73 deletions(-) diff --git a/sources/tech/20180612 Systemd Services- Reacting to Change.md b/sources/tech/20180612 Systemd Services- Reacting to Change.md index bdb7d7c44c..22c176ee80 100644 --- a/sources/tech/20180612 Systemd Services- Reacting to Change.md +++ b/sources/tech/20180612 Systemd Services- Reacting to Change.md @@ -1,47 +1,34 @@ -Systemd Services: Reacting to Change Systemd服务:响应变更 +Systemd服务:响应变更 ====== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/webcam.png?itok=zzYUs5VK) -[I have one of these Compute Sticks][1] (Figure 1) and use it as an all-purpose server. It is inconspicuous and silent and, as it is built around an x86 architecture, I don't have problems getting it to work with drivers for my printer, and that’s what it does most days: it interfaces with the shared printer and scanner in my living room. [我有一个这样的电脑棒][1](图1),并将其用作通用服务器。它很小且安静,由于它是基于x86架构,因此我为我的打印机安装驱动没有任何问题,而且这就是它大多数时候干的事:与客厅的共享打印机和扫描仪通信。 ![ComputeStick][3] -An Intel ComputeStick. Euro coin for size. 一个英特尔电脑棒。欧元硬币大小。 [Used with permission][4] -Most of the time it is idle, especially when we are out, so I thought it would be good idea to use it as a surveillance system. The device doesn't come with its own camera, and it wouldn't need to be spying all the time. I also didn't want to have to start the image capturing by hand because this would mean having to log into the Stick using SSH and fire up the process by writing commands in the shell before rushing out the door. - 大多数时候,它都闲着,尤其是当我们外出时,因此我认为用它作监视系统是个好主意。该设备没有自带的摄像头,也不需要一直监视。我也不想手动启动图像捕获,因为这样就意味着在出门前必须通过SSH登录,并在shell中编写命令来启动该进程。 -So I thought that the thing to do would be to grab a USB webcam and have the surveillance system fire up automatically just by plugging it in. Bonus points if the surveillance system fired up also after the Stick rebooted, and it found that the camera was connected. - 因此,我以为应该这么做:抓住USB摄像头,然后只需插入它即可自动启动监视系统。如果Stick重启后发现连接了摄像头也启动监视系统就更加分了。 -In prior installments, we saw that [systemd services can be started or stopped by hand][5] or [when certain conditions are met][6]. Those conditions are not limited to when the OS reaches a certain state in the boot up or powerdown sequence but can also be when you plug in new hardware or when things change in the filesystem. You do that by combining a Udev rule with a systemd service. 在先前的文章中,我们看到[systemd服务可以手动启动或停止][5]或[在满足某些条件时][6]。这些条件不限于操作系统在启动或关机时序中达到某种状态,还可以在您插入新硬件或文件系统发生变化时进行。您可以通过将Udev规则与systemd服务结合起来实现。 -### Hotplugging with Udev 有Udev(支持)的热插拔 +### 有Udev(支持)的热插拔 -Udev rules live in the _/etc/udev/rules_ directory and are usually a single line containing _conditions_ and _assignments_ that lead to an _action_. Udev规则位于 _/etc/udev/rules_ 目录中,通常是由导致一个 _动作(action)_ 的 _条件(conditions)_ 和 _赋值(assignments)_ 的单行语句来描述。 -That was a bit cryptic. Let's try again: 有点神秘。让我们再试一次: -Typically, in a Udev rule, you tell systemd what to look for when a device is connected. For example, you may want to check if the make and model of a device you just plugged in correspond to the make and model of the device you are telling Udev to wait for. Those are the _conditions_ mentioned earlier. 通常,在Udev规则中,您告诉systemd当连接一个设备时需要查看什么信息。例如,您可能想检查刚插入的设备的品牌和型号是否与您让Udev等待的设备的品牌和型号相对应。这些就是前面提到的条件。 -Then you may want to change some stuff so you can use the device easily later. An example of that would be to change the read and write permissions to a device: if you plug in a USB printer, you're going to want users to be able to read information from the printer (the user's printing app would want to know the model, make, and whether it is ready to receive print jobs or not) and write to it, that is, send stuff to print. Changing the read and write permissions for a device is done using one of the _assignments_ you read about earlier. 然后,您可能想要更改一些内容,以便以后可以轻松使用该设备。例如,更改设备的读写权限:如果插入USB打印机,您将希望用户能够从打印机读取信息(用户的打印应用程序需要知道其模型,制造商,以及是否准备好接受打印作业)并向其写入内容,即发送要打印的内容。更改设备的读写权限是通过您之前阅读的 _赋值(assignments)_ 之一完成的。 -Finally, you will probably want the system to do something when the conditions mentioned above are met, like start a backup application to copy important files when a certain external hard disk drive is plugged in. That is an example of an _action_ mentioned above. 最后,您可能希望系统在满足上述条件时执行某些动作,例如在插入某个外接硬盘时启动备份程序以复制重要文件。这就是上面提到的 _动作(action)_ 的例子。 -With that in mind, ponder this: 了解这些之后, 来看看以下几点: ``` @@ -49,7 +36,6 @@ ACTION=="add", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="03f0", ATTRS{idProduc SYMLINK+="mywebcam", TAG+="systemd", MODE="0666", ENV{SYSTEMD_WANTS}="webcam.service" ``` -The first part of the rule, 规则的第一部分, ``` @@ -57,33 +43,24 @@ ACTION=="add", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="e207" [etc... ] ``` -shows the conditions that the device has to meet before doing any of the other stuff you want the system to do. The device has to be added (`ACTION=="add"`) to the machine, it has to be integrated into the `video4linux` subsystem. To make sure the rule is applied only when the correct device is plugged in, you have to make sure Udev correctly identifies the manufacturer (`ATTRS{idVendor}=="03f0"`) and a model (`ATTRS{idProduct}=="e207"`) of the device. 表明了执行您想让系统执行的其他动作之前设备必须满足的条件。设备必须被添加到(`ACTION=="add"`)机器上,并且必须添加到 `video4linux` 子系统中。为了确保仅在插入正确的设备时才应用该规则,您必须确保Udev正确识别设备的制造商(`ATTRS{idVendor}=="03f0"`)和型号(`ATTRS{idProduct}=="e207"`)。 -In this case, we're talking about this device (Figure 2): 在本例中,我们讨论的是这个设备(图2): ![webcam][8] -The HP webcam used in this experiment. 这个试验使用的是HP的摄像头。 [Used with permission][4] -Notice how you use `==` to indicate that these are a logical operation. You would read the above snippet of the rule like this: -注意怎样用`==`来表示这是一个逻辑操作。您应该像这样阅读上面的简要规则: +注意怎样用 `==` 来表示这是一个逻辑操作。您应该像这样阅读上面的简要规则: -``` -if the device is added and the device controlled by the video4linux subsystem -and the manufacturer of the device is 03f0 and the model is e207, then... -``` ``` 如果添加了一个设备并且该设备由video4linux子系统控制 而且该设备的制造商是03f0,型号是e207,那么... ``` -But where do you get all this information? Where do you find the action that triggers the event, the manufacturer, model, and so on? You will probably have to use several sources. The `IdVendor` and `idProduct` you can get by plugging the webcam into your machine and running `lsusb`: -但是,您从哪里获取的这些信息? 您在哪里找到触发事件的动作,制造商,模型等等?您可能必须使用多个来源。您可以通过将摄像头插入机器并运行`lsusb`来获得`IdVendor`和`idProduct`: +但是,您从哪里获取的这些信息? 您在哪里找到触发事件的动作,制造商,模型等等?您可能必须使用多个来源。您可以通过将摄像头插入机器并运行 `lsusb` 来获得 `IdVendor` 和 `idProduct` : ``` lsusb @@ -97,16 +74,11 @@ Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub ``` -The webcam I’m using is made by HP, and you can only see one HP device in the list above. The `ID` gives you the manufacturer and the model numbers separated by a colon (`:`). If you have more than one device by the same manufacturer and not sure which is which, unplug the webcam, run `lsusb` again and check what's missing. -我用的摄像头是HP的,您在上面的列表中只能看到一个HP设备。`ID`告诉了制造商和型号,它们以冒号(`:`)分隔。如果您有同一制造商的多个设备,不确定哪个是哪个设备,请拔下摄像头,再次运行`lsusb`, 看看少了什么。 - -OR... - -Unplug the webcam, wait a few seconds, run the command `udevadmin monitor --environment` and then plug the webcam back in again. When you do that with the HP webcam, you get: +我用的摄像头是HP的,您在上面的列表中只能看到一个HP设备。 `ID` 告诉了制造商和型号,它们以冒号( `:` )分隔。如果您有同一制造商的多个设备,不确定哪个是哪个设备,请拔下摄像头,再次运行 `lsusb` , 看看少了什么。 或者... -拔下摄像头,等待几秒钟,运行命令`udevadmin monitor --environment`,然后重新插入摄像头。当您使用的是HP摄像头时,您将看到: +拔下摄像头,等待几秒钟,运行命令 `udevadmin monitor --environment` ,然后重新插入摄像头。当您使用的是HP摄像头时,您将看到: ``` udevadmin monitor --environment @@ -149,11 +121,7 @@ XKBOPTIONS= XKBVARIANT= ``` -That may look like a lot to process, but, check this out: the `ACTION` field early in the list tells you what event just happened, i.e., that a device got added to the system. You can also see the name of the device spelled out on several of the lines, so you can be pretty sure that it is the device you are looking for. The output also shows the manufacturer's ID number (`ID_VENDOR_ID=03f0`) and the model number (`ID_VENDOR_ID=03f0`). - -可能看起来有很多信息要处理,但是,看一下这个:列表前面的`ACTION`字段, 它告诉您刚刚发生了什么事件,即一个设备被添加到系统中。您还可以在几行中看到设备名称的拼写,因此可以非常确定它就是您要找的设备。输出里还显示了制造商的ID(`ID_VENDOR_ID = 03f0`)和型号(`ID_VENDOR_ID = 03f0`)。 - -This gives you three of the four values the condition part of the rule needs. You may be tempted to think that it a gives you the fourth, too, because there is also a line that says: +可能看起来有很多信息要处理,但是,看一下这个:列表前面的 `ACTION` 字段, 它告诉您刚刚发生了什么事件,即一个设备被添加到系统中。您还可以在几行中看到设备名称的拼写,因此可以非常确定它就是您要找的设备。输出里还显示了制造商的ID(`ID_VENDOR_ID = 03f0`)和型号(`ID_VENDOR_ID = 03f0`)。 这为您提供了规则条件部分需要的四个值中的三个。您可能也会想到它还给了您第四个,因为还有一行这样写道: @@ -161,24 +129,18 @@ This gives you three of the four values the condition part of the rule needs. Yo SUBSYSTEM=input ``` -Be careful! Although it is true that a USB webcam is a device that provides input (as does a keyboard and a mouse), it is also belongs to the _usb_ subsystem, and several others. This means that your webcam gets added to several subsystems and looks like several devices. If you pick the wrong subsystem, your rule may not work as you want it to, or, indeed, at all. 小心!尽管USB摄像头确实是提供输入的设备(键盘和鼠标也是),但它也属于 _usb_ 子系统和其他几个子系统。这意味着您的摄像头被添加到了多个子系统,并且看起来像多个设备。如果您选择了错误的子系统,那么您的规则可能无法按您期望的那样工作,或者根本无法工作。 -So, the third thing you have to check is all the subsystems the webcam has got added to and pick the correct one. To do that, unplug your webcam again and run: - 因此,您必须检查的第三件事是摄像头添加到的所有子系统,并选择正确的那个。为此,请再次拔下摄像头,然后运行: ``` ls /dev/video* ``` -This will show you all the video devices connected to the machine. If you are using a laptop, most come with a built-in webcam and it will probably show up as `/dev/video0`. Plug your webcam back in and run `ls /dev/video*` again. -这将向您显示连接到本机的所有视频设备。如果您使用的是笔记本,大多数笔记本都带有内置摄像头,它可能会显示为`/dev/video0`。重新插入摄像头,然后再次运行`ls /dev/video*`。 +这将向您显示连接到本机的所有视频设备。如果您使用的是笔记本,大多数笔记本都带有内置摄像头,它可能会显示为 `/dev/video0` 。重新插入摄像头,然后再次运行 `ls /dev/video*` 。 -Now you should see one more video device (probably `/dev/video1`). 现在,您应该看到多一个视频设备(可能是`/dev/video1`)。 -Now you can find out all the subsystems it belongs to by running `udevadm info -a /dev/video1`: 现在,您可以通过运行`udevadm info -a /dev/video1`找出它所属的所有子系统: ``` @@ -202,39 +164,28 @@ and the attributes from one single parent device. [etc...] ``` -The output goes on for quite a while, but what you're interested is right at the beginning: `SUBSYSTEM=="video4linux"`. This is a line you can literally copy and paste right into your rule. The rest of the output (not shown for brevity) gives you a couple more nuggets, like the manufacturer and mode IDs, again in a format you can copy and paste into your rule. 输出持续了一段时间,但是您感兴趣的只是开始:`SUBSYSTEM =="video4linux"`。您可以将这行按文本复制并粘贴到规则中。输出的其余部分(为简便起见未显示)为您提供了更多的块,例如制造商和模型ID,您也可以以同样的格式复制并粘贴到规则中。 -Now you have a way of identifying the device and what event should trigger the action univocally, it is time to tinker with the device. 现在,您有了识别设备的方式并明确了什么事件应该触发该动作,该对设备进行修改了。 -The next section in the rule, `SYMLINK+="mywebcam", TAG+="systemd", MODE="0666"` tells Udev to do three things: First, you want to create symbolic link from the device to (e.g. _/dev/video1_ ) to _/dev/mywebcam_. This is because you cannot predict what the system is going to call the device by default. When you have an in-built webcam and you hotplug a new one, the in-built webcam will usually be _/dev/video0_ while the external one will become _/dev/video1_. However, if you boot your computer with the external USB webcam plugged in, that could be reversed and the internal webcam can become _/dev/video1_ and the external one _/dev/video0_. What this is telling you is that, although your image-capturing script (which you will see later on) always needs to point to the external webcam device, you can't rely on it being _/dev/video0_ or _/dev/video1_. To solve this problem, you tell Udev to create a symbolic link which will never change in the moment the device is added to the _video4linux_ subsystem and you will make your script point to that. +规则的下一部分,`SYMLINK+="mywebcam", TAG+="systemd", MODE="0666"`告诉Udev做三件事:首先,您要创建设备的符号链接(例如 _/dev/video1_ 到 _/dev/mywebcam_ 。这是因为您无法预测系统默认情况下会把那个设备叫什么。当您拥有内置摄像头并热插拔一个新的时,内置摄像头通常为 _/dev/video0_ ,而外部摄像头通常为 _/dev/video1_ 。但是,如果您在插入外部USB摄像头的情况下重启计算机,则可能会相反,内部摄像头可能会变成 _/dev/video1_ ,而外部摄像头会变成 _/dev/video0_ 。这想告诉您的是,尽管您的图像捕获脚本(稍后将看到)总是需要指向外部摄像头设备,但是您不能依赖它是 _/dev/video0_ 或 _/dev/video1_ 。为了解决这个问题,您告诉Udev创建一个符号链接,该链接在设备被添加到 _video4linux_ 子系统的那一刻起就不会再变,您将使您的脚本指向该链接。 -规则的下一部分,`SYMLINK+="mywebcam", TAG+="systemd", MODE="0666"`告诉Udev做三件事:首先,您要创建设备的符号链接(例如_/dev/video1_)到_/dev/mywebcam_。这是因为您无法预测系统默认情况下会把那个设备叫什么。当您拥有内置摄像头并热插拔一个新的时,内置摄像头通常为_/dev/video0_,而外部摄像头通常为_/dev/video1_。但是,如果您在插入外部USB摄像头的情况下重启计算机,则可能会相反,内部摄像头可能会变成_/dev/video1_,而外部摄像头会变成_/dev/video0_。这想告诉您的是,尽管您的图像捕获脚本(稍后将看到)总是需要指向外部摄像头设备,但是您不能依赖它是_/dev/video0_或_/dev/video1_。为了解决这个问题,您告诉Udev创建一个符号链接,该链接在设备被添加到 _video4linux_ 子系统的那一刻起就不会再变,您将使您的脚本指向该链接。 +您要做的第二件事是将 `"systemd"` 添加到与此规则关联的Udev标记列表中。这告诉Udev,该规则触发的动作将由systemd管理,即它将是某种systemd服务。 -The second thing you do is add `"systemd"` to the list of Udev tags associated with this rule. This tells Udev that the action that the rule will trigger will be managed by systemd, that is, it will be some sort of systemd service. -您要做的第二件事是将`"systemd"`添加到与此规则关联的Udev标记列表中。这告诉Udev,该规则触发的动作将由systemd管理,即它将是某种systemd服务。 - -Notice how in both cases you use `+=` operator. This adds the value to a list, which means you can add more than one value to `SYMLINK` and `TAG`. 注意在两种情况下该如何使用 `+=` 运算符。这会将值添加到列表中,这意味着您可以向 `SYMLINK` 和 `TAG` 添加多个值。 -The `MODE` values, on the other hand, can only contain one value (hence you use the simple `=` assignment operator). What `MODE` does is tell Udev who can read from or write to the device. If you are familiar with `chmod` (and, if you are reading this, you should be), you will also be familiar of [how you can express permissions using numbers][9]. That is what this is: `0666` means " _give read and write privileges to the device to everybody_ ". 另一方面,`MODE` 值只能包含一个值(因此,您可以使用简单的 `=` 赋值运算符)。`MODE` 的作用是告诉Udev谁可以读或写该设备。如果您熟悉 `chmod`(您读到此文, 应该会熟悉),您就也会熟悉[如何用数字表示权限][9]。这就是它的含义: `0666` 的含义是 “ _向所有人授予对设备的读写权限_ ”。 -At last, `ENV{SYSTEMD_WANTS}="webcam.service"` tells Udev what systemd service to run. - 最后, `ENV{SYSTEMD_WANTS}="webcam.service"` 告诉Udev要运行什么systemd服务。 -Save this rule into file called _90-webcam.rules_ (or something like that) in _/etc/udev/rules.d_ and you can load it either by rebooting your machine, or by running: 将此规则保存到 _/etc/udev/rules.d_ 目录名为 _90-webcam.rules_ (或类似的名称)的文件中,您可以通过重启机器或运行以下命令来加载它: ``` sudo udevadm control --reload-rules && udevadm trigger ``` -## Service at Last 最后描述服务 +## 最后描述服务 -The service the Udev rule triggers is ridiculously simple: Udev规则触发的服务非常简单: ``` # webcam.service @@ -244,10 +195,8 @@ Type=simple ExecStart=/home/[user name]/bin/checkimage.sh ``` -Basically, it just runs the _checkimage.sh_ script stored in your personal _bin/_ and pushes it the background. [This is something you saw how to do in prior installments][5]. It may seem something little, but just because it is called by a Udev rule, you have just created a special kind of systemd unit called a _device_ unit. Congratulations. 基本上,它只是运行存储在您个人 _bin/_ 中的 _checkimage.sh_ 脚本并将其放到后台。 [这是您在先前的部分中看过的内容][5]。 它看起来似乎很小,但那只是因为它是被Udev规则调用的,您刚刚创建了一种特殊的systemd单元,称为 _device_ 单元。 恭喜。 -As for the _checkimage.sh_ script _webcam.service_ calls, there are several ways of grabbing an image from a webcam and comparing it to a prior one to check for changes (which is what _checkimage.sh_ does), but this is how I did it: 至于 _webcam.service_ 调用的 _checkimage.sh_ 脚本,有几种方法从摄像头抓取图像并将其与前一个图像进行比较以检查变化(这是 _checkimage.sh_ 所做的事),但这是我的方法: ``` @@ -274,37 +223,28 @@ do done ``` -Start by using [MPlayer][10] to grab a frame ( _00000001.png_ ) from the webcam. Notice how we point `mplayer` to the `mywebcam` symbolic link we created in our Udev rule, instead of to `video0` or `video1`. Then you transfer the image to the _monitor/_ directory in your home directory. Then run an infinite loop that does the same thing again and again, but also uses [Image Magick's _compare_ tool][11] to see if there any differences between the last image captured and the one that is already in the _monitor/_ directory. 首先使用[MPlayer][10]从摄像头抓取一帧(_00000001.png_)。注意,我们怎样将 `mplayer` 指向Udev规则中创建的 `mywebcam` 符号链接,而不是指向 `video0` 或 `video1` 。然后,将图像传输到主目录中的 _monitor/_ 目录。然后执行一个无限循环,一次又一次地执行相同的操作,但还使用了[Image Magick的_compare_工具][11]来查看最后捕获的图像与 _monitor/_ 目录中已有的图像之间是否存在差异。 -If the images are different, it means something has moved within the webcam's frame. The script overwrites the original image with the new image and continues comparing waiting for some more movement. 如果图像不同,则表示摄像头的镜框里某些东西动了。该脚本将新图像覆盖原始图像,并继续比较以等待更多变动。 -### Plugged 插线 - -With all the bits and pieces in place, when you plug your webcam in, your Udev rule will be triggered and will start the _webcam.service_. The _webcam.service_ will execute _checkimage.sh_ in the background, and _checkimage.sh_ will start taking pictures every half a second. You will know because your webcam's LED will start flashing indicating every time it takes a snap. +### 插线 所有东西准备好后,当您插入摄像头后,您的Udev规则将被触发并启动 _webcam.service_ 。 _webcam.service_ 将在后台执行 _checkimage.sh_ ,而 _checkimage.sh_ 将开始每半秒拍一次照。您会感觉到,因为摄像头的LED在每次拍照时将开始闪。 -As always, if something goes wrong, run 与往常一样,如果出现问题,请运行 ``` systemctl status webcam.service ``` -to check what your service and script are up to. 检查您的服务和脚本正在做什么。 -### Coming up 接下来 +### 接下来 -You may be wondering: Why overwrite the original image? Surely you would want to see what's going on if the system detects any movement, right? You would be right, but as you will see in the next installment, leaving things as they are and processing the images using yet another type of systemd unit makes things nice, clean and easy. 您可能想知道:为什么要覆盖原始图像? 当然,系统检测到任何动静,您都想知道发生了什么,对吗?您是对的,但是如您在下一部分中将看到的那样,将它们保持原样,并使用另一种类型的systemd单元处理图像将更好,更清晰和更简单。 -Just wait and see. 请稍等。 -Learn more about Linux through the free ["Introduction to Linux" ][12]course from The Linux Foundation and edX. 通过Linux基金会和edX的免费["Linux简介"][12]课程了解有关Linux的更多信息。 -------------------------------------------------------------------------------- From d5ed90bbfa6f756208c30b4ef1810f28e6150fa7 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Mon, 4 May 2020 22:54:22 +0800 Subject: [PATCH 0592/1809] translated --- .../tech/20180612 Systemd Services- Reacting to Change.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20180612 Systemd Services- Reacting to Change.md (100%) diff --git a/sources/tech/20180612 Systemd Services- Reacting to Change.md b/translated/tech/20180612 Systemd Services- Reacting to Change.md similarity index 100% rename from sources/tech/20180612 Systemd Services- Reacting to Change.md rename to translated/tech/20180612 Systemd Services- Reacting to Change.md From f43234ffd735d70afe9150860d0c31e75e424224 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 4 May 2020 23:04:29 +0800 Subject: [PATCH 0593/1809] PRF @lxbwolf --- .../tech/20200502 Mid-stack inlining in Go.md | 69 +++++++++---------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/translated/tech/20200502 Mid-stack inlining in Go.md b/translated/tech/20200502 Mid-stack inlining in Go.md index 9d8edcab43..0f8b22306a 100644 --- a/translated/tech/20200502 Mid-stack inlining in Go.md +++ b/translated/tech/20200502 Mid-stack inlining in Go.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Mid-stack inlining in Go) @@ -10,19 +10,21 @@ Go 中对栈中函数进行内联 ====== -[上一篇文章][1]中我论述了叶子内联是怎样让 Go 编译器减少函数调用的开销的,以及延伸出了跨函数边界的优化的机会。本文中,我要论述内联的限制以及叶子与栈中内联的对比。 +![](https://img.linux.net.cn/data/attachment/album/202005/04/230304avxkxlyoozbiw1bn.jpg) + +[上一篇文章][1]中我论述了叶子内联leaf inlining是怎样让 Go 编译器减少函数调用的开销的,以及延伸出了跨函数边界的优化的机会。本文中,我要论述内联的限制以及叶子内联与栈中内联mid-stack inlining的对比。 ### 内联的限制 -把函数内联到它的调用处消除了调用的开销,为编译器进行其他的优化提供了更好的机会,那么问题来了,既然内联这么好,内联得越多开销就越少,_为什么不尽可能多地内联呢?_ +把函数内联到它的调用处消除了调用的开销,为编译器进行其他的优化提供了更好的机会,那么问题来了,既然内联这么好,内联得越多开销就越少,*为什么不尽可能多地内联呢?* -内联用可能的增加程序大小换来了更快的执行时间。限制内联的最主要原因是,创建太多的函数内联的备份会增加编译时间,并且作为边际效应会增加生成的二进制文件的大小。即使把内联带来的进一步的优化机会考虑在内,太激进的内联也可能会增加生成的二进制文件的大小和编译时间。 +内联可能会以增加程序大小换来更快的执行时间。限制内联的最主要原因是,创建许多函数的内联副本会增加编译时间,并导致生成更大的二进制文件的边际效应。即使把内联带来的进一步的优化机会考虑在内,太激进的内联也可能会增加生成的二进制文件的大小和编译时间。 -内联收益最大的是[小函数][2],相对于调用它们的开销来说,这些函数做很少的工作。随着函数大小的增长,函数内部做的工作与函数调用的开销相比省下的时间越来越少。函数越大通常越复杂,因此对它们内联后进行优化与不内联相比的收益没有(对小函数进行内联)那么大。 +内联收益最大的是[小函数][2],相对于调用它们的开销来说,这些函数做很少的工作。随着函数大小的增长,函数内部做的工作与函数调用的开销相比省下的时间越来越少。函数越大通常越复杂,因此优化其内联形式相对于原地优化的好处会减少。 ### 内联预算 -在编译过程中,每个函数的内联能力是用_内联预算_计算的。开销的计算过程可以巧妙地内化,像一元和二元等简单操作,在抽象语法数(Abstract Syntax Tree,AST)中通常是每个节点一个单元,更复杂的操作如 `make` 可能单元更多。考虑下面的例子: +在编译过程中,每个函数的内联能力是用*内联预算*计算的 [^1]。开销的计算过程可以巧妙地内化,像一元和二元等简单操作,在抽象语法数Abstract Syntax Tree(AST)中通常是每个节点一个单位,更复杂的操作如 `make` 可能单位更多。考虑下面的例子: ```go package main @@ -79,28 +81,26 @@ func main() { ./inl.go:39:7: inlining call to small func() string { s := "hello, world!"; return s } ``` -编译器根据函数 `func small()` 的开销(7)决定可以对它内联,而`func large()` 的开销太大,编译器决定不进行内联。`func main()` 被标记为适合内联的,分配了 68 的开销;其中 `small` 占用 7,调用 `small` 函数占用 57,剩余的(4)是它自己的开销。 +编译器根据函数 `func small()` 的开销(7)决定可以对它内联,而 `func large()` 的开销太大,编译器决定不进行内联。`func main()` 被标记为适合内联的,分配了 68 的开销;其中 `small` 占用 7,调用 `small` 函数占用 57,剩余的(4)是它自己的开销。 可以用 `-gcflag=-l` 参数控制内联预算的等级。下面是可使用的值: * `-gcflags=-l=0` 默认的内联等级。 - * `-gcflags=-l` (或 `-gcflags=-l=1`) 取消内联。 - * `-gcflags=-l=2` 和 `-gcflags=-l=3` 现在已经不使用了。不影响 `-gcflags=-l=0` - * `-gcflags=-l=4` 减少非叶子函数和通过接口调用的函数的开销。[2][4] + * `-gcflags=-l`(或 `-gcflags=-l=1`)取消内联。 + * `-gcflags=-l=2` 和 `-gcflags=-l=3` 现在已经不使用了。和 `-gcflags=-l=0` 相比没有区别。 + * `-gcflags=-l=4` 减少非叶子函数和通过接口调用的函数的开销。[^2] +#### 不确定语句的优化 +一些函数虽然内联的开销很小,但由于太复杂它们仍不适合进行内联。这就是函数的不确定性,因为一些操作的语义在内联后很难去推导,如 `recover`、`break`。其他的操作,如 `select` 和 `go` 涉及运行时的协调,因此内联后引入的额外的开销不能抵消内联带来的收益。 -#### 难以理解的优化 - -一些函数虽然内联的开销很小,但由于太复杂它们仍不适合进行内联。这就是函数的不确定性,因为一些操作的语义在内联后很难去推导,如 `recover`,`break`。其他的操作,如 `select` 和 `go` 涉及运行时的协调,因此内联后引入的额外的开销不能抵消内联带来的收益。 - -难理解的语句也包括 `for` 和 `range`,这些语句不一定开销很大,但目前为止还没有对它们进行优化。 +不确定的语句也包括 `for` 和 `range`,这些语句不一定开销很大,但目前为止还没有对它们进行优化。 ### 栈中函数优化 -在过去,Go 编译器只对叶子函数进行内联 — 只有那些不调用其他函数的函数才有资格。在上一段难以理解的的语句的探讨内容中,一次函数调用会让这个函数失去内联的资格。 +在过去,Go 编译器只对叶子函数进行内联 —— 只有那些不调用其他函数的函数才有资格。在上一段不确定的语句的探讨内容中,一次函数调用就会让这个函数失去内联的资格。 -进入栈中进行内联,就像它的名字一样,能内联在函数调用栈中间的函数,不需要先让它下面的所有的函数都被标记为有资格内联的。栈中内联是 David Lazar 在 Go 1.9 中引入的,并在随后的版本中做了改进。[这篇文章][5]深入探究保留栈追踪的表现和被深度内联后的代码路径里的 `runtime.Caller` 们的难点。 +进入栈中进行内联,就像它的名字一样,能内联在函数调用栈中间的函数,不需要先让它下面的所有的函数都被标记为有资格内联的。栈中内联是 David Lazar 在 Go 1.9 中引入的,并在随后的版本中做了改进。[这篇文稿][5]深入探究了保留栈追踪行为和被深度内联后的代码路径里的 `runtime.Callers` 的难点。 在前面的例子中我们看到了栈中函数内联。内联后,`func main()` 包含了 `func small()` 的函数体和对 `func large()` 的一次调用,因此它被判定为非叶子函数。在过去,这会阻止它被继续内联,虽然它的联合开销小于内联预算。 @@ -134,15 +134,16 @@ func main() { } ``` -在这个例子中, `r.Area()` 是个简单的函数,调用了两个函数。`r.Width()` 可以被内联,`r.Height()` 这里用 `//go:noinline` 指令标注了,不能被内联。[3][6] +在这个例子中, `r.Area()` 是个简单的函数,调用了两个函数。`r.Width()` 可以被内联,`r.Height()` 这里用 `//go:noinline` 指令标注了,不能被内联。[^3] ```bash -% go build -gcflags='-m=2' square.go +% go build -gcflags='-m=2' square.go # command-line-arguments -./square.go:12:6: cannot inline (*Rectangle).Height: marked go:noinline +./square.go:12:6: cannot inline (*Rectangle).Height: marked go:noinline ./square.go:17:6: can inline (*Rectangle).Width with cost 2 as: method(*Rectangle) func() int { return 6 } -./square.go:21:6: can inline (*Rectangle).Area with cost 67 as: method(*Rectangle) func() int { return r.Height() * r.Width() } ./square.go:21:61: inlining call to (*Rectangle).Width method(*Rectangle) func() int { return 6 } -./square.go:23:6: cannot inline main: function too complex: cost 150 exceeds budget 80 +./square.go:21:6: can inline (*Rectangle).Area with cost 67 as: method(*Rectangle) func() int { return r.Height() * r.Width() } +./square.go:21:61: inlining call to (*Rectangle).Width method(*Rectangle) func() int { return 6 } +./square.go:23:6: cannot inline main: function too complex: cost 150 exceeds budget 80 ./square.go:25:20: inlining call to (*Rectangle).Area method(*Rectangle) func() int { return r.Height() * r.Width() } ./square.go:25:20: inlining call to (*Rectangle).Width method(*Rectangle) func() int { return 6 } ``` @@ -151,33 +152,29 @@ func main() { #### 快速路径内联 -关于栈中内联的效果最令人吃惊的例子是 2019 年 [Carlo Alberto Ferraris][7] 通过允许把 `sync.Mutex.Lock()` 的快速路径,非竞争的情况,内联到它的调用方来[提升它的性能][7]。在这个修改之前,`sync.Mutex.Lock()` 是个很大的函数,包含很多难以理解的条件,使得它没有资格被内联。即使锁可用时,调用者也要付出调用 `sync.Mutex.Lock()` 的代价。 +关于栈中内联的效果最令人吃惊的例子是 2019 年 [Carlo Alberto Ferraris][7] 通过允许把 `sync.Mutex.Lock()` 的快速路径(非竞争的情况)内联到它的调用方来[提升它的性能][7]。在这个修改之前,`sync.Mutex.Lock()` 是个很大的函数,包含很多难以理解的条件,使得它没有资格被内联。即使锁可用时,调用者也要付出调用 `sync.Mutex.Lock()` 的代价。 -Carlo 把 `sync.Mutex.Lock()` 分成了两个函数(他自己称为*外联*)。外部的 `sync.Mutex.Lock()` 方法现在调用 `sync/atomic.CompareAndSwapInt32()` 且如果 CAS(Compare and Swap)成功了之后立即返回给调用者。如果 CAS 失败,函数会走到 `sync.Mutex.lockSlow()` 慢速路径,需要对锁进行注册,暂停 goroutine。[4][8] +Carlo 把 `sync.Mutex.Lock()` 分成了两个函数(他自己称为外联outlining)。外部的 `sync.Mutex.Lock()` 方法现在调用 `sync/atomic.CompareAndSwapInt32()` 且如果 CAS(比较并交换Compare and Swap)成功了之后立即返回给调用者。如果 CAS 失败,函数会走到 `sync.Mutex.lockSlow()` 慢速路径,需要对锁进行注册,暂停 goroutine。[^4] ```bash % go build -gcflags='-m=2 -l=0' sync 2>&1 | grep '(*Mutex).Lock' -../go/src/sync/mutex.go:72:6: can inline (*Mutex).Lock with cost 69 as: method(*Mutex) func() { if "sync/atomic".CompareAndSwapInt32(&m.state, 0, mutexLocked) { if race.Enabled {  }; return  }; m.lockSlow() } +../go/src/sync/mutex.go:72:6: can inline (*Mutex).Lock with cost 69 as: method(*Mutex) func() { if "sync/atomic".CompareAndSwapInt32(&m.state, 0, mutexLocked) { if race.Enabled { }; return }; m.lockSlow() } ``` 通过把函数分割成一个简单的不能再被分割的外部函数,和(如果没走到外部函数就走到的)一个处理慢速路径的复杂的内部函数,Carlo 组合了栈中函数内联和[编译器对基础操作的支持][9],减少了非竞争锁 14% 的开销。之后他在 `sync.RWMutex.Unlock()` 重复这个技巧,节省了另外 9% 的开销。 - 1. 不同发布版本中,在考虑该函数是否适合内联时,Go 编译器对同一函数的预算是不同的。[][10] - 2. 时刻记着编译器的作者警告过[“更高的内联等级(比 -l 更高)可能导致 bug 或不被支持”][11]。 Caveat emptor。[][12] - 3. 编译器有足够的能力来内联像 `strconv.ParseInt` 的复杂函数。作为一个实验,你可以尝试去掉 `//go:noinline` 注释,使用 `-gcflags=-m=2` 编译后观察。[][13] - 4. `race.Enable` 表达式是通过传递给 `go` 工具的 `-race` 参数控制的一个常量。对于普通编译,它的值是 `false`,此时编译器可以完全省略代码路径。[][14] +[^1]: 不同发布版本中,在考虑该函数是否适合内联时,Go 编译器对同一函数的预算是不同的。 +[^2]: 时刻记着编译器的作者警告过[“更高的内联等级(比 -l 更高)可能导致错误或不被支持”][11]。 Caveat emptor。 +[^3]: 编译器有足够的能力来内联像 `strconv.ParseInt` 的复杂函数。作为一个实验,你可以尝试去掉 `//go:noinline` 注释,使用 `-gcflags=-m=2` 编译后观察。 +[^4]: `race.Enable` 表达式是通过传递给 `go` 工具的 `-race` 参数控制的一个常量。对于普通编译,它的值是 `false`,此时编译器可以完全省略代码路径。 - - -#### 相关文章: +### 相关文章: 1. [Go 中的内联优化][15] 2. [goroutine 的栈为什么会无限增长?][16] 3. [栈追踪和 errors 包][17] 4. [零值是什么,为什么它很有用?][18] - - -------------------------------------------------------------------------------- via: https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go @@ -185,13 +182,13 @@ via: https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go 作者:[Dave Cheney][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://dave.cheney.net/author/davecheney [b]: https://github.com/lujun9972 -[1]: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go +[1]: https://linux.cn/article-12176-1.html [2]: https://medium.com/@joshsaintjacque/small-functions-considered-awesome-c95b3fd1812f [3]: tmp.FyRthF1bbF#easy-footnote-bottom-1-4076 (The budget the Go compiler applies to each function when considering if it is eligible for inlining changes release to release.) [4]: tmp.FyRthF1bbF#easy-footnote-bottom-2-4076 (Keep in mind that the compiler authors warn that “Additional levels of inlining (beyond -l) may be buggy and are not supported”. Caveat emptor.) From 2656cf5b960cea155dcadbc7d04abde8e1cd1f18 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 4 May 2020 23:05:02 +0800 Subject: [PATCH 0594/1809] PUB @lxbwolf https://linux.cn/article-12184-1.html --- .../tech => published}/20200502 Mid-stack inlining in Go.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200502 Mid-stack inlining in Go.md (99%) diff --git a/translated/tech/20200502 Mid-stack inlining in Go.md b/published/20200502 Mid-stack inlining in Go.md similarity index 99% rename from translated/tech/20200502 Mid-stack inlining in Go.md rename to published/20200502 Mid-stack inlining in Go.md index 0f8b22306a..588286626a 100644 --- a/translated/tech/20200502 Mid-stack inlining in Go.md +++ b/published/20200502 Mid-stack inlining in Go.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12184-1.html) [#]: subject: (Mid-stack inlining in Go) [#]: via: (https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go) [#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) From 534199ced4194f1d29907b5446dde9ef418a25d8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 5 May 2020 00:52:45 +0800 Subject: [PATCH 0595/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200504=204=20?= =?UTF-8?q?cool=20new=20projects=20to=20try=20in=20COPR=20for=20May=202020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200504 4 cool new projects to try in COPR for May 2020.md --- ...ew projects to try in COPR for May 2020.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/tech/20200504 4 cool new projects to try in COPR for May 2020.md diff --git a/sources/tech/20200504 4 cool new projects to try in COPR for May 2020.md b/sources/tech/20200504 4 cool new projects to try in COPR for May 2020.md new file mode 100644 index 0000000000..d1b4801083 --- /dev/null +++ b/sources/tech/20200504 4 cool new projects to try in COPR for May 2020.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 cool new projects to try in COPR for May 2020) +[#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2020/) +[#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) + +4 cool new projects to try in COPR for May 2020 +====== + +![][1] + +COPR is a [collection][2] of personal repositories for software that isn’t carried in Fedora. Some software doesn’t conform to standards that allow easy packaging. Or it may not meet other Fedora standards, despite being free and open source. COPR can offer these projects outside the Fedora set of packages. Software in COPR isn’t supported by Fedora infrastructure or signed by the project. However, it can be a neat way to try new or experimental software. + +This article presents a few new and interesting projects in COPR. If you’re new to using COPR, see the [COPR User Documentation][3] for how to get started. + +### Ytop + +[Ytop][4] is a command-line system monitor similar to _htop_. The main difference between them is that _ytop_, on top of showing processes and their CPU and memory usage, shows graphs of system CPU, memory, and network usage over time. Additionally, _ytop_ shows disk usage and temperatures of the machine. Finally, _ytop_ supports multiple color schemes as well as an option to create new ones. + +![][5] + +#### Installation instructions + +The [repo][6] currently provides _ytop_ for Fedora 30, 31, 32, and Rawhide, as well as EPEL 7. To install _ytop_, use these commands [with _sudo_][7]: + +``` +sudo dnf copr enable atim/ytop +sudo dnf install ytop +``` + +### Ctop + +[Ctop][8] is yet another command-line system monitor. However, unlike _htop_ and _ytop_, _ctop_ focuses on showing resource usage of containers. _Ctop_ shows both an overview of CPU, memory, network and disk usage of all containers running on your machine, and more comprehensive information about a single container, including graphs of resource usage over time. Currently, _ctop_ has support for Docker and runc containers. + +![][9] + +#### Installation instructions + +The [repo][10] currently provides _ctop_ for Fedora 31, 32 and Rawhide, EPEL 7, as well as for other distributions. To install _ctop_, use these commands: + +``` +sudo dnf copr enable fuhrmann/ctop +sudo dnf install ctop +``` + +### Shortwave + +[Shortwave][11] is a program for listening to radio stations. Shortwave uses a community database of radio stations [www.radio-browser.info][12]. In this database, you can discover or search for radio stations, add them to your library, and listen to them. Additionally, Shortwave provides information about currently playing song and can record the songs as well. + +![][13] + +#### Installation instructions + +The [repo][14] currently provides Shortwave for Fedora 31, 32, and Rawhide. To install Shortwave, use these commands: + +``` +sudo dnf copr enable atim/shortwave +sudo dnf install shortwave +``` + +### Setzer + +[Setzer][15] is a LaTeX editor that can build pdf documents and view them as well. It provides templates for various types of documents, such as articles or presentation slides. Additionally, Setzer has buttons for a lot of special symbols, math symbols and greek letters. + +![][16] + +#### Installation instructions + +The [repo][17] currently provides Setzer for Fedora 30, 31, 32, and Rawhide. To install Setzer, use these commands: + +``` +sudo dnf copr enable lyessaadi/setzer +sudo dnf install setzer +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2020/ + +作者:[Dominik Turecek][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/dturecek/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg +[2]: https://copr.fedorainfracloud.org/ +[3]: https://docs.pagure.org/copr.copr/user_documentation.html# +[4]: https://github.com/cjbassi/ytop +[5]: https://fedoramagazine.org/wp-content/uploads/2020/04/ytop.png +[6]: https://copr.fedorainfracloud.org/coprs/atim/ytop/ +[7]: https://fedoramagazine.org/howto-use-sudo/ +[8]: https://github.com/bcicen/ctop +[9]: https://fedoramagazine.org/wp-content/uploads/2020/04/ctop.png +[10]: https://copr.fedorainfracloud.org/coprs/fuhrmann/ctop/ +[11]: https://github.com/ranfdev/shortwave +[12]: http://www.radio-browser.info/gui/#!/ +[13]: https://fedoramagazine.org/wp-content/uploads/2020/04/shortwave.png +[14]: https://copr.fedorainfracloud.org/coprs/atim/shortwave/ +[15]: https://www.cvfosammmm.org/setzer/ +[16]: https://fedoramagazine.org/wp-content/uploads/2020/04/setzer.png +[17]: https://copr.fedorainfracloud.org/coprs/lyessaadi/setzer/ From 5b41bb1e3dff2f6762798b165d21cdb5f306f732 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 5 May 2020 00:54:10 +0800 Subject: [PATCH 0596/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200505=20Brow?= =?UTF-8?q?se=20the=20Peer-to-peer=20Web=20With=20Beaker=20Browser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md --- ...he Peer-to-peer Web With Beaker Browser.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sources/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md diff --git a/sources/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md b/sources/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md new file mode 100644 index 0000000000..82129f00a5 --- /dev/null +++ b/sources/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md @@ -0,0 +1,124 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Browse the Peer-to-peer Web With Beaker Browser) +[#]: via: (https://itsfoss.com/beaker-browser/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Browse the Peer-to-peer Web With Beaker Browser +====== + +The Internet as we know it has existed unchanged (more or less) for the last 50 years. People across the globe use their devices to retrieve data from huge servers dotted around the world. + +A group of dedicated technologists wants to change that to make the internet a place where people can connect and share information directly instead of relying on a central server (decentralization). + +There are a bunch of such decentralized services that we have already covered on It’s FOSS. [LBRY as YouTube alternative][1], [Mastodon as Twitter alternative][2] are just a couple of such examples. + +And today I am going to cover another such product called [Beaker Browser][3] which is essentially for browsing the peer to peer web. + +![Beaker Browser][4] + +### What is the ‘peer-to-peer Web’? + +According to [one of the devs][5] behind the Beaker browser, “The P2P Web is an experimental set of technologies…to give users more control over the Web.” + +Further, they say that the peer-to-peer Web has three main principles: anybody can be a server; multiple computers can serve the same site; there is no back end. + +As you can see from those principles. the idea of the peer-to-peer Web is very similar to BitTorrent where files are seeded by multiple peers and those peers share the bandwidth load. This reduces the overall bandwidth that a person needs to provide for their site. + +![Beaker Browser Settings][6] + +The other major part of the peer-to-peer Web is creator control of their ideas. In this day and age, platforms being controlled by large corporations, who try to use your data for their benefit. Beaker returns control to the content creators. + +### Browsing the decentralized web with Beaker + +The [Beaker Browser][3] first came into existence in 2016. The project (and the technology that surrounds it) is created by a team of three at [Blue Link Labs][7]. The Beaker Browser uses the [Dat protocol][8] to share data between computers. All websites that use the Dat protocol start with `dat://` instead of `http://`. + +The strengths of the Dat protocol are: + + * Fast – Archives sync from multiple sources at once. + * Secure – All updates are signed and integrity-checked. + * Resilient – Archives can change hosts without changing their URLs. + * Versioned – Changes are written to an append-only version log. + * Decentralized – Any device can host any archive. + + + +![Beaker Browser Seeding][9] + +The Beaker Browser is essentially a cut down version of Chromium with built-in support for `dat://`addresses. It can still visit regular `http://` sites. + +Each time you visit a dat site, the content for that site is downloaded to your computer as you request it. For example, a picture of Linux Torvalds on the about page of a site is not downloaded until you navigate to that page. + +Also, once you visit a dat website, “[you temporarily][10] re-upload or seed whichever files you’ve downloaded from the website.” You can also choose to seed the website to help its creator. + +![Beaker Browser Menu][11] + +Since the whole idea of Beaker is to create a more open web, you can easily view the source of any website. Unlike most browsers where you just see the source code the current page, you are viewing, Beaker shows you the entire structure of the site in a GitHub-like view. You can even fork the site and host your version of it. + +Besides visiting dat-based websites, you can also create your own site. In the Beaker Browser menu, there is an option to create a new website or an empty project. If you select the option to create a new website, Beaker will build a little demo site that you can edit with the browser’s built-in editor. + +However, if you are like me and prefer to use Markdown, you can choose to create an empty project. Beaker will create the structure of a site and assign it a `dat://`address. Create an `index.md` file and you are good to go. There is a [short tutorial][12] with more info. You can also use the create empty project option to build a web app. + +![Beaker Browser Website Template][13] + +Since Beaker acts as a web server and site seeder, any time you close it or turn off your computer your site will become unavailable. Thankfully, you don’t have to run your computer or the browser constantly. You can also use a seeding service named [Hashbase][14] or you can set up a [`homebase`][15] seeding server. + +Though Beaker is [available][16] for Linux, Windows, and macOS. If you do start playing around Beaker, be sure to take a quick look at [their gui][17][d][17][es][17]. + +### Beaker Browser is not for everyone but it has a purpose + +When I first got this assignment, I had high hopes for the Beaker Browser. As it stands now, it’s still very experimental. A number of the dat sites that I tried to visit were unavailable because the user was not seeding their site. Beaker does have an option to notify you when that site is back online. + +![Beaker Browser No Peer][18] + +Another problem is that Beaker is a really stripped down version of Chromium. There is no option to install extensions or themes. Instead, you are stuck with a white theme and a very limited toolset. I would not use this as my main browser and having access to the world of dat websites is not enough of a reason to keep it installed on my system. + +I looked to see if there is an extension for Firefox that would add support for the `dat://` protocol. I did find such an extension, but it also required the installation of a couple of other pieces of software. It’s just easier to install Beaker. + +As it stands now, Beaker is not for me. Maybe in the future, more people will start using Beaker or the dat protocol will gain support by other browsers. Then it might be interesting. Right now, it’s kinda empty. + +As part of my time with Beaker, I created a [website][19] using the built-in tools. Don’t worry, I made sure that it’s seeded. + +![Beaker Bowser Site Source][20] + +What are your thoughts on the Beaker Brower? What are your thoughts on the peer-to-peer web? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News, or [Reddit][21]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/beaker-browser/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/lbry/ +[2]: https://itsfoss.com/mastodon-open-source-alternative-twitter/ +[3]: https://beakerbrowser.com/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-browser.jpg?resize=800%2C426&ssl=1 +[5]: https://pfrazee.hashbase.io/blog/what-is-the-p2p-web +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-bowser-setting.jpg?resize=800%2C573&ssl=1 +[7]: https://bluelinklabs.com/ +[8]: https://www.datprotocol.com/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-bowser-seedding.jpg?resize=800%2C466&ssl=1 +[10]: https://beakerbrowser.com/docs/faq/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-browser-menu.jpg?ssl=1 +[12]: https://beakerbrowser.com/docs/guides/create-a-markdown-site +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-browser-website-template.jpg?resize=800%2C459&ssl=1 +[14]: https://hashbase.io/ +[15]: https://github.com/beakerbrowser/homebase +[16]: https://beakerbrowser.com/install/ +[17]: https://beakerbrowser.com/docs/guides/ +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-browser-no-peer.jpg?resize=800%2C424&ssl=1 +[19]: https://41bfbd06731e8d9c5d5676e8145069c69b254e7a3b710ddda4f6e9804529690c/ +[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-bowser-source.jpg?resize=800%2C544&ssl=1 +[21]: https://reddit.com/r/linuxusersgroup From dda8976c94bbbf30066d4b8e6e720802a1e165fb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 5 May 2020 00:55:05 +0800 Subject: [PATCH 0597/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200504=20Unde?= =?UTF-8?q?rstanding=20systemd=20at=20startup=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200504 Understanding systemd at startup on Linux.md --- ...derstanding systemd at startup on Linux.md | 445 ++++++++++++++++++ 1 file changed, 445 insertions(+) create mode 100644 sources/tech/20200504 Understanding systemd at startup on Linux.md diff --git a/sources/tech/20200504 Understanding systemd at startup on Linux.md b/sources/tech/20200504 Understanding systemd at startup on Linux.md new file mode 100644 index 0000000000..2d0a5ef7b6 --- /dev/null +++ b/sources/tech/20200504 Understanding systemd at startup on Linux.md @@ -0,0 +1,445 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Understanding systemd at startup on Linux) +[#]: via: (https://opensource.com/article/20/5/systemd-startup) +[#]: author: (David Both https://opensource.com/users/dboth) + +Understanding systemd at startup on Linux +====== +systemd's startup provides important clues to help you solve problems +when they occur. +![People at the start line of a race][1] + +In [_Learning to love systemd_][2], the first article in this series, I looked at systemd's functions and architecture and the controversy around its role as a replacement for the old SystemV init program and startup scripts. In this second article, I'll start exploring the files and tools that manage the Linux startup sequence. I'll explain the systemd startup sequence, how to change the default startup target (runlevel in SystemV terms), and how to manually switch to a different target without going through a reboot. + +I'll also look at two important systemd tools. The first is the **systemctl** command, which is the primary means of interacting with and sending commands to systemd. The second is **journalctl**, which provides access to the systemd journals that contain huge amounts of system history data such as kernel and service messages (both informational and error messages). + +Be sure to use a non-production system for testing and experimentation in this and future articles. Your test system needs to have a GUI desktop (such as Xfce, LXDE, Gnome, KDE, or another) installed. + +I wrote in my previous article that I planned to look at creating a systemd unit and adding it to the startup sequence in this article. Because this article became longer than I anticipated, I will hold that for the next article in this series. + +### Exploring Linux startup with systemd + +Before you can observe the startup sequence, you need to do a couple of things to make the boot and startup sequences open and visible. Normally, most distributions use a startup animation or splash screen to hide the detailed messages that would otherwise be displayed during a Linux host's startup and shutdown. This is called the Plymouth boot screen on Red Hat-based distros. Those hidden messages can provide a great deal of information about startup and shutdown to a sysadmin looking for information to troubleshoot a bug or to just learn about the startup sequence. You can change this using the GRUB (Grand Unified Boot Loader) configuration. + +The main GRUB configuration file is **/boot/grub2/grub.cfg**, but, because this file can be overwritten when the kernel version is updated, you do not want to change it. Instead, modify the **/etc/default/grub** file, which is used to modify the default settings of **grub.cfg**. + +Start by looking at the current, unmodified version of the **/etc/default/grub** file: + + +``` +[root@testvm1 ~]# cd /etc/default ; cat grub +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" +GRUB_DEFAULT=saved +GRUB_DISABLE_SUBMENU=true +GRUB_TERMINAL_OUTPUT="console" +GRUB_CMDLINE_LINUX="resume=/dev/mapper/fedora_testvm1-swap rd.lvm. +lv=fedora_testvm1/root rd.lvm.lv=fedora_testvm1/swap rd.lvm.lv=fedora_ +testvm1/usr rhgb quiet" +GRUB_DISABLE_RECOVERY="true" +[root@testvm1 default]# +``` + +Chapter 6 of the [GRUB documentation][3] contains a list of all the possible entries in the **/etc/default/grub** file, but I focus on the following: + + * I change **GRUB_TIMEOUT**, the number of seconds for the GRUB menu countdown, from five to 10 to give a bit more time to respond to the GRUB menu before the countdown hits zero. + * I delete the last two parameters on **GRUB_CMDLINE_LINUX**, which lists the command-line parameters that are passed to the kernel at boot time. One of these parameters, **rhgb** stands for Red Hat Graphical Boot, and it displays the little Fedora icon animation during the kernel initialization instead of showing boot-time messages. The other, the **quiet** parameter, prevents displaying the startup messages that document the progress of the startup and any errors that occur. I delete both **rhgb** and **quiet** because sysadmins need to see these messages. If something goes wrong during boot, the messages displayed on the screen can point to the cause of the problem. + + + +After you make these changes, your GRUB file will look like: + + +``` +[root@testvm1 default]# cat grub +GRUB_TIMEOUT=10 +GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" +GRUB_DEFAULT=saved +GRUB_DISABLE_SUBMENU=true +GRUB_TERMINAL_OUTPUT="console" +GRUB_CMDLINE_LINUX="resume=/dev/mapper/fedora_testvm1-swap rd.lvm. +lv=fedora_testvm1/root rd.lvm.lv=fedora_testvm1/swap rd.lvm.lv=fedora_ +testvm1/usr" +GRUB_DISABLE_RECOVERY="false" +[root@testvm1 default]# +``` + +The **grub2-mkconfig** program generates the **grub.cfg** configuration file using the contents of the **/etc/default/grub** file to modify some of the default GRUB settings. The **grub2-mkconfig** program sends its output to **STDOUT**. It has a **-o** option that allows you to specify a file to send the datastream to, but it is just as easy to use redirection. Run the following command to update the **/boot/grub2/grub.cfg** configuration file: + + +``` +[root@testvm1 grub2]# grub2-mkconfig > /boot/grub2/grub.cfg +Generating grub configuration file ... +Found linux image: /boot/vmlinuz-4.18.9-200.fc28.x86_64 +Found initrd image: /boot/initramfs-4.18.9-200.fc28.x86_64.img +Found linux image: /boot/vmlinuz-4.17.14-202.fc28.x86_64 +Found initrd image: /boot/initramfs-4.17.14-202.fc28.x86_64.img +Found linux image: /boot/vmlinuz-4.16.3-301.fc28.x86_64 +Found initrd image: /boot/initramfs-4.16.3-301.fc28.x86_64.img +Found linux image: /boot/vmlinuz-0-rescue-7f12524278bd40e9b10a085bc82dc504 +Found initrd image: /boot/initramfs-0-rescue-7f12524278bd40e9b10a085bc82dc504.img +done +[root@testvm1 grub2]# +``` + +Reboot your test system to view the startup messages that would otherwise be hidden behind the Plymouth boot animation. But what if you need to view the startup messages and have not disabled the Plymouth boot animation? Or you have, but the messages stream by too fast to read? (Which they do.) + +There are a couple of options, and both involve log files and systemd journals—which are your friends. You can use the **less** command to view the contents of the **/var/log/messages** file. This file contains boot and startup messages as well as messages generated by the operating system during normal operation. You can also use the **journalctl** command without any options to view the systemd journal, which contains essentially the same information: + + +``` +[root@testvm1 grub2]# journalctl +\-- Logs begin at Sat 2020-01-11 21:48:08 EST, end at Fri 2020-04-03 08:54:30 EDT. -- +Jan 11 21:48:08 f31vm.both.org kernel: Linux version 5.3.7-301.fc31.x86_64 ([mockbuild@bkernel03.phx2.fedoraproject.org][4]) (gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)) #1 SMP Mon Oct > +Jan 11 21:48:08 f31vm.both.org kernel: Command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.3.7-301.fc31.x86_64 root=/dev/mapper/VG01-root ro resume=/dev/mapper/VG01-swap rd.lvm.lv=VG01/root rd> +Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' +Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' +Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' +Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256 +Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format. +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-provided physical RAM map: +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x0000000000100000-0x00000000dffeffff] usable +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000dfff0000-0x00000000dfffffff] ACPI data +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x0000000100000000-0x000000041fffffff] usable +Jan 11 21:48:08 f31vm.both.org kernel: NX (Execute Disable) protection: active +Jan 11 21:48:08 f31vm.both.org kernel: SMBIOS 2.5 present. +Jan 11 21:48:08 f31vm.both.org kernel: DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 +Jan 11 21:48:08 f31vm.both.org kernel: Hypervisor detected: KVM +Jan 11 21:48:08 f31vm.both.org kernel: kvm-clock: Using msrs 4b564d01 and 4b564d00 +Jan 11 21:48:08 f31vm.both.org kernel: kvm-clock: cpu 0, msr 30ae01001, primary cpu clock +Jan 11 21:48:08 f31vm.both.org kernel: kvm-clock: using sched offset of 8250734066 cycles +Jan 11 21:48:08 f31vm.both.org kernel: clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns +Jan 11 21:48:08 f31vm.both.org kernel: tsc: Detected 2807.992 MHz processor +Jan 11 21:48:08 f31vm.both.org kernel: e820: update [mem 0x00000000-0x00000fff] usable ==> reserved +Jan 11 21:48:08 f31vm.both.org kernel: e820: remove [mem 0x000a0000-0x000fffff] usable +<snip> +``` + +I truncated this datastream because it can be hundreds of thousands or even millions of lines long. (The journal listing on my primary workstation is 1,188,482 lines long.) Be sure to try this on your test system. If it has been running for some time—even if it has been rebooted many times—huge amounts of data will be displayed. Explore this journal data because it contains a lot of information that can be very useful when doing problem determination. Knowing what this data looks like for a normal boot and startup can help you locate problems when they occur. + +I will discuss systemd journals, the **journalctl** command, and how to sort through all of that data to find what you want in more detail in a future article in this series. + +After GRUB loads the kernel into memory, it must first extract itself from the compressed version of the file before it can perform any useful work. After the kernel has extracted itself and started running, it loads systemd and turns control over to it. + +This is the end of the boot process. At this point, the Linux kernel and systemd are running but unable to perform any productive tasks for the end user because nothing else is running, there's no shell to provide a command line, no background processes to manage the network or other communication links, and nothing that enables the computer to perform any productive function. + +Systemd can now load the functional units required to bring the system up to a selected target run state. + +### Targets + +A systemd target represents a Linux system's current or desired run state. Much like SystemV start scripts, targets define the services that must be present for the system to run and be active in that state. Figure 1 shows the possible run-state targets of a Linux system using systemd. As seen in the first article of this series and in the systemd bootup man page (man bootup), there are other intermediate targets that are required to enable various necessary services. These can include **swap.target**, **timers.target**, **local-fs.target**, and more. Some targets (like **basic.target**) are used as checkpoints to ensure that all the required services are up and running before moving on to the next-higher level target. + +Unless otherwise changed at boot time in the GRUB menu, systemd always starts the **default.target**. The **default.target** file is a symbolic link to the true target file. For a desktop workstation, this is typically going to be the **graphical.target**, which is equivalent to runlevel 5 in SystemV. For a server, the default is more likely to be the **multi-user.target**, which is like runlevel 3 in SystemV. The **emergency.target** file is similar to single-user mode. Targets and services are systemd units. + +The following table, which I included in the previous article in this series, compares the systemd targets with the old SystemV startup runlevels. The systemd target aliases are provided by systemd for backward compatibility. The target aliases allow scripts—and sysadmins—to use SystemV commands like **init 3** to change runlevels. Of course, the SystemV commands are forwarded to systemd for interpretation and execution. + +**systemd targets** | **SystemV runlevel** | **target aliases** | **Description** +---|---|---|--- +default.target | | | This target is always aliased with a symbolic link to either **multi-user.target** or **graphical.target**. systemd always uses the **default.target** to start the system. The **default.target** should never be aliased to **halt.target**, **poweroff.target**, or **reboot.target**. +graphical.target | 5 | runlevel5.target | **Multi-user.target** with a GUI +| 4 | runlevel4.target | Unused. Runlevel 4 was identical to runlevel 3 in the SystemV world. This target could be created and customized to start local services without changing the default **multi-user.target**. +multi-user.target | 3 | runlevel3.target | All services running, but command-line interface (CLI) only +| 2 | runlevel2.target | Multi-user, without NFS, but all other non-GUI services running +rescue.target | 1 | runlevel1.target | A basic system, including mounting the filesystems with only the most basic services running and a rescue shell on the main console +emergency.target | S | | Single-user mode—no services are running; filesystems are not mounted. This is the most basic level of operation with only an emergency shell running on the main console for the user to interact with the system. +halt.target | | | Halts the system without powering it down +reboot.target | 6 | runlevel6.target | Reboot +poweroff.target | 0 | runlevel0.target | Halts the system and turns the power off + +Each target has a set of dependencies described in its configuration file. systemd starts the required dependencies, which are the services required to run the Linux host at a specific level of functionality. When all of the dependencies listed in the target configuration files are loaded and running, the system is running at that target level. If you want, you can review the systemd startup sequence and runtime targets in the first article in this series, [_Learning to love systemd_][2]. + +### Exploring the current target + +Many Linux distributions default to installing a GUI desktop interface so that the installed systems can be used as workstations. I always install from a Fedora Live boot USB drive with an Xfce or LXDE desktop. Even when I'm installing a server or other infrastructure type of host (such as the ones I use for routers and firewalls), I use one of these installations that installs a GUI desktop. + +I could install a server without a desktop (and that would be typical for data centers), but that does not meet my needs. It is not that I need the GUI desktop itself, but the LXDE installation includes many of the other tools I use that are not in a default server installation. This means less work for me after the initial installation. + +But just because I have a GUI desktop does not mean it makes sense to use it. I have a 16-port KVM that I can use to access the KVM interfaces of most of my Linux systems, but the vast majority of my interaction with them is via a remote SSH connection from my primary workstation. This way is more secure and uses fewer system resources to run **multi-user.target** compared to **graphical.target.** + +To begin, check the default target to verify that it is the **graphical.target**: + + +``` +[root@testvm1 ~]# systemctl get-default +graphical.target +[root@testvm1 ~]# +``` + +Now verify the currently running target. It should be the same as the default target. You can still use the old method, which displays the old SystemV runlevels. Note that the previous runlevel is on the left; it is **N** (which means None), indicating that the runlevel has not changed since the host was booted. The number 5 indicates the current target, as defined in the old SystemV terminology: + + +``` +[root@testvm1 ~]# runlevel +N 5 +[root@testvm1 ~]# +``` + +Note that the runlevel man page indicates that runlevels are obsolete and provides a conversion table. + +You can also use the systemd method. There is no one-line answer here, but it does provide the answer in systemd terms: + + +``` +[root@testvm1 ~]# systemctl list-units --type target +UNIT                   LOAD   ACTIVE SUB    DESCRIPTION                 +basic.target           loaded active active Basic System               +cryptsetup.target      loaded active active Local Encrypted Volumes     +getty.target           loaded active active Login Prompts               +graphical.target       loaded active active Graphical Interface         +local-fs-pre.target    loaded active active Local File Systems (Pre)   +local-fs.target        loaded active active Local File Systems         +multi-user.target      loaded active active Multi-User System           +network-online.target  loaded active active Network is Online           +network.target         loaded active active Network                     +nfs-client.target      loaded active active NFS client services         +nss-user-lookup.target loaded active active User and Group Name Lookups +paths.target           loaded active active Paths                       +remote-fs-pre.target   loaded active active Remote File Systems (Pre)   +remote-fs.target       loaded active active Remote File Systems         +rpc_pipefs.target      loaded active active rpc_pipefs.target           +slices.target          loaded active active Slices                     +sockets.target         loaded active active Sockets                     +sshd-keygen.target     loaded active active sshd-keygen.target         +swap.target            loaded active active Swap                       +sysinit.target         loaded active active System Initialization       +timers.target          loaded active active Timers                     + +LOAD   = Reflects whether the unit definition was properly loaded. +ACTIVE = The high-level unit activation state, i.e. generalization of SUB. +SUB    = The low-level unit activation state, values depend on unit type. + +21 loaded units listed. Pass --all to see loaded but inactive units, too. +To show all installed unit files use 'systemctl list-unit-files'. +``` + +This shows all of the currently loaded and active targets. You can also see the **graphical.target** and the **multi-user.target**. The **multi-user.target** is required before the **graphical.target** can be loaded. In this example, the **graphical.target** is active. + +### Switching to a different target + +Making the switch to the **multi-user.target** is easy: + + +``` +`[root@testvm1 ~]# systemctl isolate multi-user.target` +``` + +The display should now change from the GUI desktop or login screen to a virtual console. Log in and list the currently active systemd units to verify that **graphical.target** is no longer running: + + +``` +`[root@testvm1 ~]# systemctl list-units --type target` +``` + +Be sure to use the **runlevel** command to verify that it shows both previous and current "runlevels": + + +``` +[root@testvm1 ~]# runlevel +5 3 +``` + +### Changing the default target + +Now, change the default target to the **multi-user.target** so that it will always boot into the **multi-user.target** for a console command-line interface rather than a GUI desktop interface. As the root user on your test host, change to the directory where the systemd configuration is maintained and do a quick listing: + + +``` +[root@testvm1 ~]# cd /etc/systemd/system/ ; ll +drwxr-xr-x. 2 root root 4096 Apr 25  2018  basic.target.wants +<snip> +lrwxrwxrwx. 1 root root   36 Aug 13 16:23  default.target -> /lib/systemd/system/graphical.target +lrwxrwxrwx. 1 root root   39 Apr 25  2018  display-manager.service -> /usr/lib/systemd/system/lightdm.service +drwxr-xr-x. 2 root root 4096 Apr 25  2018  getty.target.wants +drwxr-xr-x. 2 root root 4096 Aug 18 10:16  graphical.target.wants +drwxr-xr-x. 2 root root 4096 Apr 25  2018  local-fs.target.wants +drwxr-xr-x. 2 root root 4096 Oct 30 16:54  multi-user.target.wants +<snip> +[root@testvm1 system]# +``` + +I shortened this listing to highlight a few important things that will help explain how systemd manages the boot process. You should be able to see the entire list of directories and links on your virtual machine. + +The **default.target** entry is a symbolic link (symlink, soft link) to the directory **/lib/systemd/system/graphical.target**. List that directory to see what else is there: + + +``` +`[root@testvm1 system]# ll /lib/systemd/system/ | less` +``` + +You should see files, directories, and more links in this listing, but look specifically for **multi-user.target** and **graphical.target**. Now display the contents of **default.target**, which is a link to **/lib/systemd/system/graphical.target**: + + +``` +[root@testvm1 system]# cat default.target +#  SPDX-License-Identifier: LGPL-2.1+ +# +#  This file is part of systemd. +# +#  systemd is free software; you can redistribute it and/or modify it +#  under the terms of the GNU Lesser General Public License as published by +#  the Free Software Foundation; either version 2.1 of the License, or +#  (at your option) any later version. + +[Unit] +Description=Graphical Interface +Documentation=man:systemd.special(7) +Requires=multi-user.target +Wants=display-manager.service +Conflicts=rescue.service rescue.target +After=multi-user.target rescue.service rescue.target display-manager.service +AllowIsolate=yes +[root@testvm1 system]# +``` + +This link to the **graphical.target** file describes all of the prerequisites and requirements that the graphical user interface requires. I will explore at least some of these options in the next article in this series. + +To enable the host to boot to multi-user mode, you need to delete the existing link and create a new one that points to the correct target. Make the [PWD][5] **/etc/systemd/system**, if it is not already: + + +``` +[root@testvm1 system]# rm -f default.target +[root@testvm1 system]# ln -s /lib/systemd/system/multi-user.target default.target +``` + +List the **default.target** link to verify that it links to the correct file: + + +``` +[root@testvm1 system]# ll default.target +lrwxrwxrwx 1 root root 37 Nov 28 16:08 default.target -> /lib/systemd/system/multi-user.target +[root@testvm1 system]# +``` + +If your link does not look exactly like this, delete it and try again. List the content of the **default.target** link: + + +``` +[root@testvm1 system]# cat default.target +#  SPDX-License-Identifier: LGPL-2.1+ +# +#  This file is part of systemd. +# +#  systemd is free software; you can redistribute it and/or modify it +#  under the terms of the GNU Lesser General Public License as published by +#  the Free Software Foundation; either version 2.1 of the License, or +#  (at your option) any later version. + +[Unit] +Description=Multi-User System +Documentation=man:systemd.special(7) +Requires=basic.target +Conflicts=rescue.service rescue.target +After=basic.target rescue.service rescue.target +AllowIsolate=yes +[root@testvm1 system]# +``` + +The **default.target**—which is really a link to the **multi-user.target** at this point—now has different requirements in the **[Unit]** section. It does not require the graphical display manager. + +Reboot. Your virtual machine should boot to the console login for virtual console 1, which is identified on the display as tty1. Now that you know how to change the default target, change it back to the **graphical.target** using a command designed for the purpose. + +First, check the current default target: + + +``` +[root@testvm1 ~]# systemctl get-default +multi-user.target +[root@testvm1 ~]# systemctl set-default graphical.target +Removed /etc/systemd/system/default.target. +Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/graphical.target. +[root@testvm1 ~]# +``` + +Enter the following command to go directly to the **graphical.target** and the display manager login page without having to reboot: + + +``` +`[root@testvm1 system]# systemctl isolate default.target` +``` + +I do not know why the term "isolate" was chosen for this sub-command by systemd's developers. My research indicates that it may refer to running the specified target but "isolating" and terminating all other targets that are not required to support the target. However, the effect is to switch targets from one run target to another—in this case, from the multi-user target to the graphical target. The command above is equivalent to the old init 5 command in SystemV start scripts and the init program. + +Log into the GUI desktop, and verify that it is working as it should. + +### Summing up + +This article explored the Linux systemd startup sequence and started to explore two important systemd tools, **systemctl** and **journalctl**. It also explained how to switch from one target to another and to change the default target. + +The next article in this series will create a new systemd unit and configure it to run during startup. It will also look at some of the configuration options that help determine where in the sequence a particular unit will start, for example, after networking is up and running. + +### Resources + +There is a great deal of information about systemd available on the internet, but much is terse, obtuse, or even misleading. In addition to the resources mentioned in this article, the following webpages offer more detailed and reliable information about systemd startup. + + * The Fedora Project has a good, practical [guide][6] [to systemd][6]. It has pretty much everything you need to know in order to configure, manage, and maintain a Fedora computer using systemd. + * The Fedora Project also has a good [cheat sheet][7] that cross-references the old SystemV commands to comparable systemd ones. + * For detailed technical information about systemd and the reasons for creating it, check out [Freedesktop.org][8]'s [description of systemd][9]. + * [Linux.com][10]'s "More systemd fun" offers more advanced systemd [information and tips][11]. + + + +There is also a series of deeply technical articles for Linux sysadmins by Lennart Poettering, the designer and primary developer of systemd. These articles were written between April 2010 and September 2011, but they are just as relevant now as they were then. Much of everything else good that has been written about systemd and its ecosystem is based on these papers. + + * [Rethinking PID 1][12] + * [systemd for Administrators, Part I][13] + * [systemd for Administrators, Part II][14] + * [systemd for Administrators, Part III][15] + * [systemd for Administrators, Part IV][16] + * [systemd for Administrators, Part V][17] + * [systemd for Administrators, Part VI][18] + * [systemd for Administrators, Part VII][19] + * [systemd for Administrators, Part VIII][20] + * [systemd for Administrators, Part IX][21] + * [systemd for Administrators, Part X][22] + * [systemd for Administrators, Part XI][23] + + + +Alison Chiaken, a Linux kernel and systems programmer at Mentor Graphics, offers a preview of her... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/systemd-startup + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/start_line.jpg?itok=9reaaW6m (People at the start line of a race) +[2]: https://opensource.com/article/20/4/systemd +[3]: http://www.gnu.org/software/grub/manual/grub +[4]: mailto:mockbuild@bkernel03.phx2.fedoraproject.org +[5]: https://en.wikipedia.org/wiki/Pwd +[6]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html +[7]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet +[8]: http://Freedesktop.org +[9]: http://www.freedesktop.org/wiki/Software/systemd +[10]: http://Linux.com +[11]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ +[12]: http://0pointer.de/blog/projects/systemd.html +[13]: http://0pointer.de/blog/projects/systemd-for-admins-1.html +[14]: http://0pointer.de/blog/projects/systemd-for-admins-2.html +[15]: http://0pointer.de/blog/projects/systemd-for-admins-3.html +[16]: http://0pointer.de/blog/projects/systemd-for-admins-4.html +[17]: http://0pointer.de/blog/projects/three-levels-of-off.html +[18]: http://0pointer.de/blog/projects/changing-roots +[19]: http://0pointer.de/blog/projects/blame-game.html +[20]: http://0pointer.de/blog/projects/the-new-configuration-files.html +[21]: http://0pointer.de/blog/projects/on-etc-sysinit.html +[22]: http://0pointer.de/blog/projects/instances.html +[23]: http://0pointer.de/blog/projects/inetd.html From af3e2a3b0f259fa36d13ba2590ceaf744aca4760 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 5 May 2020 00:56:36 +0800 Subject: [PATCH 0598/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200504=20Defi?= =?UTF-8?q?ne=20and=20optimize=20data=20partitions=20in=20Apache=20Cassand?= =?UTF-8?q?ra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200504 Define and optimize data partitions in Apache Cassandra.md --- ...ize data partitions in Apache Cassandra.md | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 sources/tech/20200504 Define and optimize data partitions in Apache Cassandra.md diff --git a/sources/tech/20200504 Define and optimize data partitions in Apache Cassandra.md b/sources/tech/20200504 Define and optimize data partitions in Apache Cassandra.md new file mode 100644 index 0000000000..d28f0daee0 --- /dev/null +++ b/sources/tech/20200504 Define and optimize data partitions in Apache Cassandra.md @@ -0,0 +1,150 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Define and optimize data partitions in Apache Cassandra) +[#]: via: (https://opensource.com/article/20/5/apache-cassandra) +[#]: author: (Anil Inamdar https://opensource.com/users/anil-inamdar) + +Define and optimize data partitions in Apache Cassandra +====== +Apache Cassandra is built for speed and scalability; here's how to get +the most out of those benefits. +![Person standing in front of a giant computer screen with numbers, data][1] + +Apache Cassandra is a database. But it's not just any database; it's a replicating database designed and tuned for scalability, high availability, low-latency, and performance. Cassandra can help your data survive regional outages, hardware failure, and what many admins would consider excessive amounts of data. + +Having a thorough command of data partitions enables you to achieve superior Cassandra cluster design, performance, and scalability. In this article, I'll examine how to define partitions and how Cassandra uses them, as well as the most critical best practices and known issues you ought to be aware of. + +To set the scene: partitions are chunks of data that serve as the atomic unit for key database-related functions like data distribution, replication, and indexing. Distributed data systems commonly distribute incoming data into these partitions, performing the partitioning with simple mathematical functions such as identity or hashing, and using a "partition key" to group data by partition. For example, consider a case where server logs arrive as incoming data. Using the "identity" partitioning function and the timestamps of each log (rounded to the hour value) for the partition key, we can partition this data such that each partition holds one hour of the logs. + +### Data partitions in Cassandra + +Cassandra operates as a distributed system and adheres to the data partitioning principles described above. With Cassandra, data partitioning relies on an algorithm configured at the cluster level, and a partition key configured at the table level. + +![Cassandra data partition][2] + +Cassandra Query Language (CQL) uses the familiar SQL table, row, and column terminologies. In the example diagram above, the table configuration includes the partition key within its primary key, with the format: Primary Key = Partition Key + [Clustering Columns]. + +A primary key in Cassandra represents both a unique data partition and a data arrangement inside a partition. Data arrangement information is provided by optional clustering columns. Each unique partition key represents a set of table rows managed in a server, as well as all servers that manage its replicas. + +### Defining primary keys in CQL + +The following four examples demonstrate how a primary key can be represented in CQL syntax. The sets of rows produced by these definitions are generally considered a partition. + +#### Definition 1 (partition key: log_hour, clustering columns: none) + + +``` +CREATE TABLE server_logs( +   log_hour TIMESTAMP PRIMARYKEY, +   log_level text, +   message text, +   server text +   ) +``` + +Here, all rows that share a **log_hour** go into the same partition. + +#### Definition 2 (partition key: log_hour, clustering columns: log_level) + + +``` +CREATE TABLE server_logs( +   log_hour TIMESTAMP, +   log_level text, +   message text, +   server text, +   PRIMARY KEY (log_hour, log_level) +   ) +``` + +This definition uses the same partition key as Definition 1, but here all rows in each partition are arranged in ascending order by **log_level**. + +#### Definition 3 (partition key: log_hour, server, clustering columns: none) + + +``` +CREATE TABLE server_logs( +   log_hour TIMESTAMP, +   log_level text, +   message text, +   server text, +   PRIMARY KEY ((log_hour, server)) +   ) +``` + +In this definition, all rows share a **log_hour** for each distinct **server** as a single partition. + +#### Definition 4 (partition key: log_hour, server, clustering columns: log_level) + + +``` +CREATE TABLE server_logs( +   log_hour TIMESTAMP, +   log_level text, +   message text, +   server text, +   PRIMARY KEY ((log_hour, server),log_level) +   )WITH CLUSTERING ORDER BY (column3 DESC); +``` + +This definition uses the same partition as Definition 3 but arranges the rows within a partition in descending order by **log_level**. + +### How Cassandra uses the partition key + +Cassandra relies on the partition key to determine which node to store data on and where to locate data when it's needed. Cassandra performs these read and write operations by looking at a partition key in a table, and using tokens (a long value out of range -2^63 to +2^63-1) for data distribution and indexing. These tokens are mapped to partition keys by using a partitioner, which applies a partitioning function that converts any partition key to a token. Through this token mechanism, every node of a Cassandra cluster owns a set of data partitions. The partition key then enables data indexing on each node. + +![Cassandra cluster with 3 nodes and token-based ownership][3] + +A Cassandra cluster with three nodes and token-based ownership. This is a simplistic representation: the actual implementation uses [Vnodes][4]. + +### Data partition impacts on Cassandra clusters + +Careful partition key design is crucial to achieving the ideal partition size for the use case. Getting it right allows for even data distribution and strong I/O performance. Partition size has several impacts on Cassandra clusters you need to be aware of: + + * Read performance—In order to find partitions in SSTables files on disk, Cassandra uses data structures that include caches, indexes, and index summaries. Partitions that are too large reduce the efficiency of maintaining these data structures – and will negatively impact performance as a result. Cassandra releases have made strides in this area: in particular, version 3.6 and above of the Cassandra engine introduce storage improvements that deliver better performance for large partitions and resilience against memory issues and crashes. + * Memory usage— Large partitions place greater pressure on the JVM heap, increasing its size while also making the garbage collection mechanism less efficient. + * Cassandra repairs—Large partitions make it more difficult for Cassandra to perform its repair maintenance operations, which keep data consistent by comparing data across replicas. + * Tombstone eviction—Not as mean as it sounds, Cassandra uses unique markers known as "tombstones" to mark data for deletion. Large partitions can make that deletion process more difficult if there isn't an appropriate data deletion pattern and compaction strategy in place. + + + +While these impacts may make it tempting to simply design partition keys that yield especially small partitions, the data access pattern is also highly influential on ideal partition size (for more information, read this in-depth guide to [Cassandra data modeling][5]). The data access pattern can be defined as how a table is queried, including all of the table's **select** queries. Ideally, CQL select queries should have just one partition key in the **where** clause—that is to say, Cassandra is most efficient when queries can get needed data from a single partition, instead of many smaller ones. + +### Best practices for partition key design + +Following best practices for partition key design helps you get to an ideal partition size. As a rule of thumb, the maximum partition size in Cassandra should stay under 100MB. Ideally, it should be under 10MB. While Cassandra versions 3.6 and newer make larger partition sizes more viable, careful testing and benchmarking must be performed for each workload to ensure a partition key design supports desired cluster performance. + +Specifically, these best practices should be considered as part of any partition key design: + + * The goal for a partition key must be to fit an ideal amount of data into each partition for supporting the needs of its access pattern. + * A partition key should disallow unbounded partitions: those that may grow indefinitely in size over time. For instance, in the **server_logs** examples above, using the server column as a partition key would create unbounded partitions as the number of server logs continues to increase. In contrast, using **log_hour** limits each partition to an hour of data. + * A partition key should also avoid creating a partition skew, in which partitions grow unevenly, and some are able to grow without limit over time. In the **server_logs** examples, using the server column in a scenario where one server generates considerably more logs than others would produce a partition skew. To avoid this, a useful technique is to introduce another attribute from the table to force an even distribution, even if it's necessary to create a dummy column to do so. + * It's helpful to partition time-series data with a partition key that uses a time element as well as other attributes. This protects against unbounded partitions, enables access patterns to use the time attribute in querying specific data, and allows for time-bound data deletion. The examples above each demonstrate this by using the **log_hour** time attribute. + + + +Several tools are available to help test, analyze, and monitor Cassandra partitions to check that a chosen schema is efficient and effective. By carefully designing partition keys to align well with the data and needs of the solution at hand, and following best practices to optimize partition size, you can utilize data partitions that more fully deliver on the scalability and performance potential of a Cassandra deployment. + +Dani and Jon will give a three hour tutorial at OSCON this year called: Becoming friends with... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/apache-cassandra + +作者:[Anil Inamdar][a] +选题:[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/anil-inamdar +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) +[2]: https://opensource.com/sites/default/files/uploads/apache_cassandra_1_0.png (Cassandra data partition) +[3]: https://opensource.com/sites/default/files/uploads/apache_cassandra_2_0.png (Cassandra cluster with 3 nodes and token-based ownership) +[4]: https://www.instaclustr.com/cassandra-vnodes-how-many-should-i-use/ +[5]: https://www.instaclustr.com/resource/6-step-guide-to-apache-cassandra-data-modelling-white-paper/ From 748a4355a789e45127ff4708f1461671719c19d6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 5 May 2020 00:57:36 +0800 Subject: [PATCH 0599/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200504=20Crea?= =?UTF-8?q?te=20interactive=20learning=20games=20for=20kids=20with=20open?= =?UTF-8?q?=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200504 Create interactive learning games for kids with open source.md --- ...earning games for kids with open source.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/tech/20200504 Create interactive learning games for kids with open source.md diff --git a/sources/tech/20200504 Create interactive learning games for kids with open source.md b/sources/tech/20200504 Create interactive learning games for kids with open source.md new file mode 100644 index 0000000000..f6ade34857 --- /dev/null +++ b/sources/tech/20200504 Create interactive learning games for kids with open source.md @@ -0,0 +1,123 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create interactive learning games for kids with open source) +[#]: via: (https://opensource.com/article/20/5/jclic-games-kids) +[#]: author: (Peter Cheer https://opensource.com/users/petercheer) + +Create interactive learning games for kids with open source +====== +Help your students learn by creating fun puzzles and games in JClic, an +easy Java-based app. +![Family learning and reading together at night in a room][1] + +Schools are closed in many countries around the world to slow the spread of COVID-19. This has suddenly thrown many parents and teachers into homeschooling. Fortunately, there are plenty of educational resources on the internet to use or adapt, although their licenses vary. You can try searching for Creative Commons Open Educational Resources, but if you want to create your own materials, there are many options for that to. + +If you want to create digital educational activities with puzzles or tests, two easy-to-use, open source, cross-platform applications that fit the bill are eXeLearning and JClic. My earlier article on [eXeLearning][2] is a good introduction to that program, so here I'll look at [JClic][3]. It is an open source software project for creating various types of interactive activities such as associations, text-based activities, crosswords, and other puzzles with text, graphics, and multimedia elements. + +Although it's been around since the 1990s, JClic never developed a large user base in the English-speaking world. It was created in Catalonia by the [Catalan Educational Telematic Network][4] (XTEC). + +### About JClic + +JClic is a Java-based application that's available in many Linux repositories and can be downloaded from [GitHub][5]. It runs on Linux, macOS, and Windows, but because it is a Java program, you must have a Java runtime environment [installed][6]. + +The program's interface has not really changed much over the years, even while features have been added or dropped, such as introducing HTML5 export functionality to replace Java Applet technology for web-based deployment. It hasn't needed to change much, though, because it's very effective at what it does. + +### Creating a JClic project + +Many teachers from many countries have used JClic to create interactive materials for a wide variety of ability levels, subjects, languages, and curricula. Some of these materials have been collected in an [downloadable activities library][7]. Although few activities are in English, you can get a sense of the possibilities JClic offers. + +As JClic has a visual, point-and-click program interface, it is easy enough to learn that a new user can quickly concentrate on content creation. [Documentation][8] is available on GitHub. + +The screenshots below are from one of the JClic projects I created to teach basic Excel skills to learners in Papua New Guinea. + +A JClic project is created in its authoring tool and consists of the following four elements: + +#### 1\. Metadata about the project + +![JClic metadata][9] + +#### 2\. A library of the graphical and other resources it uses + +![JClic media][10] + +#### 3\. A series of one or more activities + +![JClic activities][11] + +JClic can produce seven different activity types: + + * Associations where the user discovers the relationships between two information sets + * Memory games where the user discovers pairs of identical elements or relations (which are hidden) between them + * Exploration activities involving the identification and information, based on a single Information set + * Puzzles where the user reconstructs information that is initially presented in a disordered form; the activity can include graphics, text, sound, or a combination of them + * Written-response activities that are solved by writing text, either a single word or a sentence + * Text activities that are based on words, phrases, letters, and paragraphs of text that need to be completed, understood, corrected, or ordered; these activities can contain images and windows with active content + * Word searches and crosswords + + + +Because of variants in the activities, there are 16 possible activity types. + +#### 4\. A timeline to sequence the activities + +![JClic timeline][12] + +### Using JClic content + +Projects can run in JClic's player (part of the Java application you used to create the project), or they can be exported to HTML5 so they can run in a web browser. + +The one thing I don't like about JClic is that its default HTML5 export function assumes you'll be online when running a project. If you want a project to work offline as needed, you must download a compiled and minified HTML5 player from [Github][13], and place it in the same folder as your JClic project. + +Next, open the **index.html** file in a text editor and replace this line: + + +``` +`` +``` + +With: + + +``` +`` +``` + +Now the HTML5 version of your project runs in a web browser, whether the user is online or not. + +JClic also provides a reports function that can store test scores in an ODBC-compliant database. I have not explored this feature, as my tests and puzzles are mostly used for self-assessment and to prompt reflection by the learner, rather than as part of a formal scheme, so the scores are not very important. If you would like to learn about it, there is [documentation][14] on running JClic Reports Server with Tomcat and MySQL (or [mariaDB][15]). + +### Conclusion + +JClic offers a wide range of activity types that provide plenty of room to be creative in designing content to fit your subject area and type of learner. JClic is a valuable addition for anyone who needs a quick and easy way to develop educational resources. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/jclic-games-kids + +作者:[Peter Cheer][a] +选题:[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/petercheer +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/family_learning_kids_night_reading.png?itok=6K7sJVb1 (Family learning and reading together at night in a room) +[2]: https://opensource.com/article/18/5/exelearning +[3]: https://clic.xtec.cat/legacy/en/jclic/index.html +[4]: https://clic.xtec.cat/legacy/en/index.html +[5]: https://github.com/projectestac/jclic +[6]: https://adoptopenjdk.net/installation.html +[7]: https://clic.xtec.cat/repo/ +[8]: https://github.com/projectestac/jclic/wiki/JClic_Guide +[9]: https://opensource.com/sites/default/files/uploads/metadata.png (JClic metadata) +[10]: https://opensource.com/sites/default/files/uploads/media.png (JClic media) +[11]: https://opensource.com/sites/default/files/uploads/activities.png (JClic activities) +[12]: https://opensource.com/sites/default/files/uploads/sequence.png (JClic timeline) +[13]: http://projectestac.github.io/jclic.js/ +[14]: https://github.com/projectestac/jclic/wiki/Jclic-Reports-Server-with-Tomcat-and-MySQL-on-Ubuntu +[15]: https://mariadb.org/ From 10232b2ab1eeb386c76c8c827d1c5c133aa547bd Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Tue, 5 May 2020 01:24:09 +0800 Subject: [PATCH 0600/1809] TSL --- ...nd JPG for your online images- Use WebP.md | 144 ------------------ ...nd JPG for your online images- Use WebP.md | 143 +++++++++++++++++ 2 files changed, 143 insertions(+), 144 deletions(-) delete mode 100644 sources/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md create mode 100644 translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md diff --git a/sources/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md b/sources/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md deleted file mode 100644 index f4e6711933..0000000000 --- a/sources/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md +++ /dev/null @@ -1,144 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Drop PNG and JPG for your online images: Use WebP) -[#]: via: (https://opensource.com/article/20/4/webp-image-compression) -[#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas) - -Drop PNG and JPG for your online images: Use WebP -====== -Get started with this open source image editing tool to save time and -space. -![Painting art on a computer screen][1] - -WebP is an image format developed by Google in 2010 that provides superior lossless and lossy compression for images on the web. Using WebP, web developers can create smaller, richer images that improve site speed. A faster loading website is critical to the user experience and for the website's marketing effectiveness. - -For optimal loading across all devices and users, images on your site should not be larger than 500 KB in file size. - -WebP lossless images are often at least 25% smaller in size compared to PNGs. WebP lossy images are often anywhere from 25-34% smaller than comparable JPEG images at equivalent SSIM (structural similarity) quality index. - -Lossless WebP supports transparency, as well. For cases when lossy RGB compression is acceptable, lossy WebP also supports transparency, typically providing three times smaller file sizes compared to PNG. - -Google reports a 64% reduction in file size for images converted from animated GIFs to lossy WebP, and a 19% reduction when converted to lossless WebP. - -The WebP file format is based on the RIFF (resource interchange file format) document format. The file signature is **52 49 46 46** (RIFF), as you can see with [hexdump][2]: - - -``` -$ hexdump --canonical pixel.webp -00000000  52 49 46 46 26 00 00 00  [...]  |RIFF&...WEBPVP8 | -00000010  1a 00 00 00 30 01 00 9d  [...]  |....0....*......| -00000020  0e 25 a4 00 03 70 00 fe  [...]  |.%...p...`....| -0000002e -``` - -The standalone libwebp library serves as a reference implementation for the WebP specification and is available from Google's [Git repository][3] or as a tarball. - -The WebP format is compatible with 80% of the web browsers in use worldwide. At the time of this writing, it is not compatible with Apple's Safari browser. The workaround for this is to serve up a JPG/PNG alongside a WebP, and there are methods and Wordpress plugins to do that. - -### Why does this matter? - -Part of my job is to design and maintain our organization's website. Since the website is a marketing tool and site speed is a critical aspect of the user experience, I have been working to improve the speed, and reducing image sizes by converting them to WebP has been a good solution. - -To test the speed of one of the pages, I turned to **web.dev**, which is powered by Lighthouse, released under the Apache 2.0 license, and can be found at . - -According to its official description, "Lighthouse is an open source, automated tool for improving the quality of web pages. You can run it against any web page—public or requiring authentication. It has audits for performance, accessibility, progressive web apps, SEO, and more. You can run Lighthouse in Chrome DevTools, from the command line, or as a Node module. You give Lighthouse a URL to audit, it runs a series of audits against the page, and then it generates a report on how well the page did. From there, use the failing audits as indicators on how to improve the page. Each audit has a reference doc explaining why the audit is important, as well as how to fix it." - -### Creating a smaller WebP image - -The page I tested returned three images. In the report it generates, it provides recommendations and targets. I chose the "app-graphic" image, which, it reported, is 650 KB. By converting it to WebP, I should save 589 KB, reducing the image to 61 KB. I converted the image in Photoshop and saved it with the default WebP settings, and it returned a file size of 44.9 KB. Better than expected! As the screenshot from Photoshop shows, the images look identical in visual quality. - -![WebP vs JPG comparison][4] - -On the left: 650 KB (actual size). On the right: 589 KB (target size after conversion). - -Of course, the open source image editor [GIMP][5] also supports WebP as an export format. It offers several options for quality and compression profile: - -![GIMP dialog for exporting webp, as a webp][6] - -A zoomed-in look of another image: - -![WebP vs PNG comparison][7] - -PNG (left) and WebP (right), both converted from a JPG, shows the WebP, although smaller in size, is superior in visual quality. - -### Convert to an image to WebP - -To convert images on Linux from JPG/PNG to WebP, you can also use the command-line: - -Use **cwebp** on the command line to convert PNG or JPG image files to WebP format. You can convert a PNG image file to a WebP image with a quality range of 80 with the command: - - -``` -`cwebp -q 80 image.png -o image.webp` -``` - -Alternatively, you can also use [Image Magick][8], which is probably available in your distribution's software repository. The subcommand for conversion is **convert**, and all that's needed is an input and output file: - - -``` -`convert pixel.png pixel.webp` -``` - -### Convert an image to WebP with an editor - -To convert images to WebP with a photo editor, use [GIMP][9]. From version 2.10 on, it supports WebP natively. - -If you're a Photoshop user, you need a plugin to convert the files, as Photoshop does not include it natively. WebPShop 0.2.1, released under the Apache License 2.0 license, is a Photoshop module for opening and saving WebP images, including animations, and can be found at: . - -To use the plugin, put the file found in the **bin** folder inside your Photoshop plugin directory: - -Windows x64—C:\Program Files\Adobe\Adobe Photoshop\Plug-ins\WebPShop.8bi - -Mac—Applications/Adobe Photoshop/Plug-ins/WebPShop.plugin - -### WebP on Wordpress - -Many websites are built using Wordpress (that's what I use). So, how does Wordpress handle uploading WebP images? At the time of this writing, it doesn't. But, there are, of course, plugins to enable it so you can serve up both WebP alongside PNG/JPG images (for the Apple crowd). - -Or there are these [instructions][10] from [Marius Hosting][11]: - -"How about directly uploading WebP images to Wordpress? This is easy. Just add some text line on your theme functions.php file. Wordpress does not natively support viewing and uploading WebP files, but I will explain to you how you can make it work in a few simple steps. Log in to your Wordpress admin area and go to Appearance/Theme Editor and find functions.php. Copy and paste the code below at the end of the file and save it.  - - -``` -`//** *Enable upload for webp image files.*/ function webp_upload_mimes($existing_mimes) { $existing_mimes['webp'] = 'image/webp'; return $existing_mimes; } add_filter('mime_types', 'webp_upload_mimes');` -``` - -If you want to see the thumbnail image preview when you go to Media/Library, you have to add the code below in the same functions.php file. To find the functions.php file, go to Appearance/Theme Editor and find functions.php, then copy and paste the code below at the end of the file and save it." - - -``` -`//** * Enable preview / thumbnail for webp image files.*/ function webp_is_displayable($result, $path) { if ($result === false) { $displayable_image_types = array( IMAGETYPE_WEBP ); $info = @getimagesize( $path ); if (empty($info)) { $result = false; } elseif (!in_array($info[2], $displayable_image_types)) { $result = false; } else { $result = true; } } return $result; } add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2);` -``` - -### WebP and the future - -WebP is a robust and optimized format. It looks better, it has better compression ratio, and it has all the features of most other common image formats. There's no need to wait—start using it now. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/webp-image-compression - -作者:[Jeff Macharyas][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jeffmacharyas -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/painting_computer_screen_art_design_creative.png?itok=LVAeQx3_ (Painting art on a computer screen) -[2]: https://opensource.com/article/19/8/dig-binary-files-hexdump -[3]: https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html -[4]: https://opensource.com/sites/default/files/uploads/webp-vs-jpg-app-graphic.png (WebP vs JPG comparison) -[5]: http://gimp.org -[6]: https://opensource.com/sites/default/files/webp-gimp.webp (GIMP dialog for exporting webp, as a webp) -[7]: https://opensource.com/sites/default/files/uploads/xcompare-png-left-webp-right.png (WebP vs PNG comparison) -[8]: https://imagemagick.org -[9]: https://en.wikipedia.org/wiki/GIMP -[10]: https://mariushosting.com/how-to-upload-webp-files-on-wordpress/ -[11]: https://mariushosting.com/ diff --git a/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md b/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md new file mode 100644 index 0000000000..3186cf5b00 --- /dev/null +++ b/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md @@ -0,0 +1,143 @@ +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Drop PNG and JPG for your online images: Use WebP" +[#]: via: "https://opensource.com/article/20/4/webp-image-compression" +[#]: author: "Jeff Macharyas https://opensource.com/users/jeffmacharyas" + +线上图片请抛弃 PNG 和 JPG 后缀:使用 WebP +====== +了解一下这个开源的图片编辑工具来节省时间和空间。 +![Painting art on a computer screen][1] + +WebP 是 2010 年 Google 开发的一种图片格式,能提供对网络图片的无损压缩和有损压缩。网络开发者们可以使用 WebP 来创建更小更丰富的图片,以此来提高网站的速度。更快的加载速度对于网站的用户体验和网站市场的效能是至关重要的。 + +为了提供领先于所有的设备和用户的图片加载能力,你网站上的图片文件大小不应该超过 500 KB。 + +WebP 无损图片通常比 PNG 图片文件小至少 25%。在相同的 SSIM(structural similarity,结构相似性)质量指标下,WebP 有损图片通常比 JPEG 图片小 25% 到 34%。 + +无损 WebP 也支持透明度。在有损 RGB 压缩可接受的情况下,有损 WebP 也支持透明度,PNG 文件的大小通常为 WebP 文件大小的四倍。 + +Google 报告把动图 GIF 文件转换为有损 WebP后文件大小减少了 64%,转换为无损 WebP 后文件大小减少了 19%。 + +WebP 文件格式是一种基于 RIFF(resource interchange file format,资源交换文件格式)的文档格式。你可以用 [hexdump][2] 看到文件的签名是 **52 49 46 46** (RIFF): + + +``` +$ hexdump --canonical pixel.webp +00000000  52 49 46 46 26 00 00 00  [...]  |RIFF&...WEBPVP8 | +00000010  1a 00 00 00 30 01 00 9d  [...]  |....0....*......| +00000020  0e 25 a4 00 03 70 00 fe  [...]  |.%...p...`....| +0000002e +``` + +独立的 libwebp 库以 WebP 技术规范的引用实现的方式提供服务,可以从 Google 的 [Git 仓库][3] 或下载 tar 包获得。 + +全球在用的 80% 的 web 浏览器兼容 WebP 格式。本文撰写时,Apple 的 Safari 浏览器还不兼容。对于不兼容的情况,应变方法是在 WebP 图片旁边准备一张 JPG/PNG 图片,我们有很多种方法和 Wordpress 插件来实现。 + +### 为什么这很重要? + +我的部分工作是设计和维护我们组织的网站。由于网站是个市场工具并且网站速度是衡量用户体验的重要指标,我一直致力于提高网站速度,通过把图片转换为 WebP 来减少图片大小是一个有效的解决方案。 + +我使用了 **web.dev** 来检测其中一个网页,该工具是由 Lighthouse 提供服务的,遵循 Apache 2.0 证书,可以在 找到。 + +根据官方描述,”LIghthouse 是一个开源的,旨在提升网页质量的自动化工具。你可以在任何网页上运行它 — 公共的或需要鉴权的。它有性能、可用性、积极的 web 应用、SEO和其他项目的审计。你可以使用命令行、作为一个 Node 模块或在 Chrome DevTools 里运行 Lighthouse。你输入一个 URL 给 Lighthouse,它对这个网页运行一系列的审计规则,之后生成这个网页的审计结果报告。从报告的失败审计条目中可以知道应该怎么优化网页。每条审计都有对应的文档解释为什么该项目是重要的,以及如何修复它。“ + +### 创建更小的 WebP 图片 + +我测试的页面返回了三张图片。在它生成的报告中,它提供了推荐和目标格式。我选择了它报告有 650 KB 的 ”app-graphic“ 图片。通过把它转换为 WebP 格式,预计可以图片大小降到 61 KB,节省 589 KB。我在 Photoshop 中把它转换了,用默认的 WebP 设置参数保存它,它的文件大小为 44.9 KB。比预期的还要好!从下面的 Photoshop 截图中可以看出,两张图在视觉上完全一样。 + +![WebP vs JPG comparison][4] + +左图:650 KB(实际大小)。右图: 589 KB(转换之后的目标大小)。 + +当然,也可以用开源图片编辑工具 [GIMP][5] 把图片导出为 WebP。它提供了几个质量和压缩的参数: + +![GIMP dialog for exporting webp, as a webp][6] + +另一张图拉近视野后: + +![WebP vs PNG comparison][7] + +PNG(左图)和 WebP(右图),都是从 JPG 转换而来,两图对比可以看出 WebP 不仅在文件大小更小,在视觉质量上也更优秀。 + +### 把图片转换为 WebP + +你也可以用 Linux 的命令行工具把图片从 JPG/PNG 转换为 WebP: + +在命令行使用 **cwebp** 把 PNG 或 JPG 图片文件转换为 WebP 格式。你可以用下面的命令把 PNG 图片文件转换为质量参数为 80 的 WebP 图片。 + + +``` +`cwebp -q 80 image.png -o image.webp` +``` + +你还可以用 [Image Magick][8],这个工具可能在你的发行版本软件仓库中可以找到。转换的子命令是 **convert**,它需要的所有参数就是输入和输出文件: + + +``` +`convert pixel.png pixel.webp` +``` + +### 使用编辑器把图片转换为 WebP + +使用 [GIMP][9] 图片编辑器来把图片转换为 WebP。从 2.10 版本开始,它原生地支持 WebP。 + +如果你是 Photoshop 用户,由于 Photoshop 默认不包含 WebP,因此你需要一个转换插件。遵循 Apache License 2.0 证书发行的 WebPShop 0.2.1 是一个用户打开和保存包括动图在内的 WebP 图片的 Photoshop 模块,在 可以找到。 + +为了能正常使用它,你需要把它放进 Photoshop 插件目录下的 **bin** 文件夹: + +Windows x64—C:\Program Files\Adobe\Adobe Photoshop\Plug-ins\WebPShop.8bi + +Mac—Applications/Adobe Photoshop/Plug-ins/WebPShop.plugin + +### Wordpress 上的 WebP + +很多网站是用 Wordpress 搭建的(我的网站就是)。因此,Wordpress 怎么上传 WebP 图片?本文撰写时,它还不支持。但是,当然已经有插件来满足这种需求,因此你可以在你的网站上同时准备 WebP 和 PNG/JPG 图片(为 Apple 用户)。 + +在 [Marius Hosting][11] 有下面的指示: + +”直接向 Wordpress 上传 WebP 图片会怎样?这很简单。向你的主题 functions.php 文件添加几行内容就可以了。Wordpress 默认不支持展示和上传 WebP 文件,但是我会向你陈述怎么通过几个简单的步骤来让它支持。登录进你的 Wordpress 管理员界面,进入 Appearance/Theme Editor 找到 functions.php。拷贝下面的代码粘贴到文件最后并保存。 + + +``` +`//** *Enable upload for webp image files.*/ function webp_upload_mimes($existing_mimes) { $existing_mimes['webp'] = 'image/webp'; return $existing_mimes; } add_filter('mime_types', 'webp_upload_mimes');` +``` + +"如果你想在 Media/Library 看缩略图预览,那么你需要把下面的代码也添加到 functions.php 文件。为了找到 functions.php 文件,进入 Appearance/Theme Editor 并搜索 functions.php,然后拷贝下面的代码粘贴到文件最后并保存。“ + + +``` +`//** * Enable preview / thumbnail for webp image files.*/ function webp_is_displayable($result, $path) { if ($result === false) { $displayable_image_types = array( IMAGETYPE_WEBP ); $info = @getimagesize( $path ); if (empty($info)) { $result = false; } elseif (!in_array($info[2], $displayable_image_types)) { $result = false; } else { $result = true; } } return $result; } add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2);` +``` + +### WebP 和未来 + +WebP 是鲁棒的和最优的格式。它看起来更好,有更好的压缩率,它拥有其他大部分常见图片格式的所有特性。不必再等了,现在就使用它把。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/webp-image-compression + +作者:[Jeff Macharyas][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jeffmacharyas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/painting_computer_screen_art_design_creative.png?itok=LVAeQx3_ "Painting art on a computer screen" +[2]: https://opensource.com/article/19/8/dig-binary-files-hexdump +[3]: https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html +[4]: https://opensource.com/sites/default/files/uploads/webp-vs-jpg-app-graphic.png "WebP vs JPG comparison" +[5]: http://gimp.org +[6]: https://opensource.com/sites/default/files/webp-gimp.webp "GIMP dialog for exporting webp, as a webp" +[7]: https://opensource.com/sites/default/files/uploads/xcompare-png-left-webp-right.png "WebP vs PNG comparison" +[8]: https://imagemagick.org +[9]: https://en.wikipedia.org/wiki/GIMP +[10]: https://mariushosting.com/how-to-upload-webp-files-on-wordpress/ +[11]: https://mariushosting.com/ From 791a3b784fe53c15897a82c879f44ba8adec921f Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Tue, 5 May 2020 11:58:11 +0800 Subject: [PATCH 0601/1809] update --- ...nd JPG for your online images- Use WebP.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md b/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md index 3186cf5b00..690f4c6c39 100644 --- a/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md +++ b/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md @@ -1,11 +1,11 @@ -[#]: collector: "lujun9972" -[#]: translator: "lxbwolf" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " -[#]: subject: "Drop PNG and JPG for your online images: Use WebP" -[#]: via: "https://opensource.com/article/20/4/webp-image-compression" -[#]: author: "Jeff Macharyas https://opensource.com/users/jeffmacharyas" +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Drop PNG and JPG for your online images: Use WebP) +[#]: via: (https://opensource.com/article/20/4/webp-image-compression) +[#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas) 线上图片请抛弃 PNG 和 JPG 后缀:使用 WebP ====== @@ -130,13 +130,13 @@ via: https://opensource.com/article/20/4/webp-image-compression [a]: https://opensource.com/users/jeffmacharyas [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/painting_computer_screen_art_design_creative.png?itok=LVAeQx3_ "Painting art on a computer screen" +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/painting_computer_screen_art_design_creative.png?itok=LVAeQx3_ (Painting art on a computer screen) [2]: https://opensource.com/article/19/8/dig-binary-files-hexdump [3]: https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html -[4]: https://opensource.com/sites/default/files/uploads/webp-vs-jpg-app-graphic.png "WebP vs JPG comparison" +[4]: https://opensource.com/sites/default/files/uploads/webp-vs-jpg-app-graphic.png (WebP vs JPG comparison) [5]: http://gimp.org -[6]: https://opensource.com/sites/default/files/webp-gimp.webp "GIMP dialog for exporting webp, as a webp" -[7]: https://opensource.com/sites/default/files/uploads/xcompare-png-left-webp-right.png "WebP vs PNG comparison" +[6]: https://opensource.com/sites/default/files/webp-gimp.webp (GIMP dialog for exporting webp, as a webp) +[7]: https://opensource.com/sites/default/files/uploads/xcompare-png-left-webp-right.png (WebP vs PNG comparison) [8]: https://imagemagick.org [9]: https://en.wikipedia.org/wiki/GIMP [10]: https://mariushosting.com/how-to-upload-webp-files-on-wordpress/ From fcd061d231551038992107c11607e3efe1c5970b Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Tue, 5 May 2020 15:36:41 +0800 Subject: [PATCH 0602/1809] translating by qfzy1233 --- ...Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md b/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md index c6857014ef..73e60dc17a 100644 --- a/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md +++ b/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qfzy1233) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 067db949bb992056f19c8b1462b3805cc1b96ab2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 5 May 2020 17:13:15 +0800 Subject: [PATCH 0603/1809] APL --- .../tech/20200429 The life-changing magic of git rebase -i.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200429 The life-changing magic of git rebase -i.md b/sources/tech/20200429 The life-changing magic of git rebase -i.md index 8afb9d7f8e..c6d4d904b4 100644 --- a/sources/tech/20200429 The life-changing magic of git rebase -i.md +++ b/sources/tech/20200429 The life-changing magic of git rebase -i.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ed5ce13ff18bc78f96d122c333d93dabbae5c606 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 5 May 2020 21:30:08 +0800 Subject: [PATCH 0604/1809] TSL --- ...he life-changing magic of git rebase -i.md | 80 ------------------- ...he life-changing magic of git rebase -i.md | 79 ++++++++++++++++++ 2 files changed, 79 insertions(+), 80 deletions(-) delete mode 100644 sources/tech/20200429 The life-changing magic of git rebase -i.md create mode 100644 translated/tech/20200429 The life-changing magic of git rebase -i.md diff --git a/sources/tech/20200429 The life-changing magic of git rebase -i.md b/sources/tech/20200429 The life-changing magic of git rebase -i.md deleted file mode 100644 index c6d4d904b4..0000000000 --- a/sources/tech/20200429 The life-changing magic of git rebase -i.md +++ /dev/null @@ -1,80 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The life-changing magic of git rebase -i) -[#]: via: (https://opensource.com/article/20/4/git-rebase-i) -[#]: author: (Dave Neary https://opensource.com/users/dneary) - -The life-changing magic of git rebase -i -====== -Make everyone think you write perfect code the first time (and make your -patches easier to review and merge). -![Hands programming][1] - -Software development is messy. So many wrong turns, typos to fix, quick hacks and kludges to correct later, off-by-one errors you find late in the process. With version control, you have a pristine record of every wrong turn and correction made during the process of creating the "perfect" final product—a patch ready to submit upstream. Like the outtakes from movies, they are a little embarrassing and sometimes amusing. - -Wouldn't it be great if you could use version control to save your work regularly at waypoints, and then when you have something you are ready to submit for review, you could hide all of that private drafting work and just submit a single, perfect patch? Meet **git rebase -i**, the perfect way to rewrite history and make everyone think that you produce perfect code the first time! - -### What does git rebase do? - -In case you're not familiar with the intricacies of Git, here is a brief overview. Under the covers, Git associates different versions of your project with a unique identifier, which is made up of a hash of the parent node's unique identifier, and the difference between the new version and its parent node. This creates a tree of revisions, and each person who checks out the project gets their own copy. Different people can take the project in different directions, each starting from potentially different branch points. - -![Master branch vs. private branch][2] - -The master branch in the "origin" repo on the left and the private branch on your personal copy on the right. - -There are two ways to integrate your work back with the master branch in the original repository: one is to use **git merge**, and the other is to use **git rebase**. They work in very different ways. - -When you use **git merge**, a new commit is created on the master branch that includes all of the changes from origin plus all of your local changes. If there are any conflicts (for example, if someone else has changed a file you are also working with), these will be marked, and you have an opportunity to resolve the conflicts before committing this merge commit to your local repository. When you push your changes back to the parent repository, all of your local work will appear as a branch for other users of the Git repository. - -But **git rebase** works differently. It rewinds your commits and replays those commits again from the tip of the master branch. This results in two main changes. First, since your commits are now branching off a different parent node, their hashes will be recalculated, and anyone who has cloned your repository may now have a broken copy of the repository. Second, you do not have a merge commit, so any merge conflicts are identified as your changes are being replayed onto the master branch, and you need to fix them before proceeding with the rebase. When you push your changes now, your work does not appear on a branch, and it looks as though you wrote all of your changes off the very latest commit to the master branch. - -![Merge commits preserve history, and rebase rewrites history.][3] - -Merge commits (left) preserve history, while rebase (right) rewrites history. - -However, both of these options come with a downside: everyone can see all your scribbles and edits as you worked through problems locally before you were ready to share your code. This is where the **\--interactive** (or **-i** for short) flag to **git rebase** comes into the picture. - -### Introducing git rebase -i - -The big advantage of **git rebase** is that it rewrites history. But why stop at just pretending you branched off a later point? There is a way to go even further and rewrite how you arrived at your ready-to-propose code: **git rebase -i**, an interactive **git rebase**. - -This feature is the "magic time machine" function in Git. The flag allows you to make sophisticated changes to revision history while doing a rebase. You can hide your mistakes! Merge many small changes into one pristine feature patch! Reorder how things appear in revision history! - -![output of git rebase -i][4] - -When you run **git rebase -i**, you get an editor session listing all of the commits that are being rebased and a number of options for what you can do to them. The default choice is **pick**. - - * **Pick** maintains the commit in your history. - * **Reword** allows you to change a commit message, perhaps to fix a typo or add additional commentary. - * **Edit** allows you to make changes to the commit while in the process of replaying the branch. - * **Squash** merges multiple commits into one. - * You can reorder commits by moving them around in the file. - - - -When you are finished, simply save the final result, and the rebase will execute. At each stage where you have chosen to modify a commit (either with **reword**, **edit**, **squash**, or when there is a conflict), the rebase stops and allows you to make the appropriate changes before continuing. - -The example above results in "One-liner bug fix" and "Integrate new header everywhere" being merged into one commit, and "New header for docs website" and "D'oh - typo. Fixed" into another. Like magic, the work that went into the other commits is still there on your branch, but the associated commits have disappeared from your history! - -This makes it easy to submit a clean patch to an upstream project using **git send-email** or by creating a pull request against the parent repository with your newly tidied up patchset. This has a number of advantages, including that it makes your code easier to review, easier to accept, and easier to merge. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/git-rebase-i - -作者:[Dave Neary][a] -选题:[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/dneary -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop.png?itok=pGfEfu2S (Hands programming) -[2]: https://opensource.com/sites/default/files/uploads/master-private-branches.png (Master branch vs. private branch) -[3]: https://opensource.com/sites/default/files/uploads/merge-commit-vs-rebase.png (Merge commits preserve history, and rebase rewrites history.) -[4]: https://opensource.com/sites/default/files/uploads/git-rebase-i.png (output of git rebase -i) diff --git a/translated/tech/20200429 The life-changing magic of git rebase -i.md b/translated/tech/20200429 The life-changing magic of git rebase -i.md new file mode 100644 index 0000000000..91739d2789 --- /dev/null +++ b/translated/tech/20200429 The life-changing magic of git rebase -i.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The life-changing magic of git rebase -i) +[#]: via: (https://opensource.com/article/20/4/git-rebase-i) +[#]: author: (Dave Neary https://opensource.com/users/dneary) + +完美生活:git rebase -i +====== + +> 让大家觉得你一次就能写出完美的代码,并让你的补丁更容易审核和合并。 + +![Hands programming][1] + +软件开发是混乱的。有很多错误的转折、有需要修复的错别字、有需要修正的错误、有需要稍后纠正临时和粗陋的代码,还有在开发过程中以后发现的错位问题。有了版本控制,在创建“完美”的最终产品(即准备提交给上游的补丁)的过程中,你会有一个记录着每一个错误的转折和修正的原始记录。就像电影中的片段一样,它们有些尴尬,有时还很有趣。就像电影中的花絮一样,它们会让人有点尴尬,有时也会让人觉得好笑。 + +如果你能使用版本控制来定期保存你的工作线索,然后当你准备提交审核的东西时,可以隐藏所有这些私人草稿工作,只需提交一份单一的、完美的补丁就可以了,那不是很好吗?`git rebase -i`,是重写历史记录的完美方法,可以让大家觉得你一次就写出了完美的代码。 + +### git rebase 的作用是什么? + +如果你不熟悉 Git 的复杂性,这里简单介绍一下。在幕后,Git 将项目的不同版本与唯一标识符关联起来,这个标识符由父节点的唯一标识符的哈希以及新版本与其父节点的差异组成。这样就形成了一棵修订树,每个检出项目的人都会得到自己的副本。不同的人可以把项目往不同的方向发展,每个人的出发点都可能是不同的分支点。 + +![Master branch vs. private branch][2] + +*左边是 `origin` 版本库中的主分支,右边是你个人副本中的私有分支。* + +有两种方法可以将你的工作与原始版本库中的主分支整合起来:一种是使用 合并:`git merge`,另一种是使用变基:`git rebase`。它们的工作方式非常不同。 + +当你使用 `git merge` 时,会在主分支上创建一个新的提交,其中包括所有来自 `origin` 的修改和所有本地的修改。如果有任何冲突(例如,如果别人修改了你也在修改的文件),则将这些冲突标记出来,并且你有机会在将该“合并提交”提交到本地版本库之前解决这些冲突。当你将更改推送回父版本库时,所有的本地工作都会以分支的形式出现在 Git 仓库的其他用户面前。 + +但是 `git rebase` 的工作方式不同。它回滚你的提交,并从主分支的顶端再次重放这些提交。这导致了两个主要的变化。首先,由于你的提交现在从一个不同的父节点分支出来,它们的哈希值会被重新计算,并且任何克隆了你的仓库的人都可能会有一个残破的仓库副本。第二,你没有一个合并提交,所以在将更改重放到主分支上时会识别出任何合并冲突,所以任何合并冲突都会被识别出来,因此,你需要在进行变基rebase之前修复它们。当你现在推送你的修改时,你的工作不会出现在分支上,并且看起来像是你把所有的修改都写到了主分支的最新的提交上。 + +![Merge commits preserve history, and rebase rewrites history.][3] + +*合并提交(左)保留了历史,而变基(右)重写历史。* + +然而,这两种方式都有一个坏处:在你准备好分享代码之前,每个人都可以看到你在本地处理问题时的所有涂鸦和编辑。这就是 `git rebase` 的 `--interactive`(或简写 `-i`)标志的作用。 + +### 介绍 git rebase -i + +`git rebase` 的最大优点是它重写了历史。但是,为什么仅止于假装你从后面的点分支出来呢?有一种更进一步方法可以重写你是如何准备就绪这些代码的:`git rebase -i`,交互式的 `git rebase`。 + +这个功能就是 Git 中的 "神奇的时间机器” 功能。这个标志允许你在做变基时对修订历史记录进行复杂的修改。你可以隐藏你的错误! 将许多小的修改合并到一个原始的功能补丁中! 重新排序修改历史记录中的内容 + +![output of git rebase -i][4] + +当你运行 `git rebase -i` 时,你会得到一个编辑器会话,其中列出了所有正在被变基的提交,并有一些选项可以对它们做什么。默认的选择是 `pick`。 + + * `Pick`:会在你的历史记录中保留该提交。 + * `Reword`:允许你修改提交信息,可能是修复一个错别字或添加额外的注释。 + * `Edit`:允许你在重放分支的过程中对提交进行修改。 + * `Squash`:可以将多个提交合并为一个。 + * 你可以通过移动文件中的提交来重新排序。 + +当你完成后,只需保存最终结果,变基就会执行。在每个阶段,当你选择了修改提交(无论是用 `reword`、`edit`、`squash` 还是有冲突时),变基会停止,并允许你在继续提交之前进行适当的修改。 + +上面这个例子的结果是 “One-liner bug fix” 和 “Integate new header everywhere” 被合并到一个提交中,而 “New header for docs website” 和 “D'oh - typo. Fixed” 合并到另一个提交中。就像变魔术一样,其他提交的工作还在你的分支中,但相关的提交已经从你的历史记录中消失了!这样一来,你就可以很容易地提交干净的提交。 + +这使得使用 `git send-email` 或者用你新整理好的补丁集在父版本库中创建一个拉取请求来提交一个干净的补丁给上游项目变得很容易。这有很多好处,包括让你的代码更容易审核,更容易接受,也更容易合并。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/git-rebase-i + +作者:[Dave Neary][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dneary +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop.png?itok=pGfEfu2S (Hands programming) +[2]: https://opensource.com/sites/default/files/uploads/master-private-branches.png (Master branch vs. private branch) +[3]: https://opensource.com/sites/default/files/uploads/merge-commit-vs-rebase.png (Merge commits preserve history, and rebase rewrites history.) +[4]: https://opensource.com/sites/default/files/uploads/git-rebase-i.png (output of git rebase -i) From c65cba5b8db89928c2ce6b829bcbed9a9e5a4b73 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 5 May 2020 22:36:16 +0800 Subject: [PATCH 0605/1809] PRF @robsean --- ...re SFTP Server with Chroot in Debian 10.md | 84 ++++++++++--------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/translated/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md b/translated/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md index a30b6ee817..4fe8afb9a2 100644 --- a/translated/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md +++ b/translated/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md @@ -7,61 +7,63 @@ [#]: via: (https://www.linuxtechi.com/configure-sftp-chroot-debian10/) [#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) -如何在 Debian 10 中使用 Chroot 配置 SFTP 服务 +如何在 Debian 10 中配置 Chroot 环境的 SFTP 服务 ====== -**SFTP** 代表安全文件传输协议 / SSH 文件传输协议,它是最常用的一个方法,用于通过ssh将文件从本地系统安全地传输到远程服务器,反之亦然。sftp 的主要优点是,除 ‘**openssh-server**’ 之外,我们不需要安装任何额外的软件包,在大多数的 Linux 发行版中,‘openssh-server’ 软件包是默认安装的一部分。sftp 的另外一个好处是,我们可以允许用户使用 sftp ,而不允许使用 ssh 。 +SFTP 意思是“安全文件传输协议Secure File Transfer Protocol” 或 “SSH 文件传输协议SSH File Transfer Protocol”,它是最常用的用于通过 `ssh` 将文件从本地系统安全地传输到远程服务器的方法,反之亦然。`sftp` 的主要优点是,除 `openssh-server` 之外,我们不需要安装任何额外的软件包,在大多数的 Linux 发行版中,`openssh-server` 软件包是默认安装的一部分。`sftp` 的另外一个好处是,我们可以允许用户使用 `sftp` ,而不允许使用 `ssh` 。 -[![配置-sftp-debian10][1]][2] - -当前 Debian 10 ,代号‘Buster’,已经发布,在这篇文章中,我们将演示如何在 Debian 10 系统中使用 Chroot ‘Jail’ 类似的环境配置 sftp 。在这里,Chroot Jail 类似环境意味着,用户不能超出各自的 home 目录,或者用户不能从各自的 home 目录更改目录。下面实验的详细情况: - - * OS = Debian 10 - * IP 地址 = 192.168.56.151 +![](https://img.linux.net.cn/data/attachment/album/202005/05/223518ip4mbdi4nggbdtgu.jpg) +当前发布的 Debian 10 代号为 ‘Buster’,在这篇文章中,我们将演示如何在 Debian 10 系统中在 “监狱式的” Chroot 环境中配置 `sftp`。在这里,Chroot 监狱式环境意味着,用户不能超出各自的家目录,或者用户不能从各自的家目录更改目录。下面实验的详细情况: +* OS = Debian 10 +* IP 地址 = 192.168.56.151 让我们跳转到 SFTP 配置步骤, -### 步骤:1) 为 sftp 使用 groupadd 命令创建一个组 +### 步骤 1、使用 groupadd 命令给 sftp 创建一个组 -打开终端,使用下面的 groupadd 命令创建一个名为的“**sftp_users**”组, +打开终端,使用下面的 `groupadd` 命令创建一个名为的 `sftp_users` 组: ``` root@linuxtechi:~# groupadd sftp_users ``` -### 步骤:2) 添加用户到组 ‘sftp_users’ 并设置权限 +### 步骤 2、添加用户到组 sftp_users 并设置权限 -假设你想创建新的用户,并且想添加该用户到 ‘sftp_users’ 组中,那么运行下面的命令, +假设你想创建新的用户,并且想添加该用户到 `sftp_users` 组中,那么运行下面的命令, -**语法:** # useradd -m -G sftp_users +**语法:** -让我们假设用户名是 ’Jonathan’ +``` +# useradd -m -G sftp_users <用户名> +``` + +让我们假设用户名是 `jonathan`: ``` root@linuxtechi:~# useradd -m -G sftp_users jonathan ``` -使用下面的 chpasswd 命令设置密码, +使用下面的 `chpasswd` 命令设置密码: ``` -root@linuxtechi:~# echo "jonathan:" | chpasswd +root@linuxtechi:~# echo "jonathan:<输入密码>" | chpasswd ``` -假设你想添加现有的用户到 ‘sftp_users’ 组中,那么运行下面的 usermod 命令,让我们假设已经存在的用户名称是 ‘chris’ +假设你想添加现有的用户到 `sftp_users` 组中,那么运行下面的 `usermod` 命令,让我们假设已经存在的用户名称是 `chris`: ``` root@linuxtechi:~# usermod -G sftp_users chris ``` -现在设置用户所需的权限, +现在设置用户所需的权限: ``` root@linuxtechi:~# chown root /home/jonathan /home/chris/ ``` -在各用户的 home 目录中都创建一个上传目录,并设置正确地所有权, +在各用户的家目录中都创建一个上传目录,并设置正确地所有权: ``` root@linuxtechi:~# mkdir /home/jonathan/upload @@ -72,14 +74,14 @@ root@linuxtechi:~# chown chris /home/chris/upload **注意:** 像 Jonathan 和 Chris 之类的用户可以从他们的本地系统上传文件和目录。 -### 步骤:3) 编辑 sftp 配置文件 (/etc/ssh/sshd_config) +### 步骤 3、编辑 sftp 配置文件 /etc/ssh/sshd_config -正如我们已经陈述的,sftp 操作是通过 ssh 完成的,所以它的配置文件是 “**/etc/ssh/sshd_config**“, 在做任何更改前,我建议首先备份文件,然后再编辑该文件,接下来添加下面的内容, +正如我们已经陈述的,`sftp` 操作是通过 `ssh` 完成的,所以它的配置文件是 `/etc/ssh/sshd_config`,在做任何更改前,我建议首先备份文件,然后再编辑该文件,接下来添加下面的内容: ``` root@linuxtechi:~# cp /etc/ssh/sshd_config /etc/ssh/sshd_config-org root@linuxtechi:~# vim /etc/ssh/sshd_config -……… +...... #Subsystem sftp /usr/lib/openssh/sftp-server Subsystem sftp internal-sftp @@ -88,28 +90,28 @@ Match Group sftp_users AllowTcpForwarding no ChrootDirectory %h ForceCommand internal-sftp -………… +...... ``` 保存并退出文件。 -为使上述更改生效,使用下面的 systemctl 命令来重新启动 ssh 服务 +为使上述更改生效,使用下面的 `systemctl` 命令来重新启动 `ssh` 服务: ``` root@linuxtechi:~# systemctl restart sshd ``` -在上面的 ‘sshd_config’ 文件中,我们已经注释掉了以 “Subsystem”开头的行,并添加了新的条目 “Subsystem sftp internal-sftp” 和新的行,像, +在上面的 `sshd_config` 文件中,我们已经注释掉了以 `Subsystem` 开头的行,并添加了新的条目 `Subsystem sftp internal-sftp` 和新的行。而 -“**Match Group sftp_users”** –> 它意味着如果用户是 ‘sftp_users’ 组中的一员,那么将应用下面提到的规则到这个条目。 +`Match Group sftp_users` –> 它意味着如果用户是 `sftp_users` 组中的一员,那么将应用下面提到的规则到这个条目。 -“**ChrootDierctory %h**” –> 它意味着用户只能在他们自己各自的 home 目录中更改目录,而不能超出他们各自的 home 目录。或者换句话说,我们可以说用户是不允许更改目录的。他们将在他们的目录中获得 jai 类似环境,并且不能访问其他用户的目录和系统的目录。 +`ChrootDierctory %h` –> 它意味着用户只能在他们自己各自的家目录中更改目录,而不能超出他们各自的家目录。或者换句话说,我们可以说用户是不允许更改目录的。他们将在他们的目录中获得监狱一样的环境,并且不能访问其他用户的目录和系统的目录。 -“**ForceCommand internal-sftp**” –> 它意味着用户仅被限制到 sftp 命令。 +`ForceCommand internal-sftp` –> 它意味着用户仅被限制到只能使用 `sftp` 命令。 -### 步骤:4) 测试和验证 sftp +### 步骤 4、测试和验证 sftp -登录到你的 sftp 服务器的同一个网络上的任何其它的 Linux 系统,然后通过我们在 ‘sftp_users’ 组中映射的用户来尝试 ssh sftp 服务。 +登录到你的 `sftp` 服务器的同一个网络上的任何其它的 Linux 系统,然后通过我们放入 `sftp_users` 组中的用户来尝试 ssh 和 sftp 服务。 ``` [root@linuxtechi ~]# ssh root@linuxtechi @@ -121,7 +123,7 @@ Write failed: Broken pipe [root@linuxtechi ~]# ``` -以上操作证实用户不允许 SSH ,现在使用下面的命令尝试 sftp , +以上操作证实用户不允许 `ssh` ,现在使用下面的命令尝试 `sftp`: ``` [root@linuxtechi ~]# sftp root@linuxtechi @@ -133,7 +135,7 @@ drwxr-xr-x 2 root 1001 4096 Sep 14 07:52 debian10-pkgs drwxr-xr-x 2 1001 1002 4096 Sep 14 08:29 upload ``` -让我们使用 sftp ‘**get**‘ 命令来尝试下载一个文件 +让我们使用 sftp 的 `get` 命令来尝试下载一个文件: ``` sftp> get devops-actions.txt @@ -147,9 +149,9 @@ Couldn't stat remote file: No such file or directory sftp> ``` -上面的输出证实我们能从我们的 sftp 服务器下载文件到本地机器,除此之外,我们也必需测试用户不能更改目录。 +上面的输出证实我们能从我们的 sftp 服务器下载文件到本地机器,除此之外,我们也必须测试用户不能更改目录。 -让我们在 **upload**”目录下尝试上传一个文件, +让我们在 `upload` 目录下尝试上传一个文件: ``` sftp> cd upload/ @@ -163,17 +165,17 @@ sftp> 这证实我们已经成功地从我们的本地系统上传一个文件到 sftp 服务中。 -现在使用 winscp 工具来测试 SFTP 服务,输入 sftp 服务器 ip 地址和用户的凭证, +现在使用 winscp 工具来测试 sftp 服务,输入 sftp 服务器 IP 地址和用户的凭证: -[![Winscp-sftp-debian10][1]][3] +![][3] -在 Login 上单击,然后尝试下载和上传文件 +在 “Login” 上单击,然后尝试下载和上传文件: -[![下载-文件-winscp-debian10-sftp][1]][4] +![][4] -现在,在 upload 文件夹中尝试上传文件, +现在,在 `upload` 文件夹中尝试上传文件: -[![使用-winscp-Debian10-sftp-上传-文件][1]][5] +![][5] 上面的窗口证实上传是完好地工作的,这就是这篇文章的全部。如果这些步骤能帮助你在 Debian 10 中使用 chroot 环境配置 SFTP 服务器s,那么请分享你的反馈和评论。 @@ -184,7 +186,7 @@ via: https://www.linuxtechi.com/configure-sftp-chroot-debian10/ 作者:[Pradeep Kumar][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f2866dc8c6d1f412e0ca0c7324089a85e7a96e69 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 5 May 2020 22:39:46 +0800 Subject: [PATCH 0606/1809] PUB @robsean https://linux.cn/article-12186-1.html --- ...How to Configure SFTP Server with Chroot in Debian 10.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20190915 How to Configure SFTP Server with Chroot in Debian 10.md (98%) diff --git a/translated/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md b/published/20190915 How to Configure SFTP Server with Chroot in Debian 10.md similarity index 98% rename from translated/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md rename to published/20190915 How to Configure SFTP Server with Chroot in Debian 10.md index 4fe8afb9a2..51a75f3521 100644 --- a/translated/tech/20190915 How to Configure SFTP Server with Chroot in Debian 10.md +++ b/published/20190915 How to Configure SFTP Server with Chroot in Debian 10.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12186-1.html) [#]: subject: (How to Configure SFTP Server with Chroot in Debian 10) [#]: via: (https://www.linuxtechi.com/configure-sftp-chroot-debian10/) [#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) From 06b002218761300f5686e3c1a766ae099b216df2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 5 May 2020 23:21:47 +0800 Subject: [PATCH 0607/1809] PRF @wxy --- ...0 ways to analyze binary files on Linux.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translated/tech/20200430 10 ways to analyze binary files on Linux.md b/translated/tech/20200430 10 ways to analyze binary files on Linux.md index 80577dfbcf..c5dbfc6f61 100644 --- a/translated/tech/20200430 10 ways to analyze binary files on Linux.md +++ b/translated/tech/20200430 10 ways to analyze binary files on Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (10 ways to analyze binary files on Linux) @@ -12,11 +12,11 @@ > 这些简单的命令和工具可以帮助你轻松完成分析二进制文件的任务。 -![Tux with binary code background][1] +![](https://img.linux.net.cn/data/attachment/album/202005/05/232115nn0oduodo4oztv0a.jpg) “这个世界上有 10 种人:懂二进制的人和不懂二进制的人。” -我们每天都在与二进制文件打交道,但我们对二进制文件却知之甚少。我所说的二进制,是指你每天运行的可执行文件,从你的命令行工具到成熟的应用程序都是。 +我们每天都在与二进制文件打交道,但我们对二进制文件却知之甚少。我所说的二进制,是指你每天运行的可执行文件,从命令行工具到成熟的应用程序都是。 Linux 提供了一套丰富的工具,让分析二进制文件变得轻而易举。无论你的工作角色是什么,如果你在 Linux 上工作,了解这些工具的基本知识将帮助你更好地理解你的系统。 @@ -26,7 +26,7 @@ Linux 提供了一套丰富的工具,让分析二进制文件变得轻而易 它的作用:帮助确定文件类型。 -这将是你进行二进制分析的出发点。我们每天都在与文件打交道。并非所有的文件都是可执行类型,除此之外还有各种各样的文件类型。在你开始之前,你需要了解要分析的文件类型。它是二进制文件、库文件、ASCII 文本文件、视频文件、图片文件、PDF、数据文件等等。 +这将是你进行二进制分析的起点。我们每天都在与文件打交道,并非所有的文件都是可执行类型,除此之外还有各种各样的文件类型。在你开始之前,你需要了解要分析的文件类型。是二进制文件、库文件、ASCII 文本文件、视频文件、图片文件、PDF、数据文件等文件吗? `file` 命令将帮助你确定你所处理的文件类型。 @@ -66,11 +66,11 @@ $ ### ltrace -它的作用:一个库调用跟踪器。 +它的作用:库调用跟踪器。 我们现在知道如何使用 `ldd` 命令找到一个可执行程序所依赖的库。然而,一个库可以包含数百个函数。在这几百个函数中,哪些是我们的二进制程序正在使用的实际函数? -`ltrace` 命令可以显示在运行时从库中调用的所有函数。在下面的例子中,你可以看到被调用的函数名称,以及传递给该函数的参数。你也可以在输出的最右边看到这些函数返回的内容。 +`ltrace` 命令可以显示运行时从库中调用的所有函数。在下面的例子中,你可以看到被调用的函数名称,以及传递给该函数的参数。你也可以在输出的最右边看到这些函数返回的内容。 ``` $ ltrace ls @@ -95,7 +95,7 @@ $ 它的作用:以 ASCII、十进制、十六进制或八进制显示文件内容。 -通常情况下,当你用一个应用程序打开一个文件,而它不知道如何处理该文件时,就会出现这种情况。尝试用 `vim` 打开一个可执行文件或视频文件,你会看到的只是屏幕上抛出的乱码。 +通常情况下,当你用一个应用程序打开一个文件,而它不知道如何处理该文件时,就会出现这种情况。尝试用 `vim` 打开一个可执行文件或视频文件,你屏幕上会看到的只是抛出的乱码。 在 `hexdump` 中打开未知文件,可以帮助你看到文件的具体内容。你也可以选择使用一些命令行选项来查看用 ASCII 表示的文件数据。这可能会帮助你了解到它是什么类型的文件。 @@ -132,7 +132,7 @@ $ strings /bin/ls ELF(可执行和可链接文件格式Executable and Linkable File Format)是可执行文件或二进制文件的主流格式,不仅是 Linux 系统,也是各种 UNIX 系统的主流文件格式。如果你已经使用了像 `file` 命令这样的工具,它告诉你文件是 ELF 格式,那么下一步就是使用 `readelf` 命令和它的各种选项来进一步分析文件。 -在使用 `readelf` 命令时,有一个实际的 ELF 规范的参考是非常有用的。你可以在[这里][2]找到规范。  +在使用 `readelf` 命令时,有一份实际的 ELF 规范的参考是非常有用的。你可以在[这里][2]找到该规范。  ``` $ readelf -h /bin/ls @@ -163,9 +163,9 @@ $ 它的作用:从对象文件中显示信息。 -二进制文件是通过你编写源码的创建的,这些源码会通过一个叫做编译器的工具进行编译。这个编译器会生成相当于源代码的机器语言指令,然后由 CPU 执行,以执行特定的任务。这些机器语言代码可以通过被称为汇编语言的助记词来解读。汇编语言是一组指令,它可以帮助你理解由程序所进行并最终在 CPU 上执行的操作。 +二进制文件是通过你编写的源码创建的,这些源码会通过一个叫做编译器的工具进行编译。这个编译器会生成相对于源代码的机器语言指令,然后由 CPU 执行特定的任务。这些机器语言代码可以通过被称为汇编语言的助记词来解读。汇编语言是一组指令,它可以帮助你理解由程序所进行并最终在 CPU 上执行的操作。 -`objdump` 实用程序读取二进制或可执行文件,并将汇编语言指令转储到屏幕上。汇编语言知识对于理解 `objdump` 命令的输出是至关重要的。 +`objdump` 实用程序读取二进制或可执行文件,并将汇编语言指令转储到屏幕上。汇编语言知识对于理解 `objdump` 命令的输出至关重要。 请记住:汇编语言是特定于体系结构的。 @@ -174,7 +174,6 @@ $ objdump -d /bin/ls | head /bin/ls: file format elf64-x86-64 - Disassembly of section .init: 0000000000402150 <_init@@Base>: @@ -219,7 +218,7 @@ $ 它的作用:列出对象文件中的符号。 -如果你所使用的二进制文件没有被剥离,`nm` 命令将为你提供在编译过程中嵌入到二进制文件中的有价值的信息。`nm` 可以帮助你从二进制文件中识别变量和函数。你可以想象一下,如果你无法访问二进制文件的源代码,这将是多么有用。 +如果你所使用的二进制文件没有被剥离,`nm` 命令将为你提供在编译过程中嵌入到二进制文件中的有价值的信息。`nm` 可以帮助你从二进制文件中识别变量和函数。你可以想象一下,如果你无法访问二进制文件的源代码时,这将是多么有用。 为了展示 `nm`,我们快速编写了一个小程序,用 `-g` 选项编译,我们会看到这个二进制文件没有被剥离。 @@ -264,7 +263,7 @@ $ 分析这些路径的唯一方法是在运行时环境,在任何给定的位置停止或暂停程序,并能够分析信息,然后再往下执行。 -这就是调试器的作用,在 Linux 上,`gdb` 就是调试器的事实标准。它可以帮助你加载程序,在特定的地方设置断点,分析内存和 CPU 的寄存器,还有更多的功能。它是对上面提到的其他工具的补充,可以让你做更多的运行时分析。 +这就是调试器的作用,在 Linux 上,`gdb` 就是调试器的事实标准。它可以帮助你加载程序,在特定的地方设置断点,分析内存和 CPU 的寄存器,以及更多的功能。它是对上面提到的其他工具的补充,可以让你做更多的运行时分析。 有一点需要注意的是,一旦你使用 `gdb` 加载一个程序,你会看到它自己的 `(gdb)` 提示符。所有进一步的命令都将在这个 `gdb` 命令提示符中运行,直到你退出。 @@ -290,7 +289,8 @@ Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.6.x86_6 Continuing. Hello world![Inferior 1 (process 29620) exited normally] (gdb) q -$``` +$ +``` ### 结语 @@ -303,7 +303,7 @@ via: https://opensource.com/article/20/4/linux-binary-analysis 作者:[Gaurav Kamathe][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2fc33688b14ace7d116b6ce18319b1c4820f600b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 5 May 2020 23:22:14 +0800 Subject: [PATCH 0608/1809] PUB @wxy https://linux.cn/article-12187-1.html --- .../20200430 10 ways to analyze binary files on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200430 10 ways to analyze binary files on Linux.md (99%) diff --git a/translated/tech/20200430 10 ways to analyze binary files on Linux.md b/published/20200430 10 ways to analyze binary files on Linux.md similarity index 99% rename from translated/tech/20200430 10 ways to analyze binary files on Linux.md rename to published/20200430 10 ways to analyze binary files on Linux.md index c5dbfc6f61..35fedf607a 100644 --- a/translated/tech/20200430 10 ways to analyze binary files on Linux.md +++ b/published/20200430 10 ways to analyze binary files on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12187-1.html) [#]: subject: (10 ways to analyze binary files on Linux) [#]: via: (https://opensource.com/article/20/4/linux-binary-analysis) [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) From 56e24096621276c48184a8f01b1bbb0a3ec65973 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Tue, 5 May 2020 23:45:17 +0800 Subject: [PATCH 0609/1809] APL --- .../20200505 Browse the Peer-to-peer Web With Beaker Browser.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md b/sources/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md index 82129f00a5..319b8a18c5 100644 --- a/sources/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md +++ b/sources/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0bb37bb6aec7a6661c022baa6fa47a9bae504636 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 6 May 2020 00:54:57 +0800 Subject: [PATCH 0610/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200506=20Thre?= =?UTF-8?q?e=20Methods=20to=20Check=20Uptime=20of=20MySQL/MariaDB=20Databa?= =?UTF-8?q?se=20Server=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md --- ... MySQL-MariaDB Database Server on Linux.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md diff --git a/sources/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md b/sources/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md new file mode 100644 index 0000000000..be88629967 --- /dev/null +++ b/sources/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md @@ -0,0 +1,143 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Three Methods to Check Uptime of MySQL/MariaDB Database Server on Linux) +[#]: via: (https://www.2daygeek.com/check-mysql-mariadb-database-server-uptime-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Three Methods to Check Uptime of MySQL/MariaDB Database Server on Linux +====== + +We all know the purpose of the uptime command in Linux. + +This is used to check the **[uptime of the Linux system][1]** and how long the system runs without restarting. + +The Linux admin job is to keep the system up and running. + +If you want to check how long other services like **[Apache][2]**, MySQL, MariaDB, sftp, etc., are running on Linux, how do you do that? + +Each service has their own command to check the uptime of service. + +But you can also use other commands for this purpose. + +### Method-1: How to Check the Uptime of a MySQL/MariaDB Database Server on Linux Using the ps Command + +The **[ps command][3]** stands for process status. This is one of the most basic commands that shows the system running processes with details. + +To do so, you first need to find the PID of **[MySQL][4]**/MariaDB using the **[pidof command][5]**. + +``` +# pidof mysqld | cut -d" " -f1 + +2412 +``` + +Once you have the MySQL/[**MariaDB**][6] PID, use the “etime” option with the ps command and get the uptime. + + * **etime:** elapsed time since the process was started, in the form of [[DD-]hh:]mm:ss. + + + +``` +# ps -p 2412 -o etime + + ELAPSED +2-08:49:30 +``` + +Alternatively, use the “lstart” option with the ps command to get the uptime of a given PID. + +``` +# ps -p 2412 -o lstart + + STARTED +Sat May 2 03:02:15 2020 +``` + +The MySQL/MariaDB process has been running for 2 days, 03 hours, 02 minutes and 15 seconds. + +### Method-2: How to Check the Uptime of a MySQL/MariaDB Database Server on Linux Using the Systemctl Command + +The **[systemctl command][7]** is used to control the systemd system and service manager. + +systemd is a new init system and system manager, that was adopted by most of Linux distributions now over the traditional SysVinit manager. + +``` +# systemctl status mariadb +or +# systemctl status mysql + +● mariadb.service - MariaDB 10.1.44 database server + Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) + Drop-In: /etc/systemd/system/mariadb.service.d + └─migrated-from-my.cnf-settings.conf + Active: active (running) since Sat 2020-05-02 03:02:18 UTC; 2 days ago + Docs: man:mysqld(8) + https://mariadb.com/kb/en/library/systemd/ + Process: 2448 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) + Process: 2388 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=/usr/bin/galera_recovery; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS) + Process: 2386 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) + Main PID: 2412 (mysqld) + Status: "Taking your SQL requests now…" + CGroup: /system.slice/mariadb.service + └─2412 /usr/sbin/mysqld + +May 03 21:41:26 ns2.2daygeek.com mysqld[2412]: 2020-05-03 21:41:26 140328136861440 [Warning] Host name '1.1.1.1' could not be resolved: … not known +May 04 02:00:46 ns2.2daygeek.com mysqld[2412]: 2020-05-04 2:00:46 140328436418304 [Warning] IP address '1.1.1.1' has been resolved to the host name '2…ss itself. +May 04 03:01:31 ns2.2daygeek.com mysqld[2412]: 2020-05-04 3:01:31 140328436111104 [Warning] IP address '1.1.1.1' could not be resolved: Temporary fai…resolution +May 04 04:03:06 ns2.2daygeek.com mysqld[2412]: 2020-05-04 4:03:06 140328136861440 [Warning] IP address '1.1.1.1' could not be resolved: Name or ser… not known +May 04 07:23:54 ns2.2daygeek.com mysqld[2412]: 2020-05-04 7:23:54 140328435189504 [Warning] IP address '1.1.1.1' could not be resolved: Name or service not known +May 04 08:03:31 ns2.2daygeek.com mysqld[2412]: 2020-05-04 8:03:31 140328436418304 [Warning] IP address '1.1.1.1' could not be resolved: Name or service not known +May 04 08:25:56 ns2.2daygeek.com mysqld[2412]: 2020-05-04 8:25:56 140328135325440 [Warning] IP address '1.1.1.1' could not be resolved: Name or service not known +Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable. +Hint: Some lines were ellipsized, use -l to show in full. +``` + +### Method-3: How to Check the Uptime of a MySQL/MariaDB Database Server on Linux Using the MySQLAdmin Command + +**[MySQLAdmin][8]** is a command-line utility for MySQL Server that is installed when installing the MySQL package. + +The MySQLAdmin client allows you to perform some basic administrative functions on the MySQL server. + +It is used to create a database, drop a database, set a root password, change the root password, check MySQL status, verify MySQL functionality, monitor mysql processes, and verify the configuration of the server. + +``` +# mysqladmin -u root -pPassword version + +mysqladmin Ver 8.42 Distrib 5.7.27, for Linux on x86_64 +Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. + +Oracle is a registered trademark of Oracle Corporation and/or its +affiliates. Other names may be trademarks of their respective +owners. + +Server version 5.7.27 +Protocol version 10 +Connection Localhost via UNIX socket +UNIX socket /var/lib/mysql/mysql.sock +Uptime: 1 day 10 hours 44 min 13 sec +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-mysql-mariadb-database-server-uptime-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/linux-system-server-uptime-check/ +[2]: https://www.2daygeek.com/check-find-apache-httpd-web-server-uptime-linux/ +[3]: https://www.2daygeek.com/linux-ps-command-find-running-process-monitoring/ +[4]: https://www.2daygeek.com/category/mysql/ +[5]: https://www.2daygeek.com/check-find-parent-process-id-pid-ppid-linux/ +[6]: https://www.2daygeek.com/category/mariadb/ +[7]: https://www.2daygeek.com/sysvinit-vs-systemd-cheatsheet-systemctl-command-usage/ +[8]: https://www.2daygeek.com/linux-mysqladmin-command-administrate-mysql-mariadb-server/ From fa8df9c7325af368c5190b99fc02e19f09f2c868 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 6 May 2020 01:16:16 +0800 Subject: [PATCH 0611/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200506=20Afte?= =?UTF-8?q?r=20More=20Than=203=20Years,=20Inkscape=201.0=20is=20Finally=20?= =?UTF-8?q?Here=20With=20Tons=20of=20Feature=20Improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md --- ... Here With Tons of Feature Improvements.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md diff --git a/sources/tech/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md b/sources/tech/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md new file mode 100644 index 0000000000..b036d7a56a --- /dev/null +++ b/sources/tech/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements) +[#]: via: (https://itsfoss.com/inkscape-1-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements +====== + +Even though I’m not an expert, it is safe to say that Inkscape is one of the [best vector graphics editors][1]. + +Not just limited to the reason that it is free and open-source software – but it is indeed a useful application for digital artists creating something on it. + +The last release (version 0.92) was about 3 years ago. And, now, finally, [Inkscape announced its 1.0 release][2] – with a bunch of new features, additions, and improvements. + +### Inkscape 1.0: What’s New? + +![Inkscape 1.0][3] + +Here, let me highlight the important key changes that you need to know about Inkscape 1.0 release: + +#### First native macOS application + +It’s always good to have a proper cross-platform support for amazing tools like Inkscape. And, with the latest release, a native macOS application has been made available as well. + +Do note that the macOS app is still a **preview** version and has room for a lot of improvements. However, with a better system integration without needing [XQuartz][4], it should be a promising progress for macOS users. + +#### Performance Improvements + +Any kind of application/tool benefits from a significant performance boost. And, so does Inkscape. + +With its 1.0 release, they mention that you will be able to notice the smoother performance when using Inkscape for all the creative work you do. + +Except on macOS (which is still a “preview” version), Inkscape should run just fine on Linux and Windows. + +#### Improved UI and HiDPI Support + +![][5] + +In their release notes, they’ve mentioned: + +> A major milestone was achieved in enabling Inkscape to use a more recent version of the software used to build the editor’s user interface (namely GTK+3). Users with HiDPI (high resolution) screens can thank teamwork that took place during the 2018 Boston Hackfest for setting the updated-GTK wheels in motion. + +So, starting from GTK +3 user interface to the HiDPI support for high-resolution screens, it is a wonderful upgrade. + +Not to forget, you get more customization options to tweak the look and feel as well. + +#### New Feature Additions + +![][6] + +On paper, the list of new features sounds good. Depending on your expertise and what you prefer, the latest additions should come in handy. + +Here’s an overview of the new features: + + * New and improved Live Path Effect (LPE) features + * A new searchable LPE selection dialog + * Freestyle drawing users can now mirror and rotate the canvas + * The new PowerPencil mode of the Pencil tool provides pressure-dependent width and it is finally possible to create closed paths. + * New path effects that will appeal to the artistic user include Offset, PowerClip, and PowerMask LPEs. + * Ability to create a duplicate guide, aligning grids to the page, the Measure tool’s path length indicator, and the inverted Y-axis. + * Ability to export PDFs with clickable links and metadata + * New palettes and mesh gradients that work in the web browser + + + +While I’ve tried to compile the list of the key features added to this release, you can get all the nitty gritty details in their [release notes][7]. + +#### Other Important Changes + +Along with all the major changes, Inkscape 1.0 now supports Python 3. And, with that going forward, you might notice some extensions that don’t work with the latest version. + +So, if your work depends on the workflow of your extensions, I suggest you to take a closer look at their [release notes][7] to get all the technical details. + +### Download & Install Inkscape 1.0 on Linux + +Inkscape 1.0 is available in AppImage and Snap format for Linux. You can download it from Inkscape’s website. + +[Download Inkscape 1.0 for Linux][8] + +If you aren’t aware, you can check [how to use AppImage file on Linux][9] to get started. You may also refer to [this Snap guide][10]. + +Ubuntu users can find the snap version of Inskcape 1.0 in the Ubuntu Software Center. + +I used the AppImage file on [Pop OS 20.04][11] and it worked just fine to get started. You can test drive all the features in detail to see how it works out for you. + +Have you tried it yet? Let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/inkscape-1-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/vector-graphics-editors-linux/ +[2]: https://inkscape.org/news/2020/05/04/introducing-inkscape-10/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/inkscape-1-0.jpg?ssl=1 +[4]: https://en.wikipedia.org/wiki/XQuartz +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/inkscape-ui-customization.jpg?ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/inkscape-live-path-effects.jpg?ssl=1 +[7]: https://wiki.inkscape.org/wiki/index.php/Release_notes/1.0 +[8]: https://inkscape.org/release/1.0/gnulinux/ +[9]: https://itsfoss.com/use-appimage-linux/ +[10]: https://itsfoss.com/install-snap-linux/ +[11]: https://itsfoss.com/pop-os-20-04-review/ From 73f3fbc0b669c5f0b41702b3c47ee465a5588d9a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 6 May 2020 01:17:47 +0800 Subject: [PATCH 0612/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200505=2011?= =?UTF-8?q?=20DevOps=20lessons=20from=20My=20Little=20Pony?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200505 11 DevOps lessons from My Little Pony.md --- ...5 11 DevOps lessons from My Little Pony.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20200505 11 DevOps lessons from My Little Pony.md diff --git a/sources/tech/20200505 11 DevOps lessons from My Little Pony.md b/sources/tech/20200505 11 DevOps lessons from My Little Pony.md new file mode 100644 index 0000000000..f550f871a1 --- /dev/null +++ b/sources/tech/20200505 11 DevOps lessons from My Little Pony.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (11 DevOps lessons from My Little Pony) +[#]: via: (https://opensource.com/article/20/5/devops-lessons) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +11 DevOps lessons from My Little Pony +====== +What you never thought you could learn about DevOps for Twilight Sparkle +and her friends. +![My Little Pony][1] + +In 2010, the My Little Pony franchise was rebooted with the animated show _My Little Pony: Friendship is Magic_. The combination of accessibility to children with the sophisticated themes the show tackled garnered a following that cut across ages. I was swept up in the wave and discovered there is a lot to learn about DevOps from the show. + +### Discovering technical debt + +The show begins with Twilight Sparkle reading obscure documentation, only to realize that Equestria, where the show is set, is due to suffer a calamity. Though someone named Nightmare Moon has been imprisoned for a thousand years, there is a prophecy she will return. + +#### Lesson 1: Technical debt matters. + +Nightmare Moon is a perfect stand-in for technical debt. Document it. Pay attention to the signs of risk no matter how infrequently they occur. Have a plan to resolve it. + +Twilight Sparkle goes to her manager with the news, only to be told that it is not a current priority. She is sent to Ponyville to prepare for the coming celebration, instead. + +#### Lesson 2: Communication with management is key. + +Twilight Sparkle communicated her priority (the risk of technical debt) but did not convince her management that it was more important than the celebration (of the next release or a new customer). + +We all need to make clear what the business case is for resolving critical issues. It is also not straightforward to explain technical debt in business terms. If management does not agree on the severity, find new ways to communicate the risk, and team up with others who speak that language. + +### When technical debt becomes an outage + +As the prophecy has foreseen, Nightmare Moon returns and declares eternal night. (In this DevOps story, this marks the beginning of a catastrophic outage.) Twilight quickly understands that she cannot resolve the issue by herself, and she recruits the ponies who will become, with her, the "Mane Six." They each stand for a different element of harmony—Applejack stands for Honesty, Fluttershy for Kindness, Pinkie Pie for Laughter, Rarity for Generosity, Rainbow Dash for Loyalty, and Twilight Sparkle herself for Magic. This team-building is full of lessons: + +#### Lesson 3: Few are the issues that can be resolved by one person. + +When facing an outage, reach out to other people with complementary skills who can help you. It is best if they are different than you: different backgrounds leads to differing perspectives, and that can lead to better problem-solving. + +#### Lesson 4: When resolving an outage, honest communication is key. + +Throughout the struggle against the eternal night, the Mane Six have to speak openly and honestly about what's not working. Their [blameless communication][2] is part of problem-solving. + +#### Lesson 5: When resolving an outage, kindness to yourself and to others is crucial. + +Though tempers flare hot in the land of Equestria, we all benefit from coming back to working together. + +#### Lesson 6: Laughter is important. + +Even when everything comes crashing down, remember to take a break, drink a glass of water, and take a deep breath. Stressing out does not help anything. + +#### Lesson 7: Be generous. + +Even if you are not on-call right now, if your help is needed to resolve a problem, help out as you hope your colleagues will do for you. + +#### Lesson 8: Be loyal. + +An outage is not a time to settle rivalries between teams. Focus on how to collaborate and resolve the outage as a team. + +#### Lesson 9: Though people skills are important, you have to understand the technology on a deep level. + +Keep your skills sharp. Expertise is not only the ability to learn; it is knowing when that information is needed. Part of being an expert is practice. + +### Growing into a culture of continual improvement + +After the issue is resolved, Princess Celestia realizes that the Mane Six are crucial to the long-term survival of Equestria, and tells Twilight Sparkle to stay in Ponyville and keep researching the magic of friendship. + +#### Lesson 10: After an outage is resolved, conduct a review, take concrete lessons, and act on them. + +I could go on, episode by episode, detailing lessons relevant for DevOps, but I will wrap up with one of my favorite ones. In the "Winter Wrap-Up" episode, all the ponies in Ponyville help in preparing for the spring. As per tradition, they do not use magic, leaving Twilight Sparkle to wonder how she can contribute. Eventually, she realizes that she can help by making a checklist to make sure everything is done in the right order. + +#### Lesson 11: When automation is impossible or inadvisable, write a solid checklist, and follow it. Do not depend on your memory. + +Twilight Sparkle and the Mane Six overcome great obstacles as a team, and now have a system to improve as a team. + +### A story of DevOps + +This story reflects how many organizations slowly adopt DevOps. The transition from recognizing a fear of technical debt toward addressing it is not simple. With courageous leadership, teamwork, and a willingness to improve, all organizations can come out on the other side with a similar story to Twilight Sparkle and her friends. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/devops-lessons + +作者:[Moshe Zadka][a] +选题:[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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/my-little-pony.jpg?itok=X-rwAGuE (My Little Pony) +[2]: https://opensource.com/article/19/4/psychology-behind-blameless-retrospective From a0e4f624b4db19d7fde9a83a4a8ccc29bca27ec6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 6 May 2020 01:18:47 +0800 Subject: [PATCH 0613/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200505=208=20?= =?UTF-8?q?open=20source=20video=20games=20to=20play?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200505 8 open source video games to play.md --- ...00505 8 open source video games to play.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20200505 8 open source video games to play.md diff --git a/sources/tech/20200505 8 open source video games to play.md b/sources/tech/20200505 8 open source video games to play.md new file mode 100644 index 0000000000..ac0577d96b --- /dev/null +++ b/sources/tech/20200505 8 open source video games to play.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (8 open source video games to play) +[#]: via: (https://opensource.com/article/20/5/open-source-fps-games) +[#]: author: (Aman Gaur https://opensource.com/users/amangaur) + +8 open source video games to play +====== +These games are fun and free to play, a way to connect with friends, and +an opportunity to make an old favorite even better. +![Gaming on a grid with penguin pawns][1] + +Video games are a big business. That's great for the industry's longevity—not to mention for all the people working in programming and graphics. But it can take a lot of work, time, and money to keep up with all the latest gaming crazes. If you feel like playing a few quick rounds of a video game without investing in a new console or game franchise, then you'll be happy to know that there are plenty of open source combat games you can download, play, share, and even modify (if you're inclined to programming) for free. + +First-person shooters (FPS) are one of the most popular categories of video games. They are centered around the perspective of the protagonist (the player), and they often offer weapon-based advancement. As you get better at the game, you survive longer, you get better weapons, and you increase your power. FPS games have a distinct look and feel, which is reflected in the category's name: players see everything—their weapons and the game world—in first person, as if they're looking through their player character's eyes. + +If you want to give one a try, check out the following eight great open source FPS games. + +### Xonotic + +![Xonotic][2] + +[Xonotic][3] is a fast-paced, arena-based FPS game. It is a popular game in the open source world. One reason could be the fact that it has never been a mainstream game. It offers a variety of weapons and enemies that are thrown right at you mercilessly from the start. Demanding quick action and response, it is an experience that will keep you on the edge of your seats. The game is available under the GPLv3+ license. + +### Wolfenstein Enemy Territory + +![Wolfenstein Enemy Territory][4] + +Wolfenstein has been a major franchise in gaming for many years. If you are a fan of gore and glory, then you've probably already heard of this game (if not, you'll love it once you try it). [Wolfenstein Enemy Territory][5] is an early iteration of the popular World War II game. It became free to play in 2003, and its [source code][6] is provided under the GPLv3. To play, however, you must own the game data (or recreate it yourself) separately (which remains under its original EULA). + +### Doom + +![Doom][7] + +[Doom][8] is a wildly popular game that was also an early example of games on Linux—way back in 2004. There are many iterations of the game, many of which have been released as open source. The game is about acquiring a teleportation device that's been captured by demons, so the violence, while gory, is low on realism. The source code for the game was provided under the GPL, but many versions require that you own the game for the game assets. There are dozens of ports and adaptations, including [Freedoom][9] (with free assets), [Dhewm3][10], [RBDoom-3-BFG][11], and many more. Try a few and pick your favorite! + +### Smokin' Guns + +![Smokin' Guns][12] + +If you're a fan of the Old West and six-shooters, this FPS is for you. From cowboys to gunslingers and with a captivating background score, [Smokin' Guns][13] has it all. It's a semi-realistic simulation of the old spaghetti western. On your way through the game, you face multiple enemies and get multiple weapons, so there's always the promise of excitement and danger around the corner. The game is free and open source under the terms of the GPLv2. + +### Nexuiz + +![Nexuiz][14] + +[Nexuiz][15] (classic) is another great FPS that's free to play on multiple platforms. The game is based on the Quake engine and has been made open source under the GNU GPLv2. The game offers multiple modes, including online, LAN party, and bot training. The game features sophisticated weapons and fast action. It's brutal and exciting, with an objective: kill as many opponents as possible before they get you. + +Note that the open source version of Nexuiz is not the same as the version built on CryEngine3 that is sold on Steam. + +### .kkrieger + +![kkrieger][16] + +[.Kkrieger][17] was developed in 2004 by .theprodukkt, a German demogroup. The game was developed using an unreleased (at the time) engine known as Werkkzeug. This game might feel a little slow to many, but it still offers an intense experience. The approaching enemies are slow, but their sheer number makes it confusing to know which one to take down first. It's an onslaught, and you have to shoot through layers of enemies before you reach the final boss. It was released in a rather raw form on [GitHub][18] by its creators under a BSD license with some public domain components. + +### Warsow + +![Warsow][19] + +If you've ever played Borderlands 2, then imagine [Warsow][20] as an arena-style Borderlands. The game is built on a modernized Quake II engine, and its plot takes a simple approach: Kill as many opponents as possible. The team with the most number of kills wins. Despite its simplicity, it features amazing weaponry and lots of great trick moves, like circle jumping, bunny hopping, double jumping, ramp sliding, and so on. It makes for an engaging multiplayer session, and it's been recognized by multiple online leagues as a worthy game for their competitions. Get the source code from [GitHub][21] or install the game from your software repository. + +### World of Padman + +![World of Padman][22] + +[The World of Padman][23] may be the last game on this list, but it's one of the most unique. Designed by PadWorld Entertainment, World of Padman takes a different twist graphically and introduces you to quirky and whimsical characters in a colorful (albeit cartoonishly violent) world. It's based on the ioquake3 engine, and its unique style and uproarious gameplay have earned it a featured place in multiple gaming magazines. You can download the source code from [GitHub][24]. + +### Give one a shot + +A game that becomes open source can act as a template for something great, whether it's a wholly open source version of an old classic, a remix of a beloved game, or an entirely new platform built on an old reliable engine. + +Open source gaming is important for many reasons: it provides users with a fun diversion, a way to connect with friends, and an opportunity for programmers and designers to hack within an existing framework. If titles like Doom weren't made open source, a little bit of video game history would be lost. Instead, it endures and has the opportunity to grow even more. + +Try an open source game, and watch your six. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/open-source-fps-games + +作者:[Aman Gaur][a] +选题:[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/amangaur +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/game_pawn_grid_linux.png?itok=4gERzRkg (Gaming on a grid with penguin pawns) +[2]: https://opensource.com/sites/default/files/uploads/xonotic.jpg (Xonotic) +[3]: https://www.xonotic.org/download/ +[4]: https://opensource.com/sites/default/files/uploads/wolfensteinenemyterritory.jpg (Wolfenstein Enemy Territory) +[5]: https://www.splashdamage.com/games/wolfenstein-enemy-territory/ +[6]: https://github.com/id-Software/Enemy-Territory +[7]: https://opensource.com/sites/default/files/uploads/doom.jpg (Doom) +[8]: https://github.com/id-Software/DOOM +[9]: https://freedoom.github.io/ +[10]: https://dhewm3.org/ +[11]: https://github.com/RobertBeckebans/RBDOOM-3-BFG/ +[12]: https://opensource.com/sites/default/files/uploads/smokinguns.jpg (Smokin' Guns) +[13]: https://www.smokin-guns.org/downloads +[14]: https://opensource.com/sites/default/files/uploads/nexuiz.jpg (Nexuiz) +[15]: https://sourceforge.net/projects/nexuiz/ +[16]: https://opensource.com/sites/default/files/uploads/kkrieger.jpg (kkrieger) +[17]: https://web.archive.org/web/20120204065621/http://www.theprodukkt.com/kkrieger +[18]: https://github.com/farbrausch/fr_public +[19]: https://opensource.com/sites/default/files/uploads/warsow.jpg (Warsow) +[20]: https://www.warsow.net/download +[21]: https://github.com/Warsow +[22]: https://opensource.com/sites/default/files/uploads/padman.jpg (World of Padman) +[23]: https://worldofpadman.net/en/ +[24]: https://github.com/PadWorld-Entertainment From 20388ad705e6854d78dd86f496f84b9d6b4e80c2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 6 May 2020 01:19:38 +0800 Subject: [PATCH 0614/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200505=20Anal?= =?UTF-8?q?yzing=20data=20science=20code=20with=20R=20and=20Emacs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200505 Analyzing data science code with R and Emacs.md --- ...zing data science code with R and Emacs.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20200505 Analyzing data science code with R and Emacs.md diff --git a/sources/tech/20200505 Analyzing data science code with R and Emacs.md b/sources/tech/20200505 Analyzing data science code with R and Emacs.md new file mode 100644 index 0000000000..ebcfadbe92 --- /dev/null +++ b/sources/tech/20200505 Analyzing data science code with R and Emacs.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Analyzing data science code with R and Emacs) +[#]: via: (https://opensource.com/article/20/5/r-emacs-data-science) +[#]: author: (Peter Prevos https://opensource.com/users/danderzei) + +Analyzing data science code with R and Emacs +====== +Emacs' versatility and extensibility bring the editor's full power into +play for writing data science code. +![metrics and data shown on a computer screen][1] + +Way back in 2012, _Harvard Business Review_ published an article that proclaimed "data scientist" to be the [sexiest job][2] of the 21st century. Interest in data science has exploded since then. Many great open source projects, such as [Python][3] and the [R language][4] for statistical computing, have facilitated the rapid developments in how we analyze data. + +I started my career using pencil and paper and moved to spreadsheets. Now the R language is my weapon of choice when I need to create value from data. Emacs is another one of my favorite tools. This article briefly explains how to use the [Emacs Speaks Statistics][5] (ESS) package to get started with developing R projects in this venerable editor. + +The vast majority of R developers use the [RStudio][6] IDE to manage their projects. RStudio is a powerful open source editor with specialized functionality to develop data science projects. RStudio is a great integrated development environment (IDE), but its editing functions are limited. + +Using Emacs to write data science code means that you have access to the full power of this extensible editor. I prefer using Emacs for my data science projects because I can do many other tasks within the same application, leveraging the multifunctionality of this venerable editor. If you are just getting started with Emacs, then please first read Seth Kenlon's [Emacs getting started][7] article. + +### Setting up Emacs for R + +Emacs is an almost infinitely extensible text editor, which unfortunately means that many things don't work the way you want them to out of the box. Before you can write and execute R scripts, you need to install some packages and configure them. The ESS package provides an interface between Emacs and R. Other packages, such as [Company][8] and [highlight-parentheses][9] help with completion and balancing parentheses. + +Emacs uses a version of Lisp for configuration. The lines of [Emacs Lisp][10] code below install the required extensions and define a minimal configuration to get you started. These lines were tested for GNU Emacs version 26.3. + +Copy these lines and save them in a file named **init.el** in your **.emacs.d** folder. This is the folder that Emacs uses to store configurations, including the [init file][11]. If you already have an init file, then you can append these lines to your config. This minimal configuration is enough to get you started. + + +``` +;; Elisp file for R coding with Emacs + +;; Add MELPA repository and initialise the package manager +(require 'package) +(add-to-list 'package-archives +             '("melpa" . "")) +(package-initialize) + +;; Install use-package,in case it does not exist yet +;; The use-package software will install all other packages as required +(unless (package-installed-p 'use-package) +  (package-refresh-contents) +  (package-install 'use-package)) + +;; ESS configurationEmacs Speaks Statistics +(use-package ess +  :ensure t +) + +;; Auto completion +(use-package company +  :ensure t +  :config +  (setq company-idle-delay 0) +  (setq company-minimum-prefix-length 2) +  (global-company-mode t) +) + +; Parentheses +(use-package highlight-parentheses +  :ensure t +  :config +  (progn +    (highlight-parentheses-mode) +    (global-highlight-parentheses-mode)) +  ) +``` + +### Using the R console + +To start an R console session, press **M-x R** and hit **Enter** (**M** is the Emacs way to denote the **Alt** or **Command** key). ESS will ask you to nominate a working directory, which defaults to the folder of the current buffer. You can use more than one console in the same Emacs session by repeating the R command. + +Emacs opens a new buffer for your new R console. You can also use the **Up** and **Down** arrow keys to go to previous lines and re-run them. Use the **Ctrl** and **Up/Down** arrow keys to recycle old commands. + +The Company ("complete anything") package manages autocompletion in both the console and R scripts. When entering a function, the mini-buffer at the bottom of the screen shows the relevant parameters. When the autocompletion dropdown menu appears, you can press **F1** to view the chosen option's Help file before you select it. + +The [highlight-parentheses][9] package does what its name suggests. Several other Emacs packages are available to help you balance parentheses and other structural elements in your code. + +### Writing R scripts + +Emacs recognizes R mode for any buffer with a **.R** extension (the file extension is case-sensitive). Open or create a new file with the **C-x C-f** shortcut and type the path and file name. You can start writing your code and use all of the powerful editing techniques that Emacs provides. + +Several functions are available to evaluate the code. You can evaluate each line separately with **C-<return>**, while **C-c C-c** will evaluate a contiguous region. Keying **C-c C-b** will evaluate the whole buffer. + +When you evaluate some code, Emacs will use any running console or ask you to open a new console to run the code. + +The output of any plotting functions appears in a window outside of Emacs. If you prefer to view the output within Emacs, then you need to save the output to disk and open the resulting file in a separate buffer. + +![Literate programming in Org mode, the ESS buffer, and graphics output.][12] + +Literate programming in Org mode, the ESS buffer, and graphics output. + +### Advanced use + +This article provides a brief introduction to using R in Emacs. Many parameters can be fine-tuned to make Emacs behave according to your preferences, but it would take too much space to cover them here. The [ESS manual][13] describes these in detail. You can also extend functionality with additional packages. + +Org mode can integrate R code, providing a productive platform for literate programming. If you prefer to use RMarkdown, the [Polymode][14] package has you covered. + +Emacs has various packages to make your editing experience more efficient. The best part of using Emacs to write R code is that the program is more than just an IDE; it is a malleable computer system that you can configure to match your favorite workflow. + +Learning how to configure Emacs can be daunting. The best way to learn quickly is to copy ideas from people who share their configurations. Miles McBain manages a [list of Emacs configurations][15] that could be useful if you want to explore using the R language in Emacs further. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/r-emacs-data-science + +作者:[Peter Prevos][a] +选题:[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/danderzei +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://hbr.org/2012/10/data-scientist-the-sexiest-job-of-the-21st-century +[3]: https://www.python.org/ +[4]: https://www.r-project.org/ +[5]: https://ess.r-project.org/ +[6]: https://opensource.com/article/18/2/getting-started-RStudio-IDE +[7]: https://opensource.com/article/20/3/getting-started-emacs +[8]: https://company-mode.github.io/ +[9]: https://github.com/tsdh/highlight-parentheses.el +[10]: https://en.wikipedia.org/wiki/Emacs_Lisp +[11]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html +[12]: https://opensource.com/sites/default/files/uploads/r-ess-screenshot.jpg (Literate programming in Org mode, the ESS buffer, and graphics output.) +[13]: https://ess.r-project.org/index.php?Section=documentation&subSection=manuals +[14]: https://github.com/polymode/polymode +[15]: https://github.com/MilesMcBain/esscss From bbb7192034188dc2b21697981518e40fc3701d04 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 6 May 2020 08:22:48 +0800 Subject: [PATCH 0615/1809] Rename sources/tech/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md to sources/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md --- ...scape 1.0 is Finally Here With Tons of Feature Improvements.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md (100%) diff --git a/sources/tech/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md b/sources/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md similarity index 100% rename from sources/tech/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md rename to sources/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md From 1a966c068ded416f55cdfc4bd145d11dcfb4cf5f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 6 May 2020 08:25:33 +0800 Subject: [PATCH 0616/1809] Rename sources/tech/20200505 11 DevOps lessons from My Little Pony.md to sources/talk/20200505 11 DevOps lessons from My Little Pony.md --- .../20200505 11 DevOps lessons from My Little Pony.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200505 11 DevOps lessons from My Little Pony.md (100%) diff --git a/sources/tech/20200505 11 DevOps lessons from My Little Pony.md b/sources/talk/20200505 11 DevOps lessons from My Little Pony.md similarity index 100% rename from sources/tech/20200505 11 DevOps lessons from My Little Pony.md rename to sources/talk/20200505 11 DevOps lessons from My Little Pony.md From 40bb59f0f21f43ea281031b80bc42dc2edffc89c Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 6 May 2020 08:35:34 +0800 Subject: [PATCH 0617/1809] translated --- ...and Folders on Desktop Screen in Ubuntu.md | 100 ------------------ ...and Folders on Desktop Screen in Ubuntu.md | 100 ++++++++++++++++++ 2 files changed, 100 insertions(+), 100 deletions(-) delete mode 100644 sources/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md create mode 100644 translated/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md diff --git a/sources/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md b/sources/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md deleted file mode 100644 index 32eeaa9c95..0000000000 --- a/sources/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using Files and Folders on Desktop Screen in Ubuntu) -[#]: via: (https://itsfoss.com/add-files-on-desktop-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Using Files and Folders on Desktop Screen in Ubuntu -====== - -_**This beginner tutorial discusses a few difficulties you may face while adding files and folders on the desktop screen on Ubuntu.**_ - -I know a few people who are habitual of putting all the important/frequently used files on the desktop screen for quick access. - -![][1] - -I am not a fan of a cluttered desktop screen but I can imagine that it might actually be helpful to some people. - -For the past few releases, it has been difficult to add files on the desktop screen in Ubuntu’s default GNOME desktop. It’s not really Ubuntu’s fault. - -The [GNOME][2] developers thinks that there is no place for icons and files on the desktop screen. There is no need of putting files on the desktop when you can easily search for it in the menu. And that’s part true. - -This is why the newer version of [GNOME’s File Manager Nautilus][3] doesn’t support icons and files on the desktop very well. - -That said, it’s not impossible to add files and folders on the desktop. Let me show you how you can still use it. - -### Adding files and folders on the desktop screen in Ubuntu - -![][4] - -I am using Ubuntu 20.04 in this tutorial. The steps may or may not vary for other Ubuntu versions. - -#### Add the files and folders to the “Desktop folder” - -If you open the file manager, you should see an entry called Desktop in the left sidebar or in the folders list. This folder represents your desktop screen (in a way). - -![Desktop folder can be used to add files to the desktop screen][5] - -Anything you add to this folder will be reflected on the desktop screen. - -![Anything added to the Desktop folder will be reflected on the desktop screen][6] - -If you delete files from this ‘Desktop folder’, it will be removed from the desktop screen as well. - -#### Drag and drop files to desktop screen doesn’t work - -Now, if you try to drag and drop files from the file manager on the desktop, it won’t work. It’s not a bug, it’s a feature that irks a lot of people. - -A workaround would be to open two instances of the file manager. Open Desktop folder in one of them and then drag and drop files to this folder and they will be added on the desktop. - -I know that’s not ideal but you don’t have a lot of choices here. - -#### You cannot use Ctrl+C and Ctrl+V to copy-paste on the desktop, use the right click menu - -To add salt to injury, you cannot use Ctrl+V the famous keyboard shortcut to paste files on the desktop screen. - -But you can still use the right click context menu and select Paste from there to put the copied files on the desktop. You can even create new folders this way. - -![Right click menu can be used for copy-pasting files to desktop][7] - -Does it make sense? Not to me but that’s how it is in Ubuntu 20.04. - -#### You cannot delete files and folder using the Delete key, use the right click menu again - -What’s worse is that you cannot use the delete key or shift delete key to remove files from the desktop screen. But you can still right click on the files or folders and select “Move to trash” to delete the file. - -![Delete files from desktop using right click][8] - -Alright, so now you know that at least there is a way to add files on the desktop with some restrictions. But it doesn’t end here unfortunately. - -You cannot search for files with their names on the desktop screen. Normally, if you start typing ‘abc’, files starting with ‘abc’ are highlighted. You don’t get it here. - -I don’t know why so many restrictions have been put on adding files on the desktop. Thankfully, I don’t use it a lot otherwise I have been way too frustrated. - -If interested, you may read about [adding application shortcut on the desktop in Ubuntu][9] as well. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/add-files-on-desktop-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/files-on-desktop-ubuntu.jpg?ssl=1 -[2]: https://www.gnome.org/ -[3]: https://wiki.gnome.org/Apps/Files -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/adding-files-desktop-ubuntu.png?ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/desktop-folder-ubuntu.png?ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/adding-files-desktop-screen-ubuntu.jpg?ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/adding-new-files-ubuntu-desktop.jpg?ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/delete-files-from-desktop-ubuntu.jpg?ssl=1 -[9]: https://itsfoss.com/ubuntu-desktop-shortcut/ diff --git a/translated/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md b/translated/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md new file mode 100644 index 0000000000..984bb4dedb --- /dev/null +++ b/translated/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Files and Folders on Desktop Screen in Ubuntu) +[#]: via: (https://itsfoss.com/add-files-on-desktop-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +在 Ubuntu 桌面中使用文件和文件夹 +====== + +_**此初学者教程讨论了 在Ubuntu 桌面上添加文件和文件夹时可能遇到的一些困难。**_ + +我认识一些习惯将所有重要/常用文件放在桌面上以便快速访问的人。 + +![][1] + +我不喜欢杂乱的桌面,但是我可以想象它实际上可能对某些人有所帮助。 + +在过去的几个版本中,很难在 Ubuntu 的默认 GNOME 桌面上添加文件。这并不是 Ubuntu 的错。 + +[GNOME][2] 的开发者认为,桌面上没有图标和文件的位置。当你可以在菜单中轻松搜索文件时,无需将文件放在桌面上。这部分是事实。 + +这就是为什么 [GNOME 的文件管理器 Nautilus][3]的较新版本不能很好地支持桌面上的图标和文件的原因。 + +也就是说,在桌面上添加文件和文件夹并非没有可能。让我告诉你如何做。 + +### 在 Ubuntu 的桌面上添加文件和文件夹 + +![][4] + +我在本教程中使用的是 Ubuntu 20.04。对于其他 Ubuntu 版本,步骤可能会有所不同。 + +#### 将文件和文件夹添加到“桌面文件夹” + +如果打开文件管理器,你应该在左侧边栏或文件夹列表中看到一个名为“桌面”的条目。此文件夹(以某种方式)代表你的桌面。 + +![Desktop folder can be used to add files to the desktop screen][5] + +你添加到此文件夹的所有内容都会反应在桌面上。 + +![Anything added to the Desktop folder will be reflected on the desktop screen][6] + +如果你从“桌面文件夹”中删除文件,那么文件也会从桌面中删除。 + +#### 将文件拖放到桌面不起作用 + +现在,如果你尝试在桌面上从文件管理器拖放文件,它会不起使用。这不是一个 bug,它是一个使很多人恼火的功能。 + +一种临时方案是打开两个文件管理器。在其中一个打开“桌面”文件夹,然后将文件拖放到该文件夹​​中,它们将被添加到桌面上。 + +我知道这并不理想,但是你没有太多选择。 + +#### 你不能使用 Ctrl+C 和 Ctrl+V 在桌面上复制粘贴,请使用右键单击菜单 + +更恼人的是,你不能使用 Ctrl+V(著名的键盘快捷键)将文件粘贴到桌面上。 + +但是,你仍然可以使用右键单击,然后选择“粘贴”,将文件复制到桌面上。你甚至可以通过这种方式创建新文件夹。 + +![Right click menu can be used for copy-pasting files to desktop][7] + +是否有意义?对我来说不是,但这就是 Ubuntu 20.04 的方式。 + +#### 你无法使用 Delete 键删除文件和文件夹,请再次使用右键菜单 + +更糟糕的是,你无法使用 Delete 键或 Shift+Delete 键从桌面上删除文件。但是你仍然可以右键单击文件或文件夹,然后选择“移至回收站”来删除文件。 + +![Delete files from desktop using right click][8] + +好了,你现在知道至少有一种方法可以在桌面上添加文件,但有一些限制。不幸的是,这还没有结束。 + +你无法在桌面上用名称搜索文件。通常,如果你开始输入 “abc”,那么以 “abc” 开头的文件会高亮显示。你并不明白。 + +我不知道为什么在桌面上添加文件受到了如此多的限制。值得庆幸的是,我不会经常使用它,否则我会感到非常沮丧。 + +如果有兴趣,你也可以阅读[在 Ubuntu 桌面上添加应用快捷方式][9]这篇文章。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/add-files-on-desktop-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/files-on-desktop-ubuntu.jpg?ssl=1 +[2]: https://www.gnome.org/ +[3]: https://wiki.gnome.org/Apps/Files +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/adding-files-desktop-ubuntu.png?ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/desktop-folder-ubuntu.png?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/adding-files-desktop-screen-ubuntu.jpg?ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/adding-new-files-ubuntu-desktop.jpg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/delete-files-from-desktop-ubuntu.jpg?ssl=1 +[9]: https://itsfoss.com/ubuntu-desktop-shortcut/ From bc09a3b5a8ce1d3a1e221f6f9dc6e8af9b04238f Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 6 May 2020 08:39:07 +0800 Subject: [PATCH 0618/1809] translating --- .../20200501 Using mergerfs to increase your virtual storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200501 Using mergerfs to increase your virtual storage.md b/sources/tech/20200501 Using mergerfs to increase your virtual storage.md index 06f26abf51..734af93148 100644 --- a/sources/tech/20200501 Using mergerfs to increase your virtual storage.md +++ b/sources/tech/20200501 Using mergerfs to increase your virtual storage.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From bfd297b16f67a07453d9db0fe6f0e15755626336 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 6 May 2020 08:39:28 +0800 Subject: [PATCH 0619/1809] APL --- ...ape 1.0 is Finally Here With Tons of Feature Improvements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md b/sources/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md index b036d7a56a..feb249b973 100644 --- a/sources/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md +++ b/sources/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8cfbdd4cb35e28c472c41ee509314be828b5048a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 6 May 2020 09:41:33 +0800 Subject: [PATCH 0620/1809] TSL&PRF --- ... Here With Tons of Feature Improvements.md | 115 ------------------ ... Here With Tons of Feature Improvements.md | 115 ++++++++++++++++++ 2 files changed, 115 insertions(+), 115 deletions(-) delete mode 100644 sources/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md create mode 100644 translated/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md diff --git a/sources/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md b/sources/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md deleted file mode 100644 index feb249b973..0000000000 --- a/sources/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md +++ /dev/null @@ -1,115 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements) -[#]: via: (https://itsfoss.com/inkscape-1-release/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements -====== - -Even though I’m not an expert, it is safe to say that Inkscape is one of the [best vector graphics editors][1]. - -Not just limited to the reason that it is free and open-source software – but it is indeed a useful application for digital artists creating something on it. - -The last release (version 0.92) was about 3 years ago. And, now, finally, [Inkscape announced its 1.0 release][2] – with a bunch of new features, additions, and improvements. - -### Inkscape 1.0: What’s New? - -![Inkscape 1.0][3] - -Here, let me highlight the important key changes that you need to know about Inkscape 1.0 release: - -#### First native macOS application - -It’s always good to have a proper cross-platform support for amazing tools like Inkscape. And, with the latest release, a native macOS application has been made available as well. - -Do note that the macOS app is still a **preview** version and has room for a lot of improvements. However, with a better system integration without needing [XQuartz][4], it should be a promising progress for macOS users. - -#### Performance Improvements - -Any kind of application/tool benefits from a significant performance boost. And, so does Inkscape. - -With its 1.0 release, they mention that you will be able to notice the smoother performance when using Inkscape for all the creative work you do. - -Except on macOS (which is still a “preview” version), Inkscape should run just fine on Linux and Windows. - -#### Improved UI and HiDPI Support - -![][5] - -In their release notes, they’ve mentioned: - -> A major milestone was achieved in enabling Inkscape to use a more recent version of the software used to build the editor’s user interface (namely GTK+3). Users with HiDPI (high resolution) screens can thank teamwork that took place during the 2018 Boston Hackfest for setting the updated-GTK wheels in motion. - -So, starting from GTK +3 user interface to the HiDPI support for high-resolution screens, it is a wonderful upgrade. - -Not to forget, you get more customization options to tweak the look and feel as well. - -#### New Feature Additions - -![][6] - -On paper, the list of new features sounds good. Depending on your expertise and what you prefer, the latest additions should come in handy. - -Here’s an overview of the new features: - - * New and improved Live Path Effect (LPE) features - * A new searchable LPE selection dialog - * Freestyle drawing users can now mirror and rotate the canvas - * The new PowerPencil mode of the Pencil tool provides pressure-dependent width and it is finally possible to create closed paths. - * New path effects that will appeal to the artistic user include Offset, PowerClip, and PowerMask LPEs. - * Ability to create a duplicate guide, aligning grids to the page, the Measure tool’s path length indicator, and the inverted Y-axis. - * Ability to export PDFs with clickable links and metadata - * New palettes and mesh gradients that work in the web browser - - - -While I’ve tried to compile the list of the key features added to this release, you can get all the nitty gritty details in their [release notes][7]. - -#### Other Important Changes - -Along with all the major changes, Inkscape 1.0 now supports Python 3. And, with that going forward, you might notice some extensions that don’t work with the latest version. - -So, if your work depends on the workflow of your extensions, I suggest you to take a closer look at their [release notes][7] to get all the technical details. - -### Download & Install Inkscape 1.0 on Linux - -Inkscape 1.0 is available in AppImage and Snap format for Linux. You can download it from Inkscape’s website. - -[Download Inkscape 1.0 for Linux][8] - -If you aren’t aware, you can check [how to use AppImage file on Linux][9] to get started. You may also refer to [this Snap guide][10]. - -Ubuntu users can find the snap version of Inskcape 1.0 in the Ubuntu Software Center. - -I used the AppImage file on [Pop OS 20.04][11] and it worked just fine to get started. You can test drive all the features in detail to see how it works out for you. - -Have you tried it yet? Let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/inkscape-1-release/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/vector-graphics-editors-linux/ -[2]: https://inkscape.org/news/2020/05/04/introducing-inkscape-10/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/inkscape-1-0.jpg?ssl=1 -[4]: https://en.wikipedia.org/wiki/XQuartz -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/inkscape-ui-customization.jpg?ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/inkscape-live-path-effects.jpg?ssl=1 -[7]: https://wiki.inkscape.org/wiki/index.php/Release_notes/1.0 -[8]: https://inkscape.org/release/1.0/gnulinux/ -[9]: https://itsfoss.com/use-appimage-linux/ -[10]: https://itsfoss.com/install-snap-linux/ -[11]: https://itsfoss.com/pop-os-20-04-review/ diff --git a/translated/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md b/translated/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md new file mode 100644 index 0000000000..06c61b776b --- /dev/null +++ b/translated/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements) +[#]: via: (https://itsfoss.com/inkscape-1-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +经过了 3 年,Inkscape 1.0 终于发布了 +====== + +![](https://img.linux.net.cn/data/attachment/album/202005/06/094055fvnh9nnnbybwl4jn.jpg) + +虽然我不是这方面的专业人员,但可以肯定地说,Inkscape 是[最好的矢量图形编辑器][1]之一。 + +不仅仅因为它是自由开源软件,而且对于数字艺术家来说,它是一个非常有用的应用程序。 + +上一次发布(0.92 版本)是在 3 年前。现在,终于,[Inkscape 宣布了它的 1.0 版本][2] —— 增加了很多新的功能和改进。 + +### Inkscape 1.0 里的新东西 + +![Inkscape 1.0][3] + +在这里,让我重点介绍一下 Inkscape 1.0 版本中重要关键变化。 + +#### 首个原生 macOS 应用 + +对于像 Inkscape 这样的神奇工具来说,适当的跨平台支持总是好的。在这个最新的版本中,它推出了原生的 macOS 应用。 + +请注意,这个 macOS 应用仍然是一个**预览版**,还有很多改进的空间。不过,在无需 [XQuartz][4] 的情况下就做到了更好的系统集成,对于 macOS 用户来说,应该是一个值得期许的进步。 + +#### 性能提升 + +不管是什么应用程序/工具,都会从显著的性能提升中受益,而 Inkscape 也是如此。 + +随着其 1.0 版本的发布,他们提到,当你使用 Inkscape 进行各种创意工作时,你会发现性能更加流畅。 + +除了在 macOS 上(仍为“预览版”),Inkscape 在 Linux 和 Windows 上的运行都是很好的。 + +#### 改进的 UI 和 HiDPI 支持 + +![][5] + +他们在发布说明中提到: + +> ……达成了一个重要的里程碑,使 Inkscape 能够使用最新的软件(即 GTK+3)来构建编辑器的用户界面。拥有 HiDPI(高分辨率)屏幕的用户要感谢 2018 年波士顿黑客节期间的团队合作,让更新后的 GTK 轮子开始运转起来。 + +从 GTK+3 的用户界面到高分辨率屏幕的 HiDPI 支持,这都是一次精彩的升级。 + +更不要忘了,你还可以获得更多的自定义选项来调整外观和感受。 + +#### 新增功能 + +![][6] + +即便是从纸面上看,这些列出新功能都看起来不错。根据你的专业知识和你的喜好,这些新增功能应该会派上用场。 + +以下是新功能的概述: + + * 新改进过的实时路径效果(LPE)功能。 + * 新的可搜索的 LPE 选择对话框。 + * 自由式绘图用户现在可以对画布进行镜像和旋转。 + * 铅笔工具的新的 PowerPencil 模式提供了压感的宽度,并且终于可以创建封闭路径了。 + * 包括偏移、PowerClip 和 PowerMask LPE 在内的新路径效果会吸引艺术类用户。 + * 能够创建复制引导、将网格对齐到页面上、测量工具的路径长度指示器和反向 Y 轴。 + * 能够导出带有可点击链接和元数据的 PDF 文件。 + * 新的调色板和网状渐变,可在网页浏览器中使用。 + +虽然我已经尝试着整理了这个版本中添加的关键功能列表,但你可以在他们的[发布说明][7]中获得全部细节。 + +#### 其他重要变化 + +作为重大变化之一,Inkscape 1.0 现在支持 Python 3。而且,随着这一变化,你可能会注意到一些扩展程序无法在最新版本中工作。 + +所以,如果你的工作依赖于某个扩展程序的工作流程,我建议你仔细看看他们的[发布说明][7],了解所有的技术细节。 + +### 在 Linux 上下载和安装 Inkscape 1.0 + +Inkscape 1.0 有用于 Linux 的 AppImage 和 Snap 软件包,你可以从 Inkscape 的网站上下载。 + +- [下载 Inkscape 1.0 for Linux][8] + +如果你还不知道,可以查看[如何在 Linux 上使用 AppImage 文件][9]来入门。你也可以参考[这个 Snap 指南][10]。 + +Ubuntu 用户可以在 Ubuntu 软件中心找到 Inskcape 1.0 的 Snap 版本。 + +我在 [Pop!_OS 20.04][11] 上使用了 AppImage 文件,工作的很好。你可以详细体验所有的功能,看看它的效果如何。 + +你试过了吗?请在下面的评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/inkscape-1-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/vector-graphics-editors-linux/ +[2]: https://inkscape.org/news/2020/05/04/introducing-inkscape-10/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/inkscape-1-0.jpg?ssl=1 +[4]: https://en.wikipedia.org/wiki/XQuartz +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/inkscape-ui-customization.jpg?ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/inkscape-live-path-effects.jpg?ssl=1 +[7]: https://wiki.inkscape.org/wiki/index.php/Release_notes/1.0 +[8]: https://inkscape.org/release/1.0/gnulinux/ +[9]: https://itsfoss.com/use-appimage-linux/ +[10]: https://itsfoss.com/install-snap-linux/ +[11]: https://itsfoss.com/pop-os-20-04-review/ From cf259313357b80fa60fc812766ac71fb373810c9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 6 May 2020 09:48:22 +0800 Subject: [PATCH 0621/1809] PUB @wxy https://linux.cn/article-12188-1.html --- ...e 1.0 is Finally Here With Tons of Feature Improvements.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md (98%) diff --git a/translated/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md b/published/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md similarity index 98% rename from translated/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md rename to published/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md index 06c61b776b..fcf6c3b3ca 100644 --- a/translated/news/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md +++ b/published/20200506 After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12188-1.html) [#]: subject: (After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements) [#]: via: (https://itsfoss.com/inkscape-1-release/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From a6da4f7e618643ce6beb0c799a33028d7b403c0f Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Wed, 6 May 2020 21:38:22 +0800 Subject: [PATCH 0622/1809] Almost done --- ... Create a SDN on Linux with open source.md | 64 +++++++++++++------ 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/sources/tech/20200417 Create a SDN on Linux with open source.md b/sources/tech/20200417 Create a SDN on Linux with open source.md index 5e69bb4db6..fe22d47bbe 100644 --- a/sources/tech/20200417 Create a SDN on Linux with open source.md +++ b/sources/tech/20200417 Create a SDN on Linux with open source.md @@ -7,27 +7,33 @@ [#]: via: (https://opensource.com/article/20/4/quagga-linux) [#]: author: (M Umer https://opensource.com/users/noisybotnet) -Create a SDN on Linux with open source +Create a SDN on Linux with open source 在Linux上使用开源代码创建SDN ====== -Make your Linux system act like a router with the open source routing -stack Quagga. +Make your Linux system act like a router with the open source routing stack Quagga. +使用开源路由协议栈Quagga,使您的Linux系统成为一台路由器。 ![Coding on a computer][1] Network routing protocols fall into two main categories: interior gateway protocols and exterior gateway protocols. Interior gateway protocols are used by routers to share information within a single autonomous system. If you are running Linux, you can make your system behave as a router through the open source (GPLv2) routing stack [Quagga][2]. +网络路由协议分为两大类:内部网关协议和外部网关协议。路由器使用内部网关协议在单个自治系统内共享信息。如果您用的是Linux,则可以通过开源(GPLv2)路由协议栈[Quagga][2]使其表现得像一台路由器。 -### What is Quagga? +### What is Quagga? 什么是Quagga? Quagga is a [routing software suite][3] and a fork of [GNU Zebra][4]. It provides implementations of all major routing protocols such as Open Shortest Path First (OSPF), Routing Information Protocol (RIP), Border Gateway Protocol (BGP), and Intermediate System to Intermediate System (IS-IS) for Unix-like platforms. Although Quagga implements the routing protocols for both IPv4 and IPv6, it doesn't act as a complete router. A true router not only implements all the routing protocols but also has the ability to forward network traffic. Quagga only implements the routing stack, and the job of forwarding network traffic is handled by the Linux kernel. -### Architecture +Quagga是[路由软件包][3],并且是[GNU Zebra][4]的一个分支。它为类Unix平台提供了所有主流路由协议的实现,例如开放最短路径优先(OSPF),路由信息协议(RIP),边界网关协议(BGP)和中间系统到中间系统协议(IS-IS)。 + +尽管Quagga为IPv4和IPv6都实现了路由协议,但它却不是一个完整的路由器。真正的路由器不仅实现了所有路由协议,而且还有转发网络流量的能力。 Quagga仅仅实现了路由协议栈,而转发网络流量的工作由Linux内核处理。 + +### Architecture 架构 Quagga implements the different routing protocols through protocol-specific daemons. The daemon name is the same as the routing protocol followed by the letter "d." Zebra is the core and a protocol-independent daemon that provides an [abstraction layer][5] to the kernel and presents the Zserv API over TCP sockets to Quagga clients. Each protocol-specific daemon is responsible for running the relevant protocol and building the routing table based on the information exchanged. +Quagga通过协议特定的守护程序实现不同的路由协议。守护程序名称与路由协议相同,加了字母“d”作为后缀。Zebra是核心的协议无关的守护进程,它为内核提供了一个[抽象层][5],并通过TCP套接字向Quagga客户端提供Zserv API。每个协议特定的守护程序负责运行相关的协议并基于交换的信息来建立路由表。 ![Quagga architecture][6] -### Setup +### Setup 环境 This tutorial implements the OSPF protocol to configure dynamic routing using Quagga. The setup includes two CentOS 7.7 hosts, named Alpha and Beta. Both hosts share access to the **192.168.122.0/24** network. @@ -41,26 +47,38 @@ Gateway: 192.168.122.1 IP: 192.168.122.50/24 Gateway: 192.168.122.1 -### Install the package +本教程通过Quagga实现的OSPF协议来配置动态路由。该环境包括两个名为Alpha和Beta的CentOS 7.7主机。两台主机共享访问 **192.168.122.0/24** 网络。 + +**主机Alpha** + +IP:192.168.122.100/24 +网关:192.168.122.1 + +**主机Beta** + +IP:192.168.122.50/24 +网关:192.168.122.1 + +### Install the package 安装软件包 First, install the Quagga package on both hosts. It is available in the CentOS base repo: - +首先,在两台主机上安装Quagga软件包。它存在于CentOS基础仓库中: ``` `yum install quagga -y` ``` -### Enable IP forwarding +### Enable IP forwarding 使能IP转发 Next, enable IP forwarding on both hosts since that will performed by the Linux kernel: - +接下来,在两台主机上使能IP转发,因为它将由Linux内核来执行: ``` sysctl -w net.ipv4.ip_forward = 1 sysctl -p ``` -### Configuration +### Configuration 配置 Now, go into the **/etc/quagga** directory and create the configuration files for your setup. You need three files: @@ -71,7 +89,14 @@ Now, go into the **/etc/quagga** directory and create the configuration files fo On host Alpha, +现在,进入 **/etc/quagga** 目录并为您的设置创建配置文件。您需要三个文件: + * **zebra.conf**:Quagga的守护程序配置文件,您可以在其中定义接口及其IP地址和IP转发 + * **ospfd.conf**:协议配置文件,您可以在其中定义将通过OSPF协议提供的网络 + * **守护程序**:您将在其中指定需要运行的相关的协议守护程序 + + +在主机Alpha上, ```  [root@alpha]# cat /etc/quagga/zebra.conf @@ -100,7 +125,7 @@ ospfd=yes ``` On host Beta, - +在主机Beta上, ``` [root@beta quagga]# cat zebra.conf @@ -128,10 +153,10 @@ zebra=yes ospfd=yes ``` -### Configure the firewall +### Configure the firewall 配置防火墙 To use the OSPF protocol, you must allow it in the firewall: - +要使用OSPF协议,必须允许它通过防火墙: ``` firewall-cmd --add-protocol=ospf –permanent @@ -140,7 +165,7 @@ firewall-cmd –reload ``` Now, start the zebra and ospfd daemons. - +现在,启动zebra和ospfd守护程序。 ``` # systemctl start zebra @@ -148,7 +173,7 @@ Now, start the zebra and ospfd daemons. ``` Look at the route table on both hosts using: - +用下面命令在两个主机上查看路由表: ``` [root@alpha ~]# ip route show   @@ -159,7 +184,7 @@ default via 192.168.122.1 dev eth0 proto static metric 100 ``` You can see that the routing table on Alpha contains an entry of **10.10.10.0/24** via **192.168.122.50** offered through protocol **zebra**. Similarly, on host Beta, the table contains an entry of network **10.12.13.0/24** via **192.168.122.100**. - +您可以看到Alpha上的路由表包含通过 **192.168.122.50** 到达 **10.10.10.0/24** 的条目,它是通过协议 **zebra** 获取的。同样,在主机Beta上,该表包含通过 **192.168.122.100** 到达网络 **10.12.13.0/24** 的条目。 ``` [root@beta ~]# ip route show @@ -169,9 +194,10 @@ default via 192.168.122.1 dev eth0 proto static metric 100 192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.50 metric 100 ``` -### Conclusion +### Conclusion 结论 As you can see, the setup and configuration are relatively simple. To add complexity, you can add more network interfaces to the router to provide routing for more networks. You can also implement BGP and RIP protocols using the same method. +如您所见,环境和配置相对简单。要增加复杂性,您可以向路由器添加更多网络接口,以为更多网络提供路由。您也可以使用相同的方法来实现BGP和RIP协议。 -------------------------------------------------------------------------------- @@ -179,7 +205,7 @@ via: https://opensource.com/article/20/4/quagga-linux 作者:[M Umer][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[messon007](https://github.com/messon007) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a22332810e4218e601d4230ae509484e6b067768 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Wed, 6 May 2020 21:41:09 +0800 Subject: [PATCH 0623/1809] translated --- ... Create a SDN on Linux with open source.md | 54 ++++--------------- 1 file changed, 9 insertions(+), 45 deletions(-) rename {sources => translated}/tech/20200417 Create a SDN on Linux with open source.md (62%) diff --git a/sources/tech/20200417 Create a SDN on Linux with open source.md b/translated/tech/20200417 Create a SDN on Linux with open source.md similarity index 62% rename from sources/tech/20200417 Create a SDN on Linux with open source.md rename to translated/tech/20200417 Create a SDN on Linux with open source.md index fe22d47bbe..97272e9f2d 100644 --- a/sources/tech/20200417 Create a SDN on Linux with open source.md +++ b/translated/tech/20200417 Create a SDN on Linux with open source.md @@ -7,45 +7,26 @@ [#]: via: (https://opensource.com/article/20/4/quagga-linux) [#]: author: (M Umer https://opensource.com/users/noisybotnet) -Create a SDN on Linux with open source 在Linux上使用开源代码创建SDN +在Linux上使用开源代码创建SDN ====== -Make your Linux system act like a router with the open source routing stack Quagga. 使用开源路由协议栈Quagga,使您的Linux系统成为一台路由器。 ![Coding on a computer][1] -Network routing protocols fall into two main categories: interior gateway protocols and exterior gateway protocols. Interior gateway protocols are used by routers to share information within a single autonomous system. If you are running Linux, you can make your system behave as a router through the open source (GPLv2) routing stack [Quagga][2]. 网络路由协议分为两大类:内部网关协议和外部网关协议。路由器使用内部网关协议在单个自治系统内共享信息。如果您用的是Linux,则可以通过开源(GPLv2)路由协议栈[Quagga][2]使其表现得像一台路由器。 -### What is Quagga? 什么是Quagga? - -Quagga is a [routing software suite][3] and a fork of [GNU Zebra][4]. It provides implementations of all major routing protocols such as Open Shortest Path First (OSPF), Routing Information Protocol (RIP), Border Gateway Protocol (BGP), and Intermediate System to Intermediate System (IS-IS) for Unix-like platforms. - -Although Quagga implements the routing protocols for both IPv4 and IPv6, it doesn't act as a complete router. A true router not only implements all the routing protocols but also has the ability to forward network traffic. Quagga only implements the routing stack, and the job of forwarding network traffic is handled by the Linux kernel. +### Quagga是什么? Quagga是[路由软件包][3],并且是[GNU Zebra][4]的一个分支。它为类Unix平台提供了所有主流路由协议的实现,例如开放最短路径优先(OSPF),路由信息协议(RIP),边界网关协议(BGP)和中间系统到中间系统协议(IS-IS)。 尽管Quagga为IPv4和IPv6都实现了路由协议,但它却不是一个完整的路由器。真正的路由器不仅实现了所有路由协议,而且还有转发网络流量的能力。 Quagga仅仅实现了路由协议栈,而转发网络流量的工作由Linux内核处理。 -### Architecture 架构 +### 架构 -Quagga implements the different routing protocols through protocol-specific daemons. The daemon name is the same as the routing protocol followed by the letter "d." Zebra is the core and a protocol-independent daemon that provides an [abstraction layer][5] to the kernel and presents the Zserv API over TCP sockets to Quagga clients. Each protocol-specific daemon is responsible for running the relevant protocol and building the routing table based on the information exchanged. Quagga通过协议特定的守护程序实现不同的路由协议。守护程序名称与路由协议相同,加了字母“d”作为后缀。Zebra是核心的协议无关的守护进程,它为内核提供了一个[抽象层][5],并通过TCP套接字向Quagga客户端提供Zserv API。每个协议特定的守护程序负责运行相关的协议并基于交换的信息来建立路由表。 ![Quagga architecture][6] -### Setup 环境 - -This tutorial implements the OSPF protocol to configure dynamic routing using Quagga. The setup includes two CentOS 7.7 hosts, named Alpha and Beta. Both hosts share access to the **192.168.122.0/24** network. - -**Host Alpha:** - -IP: 192.168.122.100/24 -Gateway: 192.168.122.1 - -**Host Beta:** - -IP: 192.168.122.50/24 -Gateway: 192.168.122.1 +### 环境 本教程通过Quagga实现的OSPF协议来配置动态路由。该环境包括两个名为Alpha和Beta的CentOS 7.7主机。两台主机共享访问 **192.168.122.0/24** 网络。 @@ -59,18 +40,16 @@ IP:192.168.122.100/24 IP:192.168.122.50/24 网关:192.168.122.1 -### Install the package 安装软件包 +### 安装软件包 -First, install the Quagga package on both hosts. It is available in the CentOS base repo: 首先,在两台主机上安装Quagga软件包。它存在于CentOS基础仓库中: ``` `yum install quagga -y` ``` -### Enable IP forwarding 使能IP转发 +### 使能IP转发 -Next, enable IP forwarding on both hosts since that will performed by the Linux kernel: 接下来,在两台主机上使能IP转发,因为它将由Linux内核来执行: ``` @@ -78,17 +57,8 @@ sysctl -w net.ipv4.ip_forward = 1 sysctl -p ``` -### Configuration 配置 +### 配置 -Now, go into the **/etc/quagga** directory and create the configuration files for your setup. You need three files: - - * **zebra.conf**: Quagga's daemon configuration file, which is where you'll define the interfaces and their IP addresses and IP forwarding - * **ospfd.conf**: The protocol configuration file, which is where you'll define the networks that will be offered through the OSPF protocol - * **daemons**: Where you'll specify the relevant protocol daemons that are required to run - - - -On host Alpha, 现在,进入 **/etc/quagga** 目录并为您的设置创建配置文件。您需要三个文件: * **zebra.conf**:Quagga的守护程序配置文件,您可以在其中定义接口及其IP地址和IP转发 @@ -124,7 +94,6 @@ zebra=yes ospfd=yes ``` -On host Beta, 在主机Beta上, ``` @@ -153,9 +122,8 @@ zebra=yes ospfd=yes ``` -### Configure the firewall 配置防火墙 +### 配置防火墙 -To use the OSPF protocol, you must allow it in the firewall: 要使用OSPF协议,必须允许它通过防火墙: ``` @@ -164,7 +132,6 @@ firewall-cmd --add-protocol=ospf –permanent firewall-cmd –reload ``` -Now, start the zebra and ospfd daemons. 现在,启动zebra和ospfd守护程序。 ``` @@ -172,7 +139,6 @@ Now, start the zebra and ospfd daemons. # systemctl start ospfd ``` -Look at the route table on both hosts using: 用下面命令在两个主机上查看路由表: ``` @@ -183,7 +149,6 @@ default via 192.168.122.1 dev eth0 proto static metric 100 192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.100 metric 100 ``` -You can see that the routing table on Alpha contains an entry of **10.10.10.0/24** via **192.168.122.50** offered through protocol **zebra**. Similarly, on host Beta, the table contains an entry of network **10.12.13.0/24** via **192.168.122.100**. 您可以看到Alpha上的路由表包含通过 **192.168.122.50** 到达 **10.10.10.0/24** 的条目,它是通过协议 **zebra** 获取的。同样,在主机Beta上,该表包含通过 **192.168.122.100** 到达网络 **10.12.13.0/24** 的条目。 ``` @@ -194,9 +159,8 @@ default via 192.168.122.1 dev eth0 proto static metric 100 192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.50 metric 100 ``` -### Conclusion 结论 +### 结论 -As you can see, the setup and configuration are relatively simple. To add complexity, you can add more network interfaces to the router to provide routing for more networks. You can also implement BGP and RIP protocols using the same method. 如您所见,环境和配置相对简单。要增加复杂性,您可以向路由器添加更多网络接口,以为更多网络提供路由。您也可以使用相同的方法来实现BGP和RIP协议。 -------------------------------------------------------------------------------- From 139f7f0551537cd8d82a18e33d64a17d1ae4fc02 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 6 May 2020 23:16:10 +0800 Subject: [PATCH 0624/1809] PRF @robsean --- ...7 How to compress files on Linux 5 ways.md | 76 +++++++++---------- 1 file changed, 36 insertions(+), 40 deletions(-) diff --git a/translated/tech/20200417 How to compress files on Linux 5 ways.md b/translated/tech/20200417 How to compress files on Linux 5 ways.md index e9ef6af572..e10a0bd8a4 100644 --- a/translated/tech/20200417 How to compress files on Linux 5 ways.md +++ b/translated/tech/20200417 How to compress files on Linux 5 ways.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to compress files on Linux 5 ways) @@ -9,18 +9,20 @@ 在 Linux 上压缩文件的 5 种方法 ====== -在 Linux 系统上有很多可以用于压缩文件的工具,但是它们表现的行为或产生相同程度的压缩等级并不相同,在这篇文章中,我们比较其中的五个工具。 -Getty Images -在 Linux 上有不少用于压缩文件的命令。最新最有效的一个方法是 **xz** ,但是所有的方法都有节省磁盘空间和为后期使用维护备份文件的优点。在这篇文章中,我们将比较压缩命令并指出显著的不同 。 +> 在 Linux 系统上有很多可以用于压缩文件的工具,但它们的表现并不都是一样的,也不是所有的压缩效果都是一样的。在这篇文章中,我们比较其中的五个工具。 + +![](https://img.linux.net.cn/data/attachment/album/202005/06/231536tgxma941yb8dgl53.jpg) + +在 Linux 上有不少用于压缩文件的命令。最新最有效的一个方法是 `xz`,但是所有的方法都有节省磁盘空间和维护备份文件供以后使用的优点。在这篇文章中,我们将比较这些压缩命令并指出显著的不同。 ### tar -tar 命令不是专门的压缩命令。它通常用于将多个文件拉入一单个文件中,以便容易地传输到另一个系统,或者备份文件为一个相关的组。它也提供压缩作为一个功能,这是很明智的,附加的 **z** 压缩选项能够实现压缩文件。 +`tar` 命令不是专门的压缩命令。它通常用于将多个文件拉入一个单个的文件中,以便容易地传输到另一个系统,或者将文件作为一个相关的组进行备份。它也提供压缩的功能,这就很有意义了,附加一个 `z` 压缩选项能够实现压缩文件。 -当压缩过程被附加到一个使用 **z** 选项的 **tar** 命令时,tar 使用 **gzip** 来进行压缩。 +当使用 `z` 选项为 `tar` 命令附加压缩过程时,`tar` 使用 `gzip` 来进行压缩。 -你可以使用 **tar** 来压缩一个单个文件,就像压缩一个组一样容易,尽管这种操作与直接使用 **gzip** 相比没有特别的优势。为此,要使用 **tar** ,只需要使用一个 “tar cfz newtarfile filename” 命令来像你标识一个组一样标识文件,像这样: +就像压缩一组文件一样,你可以使用 `tar` 来压缩单个文件,尽管这种操作与直接使用 `gzip` 相比没有特别的优势。要使用 `tar` 这样做,只需要使用 `tar cfz newtarfile filename` 命令来标识要压缩的文件,就像标识一组文件一样,像这样: ``` $ tar cfz bigfile.tgz bigfile @@ -33,13 +35,11 @@ $ ls -l bigfile* -rw-rw-r-- 1 shs shs 21608325 Apr 16 16:08 bigfile.tgz ``` -注意,文件的大小显著减少。 +注意,文件的大小显著减少了。 -如果你喜欢,你可以使用 **tar.gz** 扩展名,这可能会使文件的特征更加明显,但是大多数的 Linux 用户将很可能会意识到与 **tgz** 的意思是相同的东西 – **tar** 和 **gz** 的组合来显示文件是一个压缩的 tar 文件。在压缩完成后,将留下原始文件和压缩文件。 +如果你愿意,你可以使用 `tar.gz` 扩展名,这可能会使文件的特征更加明显,但是大多数的 Linux 用户将很可能会意识到与 `tgz` 的意思是一样的 – `tar` 和 `gz` 的组合来显示文件是一个压缩的 tar 文件。在压缩完成后,你将同时得到原始文件和压缩文件。 -为收集很多文件在一起并在一个命令中压缩生成的 “tar ball” ,使用相同的语法,但是要指明将要被包含的文件来作为一个组,而不是单个文件。这里有一个示例: - -[][1] +要将很多文件收集在一起并在一个命令中压缩出 “tar ball”,使用相同的语法,但要指定要包含的文件为一组,而不是单个文件。这里有一个示例: ``` $ tar cfz bin.tgz bin/* @@ -50,7 +50,7 @@ $ tar cfz bin.tgz bin/* ### zip -**zip** 命令创建一个压缩文件,与此同时保留原始文件的完整性。语法像使用 **tar** 一样简单,只是你必需记住,你的原始文件名称应该是命令行上的最后一个参数。 +`zip` 命令创建一个压缩文件,与此同时保留原始文件的完整性。语法像使用 `tar` 一样简单,只是你必需记住,你的原始文件名称应该是命令行上的最后一个参数。 ``` $ zip ./bigfile.zip bigfile @@ -62,7 +62,7 @@ $ ls -l bigfile bigfile.zip ### gzip -**gzip** 命令非常容易使用。你只需要键入 "gzip" ,紧随其后的是你想要压缩的文件名称。不像上述描述的命令,**gzip** 将“就地”加密文件。换句话说,原始文件将被加密文件替换。 +`gzip` 命令非常容易使用。你只需要键入 `gzip`,紧随其后的是你想要压缩的文件名称。不像上述描述的命令,`gzip` 将“就地”加密文件。换句话说,原始文件将被加密文件替换。 ``` $ gzip bigfile @@ -72,7 +72,7 @@ $ ls -l bigfile* ### bzip2 -像使用 **gzip** 命令一样,**bzip2** 将在你选的“合适位置”压缩文件,只留下原始文件保持原样离开。 +像使用 `gzip` 命令一样,`bzip2` 将在你选择的文件“就地”压缩,不留下原始文件。 ``` $ bzip bigfile @@ -82,7 +82,7 @@ $ ls -l bigfile* ### xz -压缩命令组中的一个相对较新的成员,**xz** 就如何更好的压缩文件而言是领跑者。像先前的两个命令一样,你只需要将文件名称补给到命令中。再强调一次,原始文件被就地压缩。 +`xz` 是压缩命令团队中的一个相对较新的成员,在压缩文件的能力方面,它是一个领跑者。像先前的两个命令一样,你只需要将文件名称提供给命令。再强调一次,原始文件被就地压缩。 ``` $ xz bigfile @@ -90,17 +90,17 @@ $ ls -l bigfile* -rw-rw-r-- 1 shs shs 13427236 Apr 15 17:30 bigfile.xz ``` -对于大文件来说,你可能会注意到 **xz** 将比其它的压缩命令花费更多的运行时间,但是压缩的结果却是非常令人赞叹的。 +对于大文件来说,你可能会注意到 `xz` 将比其它的压缩命令花费更多的运行时间,但是压缩的结果却是非常令人赞叹的。 -### 考虑对比性 +### 对比 -大多数人都听说过 "文件大小不是万能的"。所以,让我们比较一下文件大小以及一些当你计划如何压缩文件时的问题。 +大多数人都听说过“大小不是一切”。所以,让我们比较一下文件大小以及一些当你计划如何压缩文件时的问题。 -下面显示的统计数据都与压缩单个文件相关,在上面显示的示例中使用 – bigfile – 。这个文件是一个大的且相当随机的文本文件。压缩率在一定程度上取决于文件的内容。 +下面显示的统计数据都与压缩单个文件相关,在上面显示的示例中使用 `bigfile`。这个文件是一个大的且相当随机的文本文件。压缩率在一定程度上取决于文件的内容。 #### 大小减缩率 -在比较期间,上面显示的各种压缩命产生下面的结果。百分比表示压缩文件对比原始文件。 +当比较时,上面显示的各种压缩命产生下面的结果。百分比表示压缩文件与原始文件的比较效果。 ``` -rw-rw-r-- 1 shs shs 103270400 Apr 16 14:01 bigfile @@ -112,15 +112,15 @@ $ ls -l bigfile* -rw-rw-r-- 1 shs shs 21606889 Apr 16 13:59 bigfile.zip ~21% ``` -**xz** 命令获胜,最终只有压缩文件大小的13%,但是这些所有的压缩命令都相当显著地减少原始文件的大小。 +`xz` 命令获胜,最终只有压缩文件 13% 的大小,但是所有这些压缩命令都相当显著地减少原始文件的大小。 #### 是否替换原始文件 -**bzip2**,**gzip** 和 **xz** 命令都将使用压缩文件替换原始文件。**tar** 和 **zip** 命令不替换。 +`bzip2`、`gzip` 和 `xz` 命令都用压缩文件替换原始文件。`tar` 和 `zip` 命令不替换。 #### 运行时间 -**xz** 命令似乎比其它命令需要花费更多的时间来加密文件。对于 bigfile 来说,近似时间是: +`xz` 命令似乎比其它命令需要花费更多的时间来加密文件。对于 `bigfile` 来说,大概的时间是: ``` 命令 运行时间 @@ -135,27 +135,25 @@ xz 50.4 秒 #### 文件权限 -不管你对压缩文件设置什么权限,压缩文件的权限将基于你的 **umask** 设置,除 **bzip2** 维持原始文件的权限外。 +不管你对压缩文件设置什么权限,压缩文件的权限将基于你的 `umask` 设置,但 `bzip2` 除外,它保留了原始文件的权限。 #### 与 Windows 的兼容性 -**zip** 命令将创建一个可被使用的文件(例如,解压缩),在 Windows 系统上以及 Linux 和其它 Unix 系统上,无需安装其它可能可用或不可用的工具。 +`zip` 命令创建的文件可以在 Windows 系统以及 Linux 和其他 Unix 系统上使用(即解压),而无需安装其他工具,无论这些工具可能是可用还是不可用的。 ### 解压缩文件 -解压缩文件的命令类似于这些压缩文件的命令。这些命令将在我们运行上述压缩命令后用于解压缩 bigfile 。 +解压文件的命令与压缩文件的命令类似。在我们运行上述压缩命令后,这些命令用于解压缩 `bigfile`: - * tar: **tar xf bigfile.tgz** - * zip: **unzip bigfile.zip** - * gzip: **gunzip bigfile.gz** - * bzip2: **bunzip2 bigfile.gz2** - * xz: **xz -d bigfile.xz** 或 **unxz bigfile.xz** + * tar: `tar xf bigfile.tgz` + * zip: `unzip bigfile.zip` + * gzip: `gunzip bigfile.gz` + * bzip2: `bunzip2 bigfile.gz2` + * xz: `xz -d bigfile.xz` 或 `unxz bigfile.xz` +### 自己运行压缩对比 - -### 对比你自己运行的压缩 - -如果你想自己运行一些测试,抓取一个大的且可以替换的文件,并使用上面显示的每个命令来压缩它 – 最好使用一个新的子目录。你可能必需先安装 **xz** ,如果你想在测试中包含它的话。这个脚本可能更容易地压缩,但是将可能花费几分钟来完成。 +如果你想自己运行一些测试,抓取一个大的且可以替换的文件,并使用上面显示的每个命令来压缩它 —— 最好使用一个新的子目录。你可能需要先安装 `xz`,如果你想在测试中包含它的话。这个脚本可能更容易地进行压缩,但是可能需要花费几分钟完成。 ``` #!/bin/bash @@ -187,16 +185,14 @@ ls -l $filename.* mv $filename-2 $filename ``` -加入 [Facebook][2] 和 [LinkedIn][3] 网络世界社区来评论那些最重要的话题。 - -------------------------------------------------------------------------------- via: https://www.networkworld.com/article/3538471/how-to-compress-files-on-linux-5-ways.html 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 08728494a92d2f8e81d6106bee61679ec764b75a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 6 May 2020 23:16:42 +0800 Subject: [PATCH 0625/1809] PUB @robsean https://linux.cn/article-12190-1.html --- .../20200417 How to compress files on Linux 5 ways.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200417 How to compress files on Linux 5 ways.md (99%) diff --git a/translated/tech/20200417 How to compress files on Linux 5 ways.md b/published/20200417 How to compress files on Linux 5 ways.md similarity index 99% rename from translated/tech/20200417 How to compress files on Linux 5 ways.md rename to published/20200417 How to compress files on Linux 5 ways.md index e10a0bd8a4..d0cb239d11 100644 --- a/translated/tech/20200417 How to compress files on Linux 5 ways.md +++ b/published/20200417 How to compress files on Linux 5 ways.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12190-1.html) [#]: subject: (How to compress files on Linux 5 ways) [#]: via: (https://www.networkworld.com/article/3538471/how-to-compress-files-on-linux-5-ways.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 43d4e5ad70eac5daeb4d038a58b70c7ae1e58585 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Wed, 6 May 2020 23:41:46 +0800 Subject: [PATCH 0626/1809] TSL 20200505 Browse the Peer-to-peer Web With Beaker Browser --- ...he Peer-to-peer Web With Beaker Browser.md | 124 ------------------ ...he Peer-to-peer Web With Beaker Browser.md | 124 ++++++++++++++++++ 2 files changed, 124 insertions(+), 124 deletions(-) delete mode 100644 sources/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md create mode 100644 translated/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md diff --git a/sources/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md b/sources/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md deleted file mode 100644 index 319b8a18c5..0000000000 --- a/sources/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md +++ /dev/null @@ -1,124 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Browse the Peer-to-peer Web With Beaker Browser) -[#]: via: (https://itsfoss.com/beaker-browser/) -[#]: author: (John Paul https://itsfoss.com/author/john/) - -Browse the Peer-to-peer Web With Beaker Browser -====== - -The Internet as we know it has existed unchanged (more or less) for the last 50 years. People across the globe use their devices to retrieve data from huge servers dotted around the world. - -A group of dedicated technologists wants to change that to make the internet a place where people can connect and share information directly instead of relying on a central server (decentralization). - -There are a bunch of such decentralized services that we have already covered on It’s FOSS. [LBRY as YouTube alternative][1], [Mastodon as Twitter alternative][2] are just a couple of such examples. - -And today I am going to cover another such product called [Beaker Browser][3] which is essentially for browsing the peer to peer web. - -![Beaker Browser][4] - -### What is the ‘peer-to-peer Web’? - -According to [one of the devs][5] behind the Beaker browser, “The P2P Web is an experimental set of technologies…to give users more control over the Web.” - -Further, they say that the peer-to-peer Web has three main principles: anybody can be a server; multiple computers can serve the same site; there is no back end. - -As you can see from those principles. the idea of the peer-to-peer Web is very similar to BitTorrent where files are seeded by multiple peers and those peers share the bandwidth load. This reduces the overall bandwidth that a person needs to provide for their site. - -![Beaker Browser Settings][6] - -The other major part of the peer-to-peer Web is creator control of their ideas. In this day and age, platforms being controlled by large corporations, who try to use your data for their benefit. Beaker returns control to the content creators. - -### Browsing the decentralized web with Beaker - -The [Beaker Browser][3] first came into existence in 2016. The project (and the technology that surrounds it) is created by a team of three at [Blue Link Labs][7]. The Beaker Browser uses the [Dat protocol][8] to share data between computers. All websites that use the Dat protocol start with `dat://` instead of `http://`. - -The strengths of the Dat protocol are: - - * Fast – Archives sync from multiple sources at once. - * Secure – All updates are signed and integrity-checked. - * Resilient – Archives can change hosts without changing their URLs. - * Versioned – Changes are written to an append-only version log. - * Decentralized – Any device can host any archive. - - - -![Beaker Browser Seeding][9] - -The Beaker Browser is essentially a cut down version of Chromium with built-in support for `dat://`addresses. It can still visit regular `http://` sites. - -Each time you visit a dat site, the content for that site is downloaded to your computer as you request it. For example, a picture of Linux Torvalds on the about page of a site is not downloaded until you navigate to that page. - -Also, once you visit a dat website, “[you temporarily][10] re-upload or seed whichever files you’ve downloaded from the website.” You can also choose to seed the website to help its creator. - -![Beaker Browser Menu][11] - -Since the whole idea of Beaker is to create a more open web, you can easily view the source of any website. Unlike most browsers where you just see the source code the current page, you are viewing, Beaker shows you the entire structure of the site in a GitHub-like view. You can even fork the site and host your version of it. - -Besides visiting dat-based websites, you can also create your own site. In the Beaker Browser menu, there is an option to create a new website or an empty project. If you select the option to create a new website, Beaker will build a little demo site that you can edit with the browser’s built-in editor. - -However, if you are like me and prefer to use Markdown, you can choose to create an empty project. Beaker will create the structure of a site and assign it a `dat://`address. Create an `index.md` file and you are good to go. There is a [short tutorial][12] with more info. You can also use the create empty project option to build a web app. - -![Beaker Browser Website Template][13] - -Since Beaker acts as a web server and site seeder, any time you close it or turn off your computer your site will become unavailable. Thankfully, you don’t have to run your computer or the browser constantly. You can also use a seeding service named [Hashbase][14] or you can set up a [`homebase`][15] seeding server. - -Though Beaker is [available][16] for Linux, Windows, and macOS. If you do start playing around Beaker, be sure to take a quick look at [their gui][17][d][17][es][17]. - -### Beaker Browser is not for everyone but it has a purpose - -When I first got this assignment, I had high hopes for the Beaker Browser. As it stands now, it’s still very experimental. A number of the dat sites that I tried to visit were unavailable because the user was not seeding their site. Beaker does have an option to notify you when that site is back online. - -![Beaker Browser No Peer][18] - -Another problem is that Beaker is a really stripped down version of Chromium. There is no option to install extensions or themes. Instead, you are stuck with a white theme and a very limited toolset. I would not use this as my main browser and having access to the world of dat websites is not enough of a reason to keep it installed on my system. - -I looked to see if there is an extension for Firefox that would add support for the `dat://` protocol. I did find such an extension, but it also required the installation of a couple of other pieces of software. It’s just easier to install Beaker. - -As it stands now, Beaker is not for me. Maybe in the future, more people will start using Beaker or the dat protocol will gain support by other browsers. Then it might be interesting. Right now, it’s kinda empty. - -As part of my time with Beaker, I created a [website][19] using the built-in tools. Don’t worry, I made sure that it’s seeded. - -![Beaker Bowser Site Source][20] - -What are your thoughts on the Beaker Brower? What are your thoughts on the peer-to-peer web? Please let us know in the comments below. - -If you found this article interesting, please take a minute to share it on social media, Hacker News, or [Reddit][21]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/beaker-browser/ - -作者:[John Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/john/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/lbry/ -[2]: https://itsfoss.com/mastodon-open-source-alternative-twitter/ -[3]: https://beakerbrowser.com/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-browser.jpg?resize=800%2C426&ssl=1 -[5]: https://pfrazee.hashbase.io/blog/what-is-the-p2p-web -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-bowser-setting.jpg?resize=800%2C573&ssl=1 -[7]: https://bluelinklabs.com/ -[8]: https://www.datprotocol.com/ -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-bowser-seedding.jpg?resize=800%2C466&ssl=1 -[10]: https://beakerbrowser.com/docs/faq/ -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-browser-menu.jpg?ssl=1 -[12]: https://beakerbrowser.com/docs/guides/create-a-markdown-site -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-browser-website-template.jpg?resize=800%2C459&ssl=1 -[14]: https://hashbase.io/ -[15]: https://github.com/beakerbrowser/homebase -[16]: https://beakerbrowser.com/install/ -[17]: https://beakerbrowser.com/docs/guides/ -[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-browser-no-peer.jpg?resize=800%2C424&ssl=1 -[19]: https://41bfbd06731e8d9c5d5676e8145069c69b254e7a3b710ddda4f6e9804529690c/ -[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-bowser-source.jpg?resize=800%2C544&ssl=1 -[21]: https://reddit.com/r/linuxusersgroup diff --git a/translated/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md b/translated/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md new file mode 100644 index 0000000000..4a83f1435d --- /dev/null +++ b/translated/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md @@ -0,0 +1,124 @@ +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Browse the Peer-to-peer Web With Beaker Browser) +[#]: via: (https://itsfoss.com/beaker-browser/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +使用 Beaker 浏览器浏览 P2P Web +====== + +我们所认识的因特网在过去 50 年中变化不大。全球的网民使用它们的设备从遍布在世界各地的服务器上检索数据。 + +一群专业的技术专家想改变现状,使互联网变成人们可以连接和直接分享信息的地方,而不是依赖一个中心服务器(去中心化)。 + +我们已经在 It’s FOSS 讨论过很多这样的去中心化的服务。[YouTube 竞品:LBRY][1],[Twitter竞品:Mastodon][2] 是其中的两个例子。 + +今天我将要介绍另一个这样的产品,名为 [Beaker 浏览器][3],它的设计目标是浏览 P2P web 数据。 + +![Beaker Browser][4] + +### ’peer-to-peer Web‘ 是什么? + +根据 Beaker 浏览器的[开发者之一][5]的描述,”P2P Web 是一项实验性的技术...提高我们掌控 Web 的能力。“ + +还有,它们说 P2P Web 有三个主要原则:任何一点都可以成为服务器;多台计算机可以为同一个网站提供服务;没有后端。 + +从这些原则中你可以看出,P2P Web 的思想与 BitTorrent 很像,多个点把文件作为种子,这些点共享带宽负载。这减少了一个用户需要提供给他的网站的总带宽。 + +![Beaker Browser Settings][6] + +P2P Web 另一个重要的方面是创作者对于他们自己的想法的控制能力。当今年代,平台都是由庞大的组织控制的,往往拿你的数据为他们所用。Beaker 把数据的控制能力返还给了内容创造者。 + +### 使用 Beaker 浏览去中心化的 web + +[Beaker 浏览器][3] 是在 2016 年被创建的。该项目(及其周边技术)由[蓝链实验室][7]的三人团队创建。Beaker 浏览器使用 [Dat 协议][8]在计算机之间共享数据。使用 Dat 协议的网站以 `dat://` 而不是 `http://` 开头。 + +Dat 协议的优势如下: + + * 快速 – 档案能立即从多个源同步。 + * 安全 – 所有的更新都是有签名和被完整检查的。 + * 灵活 – 可以在不修改档案 URL 的情况下迁移主机。 + * 版本控制 – 每次修改都被写到只能追加的版本日志中。 + * 去中心化 – 任何设备都可以作为承载档案的主机。 + + + +![Beaker Browser Seeding][9] + +Beaker 浏览器本质上是阉割版的 Chromium,原生支持 `dat://` 地址,也可以访问普通的 `http://` 站点。 + +每次访问一个 dat 站点,在你请求时该站点的内容才会下载到你的计算机。例如,只有在你浏览到站点的 about 页面时,才会下载该页面上的 Linux Torvalds 的图片。 + +当你浏览一个 dat 网站时,”[你暂时][10]重新上传或种下你从网站上下载的所有文件。“你也可以选择为网站做种来帮助创造者。 + +![Beaker Browser Menu][11] + +由于 Beaker 的志向就是创建一个更开放的网络,因此你可以很容易地查看任何网站的源码。不像在大多数浏览器上你只能看到当前浏览的页面的源码那样,使用 Beaker 你能以类似 GitHub 的视图查看整个站点的结构。你甚至可以 fork 这个站点,自己维护。 + +除了浏览基于 dat 的网站外,你还可以创建自己的站点。在 Beaker 浏览器的菜单里,有创建新网站和创建空项目的选项。如果你选择了创建一个新网站,Beaker 会搭建一个小的 demo 站点,你可以使用浏览器里自带的编辑器来编辑。 + +然而,如果你像我一样更喜欢用 Markdown,你可以选择创建一个空项目。Beaker 会创建一个站点的结构,赋给它一个 `dat://` 地址。创建一个 `index.md` 文件后你就可以很好地工作了。里面有个[简短教程][12],你可以看到更多信息。你也可以用创建空项目的选项搭建一个 web app。 + +![Beaker Browser Website Template][13] + +由于 Beaker 的角色是个 web 服务器和站点播种者,当你关闭它或关机后你的站点就不可用了。幸运的是,你不必一直开着你的计算机或浏览器。你也可以使用名为 [Hashbase][14] 的播种服务或者你可以搭建一个 [`homebase`][15] 播种服务器。 + +虽然 Beaker [适用于][16] Linux,Windows 和 macOS,但是在搞 Beaker 之前,还是要查阅下[各平台的教程][17]。 + +### Beaker 浏览器不是每个人都能用,但它有这个意图 + +当第一次被分配到这个任务时,我对 Beaker 浏览器有极高的热情。(但是)像它现在的地位一样,Beaker 浏览器仍是实验性的。我尝试浏览过的很多 dat 站点还不可用,因为用户并没有为站点做种。当站点恢复可用时 Beaker 确实可以选择通知你。 + +![Beaker Browser No Peer][18] + +另一个问题是,Beaker 是真正阉割版的 Chromium。不能安装扩展或主题。你只能使用白色主题和极少的工具集。我不会把 Beaker 浏览器作为常用浏览器,而且能访问 dat 网站并不是把它留在系统上的充分条件。 + +我曾经寻找一个能支持 `dat://` 协议的 Firefox 扩展。我确实找到了这样一款扩展,但它需要安装一系列其他的软件。相比而言,安装 Beaker 比安装那些软件容易点。 + +就像它现在的地位,Beaker 不适合我。也许在将来更多的人使用 Beaker 或者其他浏览器支持 dat 协议。那时会很有趣。目前而言,聊胜于无。 + +在使用 Beaker 的时间里,我用内建的工具创建了一个[网站][19]。不要担心,我已经为它做种了。 + +![Beaker Bowser Site Source][20] + +你怎么看 Beaker 浏览器?你怎么看 P2P web?请尽情在下面评论。 + +如果你觉得本文有意思,请花点时间把它分享到社交媒体,Hacker News 或 [Reddit][21]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/beaker-browser/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/lbry/ +[2]: https://itsfoss.com/mastodon-open-source-alternative-twitter/ +[3]: https://beakerbrowser.com/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-browser.jpg?resize=800%2C426&ssl=1 +[5]: https://pfrazee.hashbase.io/blog/what-is-the-p2p-web +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-bowser-setting.jpg?resize=800%2C573&ssl=1 +[7]: https://bluelinklabs.com/ +[8]: https://www.datprotocol.com/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-bowser-seedding.jpg?resize=800%2C466&ssl=1 +[10]: https://beakerbrowser.com/docs/faq/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-browser-menu.jpg?ssl=1 +[12]: https://beakerbrowser.com/docs/guides/create-a-markdown-site +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-browser-website-template.jpg?resize=800%2C459&ssl=1 +[14]: https://hashbase.io/ +[15]: https://github.com/beakerbrowser/homebase +[16]: https://beakerbrowser.com/install/ +[17]: https://beakerbrowser.com/docs/guides/ +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-browser-no-peer.jpg?resize=800%2C424&ssl=1 +[19]: https://41bfbd06731e8d9c5d5676e8145069c69b254e7a3b710ddda4f6e9804529690c/ +[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/beaker-bowser-source.jpg?resize=800%2C544&ssl=1 +[21]: https://reddit.com/r/linuxusersgroup From f49b6bc5bed2a1aaf9aef634fc30512a89e011ea Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 7 May 2020 01:07:02 +0800 Subject: [PATCH 0627/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200507=20Ubun?= =?UTF-8?q?tu=20Studio=20To=20Replace=20Xfce=20With=20KDE=20Plasma=20Deskt?= =?UTF-8?q?op=20Environment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md --- ...fce With KDE Plasma Desktop Environment.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md diff --git a/sources/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md b/sources/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md new file mode 100644 index 0000000000..586232d723 --- /dev/null +++ b/sources/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment) +[#]: via: (https://itsfoss.com/ubuntu-studio-opts-for-kde/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment +====== + +[Ubuntu Studio][1] is a popular [official flavour of Ubuntu][2] tailored for creative content creators involved in audio production, video, graphics, photography, and book publishing. It offers a lot of multimedia content creation applications out of the box with the best possible experience. + +After the recent 20.04 LTS release, the Ubuntu Studio team highlighted something very important in their [official announcement][3]. And, probably not everyone noticed the key information i.e Ubuntu Studio’s future. + +Ubuntu Studio 20.04 will be the last version to ship with the [Xfce desktop environment][4]. All the future releases will be using [KDE Plasma][5] instead. + +### Why is Ubuntu Studio ditching XFCE? + +![][6] + +As per their clarification, Ubuntu Studio isn’t focused on any particular look/feel but aims to provide the best user experience possible. And, KDE proves to be a better option. + +> Plasma has proven to have better tools for graphics artists and photographers, as can be seen in Gwenview, Krita, and even the file manager Dolphin. Additionally, it has Wacom tablet support better than any other desktop environment. + +> It has become so good that the majority of the Ubuntu Studio team is now using Kubuntu with Ubuntu Studio added-on via Ubuntu Studio Installer as their daily driver. With so many of us using Plasma, the timing just seems right to focus on a transition to Plasma with our next release. + +Of course every desktop environment has been tailored for something different. And, here, they think that KDE Plasma will be the most suitable desktop environment replacing XFCE to provide a better user experience to all the users. + +While I’m not sure how the users will react to this as every user has a different set of preferences. If the existing users won’t have a problem with KDE, it isn’t going to be a big deal. + +It is worth noting that Ubuntu Studio also mentioned why KDE is potentially a superior choice for them: + +> The Plasma desktop environment has, without Akonadi, become just as light in resource usage as Xfce, perhaps even lighter. Other audio-focused Linux distributions, such as Fedora Jam and KXStudio, have historically used the KDE Plasma desktop environment and done well with the audio. + +Also, they’ve highlighted [an article by Jason Evangelho at Forbes][7] where some benchmarks reveal that KDE is almost as light as Xfce. Even though that’s a good sign – we still have to wait for the users to test-drive the KDE-powered Ubuntu Studio. Only then we’ll be able to observe whether Ubuntu Studio’s decision to ditch XFCE desktop environment was the right thing to do. + +### What will change for Ubuntu Studio users after this change? + +The overall workflow may get affected (or improve) moving forward with KDE on Ubuntu Studio 20.10 and later. + +However, the upgrade process (from 20.04 to 20.10) will result in broken systems. So, a fresh install of Ubuntu Studio 20.10 or later versions will be the only way to go. + +They’ve also mentioned that they will be constantly evaluating for any duplication with the pre-installed apps. So, I believe more details will follow in the coming days. + +Ubuntu Studio is second distribution that has changed its main desktop environment in recent times. Earlier, [Lubuntu][8] switched to LXQt from LXDE. + +What do you think about this change? Feel free to share your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-studio-opts-for-kde/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://ubuntustudio.org/ +[2]: https://itsfoss.com/which-ubuntu-install/ +[3]: https://ubuntustudio.org/2020/04/ubuntu-studio-20-04-lts-released/ +[4]: https://xfce.org +[5]: https://kde.org/plasma-desktop +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-studio-kde-xfce.jpg?ssl=1 +[7]: https://www.forbes.com/sites/jasonevangelho/2019/10/23/bold-prediction-kde-will-steal-the-lightweight-linux-desktop-crown-in-2020 +[8]: https://itsfoss.com/lubuntu-20-04-review/ From 8357ae31341fdc38a453af4aa36a1bd18f93eb19 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 7 May 2020 01:08:01 +0800 Subject: [PATCH 0628/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200507=20Ubun?= =?UTF-8?q?tu=20Cinnamon=20Remix=2020.04=20Review:=20The=20Perfect=20Blend?= =?UTF-8?q?=20of=20Ubuntu=20With=20Cinnamon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200507 Ubuntu Cinnamon Remix 20.04 Review- The Perfect Blend of Ubuntu With Cinnamon.md --- ...e Perfect Blend of Ubuntu With Cinnamon.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 sources/tech/20200507 Ubuntu Cinnamon Remix 20.04 Review- The Perfect Blend of Ubuntu With Cinnamon.md diff --git a/sources/tech/20200507 Ubuntu Cinnamon Remix 20.04 Review- The Perfect Blend of Ubuntu With Cinnamon.md b/sources/tech/20200507 Ubuntu Cinnamon Remix 20.04 Review- The Perfect Blend of Ubuntu With Cinnamon.md new file mode 100644 index 0000000000..952e2ea946 --- /dev/null +++ b/sources/tech/20200507 Ubuntu Cinnamon Remix 20.04 Review- The Perfect Blend of Ubuntu With Cinnamon.md @@ -0,0 +1,157 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu Cinnamon Remix 20.04 Review: The Perfect Blend of Ubuntu With Cinnamon) +[#]: via: (https://itsfoss.com/ubuntu-cinnamon-remix-review/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +Ubuntu Cinnamon Remix 20.04 Review: The Perfect Blend of Ubuntu With Cinnamon +====== + +GNOME 3 was introduced in 2011, and the GNOME Shell immediately generated both positive and negative responses. Many users and developers liked the original GNOME interface enough that a few groups forked it and one of those, Linux Mint team, created the [Cinnamon desktop environment][1]. + +The Cinnamon desktop became the identity of Linux Mint. For years, Cinnamon has been synonymous to [Linux Mint][2]. It has changed slightly in the past few years as the popularity for Cinnamon grew. Now other distributions have also started offering Cinnamon desktop environment. [Manjaro][3] is one such example. + +A few months back, we introduced you to a [new Ubuntu flavor that provides an out of the box Cinnamon desktop experience][4]. let’s take a deeper look at [Ubuntu Cinnamon Remix][5] today. + +### Why Ubuntu Cinnamon Remix and not Linux Mint? + +It is true that Linux Mint is based on Ubuntu and Many Linux Mint users will have the question: Does it make any sense to switch over to Ubuntu as Linux Mint is such a mature project and the user experience will remain more or less the same? + +Ubuntu Cinnamon Remix has a number of small differences from Linux Mint, but has has one key difference that a Linux enthusiast can’t ignore. + +Linux Mint is based on “LTS” (Long-Term Support) versions of Ubuntu, meaning it stays behind the Canonical’s 6-month update cadence. Ubuntu Cinnamon Remix benefits from a newer kernel to other 6-month cycle feature upgrade and more recent software. + +Another key difference is that Ubuntu Cinnamon Remix will “inherit” [Snap support][6], and Linux Mint embraces [FlatPak][7]. Ubuntu Cinnamon Remix uses Ubuntu Software Center instead of Mint Software Manager. + +That said, I am a huge fan of Cinnamon. So I chose to review this mix of Ubuntu and Cinnamon and here I share my experience with it. + +### Experiencing Ubuntu Cinnamon Remix + +By any chance given, I will always mention how fast [Calamares installer][8] is and thanks to Ubuntu Cinnamon Remix Team for choosing so. + +![Calamares Installer][9] + +A fresh installation of Ubuntu Cinnamon Remix consumes approximately 750 MB of RAM. This is very similar to Linux Mint Cinnamon. + +![An idle Cinnamon takes 750 MB of RAM][10] + +I was also impressed by the beautiful [Kimmo theme][11] and the orange toned Ubuntu wallpaper which seems to be a result of a very meticulous effort. + +![Ubuntu Cinammon Remix 20.04 Desktop][12] + +#### Enough tools to get you started + +As with any other Ubuntu distribution, Ubuntu Cinnamon Remix is packed with the essential productivity tools, to name a few: + + * Firefox Web Browser + * Thunderbird – Email Client + * LibreOffice suite + * Celluloid – Multimedia player + * [GIMP][13] – Image processing software + * Synaptic Package Manager + * Gnome Software Center + * [Gparted][14] – Partition Manager + + + +Using Ubuntu Cinnamon Remix as my main runner for a few days, fulfilled my high expectations. Ubuntu is rock-solid stable, very fast and I didn’t face a single issue at my day to day tasks. + +#### Ubuntu for Linux Mint Lovers + +Are you enthusiastic about Ubuntu Cinnamon but got used to Linux Mint theme? Click below to see how you can get a full Linux Mint theme pack and how to configure it to keep the Ubuntu heritage. + +Give Ubuntu Cinnamon Remix the real Mint touch + +Firstly you have to download and unpack the following, easily done via terminal. + +**Get the Linux Mint-X icon pack** + +``` +wget http://packages.linuxmint.com/pool/main/m/mint-x-icons/mint-x-icons_1.5.5_all.deb +``` + +**Get the Linux Mint-Y icon pack** + +``` +wget http://packages.linuxmint.com/pool/main/m/mint-y-icons/mint-y-icons_1.3.9_all.deb +``` + +**Get the Linux Mint Themes** + +``` +wget http://packages.linuxmint.com/pool/main/m/mint-themes/mint-themes_1.8.4_all.deb +``` + +**Install the downloaded content** + +``` +sudo dpkg -i ./mint-x-icons_1.5.5_all.deb ./mint-y-icons_1.3.9_all.deb ./mint-themes_1.8.4_all.deb +``` + +When done, click on the Menu button at the bottom left corner and type themes. You can also find themes in system settings. + +![Accessing Themes][15] + +Once opened replace the kimmo icons and theme as shown below. The Linux Mint default “Green” is the plain Mint-Y but the orange colour is a perfect selection for Ubuntu. + +![Linux Mint Theme Settings][16] + +#### A treat for Cinnamon fans + +Let’s accept it, aesthetics are important. Cinnamon has a clean and elegant look, easy to read fonts and nice colour contrast themes. Cinnamon offers an uncluttered desktop with easily configured desktop icons simply by accessing the Desktop menu under System Settings. You can also choose the desktop icons to be shown only on the primary monitor, only on secondary monitor, or on both. This also applies to a beyond two monitor setup. + +![Ubuntu Cinnamon Remix Desklets][17] + +Desklets and applets are small, single-purpose applications that can be added to your desktop or your panel respectively. The most commonly used among the many you can choose are CPU or resources monitor, a weather applet, sticky notes, and calendar. + +The Cinnamon Control Center provides centralized access to many of the desktop configuration options. By accessing the themes section you can choose the desktop basic scheme and icons, window borders, mouse pointers, and controls look. Fonts can have a great impact on the overall desktop look and cinnamon makes the change easier than ever. + +The Cinnamon Control Center makes the configuration simple enough for a new user, compared to KDE Plasma that can lead a new user to confusion, due to the massive number of configuration options. + +![][18] + +The Cinnamon Panel contains the menu used to launch programs, a basic system tray, and an application selector. The panel is easy to configure and adding new program launchers is simply done by locating the program you want to add in the main Menu, right click on the icon and select “Add to panel.” You can also add the launcher icon to the desktop, and to the Cinnamon “Favourites” launcher bar. If you don’t like the order of the icons at your panel, just right click at the panel bar, enter panel’s Edit mode and rearrange the icons. + +#### **Conclusions** + +Whether you decide to “spice” up your desktop or thinking to move from [Windows to Linux][19], the Cinnamon Community has made plenty of spices for you. + +Traditional yet elegant, customizable but simple, Ubuntu Cinnamon Remix is an interesting project with a promising future, and for existing fans of the Cinnamon Desktop who love Ubuntu, this is probably a no-brainer. + +What do you think of Ubuntu Cinnamon Remix? Have you used it already? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-cinnamon-remix-review/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Cinnamon_(desktop_environment) +[2]: https://www.linuxmint.com/ +[3]: https://manjaro.org/ +[4]: https://itsfoss.com/ubuntudde/ +[5]: https://ubuntucinnamon.org/ +[6]: https://snapcraft.io/ +[7]: https://flatpak.org/ +[8]: https://calamares.io/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/Calamares-Installer.png?resize=800%2C426&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/htop-running-on-Ubuntu-Cinnamon-Remix-20.04.png?ssl=1 +[11]: https://github.com/Ubuntu-Cinnamon-Remix/kimmo-gtk-theme +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Ubuntu-Cinammon-Remix-20.04-desktop.png?resize=800%2C450&ssl=1 +[13]: https://itsfoss.com/gimp-2-10-release/ +[14]: https://itsfoss.com/gparted/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/accessing-themes.png?ssl=1 +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/Linux-Mint-theme-settings.png?ssl=1 +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-cinnamon-remix-desklets.jpg?fit=800%2C450&ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-cinnamon-control.jpg?fit=800%2C450&ssl=1 +[19]: https://itsfoss.com/windows-like-linux-distributions/ From 6b681ab52dea3daf62aa77906b9286bf12846c15 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 7 May 2020 01:12:15 +0800 Subject: [PATCH 0629/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200506=206=20?= =?UTF-8?q?open=20source=20alternatives=20to=20Wunderlist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200506 6 open source alternatives to Wunderlist.md --- ... open source alternatives to Wunderlist.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sources/tech/20200506 6 open source alternatives to Wunderlist.md diff --git a/sources/tech/20200506 6 open source alternatives to Wunderlist.md b/sources/tech/20200506 6 open source alternatives to Wunderlist.md new file mode 100644 index 0000000000..84c5cc828b --- /dev/null +++ b/sources/tech/20200506 6 open source alternatives to Wunderlist.md @@ -0,0 +1,124 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 open source alternatives to Wunderlist) +[#]: via: (https://opensource.com/article/20/5/alternatives-list) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike) + +6 open source alternatives to Wunderlist +====== +Love lists? Check out this handy list of open source apps for managing +all your lists! +![a checklist for a team][1] + +Wunderlist is an app for lists, loved by many, but gone for good as of May 6, 2020. The website encourages existing users to download and use Microsoft To Do in its place. That's tempting because it makes it easy to import all of those lists you've made over the years. Then again, maybe it's a chance to _Marie Kondo_ those lists and pare things down. Do you really need 30 lists? (Apparently, I've decided that I do, so I won't judge.) + +I have lists for all sorts of things, from "Plants for the garden 2020" to "Gifts for the husband." Some are checklists, some are To Do lists, and some are lists for list's sake. + +For my husband and me, the most useful list is our shared grocery list. We both have the app on our phones, we both add things to the list, we review it together but separately on our phones before he goes shopping (yes, you read that correctly), and he checks things off as he puts them in the cart. It makes the whole thing surprisingly efficient, and I think we save some money because we're into sticking to THE LIST. + +While its users loved it, Wunderlist isn't entirely unique. There are a gazillion list apps out there. With Wunderlist, I've specifically enjoyed its combination of simplicity and design, and that it managed to implement useful features like sharing and collaboration with others, dynamics checkboxes for lists, and a great user experience across both mobile and web interfaces. I've also enjoyed using it for a list that isn't an "active" document: a list I don't review weekly or make regular progress on—like my many lists I've used for brainstorming an idea (including that novel I've been meaning to write...). + +From the many wonderful articles we've published over the years, I've curated a list of open source alternatives to Wunderlist that may work for your needs, from simple task management and to-do lists to complex note-taking and process management. Or, if you are that person scribbling tasks and notes on paper scraps and post-it notes that are lying... er, around somewhere and everywhere... this might be a good time to try one of these digital options out. + +### Tasks—works with OwnCloud + +> Tasks is a free and open source app you can install from [F-droid][2]. Tasks is a mobile-only application, but it's extremely flexible in what it can sync to. You can save your lists to NextCloud or OwnCloud, Google Tasks, Apple Reminders, and just about any CalDAV server you have an account on. +> +> The default view of Tasks is a daily view, so any task you enter is assumed to be a task from today onward. If you're like me and you want to maintain several unique lists, you can do that with Tags. When you create a tag, you create a category for tasks. You can assign a colour and an icon so each list of tasks is unique. +> +> It takes a little getting used to, but tagging has many advantages. Because all tasks are tagged, you can view groups of tasks by clicking the tag you want to filter for, but you can also filter by day and even by place. That means that when you go grocery shopping, your grocery list becomes the active default list, and your everyday life list becomes active again when you return home. +> +> By syncing your data to one of your online accounts, you can share lists with loved ones, collaborators, and colleagues. +> +> Another great feature is that if you the same tasks every morning when you get to work, or the same 20 items in your weekly grocery list, you can create tasks that repeat on a regular basis. + +Reviewed by Seth Kenlon + +![Screenshot of Tasks interface][3] + +### OpenTasks—best for long lists + +> [OpenTasks][4] is an excellent task management tool for creating individual tasks with a wide variety of settings. It supports a wide range of fields when creating a task, ranging from basic things, such as name and description, to more complex items, such as choosing if the task is private, public, or confidential. The biggest thing that sets OpenTasks apart from the alternatives is its use of tabs on the app's main screen. These tabs quickly allow you to see the tasks due, tasks starting soon, tasks sorted by priority, and tasks sorted by current progress towards completion. Many of the other apps support doing things like these, but OpenTasks quickly easily accesses these lists. + +[Read the full OpenTasks review][5] by Joshua Allen Holm + +![OpenTasks in Google Play store][6] + +### Mirakel—great for nested lists + +> [Mirakel][7] is a task management app with a modern user interface and support for just about every format you might want in such a program. At Mirakel's basic level, it supports multiple lists, which are referred to as "meta lists." Creating an individual task has a plethora of options with deadlines, reminders, progress tracking, tags, notes, sub-tasks, and file attachments, all comprising a part of a task's entry. + +[Read the full Mirakel review][5] by Joshua Allen Holm + +![Screenshot from website of Mirakel app][8] + +### Todo—simple and effective, works anywhere + +> [Todo.txt][9] is one of the two to-do list and task management apps that I keep coming back to over and over again (the other is Org mode). And what keeps me coming back is that it is simple, portable, understandable, and has many great add-ons that don't break it if one machine has them and the others don't. And since it is a Bash shell script, I have never found a system that cannot support it. Read more about [how to install and use Todo.txt][10]. + +[Read the full todo.txt review][10] by Kevin Sonney + +![Drop-down menu for Todo.txt][11] + +Drop-down menu for Todo.txt + +### Joplin—best for private lists + +> [Joplin][12] is a NodeJS application that runs and stores information locally, allows you to encrypt your tasks and supports multiple sync methods. Joplin can run as a console or graphical application on Windows, Mac, and Linux. Joplin also has mobile apps for Android and iOS, meaning you can take your notes with you without a major hassle. Joplin even allows you to format your notes with Markdown, HTML, or plain text. + +[Read the full Joplin review][13] by Kevin Sonney + +![Joplin graphical version ][14] + +### CherryTree—great alternative to Evernote / OneNote / Keep + +> [CherryTree][15] is a GPLv3-licensed application that organizes information in nodes. Each node can have child nodes, allowing you to easily organize your lists and thoughts. And, child nodes can have their own children with independent properties. + +[Read the full CherryTree review][16] by Ben Cotton + +![CherryTree's hierarchical note layout][17] + +### Bonus: Wekan—for fans of Kanban + +> Kanban boards are a mainstay of today's agile processes. And many of us (myself included) use them to organize not just our work but also our personal lives. I know several artists who use apps like Trello to keep track of their commission lists as well as what's in progress and what's complete. But these apps are often linked to a work account or a commercial service. Enter [Wekan][18], an open source kanban board you can run locally or on the service of your choice. Wekan offers much of the same functionality as other Kanban apps, such as creating boards, lists, swimlanes, and cards, dragging and dropping between lists, assigning to users, labeling cards, and doing pretty much everything else you'd expect in a modern kanban board. + +[Read the full Wekan review][19]* by Kevin Sonney* + +![Wekan kanban board][20] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/alternatives-list + +作者:[Jen Wike Huger][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jen-wike +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_hands_team_collaboration.png?itok=u82QepPk (a checklist for a team) +[2]: https://f-droid.org/en/packages/org.tasks/ +[3]: https://opensource.com/sites/default/files/uploads/screenshot_tasks_resized.jpg (Screenshot of Tasks interface) +[4]: https://play.google.com/store/apps/details?id=org.dmfs.tasks +[5]: https://opensource.com/article/17/1/task-management-time-tracking-android +[6]: https://opensource.com/sites/default/files/uploads/opentasks_rezied.jpg (OpenTasks in Google Play store) +[7]: https://mirakel.azapps.de/ +[8]: https://opensource.com/sites/default/files/uploads/mirakel_web_resized.jpg (Screenshot from website of Mirakel app) +[9]: http://todotxt.org/ +[10]: https://opensource.com/article/20/1/open-source-to-do-list +[11]: https://opensource.com/sites/default/files/uploads/todo.txtmenu_3.png (Drop-down menu for Todo.txt) +[12]: https://joplin.cozic.net/ +[13]: https://opensource.com/article/19/1/productivity-tool-joplin +[14]: https://opensource.com/sites/default/files/uploads/joplin-1.png (Joplin graphical version ) +[15]: https://www.giuspen.com/cherrytree/ +[16]: https://opensource.com/article/19/5/cherrytree-notetaking +[17]: https://opensource.com/sites/default/files/uploads/cherrytree.png (CherryTree's hierarchical note layout) +[18]: https://wekan.github.io/ +[19]: https://opensource.com/article/19/1/productivity-tool-wekan +[20]: https://opensource.com/sites/default/files/uploads/wekan-board.png (Wekan kanban board) From 290c3681d6c02ae1a9d4c7b25e907ec1338867d6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 7 May 2020 01:12:50 +0800 Subject: [PATCH 0630/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200506=20Spee?= =?UTF-8?q?d=20up=20administration=20of=20Kubernetes=20clusters=20with=20k?= =?UTF-8?q?9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md --- ...tration of Kubernetes clusters with k9s.md | 311 ++++++++++++++++++ 1 file changed, 311 insertions(+) create mode 100644 sources/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md diff --git a/sources/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md b/sources/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md new file mode 100644 index 0000000000..03f563a952 --- /dev/null +++ b/sources/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md @@ -0,0 +1,311 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Speed up administration of Kubernetes clusters with k9s) +[#]: via: (https://opensource.com/article/20/5/kubernetes-administration) +[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) + +Speed up administration of Kubernetes clusters with k9s +====== +Check out this cool terminal UI for Kubernetes administration. +![Dogs playing chess][1] + +Usually, my articles about Kubernetes administration are full of kubectl commands for administration for your clusters. Recently, however, someone pointed me to the [k9s][2] project for a fast way to review and resolve day-to-day issues in Kubernetes. It's been a huge improvement to my workflow and I'll show you how to get started in this tutorial.  + +Installation can be done on a Mac, in Windows, and Linux. Instructions for each operating system can be found [here][2]. Be sure to complete installation to be able to follow along. + +I will be using Linux and Minikube, which is a lightweight way to run Kubernetes on a personal computer. Install it following [this tutorial][3] or by using the [documentation][4]. + +### Setting the k9s configuration file + +Once you've installed the k9s app, it's always good to start with the help command. + + +``` +$ k9s help +K9s is a CLI to view and manage your Kubernetes clusters. + +Usage: +  k9s [flags] +  k9s [command] + +Available Commands: +  help        Help about any command +  info        Print configuration info +  version     Print version/build info + +Flags: +  -A, --all-namespaces                 Launch K9s in all namespaces +      --as string                      Username to impersonate for the operation +      --as-group stringArray           Group to impersonate for the operation +      --certificate-authority string   Path to a cert file for the certificate authority +      --client-certificate string      Path to a client certificate file for TLS +      --client-key string              Path to a client key file for TLS +      --cluster string                 The name of the kubeconfig cluster to use +  -c, --command string                 Specify the default command to view when the application launches +      --context string                 The name of the kubeconfig context to use +      --demo                           Enable demo mode to show keyboard commands +      --headless                       Turn K9s header off +  -h, --help                           help for k9s +      --insecure-skip-tls-verify       If true, the server's caCertFile will not be checked for validity +      --kubeconfig string              Path to the kubeconfig file to use for CLI requests +  -l, --logLevel string                Specify a log level (info, warn, debug, error, fatal, panic, trace) (default "info") +  -n, --namespace string               If present, the namespace scope for this CLI request +      --readonly                       Disable all commands that modify the cluster +  -r, --refresh int                    Specify the default refresh rate as an integer (sec) (default 2) +      --request-timeout string         The length of time to wait before giving up on a single server request +      --token string                   Bearer token for authentication to the API server +      --user string                    The name of the kubeconfig user to use + +Use "k9s [command] --help" for more information about a command. +``` + +As you can see, there is a lot of functionality we can configure with k9s. The only step we need to take place to get off the ground is to write a configuration file. The **info** command will point us to where the application is looking for it. + + +``` +$ k9s info + ____  __.________ +|    |/ _/   __   \\______ +|      < \\____    /  ___/ +|    |  \   /    /\\___ \ +|____|__ \ /____//____  > +        \/            \/ + +Configuration:   /Users/jess/.k9s/config.yml +Logs:            /var/folders/5l/c1y1gcw97szdywgf9rk1100m0000gn/T/k9s-jess.log +Screen Dumps:    /var/folders/5l/c1y1gcw97szdywgf9rk1100m0000gn/T/k9s-screens-jess +``` + + By default, k9s expects a configuration file and will fail to run without one. The command will return without any message, but if we look at the log file we see an error. + + +``` +$ tail -1 /var/folders/5l/c1y1gcw97szdywgf9rk1100m0000gn/T/k9s-mbbroberg.log +10:56AM FTL Unable to connect to api server error="Missing or incomplete configuration info.  Please point to an existing, complete config file:\n\n  1. Via the command-line flag --kubeconfig\n  2. Via the KUBECONFIG environment variable\n  3. In your home directory as ~/.kube/config\n\nTo view or setup config directly use the 'config' command." +``` + +To add a file, make the directory if it doesn't already exist and then add one. + + +``` +$ mkdir -p ~/.k9s/ +$ touch ~/.k9s/config.yml +``` + +For this introduction, we will use the default config.yml recommendations from the k9s repository. The maintainers note that this format is subject to change, so we can [check here][5] for the latest version. + + +``` +k9s: +  refreshRate: 2 +  headless: false +  readOnly: false +  noIcons: false +  logger: +    tail: 200 +    buffer: 500 +    sinceSeconds: 300 +    fullScreenLogs: false +    textWrap: false +    showTime: false +  currentContext: minikube +  currentCluster: minikube +  clusters: +    minikube: +      namespace: +        active: "" +        favorites: +       - all +        - kube-system +        - default +      view: +        active: dp +  thresholds: +    cpu: +      critical: 90 +      warn: 70 +    memory: +      critical: 90 +      warn: 70 +``` + +We set k9s to look for a local minikube configuration, so I'm going to confirm minikube is online and ready to go.  + + +``` +$ minikube status +host: Running +kubelet: Running +apiserver: Running +kubeconfig: Configured +``` + +### Running k9s to explore a Kubernetes cluster + +### With a configuration file set and pointing at our local cluster, we can now run the **k9s** command. + + +``` +`$ k9s` +``` + +Once you start it up, the k9s text-based user interface (UI) will pop up. With no flag for a namespace, it will show you the pods in the default namespace. + +![K9s screenshot][6] + +If you run in an environment with a lot of pods, the default view can be overwhelming. Alternatively, we can focus on a given namespace. Exit the application and run **k9s -n <namespace>** where _<namespace>_ is an existing namespace. In the picture below, I ran **k9s -n minecraft,** and it shows my broken pod + +![K9s screenshot][7] + +So once you have k9s up and running, there are a bunch of things you can do quickly.  + +Navigating k9s happens through shortcut keys. We can always use arrow keys and the enter key to choose items listed. There are quite a few other universal keystrokes to navigate to different views: + + * **0**—Show all pods in all namespaces + + + +![K9s screenshot][8] + + * **d**—Describe the selected pod + + + +![K9s screenshot][9] + + * **l**—Show logs for the selected pod pod + + + +![Using k9s to show Kubernetes pod logs][10] + +You may notice that k9s is set to use [Vim command keys][11], including moving up and down using **J** and **K** keys. Good luck exiting, emacs users :) + +### Viewing different Kubernetes resources quickly + +Need to get to something that's not a pod? Yea I do too. There are a number of shortcuts that are available when we enter a colon (":") key. From there, you can use the following commands to navigate around there. + + * **:svc**—Jump to a services view. + + + +![K9s screenshot][12] + + * **:deploy**—Jump to a deployment view. + + + +![K9s screenshot][13] + + * **:rb**—Jump to a Rolebindings view for [role-based access control (RBAC)][14] management. + + + +![K9s screenshot][15] + + * **:namespace**—Jump back to the namespaces view. + + + +![K9s screenshot][16] + + * **:cj**—Jump to the cronjobs view to see what jobs are scheduled in the cluster. + + + +![K9s screenshot][17] + +The most used tool for this application will be the keyboard; to go up or down on any page, use the arrow keys. If you need to quit, remember to use Vim keybindings. Type **:q** and hit enter to leave. + +### Example of troubleshooting Kubernetes with k9s + +How does k9s help when something goes wrong? To walk through an example, I let several pods die due to misconfiguration. Below you can see my terrible hello deployment that's crashing. Once we highlight it, we press **d** to run a _describe_ command to see what is causing the failure. + +![K9s screenshot][18] + +![K9s screenshot][19] + +Skimming the events does not tell us a reason for the failure. Next, I hit the **esc** key and go check the logs by highlighting the pod and entering **<shift-l>**. + +![K9s screenshot][20] + +Unfortunately, the logs don't offer anything helpful either (probably because the deployment was never correctly configured), and the pod will not come up. + +I then **esc** to step back out, and I will see if deleting the pod will take care of this issue. To do so, I highlight the pod and use **<ctrl-d>**. Thankfully, k9s prompts users before deletion.  + +![K9s screenshot][21] + +While I did delete the pod, the deployment resource still exists, so a new pod will come back up. It will also continue to restart and crash for whatever reason (we don't know yet). + +Here is the point where I would repeat reviewing logs, describing resources, and use the **e** shortcut to even edit a running pod to troubleshoot the behavior. In this particular case, the failing pod is not configured to run in this environment. So let's delete the deployment to stop crash-then-reboot loop we are in. + +We can get to deployments by typing **:deploy** and clicking enter. From there we highlight and press **<ctrl-d>** to delete. + +![K9s screenshot][22] + +![K9s screenshot][23] + +And poof the deployment is gone! It only took a few keystrokes to clean up this failed deployment. + +### k9s is incredibly customizable + +So this application has a ton of customization options, down to the color scheme of the UI. Here are a few editable options you may be interested in: + + * Adjust where you put the config.yml file (so you can store it in [version control][24]) + * Add [custom aliases][25] to an **alias.yml** file + * Create [custom hotkeys][26] in a **hotkey.yml** file + * Explore available [plugins][27] or write your own + + + +The entire application is configured in YAML files, so customization will feel familiar to any Kubernetes administrator. + +### Simplify your life with k9s + +I'm prone to administrating over my team's systems in a very manual way, more for brain training than anything else. When I first heard about k9s, I thought, "This is just lazy Kubernetes," so I dismissed it and went back to doing my manual intervention everywhere. I actually started using it daily while working through my backlog, and I was blown away at how much faster it was to use than kubectl alone. Now I'm a convert.  + +It's important to know your tools and master the "hard way" of doing something. It is also important to remember, as far as administration goes, it's important to work smarter, not harder. Using k9s is the way I live up to that objective. I guess we can call it lazy Kubernetes administration, and that's okay. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/kubernetes-administration + +作者:[Jessica Cherry][a] +选题:[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/cherrybomb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/game-dogs-chess-play-lead.png?itok=NAuhav4Z (Dogs playing chess) +[2]: https://github.com/derailed/k9s +[3]: https://opensource.com/article/18/10/getting-started-minikube +[4]: https://kubernetes.io/docs/tasks/tools/install-minikube/ +[5]: https://github.com/derailed/k9s#k9s-configuration +[6]: https://opensource.com/sites/default/files/uploads/k9s_1.png (K9s screenshot) +[7]: https://opensource.com/sites/default/files/uploads/k9s_2.png (K9s screenshot) +[8]: https://opensource.com/sites/default/files/uploads/k9s_3.png (K9s screenshot) +[9]: https://opensource.com/sites/default/files/uploads/k9s_5_0.png (K9s screenshot) +[10]: https://opensource.com/sites/default/files/uploads/k9s-show-logs-opensourcedotcom.png (Using k9s to show Kubernetes pod logs) +[11]: https://opensource.com/article/19/3/getting-started-vim +[12]: https://opensource.com/sites/default/files/uploads/k9s_5.png (K9s screenshot) +[13]: https://opensource.com/sites/default/files/uploads/k9s_6.png (K9s screenshot) +[14]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ +[15]: https://opensource.com/sites/default/files/uploads/k9s_7.png (K9s screenshot) +[16]: https://opensource.com/sites/default/files/uploads/k9s_8.png (K9s screenshot) +[17]: https://opensource.com/sites/default/files/uploads/k9s_9.png (K9s screenshot) +[18]: https://opensource.com/sites/default/files/uploads/k9s_10.png (K9s screenshot) +[19]: https://opensource.com/sites/default/files/uploads/k9s_11.png (K9s screenshot) +[20]: https://opensource.com/sites/default/files/uploads/k9s_12.png (K9s screenshot) +[21]: https://opensource.com/sites/default/files/uploads/k9s_13.png (K9s screenshot) +[22]: https://opensource.com/sites/default/files/uploads/k9s_14.png (K9s screenshot) +[23]: https://opensource.com/sites/default/files/uploads/k9s_15.png (K9s screenshot) +[24]: https://opensource.com/article/19/3/move-your-dotfiles-version-control +[25]: https://k9scli.io/topics/aliases/ +[26]: https://k9scli.io/topics/hotkeys/ +[27]: https://github.com/derailed/k9s/tree/master/plugins From 36fe6fa73d662e98210850732e6239c52fc3d555 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 7 May 2020 01:13:33 +0800 Subject: [PATCH 0631/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200506=20Cust?= =?UTF-8?q?omizing=20my=20open=20source=20PHP=20framework=20for=20web=20de?= =?UTF-8?q?velopment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200506 Customizing my open source PHP framework for web development.md --- ...ource PHP framework for web development.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20200506 Customizing my open source PHP framework for web development.md diff --git a/sources/tech/20200506 Customizing my open source PHP framework for web development.md b/sources/tech/20200506 Customizing my open source PHP framework for web development.md new file mode 100644 index 0000000000..00b605148d --- /dev/null +++ b/sources/tech/20200506 Customizing my open source PHP framework for web development.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Customizing my open source PHP framework for web development) +[#]: via: (https://opensource.com/article/20/5/codeignitor) +[#]: author: (Wee Ben Sen https://opensource.com/users/bswee14) + +Customizing my open source PHP framework for web development +====== +Codeignitor is a PHP framework that empowers companies to develop +high-performance websites with flexibility and ease. +![Business woman on laptop sitting in front of window][1] + +PHP Codeignitor is an open source framework providing business applications with the easy-to-use PHP programming language and powerful tools for coding. It also provides business intelligence, server monitoring, development, and application integration facilities. It's a relatively quiet project that you don't hear much about, but it's got a lot going for it that many developers new to it find surprising and refreshing. + +I use [Codeignitor][2] at my job working for an online tuition service provider in Singapore. We offer services that aren't common enough to be the default feature set for templates or existing back-ends, so I need something that provides good, solid, raw materials I can build upon. Initially, I was considering other platforms such as Wordpress for our website; however, I arrived at Codeignitor due to its flexibility and integration of functions needed in the tuition-matching process. + +Here are the points that sold me on Codeignitor: + + * Database integration with MySQL—A major functionality is allowing clients to browse the tutor database and add tutors like a "shopping cart" similar to an e-commerce platform. + * Client interface system—Users can log in to manage preferences and edit their particulars, modify subject taught, areas traveled, mobile number, address, etc. + * Customized administrator panel—The administrator can access the client's submission with a customized admin panel, which is integrated with a customer service feature so the administrator can follow up individually. + * Payment system—The admin panel comes with an invoice and payments gateway, which is integrated with Paypal. + * CMS editor interface—The administrator is able to edit text and images in the blog and subject pages, as well as add new pages. + + + +The project took around six months to complete and another two months of debugging work. If I'd had to build all of it from scratch or try to rework an existing framework to suit our needs, it would have taken longer, and I probably wouldn't have ended up with what I needed for the demands of our customers. + +### Features and benefits + +There are many more features that draw developers to PHP Codeignitor, including error handling and code formatting, which are useful in every coding situation. It supports templates, which can be used to add functionality to an existing website or to generate new ones. There are many features available for a business that needs to use a web-based system, including the ability to use custom tags. Most can be used by even an average developer who does not have any prior experience in programming. + +The key features of Codeignitor are: + + * XML core services, + * HTTP/FTP core services + * AppData and PHP sandbox features + * XSLT and HTML templates + * Encrypted information transfer + * PCM Codeignitor server monitoring + * Application integration + * File Transfer Protocol (FTP) + * Help desk support + * Apache POI (content management infrastructure used for hosting a website) + + + +#### Compatibility + +Codeignitor is compatible with many leading software applications like PHP, MySQL, [MariaDB][3], [phpMyAdmin][4], [Apache][5], OpenBSD, XSLT, [SQLite][6], and more. A number of companies prefer to use Codeignitor products for their website requirements because they are easy to work with and integrate. If you're not comfortable creating your own website, you can find many developers and design agencies that provide custom web development services. + +#### Security + +Codeignitor also provides data security through SSL encryption. The encryption protects the data from external threats such as intruders and firewalls. The data storage facility also allows for security audits of the company's website. + +#### Other features + +A good PHP web development company uses several advanced and third-party technologies such as XML and PHP. It provides organizations with a complete platform to develop professional-looking, useful websites with a business application. Codeignitor makes it easy to use third party technology, and works with common web development software. This allows web agencies to easily create websites with their chosen modules. Most PHP developers offer support and training services for individuals, as well. + +### Using PHP framework Codeignitor + +Codeignitor allows businesses to have a complete package for PHP development that will offer the right combination of power, flexibility, and performance. So far, I am very pleased with our website and I have continuously upgraded and added new features along the way. I look forward to discovering what else I can do with our website using Codeignitor. Could it be right for you too? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/codeignitor + +作者:[Wee Ben Sen][a] +选题:[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/bswee14 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) +[2]: https://codeigniter.com/ +[3]: http://mariadb.org/ +[4]: https://www.phpmyadmin.net/ +[5]: http://apache.org/ +[6]: http://sqlite.org/ From d771233d1eef0243d1f53c0758065738cce95480 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 7 May 2020 01:14:26 +0800 Subject: [PATCH 0632/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200506=20Mana?= =?UTF-8?q?ging=20Git=20projects=20with=20submodules=20and=20subtrees?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200506 Managing Git projects with submodules and subtrees.md --- ...t projects with submodules and subtrees.md | 212 ++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 sources/tech/20200506 Managing Git projects with submodules and subtrees.md diff --git a/sources/tech/20200506 Managing Git projects with submodules and subtrees.md b/sources/tech/20200506 Managing Git projects with submodules and subtrees.md new file mode 100644 index 0000000000..f906f2a4e4 --- /dev/null +++ b/sources/tech/20200506 Managing Git projects with submodules and subtrees.md @@ -0,0 +1,212 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managing Git projects with submodules and subtrees) +[#]: via: (https://opensource.com/article/20/5/git-submodules-subtrees) +[#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) + +Managing Git projects with submodules and subtrees +====== +Submodules and subtrees help you manage child projects across multiple +repositories. +![Digital creative of a browser on the internet][1] + +If you are into open source development, you have probably worked with Git to manage source code. You might have come across projects with numerous dependencies and/or sub-projects. How do you manage them? + +For an open source organization, it can be tricky to achieve single-source documentation and dependency management for the community _and_ the product. The documentation and project often end up fragmented and redundant, which makes them difficult to maintain. + +### The need + +Suppose you want to use a single project as a child project inside a repository. The traditional method is just to copy the project to the parent repository. But, what if you want to use the same child project in many parent repositories? It wouldn't be feasible to copy the child project into every parent and have to make changes in all of them whenever you update it. This would create redundancy and inconsistency in the parent repositories and make it difficult to update and maintain the child project. + +### Git submodules and subtrees + +What if you could put one project within another using a single command? What if you could just add the project as a child to any number of projects and push changes on the go, whenever you want to? Git provides solutions for this: Git submodules and Git subtrees. These tools were created to support code-sharing development workflows on a more modular level, aspiring to bridge the gap between the Git repository's source-code management (SCM) and the sub-repos within it. + +![Cherry tree growing on a mulberry tree][2] + +Cherry tree growing on a mulberry tree + +This is a real-life scenario of the concepts this article will cover in detail. If you're already familiar with trees, here is what this model will look like: + +![Tree with subtrees][3] + +CC BY-SA opensource.com + +### What are Git submodules? + +Git provides submodules in its default package that enable Git repositories to be nested within other repositories. To be precise, the Git submodule points to a specific commit on the child repository. Here is what Git submodules look like in my [Docs-test][4] GitHub repo: + +![Git submodules screenshot][5] + +The format **[folder@commitId][6]** indicates that the repository is a submodule, and you can directly click on the folder to go to the child repository. The config file called **.gitmodules** contains all the submodule repository details. My repo's **.gitmodules** file looks like this: + +![Screenshot of .gitmodules file][7] + +You can use the following commands to use Git submodules in your repositories. + +#### Clone a repository and load submodules + +To clone a repository containing submodules: + + +``` +`$ git clone --recursive ` +``` + +If you have already cloned a repository and want to load its submodules: + + +``` +`$ git submodule update --init` +``` + +If there are nested submodules: + + +``` +`$ git submodule update --init --recursive` +``` + +#### Download submodules + +Downloading submodules sequentially can be a tedious task, so **clone** and **submodule update** will support the **\--jobs** or **-j** parameter. + +For example, to download eight submodules at once, use: + + +``` +$ git submodule update --init --recursive -j 8 +$ git clone --recursive --jobs 8 <URL to Git repo> +``` + +#### Pull submodules + +Before running or building the parent repository, you have to make sure that the child dependencies are up to date. + +To pull all changes in submodules: + + +``` +`$ git submodule update --remote` +``` + +#### Create repositories with submodules + +To add a child repository to a parent repository: + + +``` +`$ git submodule add ` +``` + +To initialize an existing Git submodule: + + +``` +`$ git submodule init` +``` + +You can also create branches and track commits in your submodules by adding **\--update** to your **submodule update** command: + + +``` +`$ git submodule update --remote` +``` + +#### Update submodule commits + +As explained above, a submodule is a link that points to a specific commit in the child repository. If you want to update the commit of the submodule, don't worry. You don't need to specify the latest commit explicitly. You can just use the general **submodule update** command: + + +``` +`$ git submodule update` +``` + +Just add and commit as you normally would to create and push the parent repository to GitHub. + +#### Delete a submodule from a parent repository + +Merely deleting a child project folder manually won't remove the child project from the parent repository. To delete a submodule named **childmodule**, use: + + +``` +`$ git rm -f childmodule` +``` + +Although Git submodules may appear easy to work with, it can be difficult for beginners to find their way around them. + +### What are Git subtrees? + +Git subtrees, introduced in Git 1.7.11, allow you to insert a copy of any repository as a subdirectory of another one. It is one of several ways Git projects can inject and manage project dependencies. It stores the external dependencies in regular commits. Git subtrees provide clean integration points, so they're easier to revert. + +If you use the [subtrees tutorial provided by GitHub][8] to use subtrees, you won't see a **.gittrees** config file in your local whenever you add a subtree. This makes it difficult to recognize subtrees because subtrees look like general folders, but they are copies of the child repository. The version of Git subtree with the **.gittrees** config file is not available with the default Git package, so to get the git-subtree with **.gittrees** config file, you must download git-subtree from the [**/contrib/subtree** folder][9] in the Git source repository. + +You can clone any repository containing subtrees, just like any other general repository, but it may take longer because entire copies of the child repository reside in the parent repository. + +You can use the following commands to use Git subtrees in your repositories. + +#### Add a subtree to a parent repository + +To add a new subtree to a parent repository, you first need to **remote add** it and then run the **subtree add** command, like: + + +``` +$ git remote add remote-name <URL to Git repo> +$ git subtree add --prefix=folder/ remote-name <URL to Git repo> subtree-branchname +``` + +This merges the whole child project's commit history to the parent repository. + +#### Push and pull changes to and from the subtree + + +``` +`$ git subtree push-all` +``` + +or + + +``` +`$ git subtree pull-all` +``` + +### Which should you use? + +Every tool has pros and cons. Here are some features that may help you decide which is best for your use case. + + * Git submodules have a smaller repository size since they are just links that point to a specific commit in the child project, whereas Git subtrees house the entire child project along with its history. + * Git submodules need to be accessible in a server, but subtrees are decentralized. + * Git submodules are mostly used in component-based development, whereas Git subtrees are used in system-based development. + + + +A Git subtree isn't a direct alternative to a Git submodule. There are certain caveats that guide where each can be used. If there is an external repository you own and are likely to push code back to, use Git submodule since it is easier to push. If you have third-party code that you are unlikely to push to, use Git subtree since it is easier to pull. + +Give Git subtrees and submodules a try and let me know how it goes in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/git-submodules-subtrees + +作者:[Manaswini Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/manaswinidas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://opensource.com/sites/default/files/uploads/640px-bialbero_di_casorzo.jpg (Cherry tree growing on a mulberry tree) +[3]: https://opensource.com/sites/default/files/subtree_0.png (Tree with subtrees) +[4]: https://github.com/manaswinidas/Docs-test/ +[5]: https://opensource.com/sites/default/files/uploads/git-submodules_github.png (Git submodules screenshot) +[6]: mailto:folder@commitId +[7]: https://opensource.com/sites/default/files/uploads/gitmodules.png (Screenshot of .gitmodules file) +[8]: https://help.github.com/en/github/using-git/about-git-subtree-merges +[9]: https://github.com/git/git/tree/master/contrib/subtree From b75fb525cba2f1e4b07042ad202a49b19c2d6384 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 7 May 2020 01:18:56 +0800 Subject: [PATCH 0633/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200506=20IBM?= =?UTF-8?q?=20rolls=20Red=20Hat=20into=20edge,=20AI,=20hybrid-cloud=20expa?= =?UTF-8?q?nsion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200506 IBM rolls Red Hat into edge, AI, hybrid-cloud expansion.md --- ...t into edge, AI, hybrid-cloud expansion.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/talk/20200506 IBM rolls Red Hat into edge, AI, hybrid-cloud expansion.md diff --git a/sources/talk/20200506 IBM rolls Red Hat into edge, AI, hybrid-cloud expansion.md b/sources/talk/20200506 IBM rolls Red Hat into edge, AI, hybrid-cloud expansion.md new file mode 100644 index 0000000000..ef7d152e55 --- /dev/null +++ b/sources/talk/20200506 IBM rolls Red Hat into edge, AI, hybrid-cloud expansion.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IBM rolls Red Hat into edge, AI, hybrid-cloud expansion) +[#]: via: (https://www.networkworld.com/article/3542409/ibm-rolls-red-hat-into-edge-ai-hybrid-cloud-expansion.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +IBM rolls Red Hat into edge, AI, hybrid-cloud expansion +====== +Every company will be an AI company new IBM CEO Krishna tells Think! virtual gathering +Getty + +Deeply assimilating its Red Hat technology, IBM this week rolled out a set of new platforms and services designed to help customers manage edge-based application workloads and exploit artificial intelligence for infrastructure resiliency. + +The announcements came at IBM’s virtualized Think! 2020 event that also featured the first Big Blue keynote by [the company's new CEO Arvind Krishna][1], during which he told the online audience about challenges of COVID-19: "History will look back on this as the moment when the digital transformation of business and society suddenly accelerated,” but also that [hybrid cloud and AI][2] are the two dominant forces driving digital transformation. + +[Now see how AI can boost data-center availability and efficiency][3] + +“More than 20 years ago, experts predicted every company would become an internet company. I am predicting today that every company will become an AI company, not because they can, but because they must,” he said. + +With that idea in mind the company rolled out [IBM Watson AIOps][4], an application that uses AI to automate how enterprises detect, diagnose and respond to IT anomalies in real time. Watson AIOps works by grouping log anomalies and alerts based on spatial and temporal reasoning as well as similarity to past situations, IBM said. It uses IBM’s natural language processing technology to understand the content in trouble tickets to identify and extract resolution actions automatically. + +Then it provides a pointer to where the problem is and identifies other services that might be affected.  “It does this by showing details of the problem based on data from existing tools in the environment, all in the context of the application topology, distilling multiple signals into a succinct report” and eliminating the need for multiple dashboards, IBM stated. + +AI can automate tasks like shifting traffic from one router to another, freeing up space on a drive, or restarting an application. AI systems can also be trained to self-correct, IBM stated. + +“The problem is that many businesses are consumed with fixing problems after they occur, instead of preventing them before they happen. Watson AIOps relies on AI to solve and automate how enterprises self-detect, diagnose and respond to anomalies in real time,” Krishna said. + +AIOps is built on the latest release of Red Hat OpenShift, supports Slack and Box, and can be integrated with IT-monitoring packages from Mattermost and ServiceNow, IBM stated.  + +The Kubernetes-based OpenShift Container Platform lets enterprise customers deploy and manage containers on their infrastructure of choice, be it private or public clouds, including AWS, Microsoft Azure, Google Cloud Platform, Alibaba and IBM Cloud.  It also integrates with IBM prepackaged Cloud Paks, which include a secured Kubernetes container and containerized IBM middleware designed to let customers quickly spin-up enterprise-ready containers. + +OpenShift is also the underlying package for a new version of its [edge network][5] management application called IBM Edge Application Manager. Based on the open source project [Open Horizon][6], the Edge Application Manager can use AI and analytics to help deploy and manage up to 10,000 edge nodes simultaneously by a single administrator. With the platform customers can remotely add new capabilities to a single-purpose device or automatically direct a device to use a variety of cloud-based resources depending on what resources it needs.   + +Cisco said it was working with the IBM Edge Application Manager to deploy apps and analytics models that run on a broad range of Cisco products, such as servers, its industrial portfolio of gateways, routers, switches, SD-WAN, and wireless-connectivity offerings for edge computing.  + +“As an example, IBM Edge Application Manager leverages [Cisco HyperFlex Edge][7] and Cisco IC3000 Industrial Compute Gateway servers. The HyperFlex Edge and IC3K platforms are specifically designed to support a number of edge use cases, such as optimizing traffic management, increasing manufacturing productivity, and increasing the safety of oil and gas pipelines,” Cisco [stated][8]. + +In addition, Cisco said it has used the capabilities in IBM Edge Application Manager to build an “Edge in a Box proposal,” where customers can deploy remote edge applications that run entirely disconnected from public or private clouds but are also synchronized and managed remotely in controlled connectivity windows. For instance, client edge locations may need to operate in disconnected mode but have the ability to synch up for automated application updates and data exchanges, Cisco stated. + +Other edge-related announcements include: + + * IBM [Edge Ecosystem][9], a group of industry players who will target open technology developments to let customers move data and applications between private data centers, hybrid multicloud environments and the edge. The group includes Cisco, Juniper, Samsung and NVIDIA among others. IBM said a Telco Network Cloud Ecosystem will serve a similar function for their network cloud platforms. + * A preview of an upcoming service, called IBM Cloud Satellite. This will extend IBM’s public-cloud service to give customers the ability to use IBM Cloud anywhere – on-premises, in data centers or at the edge – delivered as a service that can be managed from a single pane of glass controlled through the public cloud. It lets customers run applications where it makes sense while utilizing cloud security and ops benefits, IBM stated. Satellite runs on Red Hat OpenShift. + * Telco Network Cloud Manager – a telco/service provider offering that runs  on Red Hat OpenShift to deliver intelligent automation capabilities to orchestrate virtual and container network functions in minutes. Service providers will have the ability to manage workloads on both Red Hat OpenShift and Red Hat OpenStack platforms, which will be critical as telcos increasingly look to modernize their networks for greater agility and efficiency, and to provide new services as 5G adoption expands, IBM stated. + * New capabilities for some of its Cloud Paks including extending the Cloud Pak for Data to include the ability to better automate planning, budgeting and forecasting in [hybrid-cloud][10] environments. IBM upgraded tools for business routing and data capture to the Cloud Pak for Automation as well. + + + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3542409/ibm-rolls-red-hat-into-edge-ai-hybrid-cloud-expansion.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3536654/ibm-taps-new-leaders-for-hybrid-cloud-battles-ahead.html +[2]: https://www.infoworld.com/article/3541825/ibms-new-ceo-lays-out-his-roadmap.html +[3]: https://www.networkworld.com/article/3274654/ai-boosts-data-center-availability-efficiency.html +[4]: https://www.ibm.com/watson/assets/duo/pdf/WDDE814_IBM_Watson_AIOps_Web.pdf +[5]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[6]: https://developer.ibm.com/blogs/open-horizon-joins-linux-foundation-grow-open-edge-computing-platform/ +[7]: https://www.cisco.com/c/en/us/products/hyperconverged-infrastructure/index.html?dtid=oblgzzz001087 +[8]: https://blogs.cisco.com/partner/cisco-and-ibm-teaming-at-the-edge +[9]: https://www.ibm.com/blogs/business-partners/join-the-edge-ecosystem/ +[10]: https://www.networkworld.com/article/3268448/what-is-hybrid-cloud-really-and-whats-the-best-strategy.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From 3c1f6f4adaea0bc7680f2b2ba50c145ad80817bf Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 7 May 2020 08:41:17 +0800 Subject: [PATCH 0634/1809] translated --- ...200428 Upgrading Fedora 31 to Fedora 32.md | 99 ------------------- ...200428 Upgrading Fedora 31 to Fedora 32.md | 99 +++++++++++++++++++ 2 files changed, 99 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md create mode 100644 translated/tech/20200428 Upgrading Fedora 31 to Fedora 32.md diff --git a/sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md b/sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md deleted file mode 100644 index 5dd426ccfc..0000000000 --- a/sources/tech/20200428 Upgrading Fedora 31 to Fedora 32.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Upgrading Fedora 31 to Fedora 32) -[#]: via: (https://fedoramagazine.org/upgrading-fedora-31-to-fedora-32/) -[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) - -Upgrading Fedora 31 to Fedora 32 -====== - -![][1] - -Fedora 32 [is available now][2]. You’ll likely want to upgrade your system to get the latest features available in Fedora. Fedora Workstation has a graphical upgrade method. Alternatively, Fedora offers a command-line method for upgrading Fedora 30 to Fedora 31. - -Before upgrading, visit the [wiki page of common Fedora 32 bugs][3] to see if there’s an issue that might affect your upgrade. Although the Fedora community tries to ensure upgrades work well, there’s no way to guarantee this for every combination of hardware and software that users might have. - -### Upgrading Fedora 31 Workstation to Fedora 32 - -Soon after release time, a notification appears to tell you an upgrade is available. You can click the notification to launch the **GNOME Software** app. Or you can choose Software from GNOME Shell. - -Choose the _Updates_ tab in GNOME Software and you should see a screen informing you that Fedora 32 is Now Available. - -If you don’t see anything on this screen, try using the reload button at the top left. It may take some time after release for all systems to be able to see an upgrade available. - -Choose _Download_ to fetch the upgrade packages. You can continue working until you reach a stopping point, and the download is complete. Then use GNOME Software to restart your system and apply the upgrade. Upgrading takes time, so you may want to grab a coffee and come back to the system later. - -### Using the command line - -If you’ve upgraded from past Fedora releases, you are likely familiar with the _dnf upgrade_ plugin. This method is the recommended and supported way to upgrade from Fedora 31 to Fedora 32. Using this plugin will make your upgrade to Fedora 32 simple and easy. - -#### 1\. Update software and back up your system - -Before you do start the upgrade process, make sure you have the latest software for Fedora 31. This is particularly important if you have modular software installed; the latest versions of dnf and GNOME Software include improvements to the upgrade process for some modular streams. To update your software, use _GNOME Software_ or enter the following command in a terminal. - -``` -sudo dnf upgrade --refresh -``` - -Additionally, make sure you back up your system before proceeding. For help with taking a backup, see [the backup series][4] on the Fedora Magazine. - -#### 2\. Install the DNF plugin - -Next, open a terminal and type the following command to install the plugin: - -``` -sudo dnf install dnf-plugin-system-upgrade -``` - -#### 3\. Start the update with DNF - -Now that your system is up-to-date, backed up, and you have the DNF plugin installed, you can begin the upgrade by using the following command in a terminal: - -``` -sudo dnf system-upgrade download --releasever=32 -``` - -This command will begin downloading all of the upgrades for your machine locally to prepare for the upgrade. If you have issues when upgrading because of packages without updates, broken dependencies, or retired packages, add the _‐‐allowerasing_ flag when typing the above command. This will allow DNF to remove packages that may be blocking your system upgrade. - -#### 4\. Reboot and upgrade - -Once the previous command finishes downloading all of the upgrades, your system will be ready for rebooting. To boot your system into the upgrade process, type the following command in a terminal: - -``` -sudo dnf system-upgrade reboot -``` - -Your system will restart after this. Many releases ago, the _fedup_ tool would create a new option on the kernel selection / boot screen. With the _dnf-plugin-system-upgrade_ package, your system reboots into the current kernel installed for Fedora 31; this is normal. Shortly after the kernel selection screen, your system begins the upgrade process. - -Now might be a good time for a coffee break! Once it finishes, your system will restart and you’ll be able to log in to your newly upgraded Fedora 32 system. - -![][5] - -### Resolving upgrade problems - -On occasion, there may be unexpected issues when you upgrade your system. If you experience any issues, please visit the [DNF system upgrade quick docs][6] for more information on troubleshooting. - -If you are having issues upgrading and have third-party repositories installed on your system, you may need to disable these repositories while you are upgrading. For support with repositories not provided by Fedora, please contact the providers of the repositories. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/upgrading-fedora-31-to-fedora-32/ - -作者:[Adam Šamalík][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/asamalik/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/31-32-816x345.png -[2]: https://fedoramagazine.org/announcing-fedora-32/ -[3]: https://fedoraproject.org/wiki/Common_F32_bugs -[4]: https://fedoramagazine.org/taking-smart-backups-duplicity/ -[5]: https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot_f23-ws-upgrade-test_2016-06-10_110906-1024x768.png -[6]: https://docs.fedoraproject.org/en-US/quick-docs/dnf-system-upgrade/#Resolving_post-upgrade_issues diff --git a/translated/tech/20200428 Upgrading Fedora 31 to Fedora 32.md b/translated/tech/20200428 Upgrading Fedora 31 to Fedora 32.md new file mode 100644 index 0000000000..637bf41ce8 --- /dev/null +++ b/translated/tech/20200428 Upgrading Fedora 31 to Fedora 32.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Upgrading Fedora 31 to Fedora 32) +[#]: via: (https://fedoramagazine.org/upgrading-fedora-31-to-fedora-32/) +[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) + +将 Fedora 31 升级到 Fedora 32 +====== + +![][1] + +Fedora 32 [已经发布][2]。你可能想升级系统以获得 Fedora 中的最新功能。Fedora Workstation 有图形化的升级方法。另外,Fedora 提供了命令行方法,用于将 Fedora 30 升级到 Fedora 31。 + +升级前,请访问 [Fedora 32 个常见 bug 的维基页面] [3],查看是否存在可能影响升级的问题。尽管 Fedora 社区试图确保升级正常进行,但是无法为用户可能使用的每种软硬件组合提供保证。 + +### 将Fedora 31 Workstation 升级到 Fedora 32 + +发布不久之后就会出现通知,告诉你有可用的升级。你可以单击通知启动 **GNOME Software**。或者,你可以从 GNOME Shell 中选择“软件”。 + +在 GNOME Software中 选择 _Updates_ 选项卡,你会看到一个页面通知你 Fedora 32 现在可用。 + +如果你在此页面看不到任何内容,请尝试使用左上方的重新加载按钮。发布后,所有系统可能都需要一段时间才能看到可用的升级。 + +选择 _Download_ 获取升级包。你可以继续做事直到下载完成。然后使用 GNOME Software 重启系统并应用升级。升级需要时间,因此你可能需要喝杯咖啡,稍后再回来。 + +### 使用命令行 + +如果你是从 Fedora 的先前版本升级的,那么你可能对 _dnf upgrade_ 插件很熟悉。此方法是从 Fedora 31 升级到 Fedora 32 的推荐和受支持的方法。使用此插件将使你轻松地升级到 Fedora 32。 + +#### 1\. 更新软件并备份系统 + +在开始升级过程之前,请确保你有 Fedora 31 的最新软件。如果你安装了模块化软件,这尤为重要。dnf 和 GNOME Software 的最新版本对某些模块化流的升级过程进行了改进。要更新软件,请使用_ GNOME Software_ 或在终端中输入以下命令。 + +``` +sudo dnf upgrade --refresh +``` + +此外,在继续操作之前,请确保备份系统。有关备份的帮助,请参阅 Fedora Magazine 上的[备份系列][4]。 + +#### 2\. 安装 DNF 插件 + +接下来,打开终端并输入以下命令安装插件: + +``` +sudo dnf install dnf-plugin-system-upgrade +``` + +#### 3\. 使用 DNF 开始更新 + +现在,你的系统已更新、已备份、并且已安装 DNF 插件,你可以在终端中使用以下命令开始升级: + +``` +sudo dnf system-upgrade download --releasever=32 +``` + +该命令将开始在本地下载计算机的所有升级,以准备升级。如果由于没有更新的软件包、损坏的依赖项或已淘汰的软件包而在升级时遇到问题,请在输入上述命令时添加 _‐allowerasing_ 标志。这将使 DNF 删除可能阻止系统升级的软件包。 + +#### 4\. 重启并升级 + +当上一个命令完成了所有升级的下载,你的系统就可以重新启动了。要将系统引导至升级过程,请在终端中输入以下命令: + +``` +sudo dnf system-upgrade reboot +``` + +此后,系统将重启。在许多版本之前,_fedup_ 工具会在内核选择/引导页上创建一个新选项。使用 _dnf-plugin-system-upgrade_ 包,你的系统将重启进入 Fedora 31 当前安装的内核;这个是正常的。在选择内核之后,你的系统会立即开始升级过程。 + +现在可能是喝杯咖啡休息的好时机!完成后,系统将重启,你将能够登录到新升级的 Fedora 32 系统。 + +![][5] + +### 解决升级问题 + +有时,升级系统时可能会出现意外问题。如果你遇到任何问题,请访问 [DNF 系统升级文档][6],以获取有关故障排除的更多信息。 + +如果升级时遇到问题,并且系统上安装了第三方仓库,那么在升级时可能需要禁用这些仓库。对于 Fedora 不提供的仓库的支持,请联系仓库的提供者。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/upgrading-fedora-31-to-fedora-32/ + +作者:[Adam Šamalík][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/asamalik/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/31-32-816x345.png +[2]: https://fedoramagazine.org/announcing-fedora-32/ +[3]: https://fedoraproject.org/wiki/Common_F32_bugs +[4]: https://fedoramagazine.org/taking-smart-backups-duplicity/ +[5]: https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot_f23-ws-upgrade-test_2016-06-10_110906-1024x768.png +[6]: https://docs.fedoraproject.org/en-US/quick-docs/dnf-system-upgrade/#Resolving_post-upgrade_issues From 9f2a56309ae5a977e41ccd004f8a06c8108c6dc1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 7 May 2020 08:48:05 +0800 Subject: [PATCH 0635/1809] translating --- sources/tech/20200428 What-s new in Fedora 32 Workstation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200428 What-s new in Fedora 32 Workstation.md b/sources/tech/20200428 What-s new in Fedora 32 Workstation.md index 402a8e63a7..7553d1bb99 100644 --- a/sources/tech/20200428 What-s new in Fedora 32 Workstation.md +++ b/sources/tech/20200428 What-s new in Fedora 32 Workstation.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 366f92cf3ad9cf9b17feb32c3c88a6a651c57713 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 7 May 2020 10:07:38 +0800 Subject: [PATCH 0636/1809] PRF @tinyeyeser --- ...o avoid man-in-the-middle cyber attacks.md | 52 +++++++++---------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/translated/tech/20200407 How to avoid man-in-the-middle cyber attacks.md b/translated/tech/20200407 How to avoid man-in-the-middle cyber attacks.md index 7ccce7c3bd..ca5b6b0aac 100644 --- a/translated/tech/20200407 How to avoid man-in-the-middle cyber attacks.md +++ b/translated/tech/20200407 How to avoid man-in-the-middle cyber attacks.md @@ -1,68 +1,64 @@ [#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " +[#]: translator: "tinyeyeser" +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "How to avoid man-in-the-middle cyber attacks" [#]: via: "https://opensource.com/article/20/4/mitm-attacks" [#]: author: "Jackie Lam https://opensource.com/users/beenverified" -如何避免中间人攻击 +如何避免中间人攻击(MITM) ====== -首先搞明白到底什么是中间人攻击,才能避免成为此类高科技窃听的受害者。 +> 首先搞明白到底什么是中间人攻击(MITM),才能避免成为此类高科技窃听的受害者。 -![Security monster][1] +![](https://img.linux.net.cn/data/attachment/album/202005/07/100655i7og1eqsw6o3ww81.jpg) 当你使用电脑发送数据或与某人在线通话的时候,你一定采取了某种程度的安全隐私手段。 但如果有第三方在你不知情的情况下窃听,甚至冒充某个你信任的商业伙伴窃取破坏性的信息呢?你的私人数据就这样被放在了危险分子的手中。 -这就是臭名昭著的中间人攻击。 +这就是臭名昭著的中间人攻击man-in-the-middle(MITM)。 ### 到底什么是中间人攻击? -黑客潜入到你与受害者或是某个设备间的通信过程中,窃取敏感信息——多数是身份信息——进而从事各种违法行为的过程,就是一次中间人攻击。Scamicide公司创始人Steve J. J. Weisman介绍说: +黑客潜入到你与受害者或是某个设备间的通信过程中,窃取敏感信息(多数是身份信息)进而从事各种违法行为的过程,就是一次中间人攻击。Scamicide 公司创始人 Steve J. J. Weisman 介绍说: -“中间人攻击也可以发生在受害者与某个合法app或网页中间。当受害者以为自己面对的是正常app或网页时,其实Ta 正在与一个仿冒的app或网页互动,将自己的敏感信息透露给不法分子。” +> “中间人攻击也可以发生在受害者与某个合法 app 或网页中间。当受害者以为自己面对的是正常 app 或网页时,其实 Ta 正在与一个仿冒的 app 或网页互动,将自己的敏感信息透露给了不法分子。” -中间人攻击诞生于1980年代,是最古老的网络攻击形式之一。但它却更为常见。Weisman解释道,发生中间人攻击的场景有很多种: +中间人攻击诞生于 1980 年代,是最古老的网络攻击形式之一。但它却更为常见。Weisman 解释道,发生中间人攻击的场景有很多种: - * **攻陷一个未有效加密的WiFi路由器**:该场景多见于人们使用公共WiFi的时候。“虽然家用路由器也很脆弱,但黑客攻击公共WiFi网络的情况更为常见。”Weisman说,“黑客的目标就是从毫无戒心的人们那里窃取在线银行账户这样的敏感信息。” - * **攻陷银行、金融顾问等机构的电子邮件账户**:“一旦黑客攻陷了这些电子邮件系统,他们就会冒充银行或此类公司给受害者发邮件”,Weisman说,”他们以紧急情况的名义索要个人信息,诸如用户名和密码。受害者很容易被诱骗交出这些信息。“ - * **发送钓鱼邮件**:窃贼们还可能冒充成与受害者有合作关系的公司,向其索要个人信息。”在多个案例中,钓鱼邮件会引导受害者访问一个伪造的网页,这个伪造的网页看起来就和受害者常常访问的合法公司网页一模一样。“Weisman说道。 - * **在合法网页中嵌入恶意代码**:攻击者还会把恶意代码——通常是JavaScript——嵌入到一个合法的网页中。”当受害者加载这个合法网页时,恶意代码首先按兵不动,直到用户输入账户登录或是信用卡信息时,恶意代码就会复制这些信息并将其发送至攻击者的服务器。“网络安全专家Nicholas McBride介绍说。 + * **攻陷一个未有效加密的 WiFi 路由器**:该场景多见于人们使用公共 WiFi 的时候。“虽然家用路由器也很脆弱,但黑客攻击公共 WiFi 网络的情况更为常见。”Weisman 说,“黑客的目标就是从毫无戒心的人们那里窃取在线银行账户这样的敏感信息。” + * **攻陷银行、金融顾问等机构的电子邮件账户**:“一旦黑客攻陷了这些电子邮件系统,他们就会冒充银行或此类公司给受害者发邮件”,Weisman 说,”他们以紧急情况的名义索要个人信息,诸如用户名和密码。受害者很容易被诱骗交出这些信息。” + * **发送钓鱼邮件**:窃贼们还可能冒充成与受害者有合作关系的公司,向其索要个人信息。“在多个案例中,钓鱼邮件会引导受害者访问一个伪造的网页,这个伪造的网页看起来就和受害者常常访问的合法公司网页一模一样。”Weisman 说道。 + * **在合法网页中嵌入恶意代码**:攻击者还会把恶意代码(通常是 JavaScript)嵌入到一个合法的网页中。“当受害者加载这个合法网页时,恶意代码首先按兵不动,直到用户输入账户登录或是信用卡信息时,恶意代码就会复制这些信息并将其发送至攻击者的服务器。”网络安全专家 Nicholas McBride 介绍说。 ### 有哪些中间人攻击的著名案例? -联想作为主流的计算机制造厂商,在2014到2015年售卖的消费级笔记本电脑中预装了一款叫做 VisualDiscovery 的软件,拦截用户的网页浏览行为。当用户的鼠标在某个产品页面经过时,这款软件就会弹出一个来自合作伙伴的类似产品的广告。 +联想作为主流的计算机制造厂商,在 2014 到 2015 年售卖的消费级笔记本电脑中预装了一款叫做 VisualDiscovery 的软件,拦截用户的网页浏览行为。当用户的鼠标在某个产品页面经过时,这款软件就会弹出一个来自合作伙伴的类似产品的广告。 -这起中间人攻击事件的关键在于:VisualDiscovery 拥有访问用户所有私人数据的权限,包括身份证号、金融交易信息、医疗信息、登录名和密码等等。所有这些访问行为都是在用户不知情和未获得授权的情况下进行的。联邦交易委员会(FTC)认定此次事件为欺诈与不公平竞争。2019年,联想同意为此支付8300万美元的集体诉讼罚款。 +这起中间人攻击事件的关键在于:VisualDiscovery 拥有访问用户所有私人数据的权限,包括身份证号、金融交易信息、医疗信息、登录名和密码等等。所有这些访问行为都是在用户不知情和未获得授权的情况下进行的。联邦交易委员会(FTC)认定此次事件为欺诈与不公平竞争。2019 年,联想同意为此支付 8300 万美元的集体诉讼罚款。 ### 我如何才能避免遭受中间人攻击? - * **避免使用公共WiFi:**Weisman建议,从来都不要使用公开的WiFi进行金融交易,除非你安装了可靠的VPN客户端并连接至可信任的VPN服务器。通过VPN连接,你的通信是加密的,信息也就不会失窃。 + * **避免使用公共 WiFi**:Weisman 建议,从来都不要使用公开的 WiFi 进行金融交易,除非你安装了可靠的 VPN 客户端并连接至可信任的 VPN 服务器。通过 VPN 连接,你的通信是加密的,信息也就不会失窃。 * **时刻注意:**对要求你更新密码或是提供用户名等私人信息的邮件或文本消息要时刻保持警惕。这些手段很可能被用来窃取你的身份信息。 -如果不确定收到的邮件来自于确切哪一方,你可以使用诸如电话反查或是邮件反查等工具。通过电话反查,你可以找出未知发件人的更多身份信息。通过邮件反查,你可以尝试确定谁给你发来了这条消息。 + 如果不确定收到的邮件来自于确切哪一方,你可以使用诸如电话反查或是邮件反查等工具。通过电话反查,你可以找出未知发件人的更多身份信息。通过邮件反查,你可以尝试确定谁给你发来了这条消息。 -通常来讲,如果发现某些方面确实有问题,你可以听从公司中某个你认识或是信任的人的意见。或者,你也可以去你的银行、学校或其他某个组织,当面寻求他们的帮助。总之,重要的账户信息绝对不要透露给不认识的“技术人员”。 + 通常来讲,如果发现某些方面确实有问题,你可以听从公司中某个你认识或是信任的人的意见。或者,你也可以去你的银行、学校或其他某个组织,当面寻求他们的帮助。总之,重要的账户信息绝对不要透露给不认识的“技术人员”。 - * **不要点击邮件中的链接:**如果有人给你发了一封邮件,说你需要登录某个账户,不要点击邮件中的链接。相反,要通过平常习惯的方式自行去访问,并留意是否有告警信息。如果在账户设置中没有看到告警信息,给客服打电话的时候也_不要_联系邮件中留的电话,而是站点页面中的联系人信息。 - * **安装可靠的安全软件:**如果你使用的是Windows操作系统,安装开源的杀毒软件,如[ClamAV][2]。如果使用的是其他平台,要保持你的软件安装有最新的安全补丁。 - * **认真对待告警信息:**如果你正在访问的页面以HTTPS开头,浏览器可能会出现一则告警信息。例如,站点证书的域名与你尝试访问的站点域名不相匹配。千万不要忽视此类告警信息。听从告警建议,迅速关掉页面。确认域名没有输入错误的情况下,如果情况依旧,要立刻联系站点所有者。 - * **使用广告屏蔽软件:**弹窗广告(也叫广告软件攻击)可被用于窃取个人信息,因此你还可以使用广告屏蔽类软件。对个人用户来说,中间人攻击其实是很难防范的,因为它被设计出来的时候,就是为了让受害者始终蒙在鼓里,意识不到任何异常。有一款不错的开源广告屏蔽软件叫 [uBlock origin][4]。可以同时支持Firefox和Chromium(以及所有基于Chromium的浏览器,例如Chrome、Brave、Vivaldi、Edge等),甚至还支持Safari。 + * **不要点击邮件中的链接**:如果有人给你发了一封邮件,说你需要登录某个账户,不要点击邮件中的链接。相反,要通过平常习惯的方式自行去访问,并留意是否有告警信息。如果在账户设置中没有看到告警信息,给客服打电话的时候也*不要*联系邮件中留的电话,而是联系站点页面中的联系人信息。 + * **安装可靠的安全软件**:如果你使用的是 Windows 操作系统,安装开源的杀毒软件,如 [ClamAV][2]。如果使用的是其他平台,要保持你的软件安装有最新的安全补丁。 + * **认真对待告警信息**:如果你正在访问的页面以 HTTPS 开头,浏览器可能会出现一则告警信息。例如,站点证书的域名与你尝试访问的站点域名不相匹配。千万不要忽视此类告警信息。听从告警建议,迅速关掉页面。确认域名没有输入错误的情况下,如果情况依旧,要立刻联系站点所有者。 + * **使用广告屏蔽软件**:弹窗广告(也叫广告软件攻击)可被用于窃取个人信息,因此你还可以使用广告屏蔽类软件。对个人用户来说,中间人攻击其实是很难防范的,因为它被设计出来的时候,就是为了让受害者始终蒙在鼓里,意识不到任何异常。有一款不错的开源广告屏蔽软件叫 [uBlock origin][4]。可以同时支持 Firefox 和 Chromium(以及所有基于 Chromium 的浏览器,例如 Chrome、Brave、Vivaldi、Edge 等),甚至还支持 Safari。 ### 保持警惕 -要时刻记住,你并不需要立刻就点击某些链接,你也并不需要跟随某个陌生人的建议,无论这些信息看起来有多么紧急。互联网始终都在。你大可以先离开电脑,去证实一下这些人的真实身份,看看这些”无比紧急“的页面到底是真是假。 +要时刻记住,你并不需要立刻就点击某些链接,你也并不需要听从某个陌生人的建议,无论这些信息看起来有多么紧急。互联网始终都在。你大可以先离开电脑,去证实一下这些人的真实身份,看看这些“无比紧急”的页面到底是真是假。 尽管任何人都可能遭遇中间人攻击,只要弄明白何为中间人攻击,理解中间人攻击如何发生,并采取有效的防范措施,就可以保护自己避免成为其受害者。 -* * * - -_This article was originally published on [BeenVerified.com][5] under a [CC BY-SA 2.0][6] license._ - -------------------------------------------------------------------------------- via: https://opensource.com/article/20/4/mitm-attacks @@ -70,7 +66,7 @@ via: https://opensource.com/article/20/4/mitm-attacks 作者:[Jackie Lam][a] 选题:[lujun9972][b] 译者:[tinyeyeser](https://github.com/tinyeyeser) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b525cbdf895c58609a8996f05a198f01ff4196e3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 7 May 2020 10:08:10 +0800 Subject: [PATCH 0637/1809] PUB @tinyeyeser https://linux.cn/article-12191-1.html --- .../20200407 How to avoid man-in-the-middle cyber attacks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200407 How to avoid man-in-the-middle cyber attacks.md (99%) diff --git a/translated/tech/20200407 How to avoid man-in-the-middle cyber attacks.md b/published/20200407 How to avoid man-in-the-middle cyber attacks.md similarity index 99% rename from translated/tech/20200407 How to avoid man-in-the-middle cyber attacks.md rename to published/20200407 How to avoid man-in-the-middle cyber attacks.md index ca5b6b0aac..8ae4bb8a6d 100644 --- a/translated/tech/20200407 How to avoid man-in-the-middle cyber attacks.md +++ b/published/20200407 How to avoid man-in-the-middle cyber attacks.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "tinyeyeser" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-12191-1.html" [#]: subject: "How to avoid man-in-the-middle cyber attacks" [#]: via: "https://opensource.com/article/20/4/mitm-attacks" [#]: author: "Jackie Lam https://opensource.com/users/beenverified" From c9bea52ee1574bc76d95802cbd33a555c5aeb81c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 7 May 2020 14:40:15 +0800 Subject: [PATCH 0638/1809] PRF @lxbwolf --- ...nd JPG for your online images- Use WebP.md | 83 ++++++++++--------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md b/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md index 690f4c6c39..0450e63f23 100644 --- a/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md +++ b/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md @@ -1,28 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Drop PNG and JPG for your online images: Use WebP) [#]: via: (https://opensource.com/article/20/4/webp-image-compression) [#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas) -线上图片请抛弃 PNG 和 JPG 后缀:使用 WebP +线上图片请抛弃 PNG 和 JPG:使用 WebP ====== -了解一下这个开源的图片编辑工具来节省时间和空间。 -![Painting art on a computer screen][1] -WebP 是 2010 年 Google 开发的一种图片格式,能提供对网络图片的无损压缩和有损压缩。网络开发者们可以使用 WebP 来创建更小更丰富的图片,以此来提高网站的速度。更快的加载速度对于网站的用户体验和网站市场的效能是至关重要的。 +> 了解一下这个开源的图片编辑工具来节省时间和空间。 -为了提供领先于所有的设备和用户的图片加载能力,你网站上的图片文件大小不应该超过 500 KB。 +![](https://img.linux.net.cn/data/attachment/album/202005/07/143932l22hot7ebhbbqjmm.jpg) -WebP 无损图片通常比 PNG 图片文件小至少 25%。在相同的 SSIM(structural similarity,结构相似性)质量指标下,WebP 有损图片通常比 JPEG 图片小 25% 到 34%。 +WebP 是 2010 年 Google 开发的一种图片格式,它为网页上的图片提供了卓越的无损和有损压缩。网站开发者们可以使用 WebP 来创建尺寸更小、细节更丰富的图片,以此来提高网站的速度。更快的加载速度对于网站的用户体验和网站的营销效果是至关重要的。 -无损 WebP 也支持透明度。在有损 RGB 压缩可接受的情况下,有损 WebP 也支持透明度,PNG 文件的大小通常为 WebP 文件大小的四倍。 +为了在所有设备和用户中达到最佳加载效果,你网站上的图片文件大小不应该超过 500 KB。 -Google 报告把动图 GIF 文件转换为有损 WebP后文件大小减少了 64%,转换为无损 WebP 后文件大小减少了 19%。 +与 PNG 图片相比,WebP 无损图片通常至少要比 PNG 图片小 25%。在同等的 SSIM(结构相似度structural similarity)质量指标下,WebP 有损图片通常比 JPEG 图片小 25% 到 34%。 -WebP 文件格式是一种基于 RIFF(resource interchange file format,资源交换文件格式)的文档格式。你可以用 [hexdump][2] 看到文件的签名是 **52 49 46 46** (RIFF): +无损 WebP 也支持透明度。而在可接受有损 RGB 压缩的情况下,有损 WebP 也支持透明度,通常其大小比 PNG 文件小三倍。 + +Google 报告称,把动画 GIF 文件转换为有损 WebP 后文件大小减少了 64%,转换为无损 WebP 后文件大小减少了 19%。 + +WebP 文件格式是一种基于 RIFF(资源互换文件格式resource interchange file format)的文档格式。你可以用 [hexdump][2] 看到文件的签名是 `52 49 46 46`(RIFF): ``` @@ -33,31 +35,31 @@ $ hexdump --canonical pixel.webp 0000002e ``` -独立的 libwebp 库以 WebP 技术规范的引用实现的方式提供服务,可以从 Google 的 [Git 仓库][3] 或下载 tar 包获得。 +独立的 libwebp 库作为 WebP 技术规范的参考实现,可以从 Google 的 [Git 仓库][3] 或 tar 包中获得。 -全球在用的 80% 的 web 浏览器兼容 WebP 格式。本文撰写时,Apple 的 Safari 浏览器还不兼容。对于不兼容的情况,应变方法是在 WebP 图片旁边准备一张 JPG/PNG 图片,我们有很多种方法和 Wordpress 插件来实现。 +全球在用的 80% 的 web 浏览器兼容 WebP 格式。本文撰写时,Apple 的 Safari 浏览器还不兼容。解决这个问题的方法是将 JPG/PNG 图片与 WebP 图片一起提供,有一些方法和 Wordpress 插件可以做到这一点。 -### 为什么这很重要? +### 为什么要这样做? -我的部分工作是设计和维护我们组织的网站。由于网站是个市场工具并且网站速度是衡量用户体验的重要指标,我一直致力于提高网站速度,通过把图片转换为 WebP 来减少图片大小是一个有效的解决方案。 +我的部分工作是设计和维护我们组织的网站。由于网站是个营销工具,而网站的速度是衡量用户体验的重要指标,我一直致力于提高网站速度,通过把图片转换为 WebP 来减少图片大小是一个很好的解决方案。 -我使用了 **web.dev** 来检测其中一个网页,该工具是由 Lighthouse 提供服务的,遵循 Apache 2.0 证书,可以在 找到。 +我使用了 web.dev 来检测其中一个网页,该工具是由 Lighthouse 提供服务的,遵循 Apache 2.0 许可证,可以在 找到。 -根据官方描述,”LIghthouse 是一个开源的,旨在提升网页质量的自动化工具。你可以在任何网页上运行它 — 公共的或需要鉴权的。它有性能、可用性、积极的 web 应用、SEO和其他项目的审计。你可以使用命令行、作为一个 Node 模块或在 Chrome DevTools 里运行 Lighthouse。你输入一个 URL 给 Lighthouse,它对这个网页运行一系列的审计规则,之后生成这个网页的审计结果报告。从报告的失败审计条目中可以知道应该怎么优化网页。每条审计都有对应的文档解释为什么该项目是重要的,以及如何修复它。“ +据其官方描述,“LIghthouse 是一个开源的,旨在提升网页质量的自动化工具。你可以在任何公共的或需要鉴权的网页上运行它。它有性能、可用性、渐进式 web 应用、SEO 等方面的审计。你可以在 Chrome 浏览器的开发工具中运行 Lighthouse,也可以通过命令行或作为 Node 模块运行。你输入一个 URL 给 Lighthouse,它会对这个网页进行一系列的审计,然后生成这个网页的审计结果报告。从报告的失败审计条目中可以知道应该怎么优化网页。每条审计都有对应的文档解释为什么该项目是重要的,以及如何修复它。” ### 创建更小的 WebP 图片 -我测试的页面返回了三张图片。在它生成的报告中,它提供了推荐和目标格式。我选择了它报告有 650 KB 的 ”app-graphic“ 图片。通过把它转换为 WebP 格式,预计可以图片大小降到 61 KB,节省 589 KB。我在 Photoshop 中把它转换了,用默认的 WebP 设置参数保存它,它的文件大小为 44.9 KB。比预期的还要好!从下面的 Photoshop 截图中可以看出,两张图在视觉上完全一样。 +我测试的页面返回了三张图片。在它生成的报告中,它提供了推荐和目标。我选择了它报告有 650 KB 的 `app-graphic` 图片。通过把它转换为 WebP 格式,预计可以把图片大小降到 61 KB,节省 589 KB。我在 Photoshop 中把它转换了,用默认的 WebP 设置参数保存它,它的文件大小为 44.9 KB。比预期的还要好!从下面的 Photoshop 截图中可以看出,两张图在视觉质量上完全一样。 ![WebP vs JPG comparison][4] -左图:650 KB(实际大小)。右图: 589 KB(转换之后的目标大小)。 +*左图:650 KB(实际大小)。右图: 44.9 KB(转换之后的目标大小)。* 当然,也可以用开源图片编辑工具 [GIMP][5] 把图片导出为 WebP。它提供了几个质量和压缩的参数: ![GIMP dialog for exporting webp, as a webp][6] -另一张图拉近视野后: +另一张图放大后: ![WebP vs PNG comparison][7] @@ -67,55 +69,54 @@ PNG(左图)和 WebP(右图),都是从 JPG 转换而来,两图对比 你也可以用 Linux 的命令行工具把图片从 JPG/PNG 转换为 WebP: -在命令行使用 **cwebp** 把 PNG 或 JPG 图片文件转换为 WebP 格式。你可以用下面的命令把 PNG 图片文件转换为质量参数为 80 的 WebP 图片。 - +在命令行使用 `cwebp` 把 PNG 或 JPG 图片文件转换为 WebP 格式。你可以用下面的命令把 PNG 图片文件转换为质量参数为 80 的 WebP 图片。 ``` -`cwebp -q 80 image.png -o image.webp` +cwebp -q 80 image.png -o image.webp ``` -你还可以用 [Image Magick][8],这个工具可能在你的发行版本软件仓库中可以找到。转换的子命令是 **convert**,它需要的所有参数就是输入和输出文件: - +你还可以用 [Image Magick][8],这个工具可能在你的发行版本软件仓库中可以找到。转换的子命令是 `convert`,它需要的所有参数就是输入和输出文件: ``` -`convert pixel.png pixel.webp` +convert pixel.png pixel.webp ``` ### 使用编辑器把图片转换为 WebP -使用 [GIMP][9] 图片编辑器来把图片转换为 WebP。从 2.10 版本开始,它原生地支持 WebP。 +要在图片编辑器中来把图片转换为 WebP,可以使用 [GIMP][9]。从 2.10 版本开始,它原生地支持 WebP。 -如果你是 Photoshop 用户,由于 Photoshop 默认不包含 WebP,因此你需要一个转换插件。遵循 Apache License 2.0 证书发行的 WebPShop 0.2.1 是一个用户打开和保存包括动图在内的 WebP 图片的 Photoshop 模块,在 可以找到。 +如果你是 Photoshop 用户,由于 Photoshop 默认不包含 WebP 支持,因此你需要一个转换插件。遵循 Apache License 2.0 许可证发布的 WebPShop 0.2.1 是一个用于打开和保存包括动画图在内的 WebP 图片的 Photoshop 模块,在 可以找到。 -为了能正常使用它,你需要把它放进 Photoshop 插件目录下的 **bin** 文件夹: +为了能正常使用它,你需要把它放进 Photoshop 插件目录下的 `bin` 文件夹: -Windows x64—C:\Program Files\Adobe\Adobe Photoshop\Plug-ins\WebPShop.8bi +Windows x64 :`C:\Program Files\Adobe\Adobe Photoshop\Plug-ins\WebPShop.8bi` -Mac—Applications/Adobe Photoshop/Plug-ins/WebPShop.plugin +Mac:`Applications/Adobe Photoshop/Plug-ins/WebPShop.plugin` ### Wordpress 上的 WebP 很多网站是用 Wordpress 搭建的(我的网站就是)。因此,Wordpress 怎么上传 WebP 图片?本文撰写时,它还不支持。但是,当然已经有插件来满足这种需求,因此你可以在你的网站上同时准备 WebP 和 PNG/JPG 图片(为 Apple 用户)。 -在 [Marius Hosting][11] 有下面的指示: +在 [Marius Hosting][11] 有下面的[说明][10]: -”直接向 Wordpress 上传 WebP 图片会怎样?这很简单。向你的主题 functions.php 文件添加几行内容就可以了。Wordpress 默认不支持展示和上传 WebP 文件,但是我会向你陈述怎么通过几个简单的步骤来让它支持。登录进你的 Wordpress 管理员界面,进入 Appearance/Theme Editor 找到 functions.php。拷贝下面的代码粘贴到文件最后并保存。 +> “直接向 Wordpress 上传 WebP 图片会怎样?这很简单。向你的主题 `functions.php` 文件添加几行内容就可以了。Wordpress 默认不支持展示和上传 WebP 文件,但是我会向你介绍一下怎么通过几个简单的步骤来让它支持。登录进你的 Wordpress 管理员界面,进入‘外观/主题编辑器’找到 `functions.php`。复制下面的代码粘贴到该文件最后并保存: - -``` -`//** *Enable upload for webp image files.*/ function webp_upload_mimes($existing_mimes) { $existing_mimes['webp'] = 'image/webp'; return $existing_mimes; } add_filter('mime_types', 'webp_upload_mimes');` +> ``` +//** *Enable upload for webp image files.*/ function webp_upload_mimes($existing_mimes) { $existing_mimes['webp'] = 'image/webp'; return $existing_mimes; } add_filter('mime_types', 'webp_upload_mimes'); ``` -"如果你想在 Media/Library 看缩略图预览,那么你需要把下面的代码也添加到 functions.php 文件。为了找到 functions.php 文件,进入 Appearance/Theme Editor 并搜索 functions.php,然后拷贝下面的代码粘贴到文件最后并保存。“ +> 如果你想在‘媒体/媒体库’时看到缩略图预览,那么你需要把下面的代码也添加到 `functions.php` 文件。为了找到 `functions.php` 文件,进入‘外观/主题编辑器’并搜索 `functions.php`,然后复制下面的代码粘贴到文件最后并保存: +> ``` +//** * Enable preview / thumbnail for webp image files.*/ function webp_is_displayable($result, $path) { if ($result === false) { $displayable_image_types = array( IMAGETYPE_WEBP ); $info = @getimagesize( $path ); if (empty($info)) { $result = false; } elseif (!in_array($info[2], $displayable_image_types)) { $result = false; } else { $result = true; } } return $result; } add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2); ``` -`//** * Enable preview / thumbnail for webp image files.*/ function webp_is_displayable($result, $path) { if ($result === false) { $displayable_image_types = array( IMAGETYPE_WEBP ); $info = @getimagesize( $path ); if (empty($info)) { $result = false; } elseif (!in_array($info[2], $displayable_image_types)) { $result = false; } else { $result = true; } } return $result; } add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2);` -``` + +> ” ### WebP 和未来 -WebP 是鲁棒的和最优的格式。它看起来更好,有更好的压缩率,它拥有其他大部分常见图片格式的所有特性。不必再等了,现在就使用它把。 +WebP 是一个健壮而优化的格式。它看起来更好,压缩率更高,并具有其他大部分常见图片格式的所有特性。不必再等了,现在就使用它吧。 -------------------------------------------------------------------------------- @@ -124,7 +125,7 @@ via: https://opensource.com/article/20/4/webp-image-compression 作者:[Jeff Macharyas][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -135,7 +136,7 @@ via: https://opensource.com/article/20/4/webp-image-compression [3]: https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html [4]: https://opensource.com/sites/default/files/uploads/webp-vs-jpg-app-graphic.png (WebP vs JPG comparison) [5]: http://gimp.org -[6]: https://opensource.com/sites/default/files/webp-gimp.webp (GIMP dialog for exporting webp, as a webp) +[6]: https://img.linux.net.cn/data/attachment/album/202005/07/143538plu797s4wmhy9b1p.jpg (GIMP dialog for exporting webp, as a webp) [7]: https://opensource.com/sites/default/files/uploads/xcompare-png-left-webp-right.png (WebP vs PNG comparison) [8]: https://imagemagick.org [9]: https://en.wikipedia.org/wiki/GIMP From 20a7f216748da621361b1eb9144ac850c208df5f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 7 May 2020 14:52:53 +0800 Subject: [PATCH 0639/1809] PRF --- ...nd JPG for your online images- Use WebP.md | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md b/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md index 0450e63f23..7cf2cdd803 100644 --- a/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md +++ b/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md @@ -99,20 +99,41 @@ Mac:`Applications/Adobe Photoshop/Plug-ins/WebPShop.plugin` 在 [Marius Hosting][11] 有下面的[说明][10]: -> “直接向 Wordpress 上传 WebP 图片会怎样?这很简单。向你的主题 `functions.php` 文件添加几行内容就可以了。Wordpress 默认不支持展示和上传 WebP 文件,但是我会向你介绍一下怎么通过几个简单的步骤来让它支持。登录进你的 Wordpress 管理员界面,进入‘外观/主题编辑器’找到 `functions.php`。复制下面的代码粘贴到该文件最后并保存: +“直接向 Wordpress 上传 WebP 图片会怎样?这很简单。向你的主题 `functions.php` 文件添加几行内容就可以了。Wordpress 默认不支持展示和上传 WebP 文件,但是我会向你介绍一下怎么通过几个简单的步骤来让它支持。登录进你的 Wordpress 管理员界面,进入‘外观/主题编辑器’找到 `functions.php`。复制下面的代码粘贴到该文件最后并保存: -> ``` -//** *Enable upload for webp image files.*/ function webp_upload_mimes($existing_mimes) { $existing_mimes['webp'] = 'image/webp'; return $existing_mimes; } add_filter('mime_types', 'webp_upload_mimes'); +``` +//** *Enable upload for webp image files.*/ +function webp_upload_mimes($existing_mimes) { + $existing_mimes['webp'] = 'image/webp'; + return $existing_mimes; +} +add_filter('mime_types', 'webp_upload_mimes'); ``` -> 如果你想在‘媒体/媒体库’时看到缩略图预览,那么你需要把下面的代码也添加到 `functions.php` 文件。为了找到 `functions.php` 文件,进入‘外观/主题编辑器’并搜索 `functions.php`,然后复制下面的代码粘贴到文件最后并保存: +如果你想在‘媒体/媒体库’时看到缩略图预览,那么你需要把下面的代码也添加到 `functions.php` 文件。为了找到 `functions.php` 文件,进入‘外观/主题编辑器’并搜索 `functions.php`,然后复制下面的代码粘贴到文件最后并保存: +``` +//** * Enable preview / thumbnail for webp image files.*/ +function webp_is_displayable($result, $path) { + if ($result === false) { + $displayable_image_types = array( IMAGETYPE_WEBP ); + $info = @getimagesize( $path ); -> ``` -//** * Enable preview / thumbnail for webp image files.*/ function webp_is_displayable($result, $path) { if ($result === false) { $displayable_image_types = array( IMAGETYPE_WEBP ); $info = @getimagesize( $path ); if (empty($info)) { $result = false; } elseif (!in_array($info[2], $displayable_image_types)) { $result = false; } else { $result = true; } } return $result; } add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2); + if (empty($info)) { + $result = false; + } elseif (!in_array($info[2], $displayable_image_types)) { + $result = false; + } else { + $result = true; + } + } + + return $result; +} +add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2); ``` -> ” +” ### WebP 和未来 From 1baf20a87c0e4d7c0534a572361511c4280ef2bd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 7 May 2020 14:55:16 +0800 Subject: [PATCH 0640/1809] PUB @lxbwolf https://linux.cn/article-12193-1.html --- ...00429 Drop PNG and JPG for your online images- Use WebP.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200429 Drop PNG and JPG for your online images- Use WebP.md (99%) diff --git a/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md b/published/20200429 Drop PNG and JPG for your online images- Use WebP.md similarity index 99% rename from translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md rename to published/20200429 Drop PNG and JPG for your online images- Use WebP.md index 7cf2cdd803..7f581e778f 100644 --- a/translated/tech/20200429 Drop PNG and JPG for your online images- Use WebP.md +++ b/published/20200429 Drop PNG and JPG for your online images- Use WebP.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12193-1.html) [#]: subject: (Drop PNG and JPG for your online images: Use WebP) [#]: via: (https://opensource.com/article/20/4/webp-image-compression) [#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas) From a537b46c0f00cdc990c4ebb716e1511d4060ae09 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 8 May 2020 00:57:13 +0800 Subject: [PATCH 0641/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200508=20Good?= =?UTF-8?q?=20News!=20You=20Can=20Now=20Buy=20the=20De-Googled=20/e/OS=20S?= =?UTF-8?q?martphone=20from=20Fairphone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200508 Good News- You Can Now Buy the De-Googled -e-OS Smartphone from Fairphone.md --- ...Googled -e-OS Smartphone from Fairphone.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20200508 Good News- You Can Now Buy the De-Googled -e-OS Smartphone from Fairphone.md diff --git a/sources/tech/20200508 Good News- You Can Now Buy the De-Googled -e-OS Smartphone from Fairphone.md b/sources/tech/20200508 Good News- You Can Now Buy the De-Googled -e-OS Smartphone from Fairphone.md new file mode 100644 index 0000000000..19d0bb67c2 --- /dev/null +++ b/sources/tech/20200508 Good News- You Can Now Buy the De-Googled -e-OS Smartphone from Fairphone.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Good News! You Can Now Buy the De-Googled /e/OS Smartphone from Fairphone) +[#]: via: (https://itsfoss.com/fairphone-with-e-os/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Good News! You Can Now Buy the De-Googled /e/OS Smartphone from Fairphone +====== + +Fairphone is known for its ethical (or fair) approach of making a smartphone. + +Normally, the ethical approach involves that the workers get paid well, the smartphone build materials are safer for the planet, and the phone is durable/sustainable. And, they’ve already done a good job with their [Fairphone 1][1] , [Fairphone 2][2], and [Fairphone 3][3] smartphones. + +Now, to take things up a notch, Fairphone has teamed up with [/e/OS][4] which is a de-googled Android fork, to launch a separate edition of [Fairphone 3][3] (its latest smartphone) that comes with **/e/OS** out of the box. + +In case you didn’t know about the mobile operating system, you can read our [interview with Gael Duval (Founder of /e/OS)][5] to know more about it. + +While we already have some privacy-focused smartphones like [Librem 5][6], Fairphone 3 with /e/OS is something different to its core. In this article, I’ll try highlighting the key things that you need to know before ordering a Fairphone 3 with /e/OS loaded. + +### The First Privacy Conscious & Sustainable Phone + +You may have noticed a privacy-focused smartphone manufactured in some corner of the world, like [Librem 5][7]. + +But for the most part, it looks like the Fairphone 3 is the first privacy-conscious sustainable phone to get the spotlight. + +![][8] + +The de-googled operating system /e/OS ensures that the smartphone does not rely on Google services to function among other things. Hence, /e/OS should be a great choice for Fairphone 3 for privacy-focused users. + +Also, to support /e/OS out of the box wasn’t just the decision of the manufacturer – but its community. + +As per their announcement, they’ve mentioned: + +> For many, fairer technology isn’t just about the device and its components, it is also about the software that powers the product; and when Fairphone community members were asked what their preferred alternative operating system (OS) was for the next Fairphone, the Fairphone 3, they voted for /e/OS. + +So, it looks like the users do prefer to have /e/OS on their smartphones. + +### Fairphone 3: Overview + +![][9] + +To tell you what I think about it, let me first share the technical specifications of the phone: + + * Dual Nano-SIM (4G LTE/3G/2G support) + * **Display:** 5.65-inch LCD (IPS) with Corning Gorilla Glass 5 protection + * **Screen Resolution**: 2160 x 1080 + * **RAM:** 4 GB + * **Chipset**: Qualcomm Snapdragon 632 + * **Internal Storage:** 64 GB + * **Rear Camera:** 12 MP (IMX363 sensor) + * **Front Camera:** 8 MP + * Bluetooth 5.0 + * WiFi 802.11a/b/g/n/ac + * NFC Supported + * USB-C + * Expandable Storage supported + + + +So, on paper, it sounds like a decent budget smartphone. But, the pricing and availability will be an important factor keeping in mind that it’s a one-of-a-kind smartphone and we don’t really have alternatives to compare to. + +Not just how it’s unique for privacy-focused users, but it is potentially the easiest phone to fix (as suggested by [iFixit’s teardown][10]). + +### Fairphone 3 with /e/OS: Pre-Order, Price & Availability + +![][11] + +As for its availability – the Fairphone 3 with /e/OS is available to pre-order through the [online shop of /e/OS][12] for **€479.90** across Europe.  + +If you are an existing Fairphone 3 user, you can also install /e/OS from the [available build here][13]. + +You get 2 years of warranty along with a 14-day return policy. + +[Pre-Order Fairphone 3 With /e/OS][12] + +### My Thoughts On Fairphone 3 with /e/OS + +It’s important to consider that the smartphone is targeting a particular group of consumers. So, it’s quite obvious that it isn’t meant for everyone. The specifications on paper may look good – but not necessarily the best bang for the buck. + +Also, looking at the smartphone market right now – the specifications and its value for money matter more than what we privacy-focused users want. + +But it’s definitely something impressive and I believe it’s going to get good attention specially among the privacy-aware people who don’t want their smartphone spying on them. + +With Fairphone 3’s launch with /e/OS, the lesser tech savvy people can now get an out of the box privacy-focused smartphone experience. + +What do you think about the Fairphone 3 with /e/OS? Let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fairphone-with-e-os/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Fairphone_1 +[2]: https://en.wikipedia.org/wiki/Fairphone_2 +[3]: https://shop.fairphone.com/en/?ref=header +[4]: https://e.foundation/ +[5]: https://itsfoss.com/gael-duval-interview/ +[6]: https://itsfoss.com/librem-5-available/ +[7]: https://itsfoss.com/librem-linux-phone/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/Fairphone-3-battery.png?ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/fairphone-3.png?ssl=1 +[10]: https://www.ifixit.com/Teardown/Fairphone+3+Teardown/125573 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/fairphone-e-os.png?ssl=1 +[12]: https://e.foundation/product/e-os-fairphone-3/ +[13]: https://doc.e.foundation/devices/FP3/ From e7bb7616b6e076d6699bc1c91f6c0ebaf4995699 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 8 May 2020 00:57:46 +0800 Subject: [PATCH 0642/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200508=20Fixi?= =?UTF-8?q?ng=20=E2=80=9CUnable=20to=20parse=20package=20file=20/var/lib/a?= =?UTF-8?q?pt/lists=E2=80=9D=20Error=20in=20Ubuntu=20and=20Other=20Linux?= =?UTF-8?q?=20Distributions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md --- ...in Ubuntu and Other Linux Distributions.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md b/sources/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..6ef4f2b55a --- /dev/null +++ b/sources/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fixing “Unable to parse package file /var/lib/apt/lists” Error in Ubuntu and Other Linux Distributions) +[#]: via: (https://itsfoss.com/unable-to-parse-package-file/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Fixing “Unable to parse package file /var/lib/apt/lists” Error in Ubuntu and Other Linux Distributions +====== + +I have discussed a number of [Ubuntu update errors][1] in the past. If you [use the command line to update Ubuntu][2], you might run into some ‘errors’. + +Some of these ‘errors’ are basically built-in features to prevent unwarranted changes to your system. I am not going into those details in this quick tutorial. + +In this quick tip, I’ll show you how to tackle the following error that you could encounter while updating your system or installing new software: + +**Reading package lists… Error! +E: Unable to parse package file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease +E: The package lists or status file could not be parsed or opened.** + +A similar error can be encountered in Debian: + +**E: Unable to parse package file /var/lib/apt/extended_states (1)** + +There is absolutely no need to panic even thought it says ‘**The package cache file is corrupted**‘. This is really easy to ‘fix’. + +### Handling “Unable to parse package file” error in Ubuntu and Debian-based Linux distributions + +![][3] + +Here’s what you need to do. Take a closer look at the name and path of the file the [Ubuntu][4] is complaining about. + +Reading package lists… Error! +**E: Unable to parse package file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease** +E: The package lists or status file could not be parsed or opened. + +For example, in the above error, it was complaining about /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease + +This gives you the idea that something is not right with this file. Now all you need to do is to remove this file and regenerate the cache. + +``` +sudo rm +``` + +So in my case, I could use this command: **sudo rm /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease** and then rebuild the cache with sudo apt update command. + +#### Step by step for beginners + +If you are familiar with Linux commands, you may know how to do delete the file with its absolute path. For novice users, let me guide you to safely delete the file. + +First, you should go to the directory where the file is stored: + +``` +cd /var/lib/apt/lists/ +``` + +Now delete the file which is not being parsed: + +``` +sudo rm archive.ubuntu.com_ubuntu_dists_bionic_InRelease +``` + +Now if you run the update again, the apt cache will be regenerated. + +``` +sudo apt update +``` + +#### Too many files cannot be parsed? + +This is fine if you have one or two files that are not being parsed while updating the system. But if the system complains about ten or twenty such files, removing them one by one is too tiring. + +What you can do in such a case to remove the entire cache and then generate it again: + +``` +sudo rm -r /var/lib/apt/lists/* +sudo apt update +``` + +#### Explanation of how it fixed your problem + +The /var/lib/apt is the directory where files and data related to the apt package manager are stored. The /var/lib/apt/lists is the directory which is used for storing information for each package resource specified in your system’s sources.list. + +In slightly non complicated terms, this /var/lib/apt/lists stores the package information cache. When you want to install or update a program, your system checks in this directory for the information on the said package. If it finds the detail on the package, then it goes to remote repository and actually download the program or its update. + +When you run the “sudo apt update”, it builds the cache. This is why even when you remove everything in the /var/lib/apt/lists directory, running the update will build a fresh cache. + +This is how it handles the issue of file not being parsed. Your system complained about a particular package or repository information that somehow got corrupted (either a failed download or manual change to sources.list). Removing that file (or everything) and rebuilding the cache solves the issue. + +#### Still facing error? + +This should fix the issue for you. But if the problem still persists or if you have some other related issue, let me know in the comment section and I’ll try to help you out. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/unable-to-parse-package-file/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-update-error/ +[2]: https://itsfoss.com/update-ubuntu/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/Unable-to-parse-package-file.png?ssl=1 +[4]: https://ubuntu.com/ From 52b62af73c729813313bbf83fce220728aaeb9ad Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 8 May 2020 01:02:30 +0800 Subject: [PATCH 0643/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200507=20Usin?= =?UTF-8?q?g=20the=20systemctl=20command=20to=20manage=20systemd=20units?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200507 Using the systemctl command to manage systemd units.md --- ...stemctl command to manage systemd units.md | 618 ++++++++++++++++++ 1 file changed, 618 insertions(+) create mode 100644 sources/tech/20200507 Using the systemctl command to manage systemd units.md diff --git a/sources/tech/20200507 Using the systemctl command to manage systemd units.md b/sources/tech/20200507 Using the systemctl command to manage systemd units.md new file mode 100644 index 0000000000..e305cee36c --- /dev/null +++ b/sources/tech/20200507 Using the systemctl command to manage systemd units.md @@ -0,0 +1,618 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using the systemctl command to manage systemd units) +[#]: via: (https://opensource.com/article/20/5/systemd-units) +[#]: author: (David Both https://opensource.com/users/dboth) + +Using the systemctl command to manage systemd units +====== +Units are the basis of everything in systemd. +![woman on laptop sitting at the window][1] + +In the first two articles in this series, I explored the Linux systemd startup sequence. In the [first article][2], I looked at systemd's functions and architecture and the controversy around its role as a replacement for the old SystemV init program and startup scripts. And in the [second article][3], I examined two important systemd tools, systemctl and journalctl, and explained how to switch from one target to another and to change the default target. + +In this third article, I'll look at systemd units in more detail and how to use the systemctl command to explore and manage units. I'll also explain how to stop and disable units and how to create a new systemd mount unit to mount a new filesystem and enable it to initiate during startup. + +### Preparation + +All of the experiments in this article should be done as the root user (unless otherwise specified). Some of the commands that simply list various systemd units can be performed by non-root users, but the commands that make changes cannot. Make sure to do all of these experiments only on non-production hosts or virtual machines (VMs). + +One of these experiments requires the sysstat package, so install it before you move on. For Fedora and other Red Hat-based distributions you can install sysstat with: + + +``` +`dnf -y install sysstat` +``` + +The sysstat RPM installs several statistical tools that can be used for problem determination. One is [System Activity Report][4] (SAR), which records many system performance data points at regular intervals (every 10 minutes by default). Rather than run as a daemon in the background, the sysstat package installs two systemd timers. One timer runs every 10 minutes to collect data, and the other runs once a day to aggregate the daily data. In this article, I will look briefly at these timers but wait to explain how to create a timer in a future article. + +### systemd suite + +The fact is, systemd is more than just one program. It is a large suite of programs all designed to work together to manage nearly every aspect of a running Linux system. A full exposition of systemd would take a book on its own. Most of us do not need to understand all of the details about how all of systemd's components fit together, so I will focus on the programs and components that enable you to manage various Linux services and deal with log files and journals. + +### Practical structure + +The structure of systemd—outside of its executable files—is contained in its many configuration files. Although these files have different names and identifier extensions, they are all called "unit" files. Units are the basis of everything systemd. + +Unit files are ASCII plain-text files that are accessible to and can be created or modified by a sysadmin. There are a number of unit file types, and each has its own man page. Figure 1 lists some of these unit file types by their filename extensions and a short description of each. + +systemd unit | Description +---|--- +.automount | The **.automount** units are used to implement on-demand (i.e., plug and play) and mounting of filesystem units in parallel during startup. +.device | The **.device** unit files define hardware and virtual devices that are exposed to the sysadmin in the **/dev/directory**. Not all devices have unit files; typically, block devices such as hard drives, network devices, and some others have unit files. +.mount | The **.mount** unit defines a mount point on the Linux filesystem directory structure. +.scope | The **.scope** unit defines and manages a set of system processes. This unit is not configured using unit files, rather it is created programmatically. Per the **systemd.scope** man page, “The main purpose of scope units is grouping worker processes of a system service for organization and for managing resources.” +.service | The **.service** unit files define processes that are managed by systemd. These include services such as crond cups (Common Unix Printing System), iptables, multiple logical volume management (LVM) services, NetworkManager, and more. +.slice | The **.slice** unit defines a “slice,” which is a conceptual division of system resources that are related to a group of processes. You can think of all system resources as a pie and this subset of resources as a “slice” out of that pie. +.socket | The **.socket** units define interprocess communication sockets, such as network sockets. +.swap | The **.swap** units define swap devices or files. +.target | The **.target** units define groups of unit files that define startup synchronization points, runlevels, and services. Target units define the services and other units that must be active in order to start successfully. +.timer | The **.timer** unit defines timers that can initiate program execution at specified times. + +### systemctl + +I looked at systemd's startup functions in the [second article][3], and here I'll explore its service management functions a bit further. systemd provides the **systemctl** command that is used to start and stop services, configure them to launch (or not) at system startup, and monitor the current status of running services. + +In a terminal session as the root user, ensure that root's home directory ( **~** ) is the [PWD][5]. To begin looking at units in various ways, list all of the loaded and active systemd units. systemctl automatically pipes its [stdout][6] data stream through the **less** pager, so you don't have to: + + +``` +[root@testvm1 ~]# systemctl +UNIT                                       LOAD   ACTIVE SUB       DESCRIPTION               +proc-sys-fs-binfmt_misc.automount          loaded active running   Arbitrary Executable File> +sys-devices-pci0000:00-0000:00:01.1-ata7-host6-target6:0:0-6:0:0:0-block-sr0.device loaded a> +sys-devices-pci0000:00-0000:00:03.0-net-enp0s3.device loaded active plugged   82540EM Gigabi> +sys-devices-pci0000:00-0000:00:05.0-sound-card0.device loaded active plugged   82801AA AC'97> +sys-devices-pci0000:00-0000:00:08.0-net-enp0s8.device loaded active plugged   82540EM Gigabi> +sys-devices-pci0000:00-0000:00:0d.0-ata1-host0-target0:0:0-0:0:0:0-block-sda-sda1.device loa> +sys-devices-pci0000:00-0000:00:0d.0-ata1-host0-target0:0:0-0:0:0:0-block-sda-sda2.device loa> +<snip – removed lots of lines of data from here> + +LOAD   = Reflects whether the unit definition was properly loaded. +ACTIVE = The high-level unit activation state, i.e. generalization of SUB. +SUB    = The low-level unit activation state, values depend on unit type. + +206 loaded units listed. Pass --all to see loaded but inactive units, too. +To show all installed unit files use 'systemctl list-unit-files'. +``` + +As you scroll through the data in your terminal session, look for some specific things. The first section lists devices such as hard drives, sound cards, network interface cards, and TTY devices. Another section shows the filesystem mount points. Other sections include various services and a list of all loaded and active targets. + +The sysstat timers at the bottom of the output are used to collect and generate daily system activity summaries for SAR. SAR is a very useful problem-solving tool. (You can learn more about it in Chapter 13 of my book [_Using and Administering Linux: Volume 1, Zero to SysAdmin: Getting Started_][7].) + +Near the very bottom, three lines describe the meanings of the statuses (loaded, active, and sub). Press **q** to exit the pager. + +Use the following command (as suggested in the last line of the output above) to see all the units that are installed, whether or not they are loaded. I won't reproduce the output here, because you can scroll through it on your own. The systemctl program has an excellent tab-completion facility that makes it easy to enter complex commands without needing to memorize all the options: + + +``` +`[root@testvm1 ~]# systemctl list-unit-files` +``` + +You can see that some units are disabled. Table 1 in the man page for systemctl lists and provides short descriptions of the entries you might see in this listing. Use the **-t** (type) option to view just the timer units: + + +``` +[root@testvm1 ~]# systemctl list-unit-files -t timer +UNIT FILE                    STATE   +[chrony-dnssrv@.timer][8]         disabled +dnf-makecache.timer          enabled +fstrim.timer                 disabled +logrotate.timer              disabled +logwatch.timer               disabled +[mdadm-last-resort@.timer][9]     static   +mlocate-updatedb.timer       enabled +sysstat-collect.timer        enabled +sysstat-summary.timer        enabled +systemd-tmpfiles-clean.timer static   +unbound-anchor.timer         enabled +``` + +You could do the same thing with this alternative, which provides considerably more detail: + + +``` +[root@testvm1 ~]# systemctl list-timers +Thu 2020-04-16 09:06:20 EDT  3min 59s left n/a                          n/a           systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service +Thu 2020-04-16 10:02:01 EDT  59min left    Thu 2020-04-16 09:01:32 EDT  49s ago       dnf-makecache.timer          dnf-makecache.service +Thu 2020-04-16 13:00:00 EDT  3h 57min left n/a                          n/a           sysstat-collect.timer        sysstat-collect.service +Fri 2020-04-17 00:00:00 EDT  14h left      Thu 2020-04-16 12:51:37 EDT  3h 49min left mlocate-updatedb.timer       mlocate-updatedb.service +Fri 2020-04-17 00:00:00 EDT  14h left      Thu 2020-04-16 12:51:37 EDT  3h 49min left unbound-anchor.timer         unbound-anchor.service +Fri 2020-04-17 00:07:00 EDT  15h left      n/a                          n/a           sysstat-summary.timer        sysstat-summary.service + +6 timers listed. +Pass --all to see loaded but inactive timers, too. +[root@testvm1 ~]# +``` + +Although there is no option to do systemctl list-mounts, you can list the mount point unit files: + + +``` +[root@testvm1 ~]# systemctl list-unit-files -t mount +UNIT FILE                     STATE     +-.mount                       generated +boot.mount                    generated +dev-hugepages.mount           static   +dev-mqueue.mount              static   +home.mount                    generated +proc-fs-nfsd.mount            static   +proc-sys-fs-binfmt_misc.mount disabled +run-vmblock\x2dfuse.mount     disabled +sys-fs-fuse-connections.mount static   +sys-kernel-config.mount       static   +sys-kernel-debug.mount        static   +tmp.mount                     generated +usr.mount                     generated +var-lib-nfs-rpc_pipefs.mount  static   +var.mount                     generated + +15 unit files listed. +[root@testvm1 ~]# +``` + +The STATE column in this data stream is interesting and requires a bit of explanation. The "generated" states indicate that the mount unit was generated on the fly during startup using the information in **/etc/fstab**. The program that generates these mount units is **/lib/systemd/system-generators/systemd-fstab-generator,** along with other tools that generate a number of other unit types. The "static" mount units are for filesystems like **/proc** and **/sys**, and the files for these are located in the **/usr/lib/systemd/system** directory. + +Now, look at the service units. This command will show all services installed on the host, whether or not they are active: + + +``` +`[root@testvm1 ~]# systemctl --all -t service` +``` + +The bottom of this listing of service units displays 166 as the total number of loaded units on my host. Your number will probably differ. + +Unit files do not have a filename extension (such as **.unit**) to help identify them, so you can generalize that most configuration files that belong to systemd are unit files of one type or another. The few remaining files are mostly **.conf** files located in **/etc/systemd**. + +Unit files are stored in the **/usr/lib/systemd** directory and its subdirectories, while the **/etc/systemd/** directory and its subdirectories contain symbolic links to the unit files necessary to the local configuration of this host. + +To explore this, make **/etc/systemd** the PWD and list its contents. Then make **/etc/systemd/system** the PWD and list its contents, and list the contents of at least a couple of the current PWD's subdirectories. + +Take a look at the **default.target** file, which determines which runlevel target the system will boot to. In the second article in this series, I explained how to change the default target from the GUI (**graphical.target**) to the command-line only (**multi-user.target**) target. The **default.target** file on my test VM is simply a symlink to **/usr/lib/systemd/system/graphical.target**. + +Take a few minutes to examine the contents of the **/etc/systemd/system/default.target** file: + + +``` +[root@testvm1 system]# cat default.target +#  SPDX-License-Identifier: LGPL-2.1+ +# +#  This file is part of systemd. +# +#  systemd is free software; you can redistribute it and/or modify it +#  under the terms of the GNU Lesser General Public License as published by +#  the Free Software Foundation; either version 2.1 of the License, or +#  (at your option) any later version. + +[Unit] +Description=Graphical Interface +Documentation=man:systemd.special(7) +Requires=multi-user.target +Wants=display-manager.service +Conflicts=rescue.service rescue.target +After=multi-user.target rescue.service rescue.target display-manager.service +AllowIsolate=yes +``` + +Note that this requires the **multi-user.target**; the **graphical.target** cannot start if the **multi-user.target** is not already up and running. It also says it "wants" the **display-manager.service** unit. A "want" does not need to be fulfilled in order for the unit to start successfully. If the "want" cannot be fulfilled, it will be ignored by systemd, and the rest of the target will start regardless. + +The subdirectories in **/etc/systemd/system** are lists of wants for various targets. Take a few minutes to explore the files and their contents in the **/etc/systemd/system/graphical.target.wants** directory. + +The **systemd.unit** man page contains a lot of good information about unit files, their structure, the sections they can be divided into, and the options that can be used. It also lists many of the unit types, all of which have their own man pages. If you want to interpret a unit file, this would be a good place to start. + +### Service units + +A Fedora installation usually installs and enables services that particular hosts do not need for normal operation. Conversely, sometimes it doesn't include services that need to be installed, enabled, and started. Services that are not needed for the Linux host to function as desired, but which are installed and possibly running, represent a security risk and should—at minimum—be stopped and disabled and—at best—should be uninstalled. + +The systemctl command is used to manage systemd units, including services, targets, mounts, and more. Take a closer look at the list of services to identify services that will never be used: + + +``` +[root@testvm1 ~]# systemctl --all -t service +UNIT                           LOAD      ACTIVE SUB        DESCRIPTION                             +<snip> +chronyd.service                loaded    active running    NTP client/server                       +crond.service                  loaded    active running    Command Scheduler                       +cups.service                   loaded    active running    CUPS Scheduler                           +dbus-daemon.service            loaded    active running    D-Bus System Message Bus                 +<snip> +● ip6tables.service           not-found inactive dead     ip6tables.service                   +● ipset.service               not-found inactive dead     ipset.service                       +● iptables.service            not-found inactive dead     iptables.service                     +<snip> +firewalld.service              loaded    active   running  firewalld - dynamic firewall daemon +<snip> +● ntpd.service                not-found inactive dead     ntpd.service                         +● ntpdate.service             not-found inactive dead     ntpdate.service                     +pcscd.service                  loaded    active   running  PC/SC Smart Card Daemon +``` + +I have pruned out most of the output from the command to save space. The services that show "loaded active running" are obvious. The "not-found" services are ones that systemd is aware of but are not installed on the Linux host. If you want to run those services, you must install the packages that contain them. + +Note the **pcscd.service** unit. This is the PC/SC smart-card daemon. Its function is to communicate with smart-card readers. Many Linux hosts—including VMs—have no need for this reader nor the service that is loaded and taking up memory and CPU resources. You can stop this service and disable it, so it will not restart on the next boot. First, check its status: + + +``` +[root@testvm1 ~]# systemctl status pcscd.service +● pcscd.service - PC/SC Smart Card Daemon +   Loaded: loaded (/usr/lib/systemd/system/pcscd.service; indirect; vendor preset: disabled) +   Active: active (running) since Fri 2019-05-10 11:28:42 EDT; 3 days ago +     Docs: man:pcscd(8) + Main PID: 24706 (pcscd) +    Tasks: 6 (limit: 4694) +   Memory: 1.6M +   CGroup: /system.slice/pcscd.service +           └─24706 /usr/sbin/pcscd --foreground --auto-exit + +May 10 11:28:42 testvm1 systemd[1]: Started PC/SC Smart Card Daemon. +``` + +This data illustrates the additional information systemd provides versus SystemV, which only reports whether or not the service is running. Note that specifying the **.service** unit type is optional. Now stop and disable the service, then re-check its status: + + +``` +[root@testvm1 ~]# systemctl stop pcscd ; systemctl disable pcscd +Warning: Stopping pcscd.service, but it can still be activated by: +  pcscd.socket +Removed /etc/systemd/system/sockets.target.wants/pcscd.socket. +[root@testvm1 ~]# systemctl status pcscd +● pcscd.service - PC/SC Smart Card Daemon +   Loaded: loaded (/usr/lib/systemd/system/pcscd.service; indirect; vendor preset: disabled) +   Active: failed (Result: exit-code) since Mon 2019-05-13 15:23:15 EDT; 48s ago +     Docs: man:pcscd(8) + Main PID: 24706 (code=exited, status=1/FAILURE) + +May 10 11:28:42 testvm1 systemd[1]: Started PC/SC Smart Card Daemon. +May 13 15:23:15 testvm1 systemd[1]: Stopping PC/SC Smart Card Daemon... +May 13 15:23:15 testvm1 systemd[1]: pcscd.service: Main process exited, code=exited, status=1/FAIL> +May 13 15:23:15 testvm1 systemd[1]: pcscd.service: Failed with result 'exit-code'. +May 13 15:23:15 testvm1 systemd[1]: Stopped PC/SC Smart Card Daemon. +``` + +The short log entry display for most services prevents having to search through various log files to locate this type of information. Check the status of the system runlevel targets—specifying the "target" unit type is required: + + +``` +[root@testvm1 ~]# systemctl status multi-user.target +● multi-user.target - Multi-User System +   Loaded: loaded (/usr/lib/systemd/system/multi-user.target; static; vendor preset: disabled) +   Active: active since Thu 2019-05-09 13:27:22 EDT; 4 days ago +     Docs: man:systemd.special(7) + +May 09 13:27:22 testvm1 systemd[1]: Reached target Multi-User System. +[root@testvm1 ~]# systemctl status graphical.target +● graphical.target - Graphical Interface +   Loaded: loaded (/usr/lib/systemd/system/graphical.target; indirect; vendor preset: disabled) +   Active: active since Thu 2019-05-09 13:27:22 EDT; 4 days ago +     Docs: man:systemd.special(7) + +May 09 13:27:22 testvm1 systemd[1]: Reached target Graphical Interface. +[root@testvm1 ~]# systemctl status default.target +● graphical.target - Graphical Interface +   Loaded: loaded (/usr/lib/systemd/system/graphical.target; indirect; vendor preset: disabled) +   Active: active since Thu 2019-05-09 13:27:22 EDT; 4 days ago +     Docs: man:systemd.special(7) + +May 09 13:27:22 testvm1 systemd[1]: Reached target Graphical Interface. +``` + +The default target is the graphical target. The status of any unit can be checked in this way. + +### Mounts the old way + +A mount unit defines all of the parameters required to mount a filesystem on a designated mount point. systemd can manage mount units with more flexibility than those using the **/etc/fstab** filesystem configuration file. Despite this, systemd still uses the **/etc/fstab** file for filesystem configuration and mounting purposes. systemd uses the **systemd-fstab-generator** tool to create transient mount units from the data in the **fstab** file. + +I will create a new filesystem and a systemd mount unit to mount it. If you have some available disk space on your test system, you can do it along with me. + +_Note that the volume group and logical volume names may be different on your test system. Be sure to use the names that are pertinent to your system._ + +You will need to create a partition or logical volume, then make an EXT4 filesystem on it. Add a label to the filesystem, **TestFS**, and create a directory for a mount point **/TestFS**. + +To try this on your own, first, verify that you have free space on the volume group. Here is what that looks like on my VM where I have some space available on the volume group to create a new logical volume: + + +``` +[root@testvm1 ~]# lsblk +NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT +sda             8:0    0  120G  0 disk +├─sda1          8:1    0    4G  0 part /boot +└─sda2          8:2    0  116G  0 part +  ├─VG01-root 253:0    0    5G  0 lvm  / +  ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] +  ├─VG01-usr  253:2    0   30G  0 lvm  /usr +  ├─VG01-home 253:3    0   20G  0 lvm  /home +  ├─VG01-var  253:4    0   20G  0 lvm  /var +  └─VG01-tmp  253:5    0   10G  0 lvm  /tmp +sr0            11:0    1 1024M  0 rom   +[root@testvm1 ~]# vgs +  VG   #PV #LV #SN Attr   VSize    VFree   +  VG01   1   6   0 wz--n- <116.00g <23.00g +``` + +Then create a new volume on **VG01** named **TestFS**. It does not need to be large; 1GB is fine. Then create a filesystem, add the filesystem label, and create the mount point: + + +``` +[root@testvm1 ~]# lvcreate -L 1G -n TestFS VG01 +  Logical volume "TestFS" created. +[root@testvm1 ~]# mkfs -t ext4 /dev/mapper/VG01-TestFS +mke2fs 1.45.3 (14-Jul-2019) +Creating filesystem with 262144 4k blocks and 65536 inodes +Filesystem UUID: 8718fba9-419f-4915-ab2d-8edf811b5d23 +Superblock backups stored on blocks: +        32768, 98304, 163840, 229376 + +Allocating group tables: done                             +Writing inode tables: done                             +Creating journal (8192 blocks): done +Writing superblocks and filesystem accounting information: done + +[root@testvm1 ~]# e2label /dev/mapper/VG01-TestFS TestFS +[root@testvm1 ~]# mkdir /TestFS +``` + +Now, mount the new filesystem: + + +``` +[root@testvm1 ~]# mount /TestFS/ +mount: /TestFS/: can't find in /etc/fstab. +``` + +This will not work because you do not have an entry in **/etc/fstab**. You can mount the new filesystem even without the entry in **/etc/fstab** using both the device name (as it appears in **/dev**) and the mount point. Mounting in this manner is simpler than it used to be—it used to require the filesystem type as an argument. The mount command is now smart enough to detect the filesystem type and mount it accordingly. + +Try it again: + + +``` +[root@testvm1 ~]# mount /dev/mapper/VG01-TestFS /TestFS/ +[root@testvm1 ~]# lsblk +NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT +sda               8:0    0  120G  0 disk +├─sda1            8:1    0    4G  0 part /boot +└─sda2            8:2    0  116G  0 part +  ├─VG01-root   253:0    0    5G  0 lvm  / +  ├─VG01-swap   253:1    0    8G  0 lvm  [SWAP] +  ├─VG01-usr    253:2    0   30G  0 lvm  /usr +  ├─VG01-home   253:3    0   20G  0 lvm  /home +  ├─VG01-var    253:4    0   20G  0 lvm  /var +  ├─VG01-tmp    253:5    0   10G  0 lvm  /tmp +  └─VG01-TestFS 253:6    0    1G  0 lvm  /TestFS +sr0              11:0    1 1024M  0 rom   +[root@testvm1 ~]# +``` + +Now the new filesystem is mounted in the proper location. List the mount unit files: + + +``` +`[root@testvm1 ~]# systemctl list-unit-files -t mount` +``` + +This command does not show a file for the **/TestFS** filesystem because no file exists for it. The command **systemctl status TestFS.mount** does not display any information about the new filesystem either. You can try it using wildcards with the **systemctl status** command: + + +``` +[root@testvm1 ~]# systemctl status *mount +● usr.mount - /usr +   Loaded: loaded (/etc/fstab; generated) +   Active: active (mounted) +    Where: /usr +     What: /dev/mapper/VG01-usr +     Docs: man:fstab(5) +           man:systemd-fstab-generator(8) + +<SNIP> +● TestFS.mount - /TestFS +   Loaded: loaded (/proc/self/mountinfo) +   Active: active (mounted) since Fri 2020-04-17 16:02:26 EDT; 1min 18s ago +    Where: /TestFS +     What: /dev/mapper/VG01-TestFS + +● run-user-0.mount - /run/user/0 +   Loaded: loaded (/proc/self/mountinfo) +   Active: active (mounted) since Thu 2020-04-16 08:52:29 EDT; 1 day 5h ago +    Where: /run/user/0 +     What: tmpfs + +● var.mount - /var +   Loaded: loaded (/etc/fstab; generated) +   Active: active (mounted) since Thu 2020-04-16 12:51:34 EDT; 1 day 1h ago +    Where: /var +     What: /dev/mapper/VG01-var +     Docs: man:fstab(5) +           man:systemd-fstab-generator(8) +    Tasks: 0 (limit: 19166) +   Memory: 212.0K +      CPU: 5ms +   CGroup: /system.slice/var.mount +``` + +This command provides some very interesting information about your system's mounts, and your new filesystem shows up. The **/var** and **/usr** filesystems are identified as being generated from **/etc/fstab**, while your new filesystem simply shows that it is loaded and provides the location of the info file in the **/proc/self/mountinfo** file. + +Next, automate this mount. First, do it the old-fashioned way by adding an entry in **/etc/fstab**. Later, I'll show you how to do it the new way, which will teach you about creating units and integrating them into the startup sequence. + +Unmount **/TestFS** and add the following line to the **/etc/fstab** file: + + +``` +`/dev/mapper/VG01-TestFS  /TestFS       ext4    defaults        1 2` +``` + +Now, mount the filesystem with the simpler **mount** command and list the mount units again: + + +``` +[root@testvm1 ~]# mount /TestFS +[root@testvm1 ~]# systemctl status *mount +<SNIP> +● TestFS.mount - /TestFS +   Loaded: loaded (/proc/self/mountinfo) +   Active: active (mounted) since Fri 2020-04-17 16:26:44 EDT; 1min 14s ago +    Where: /TestFS +     What: /dev/mapper/VG01-TestFS +<SNIP> +``` + +This did not change the information for this mount because the filesystem was manually mounted. Reboot and run the command again, and this time specify **TestFS.mount** rather than using the wildcard. The results for this mount are now consistent with it being mounted at startup: + + +``` +[root@testvm1 ~]# systemctl status TestFS.mount +● TestFS.mount - /TestFS +   Loaded: loaded (/etc/fstab; generated) +   Active: active (mounted) since Fri 2020-04-17 16:30:21 EDT; 1min 38s ago +    Where: /TestFS +     What: /dev/mapper/VG01-TestFS +     Docs: man:fstab(5) +           man:systemd-fstab-generator(8) +    Tasks: 0 (limit: 19166) +   Memory: 72.0K +      CPU: 6ms +   CGroup: /system.slice/TestFS.mount + +Apr 17 16:30:21 testvm1 systemd[1]: Mounting /TestFS... +Apr 17 16:30:21 testvm1 systemd[1]: Mounted /TestFS. +``` + +### Creating a mount unit + +Mount units may be configured either with the traditional **/etc/fstab** file or with systemd units. Fedora uses the **fstab** file as it is created during the installation. However, systemd uses the **systemd-fstab-generator** program to translate the **fstab** file into systemd units for each entry in the **fstab** file. Now that you know you can use systemd **.mount** unit files for filesystem mounting, try it out by creating a mount unit for this filesystem. + +First, unmount **/TestFS**. Edit the **/etc/fstab** file and delete or comment out the **TestFS** line. Now, create a new file with the name **TestFS.mount** in the **/etc/systemd/system** directory. Edit it to contain the configuration data below. The unit file name and the name of the mount point _must_ be identical, or the mount will fail: + + +``` +# This mount unit is for the TestFS filesystem +# By David Both +# Licensed under GPL V2 +# This file should be located in the /etc/systemd/system directory + +[Unit] +Description=TestFS Mount + +[Mount] +What=/dev/mapper/VG01-TestFS +Where=/TestFS +Type=ext4 +Options=defaults + +[Install] +WantedBy=multi-user.target +``` + +The **Description** line in the **[Unit]** section is for us humans, and it provides the name that's shown when you list mount units with **systemctl -t mount**. The data in the **[Mount]** section of this file contains essentially the same data that would be found in the **fstab** file. + +Now enable the mount unit: + + +``` +[root@testvm1 etc]# systemctl enable TestFS.mount +Created symlink /etc/systemd/system/multi-user.target.wants/TestFS.mount → /etc/systemd/system/TestFS.mount. +``` + +This creates the symlink in the **/etc/systemd/system** directory, which will cause this mount unit to be mounted on all subsequent boots. The filesystem has not yet been mounted, so you must "start" it: + + +``` +`[root@testvm1 ~]# systemctl start TestFS.mount` +``` + +Verify that the filesystem has been mounted: + + +``` +[root@testvm1 ~]# systemctl status TestFS.mount +● TestFS.mount - TestFS Mount +   Loaded: loaded (/etc/systemd/system/TestFS.mount; enabled; vendor preset: disabled) +   Active: active (mounted) since Sat 2020-04-18 09:59:53 EDT; 14s ago +    Where: /TestFS +     What: /dev/mapper/VG01-TestFS +    Tasks: 0 (limit: 19166) +   Memory: 76.0K +      CPU: 3ms +   CGroup: /system.slice/TestFS.mount + +Apr 18 09:59:53 testvm1 systemd[1]: Mounting TestFS Mount... +Apr 18 09:59:53 testvm1 systemd[1]: Mounted TestFS Mount. +``` + +This experiment has been specifically about creating a unit file for a mount, but it can be applied to other types of unit files as well. The details will be different, but the concepts are the same. Yes, I know it is still easier to add a line to the **/etc/fstab** file than it is to create a mount unit. But this is a good example of how to create a unit file because systemd does not have generators for every type of unit. + +### In summary + +This article looked at systemd units in more detail and how to use the systemctl command to explore and manage units. It also showed how to stop and disable units and create a new systemd mount unit to mount a new filesystem and enable it to initiate during startup. + +In the next article in this series, I will take you through a recent problem I had during startup and show you how I circumvented it using systemd. + +### Resources + +There is a great deal of information about systemd available on the internet, but much is terse, obtuse, or even misleading. In addition to the resources mentioned in this article, the following webpages offer more detailed and reliable information about systemd startup. + + * The Fedora Project has a good, practical [guide][10] [to systemd][10]. It has pretty much everything you need to know in order to configure, manage, and maintain a Fedora computer using systemd. + * The Fedora Project also has a good [cheat sheet][11] that cross-references the old SystemV commands to comparable systemd ones. + * For detailed technical information about systemd and the reasons for creating it, check out [Freedesktop.org][12]'s [description of systemd][13]. + * [Linux.com][14]'s "More systemd fun" offers more advanced systemd [information and tips][15]. + + + +There is also a series of deeply technical articles for Linux sysadmins by Lennart Poettering, the designer and primary developer of systemd. These articles were written between April 2010 and September 2011, but they are just as relevant now as they were then. Much of everything else good that has been written about systemd and its ecosystem is based on these papers. + + * [Rethinking PID 1][16] + * [systemd for Administrators, Part I][17] + * [systemd for Administrators, Part II][18] + * [systemd for Administrators, Part III][19] + * [systemd for Administrators, Part IV][20] + * [systemd for Administrators, Part V][21] + * [systemd for Administrators, Part VI][22] + * [systemd for Administrators, Part VII][23] + * [systemd for Administrators, Part VIII][24] + * [systemd for Administrators, Part IX][25] + * [systemd for Administrators, Part X][26] + * [systemd for Administrators, Part XI][27] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/systemd-units + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: https://opensource.com/article/20/4/systemd +[3]: https://opensource.com/article/20/4/systemd-startup +[4]: https://en.wikipedia.org/wiki/Sar_%28Unix%29 +[5]: https://en.wikipedia.org/wiki/Pwd +[6]: https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout) +[7]: http://www.both.org/?page_id=1183 +[8]: mailto:chrony-dnssrv@.timer +[9]: mailto:mdadm-last-resort@.timer +[10]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html +[11]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet +[12]: http://Freedesktop.org +[13]: http://www.freedesktop.org/wiki/Software/systemd +[14]: http://Linux.com +[15]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ +[16]: http://0pointer.de/blog/projects/systemd.html +[17]: http://0pointer.de/blog/projects/systemd-for-admins-1.html +[18]: http://0pointer.de/blog/projects/systemd-for-admins-2.html +[19]: http://0pointer.de/blog/projects/systemd-for-admins-3.html +[20]: http://0pointer.de/blog/projects/systemd-for-admins-4.html +[21]: http://0pointer.de/blog/projects/three-levels-of-off.html +[22]: http://0pointer.de/blog/projects/changing-roots +[23]: http://0pointer.de/blog/projects/blame-game.html +[24]: http://0pointer.de/blog/projects/the-new-configuration-files.html +[25]: http://0pointer.de/blog/projects/on-etc-sysinit.html +[26]: http://0pointer.de/blog/projects/instances.html +[27]: http://0pointer.de/blog/projects/inetd.html From 866f79c53dcdaf1cc6d114f2e333c63be2ca3e0a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 8 May 2020 01:04:05 +0800 Subject: [PATCH 0644/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200506=20Cust?= =?UTF-8?q?omizing=20my=20open=20source=20PHP=20framework=20for=20web=20de?= =?UTF-8?q?velopment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200506 Customizing my open source PHP framework for web development.md --- ...ource PHP framework for web development.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sources/tech/20200506 Customizing my open source PHP framework for web development.md b/sources/tech/20200506 Customizing my open source PHP framework for web development.md index 00b605148d..8247a6ad49 100644 --- a/sources/tech/20200506 Customizing my open source PHP framework for web development.md +++ b/sources/tech/20200506 Customizing my open source PHP framework for web development.md @@ -4,20 +4,20 @@ [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Customizing my open source PHP framework for web development) -[#]: via: (https://opensource.com/article/20/5/codeignitor) +[#]: via: (https://opensource.com/article/20/5/codeigniter) [#]: author: (Wee Ben Sen https://opensource.com/users/bswee14) Customizing my open source PHP framework for web development ====== -Codeignitor is a PHP framework that empowers companies to develop +Codeigniter is a PHP framework that empowers companies to develop high-performance websites with flexibility and ease. ![Business woman on laptop sitting in front of window][1] -PHP Codeignitor is an open source framework providing business applications with the easy-to-use PHP programming language and powerful tools for coding. It also provides business intelligence, server monitoring, development, and application integration facilities. It's a relatively quiet project that you don't hear much about, but it's got a lot going for it that many developers new to it find surprising and refreshing. +PHP Codeigniter is an open source framework providing business applications with the easy-to-use PHP programming language and powerful tools for coding. It also provides business intelligence, server monitoring, development, and application integration facilities. It's a relatively quiet project that you don't hear much about, but it's got a lot going for it that many developers new to it find surprising and refreshing. -I use [Codeignitor][2] at my job working for an online tuition service provider in Singapore. We offer services that aren't common enough to be the default feature set for templates or existing back-ends, so I need something that provides good, solid, raw materials I can build upon. Initially, I was considering other platforms such as Wordpress for our website; however, I arrived at Codeignitor due to its flexibility and integration of functions needed in the tuition-matching process. +I use [Codeigniter][2] at my job working for an online tuition service provider in Singapore. We offer services that aren't common enough to be the default feature set for templates or existing back-ends, so I need something that provides good, solid, raw materials I can build upon. Initially, I was considering other platforms such as Wordpress for our website; however, I arrived at Codeigniter due to its flexibility and integration of functions needed in the tuition-matching process. -Here are the points that sold me on Codeignitor: +Here are the points that sold me on Codeigniter: * Database integration with MySQL—A major functionality is allowing clients to browse the tutor database and add tutors like a "shopping cart" similar to an e-commerce platform. * Client interface system—Users can log in to manage preferences and edit their particulars, modify subject taught, areas traveled, mobile number, address, etc. @@ -31,16 +31,16 @@ The project took around six months to complete and another two months of debuggi ### Features and benefits -There are many more features that draw developers to PHP Codeignitor, including error handling and code formatting, which are useful in every coding situation. It supports templates, which can be used to add functionality to an existing website or to generate new ones. There are many features available for a business that needs to use a web-based system, including the ability to use custom tags. Most can be used by even an average developer who does not have any prior experience in programming. +There are many more features that draw developers to PHP Codeigniter, including error handling and code formatting, which are useful in every coding situation. It supports templates, which can be used to add functionality to an existing website or to generate new ones. There are many features available for a business that needs to use a web-based system, including the ability to use custom tags. Most can be used by even an average developer who does not have any prior experience in programming. -The key features of Codeignitor are: +The key features of Codeigniter are: * XML core services, * HTTP/FTP core services * AppData and PHP sandbox features * XSLT and HTML templates * Encrypted information transfer - * PCM Codeignitor server monitoring + * PCM Codeigniter server monitoring * Application integration * File Transfer Protocol (FTP) * Help desk support @@ -50,23 +50,23 @@ The key features of Codeignitor are: #### Compatibility -Codeignitor is compatible with many leading software applications like PHP, MySQL, [MariaDB][3], [phpMyAdmin][4], [Apache][5], OpenBSD, XSLT, [SQLite][6], and more. A number of companies prefer to use Codeignitor products for their website requirements because they are easy to work with and integrate. If you're not comfortable creating your own website, you can find many developers and design agencies that provide custom web development services. +Codeigniter is compatible with many leading software applications like PHP, MySQL, [MariaDB][3], [phpMyAdmin][4], [Apache][5], OpenBSD, XSLT, [SQLite][6], and more. A number of companies prefer to use Codeigniter products for their website requirements because they are easy to work with and integrate. If you're not comfortable creating your own website, you can find many developers and design agencies that provide custom web development services. #### Security -Codeignitor also provides data security through SSL encryption. The encryption protects the data from external threats such as intruders and firewalls. The data storage facility also allows for security audits of the company's website. +Codeigniter also provides data security through SSL encryption. The encryption protects the data from external threats such as intruders and firewalls. The data storage facility also allows for security audits of the company's website. #### Other features -A good PHP web development company uses several advanced and third-party technologies such as XML and PHP. It provides organizations with a complete platform to develop professional-looking, useful websites with a business application. Codeignitor makes it easy to use third party technology, and works with common web development software. This allows web agencies to easily create websites with their chosen modules. Most PHP developers offer support and training services for individuals, as well. +A good PHP web development company uses several advanced and third-party technologies such as XML and PHP. It provides organizations with a complete platform to develop professional-looking, useful websites with a business application. Codeigniter makes it easy to use third party technology, and works with common web development software. This allows web agencies to easily create websites with their chosen modules. Most PHP developers offer support and training services for individuals, as well. -### Using PHP framework Codeignitor +### Using PHP framework Codeigniter -Codeignitor allows businesses to have a complete package for PHP development that will offer the right combination of power, flexibility, and performance. So far, I am very pleased with our website and I have continuously upgraded and added new features along the way. I look forward to discovering what else I can do with our website using Codeignitor. Could it be right for you too? +Codeigniter allows businesses to have a complete package for PHP development that will offer the right combination of power, flexibility, and performance. So far, I am very pleased with our website and I have continuously upgraded and added new features along the way. I look forward to discovering what else I can do with our website using Codeigniter. Could it be right for you too? -------------------------------------------------------------------------------- -via: https://opensource.com/article/20/5/codeignitor +via: https://opensource.com/article/20/5/codeigniter 作者:[Wee Ben Sen][a] 选题:[lujun9972][b] From 473726103224793847e84829d310e7fcbaf8f427 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 8 May 2020 08:39:09 +0800 Subject: [PATCH 0645/1809] translating --- ...rgerfs to increase your virtual storage.md | 147 ------------------ ...rgerfs to increase your virtual storage.md | 147 ++++++++++++++++++ 2 files changed, 147 insertions(+), 147 deletions(-) delete mode 100644 sources/tech/20200501 Using mergerfs to increase your virtual storage.md create mode 100644 translated/tech/20200501 Using mergerfs to increase your virtual storage.md diff --git a/sources/tech/20200501 Using mergerfs to increase your virtual storage.md b/sources/tech/20200501 Using mergerfs to increase your virtual storage.md deleted file mode 100644 index 734af93148..0000000000 --- a/sources/tech/20200501 Using mergerfs to increase your virtual storage.md +++ /dev/null @@ -1,147 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using mergerfs to increase your virtual storage) -[#]: via: (https://fedoramagazine.org/using-mergerfs-to-increase-your-virtual-storage/) -[#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/) - -Using mergerfs to increase your virtual storage -====== - -![][1] - -What happens if you have multiple disks or partitions that you’d like to use for a media project and you don’t want to lose any of your existing data, but you’d like to have everything located or mounted under one drive. That’s where mergerfs can come to your rescue! - -[mergerfs][2] is a union filesystem geared towards simplifying storage and management of files across numerous commodity storage devices. - -You will need to grab the latest RPM from their github page [here][3]. The releases for Fedora have _**fc**_ and the version number in the name. For example here is the version for Fedora 31: - -[mergerfs-2.29.0-1.fc31.x86_64.rpm][4] - -### Installing and configuring mergerfs - -Install the mergerfs package that you’ve downloaded using sudo: - -``` -$ sudo dnf install mergerfs-2.29.0-1.fc31.x86_64.rpm -``` - -You will now be able to mount multiple disks as one drive. This comes in handy if you have a media server and you’d like all of your media files to show up under one location. If you upload new files to your system, you can copy them to your mergerfs directory and mergerfs will automatically copy them to which ever drive has enough free space available. - -Here is an example to make it easier to understand: - -``` -$ df -hT | grep disk -/dev/sdb1 ext4 23M 386K 21M 2% /disk1 -/dev/sdc1 ext4 44M 1.1M 40M 3% /disk2 - -$ ls -l /disk1/Videos/ -total 1 --rw-r--r--. 1 curt curt 0 Mar 8 17:17 Our Wedding.mkv - -$ ls -l /disk2/Videos/ -total 2 --rw-r--r--. 1 curt curt 0 Mar 8 17:17 Baby's first Xmas.mkv --rw-rw-r--. 1 curt curt 0 Mar 8 17:21 Halloween hijinks.mkv -``` - -In this example there are two disks mounted as _disk1_ and _disk2_. Both drives have a _**Videos**_ directory with existing files. - -Now we’re going to mount those drives using mergerfs to make them appear as one larger drive. - -``` -$ sudo mergerfs -o defaults,allow_other,use_ino,category.create=mfs,moveonenospc=true,minfreespace=1M /disk1:/disk2 /media -``` - -The mergerfs man page is quite extensive and complex so we’ll break down the options that were specified. - - * _defaults_: This will use the default settings unless specified. - * _allow_other_: allows users besides sudo or root to see the filesystem. - * _use_ino_: Causes mergerfs to supply file/directory inodes rather than libfuse. While not a default it is recommended it be enabled so that linked files share the same inode value. - * _category.create=mfs_: Spreads files out across your drives based on available space. - * _moveonenospc=true_: If enabled, if writing fails, a scan will be done looking for the drive with the most free space. - * _minfreespace=1M_: The minimum space value used. - * _disk1_: First hard drive. - * _disk2_: Second hard drive. - * _/media_: The directory folder where the drives are mounted. - - - -Here is what it looks like: - -``` -$ df -hT | grep disk -/dev/sdb1 ext4 23M 386K 21M 2% /disk1 -/dev/sdc1 ext4 44M 1.1M 40M 3% /disk2 - -$ df -hT | grep media -1:2 fuse.mergerfs 66M 1.4M 60M 3% /media -``` - -You can see that the mergerfs mount now shows a total capacity of 66M which is the combined total of the two hard drives. - -Continuing with the example: - -There is a 30Mb video called _Baby’s second Xmas.mkv_. Let’s copy it to the _/media_ folder which is the mergerfs mount. - -``` -$ ls -lh "Baby's second Xmas.mkv" --rw-rw-r--. 1 curt curt 30M Apr 20 08:45 Baby's second Xmas.mkv -$ cp "Baby's second Xmas.mkv" /media/Videos/ -``` - -Here is the end result: - -``` -$ df -hT | grep disk -/dev/sdb1 ext4 23M 386K 21M 2% /disk1 -/dev/sdc1 ext4 44M 31M 9.8M 76% /disk2 - -$ df -hT | grep media -1:2 fuse.mergerfs 66M 31M 30M 51% /media -``` - -You can see from the disk space utilization that mergerfs automatically copied the file to disk2 because disk1 did not have enough free space. - -Here is a breakdown of all of the files: - -``` -$ ls -l /disk1/Videos/ -total 1 --rw-r--r--. 1 curt curt 0 Mar 8 17:17 Our Wedding.mkv - -$ ls -l /disk2/Videos/ -total 30003 --rw-r--r--. 1 curt curt 0 Mar 8 17:17 Baby's first Xmas.mkv --rw-rw-r--. 1 curt curt 30720000 Apr 20 08:47 Baby's second Xmas.mkv --rw-rw-r--. 1 curt curt 0 Mar 8 17:21 Halloween hijinks.mkv - -$ ls -l /media/Videos/ -total 30004 --rw-r--r--. 1 curt curt 0 Mar 8 17:17 Baby's first Xmas.mkv --rw-rw-r--. 1 curt curt 30720000 Apr 20 08:47 Baby's second Xmas.mkv --rw-rw-r--. 1 curt curt 0 Mar 8 17:21 Halloween hijinks.mkv --rw-r--r--. 1 curt curt 0 Mar 8 17:17 Our Wedding.mkv -``` - -When you copy files to your mergerfs mount, it will always copy the files to the hard disk that has enough free space. If none of the drives in the pool have enough free space, then you won’t be able to copy them. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/using-mergerfs-to-increase-your-virtual-storage/ - -作者:[Curt Warfield][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/rcurtiswarfield/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/mergerfs-816x346.png -[2]: https://github.com/trapexit/mergerfs -[3]: https://github.com/trapexit/mergerfs/releases -[4]: https://github.com/trapexit/mergerfs/releases/download/2.29.0/mergerfs-2.29.0-1.fc31.x86_64.rpm diff --git a/translated/tech/20200501 Using mergerfs to increase your virtual storage.md b/translated/tech/20200501 Using mergerfs to increase your virtual storage.md new file mode 100644 index 0000000000..936ed454d9 --- /dev/null +++ b/translated/tech/20200501 Using mergerfs to increase your virtual storage.md @@ -0,0 +1,147 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using mergerfs to increase your virtual storage) +[#]: via: (https://fedoramagazine.org/using-mergerfs-to-increase-your-virtual-storage/) +[#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/) + +使用 mergefs 增加虚拟存储 +====== + +![][1] + +如果你想在一个媒体项目中用上多个磁盘或分区,而又不想丢失任何现有数据,但又想将所有文件都存放在一个驱动器下,该怎么办?这就是 mergefs 派上用场的地方! + +[mergerfs][2] 是旨在简化跨多个商业存储设备文件的存储和管理的联合文件系统。 + +你需要从[这个][3] github 页面获取最新的 RPM。Fedora 的版本名称中带有 _**fc**_ 和版本号。例如,以下是 Fedora 31 的版本: + +[mergerfs-2.29.0-1.fc31.x86_64.rpm][4] + +### 安装和配置 mergefs + +使用 sudo 安装已下载的 mergefs 软件包: + +``` +$ sudo dnf install mergerfs-2.29.0-1.fc31.x86_64.rpm +``` + +现在,你可以将多个磁盘挂载为一个驱动器。如果你有一台媒体服务器,并且希望所有媒体文件都显示在一个地方,这将很方便。如果将新文件上传到系统,那么可以将它们复制到 mergefs 目录,mergefs 会自动将它们复制具有足够可用空间的磁盘上。 + +这是使你更容易理解的例子: + +``` +$ df -hT | grep disk +/dev/sdb1 ext4 23M 386K 21M 2% /disk1 +/dev/sdc1 ext4 44M 1.1M 40M 3% /disk2 + +$ ls -l /disk1/Videos/ +total 1 +-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Our Wedding.mkv + +$ ls -l /disk2/Videos/ +total 2 +-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Baby's first Xmas.mkv +-rw-rw-r--. 1 curt curt 0 Mar 8 17:21 Halloween hijinks.mkv +``` + +在此例中挂载了两块磁盘,分别为 _disk1_ 和 _disk2_。两个驱动器都有一个包含文件的 _**Videos**_ 目录。 + +现在,我们将使用 mergefs 挂载这些驱动器,使它们看起来像一个更大的驱动器。 + +``` +$ sudo mergerfs -o defaults,allow_other,use_ino,category.create=mfs,moveonenospc=true,minfreespace=1M /disk1:/disk2 /media +``` + +mergefs 手册页非常广泛且复杂,因此我们将说明上面提到的选项。 + + * _defaults_:除非指定,否则将使用默认设置。 + * _allow_other_:允许 sudo 或 root 以外的用户查看文件系统。 + * _use_ino_:让 mergefs 提供文件/目录 inode 而不是 libfuse。虽然不是默认值,但建议你启用它,以便链接的文件共享相同的 inode 值。 + * _category.create=mfs_:根据可用空间在驱动器间传播文件。 + * _moveonenospc=true_:如果启用,那么如果写入失败,将进行扫描以查找具有最大可用空间的驱动器。 + * _minfreespace=1M_:最小使用空间值。 + * _disk1_:第一块硬盘。 + * _disk2_:第二块硬盘。 + * _/media_:挂载驱动器的目录。 + + + +看起来是这样的: + +``` +$ df -hT | grep disk +/dev/sdb1 ext4 23M 386K 21M 2% /disk1 +/dev/sdc1 ext4 44M 1.1M 40M 3% /disk2 + +$ df -hT | grep media +1:2 fuse.mergerfs 66M 1.4M 60M 3% /media +``` + +你可以看到现在 mergefs 挂载显示的总容量为 66M,这是两块硬盘的总容量。 + +继续示例: + +有一个叫 _Baby’s second Xmas.mkv_ 的 30M 视频。让我们将其复制到用 mergerfs 挂载的 _/media_ 文件夹中。 + +``` +$ ls -lh "Baby's second Xmas.mkv" +-rw-rw-r--. 1 curt curt 30M Apr 20 08:45 Baby's second Xmas.mkv +$ cp "Baby's second Xmas.mkv" /media/Videos/ +``` + +这是最终结果: + +``` +$ df -hT | grep disk +/dev/sdb1 ext4 23M 386K 21M 2% /disk1 +/dev/sdc1 ext4 44M 31M 9.8M 76% /disk2 + +$ df -hT | grep media +1:2 fuse.mergerfs 66M 31M 30M 51% /media +``` + +从磁盘空间利用率中可以看到,因为 disk1 没有足够的可用空间,所以 mergefs 自动将文件复制到 disk2。 + +这是所有文件详情: + +``` +$ ls -l /disk1/Videos/ +total 1 +-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Our Wedding.mkv + +$ ls -l /disk2/Videos/ +total 30003 +-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Baby's first Xmas.mkv +-rw-rw-r--. 1 curt curt 30720000 Apr 20 08:47 Baby's second Xmas.mkv +-rw-rw-r--. 1 curt curt 0 Mar 8 17:21 Halloween hijinks.mkv + +$ ls -l /media/Videos/ +total 30004 +-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Baby's first Xmas.mkv +-rw-rw-r--. 1 curt curt 30720000 Apr 20 08:47 Baby's second Xmas.mkv +-rw-rw-r--. 1 curt curt 0 Mar 8 17:21 Halloween hijinks.mkv +-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Our Wedding.mkv +``` + +当你将文件复制到 mergefs 挂载点时,它将始终将文件复制到有足够可用空间的硬盘上。如果池中的所有驱动器都没有足够的可用空间,那么你将无法复制它们。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/using-mergerfs-to-increase-your-virtual-storage/ + +作者:[Curt Warfield][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/rcurtiswarfield/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/mergerfs-816x346.png +[2]: https://github.com/trapexit/mergerfs +[3]: https://github.com/trapexit/mergerfs/releases +[4]: https://github.com/trapexit/mergerfs/releases/download/2.29.0/mergerfs-2.29.0-1.fc31.x86_64.rpm From c6aea43b045b063f0e9a7d072b89a26abcd93efd Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 8 May 2020 08:43:51 +0800 Subject: [PATCH 0646/1809] translating --- ...tudio To Replace Xfce With KDE Plasma Desktop Environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md b/sources/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md index 586232d723..61c2007784 100644 --- a/sources/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md +++ b/sources/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0f1c6aa3bbbcf726d40eb12f1a14a931ffab9807 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 8 May 2020 09:40:39 +0800 Subject: [PATCH 0647/1809] PRF @geekpi --- ...200428 Upgrading Fedora 31 to Fedora 32.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/translated/tech/20200428 Upgrading Fedora 31 to Fedora 32.md b/translated/tech/20200428 Upgrading Fedora 31 to Fedora 32.md index 637bf41ce8..a5f6cc9ce0 100644 --- a/translated/tech/20200428 Upgrading Fedora 31 to Fedora 32.md +++ b/translated/tech/20200428 Upgrading Fedora 31 to Fedora 32.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Upgrading Fedora 31 to Fedora 32) @@ -12,27 +12,27 @@ ![][1] -Fedora 32 [已经发布][2]。你可能想升级系统以获得 Fedora 中的最新功能。Fedora Workstation 有图形化的升级方法。另外,Fedora 提供了命令行方法,用于将 Fedora 30 升级到 Fedora 31。 +Fedora 32 [已经发布][2]。你可能想升级系统以获得 Fedora 中的最新功能。Fedora Workstation 有图形化的升级方法。另外,Fedora 提供了命令行方法,用于将 Fedora 31 升级到 Fedora 32。 -升级前,请访问 [Fedora 32 个常见 bug 的维基页面] [3],查看是否存在可能影响升级的问题。尽管 Fedora 社区试图确保升级正常进行,但是无法为用户可能使用的每种软硬件组合提供保证。 +升级前,请访问 [Fedora 32 个常见 bug 的维基页面][3],查看是否存在可能影响升级的问题。尽管 Fedora 社区试图确保升级正常进行,但是无法为用户可能使用的每种软硬件组合提供保证。 -### 将Fedora 31 Workstation 升级到 Fedora 32 +### 将 Fedora 31 Workstation 升级到 Fedora 32 -发布不久之后就会出现通知,告诉你有可用的升级。你可以单击通知启动 **GNOME Software**。或者,你可以从 GNOME Shell 中选择“软件”。 +在新版本发布不久之后就会出现通知,告诉你有可用的升级。你可以单击该通知启动 “GNOME 软件”。或者,你可以从 GNOME Shell 中选择“软件”。 -在 GNOME Software中 选择 _Updates_ 选项卡,你会看到一个页面通知你 Fedora 32 现在可用。 +在 “GNOME 软件”中选择更新Updates选项卡,你会看到一个页面通知你 Fedora 32 现在可用。 如果你在此页面看不到任何内容,请尝试使用左上方的重新加载按钮。发布后,所有系统可能都需要一段时间才能看到可用的升级。 -选择 _Download_ 获取升级包。你可以继续做事直到下载完成。然后使用 GNOME Software 重启系统并应用升级。升级需要时间,因此你可能需要喝杯咖啡,稍后再回来。 +选择下载Download获取升级包。你可以继续做事直到下载完成。然后使用 “GNOME 软件”重启系统并应用升级。升级需要时间,因此你可能需要喝杯咖啡,稍后再回来。 ### 使用命令行 -如果你是从 Fedora 的先前版本升级的,那么你可能对 _dnf upgrade_ 插件很熟悉。此方法是从 Fedora 31 升级到 Fedora 32 的推荐和受支持的方法。使用此插件将使你轻松地升级到 Fedora 32。 +如果你是从 Fedora 的先前版本升级的,那么你可能对 `dnf upgrade` 插件很熟悉。这个方法是推荐和受支持的从 Fedora 31 升级到 Fedora 32 的方法。使用此插件将使你轻松地升级到 Fedora 32。 -#### 1\. 更新软件并备份系统 +#### 1、更新软件并备份系统 -在开始升级过程之前,请确保你有 Fedora 31 的最新软件。如果你安装了模块化软件,这尤为重要。dnf 和 GNOME Software 的最新版本对某些模块化流的升级过程进行了改进。要更新软件,请使用_ GNOME Software_ 或在终端中输入以下命令。 +在开始升级过程之前,请确保你有 Fedora 31 的最新软件。如果你安装了模块化软件modular software,这尤为重要。`dnf` 和 “GNOME 软件”的最新版本对某些模块化流的升级过程进行了改进。要更新软件,请使用 “GNOME 软件” 或在终端中输入以下命令。 ``` sudo dnf upgrade --refresh @@ -40,7 +40,7 @@ sudo dnf upgrade --refresh 此外,在继续操作之前,请确保备份系统。有关备份的帮助,请参阅 Fedora Magazine 上的[备份系列][4]。 -#### 2\. 安装 DNF 插件 +#### 2、安装 DNF 插件 接下来,打开终端并输入以下命令安装插件: @@ -48,7 +48,7 @@ sudo dnf upgrade --refresh sudo dnf install dnf-plugin-system-upgrade ``` -#### 3\. 使用 DNF 开始更新 +#### 3、使用 DNF 开始更新 现在,你的系统已更新、已备份、并且已安装 DNF 插件,你可以在终端中使用以下命令开始升级: @@ -56,17 +56,17 @@ sudo dnf install dnf-plugin-system-upgrade sudo dnf system-upgrade download --releasever=32 ``` -该命令将开始在本地下载计算机的所有升级,以准备升级。如果由于没有更新的软件包、损坏的依赖项或已淘汰的软件包而在升级时遇到问题,请在输入上述命令时添加 _‐allowerasing_ 标志。这将使 DNF 删除可能阻止系统升级的软件包。 +这个命令将开始在本地下载所有的升级包,为升级做准备。如果你在升级的时候因为没有更新的包、依赖关系破损或退役的包而出现问题,请在输入上述命令时添加 `--allowerasing` 标志。这将允许 DNF 移除可能阻碍系统升级的软件包。 -#### 4\. 重启并升级 +#### 4、重启并升级 -当上一个命令完成了所有升级的下载,你的系统就可以重新启动了。要将系统引导至升级过程,请在终端中输入以下命令: +当上一个命令完成了所有升级包的下载,你的系统就可以重新启动了。要将系统引导至升级过程,请在终端中输入以下命令: ``` sudo dnf system-upgrade reboot ``` -此后,系统将重启。在许多版本之前,_fedup_ 工具会在内核选择/引导页上创建一个新选项。使用 _dnf-plugin-system-upgrade_ 包,你的系统将重启进入 Fedora 31 当前安装的内核;这个是正常的。在选择内核之后,你的系统会立即开始升级过程。 +此后,系统将重启。在许多版本之前,`fedup` 工具会在内核选择/启动页上创建一个新选项。使用 `dnf-plugin-system-upgrade` 包,你的系统会重启进入 Fedora 31 当前安装的内核;这个是正常的。在选择内核之后,你的系统会立即开始升级过程。 现在可能是喝杯咖啡休息的好时机!完成后,系统将重启,你将能够登录到新升级的 Fedora 32 系统。 @@ -85,14 +85,14 @@ via: https://fedoramagazine.org/upgrading-fedora-31-to-fedora-32/ 作者:[Adam Šamalík][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://fedoramagazine.org/author/asamalik/ [b]: https://github.com/lujun9972 [1]: https://fedoramagazine.org/wp-content/uploads/2020/04/31-32-816x345.png -[2]: https://fedoramagazine.org/announcing-fedora-32/ +[2]: https://linux.cn/article-12164-1.html [3]: https://fedoraproject.org/wiki/Common_F32_bugs [4]: https://fedoramagazine.org/taking-smart-backups-duplicity/ [5]: https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot_f23-ws-upgrade-test_2016-06-10_110906-1024x768.png From ed260ec05ed019b957efea8774ede77278f690d1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 8 May 2020 09:41:06 +0800 Subject: [PATCH 0648/1809] PUB @geekpi https://linux.cn/article-12195-1.html --- .../20200428 Upgrading Fedora 31 to Fedora 32.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200428 Upgrading Fedora 31 to Fedora 32.md (98%) diff --git a/translated/tech/20200428 Upgrading Fedora 31 to Fedora 32.md b/published/20200428 Upgrading Fedora 31 to Fedora 32.md similarity index 98% rename from translated/tech/20200428 Upgrading Fedora 31 to Fedora 32.md rename to published/20200428 Upgrading Fedora 31 to Fedora 32.md index a5f6cc9ce0..c2c4bc0301 100644 --- a/translated/tech/20200428 Upgrading Fedora 31 to Fedora 32.md +++ b/published/20200428 Upgrading Fedora 31 to Fedora 32.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12195-1.html) [#]: subject: (Upgrading Fedora 31 to Fedora 32) [#]: via: (https://fedoramagazine.org/upgrading-fedora-31-to-fedora-32/) [#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) From 26adc8d62d551e8bcf00e27f43dae24e412a9669 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 8 May 2020 09:58:48 +0800 Subject: [PATCH 0649/1809] Rename sources/tech/20200508 Good News- You Can Now Buy the De-Googled -e-OS Smartphone from Fairphone.md to sources/news/20200508 Good News- You Can Now Buy the De-Googled -e-OS Smartphone from Fairphone.md --- ... Can Now Buy the De-Googled -e-OS Smartphone from Fairphone.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200508 Good News- You Can Now Buy the De-Googled -e-OS Smartphone from Fairphone.md (100%) diff --git a/sources/tech/20200508 Good News- You Can Now Buy the De-Googled -e-OS Smartphone from Fairphone.md b/sources/news/20200508 Good News- You Can Now Buy the De-Googled -e-OS Smartphone from Fairphone.md similarity index 100% rename from sources/tech/20200508 Good News- You Can Now Buy the De-Googled -e-OS Smartphone from Fairphone.md rename to sources/news/20200508 Good News- You Can Now Buy the De-Googled -e-OS Smartphone from Fairphone.md From 2924cda5869786e5d6cebd523107a9b8d0a9917e Mon Sep 17 00:00:00 2001 From: luzw3 Date: Fri, 8 May 2020 14:32:25 +0800 Subject: [PATCH 0650/1809] =?UTF-8?q?=E7=94=B3=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20200410 How Kubernetes saved my desktop application.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200410 How Kubernetes saved my desktop application.md b/sources/tech/20200410 How Kubernetes saved my desktop application.md index ecbd6ee273..8e2cf34da6 100644 --- a/sources/tech/20200410 How Kubernetes saved my desktop application.md +++ b/sources/tech/20200410 How Kubernetes saved my desktop application.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (CrazyShipOne) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c1435a2539bd6cfc203ebb2012fec2193b6dfa34 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 8 May 2020 22:48:44 +0800 Subject: [PATCH 0651/1809] PRF @geekpi --- ...and Folders on Desktop Screen in Ubuntu.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/translated/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md b/translated/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md index 984bb4dedb..562862520e 100644 --- a/translated/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md +++ b/translated/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using Files and Folders on Desktop Screen in Ubuntu) @@ -10,7 +10,9 @@ 在 Ubuntu 桌面中使用文件和文件夹 ====== -_**此初学者教程讨论了 在Ubuntu 桌面上添加文件和文件夹时可能遇到的一些困难。**_ +![](https://img.linux.net.cn/data/attachment/album/202005/08/224609chff5qn5ccah56af.jpg) + +> 此初学者教程讨论了 在Ubuntu 桌面上添加文件和文件夹时可能遇到的一些困难。 我认识一些习惯将所有重要/常用文件放在桌面上以便快速访问的人。 @@ -20,9 +22,9 @@ _**此初学者教程讨论了 在Ubuntu 桌面上添加文件和文件夹时可 在过去的几个版本中,很难在 Ubuntu 的默认 GNOME 桌面上添加文件。这并不是 Ubuntu 的错。 -[GNOME][2] 的开发者认为,桌面上没有图标和文件的位置。当你可以在菜单中轻松搜索文件时,无需将文件放在桌面上。这部分是事实。 +[GNOME][2] 的开发者认为,桌面上没有图标和文件的存身之地。当你可以在菜单中轻松搜索文件时,无需将文件放在桌面上。这在部分情况下是事实。 -这就是为什么 [GNOME 的文件管理器 Nautilus][3]的较新版本不能很好地支持桌面上的图标和文件的原因。 +这就是为什么 [GNOME 的文件管理器 Nautilus][3] 的较新版本不能很好地支持桌面上的图标和文件的原因。 也就是说,在桌面上添加文件和文件夹并非没有可能。让我告诉你如何做。 @@ -38,7 +40,7 @@ _**此初学者教程讨论了 在Ubuntu 桌面上添加文件和文件夹时可 ![Desktop folder can be used to add files to the desktop screen][5] -你添加到此文件夹的所有内容都会反应在桌面上。 +你添加到此文件夹的所有内容都会反映在桌面上。 ![Anything added to the Desktop folder will be reflected on the desktop screen][6] @@ -46,7 +48,7 @@ _**此初学者教程讨论了 在Ubuntu 桌面上添加文件和文件夹时可 #### 将文件拖放到桌面不起作用 -现在,如果你尝试在桌面上从文件管理器拖放文件,它会不起使用。这不是一个 bug,它是一个使很多人恼火的功能。 +现在,如果你尝试从文件管理器往桌面上拖放文件,它会不起使用。这不是一个 bug,它是一个使很多人恼火的功能。 一种临时方案是打开两个文件管理器。在其中一个打开“桌面”文件夹,然后将文件拖放到该文件夹​​中,它们将被添加到桌面上。 @@ -54,7 +56,7 @@ _**此初学者教程讨论了 在Ubuntu 桌面上添加文件和文件夹时可 #### 你不能使用 Ctrl+C 和 Ctrl+V 在桌面上复制粘贴,请使用右键单击菜单 -更恼人的是,你不能使用 Ctrl+V(著名的键盘快捷键)将文件粘贴到桌面上。 +更恼人的是,你不能使用 `Ctrl+V`(著名的键盘快捷键)将文件粘贴到桌面上。 但是,你仍然可以使用右键单击,然后选择“粘贴”,将文件复制到桌面上。你甚至可以通过这种方式创建新文件夹。 @@ -64,13 +66,13 @@ _**此初学者教程讨论了 在Ubuntu 桌面上添加文件和文件夹时可 #### 你无法使用 Delete 键删除文件和文件夹,请再次使用右键菜单 -更糟糕的是,你无法使用 Delete 键或 Shift+Delete 键从桌面上删除文件。但是你仍然可以右键单击文件或文件夹,然后选择“移至回收站”来删除文件。 +更糟糕的是,你无法使用 `Delete` 键或 `Shift+Delete` 键从桌面上删除文件。但是你仍然可以右键单击文件或文件夹,然后选择“移至回收站”来删除文件。 ![Delete files from desktop using right click][8] 好了,你现在知道至少有一种方法可以在桌面上添加文件,但有一些限制。不幸的是,这还没有结束。 -你无法在桌面上用名称搜索文件。通常,如果你开始输入 “abc”,那么以 “abc” 开头的文件会高亮显示。你并不明白。 +你无法在桌面上用名称搜索文件。通常,如果你开始输入 “abc”,那么以 “abc” 开头的文件会高亮显示。但是在这里不行。 我不知道为什么在桌面上添加文件受到了如此多的限制。值得庆幸的是,我不会经常使用它,否则我会感到非常沮丧。 @@ -83,7 +85,7 @@ via: https://itsfoss.com/add-files-on-desktop-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d24a2d5eef4fb1babb454f784829a578b4f65ba1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 8 May 2020 22:49:16 +0800 Subject: [PATCH 0652/1809] PUB @geekpi https://linux.cn/article-12198-1.html --- ...428 Using Files and Folders on Desktop Screen in Ubuntu.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md (98%) diff --git a/translated/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md b/published/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md similarity index 98% rename from translated/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md rename to published/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md index 562862520e..a58f9a7895 100644 --- a/translated/tech/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md +++ b/published/20200428 Using Files and Folders on Desktop Screen in Ubuntu.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12198-1.html) [#]: subject: (Using Files and Folders on Desktop Screen in Ubuntu) [#]: via: (https://itsfoss.com/add-files-on-desktop-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From e2551e28f4169713f1a3c7eecd515fa790feac61 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Fri, 8 May 2020 23:06:19 +0800 Subject: [PATCH 0653/1809] APL --- ...200506 Managing Git projects with submodules and subtrees.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200506 Managing Git projects with submodules and subtrees.md b/sources/tech/20200506 Managing Git projects with submodules and subtrees.md index f906f2a4e4..66f89ca545 100644 --- a/sources/tech/20200506 Managing Git projects with submodules and subtrees.md +++ b/sources/tech/20200506 Managing Git projects with submodules and subtrees.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 04be984af861c64adf5ab4de7b4e2bad92d9065f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 9 May 2020 00:54:38 +0800 Subject: [PATCH 0654/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200507=20How?= =?UTF-8?q?=20to=20repeat=20a=20Linux=20command=20until=20it=20succeeds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200507 How to repeat a Linux command until it succeeds.md --- ...epeat a Linux command until it succeeds.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 sources/tech/20200507 How to repeat a Linux command until it succeeds.md diff --git a/sources/tech/20200507 How to repeat a Linux command until it succeeds.md b/sources/tech/20200507 How to repeat a Linux command until it succeeds.md new file mode 100644 index 0000000000..1eb586b267 --- /dev/null +++ b/sources/tech/20200507 How to repeat a Linux command until it succeeds.md @@ -0,0 +1,30 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to repeat a Linux command until it succeeds) +[#]: via: (https://www.linux.com/news/how-to-repeat-a-linux-command-until-it-succeeds/) +[#]: author: (Linux.com Editorial Staff https://www.linux.com/author/linuxdotcom/) + +How to repeat a Linux command until it succeeds +====== + +If you want to run a command on a Linux system until it succeeds, there are some really easy ways to do it that don’t require you to retype the command repeatedly or sit in front of your screen pressing !! Let’s look at the two options available with bash. + +Read More at [Network World][1] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/how-to-repeat-a-linux-command-until-it-succeeds/ + +作者:[Linux.com Editorial Staff][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/author/linuxdotcom/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3541298/how-to-repeat-a-linux-command-until-it-succeeds.html From e2c3b95ce71aeff916ddb6d63ab9d07ac42b65d9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 9 May 2020 01:04:48 +0800 Subject: [PATCH 0655/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200508=205=20?= =?UTF-8?q?ways=20to=20split=20your=20Linux=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200508 5 ways to split your Linux terminal.md --- ...508 5 ways to split your Linux terminal.md | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 sources/tech/20200508 5 ways to split your Linux terminal.md diff --git a/sources/tech/20200508 5 ways to split your Linux terminal.md b/sources/tech/20200508 5 ways to split your Linux terminal.md new file mode 100644 index 0000000000..b1115fbfcb --- /dev/null +++ b/sources/tech/20200508 5 ways to split your Linux terminal.md @@ -0,0 +1,169 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 ways to split your Linux terminal) +[#]: via: (https://opensource.com/article/20/5/split-terminal) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +5 ways to split your Linux terminal +====== +What's your favorite terminal multiplexer? Take our poll. Then read +about how Linux offers plenty of ways for you to split your terminal so +you can multitask. +![4 different color terminal windows with code][1] + +Is there anything better than a warmly flickering Linux terminal? + +Sure there is: two warmly flickering Linux terminals. In fact, the more, the better. + +Long ago, [terminals were physical devices][2], but of course, today, they're just emulated as an application on your computer. If you prefer the terminal as your interface, you probably know that one terminal is rarely enough. Inevitably, you're going to open a new terminal or a new tab so you can work in it while your first is busy compiling or converting or otherwise processing data. + +If you're a sysadmin, then you know you're going to need at least four open windows while you work on several systems at the same time. + +Terminal applications with tabs have existed on Linux for a long time, and luckily, that trend seems to have caught on such that it's an expected feature of a modern terminal. And yet, sometimes it's distracting or inconvenient to flip back and forth between tabs. + +The only answer is a split screen so that two or more terminals can exist at the same time within just one application window. There are many tools in your Linux kit to help you slice and dice your consoles. + +### Shells, terminals, and consoles + +Before you slice and dice screens, you should know the difference between a terminal, a shell, and a "console." To get the full picture, read my article on the subject over on the [Enable Sysadmin][2] blog. + +The short version: + + * A shell is an input and output screen with a prompt. There's technically a shell running somewhere underneath your [POSIX][3] desktop, even when it's not visible (because it's a shell that launched your user session). + * A terminal is an application running within a graphics server (such as X11 or Wayland) with a shell loaded into it. A terminal is only running when you have a terminal window launched. It's more or less a "portal" into your shell. + * "Console" or "virtual console" is a term usually used to imply a shell running outside of your desktop. You can get to a virtual console by pressing **Alt-Ctrl-F2** (more are usually available from **F3** up to **F7**, with **F1** or **F7** representing your desktop, depending on your distribution). + + + +Some applications let you split your shell or console, while others let you split your terminal. + +### tmux + +![tmux terminal][4] + +Arguably the most flexible and capable of screen splitters, [tmux][5] is a keyboard-centric terminal multiplexer, meaning that you can "layer" one console on top of another and then switch between the two. You can also split a console view in half (or thirds or fourths, and so on) so you can see other consoles next to it. + +All controls center around the keyboard, which means you never have to take your hand off the keys in search of a mouse, but also that you must learn some new keyboard combos. + +If you're using tmux primarily for screen splitting, then the only commands you really need are these: + + * **Ctrl-B %** for a vertical split (one shell on the left, one shell on the right) + * **Ctrl-B"** for a horizontal split (one shell at the top, one shell at the bottom) + * **Ctrl-B O** to make the other shell active + * **Ctrl-B ?** for help + * **Ctrl-B d** detach from Tmux, leaving it running in the background (use **tmux attach** to reenter) + + + +There are many benefits to tmux, including the ability to start a tmux session on one computer, and then join that same session from another computer remotely. It essentially daemonizes your shell. + +It's with tmux running on a Pi, for example, that I can stay logged into IRC on a permanent basis—I start tmux on the Pi, and then log in from whatever computer I happen to be on. When I log out, tmux continues to run, patiently waiting for me to reattach to the session from a different computer. + +### GNU Screen + +![GNU Screen terminal][6] + +Similar to tmux, [GNU Screen][7] is a shell multiplexer. You can detach and reattach from a running session, and you can split the screen both horizontally and vertically. + +Screen is a little clunkier than tmux. Its default key binding is **Ctrl-A**, which also happens to be Bash's keyboard shortcut to go to the beginning of a line. This means that if you have Screen running, you must press **Ctrl-A** twice instead of just once to go to the beginning of the line. Personally, I redefine the trigger key to **Ctrl-J** with this line in **$HOME/.screenrc**: + + +``` +`escape ^jJ` +``` + +Screen's split function works well, but it leaves out a few pleasantries that tmux lacks. For instance, when you split your shell, a new shell does not start in the other panel. You have to navigate to the other space with **Ctrl-A Tab** (or **Ctrl-J** if you redefine your keyboard shortcut as I do) and create a new shell manually with **Ctrl-A C**. + +Unlike tmux, a split doesn't go away when you exit a shell, which is a design feature that's quite nice in some instances but can also sometimes be cumbersome because it forces you to manage your splits manually. + +Still, Screen is a reliable and flexible application that you can run should you find that **tmux** is unavailable to you. + +Here are the basic split commands, using the default keyboard shortcuts: + + * **Ctrl-A |** for a vertical split (one shell on the left, one shell on the right) + * **Ctrl-A S** for a horizontal split (one shell at the top, one shell at the bottom) + * **Ctrl-A Tab** to make the other shell active + * **Ctrl-A ?** for help + * **Ctrl-A d** detach from Screen, leaving it running in the background (use **screen -r** to reenter) + + + +### Konsole + +![Konsole screen][8] + +[Konsole][9] is the terminal bundled along with the KDE Plasma desktop. Like KDE itself, Konsole is famous for being highly customizable and powerful. + +Among its many features is the ability to split its window, similar to both tmux and GNU Screen. Because Konsole is a graphical terminal, you can control its split-screen feature with your mouse instead of your keyboard. + +Splitting is found in the **View** menu of Konsole. You can split your window horizontally or vertically. To change which panel is active, just click on it. Each panel is a unique terminal, so it can have its own theme and tabs. + +Unlike tmux and GNU Screen, you can't detach and reattach from Konsole. Like most graphical applications, you use Konsole while you're physically in front of it, and you lose access to it when you're away (unless you use remote desktop software). + +### Emacs + +![Emacs rpg][10] + +Emacs isn't exactly a terminal multiplexer, but its interface supports splitting and resizing, and it has a built-in terminal. + +If you're in Emacs on a daily basis anyway, the ability to split your window between essentially different applications means you never have to leave the familiarity and comfort of your favorite text editor. Furthermore, because the Emacs **eshell** module is implemented in eLISP, you can interact with it using the same commands you use in Emacs itself, making it trivial to copy and yank long file paths or command output. + +If you're using Emacs in a graphical window, you can perform some actions with your mouse. It's faster to use keyboard shortcuts, and some are more or less required. For instance, you can change which panel is the active one by clicking into it, and you can resize the proportions of your split screen with your mouse. + +These are the important keyboard shortcuts: + + * **Ctrl-X 3** for a vertical split (one shell on the left, one shell on the right) + * **Ctrl-X 2** for a horizontal split (one shell at the top, one shell at the bottom) + * **Ctrl-X O** to make the other shell active (you can also do this with the mouse) + * **Ctrl-X 0** (that’s a zero) close the current panel + + + +Similar to tmux and GNU Screen, you can detach and reattach from Emacs as long as you run **emacs-client**. + +### Window manager + +![Ratpoison split screen][11] + +Should you think a text editor that can split its screen and load a terminal is amazing, imagine your desktop serving the same purpose. There are Linux desktops, like [Ratpoison][12], [Herbsluftwm][13], i3, Awesome, and even the KDE Plasma desktop with specific settings enabled, that present each application window to you as a fixed tile in a desktop grid. + +Instead of windows floating "above" your desktop, they remain in a predictable place so you can change from one to the other. You can open any number of terminals within your grid, emulating a terminal multiplexer. In fact, you could even load a terminal multiplexer in your desktop multiplexer. + +And there's nothing stopping you from loading Emacs with split buffers inside of that. No one knows what happens if you take it further than that, and most Linux users agree it's best not to find out. + +Unlike tmux and GNU Screen, you can't detach and reattach from your desktop unless you count using remote desktop software. + +### Other options + +Believe it or not, these aren't the only options you have to split your screen on Linux. There are other terminal emulators, like [Tilix][14] and Terminator before it, that can split into sections, and applications with embedded terminal components, and much more. Tell us your favorite way of splitting up your workspace in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/split-terminal + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/freedos.png?itok=aOBLy7Ky (4 different color terminal windows with code) +[2]: https://www.redhat.com/sysadmin/terminals-shells-consoles +[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[4]: https://opensource.com/sites/default/files/uploads/terminal-split-tmux2.png (tmux terminal) +[5]: https://github.com/tmux/tmux +[6]: https://opensource.com/sites/default/files/uploads/terminal-split-screen.png (GNU Screen terminal) +[7]: https://www.gnu.org/software/screen/ +[8]: https://opensource.com/sites/default/files/uploads/konsole.jpg (Konsole screen) +[9]: https://konsole.kde.org +[10]: https://opensource.com/sites/default/files/uploads/emacs-rpg_0.jpg (Emacs rpg) +[11]: https://opensource.com/sites/default/files/uploads/advent-ratpoison-split_0.jpg (Ratpoison split screen) +[12]: https://opensource.com/article/19/12/ratpoison-linux-desktop +[13]: https://opensource.com/article/19/12/herbstluftwm-linux-desktop +[14]: https://gnunn1.github.io/tilix-web/ From 467fafcaf77526fe15d1bdb93be779d5ed8ceab6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 9 May 2020 01:05:28 +0800 Subject: [PATCH 0656/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200508=20Gett?= =?UTF-8?q?ing=20started=20with=20FreeBSD=20as=20a=20desktop=20operating?= =?UTF-8?q?=20system?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200508 Getting started with FreeBSD as a desktop operating system.md --- ...h FreeBSD as a desktop operating system.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20200508 Getting started with FreeBSD as a desktop operating system.md diff --git a/sources/tech/20200508 Getting started with FreeBSD as a desktop operating system.md b/sources/tech/20200508 Getting started with FreeBSD as a desktop operating system.md new file mode 100644 index 0000000000..0ce2dc4e32 --- /dev/null +++ b/sources/tech/20200508 Getting started with FreeBSD as a desktop operating system.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with FreeBSD as a desktop operating system) +[#]: via: (https://opensource.com/article/20/5/furybsd-linux) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) + +Getting started with FreeBSD as a desktop operating system +====== +FuryBSD's live desktop environment lets you try it before committing to +it. +![web development and design, desktop and browser][1] + +[FreeBSD][2] is a great operating system, but, by design, it does not come with a desktop environment. Without installing additional software from FreeBSD's [ports and packages collection][3], FreeBSD is a command-line only experience. The screenshot below shows what logging into FreeBSD 12.1 looks like when every one of the "optional system components" is selected during installation. + +![FreeBSD][4] + +FreeBSD can be turned into a desktop operating system with any of a wide selection of desktop environments, but it takes time, effort, and [following a lot of written instructions][5]. Using the **desktop-installer** package, which provides the user with options in a text-based menu and helps automate much of the process, is still time-consuming. The biggest problem with either of these methods is that users might find out that their system is not fully compatible with FreeBSD after they have taken all the time to set things up. + +[FuryBSD][6] solves that problem by providing a live desktop image that users can evaluate before installing. Currently, FuryBSD provides an Xfce image and a KDE image. Each of these images provides an installation of FreeBSD that has a desktop environment pre-installed. If users try out the image and find that their hardware works, they can install FuryBSD and have a ready-to-go desktop operating system powered by FreeBSD. For the purposes of this article, I will be using the Xfce image, but the KDE image works the exact same way. + +Getting started with FuryBSD should be a familiar process to anyone who has installed a Linux distribution, any of the BSDs, or any other Unix-like open source operating system. Download the ISO from the FuryBSD website, copy it to a flash drive, and boot a computer from the flash drive. If booting from the flash drive fails, make sure Secure Boot is disabled. + +![FuryBSD Live XFCE Desktop][7] + +After booting from the flash drive, the desktop environment loads automatically. In addition to the Home, File System, and Trash icons, the live desktop has icons for a tool to configure Xorg, getting started instructions, the FuryBSD installer, and a system information utility. Other than these extras and some custom Xfce settings and wallpaper, the desktop environment does not come with much beyond the basic Xfce applications and Firefox. + +![FuryBSD Xorg Tool][8] + +Only basic graphics drivers are loaded at this point, but it is enough to check to see if the system's wired and wireless network interfaces are supported by FuryBSD. If none of the network interfaces is working automatically, the **Getting Started.txt** file contains instructions for attempting to configure network interfaces and other configuration tasks. If at least one of the network interfaces works, the **Configure Xorg** application can be used to install Intel, NVidia, or VirtualBox graphics drivers. The drivers will be downloaded and installed, and Xorg will need to be restarted. If the system does not automatically re-login to the live image user, the password is **furybsd**. Once they are configured, the graphics drivers will carry over to an installed system. + +![FuryBSD Installer - ZFS Configuration][9] + +If everything works well in the live environment, the FuryBSD installer can configure and install FuryBSD onto the computer. This installer runs in a terminal, but it provides the same options found in most other BSD and Linux installers. The user will be asked to set the system's hostname, configure ZFS storage, set the root password, add at least one non-root user, and configure the time and date settings. Once the process is complete, the system can be rebooted into a pre-configured FreeBSD with an Xfce (or KDE) desktop. FuryBSD did all the hard work and even took the extra effort to make the desktop look nice. + +![FuryBSD Post-Install XFCE Desktop][10] + +As noted above, the desktop environment does not come with a lot of pre-installed software, so installing additional packages is almost certainly necessary. The quickest way to do this is by using the **pkg** command in the terminal. This command behaves much like **dnf** and **apt**, so users coming from a Linux distribution that uses one of those should feel right at home when it comes to finding and installing packages. FreeBSD's package collection is large, so most of the big-name open source software packages are available. + +Users trying out FuryBSD without having much FreeBSD experience should consult the [FreeBSD Handbook][11] to learn more about how to do things the FreeBSD way. Users with experience using any Linux distribution or one of the other BSDs should be able to figure out a lot of things, but there are differences that the handbook can help clarify. Another great resource for learning more about the FreeBSD way of doing things is _[Absolute FreeBSD, 3rd Edition][12],_ by Michael W. Lucas. + +A brief overview of PC-BSD and thoughts about the distribution. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/furybsd-linux + +作者:[Joshua Allen Holm][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/web_browser_desktop_devlopment_design_system_computer.jpg?itok=pfqRrJgh (web development and design, desktop and browser) +[2]: https://www.freebsd.org +[3]: https://www.freebsd.org/ports/ +[4]: https://opensource.com/sites/default/files/uploads/freebsd.png (FreeBSD) +[5]: https://www.freebsdfoundation.org/freebsd/how-to-guides/installing-a-desktop-environment-on-freebsd/ +[6]: https://www.furybsd.org +[7]: https://opensource.com/sites/default/files/uploads/furybsd_live_xfce_desktop.png (FuryBSD Live XFCE Desktop) +[8]: https://opensource.com/sites/default/files/uploads/furybsd_xorg_tool.png (FuryBSD Xorg Tool) +[9]: https://opensource.com/sites/default/files/uploads/furybsd_installer_-_zfs_configuration.png (FuryBSD Installer - ZFS Configuration) +[10]: https://opensource.com/sites/default/files/uploads/furybsd_post-install_xfce_desktop.png (FuryBSD Post-Install XFCE Desktop) +[11]: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ +[12]: https://nostarch.com/absfreebsd3 From 1b952189f0437987229ddca3634ad76244ee2415 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 9 May 2020 01:06:03 +0800 Subject: [PATCH 0657/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200508=20A=20?= =?UTF-8?q?guide=20to=20setting=20up=20your=20Open=20Source=20Program=20Of?= =?UTF-8?q?fice=20(OSPO)=20for=20success?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200508 A guide to setting up your Open Source Program Office (OSPO) for success.md --- ...ource Program Office (OSPO) for success.md | 193 ++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 sources/tech/20200508 A guide to setting up your Open Source Program Office (OSPO) for success.md diff --git a/sources/tech/20200508 A guide to setting up your Open Source Program Office (OSPO) for success.md b/sources/tech/20200508 A guide to setting up your Open Source Program Office (OSPO) for success.md new file mode 100644 index 0000000000..ea3aa01866 --- /dev/null +++ b/sources/tech/20200508 A guide to setting up your Open Source Program Office (OSPO) for success.md @@ -0,0 +1,193 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A guide to setting up your Open Source Program Office (OSPO) for success) +[#]: via: (https://opensource.com/article/20/5/open-source-program-office) +[#]: author: (J. Manrique Lopez de la Fuente https://opensource.com/users/jsmanrique) + +A guide to setting up your Open Source Program Office (OSPO) for success +====== +Learn how to best grow and maintain your open source communities and +allies. +![community team brainstorming ideas][1] + +Companies create Open Source Program Offices (OSPO) to manage their relationship with the open source ecosystems they depend on. By understanding the company's open source ecosystem, an OSPO is able to maximize the company's return on investment and reduce the risks of consuming, contributing to, and releasing open source software. Additionally, since the company depends on its open source ecosystem, ensuring its health and sustainability shall ensure the company's health, sustainable growth, and evolution. + +### How has OSPO become vital to companies and their open source ecosystem? + +Marc Andreessen has said that "software is eating the world," and more recently, it could be said that open source is eating the software world. But how is that process happening? + +Companies get involved with open source projects in several ways. These projects comprise the company's open source ecosystem, and their relationships and interactions can be seen through Open Source Software's (OSS) inbound and outbound processes. + +From the OSS inbound point of view, companies use it to build their own solutions and their own infrastructure. OSS gets introduced because it's part of the code their technology providers use, or because their own developers add open source components to the company's information technology (IT) infrastructure. + +From the OSS outbound point of view, some companies contribute to OSS projects. That contribution could be part of the company's requirements for their solutions that need certain fixes in upstream projects. For example, Samsung contributes to certain graphics-related projects to ensure its hardware has software support once it gets into the market. In some other cases, contributing to OSS is a mechanism to retain talent by allowing the people to contribute to projects different from their daily work. + +Some companies release their own open source projects as an outbound OSS process. For companies like Red Hat or GitLab, it would be expected. But, there are increasingly more non-software companies releasing a lot of OSS, like Lyft. + +![OSS inbound and outbound processes][2] + +OSS inbound and outbound processes + +Ultimately, all of these projects involved in the inbound and outbound OSS flow are the company's OSS ecosystem. And like any living being, the company's health and sustainability depend on the ecosystem that surrounds it. + +### OSPO responsibilities + +Following the species and their ecosystem, people working in the OSPO team could be seen as the rangers in the organization's OSS ecosystem. They take care of the ecosystem and its relationship with the company, to keep everything healthy and sustainable. + +When the company consumes open source software projects, they need to be aware of licenses and compliance, to check the project's health, to ensure there are no security flaws, and, in some cases, to identify talented community members for potential hiring processes. + +When the company contributes to open source software projects, they need to be sure there are no Intellectual Property (IP) issues, to ensure the company contributions' footprint and its leadership in the projects, and sometimes, also to help talented people stay engaged with the company through their contributions. + +And when the company releases and maintains open source projects, they are responsible for ensuring community engagement and growth, for checking there are no IP issues, that the company maintains its footprint and leadership, and perhaps, to attract new talent to the company. + +Have you realized the whole set of skills required in an OSPO team? When I've asked people working in OSPO about the size of their teams, the number is around 1 to 5 people per 1,000 developers in the company. That's a small team to monitor a lot of people and their potential OSS related activity. + +### How to manage an OSPO + +With all these activities in OSPO people's minds and all the resources they need to worry about, how are they able to manage all of this? + +There are at least a couple of open source communities with valuable knowledge and resources available for them: + + * The [TODO Group][3] is "an open group of companies who want to collaborate on practices, tools, and other ways to run successful and effective open source projects and programs." For example, they have a complete set of [guides][4] with best practices for and from companies running OSPOS. + * The [CHAOSS (Community Health Analytics for Open Source Software)][5] community develops metrics, methodologies, and software for managing open source project health and sustainability. (See more on CHAOSS' active communities and working groups below). + + + +OSPO managers need to report a lot of information to the rest of the company to answer many questions related to their OSS inbound and outbound processes, i.e., Which projects are we using in our organization? What's the health of those projects? Who are the key people in those projects? Which projects are we contributing to? Which projects are we releasing? How are we dealing with community contributions? Who are the key contributors? + +### Data-driven OSPO + +As William Edwards Deming said, "Without data, you are just a person with an opinion." + +Having opinions is not a bad thing, but having opinions based on data certainly makes it easier to understand, discuss, and determine the processes best suited to your company and its goals. CHAOSS is the recommended community to look to for guidance about metrics strategies and tools. + +Recently, the CHAOSS community has released [a new set of metric definitions][6]. These metrics are only subsets of all the ones being discussed in the focus areas of each working group (WG): + + * [Common WG][7]: Defines the metrics that are used by both working groups or are important for community health, but that do not cleanly fit into one of the other existing working groups. Areas of interest include organizational affiliation, responsiveness, and geographic coverage. + * [Diversity and Inclusion WG][8]: Gathers experiences regarding diversity and inclusion in open source projects with the goal of understanding, from a qualitative and quantitative point of view, how diversity and inclusion can be measured. + * [Evolution WG][9]: Refines the metrics that inform evolution and works with software implementations. + * [Risk WG][10]: Refines the metrics that inform risk and works with software implementations. + * [Value WG][11]: Focuses on industry-standard metrics for economic value in open source. Their main goal is to publish trusted industry-standard value metrics—a kind of S&P for software development and an authoritative source for metrics significance and industry norms. + + + +On the tooling side, projects like [Augur][12], [Cregit][13], and [GrimoireLab][14] are the reference tools that report these metrics, but also many others related to OSPO activities. They are also the seed for new tools and solutions provided by the OSS community like [Cauldron.io][15], a SaaS open source solution to ease OSS ecosystem analysis. + +![CHAOSS Metrics for 15 years of Unity OSS activity. Source: cauldron.io][16] + +CHAOSS Metrics for 15 years of Unity OSS activity. Source: cauldron.io + +All these metrics and data are useless without a metrics strategy. Usually, the first approach is to try to measure as much as possible, producing overwhelming reports and dashboards full of charts and data. What is the value of that? + +Experience has shown that a very valid approach is the [Goal, Questions, Metrics (GQM)][17] strategy. But how do we put that in practice in an OSPO? + +First of all, we need to understand the company's goals when using, consuming, contributing to, or releasing and maintaining OSS projects. The usual goals are related to market positioning, required upstream features development, and talent attraction or retention. Based on these goals, we should write down related questions that can be answered with numbers, like the following: + +#### Who/how many are the core maintainers of my OSS ecosystem projects? + +![Uber OSS code core, regular, and casual contributors evolution. Source: uber.biterg.io][18] + +Uber OSS code core, regular, and casual contributors evolution. Source: uber.biterg.io + +People contribute through different mechanisms or tools (code, issues, comments, tests, etc.). Measuring the core contributors (those that have done 80% of the contributions), the regular ones (those that have done 15% of the contributions), and the casual ones (those have made 5% of the contributions) can answer questions related to participation over time, but also how people move between the different buckets. Adding affiliation information helps to identify external core contributors. + +#### Where are the contributions happening? + +![Uber OSS activity based on location. Source: uber.biterg.io][19] + +Uber OSS activity based on location. Source: uber.biterg.io + +The growth of OSS ecosystems is also related to OSS projects spread across the world. Understanding that spread helps OSPO, and the company, to manage actions that improve support for people from different countries and regions. + +#### What is the company's OSS network? + +![Uber OSS network. Source: uber.biterg.io][20] + +Uber OSS network. Source: uber.biterg.io + +The company's OSS ecosystem includes those projects that the company's people contribute to. Understanding which projects they contribute to offers insight into which technologies or OSS components are interesting to people, and which companies or organizations the company collaborates with. + +#### How is the company dealing with contributions? + +![Github Pull Requests backlog management index and time to close analysis. Source: uber.biterg.io][21] + +Github Pull Requests backlog management index and time to close analysis. Source: uber.biterg.io + +One of the goals when releasing OSS projects is to grow the community around them. Measuring how the company handles contributions to its projects from outside its boundaries helps to understand how "welcoming" it is and identifies mentors (or bottlenecks) and opportunities to lower the barrier to contribute. + +#### Consumers vs. maintainers + +Over the last months, we have been hearing that corporations are taking OSS for free without contributing back. The typical arguments are that these corporations are making millions of dollars thanks to free work, plus the issue of OSS project maintainer burnout due to users' complaints and requests for free support. + +The system is unbalanced; usually, the number of users exceeds the number of maintainers. Is that good or bad? Having users for our software is (or should be) good. But we need to manage expectations on both sides. + +From the corporation's point of view, consuming OSS without care is very, very risky. + +OSPO can play an important role in educating the company about the risks they are facing, and how to reduce them by contributing back to their OSS ecosystem. Remember, a company's overall sustainability could rely heavily on its ecosystem sustainability. + +A good strategy is to start shifting your company from being pure OSS consumers to becoming contributors to their OSS inbound projects. From just submitting issues and asking questions to help solve issues, answering questions, and even sending patches, contributing helps grow and maintain the project while giving back to the community. It doesn't happen immediately, but over time, the company will be perceived as an OSS ecosystem citizen. Eventually, some people from the company could end up helping to maintain those projects too. + +And what about money? There are plenty of ways to support the OSS ecosystem financially. Some examples: + + * Business initiatives like [Tidelift][22], or [OpenCollective][23] + * Foundations and their supporting mechanisms, like [Software Freedom Conservancy][24], or [CommunityBridge][25] from the Linux Foundation + * Self-funding programs (like [Indeed][26] and [Salesforce][27] have done) + * Emerging gig development approaches like [Github Sponsors][28] or [Patreon][29] + + + +Last but not least, companies need to avoid the "not invented here" syndrome. For some OSS projects, there might be companies providing consulting, customization, maintenance, and/or support services. Instead of taking OSS and spending time and people to self-host, self-customize, or try to bring those kinds of services in-house, it might be smarter and more efficient to hire some of those companies to do the thought work. + +As a final remark, I would like to emphasize the importance of an OSPO for a company to succeed and grow in the current market. As shepherds of the company's OSS ecosystem, they are the best people in the organization to understand how the ecosystem works and flows, and they should be empowered to manage, monitor, and make recommendations and decisions to ensure sustainability and growth. + +Does your organization have an OSPO yet? + +Six common traits of successful open source programs, and a look back at how the open source... + +Why would a company not in the business of software development create an open source program... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/open-source-program-office + +作者:[J. Manrique Lopez de la Fuente][a] +选题:[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/jsmanrique +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/meeting_discussion_brainstorm.png?itok=7_m4CC8S (community team brainstorming ideas) +[2]: https://opensource.com/sites/default/files/uploads/ospo_1.png (OSS inbound and outbound processes) +[3]: https://todogroup.org/ +[4]: https://todogroup.org/guides/ +[5]: https://chaoss.community/ +[6]: https://chaoss.community/metrics/ +[7]: https://github.com/chaoss/wg-common +[8]: https://github.com/chaoss/wg-diversity-inclusion +[9]: https://github.com/chaoss/wg-evolution +[10]: https://github.com/chaoss/wg-risk +[11]: https://github.com/chaoss/wg-value +[12]: https://github.com/chaoss/augur +[13]: https://github.com/cregit +[14]: https://chaoss.github.io/grimoirelab/ +[15]: https://cauldron.io/ +[16]: https://opensource.com/sites/default/files/uploads/ospo_2.png (CHAOSS Metrics for 15 years of Unity OSS activity. Source: cauldron.io) +[17]: https://en.wikipedia.org/wiki/GQM +[18]: https://opensource.com/sites/default/files/uploads/ospo_3.png (Uber OSS code core, regular, and casual contributors evolution. Source: uber.biterg.io) +[19]: https://opensource.com/sites/default/files/uploads/ospo_4.png (Uber OSS activity based on location. Source: uber.biterg.io) +[20]: https://opensource.com/sites/default/files/uploads/ospo_5_0.png (Uber OSS network. Source: uber.biterg.io) +[21]: https://opensource.com/sites/default/files/uploads/ospo_6.png (Github Pull Requests backlog management index and time to close analysis. Source: uber.biterg.io) +[22]: https://tidelift.com/ +[23]: https://opencollective.com/ +[24]: https://sfconservancy.org/ +[25]: https://funding.communitybridge.org/ +[26]: https://engineering.indeedblog.com/blog/2019/02/sponsoring-osi/ +[27]: https://sustain.codefund.fm/23 +[28]: https://help.github.com/en/github/supporting-the-open-source-community-with-github-sponsors +[29]: https://www.patreon.com/ From fbbbc4c7ca206c03746dc65e9d41081395666ee1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 9 May 2020 08:49:34 +0800 Subject: [PATCH 0658/1809] translated --- ...428 What-s new in Fedora 32 Workstation.md | 89 ------------------- ...428 What-s new in Fedora 32 Workstation.md | 89 +++++++++++++++++++ 2 files changed, 89 insertions(+), 89 deletions(-) delete mode 100644 sources/tech/20200428 What-s new in Fedora 32 Workstation.md create mode 100644 translated/tech/20200428 What-s new in Fedora 32 Workstation.md diff --git a/sources/tech/20200428 What-s new in Fedora 32 Workstation.md b/sources/tech/20200428 What-s new in Fedora 32 Workstation.md deleted file mode 100644 index 7553d1bb99..0000000000 --- a/sources/tech/20200428 What-s new in Fedora 32 Workstation.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What’s new in Fedora 32 Workstation) -[#]: via: (https://fedoramagazine.org/whats-new-fedora-32-workstation/) -[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) - -What’s new in Fedora 32 Workstation -====== - -![][1] - -Fedora 32 Workstation is the [latest release][2] of our free, leading-edge operating system. You can download it from [the official website here][3] right now. There are several new and noteworthy changes in Fedora 32 Workstation. Read more details below. - -### GNOME 3.36 - -Fedora 32 Workstation includes the latest release of GNOME Desktop Environment for users of all types. GNOME 3.36 in Fedora 32 Workstation includes many updates and improvements, including: - -#### Redesigned Lock Screen - -The lock screen in Fedora 32 is a totally new experience. The new design removes the “window shade” metaphor used in previous releases, and focuses on ease and speed of use. - -![Unlock screen in Fedora 32][4] - -#### New Extensions Application - -Fedora 32 features the new Extensions application, to easily manage your GNOME Extensions. In the past, extensions were installed, configured, and enabled using either the Software application and / or the Tweak Tool. - -![The new Extensions application in Fedora 32][5] - -Note that the Extensions application is not installed by default on Fedora 32. To either use the Software application to search and install, or use the following command in the terminal: - -``` -sudo dnf install gnome-extensions-app -``` - -#### Reorganized Settings - -Eagle-eyed Fedora users will notice that the Settings application has been re-organized. The structure of the settings categories is a lot flatter, resulting in more settings being visible at a glance. - -Additionally, the **About** category now has a more information about your system, including which windowing system you are running (e.g. Wayland) - -![The reorganized settings application in Fedora 32][6] - -#### Redesigned Notifications / Calendar popover - -The Notifications / Calendar popover — toggled by clicking on the Date and Time at the top of your desktop — has had numerous small style tweaks. Additionally, the popover now has a **Do Not Disturb** switch to quickly disable all notifications. This quick access is useful when presenting your screen, and not wanting your personal notifications appearing. - -![The new Notification / Calendar popover in Fedora 32 ][7] - -#### Redesigned Clocks Application - -The Clocks application is totally redesigned in Fedora 32. It features a design that works better on smaller windows. - -![The Clocks application in Fedora 32][8] - -GNOME 3.36 also provides many additional features and enhancements. Check out the [GNOME 3.36 Release Notes][9] for further information - -* * * - -### Improved Out of Memory handling - -Previously, if a system encountered a low-memory situation, it may have encountered heavy swap usage (aka [swap thrashing][10])– sometimes resulting in the Workstation UI slowing down, or becoming unresponsive for periods of time. Fedora 32 Workstation now ships and enables EarlyOOM by default. EarlyOOM enables users to more quickly recover and regain control over their system in low-memory situations with heavy swap usage. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/whats-new-fedora-32-workstation/ - -作者:[Ryan Lerch][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/ryanlerch/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/fedora32workstation-816x345.jpg -[2]: https://fedoramagazine.org/announcing-fedora-32/ -[3]: https://getfedora.org/workstation -[4]: https://fedoramagazine.org/wp-content/uploads/2020/04/unlock.gif -[5]: https://fedoramagazine.org/wp-content/uploads/2020/04/extensions.png -[6]: https://fedoramagazine.org/wp-content/uploads/2020/04/settings.png -[7]: https://fedoramagazine.org/wp-content/uploads/2020/04/donotdisturb.png -[8]: https://fedoramagazine.org/wp-content/uploads/2020/04/clocks.png -[9]: https://help.gnome.org/misc/release-notes/3.36/ -[10]: https://en.wikipedia.org/wiki/Thrashing_(computer_science) diff --git a/translated/tech/20200428 What-s new in Fedora 32 Workstation.md b/translated/tech/20200428 What-s new in Fedora 32 Workstation.md new file mode 100644 index 0000000000..383da73a32 --- /dev/null +++ b/translated/tech/20200428 What-s new in Fedora 32 Workstation.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What’s new in Fedora 32 Workstation) +[#]: via: (https://fedoramagazine.org/whats-new-fedora-32-workstation/) +[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) + +Fedora 32 Workstation 的新功能 +====== + +![][1] + +Fedora 32 Workstation 是我们免费的领先操作系统的[最新版本][2]。你现在可以从[官方网站][3]下载它。Fedora 32 Workstation 中有几个新的且值得注意的更改。请阅读下面的详情。 + +### GNOME 3.36 + +Fedora 32 Workstation 包含了适合所有用户的 GNOME 桌面环境的最新版本。Fedora 32 Workstation 中的 GNOME 3.36 包含了许多更新和改进,包括: + +#### 重新设计的锁屏界面 + +Fedora 32 中的锁屏是一种全新的体验。新设计消除了以前版本中使用的“窗口阴影”,并着重于易用性和速度。 + +![Unlock screen in Fedora 32][4] + +#### 新的扩展程序 + +Fedora 32 有新的“扩展”应用,它可轻松管理你的 GNOME 扩展。过去,扩展是使用“软件”和/或“调整工具”来安装、配置和启用的。 + +![The new Extensions application in Fedora 32][5] + +请注意,默认情况下,Fedora 32 上未安装“扩展”应用。需要使用“软件”进行搜索和安装,或在终端中使用以下命令: + +``` +sudo dnf install gnome-extensions-app +``` + +#### 重新组织的设置 + +敏锐的 Fedora 用户会注意到“设置”应用已重新组织。设置类别的结构更加平坦,因此可以一次看到更多设置。 + +此外,“关于”中现在有有关系统的更多信息,包括正在运行的窗口系统(例如 Wayland) + +![The reorganized settings application in Fedora 32][6] + +#### 重新设计的通知/日历弹出框 + +单击桌面顶部的“日期和时间”可切换“通知/日历”弹出窗口,其中有许多小的样式调整项。此外,弹出窗口现在有“请勿打扰”开关,可快速禁用所有通知。这在希望只显示屏幕不显示个人通知时很有用。 + +![The new Notification / Calendar popover in Fedora 32 ][7] + +#### 重新设计的时钟应用 + +Fedora 32 完全重新设计了时钟。该设计在较小的窗口中效果更好。 + +![The Clocks application in Fedora 32][8] + +GNOME 3.36 还提供了许多其他功能和增强。有关更多信息,请查看 [GNOME 3.36 的发布说明][9]。 + +* * * + +### 改进的内存不足处理 + +以前,如果系统内存不足,那么可能会遇到大量 swap 使用(也称为 [swap thrashing][10])–有时会导致 Workstation UI 变慢或在一段时间内无响应。Fedora 32 Workstation 现在默认启用 EarlyOOM。EarlyOOM 使用户可以在低内存情况下通过大量 swap 使用来更快地恢复并重新获得对系统的控制。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/whats-new-fedora-32-workstation/ + +作者:[Ryan Lerch][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/ryanlerch/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/fedora32workstation-816x345.jpg +[2]: https://fedoramagazine.org/announcing-fedora-32/ +[3]: https://getfedora.org/workstation +[4]: https://fedoramagazine.org/wp-content/uploads/2020/04/unlock.gif +[5]: https://fedoramagazine.org/wp-content/uploads/2020/04/extensions.png +[6]: https://fedoramagazine.org/wp-content/uploads/2020/04/settings.png +[7]: https://fedoramagazine.org/wp-content/uploads/2020/04/donotdisturb.png +[8]: https://fedoramagazine.org/wp-content/uploads/2020/04/clocks.png +[9]: https://help.gnome.org/misc/release-notes/3.36/ +[10]: https://en.wikipedia.org/wiki/Thrashing_(computer_science) From baf9d42292372004ce21335583c72399f622b1ab Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 9 May 2020 09:16:04 +0800 Subject: [PATCH 0659/1809] translating --- ...-apt-lists- Error in Ubuntu and Other Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md b/sources/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md index 6ef4f2b55a..637f438ed8 100644 --- a/sources/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 03445180fdfbaf58b55c1cadd74b5d8f383d7272 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 9 May 2020 09:38:36 +0800 Subject: [PATCH 0660/1809] PRF @messon007 --- ... Create a SDN on Linux with open source.md | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/translated/tech/20200417 Create a SDN on Linux with open source.md b/translated/tech/20200417 Create a SDN on Linux with open source.md index 97272e9f2d..b8370a8e62 100644 --- a/translated/tech/20200417 Create a SDN on Linux with open source.md +++ b/translated/tech/20200417 Create a SDN on Linux with open source.md @@ -1,56 +1,58 @@ [#]: collector: (lujun9972) [#]: translator: (messon007) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Create a SDN on Linux with open source) [#]: via: (https://opensource.com/article/20/4/quagga-linux) [#]: author: (M Umer https://opensource.com/users/noisybotnet) -在Linux上使用开源代码创建SDN +在 Linux 上使用开源软件创建 SDN ====== -使用开源路由协议栈Quagga,使您的Linux系统成为一台路由器。 -![Coding on a computer][1] -网络路由协议分为两大类:内部网关协议和外部网关协议。路由器使用内部网关协议在单个自治系统内共享信息。如果您用的是Linux,则可以通过开源(GPLv2)路由协议栈[Quagga][2]使其表现得像一台路由器。 +> 使用开源路由协议栈 Quagga,使你的 Linux 系统成为一台路由器。 -### Quagga是什么? +![](https://img.linux.net.cn/data/attachment/album/202005/09/093541rqx3zr5dxn3yvnq6.jpg) -Quagga是[路由软件包][3],并且是[GNU Zebra][4]的一个分支。它为类Unix平台提供了所有主流路由协议的实现,例如开放最短路径优先(OSPF),路由信息协议(RIP),边界网关协议(BGP)和中间系统到中间系统协议(IS-IS)。 +网络路由协议分为两大类:内部网关协议和外部网关协议。路由器使用内部网关协议在单个自治系统内共享信息。如果你用的是 Linux,则可以通过开源(GPLv2)路由协议栈 [Quagga][2] 使其表现得像一台路由器。 -尽管Quagga为IPv4和IPv6都实现了路由协议,但它却不是一个完整的路由器。真正的路由器不仅实现了所有路由协议,而且还有转发网络流量的能力。 Quagga仅仅实现了路由协议栈,而转发网络流量的工作由Linux内核处理。 +### Quagga 是什么? + +Quagga 是一个[路由软件包][3],并且是 [GNU Zebra][4] 的一个分支。它为类 Unix 平台提供了所有主流路由协议的实现,例如开放最短路径优先(OSPF),路由信息协议(RIP),边界网关协议(BGP)和中间系统到中间系统协议(IS-IS)。 + +尽管 Quagga 实现了 IPv4 和 IPv6 的路由协议,但它并不是一个完整的路由器。一个真正的路由器不仅实现了所有路由协议,而且还有转发网络流量的能力。 Quagga 仅仅实现了路由协议栈,而转发网络流量的工作由 Linux 内核处理。 ### 架构 -Quagga通过协议特定的守护程序实现不同的路由协议。守护程序名称与路由协议相同,加了字母“d”作为后缀。Zebra是核心的协议无关的守护进程,它为内核提供了一个[抽象层][5],并通过TCP套接字向Quagga客户端提供Zserv API。每个协议特定的守护程序负责运行相关的协议并基于交换的信息来建立路由表。 +Quagga 通过特定协议的守护程序实现不同的路由协议。守护程序名称与路由协议相同,加了字母“d”作为后缀。Zebra 是核心,也是与协议无关的守护进程,它为内核提供了一个[抽象层][5],并通过 TCP 套接字向 Quagga 客户端提供 Zserv API。每个特定协议的守护程序负责运行相关的协议,并基于交换的信息来建立路由表。 ![Quagga architecture][6] ### 环境 -本教程通过Quagga实现的OSPF协议来配置动态路由。该环境包括两个名为Alpha和Beta的CentOS 7.7主机。两台主机共享访问 **192.168.122.0/24** 网络。 +本教程通过 Quagga 实现的 OSPF 协议来配置动态路由。该环境包括两个名为 Alpha 和 Beta 的 CentOS 7.7 主机。两台主机共享访问 **192.168.122.0/24** 网络。 -**主机Alpha** +**主机 Alpha:** IP:192.168.122.100/24 网关:192.168.122.1 -**主机Beta** +**主机 Beta:** IP:192.168.122.50/24 网关:192.168.122.1 ### 安装软件包 -首先,在两台主机上安装Quagga软件包。它存在于CentOS基础仓库中: +首先,在两台主机上安装 Quagga 软件包。它存在于 CentOS 基础仓库中: ``` -`yum install quagga -y` +yum install quagga -y ``` -### 使能IP转发 +### 启用 IP 转发 -接下来,在两台主机上使能IP转发,因为它将由Linux内核来执行: +接下来,在两台主机上启用 IP 转发,因为它将由 Linux 内核来执行: ``` sysctl -w net.ipv4.ip_forward = 1 @@ -59,14 +61,13 @@ sysctl -p ### 配置 -现在,进入 **/etc/quagga** 目录并为您的设置创建配置文件。您需要三个文件: +现在,进入 `/etc/quagga` 目录并为你的设置创建配置文件。你需要三个文件: - * **zebra.conf**:Quagga的守护程序配置文件,您可以在其中定义接口及其IP地址和IP转发 - * **ospfd.conf**:协议配置文件,您可以在其中定义将通过OSPF协议提供的网络 - * **守护程序**:您将在其中指定需要运行的相关的协议守护程序 +* `zebra.conf`:Quagga 守护程序的配置文件,你可以在其中定义接口及其 IP 地址和 IP 转发 +* `ospfd.conf`:协议配置文件,你可以在其中定义将通过 OSPF 协议提供的网络 +* `daemons`:你将在其中指定需要运行的相关的协议守护程序 - -在主机Alpha上, +在主机 Alpha 上, ```  [root@alpha]# cat /etc/quagga/zebra.conf @@ -94,7 +95,7 @@ zebra=yes ospfd=yes ``` -在主机Beta上, +在主机 Beta 上, ``` [root@beta quagga]# cat zebra.conf @@ -124,7 +125,7 @@ ospfd=yes ### 配置防火墙 -要使用OSPF协议,必须允许它通过防火墙: +要使用 OSPF 协议,必须允许它通过防火墙: ``` firewall-cmd --add-protocol=ospf –permanent @@ -132,7 +133,7 @@ firewall-cmd --add-protocol=ospf –permanent firewall-cmd –reload ``` -现在,启动zebra和ospfd守护程序。 +现在,启动 `zebra` 和 `ospfd` 守护程序。 ``` # systemctl start zebra @@ -149,7 +150,7 @@ default via 192.168.122.1 dev eth0 proto static metric 100 192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.100 metric 100 ``` -您可以看到Alpha上的路由表包含通过 **192.168.122.50** 到达 **10.10.10.0/24** 的条目,它是通过协议 **zebra** 获取的。同样,在主机Beta上,该表包含通过 **192.168.122.100** 到达网络 **10.12.13.0/24** 的条目。 +你可以看到 Alpha 上的路由表包含通过 **192.168.122.50** 到达 **10.10.10.0/24** 的路由项,它是通过协议 zebra 获取的。同样,在主机 Beta 上,该表包含通过 **192.168.122.100** 到达网络 **10.12.13.0/24** 的路由项。 ``` [root@beta ~]# ip route show @@ -161,7 +162,7 @@ default via 192.168.122.1 dev eth0 proto static metric 100 ### 结论 -如您所见,环境和配置相对简单。要增加复杂性,您可以向路由器添加更多网络接口,以为更多网络提供路由。您也可以使用相同的方法来实现BGP和RIP协议。 +如你所见,环境和配置相对简单。要增加复杂性,你可以向路由器添加更多网络接口,以为更多网络提供路由。你也可以使用相同的方法来实现 BGP 和 RIP 协议。 -------------------------------------------------------------------------------- @@ -170,7 +171,7 @@ via: https://opensource.com/article/20/4/quagga-linux 作者:[M Umer][a] 选题:[lujun9972][b] 译者:[messon007](https://github.com/messon007) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b0610b989b6eff8a94e6886097c7725710b1bfa9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 9 May 2020 09:39:13 +0800 Subject: [PATCH 0661/1809] PUB @messon007 https://linux.cn/article-12199-1.html --- .../20200417 Create a SDN on Linux with open source.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200417 Create a SDN on Linux with open source.md (98%) diff --git a/translated/tech/20200417 Create a SDN on Linux with open source.md b/published/20200417 Create a SDN on Linux with open source.md similarity index 98% rename from translated/tech/20200417 Create a SDN on Linux with open source.md rename to published/20200417 Create a SDN on Linux with open source.md index b8370a8e62..e05b649ee1 100644 --- a/translated/tech/20200417 Create a SDN on Linux with open source.md +++ b/published/20200417 Create a SDN on Linux with open source.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (messon007) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12199-1.html) [#]: subject: (Create a SDN on Linux with open source) [#]: via: (https://opensource.com/article/20/4/quagga-linux) [#]: author: (M Umer https://opensource.com/users/noisybotnet) From 6dfa609674d949f2c709f4514af2c22490872f16 Mon Sep 17 00:00:00 2001 From: Hank Chow <280630620@qq.com> Date: Sat, 9 May 2020 19:30:35 +0800 Subject: [PATCH 0662/1809] hankchow translating --- sources/tech/20200508 5 ways to split your Linux terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200508 5 ways to split your Linux terminal.md b/sources/tech/20200508 5 ways to split your Linux terminal.md index b1115fbfcb..1809296e6a 100644 --- a/sources/tech/20200508 5 ways to split your Linux terminal.md +++ b/sources/tech/20200508 5 ways to split your Linux terminal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 323f3a9dba50bede8e8208cd87cb74bdd64c2da5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 9 May 2020 20:37:19 +0800 Subject: [PATCH 0663/1809] PRF @geekpi --- ...428 What-s new in Fedora 32 Workstation.md | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/translated/tech/20200428 What-s new in Fedora 32 Workstation.md b/translated/tech/20200428 What-s new in Fedora 32 Workstation.md index 383da73a32..629267aa9a 100644 --- a/translated/tech/20200428 What-s new in Fedora 32 Workstation.md +++ b/translated/tech/20200428 What-s new in Fedora 32 Workstation.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What’s new in Fedora 32 Workstation) @@ -12,7 +12,7 @@ Fedora 32 Workstation 的新功能 ![][1] -Fedora 32 Workstation 是我们免费的领先操作系统的[最新版本][2]。你现在可以从[官方网站][3]下载它。Fedora 32 Workstation 中有几个新的且值得注意的更改。请阅读下面的详情。 +Fedora 32 Workstation 是我们免费的领先操作系统的[最新版本][2]。你现在可以从[官方网站][3]下载它。Fedora 32 Workstation 中有几个新的且值得注意的变化。请阅读下面的详情。 ### GNOME 3.36 @@ -30,23 +30,23 @@ Fedora 32 有新的“扩展”应用,它可轻松管理你的 GNOME 扩展。 ![The new Extensions application in Fedora 32][5] -请注意,默认情况下,Fedora 32 上未安装“扩展”应用。需要使用“软件”进行搜索和安装,或在终端中使用以下命令: +请注意,默认情况下,Fedora 32 上未安装这个“扩展”应用。需要使用“软件”进行搜索和安装,或在终端中使用以下命令: ``` sudo dnf install gnome-extensions-app ``` -#### 重新组织的设置 +#### 重新组织的设置应用 -敏锐的 Fedora 用户会注意到“设置”应用已重新组织。设置类别的结构更加平坦,因此可以一次看到更多设置。 +敏锐的 Fedora 用户会注意到“设置”应用已重新组织。设置类别的结构更加扁平,因此可以一次看到更多设置。 -此外,“关于”中现在有有关系统的更多信息,包括正在运行的窗口系统(例如 Wayland) +此外,“关于”中现在有有关系统的更多信息,包括正在运行的窗口系统(例如 Wayland)。 ![The reorganized settings application in Fedora 32][6] #### 重新设计的通知/日历弹出框 -单击桌面顶部的“日期和时间”可切换“通知/日历”弹出窗口,其中有许多小的样式调整项。此外,弹出窗口现在有“请勿打扰”开关,可快速禁用所有通知。这在希望只显示屏幕不显示个人通知时很有用。 +单击桌面顶部的“日期和时间”可切换“通知/日历”弹出窗口,其中有许多小的样式调整项。此外,弹出窗口现在有“请勿打扰”开关,可快速禁用所有通知。这在希望只显示屏幕而不显示个人通知时很有用。 ![The new Notification / Calendar popover in Fedora 32 ][7] @@ -58,11 +58,9 @@ Fedora 32 完全重新设计了时钟。该设计在较小的窗口中效果更 GNOME 3.36 还提供了许多其他功能和增强。有关更多信息,请查看 [GNOME 3.36 的发布说明][9]。 -* * * - ### 改进的内存不足处理 -以前,如果系统内存不足,那么可能会遇到大量 swap 使用(也称为 [swap thrashing][10])–有时会导致 Workstation UI 变慢或在一段时间内无响应。Fedora 32 Workstation 现在默认启用 EarlyOOM。EarlyOOM 使用户可以在低内存情况下通过大量 swap 使用来更快地恢复并重新获得对系统的控制。 +以前,如果系统内存不足,那么可能会遇到大量使用交换(也称为 [交换抖动][10])–有时会导致 Workstation UI 变慢或在一段时间内无响应。Fedora 32 Workstation 现在默认启用 EarlyOOM。EarlyOOM 可以让用户在低内存的情况下,存在大量使用交换的情况下,更快速地恢复和恢复对系统的控制。 -------------------------------------------------------------------------------- @@ -71,7 +69,7 @@ via: https://fedoramagazine.org/whats-new-fedora-32-workstation/ 作者:[Ryan Lerch][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cfe1ff164eea4bd5f75ed23613f8ee905c0317fa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 9 May 2020 20:38:47 +0800 Subject: [PATCH 0664/1809] PUB @geekpi https://linux.cn/article-12201-1.html --- .../20200428 What-s new in Fedora 32 Workstation.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20200428 What-s new in Fedora 32 Workstation.md (97%) diff --git a/translated/tech/20200428 What-s new in Fedora 32 Workstation.md b/published/20200428 What-s new in Fedora 32 Workstation.md similarity index 97% rename from translated/tech/20200428 What-s new in Fedora 32 Workstation.md rename to published/20200428 What-s new in Fedora 32 Workstation.md index 629267aa9a..17050794d2 100644 --- a/translated/tech/20200428 What-s new in Fedora 32 Workstation.md +++ b/published/20200428 What-s new in Fedora 32 Workstation.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12201-1.html) [#]: subject: (What’s new in Fedora 32 Workstation) [#]: via: (https://fedoramagazine.org/whats-new-fedora-32-workstation/) [#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) @@ -76,7 +76,7 @@ via: https://fedoramagazine.org/whats-new-fedora-32-workstation/ [a]: https://fedoramagazine.org/author/ryanlerch/ [b]: https://github.com/lujun9972 [1]: https://fedoramagazine.org/wp-content/uploads/2020/04/fedora32workstation-816x345.jpg -[2]: https://fedoramagazine.org/announcing-fedora-32/ +[2]: https://linux.cn/article-12164-1.html [3]: https://getfedora.org/workstation [4]: https://fedoramagazine.org/wp-content/uploads/2020/04/unlock.gif [5]: https://fedoramagazine.org/wp-content/uploads/2020/04/extensions.png From bd59f554ca437110171b163a431c7f7eeea43bd4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 9 May 2020 22:39:02 +0800 Subject: [PATCH 0665/1809] PRF @messon007 --- ...high-performance computing as a service.md | 79 +++++++++---------- 1 file changed, 37 insertions(+), 42 deletions(-) diff --git a/translated/talk/20200401 The ins and outs of high-performance computing as a service.md b/translated/talk/20200401 The ins and outs of high-performance computing as a service.md index 948d985765..40d9fd292e 100644 --- a/translated/talk/20200401 The ins and outs of high-performance computing as a service.md +++ b/translated/talk/20200401 The ins and outs of high-performance computing as a service.md @@ -1,87 +1,82 @@ [#]: collector: (lujun9972) [#]: translator: (messon007) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (The ins and outs of high-performance computing as a service) [#]: via: (https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html) [#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) -高性能计算即服务的来龙去脉 +超算即服务:超级计算机如何上云 ====== -高性能计算(HPC)服务可能是一种满足不断增长的超级计算需求的方式,但依赖于使用场景,它们不一定比使用本地超级计算机好。 -戴尔EMC -导弹和军用直升机上的电子设备需要工作在极端条件下。国防承包商麦考密克·史蒂文森公司(McCormick Stevenson Corp.)在部署任何物理设备之前都会事先模拟它所能承受的真实条件。模拟依赖于像Ansys这样的有限元素分析软件,该软件需要强大的算力。 +> 高性能计算(HPC)服务可能是一种满足不断增长的超级计算需求的方式,但依赖于使用场景,它们不一定比使用本地超级计算机好。 + +![](https://img.linux.net.cn/data/attachment/album/202005/09/223805mrjfjzecr3hceais.jpg) + +导弹和军用直升机上的电子设备需要工作在极端条件下。美国国防承包商麦考密克·史蒂文森公司McCormick Stevenson Corp.在部署任何物理设备之前都会事先模拟它所能承受的真实条件。模拟依赖于像 Ansys 这样的有限元素分析软件,该软件需要强大的算力。 几年前的一天,它出乎意料地超出了计算极限。 -[世界上最快的10个超级计算机][1] -麦考密克·史蒂文森(McCormick Stevenson)的首席工程师迈克·克劳奇奇(Mike Krawczyk)说:“我们的一些工作会使办公室的计算机不堪重负。购买机器并安装软件在经济上或计划上都不划算。” 相反,该公司与Rescale签约,从其购买在超级计算机系统上运行的周期(cycles),而这只花费了他们购买新硬件上所需的一小部分。 +麦考密克·史蒂文森公司的首席工程师 Mike Krawczyk 说:“我们的一些工作会使办公室的计算机不堪重负。购买机器并安装软件在经济上或计划上都不划算。”相反,他们与 Rescale 签约,该公司销售其超级计算机系统上的处理能力,而这只花费了他们购买新硬件上所需的一小部分。 -麦考密克·史蒂文森(McCormick Stevenson)已成为被称为超级计算即服务或高性能计算(HPC)即服务(两个紧密相关的术语)市场的早期采用者之一。根据国家计算科学研究所(的定义),HPC是超级计算机在计算复杂问题上的应用,而超级计算机是处理能力最先进的那些计算机。 +麦考密克·史蒂文森公司已成为被称为超级计算即服务或高性能计算即服务(两个紧密相关的术语)市场的早期采用者之一。根据国家计算科学研究所的定义,HPC 是超级计算机在计算复杂问题上的应用,而超级计算机是处理能力最先进的那些计算机。 -无论叫它什么,这些服务都在颠覆传统的超级计算市场,并将HPC能力带给以前买不起的客户。但这不是万能的,而且绝对不是即插即用的,至少现在还不是。 +无论叫它什么,这些服务都在颠覆传统的超级计算市场,并将 HPC 能力带给以前负担不起的客户。但这不是万能的,而且绝对不是即插即用的,至少现在还不是。 -### HPC服务实践 +### HPC 服务实践 -从最终用户的角度来看,HPC即服务类似于早期大型机时代的批处理模型。 “我们创建一个Ansys批处理文件并将其发送过去,运行它,然后将结果文件取下来并在本地导入它们,” Krawczyk说。 +从最终用户的角度来看,HPC 即服务类似于早期大型机时代的批处理模型。 “我们创建一个 Ansys 批处理文件并将其发送过去,运行它,然后将结果文件取下来,然后导入到本地,” Krawczyk 说。 -在HPC服务背后,云提供商在其自己的数据中心中运行超级计算基础设施,尽管这不一定意味着当您听到“超级计算机”时你就会看到最先进的硬件。正如IBM OpenPOWER计算技术副总裁Dave Turek解释的那样,HPC服务的核心是“相互互连的服务器集合。您可以调用该虚拟计算基础设施,它能够在您提出问题时,使得许多不同的服务器并行工作来解决问题。” -[][2] +在 HPC 服务背后,云提供商在其自己的数据中心中运行超级计算基础设施,尽管这不一定意味着当你听到“超级计算机”时你就会看到最先进的硬件。正如 IBM OpenPOWER 计算技术副总裁 Dave Turek 解释的那样,HPC 服务的核心是“相互互连的服务器集合。你可以调用该虚拟计算基础设施,它能够在你提出问题时,使得许多不同的服务器并行工作来解决问题。” -理论听起来很简单。但都柏林城市大学数字业务教授西奥·林恩(Theo Lynn)表示,要使其在实践中可行,需要解决一些技术问题。普通计算与HPC的区别在于那些互连-高速的,低延时的而且昂贵的-因此需要将这些互连引入云基础设施领域。在HPC服务可行之前,至少需要将存储性能和数据传输也提升到与本地HPC相同的水平。 +理论听起来很简单。但都柏林城市大学数字商业教授 Theo Lynn 表示,要使其在实践中可行,需要解决一些技术问题。普通计算与 HPC 的区别在于那些互联互通 —— 高速的、低延时的而且昂贵的 —— 因此需要将这些互连引入云基础设施领域。在 HPC 服务可行之前,至少需要将存储性能和数据传输也提升到与本地 HPC 相同的水平。 -但是林恩说,一些制度创新相比技术更好的帮助了HPC服务的起飞。特别是,“我们现在看到越来越多的传统HPC应用采用云友好的许可模式-过去是采用这种模式的障碍。” +但是 Lynn 说,一些制度创新相比技术更好的帮助了 HPC 服务的起飞。特别是,“我们现在看到越来越多的传统 HPC 应用采用云友好的许可模式 —— 这在过去是阻碍采用的障碍。” -他说,经济也改变了潜在的客户群。 “云服务提供商通过向那些负担不起传统HPC所需的投资成本的低端HPC买家开放,进一步开放了市场。随着市场的开放,超大规模经济模型变得越来越多,更可行,成本开始下降。” +他说,经济也改变了潜在的客户群。“云服务提供商通过向那些负担不起传统 HPC 所需的投资成本的低端 HPC 买家开放,进一步开放了市场。随着市场的开放,超大规模经济模型变得越来越多,更可行,成本开始下降。” -避免本地资本支出** -** +### 避免本地资本支出 -HPC服务对有志于传统超级计算长期把持的领域的私营行业客户具有吸引力。这些客户包括严重依赖复杂数学模型的行业,包括麦考密克·史蒂文森(McCormick Stevenson)等国防承包商,以及油气公司,金融服务公司和生物技术公司。都柏林城市大学的Lynn补充说,松耦合的工作负载是一个特别好的用例,这意味着许多早期采用者将其用于3D图像渲染和相关应用。 +HPC 服务对传统超级计算长期以来一直占据主导地位的私营部门客户具有吸引力。这些客户包括严重依赖复杂数学模型的行业,包括麦考密克·史蒂文森公司等国防承包商,以及石油和天然气公司、金融服务公司和生物技术公司。都柏林城市大学的 Lynn 补充说,松耦合的工作负载是一个特别好的用例,这意味着许多早期采用者将其用于 3D 图像渲染和相关应用。 -但是,何时考虑HPC服务而不是本地HPC才有意义?对于德国的模拟烟雾在建筑物中的蔓延和火灾对建筑物结构部件的破坏的hhpberlin公司来说,答案是在它超出了其现有资源时。 +但是,何时考虑 HPC 服务而不是本地 HPC 才有意义?对于德国的模拟烟雾在建筑物中的蔓延和火灾对建筑物结构部件的破坏的 hhpberlin 公司来说,答案是在它超出了其现有资源时。 -Hpberlin公司数值模拟的科学负责人Susanne Kilian说:“几年来,我们一直在运行自己的小型集群,该集群具有多达80个处理器核。” “但是,随着应用复杂性的提高,这种架构(constellation)已经越来越不足以支撑;可用容量并不总是够快速地处理项目。” +Hpberlin 公司数值模拟的科学负责人 Susanne Kilian 说:“几年来,我们一直在运行自己的小型集群,该集群具有多达 80 个处理器核。……但是,随着应用复杂性的提高,这种架构已经越来越不足以支撑;可用容量并不总是够快速地处理项目。” -她说:“但是,仅仅花钱买一个新的集群并不是一个理想的解决方案:鉴于我们公司的规模和管理环境,强制持续维护该集群(定期进行软件和硬件升级)是不现实的。另外,需要模拟的项目数量会出现很大的波动,因此集群的利用率并不是真正可预测的。通常,使用率很高的阶段与很少使用或不使用的阶段交替出现。”通过转换为HPC服务模式,hhpberlin释放了过剩的容量,并无需支付升级费用。 +她说:“但是,仅仅花钱买一个新的集群并不是一个理想的解决方案:鉴于我们公司的规模和管理环境,不断地维护这个集群(定期进行软件和硬件升级)是不现实的。另外,需要模拟的项目数量会出现很大的波动,因此集群的利用率并不是真正可预测的。通常,使用率很高的阶段与很少使用或不使用的阶段交替出现。”通过转换为 HPC 服务模式,hhpberlin 释放了过剩的产能,并无需支付升级费用。 -IBM的Turek解释了不同公司在评估其需求时所经历的计算过程。对于拥有30名员工的生物科学初创公司来说,“您需要计算,但您实在负担不起15%的员工专门从事它。这就像您可能也说过,您不想拥有在职法律代表,因此您也可以通过服务获得它。”但是,对于一家较大的公司而言,最终归结为权衡HPC服务的运营费用与购买内部超级计算机或HPC集群的费用。 +IBM 的 Turek 解释了不同公司在评估其需求时所经历的计算过程。对于拥有 30 名员工的生物科学初创公司来说,“你需要计算,但你真的不可能让 15% 的员工专门负责计算。这就像你可能也会说你不希望有专职的法律代表,所以你也会把它作为一项服务来做。”不过,对于一家较大的公司而言,最终归结为权衡 HPC 服务的运营费用与购买内部超级计算机或 HPC 集群的费用。 -到目前为止,这些都是您采用任何云服务时都会遇到的类似的争论。但是,可以HPC市场的某些特点将使得衡量运营支出与资本支出时选择前者。超级计算机不是诸如存储或x86服务器之类的商用硬件;它们非常昂贵,技术进步很快会使其过时。正如麦考密克·史蒂文森(McCormick Stevenson)的克拉维奇(Krawczyk)所说,“这就像买车:只要车一开走,它就会开始贬值。”对于许多公司,尤其是规模较大,灵活性较差的公司,购买超级计算机的过程可能会陷入无望的泥潭。 IBM的Turek说:“您陷入了计划问题,建筑问题,施工问题,培训问题,然后必须执行RFP。您必须得到CIO的支持。您必须与内部客户合作以确保服务的连续性。这是一个非常非常复杂的过程,并没有很多机构有非常出色的执行力。” +到目前为止,这些都是你采用任何云服务时都会遇到的类似的争论。但是,可以 HPC 市场的某些特殊性将使得衡量运营支出(OPEX)与资本支出(CAPEX)时选择前者。超级计算机不是诸如存储或 x86 服务器之类的商用硬件;它们非常昂贵,技术进步很快会使其过时。正如麦考密克·史蒂文森公司的 Krawczyk 所说,“这就像买车:只要车一开走,它就会开始贬值。”对于许多公司,尤其是规模较大,灵活性较差的公司,购买超级计算机的过程可能会陷入无望的泥潭。IBM 的 Turek 说:“你会被规划问题、建筑问题、施工问题、培训问题所困扰,然后必须执行 RFP。你必须得到 CIO 的支持。你必须与内部客户合作以确保服务的连续性。这是一个非常、非常复杂的过程,并没有很多机构有非常出色的执行力。” -一旦您选择了HPC服务的路线后,您会发现您会得到您期望从云服务中得到的许多好处,特别是仅在业务需要时才需付费的能力,从而可以带来资源的高效利用。 Gartner高级总监兼分析师Chirag Dekate表示,当您对高性能计算有短期需求时的突发性负载是推动选择HPC服务的关键用例。 +一旦你选择走 HPC 服务的路线,你会发现你会得到你期望从云服务中得到的许多好处,特别是仅在业务需要时才需付费的能力,从而可以带来资源的高效利用。Gartner 高级总监兼分析师 Chirag Dekate 表示,当你对高性能计算有短期需求时,突发性负载是推动选择 HPC 服务的关键用例。 -他说:“在制造业中,在产品设计阶段,HPC活动往往会达到很高的峰值。但是,一旦产品设计完成,在其余产品开发周期中,HPC资源的利用率就会降低。” 相比之下,他说:“当您拥有大量长期运行的工作时,云的经济性就会逐渐减弱。” +他说:“在制造业中,在产品设计阶段前后,HPC 活动往往会达到很高的峰值。但是,一旦产品设计完成,在其余产品开发周期中,HPC 资源的利用率就会降低。” 相比之下,他说:“当你拥有大型的、长期运行的工作时,云计算的经济性才会逐渐减弱。” -通过巧妙的系统设计,您可以将这些HPC服务突发活动与您自己的内部常规计算集成在一起。 埃森哲(Accenture)实验室常务董事Teresa Tung举了一个例子:“通过API访问HPC可以无缝地与传统计算混合。在模型构建阶段,传统的AI流水线可能会在高端超级计算机上进行训练,但是最终经过反复按预期运行的训练好的模型将部署在云中的其他服务上,甚至部署在边缘设备上。” +通过巧妙的系统设计,你可以将这些 HPC 服务突发活动与你自己的内部常规计算集成在一起。埃森哲Accenture实验室常务董事 Teresa Tung 举了一个例子:“通过 API 访问 HPC 可以与传统计算无缝融合。在模型构建阶段,传统的 AI 流水线可能会在高端超级计算机上进行训练,但是最终经过反复按预期运行的训练好的模型将部署在云端的其他服务上,甚至部署在边缘设备上。” -### 它并不适合所有的应用场景 ** +### 它并不适合所有的应用场景 -** +HPC 服务适合批处理和松耦合的场景。这与一个常见的 HPC 缺点有关:数据传输问题。高性能计算本身通常涉及庞大的数据集,而将所有这些信息通过互联网发送到云服务提供商并不容易。IBM 的 Turek 说:“我们与生物技术行业的客户交流,他们每月仅在数据费用上就花费 1000 万美元。” -HPC服务适合批处理和松耦合的场景。这与HPC的普遍缺点有关:数据传输问题。高性能计算本身通常涉及庞大的数据集,而将所有这些信息通过Internet发送到云服务提供商并不容易。IBM的Turek说:“我们与生物技术行业的客户交流,他们每月仅在数据费用上就花费1000万美元。” +而钱并不是唯一的潜在问题。构建一个利用数据的工作流程,可能会对你的工作流程提出挑战,让你绕过数据传输所需的漫长时间。hhpberlin 的 Kilian 说:“当我们拥有自己的 HPC 集群时,当然可以随时访问已经产生的仿真结果,从而进行交互式的临时评估。我们目前正努力达到在仿真的任意时刻都可以更高效地、交互地访问和评估云端生成的数据,而无需下载大量的模拟数据。” -钱并不是唯一的潜在问题。已制定的需要使用数据的工作流可能会使您在数据传输所需的时间内无法工作。hhpberlin的Kilian说:“当我们拥有自己的HPC集群时,当然可以随时访问已经产生的仿真结果,从而进行交互式的临时评估。我们目前正努力达到在仿真的任意时刻都可以更高效地,交互地访问和评估云中生成的数据,而无需下载大量的模拟数据。” +Mike Krawczyk 提到了另一个绊脚石:合规性问题。国防承包商使用的任何服务都需要遵从《国际武器交易条例》(ITAR),麦考密克·史蒂文森公司之所以选择 Rescale,部分原因是因为这是他们发现的唯一符合的供应商。如今,尽管有更多的公司使用云服务,但任何希望使用云服务的公司都应该意识到使用其他人的基础设施时所涉及的法律和数据保护问题,而且许多 HPC 场景的敏感性使得 HPC 即服务的这个问题更加突出。 -Mike Krawczyk提到了另一个绊脚石:合规性问题。国防承包商使用的任何服务都需要遵从(原文是complaint, 应该是笔误)《国际武器交易条例》(ITAR),麦考密克·史蒂文森(McCormick Stevenson)之所以选择Rescale,部分原因是因为这是他们发现的唯一符合的供应商。如今,尽管有更多的公司(使用云服务),但任何希望使用云服务的公司都应该意识到使用其他人的基础设施时所涉及的法律和数据保护问题,而且许多HPC场景的敏感性使得更HPC即服务的这个问题更加突出。 +此外,HPC 服务所需的 IT 治理超出了目前的监管范围。例如,你需要跟踪你的软件许可证是否允许云使用­ —— 尤其是专门为本地 HPC 群集上运行而编写的软件包。通常,你需要跟踪 HPC 服务的使用方式,它可能是一个诱人的资源,尤其是当你从员工习惯的内部系统过渡到有可用的空闲的 HPC 能力时。例如,Avanade 全球平台高级主管兼 Azure 平台服务全球负责人 Ron Gilpin 建议,将你使用的处理核心的数量回拨给那些对时间不敏感的任务。他说:“如果一项工作只需要用一小时来完成而不需要在十分钟内就完成,那么它可以使用 165 个处理器而不是 1,000 个,从而节省了数千美元。” -此外,HPC服务所需的IT治理超出了目前的监管范围。例如,您需要跟踪您的软件许可证是否允许云使用­ –尤其是专门为本地HPC群集上运行而编写的软件包。通常,您需要跟踪HPC服务的使用方式,它可能是一个诱人的资源,尤其是当您从员工习惯的内部系统过渡到有可用的空闲的HPC能力时。例如,Avanade全球平台高级主管兼Azure平台服务全球负责人Ron Gilpin建议,回调您用于时间不敏感任务的处理核心数量。他说:“如果一项工作只需要用一小时来完成而不需要在十分钟内就完成,那么它可以使用165个处理器而不是1,000个,从而节省了数千美元。” +### 对 HPC 技能的要求很高 -### 独特的HPC技能** +一直以来,采用 HPC 的最大障碍之一就是其所需的独特的内部技能,而 HPC 服务并不能神奇使这种障碍消失。Gartner 的 Dekate 表示:“许多 CIO 将许多工作负载迁移到了云上,他们看到了成本的节约、敏捷性和效率的提升,因此相信在 HPC 生态中也可以达成类似的效果。一个普遍的误解是,他们可以通过彻底地免去系统管理员,并聘用能解决其 HPC 工作负载的新的云专家,从而以某种方式优化人力成本。”对于 HPC 即服务来说更是如此。 -** +“但是 HPC 并不是一个主流的企业环境。” 他说。“你正在处理通过高带宽、低延迟的网络互联的高端计算节点,以及相当复杂的应用和中间件技术栈。许多情况下,甚至连文件系统层也是 HPC 环境所独有的。没有对应的技能可能会破坏稳定性。” -一直以来,采用HPC的最大障碍之一就是其所需的独特的内部技能,而HPC服务并不能使这种障碍消失。Gartner的Dekate表示:“许多CIO将许多工作负载迁移到了云上,他们看到了成本的节约,敏捷性和效率的提升,因此相信在HPC生态中也可以达成类似的效果。一个普遍的误解是,他们可以通过彻底地免去系统管理员,并聘用能解决其HPC工作负载的新的云专家,从而以某种方式优化人力成本。” +但是超级计算技能的供给却在减少,Dekate 将其称为劳动力“老龄化”,这是因为这一代开发人员将目光投向了新兴的初创公司,而不是学术界或使用 HPC 的更老套的公司。因此,HPC 服务供应商正在尽其所能地弥补差距。IBM 的 Turek 表示,许多 HPC 老手将总是想运行他们自己精心调整过的代码,并需要专门的调试器和其他工具来帮助他们在云端实现这一目标。但是,即使是 HPC 新手也可以调用供应商构建的代码库,以利用超级计算的并行处理能力。第三方软件提供商出售的交钥匙软件包可以减少 HPC 的许多复杂性。 -“但是HPC并不是一个主流的企业环境。” 他说。“您正在处理通过高带宽,低延迟的网络互联的高端计算节点,以及相当复杂的应用和中间件技术栈。许多情况下,甚至连文件系统层也是HPC环境所独有的。没有对应的技能可能会破坏稳定性。” +埃森哲的 Tung 表示,该行业需要进一步加大投入才能真正繁荣。她说:“HPCaaS 已经创建了具有重大影响力的新功能,但还需要做的是使它易于被数据科学家、企业架构师或软件开发人员使用。这包括易用的 API、文档和示例代码。它包括解答问题的用户支持。仅仅提供 API 是不够的,API 需要适合特定的用途。对于数据科学家而言,这可能是以 Python 形式提供,并容易更换她已经在使用的框架。价值来自于使这些用户能够通过新的效率和性能最终使他们的工作得到改善,只要他们能够访问新的功能就可以了。” 如果供应商能够做到这一点,那么 HPC 服务才能真正将超级计算带给大众。 -但是超级计算技能的供给却在减少,Dekate将其称为劳动力“灰化”,这是因为一代开发人员将目光投向了新兴的初创公司,而不是学术界或使用HPC的更老套的公司。因此,HPC服务供应商正在尽其所能地弥补差距。 IBM的Turek表示,许多HPC老手将总是想运行他们自己精心调整过的代码,将需要专门的调试器和其他工具来帮助他们在云上实现这一目标。但是,即使是HPC新手也可以调用供应商构建的代码库,以利用超级计算的并行处理能力。第三方软件提供商出售的交钥匙软件包可以减少HPC的许多复杂性。 -埃森哲的Tung表示,该行业需要进一步加大投入才能真正繁荣。她说:“HPCaaS已经创建了具有重大影响力的新功能,但还需要做的是使它易于被数据科学家,企业架构师或软件开发人员使用。这包括易用的API,文档和示例代码。它包括用户支持来解答问题。仅仅提供API是不够的,API需要适合特定的用途。对于数据科学家而言,这可能是以python形式提供,并容易更换她已经在使用的框架。其价值来自使这些用户最综只有在使用新功能时才能够改进效率和性能。” 如果供应商能够做到这一点,那么HPC服务才能真正将超级计算带给大众。 - -加入[Facebook][3]和[LinkedIn][4]上的Network World社区,探讨最前沿的话题。 -------------------------------------------------------------------------------- via: https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html @@ -89,7 +84,7 @@ via: https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-perfo 作者:[Josh Fruhlinger][a] 选题:[lujun9972][b] 译者:[messon007](https://github.com/messon007) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f359853d721f21859f65f83415a799af9ab125a1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 9 May 2020 22:39:37 +0800 Subject: [PATCH 0666/1809] PUB @messon007 https://linux.cn/article-12202-1.html --- ...ins and outs of high-performance computing as a service.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20200401 The ins and outs of high-performance computing as a service.md (99%) diff --git a/translated/talk/20200401 The ins and outs of high-performance computing as a service.md b/published/20200401 The ins and outs of high-performance computing as a service.md similarity index 99% rename from translated/talk/20200401 The ins and outs of high-performance computing as a service.md rename to published/20200401 The ins and outs of high-performance computing as a service.md index 40d9fd292e..ef96b09ffe 100644 --- a/translated/talk/20200401 The ins and outs of high-performance computing as a service.md +++ b/published/20200401 The ins and outs of high-performance computing as a service.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (messon007) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12202-1.html) [#]: subject: (The ins and outs of high-performance computing as a service) [#]: via: (https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html) [#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) From 655214810f39e827932526b4f3d8eef8e58d394f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 10 May 2020 01:06:03 +0800 Subject: [PATCH 0667/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200509=20The?= =?UTF-8?q?=20success=20of=20virtual=20conferences,=20Retropie=20comes=20t?= =?UTF-8?q?o=20Raspberry=20Pi=204,=20and=20other=20open=20source=20news?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200509 The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news.md --- ...pberry Pi 4, and other open source news.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20200509 The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news.md diff --git a/sources/tech/20200509 The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news.md b/sources/tech/20200509 The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news.md new file mode 100644 index 0000000000..76a6def4a1 --- /dev/null +++ b/sources/tech/20200509 The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news) +[#]: via: (https://opensource.com/article/20/5/news-may-9) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news +====== +Catch up on the biggest open source headlines from the past two weeks. +![][1] + +In this week’s edition of our open source news roundup, we see the success of virtual conferences, continued impact of open source on COVID-19, Retropie adds support for Raspberry Pi 4, and more open source news. + +### Virtual conferences report record attendance + +The technology industry, and non-profits supporting open source software, greatly [depend on conferences][2] to connect their community together. There has been an open question of whether moving to an online alternative would be effective or not. The last two weeks have given us reason to say virtual conferences are a huge success, and there are multiple paths to getting there. + +The first success goes to [Red Hat Summit][3], a conference put on by Red Hat to showcase their technology and interact with the open source community each year. Last year it held at Boston Convention and Exhibition Center in Boston, MA with a record-breaking  8,900 people in attendence. This year, due to COVID-19, Red Hat took it virtual with what they called [Red Hat Summit 2020 Virtual Experience][3]. The final attendance numbers, as [reported by IT World Canada][4], was 80,000 people. + +The explosive growth of online events continued this week with GitHub Satelite [reporting][5] over 40,000 attendees for its multiday event. + +![Example streaming for #DIDevOps][6] + +*Streaming example of [Desert Island DevOps][7] * + +Another success with a different twist came in the shape of 3-D avatars in the popular Animal Crossing game. Desert Island DevOps [reported][8] over 8,500 attendees in a simulated space and received [a lot of praise][9] from attendees and speakers alike.  + +### Open source continues to speed COVID-19 response + +Emergency response requires speed and safety to be a top concern, which makes open source licensing and designs even more valuable. In our current battle with COVID-19, there is a need for increasing inventory of medical equipment such as ventilators and PPE as well as the development of treatments and medications. An open source approach is showing to have a major response. + +A recent victory comes in the form of a [ventilator design][10] announced by Nvidia Corporation. Described as "low-cost and easy-to-assemble," the ventilators are expected to cost much less to build than other models on the market, making them a great option for medical professionals who have been working so hard to protect their patients. + +Developing [open source medications][11] may also provide vast benefits. Research and development of vaccines are taking practices perfected in the open source world of the Linux kernel and applying them to how medications are developed. The focus may help merit be more central to the process than profitability. The absence of patent and copyright restrictions are also noted to speed the process of discovery. + +### Retropie announces support for Raspberry Pi 4 + +Many of us are passing the time by playing games while we stay at home. If you’re into console gaming and nostalgia, [Retropie][12] gives Raspberry Pi enthusiasts a set of classic games to dig through. Last week the team behind the project is happy to announce [support for the latest Raspberry Pi 4][13] hardware [released 24 June 2019][14].   + +#### In other news + + * [Fedora 32 Linux Official Release][15] + * [Jitsi open source conferencing gaining interest][16] + * [Free Wayland Book Available][17] + * [Inkscape 1.0 Released][18] + + + +Thanks, as always, to Opensource.com staff members and [Correspondents][19] for their help this week. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/news-may-9 + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/weekly_news_roundup_tv.png?itok=tibLvjBd +[2]: https://opensource.com/article/20/5/pycon-covid-19 +[3]: https://www.redhat.com/en/summit +[4]: https://www.itworldcanada.com/article/over-80000-people-tune-into-virtual-red-hat-summit-crushing-last-years-record/430090?sc_cid=701f2000000u72aAAA +[5]: https://twitter.com/MishManners/status/1258232215814586369 +[6]: https://opensource.com/sites/default/files/uploads/stream_example.jpg (Example streaming for #DIDevOps) +[7]: https://desertedisland.club/about/ +[8]: https://desertedislanddevops.com/ +[9]: https://www.vice.com/en_us/article/z3bjga/this-tech-conference-is-being-held-on-an-animal-crossing-island +[10]: https://blogs.nvidia.com/blog/2020/05/01/low-cost-open-source-ventilator-nvidia-chief-scientist/ +[11]: https://www.fastcompany.com/90498448/how-open-source-medicine-could-prepare-us-for-the-next-pandemic +[12]: https://opensource.com/article/19/1/retropie +[13]: https://retropie.org.uk/2020/04/retropie-4-6-released-with-raspberry-pi-4-support/ +[14]: https://opensource.com/article/19/6/raspberry-pi-4 +[15]: https://fedoramagazine.org/announcing-fedora-32/ +[16]: https://joinup.ec.europa.eu/collection/open-source-observatory-osor/news/open-source-videoconferences +[17]: https://www.phoronix.com/scan.php?page=news_item&px=Wayland-Book-Free +[18]: https://inkscape.org/news/2020/05/04/introducing-inkscape-10/ +[19]: https://opensource.com/correspondent-program From 83601b12602323d27cdb7b858cd26e85b9d1eeb7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 10 May 2020 07:56:14 +0800 Subject: [PATCH 0668/1809] Rename sources/tech/20200509 The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news.md to sources/news/20200509 The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news.md --- ...etropie comes to Raspberry Pi 4, and other open source news.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200509 The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news.md (100%) diff --git a/sources/tech/20200509 The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news.md b/sources/news/20200509 The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news.md similarity index 100% rename from sources/tech/20200509 The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news.md rename to sources/news/20200509 The success of virtual conferences, Retropie comes to Raspberry Pi 4, and other open source news.md From 50f15bd0323ed00e9b0fc4443ff81534668cee57 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 10 May 2020 08:28:23 +0800 Subject: [PATCH 0669/1809] PRF @lxbwolf --- ...he Peer-to-peer Web With Beaker Browser.md | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/translated/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md b/translated/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md index 4a83f1435d..ef75d543f2 100644 --- a/translated/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md +++ b/translated/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md @@ -1,36 +1,38 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Browse the Peer-to-peer Web With Beaker Browser) [#]: via: (https://itsfoss.com/beaker-browser/) [#]: author: (John Paul https://itsfoss.com/author/john/) -使用 Beaker 浏览器浏览 P2P Web +使用 Beaker 浏览器浏览对等 Web ====== -我们所认识的因特网在过去 50 年中变化不大。全球的网民使用它们的设备从遍布在世界各地的服务器上检索数据。 +![](https://img.linux.net.cn/data/attachment/album/202005/10/082745ztmi4kqh4iq449ll.jpg) + +在过去 50 年中,我们所了解的互联网没有什么变化,全球的网民使用他们的设备从遍布在世界各地的服务器上检索数据。 一群专业的技术专家想改变现状,使互联网变成人们可以连接和直接分享信息的地方,而不是依赖一个中心服务器(去中心化)。 -我们已经在 It’s FOSS 讨论过很多这样的去中心化的服务。[YouTube 竞品:LBRY][1],[Twitter竞品:Mastodon][2] 是其中的两个例子。 +我们已经在 It’s FOSS 讨论过很多这样的去中心化的服务。[YouTube 竞品:LBRY][1]、[Twitter 竞品:Mastodon][2] 是其中的两个例子。 -今天我将要介绍另一个这样的产品,名为 [Beaker 浏览器][3],它的设计目标是浏览 P2P web 数据。 +今天我将要介绍另一个这样的产品,名为 [Beaker 浏览器][3],它的设计目标是浏览对等 Web。 ![Beaker Browser][4] -### ’peer-to-peer Web‘ 是什么? +### “对等 Web” 是什么? -根据 Beaker 浏览器的[开发者之一][5]的描述,”P2P Web 是一项实验性的技术...提高我们掌控 Web 的能力。“ +根据 Beaker 浏览器的[开发者之一][5]的描述,“对等 Web 是一项实验性的技术 ……旨在提高我们掌控 Web 的能力。” -还有,它们说 P2P Web 有三个主要原则:任何一点都可以成为服务器;多台计算机可以为同一个网站提供服务;没有后端。 +还有,他们说对等 Web 有三个主要原则:任何一点都可以成为服务器;多台计算机可以为同一个网站提供服务;没有后端。 -从这些原则中你可以看出,P2P Web 的思想与 BitTorrent 很像,多个点把文件作为种子,这些点共享带宽负载。这减少了一个用户需要提供给他的网站的总带宽。 +从这些原则中你可以看出,对等 Web 的思想与 BitTorrent 很像,文件由多个对端做种,这些对端共同承担带宽负载。这减少了一个用户需要提供给他们的网站的总带宽。 ![Beaker Browser Settings][6] -P2P Web 另一个重要的方面是创作者对于他们自己的想法的控制能力。当今年代,平台都是由庞大的组织控制的,往往拿你的数据为他们所用。Beaker 把数据的控制能力返还给了内容创造者。 +对等 Web 另一个重要的方面是创作者对于他们自己的想法的控制能力。当今年代,平台都是由庞大的组织控制的,往往拿你的数据为他们所用。Beaker 把数据的控制能力返还给了内容创造者。 ### 使用 Beaker 浏览去中心化的 web @@ -39,52 +41,50 @@ P2P Web 另一个重要的方面是创作者对于他们自己的想法的控制 Dat 协议的优势如下: * 快速 – 档案能立即从多个源同步。 - * 安全 – 所有的更新都是有签名和被完整检查的。 + * 安全 – 所有的更新都是有签名和经过完整性检查的。 * 灵活 – 可以在不修改档案 URL 的情况下迁移主机。 * 版本控制 – 每次修改都被写到只能追加的版本日志中。 * 去中心化 – 任何设备都可以作为承载档案的主机。 - - ![Beaker Browser Seeding][9] Beaker 浏览器本质上是阉割版的 Chromium,原生支持 `dat://` 地址,也可以访问普通的 `http://` 站点。 -每次访问一个 dat 站点,在你请求时该站点的内容才会下载到你的计算机。例如,只有在你浏览到站点的 about 页面时,才会下载该页面上的 Linux Torvalds 的图片。 +每次访问一个 dat 站点,在你请求时该站点的内容才会下载到你的计算机。例如,在一个站点上的 about 页面中有一张 Linux Torvalds 的图片,只有在你浏览到该站点的这个页面时,才会下载这张图片。 -当你浏览一个 dat 网站时,”[你暂时][10]重新上传或种下你从网站上下载的所有文件。“你也可以选择为网站做种来帮助创造者。 +此外,当你浏览一个 dat 网站时,“[你会短暂性的][10]重新上传或做种你从该网站上下载的所有文件。”你也可以选择为网站(主动)做种来帮助创造者。 ![Beaker Browser Menu][11] -由于 Beaker 的志向就是创建一个更开放的网络,因此你可以很容易地查看任何网站的源码。不像在大多数浏览器上你只能看到当前浏览的页面的源码那样,使用 Beaker 你能以类似 GitHub 的视图查看整个站点的结构。你甚至可以 fork 这个站点,自己维护。 +由于 Beaker 的志向就是创建一个更开放的网络,因此你可以很容易地查看任何网站的源码。不像在大多数浏览器上你只能看到当前浏览的页面的源码那样,使用 Beaker 你能以类似 GitHub 的视图查看整个站点的结构。你甚至可以复刻这个站点,并托管你自己的版本。 -除了浏览基于 dat 的网站外,你还可以创建自己的站点。在 Beaker 浏览器的菜单里,有创建新网站和创建空项目的选项。如果你选择了创建一个新网站,Beaker 会搭建一个小的 demo 站点,你可以使用浏览器里自带的编辑器来编辑。 +除了浏览基于 dat 的网站外,你还可以创建自己的站点。在 Beaker 浏览器的菜单里,有创建新网站或空项目的选项。如果你选择了创建一个新网站,Beaker 会搭建一个小的演示站点,你可以使用浏览器里自带的编辑器来编辑。 -然而,如果你像我一样更喜欢用 Markdown,你可以选择创建一个空项目。Beaker 会创建一个站点的结构,赋给它一个 `dat://` 地址。创建一个 `index.md` 文件后你就可以很好地工作了。里面有个[简短教程][12],你可以看到更多信息。你也可以用创建空项目的选项搭建一个 web app。 +然而,如果你像我一样更喜欢用 Markdown,你可以选择创建一个空项目。Beaker 会创建一个站点的结构,赋给它一个 `dat://` 地址。你只需要创建一个 `index.md` 文件后就行了。这有个[简短教程][12],你可以看到更多信息。你也可以用创建空项目的方式搭建一个 web 应用。 ![Beaker Browser Website Template][13] -由于 Beaker 的角色是个 web 服务器和站点播种者,当你关闭它或关机后你的站点就不可用了。幸运的是,你不必一直开着你的计算机或浏览器。你也可以使用名为 [Hashbase][14] 的播种服务或者你可以搭建一个 [`homebase`][15] 播种服务器。 +由于 Beaker 的角色是个 Web 服务器和站点做种者,当你关闭它或关机后你的站点就不可用了。幸运的是,你不必一直开着你的计算机或浏览器。你也可以使用名为 [Hashbase][14] 的做种服务或者你可以搭建一个 [homebase][15] 做种服务器。 -虽然 Beaker [适用于][16] Linux,Windows 和 macOS,但是在搞 Beaker 之前,还是要查阅下[各平台的教程][17]。 +虽然 Beaker [适用于][16] Linux、Windows 和 macOS,但是在使用 Beaker 之前,还是要查阅下[各平台的教程][17]。 -### Beaker 浏览器不是每个人都能用,但它有这个意图 +### Beaker 浏览器不是大众可用的,但它有这个意图 -当第一次被分配到这个任务时,我对 Beaker 浏览器有极高的热情。(但是)像它现在的地位一样,Beaker 浏览器仍是实验性的。我尝试浏览过的很多 dat 站点还不可用,因为用户并没有为站点做种。当站点恢复可用时 Beaker 确实可以选择通知你。 +当第一次接触到时,我对 Beaker 浏览器有极高的热情。(但是)如它现在的名字一样(烧杯),Beaker 浏览器仍是非常实验性的。我尝试浏览过的很多 dat 站点还不可用,因为用户并没有为站点做种。当站点恢复可用时 Beaker 确实可以选择通知你。 ![Beaker Browser No Peer][18] -另一个问题是,Beaker 是真正阉割版的 Chromium。不能安装扩展或主题。你只能使用白色主题和极少的工具集。我不会把 Beaker 浏览器作为常用浏览器,而且能访问 dat 网站并不是把它留在系统上的充分条件。 +另一个问题是,Beaker 是真正阉割版的 Chromium。它不能安装扩展或主题。你只能使用白色主题和极少的工具集。我不会把 Beaker 浏览器作为常用浏览器,而且能访问 dat 网站并不是把它留在系统上的充分条件。 我曾经寻找一个能支持 `dat://` 协议的 Firefox 扩展。我确实找到了这样一款扩展,但它需要安装一系列其他的软件。相比而言,安装 Beaker 比安装那些软件容易点。 -就像它现在的地位,Beaker 不适合我。也许在将来更多的人使用 Beaker 或者其他浏览器支持 dat 协议。那时会很有趣。目前而言,聊胜于无。 +就如它现在的名字一样,Beaker 不适合我。也许在将来更多的人使用 Beaker 或者其他浏览器支持 dat 协议。那时会很有趣。目前而言,聊胜于无。 在使用 Beaker 的时间里,我用内建的工具创建了一个[网站][19]。不要担心,我已经为它做种了。 ![Beaker Bowser Site Source][20] -你怎么看 Beaker 浏览器?你怎么看 P2P web?请尽情在下面评论。 +你怎么看 Beaker 浏览器?你怎么看对等 Web?请尽情在下面评论。 如果你觉得本文有意思,请花点时间把它分享到社交媒体,Hacker News 或 [Reddit][21]。 @@ -95,7 +95,7 @@ via: https://itsfoss.com/beaker-browser/ 作者:[John Paul][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 355b269580ae342dae6d8689da592614f34d4884 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 10 May 2020 08:31:14 +0800 Subject: [PATCH 0670/1809] PUB @lxbwolf https://linux.cn/article-12203-1.html --- ...0200505 Browse the Peer-to-peer Web With Beaker Browser.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200505 Browse the Peer-to-peer Web With Beaker Browser.md (99%) diff --git a/translated/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md b/published/20200505 Browse the Peer-to-peer Web With Beaker Browser.md similarity index 99% rename from translated/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md rename to published/20200505 Browse the Peer-to-peer Web With Beaker Browser.md index ef75d543f2..701d66156e 100644 --- a/translated/tech/20200505 Browse the Peer-to-peer Web With Beaker Browser.md +++ b/published/20200505 Browse the Peer-to-peer Web With Beaker Browser.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12203-1.html) [#]: subject: (Browse the Peer-to-peer Web With Beaker Browser) [#]: via: (https://itsfoss.com/beaker-browser/) [#]: author: (John Paul https://itsfoss.com/author/john/) From 3318f6f9e67755f311335a4aa1ea69f53ee47088 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 10 May 2020 16:14:54 +0800 Subject: [PATCH 0671/1809] APL --- ... introduction to the GNU Core Utilities - Opensource.com.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md b/sources/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md index aaa5a6ca00..5b4159d8c8 100644 --- a/sources/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md +++ b/sources/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md @@ -1,3 +1,4 @@ +wxy An introduction to the GNU Core Utilities ====== @@ -117,7 +118,7 @@ David Both \- David Both is a Linux and Open Source advocate who resides in Rale via: [https://opensource.com/article/18/4/gnu-core-utilities][17] -作者: [David Both][18] 选题者: [@lujun9972][19] 译者: [译者ID][20] 校对: [校对者ID][21] +作者: [David Both][18] 选题者: [lujun9972][19] 译者: [译者ID][20] 校对: [校对者ID][21] 本文由 [LCTT][22] 原创编译,[Linux中国][23] 荣誉推出 From a667d15e9a3493c9a6f29ea1e0dcd5642c0c7d6c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 10 May 2020 17:23:54 +0800 Subject: [PATCH 0672/1809] TSL&PRF --- ...the GNU Core Utilities - Opensource.com.md | 147 ------------------ ...the GNU Core Utilities - Opensource.com.md | 127 +++++++++++++++ 2 files changed, 127 insertions(+), 147 deletions(-) delete mode 100644 sources/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md create mode 100644 translated/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md diff --git a/sources/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md b/sources/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md deleted file mode 100644 index 5b4159d8c8..0000000000 --- a/sources/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md +++ /dev/null @@ -1,147 +0,0 @@ -wxy -An introduction to the GNU Core Utilities -====== - -![Introduction to the GNU Core Utilities](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/core-utils.jpg?itok=YTkmsnyy "Introduction to the GNU Core Utilities") - -Image credits :  - -[Bella67][1] via Pixabay. [CC0][2]. - -Two sets of utilities—the [GNU Core Utilities][3] and util-linux—comprise many of the Linux system administrator's most basic and regularly used tools. Their basic functions allow sysadmins to perform many of the tasks required to administer a Linux computer, including management and manipulation of text files, directories, data streams, storage media, process controls, filesystems, and much more. - -These tools are indispensable because, without them, it is impossible to accomplish any useful work on a Unix or Linux computer. Given their importance, let's examine them. - -### GNU coreutils - -The Linux Terminal - -* [Top 7 terminal emulators for Linux][4] -* [10 command-line tools for data analysis in Linux][5] -* [Download Now: SSH cheat sheet][6] -* [Advanced Linux commands cheat sheet][7] - -To understand the origins of the GNU Core Utilities, we need to take a short trip in the Wayback machine to the early days of Unix at Bell Labs. [Unix was written][8] so Ken Thompson, Dennis Ritchie, Doug McIlroy, and Joe Ossanna could continue with something they had started while working on a large multi-tasking and multi-user computer project called [Multics][9]. That little something was a game called Space Travel. As remains true today, it always seems to be the gamers who drive forward the technology of computing. This new operating system was much more limited than Multics, as only two users could log in at a time, so it was called Unics. This name was later changed to Unix. - -Over time, Unix turned out to be such a success that Bell Labs began essentially giving it away it to universities and later to companies for the cost of the media and shipping. Back in those days, system-level software was shared between organizations and programmers as they worked to achieve common goals within the context of system administration. - -Eventually, the [PHBs][10] at AT&T decided they should make money on Unix and started using more restrictive—and expensive—licensing. This was taking place at a time when software was becoming more proprietary, restricted, and closed. It was becoming impossible to share software with other users and organizations. - -Some people did not like this and fought it with free software. Richard M. Stallman, aka RMS, led a group of rebels who were trying to write an open and freely available operating system they called the GNU Operating System. This group created the GNU Utilities but didn't produce a viable kernel. - -When Linus Torvalds first wrote and compiled the Linux kernel, he needed a set of very basic system utilities to even begin to perform marginally useful work. The kernel does not provide commands or any type of command shell such as Bash. It is useless by itself. So, Linus used the freely available GNU Core Utilities and recompiled them for Linux. This gave him a complete, if quite basic, operating system. - -You can learn about all the individual programs that comprise the GNU Utilities by entering the command info coreutils at a terminal command line. The following list of the core utilities is part of that info page. The utilities are grouped by function to make specific ones easier to find; in the terminal, highlight the group you want more information on and press the Enter key. - -``` -* Output of entire files::       cat tac nl od base32 base64 -* Formatting file contents::     fmt pr fold -* Output of parts of files::     head tail split csplit -* Summarizing files::            wc sum cksum b2sum md5sum sha1sum sha2 -* Operating on sorted files::    sort shuf uniq comm ptx tsort -* Operating on fields::          cut paste join -* Operating on characters::      tr expand unexpand -* Directory listing::            ls dir vdir dircolors -* Basic operations::             cp dd install mv rm shred -* Special file types::           mkdir rmdir unlink mkfifo mknod ln link readlink -* Changing file attributes::     chgrp chmod chown touch -* Disk usage::                   df du stat sync truncate -* Printing text::                echo printf yes -* Conditions::                   false true test expr -* Redirection::                  tee -* File name manipulation::       dirname basename pathchk mktemp realpath -* Working context::              pwd stty printenv tty -* User information::             id logname whoami groups users who -* System context::               date arch nproc uname hostname hostid uptime -* SELinux context::              chcon runcon -* Modified command invocation::  chroot env nice nohup stdbuf timeout -* Process control::              kill -* Delaying::                     sleep -* Numeric operations::           factor numfmt seq -``` - -There are 102 utilities on this list. It covers many of the functions necessary to perform basic tasks on a Unix or Linux host. However, many basic utilities are missing. For example, the mount and umount commands are not in this list. Those and many of the other commands that are not in the GNU coreutils can be found in the util-linux collection. - -### util-linux - -The util-linix package of utilities contains many of the other common commands that sysadmins use. These utilities are distributed by the Linux Kernel Organization, and virtually every one of these 107 commands were originally three separate collections—fileutils, shellutils, and textutils—which were [combined into the single package][11] util-linux in 2003. - -``` -agetty          fsck.minix      mkfs.bfs        setpriv -blkdiscard      fsfreeze        mkfs.cramfs     setsid -blkid           fstab           mkfs.minix      setterm -blockdev        fstrim          mkswap          sfdisk -cal             getopt          more            su -cfdisk          hexdump         mount           sulogin -chcpu           hwclock         mountpoint      swaplabel -chfn            ionice          namei           swapoff -chrt            ipcmk           newgrp          swapon -chsh            ipcrm           nologin         switch_root -colcrt          ipcs            nsenter         tailf -col             isosize         partx           taskset -colrm           kill            pg              tunelp -column          last            pivot_root      ul -ctrlaltdel      ldattach        prlimit         umount -ddpart          line            raw             unshare -delpart         logger          readprofile     utmpdump -dmesg           login           rename          uuidd -eject           look            renice          uuidgen -fallocate       losetup         reset           vipw -fdformat        lsblk           resizepart      wall -fdisk           lscpu           rev             wdctl -findfs          lslocks         RTC Alarm       whereis -findmnt         lslogins        runuser         wipefs -flock           mcookie         script          write -fsck            mesg            scriptreplay    zramctl -fsck.cramfs     mkfs            setarch -``` - -Some of these utilities have been deprecated and will likely fall out of the collection at some point in the future. You should check [Wikipedia's util-linux page][12] for information on many of the utilities, and the man pages also provide details on the commands. - -### Summary - -These two collections of Linux utilities, the GNU Core Utilities and util-linux, together provide the basic utilities required to administer a Linux system. As I researched this article, I found several interesting utilities I never knew about. Many of these commands are seldom needed, but when you need them, they are indispensable. - -Between these two collections, there are over 200 Linux utilities. While Linux has many more commands, these are the ones needed to manage the basic functions of a typical Linux host. - -### About the author - -[![](https://opensource.com/sites/default/files/styles/profile_pictures/public/david-crop.jpg?itok=oePpOpyV)][13] - -David Both \- David Both is a Linux and Open Source advocate who resides in Raleigh, North Carolina. He has been in the IT industry for over forty years and taught OS/2 for IBM where he worked for over 20 years. While at IBM, he wrote the first training course for the original IBM PC in 1981. He has taught RHCE classes for Red Hat and has worked at MCI Worldcom, Cisco, and the State of North Carolina. He has been working with Linux and Open Source Software for almost 20 years. David has written articles for... [more about David Both][14] - -[More about me][15] - -* [Learn how you can contribute][16] - ---- - -via: [https://opensource.com/article/18/4/gnu-core-utilities][17] - -作者: [David Both][18] 选题者: [lujun9972][19] 译者: [译者ID][20] 校对: [校对者ID][21] - -本文由 [LCTT][22] 原创编译,[Linux中国][23] 荣誉推出 - -[1]: https://pixabay.com/en/tiny-people-core-apple-apple-half-700921/ -[2]: https://creativecommons.org/publicdomain/zero/1.0/ -[3]: https://www.gnu.org/software/coreutils/coreutils.html -[4]: https://opensource.com/life/17/10/top-terminal-emulators?intcmp=7016000000127cYAAQ -[5]: https://opensource.com/article/17/2/command-line-tools-data-analysis-linux?intcmp=7016000000127cYAAQ -[6]: https://opensource.com/downloads/advanced-ssh-cheat-sheet?intcmp=7016000000127cYAAQ -[7]: https://developers.redhat.com/cheat-sheet/advanced-linux-commands-cheatsheet?intcmp=7016000000127cYAAQ -[8]: https://en.wikipedia.org/wiki/History_of_Unix -[9]: https://en.wikipedia.org/wiki/Multics -[10]: https://en.wikipedia.org/wiki/Pointy-haired_Boss -[11]: https://en.wikipedia.org/wiki/GNU_Core_Utilities -[12]: https://en.wikipedia.org/wiki/Util-linux -[13]: https://opensource.com/users/dboth -[14]: https://opensource.com/users/dboth -[15]: https://opensource.com/users/dboth -[16]: https://opensource.com/participate -[17]: https://opensource.com/article/18/4/gnu-core-utilities -[18]: https://opensource.com/users/dboth -[19]: https://github.com/lujun9972 -[20]: https://github.com/译者ID -[21]: https://github.com/校对者ID -[22]: https://github.com/LCTT/TranslateProject -[23]: https://linux.cn/ diff --git a/translated/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md b/translated/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md new file mode 100644 index 0000000000..fe61c265f0 --- /dev/null +++ b/translated/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md @@ -0,0 +1,127 @@ +GNU 核心实用程序简介 +====== + +> 大多数 Linux 系统管理员需要做的事情都可以在 GNU coreutils 或 util-linux 中找到。 + +![](https://img.linux.net.cn/data/attachment/album/202005/10/172312hofgh88i3g6jajfj.jpg) + +许多 Linux 系统管理员最基本和常用的工具主要包括在两套实用程序中:[GNU 核心实用程序(coreutils)][3]和 util-linux。它们的基本功能允许系统管理员执行许多管理 Linux 系统的任务,包括管理和操作文本文件、目录、数据流、存储介质、进程控制、文件系统等等。 + +这些工具是不可缺少的,因为没有它们,就不可能在 Unix 或 Linux 计算机上完成任何有用的工作。鉴于它们的重要性,让我们来研究一下它们。 + +### GNU coreutils + +要了解 GNU 核心实用程序的起源,我们需要乘坐时光机进行一次短暂的旅行,回到贝尔实验室的 Unix 早期。[编写 Unix][8] 是为了让 Ken Thompson、Dennis Ritchie、Doug McIlroy 和 Joe Ossanna 可以继续他们在大型多任务和多用户计算机项目 [Multics][9] 上的工作:开发一个叫做《太空旅行》游戏的小东西。正如今天一样,推动计算技术发展的似乎总是游戏玩家。这个新的操作系统比 Multics(LCTT 译注:multi- 字头的意思是多数的)的局限性更大,因为一次只能有两个用户登录,所以被称为 Unics(LCTT 译注:uni- 字头的意思是单独的)。后来这个名字被改成了 Unix。 + +随着时间的推移,Unix 取得了如此巨大的成功,开始贝尔实验室基本上是将其赠送给大学,后来送给公司也只是收取介质和运输的费用。在那个年代,系统级的软件是在组织和程序员之间共享的,因为在系统管理这个层面,他们努力实现的是共同的目标。 + +最终,AT&T 公司的[老板们][10]决定,他们应该在 Unix 上赚钱,并开始使用限制更多的、昂贵的许可证。这发生在软件变得更加专有、受限和封闭的时期,从那时起,与其他用户和组织共享软件变得不可能。 + +有些人不喜欢这种情况,于是用自由软件来对抗。Richard M. Stallman(RMS),他带领着一群“反叛者”试图编写一个开放的、自由的可用操作系统,他们称之为 GNU 操作系统。这群人创建了 GNU 实用程序,但并没有产生一个可行的内核。 + +当 Linus Torvalds 开始编写和编译 Linux 内核时,他需要一套非常基本的系统实用程序来开始执行一些稍微有用的工作。内核并不提供命令或任何类型的命令 shell,比如 Bash,它本身是没有任何用处的,因此,Linus 使用了免费提供的 GNU 核心实用程序,并为 Linux 重新编译了它们。这让他拥有了一个完整的、即便是相当基本的操作系统。 + +你可以通过在终端命令行中输入命令 `info coreutils` 来了解 GNU 核心实用程序的全部内容。下面的核心实用程序列表就是这个信息页面的一部分。这些实用程序按功能进行了分组,以方便查找;在终端中,选择你想了解更多信息的组,然后按回车键。 + +``` +* Output of entire files::       cat tac nl od base32 base64 +* Formatting file contents::     fmt pr fold +* Output of parts of files::     head tail split csplit +* Summarizing files::            wc sum cksum b2sum md5sum sha1sum sha2 +* Operating on sorted files::    sort shuf uniq comm ptx tsort +* Operating on fields::          cut paste join +* Operating on characters::      tr expand unexpand +* Directory listing::            ls dir vdir dircolors +* Basic operations::             cp dd install mv rm shred +* Special file types::           mkdir rmdir unlink mkfifo mknod ln link readlink +* Changing file attributes::     chgrp chmod chown touch +* Disk usage::                   df du stat sync truncate +* Printing text::                echo printf yes +* Conditions::                   false true test expr +* Redirection::                  tee +* File name manipulation::       dirname basename pathchk mktemp realpath +* Working context::              pwd stty printenv tty +* User information::             id logname whoami groups users who +* System context::               date arch nproc uname hostname hostid uptime +* SELinux context::              chcon runcon +* Modified command invocation::  chroot env nice nohup stdbuf timeout +* Process control::              kill +* Delaying::                     sleep +* Numeric operations::           factor numfmt seq +``` + +这个列表里有 102 个实用程序。它涵盖了在 Unix 或 Linux 主机上执行基本任务所需的许多功能。但是,很多基本的实用程序都缺失了,例如,`mount` 和 `umount` 命令不在这个列表中。这些命令和其他许多不在 GNU 核心实用程序中的命令可以在 util-linux 中找到。 + +### util-linux + +util-linix 实用程序包中包含了许多系统管理员常用的其它命令。这些实用程序是由 Linux 内核组织发布的,这 107 条命令中几乎每一个都来自原本是三个单独的集合 —— fileutils、shellutils 和 textutils,2003 年它们被[合并成一个包][11]:util-linux。 + +``` +agetty          fsck.minix      mkfs.bfs        setpriv +blkdiscard      fsfreeze        mkfs.cramfs     setsid +blkid           fstab           mkfs.minix      setterm +blockdev        fstrim          mkswap          sfdisk +cal             getopt          more            su +cfdisk          hexdump         mount           sulogin +chcpu           hwclock         mountpoint      swaplabel +chfn            ionice          namei           swapoff +chrt            ipcmk           newgrp          swapon +chsh            ipcrm           nologin         switch_root +colcrt          ipcs            nsenter         tailf +col             isosize         partx           taskset +colrm           kill            pg              tunelp +column          last            pivot_root      ul +ctrlaltdel      ldattach        prlimit         umount +ddpart          line            raw             unshare +delpart         logger          readprofile     utmpdump +dmesg           login           rename          uuidd +eject           look            renice          uuidgen +fallocate       losetup         reset           vipw +fdformat        lsblk           resizepart      wall +fdisk           lscpu           rev             wdctl +findfs          lslocks         RTC Alarm       whereis +findmnt         lslogins        runuser         wipefs +flock           mcookie         script          write +fsck            mesg            scriptreplay    zramctl +fsck.cramfs     mkfs            setarch +``` + +这些实用程序中的一些已经被淘汰了,很可能在未来的某个时候会从集合中被踢出去。你应该看看[维基百科的 util-linux 页面][12]来了解其中许多实用程序的信息,而 man 页面也提供了关于这些命令的详细信息。 + +### 总结 + +这两个 Linux 实用程序的集合,GNU 核心实用程序和 util-linux,共同提供了管理 Linux 系统所需的基本实用程序。在研究这篇文章的过程中,我发现了几个有趣的实用程序,这些实用程序是我从不知道的。这些命令中的很多都是很少需要的,但当你需要的时候,它们是不可缺少的。 + +在这两个集合里,有 200 多个 Linux 实用工具。虽然 Linux 的命令还有很多,但这些都是管理一个典型的 Linux 主机的基本功能所需要的。 + +--- + +via: [https://opensource.com/article/18/4/gnu-core-utilities][17] + +作者: [David Both][18] 选题者: [lujun9972][19] 译者: [wxy][20] 校对: [wxy][21] + +本文由 [LCTT][22] 原创编译,[Linux中国][23] 荣誉推出 + +[1]: https://pixabay.com/en/tiny-people-core-apple-apple-half-700921/ +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.gnu.org/software/coreutils/coreutils.html +[4]: https://opensource.com/life/17/10/top-terminal-emulators?intcmp=7016000000127cYAAQ +[5]: https://opensource.com/article/17/2/command-line-tools-data-analysis-linux?intcmp=7016000000127cYAAQ +[6]: https://opensource.com/downloads/advanced-ssh-cheat-sheet?intcmp=7016000000127cYAAQ +[7]: https://developers.redhat.com/cheat-sheet/advanced-linux-commands-cheatsheet?intcmp=7016000000127cYAAQ +[8]: https://en.wikipedia.org/wiki/History_of_Unix +[9]: https://en.wikipedia.org/wiki/Multics +[10]: https://en.wikipedia.org/wiki/Pointy-haired_Boss +[11]: https://en.wikipedia.org/wiki/GNU_Core_Utilities +[12]: https://en.wikipedia.org/wiki/Util-linux +[13]: https://opensource.com/users/dboth +[14]: https://opensource.com/users/dboth +[15]: https://opensource.com/users/dboth +[16]: https://opensource.com/participate +[17]: https://opensource.com/article/18/4/gnu-core-utilities +[18]: https://opensource.com/users/dboth +[19]: https://github.com/lujun9972 +[20]: https://github.com/译者ID +[21]: https://github.com/校对者ID +[22]: https://github.com/LCTT/TranslateProject +[23]: https://linux.cn/ From 232bdb69c873cd5e88c493e267374fdbd8439102 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 10 May 2020 17:29:28 +0800 Subject: [PATCH 0673/1809] PUB @wxy https://linux.cn/article-12205-1.html --- ... An introduction to the GNU Core Utilities - Opensource.com.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180425 An introduction to the GNU Core Utilities - Opensource.com.md (100%) diff --git a/translated/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md b/published/20180425 An introduction to the GNU Core Utilities - Opensource.com.md similarity index 100% rename from translated/tech/20180425 An introduction to the GNU Core Utilities - Opensource.com.md rename to published/20180425 An introduction to the GNU Core Utilities - Opensource.com.md From 791e6d91e0f4c22901d91bd9d6ba3b23f48618af Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Sun, 10 May 2020 21:30:24 +0800 Subject: [PATCH 0674/1809] Translated. (#18405) * Translating. * Translating. * Translating. * Translating. * Translating. * Translating. * Translating. * Translating. * Checking. * Translated. --- ...00414 How I containerize a build system.md | 166 ------------------ ...00414 How I containerize a build system.md | 163 +++++++++++++++++ 2 files changed, 163 insertions(+), 166 deletions(-) delete mode 100644 sources/tech/20200414 How I containerize a build system.md create mode 100644 translated/tech/20200414 How I containerize a build system.md diff --git a/sources/tech/20200414 How I containerize a build system.md b/sources/tech/20200414 How I containerize a build system.md deleted file mode 100644 index 1271aa27af..0000000000 --- a/sources/tech/20200414 How I containerize a build system.md +++ /dev/null @@ -1,166 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (LazyWolfLin) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How I containerize a build system) -[#]: via: (https://opensource.com/article/20/4/how-containerize-build-system) -[#]: author: (Ravi Chandran https://opensource.com/users/ravichandran) - -How I containerize a build system -====== -Building a repeatable structure to deliver applications as containers -can be complicated. Here is one way to do it effectively. -![Containers on a ship on the ocean][1] - -A build system is comprised of the tools and processes used to transition from source code to a running application. This transition also involves changing the code's audience from the software developer to the end user, whether the end user is a colleague in operations or a deployment system. - -After creating a few build systems using containers, I think I have a decent, repeatable approach that's worth sharing. These build systems were used for generating loadable software images for embedded hardware and compiling machine learning algorithms, but the approach is abstract enough to be used in any container-based build system. - -This approach is about creating or organizing the build system in a way that makes it easy to use and maintain. It's not about the tricks needed to deal with containerizing any particular software compilers or tools. It applies to the common use case of software developers building software to hand off a maintainable image to other technical users (whether they are sysadmins, DevOps engineers, or some other title). The build system is abstracted away from the end users so that they can focus on the software. - -### Why containerize a build system? - -Creating a repeatable, container-based build system can provide a number of benefits to a software team: - - * **Focus:** I want to focus on writing my application. When I call a tool to "build," I want the toolset to deliver a ready-to-use binary. I don't want to spend time troubleshooting the build system. In fact, I'd rather not know or care about the build system. - * **Identical build behavior:** Whatever the use case, I want to ensure that the entire team uses the same versions of the toolset and gets the same results when building. Otherwise, I am constantly dealing with the case of "it works on my PC but not yours." Using the same toolset version and getting identical output for a given input source file set is critical in a team project. - * **Easy setup and future migration:** Even if a detailed set of instructions is given to everyone to install a toolset for a project, chances are someone will get it wrong. Or there could be issues due to how each person has customized their Linux environment. This can be further compounded by the use of different Linux distributions across the team (or other operating systems). The issues can get uglier quickly when it comes time for moving to the next version of the toolset. Using containers and the guidelines in this article will make migration to newer versions much easier. - - - -Containerizing the build systems that I use on my projects has certainly been valuable in my experience, as it has alleviated the problems above. I tend to use Docker for my container tooling, but there can still be issues due to the installation and network configuration being unique environment to environment, especially if you work in a corporate environment involving some complex proxy settings. But at least now I have fewer build system problems to deal with. - -### Walking through a containerized build system - -I created a [tutorial repository][2] you can clone and examine at a later time or follow along through this article. I'll be walking through all the files in the repository. The build system is deliberately trivial (it runs **gcc**) to keep the focus on the build system architecture. - -### Build system requirements - -Two key aspects that I think are desirable in a build system are: - - * **Standard build invocation:** I want to be able to build code by pointing to some work directory whose path is **/path/to/workdir**. I want to invoke the build as: [code]`./build.sh /path/to/workdir`[/code] To keep the example architecture simple (for the sake of explanation), I'll assume that the output is also generated somewhere within **/path/to/workdir**. (Otherwise, it would increase the number of volumes exposed to the container, which is not difficult, but more cumbersome to explain.) - * **Custom build invocation via shell:** Sometimes, the toolset needs to be used in unforeseen ways. In addition to the standard **build.sh** to invoke the toolset, some of these could be added as options to **build.sh**, if needed. But I always want to be able to get to a shell where I can invoke toolset commands directly. In this trivial example, say I sometimes want to try out different **gcc** optimization options to see the effects. To achieve this, I want to invoke: [code]`./shell.sh /path/to/workdir`[/code] This should get me to a Bash shell inside the container with access to the toolset and to my **workdir**, so I can experiment as I please with the toolset. - - - -### Build system architecture - -To comply with the basic requirements above, here is how I architect the build system: - -![Container build system architecture][3] - -At the bottom, the **workdir** represents any software source code that needs to be built by the software developer end users. Typically, this **workdir** will be a source-code repository. The end users can manipulate this source code repository in any way they want before invoking a build. For example, if they're using **git** for version control, they could **git checkout** the feature branch they are working on and add or modify files. This keeps the build system independent of the **workdir**. - -The three blocks at the top collectively represent the containerized build system. The left-most (yellow) block at the top represents the scripts (**build.sh** and **shell.sh**) that the end user will use to interact with the build system. - -In the middle (the red block) is the Dockerfile and the associated script **build_docker_image.sh**. The development operations people (me, in this case) will typically execute this script and generate the container image. (In fact, I'll execute this many, many times until I get everything working right, but that's another story.) And then I would distribute the image to the end users, such as through a container trusted registry. The end users will need this image. In addition, they will clone the build system repository (i.e., one that is equivalent to the [tutorial repository][2]). - -The **run_build.sh** script on the right is executed inside the container when the end user invokes either **build.sh** or **shell.sh**. I'll explain these scripts in detail next. The key here is that the end user does not need to know anything about the red or blue blocks or how a container works in order to use any of this. - -### Build system details - -The tutorial repository's file structure maps to this architecture. I've used this prototype structure for relatively complex build systems, so its simplicity is not a limitation in any way. Below, I've listed the tree structure of the relevant files from the repository. The **dockerize-tutorial** folder could be replaced with any other name corresponding to a build system. From within this folder, I invoke either **build.sh** or **shell.sh** with the one argument that is the path to the **workdir**. - - -``` -dockerize-tutorial/ -├── build.sh -├── shell.sh -└── swbuilder -    ├── build_docker_image.sh -    ├── install_swbuilder.dockerfile -    └── scripts -        └── run_build.sh -``` - -Note that I've deliberately excluded the **example_workdir** above, which you'll find in the tutorial repository. Actual source code would typically reside in a separate repository and not be part of the build tool repository; I included it in this repository, so I didn't have to deal with two repositories in the tutorial. - -Doing the tutorial is not necessary if you're only interested in the concepts, as I'll explain all the files. But if you want to follow along (and have Docker installed), first build the container image **swbuilder:v1** with: - - -``` -cd dockerize-tutorial/swbuilder/ -./build_docker_image.sh -docker image ls  # resulting image will be swbuilder:v1 -``` - -Then invoke **build.sh** as: - - -``` -cd dockerize-tutorial -./build.sh ~/repos/dockerize-tutorial/example_workdir -``` - -The code for [build.sh][4] is below. This script instantiates a container from the container image **swbuilder:v1**. It performs two volume mappings: one from the **example_workdir** folder to a volume inside the container at path **/workdir**, and the second from **dockerize-tutorial/swbuilder/scripts** outside the container to **/scripts** inside the container. - - -``` -docker container run                              \ -    --volume $(pwd)/swbuilder/scripts:/scripts    \ -    --volume $1:/workdir                          \ -    --user $(id -u ${USER}):$(id -g ${USER})      \ -    --rm -it --name build_swbuilder swbuilder:v1  \ -    build -``` - -In addition, the **build.sh** also invokes the container to run with your username (and group, which the tutorial assumes to be the same) so that you will not have issues with file permissions when accessing the generated build output. - -Note that [**shell.sh**][5] is identical except for two things: **build.sh** creates a container named **build_swbuilder** while **shell.sh** creates one named **shell_swbuilder**. This is so that there are no conflicts if either script is invoked while the other one is running. - -The other key difference between the two scripts is the last argument: **build.sh** passes in the argument **build** while **shell.sh** passes in the argument **shell**. If you look at the [Dockerfile][6] that is used to create the container image, the last line contains the following **ENTRYPOINT**. This means that the **docker container run** invocation above will result in executing the **run_build.sh** script with either **build** or **shell** as the sole input argument. - - -``` -# run bash script and process the input command -ENTRYPOINT [ "/bin/bash", "/scripts/run_build.sh"] -``` - -[**run_build.sh**][7] uses this input argument to either start the Bash shell or invoke **gcc** to perform the build of the trivial **helloworld.c** project. A real build system would typically invoke a Makefile and not run **gcc** directly. - - -``` -cd /workdir - -if [ $1 = "shell" ]; then     -    echo "Starting Bash Shell" -    /bin/bash -elif [ $1 = "build" ]; then -    echo "Performing SW Build" -    gcc helloworld.c -o helloworld -Wall -fi -``` - -You could certainly pass more than one argument if your use case demands it. For the build systems I've dealt with, the build is usually for a given project with a specific **make** invocation. In the case of a build system where the build invocation is complex, you can have **run_build.sh** call a specific script inside **workdir** that the end user has to write. - -### A note about the scripts folder - -You may be wondering why the **scripts** folder is located deep in the tree structure rather than at the top level of the repository. Either approach would work, but I didn't want to encourage the end user to poke around and change things there. Placing it deeper is a way to make it more difficult to poke around. Also, I could have added a **.dockerignore** file to ignore the **scripts** folder, as it doesn't need to be part of the container context. But since it's tiny, I didn't bother. - -### Simple yet flexible - -While the approach is simple, I've used it for a few rather different build systems and found it to be quite flexible. The aspects that are going to be relatively stable (e.g., a given toolset that changes only a few times a year) are fixed inside the container image. The aspects that are more fluid are kept outside the container image as scripts. This allows me to easily modify how the toolset is invoked by updating the script and pushing the changes to the build system repository. All the user needs to do is to pull the changes to their local build system repository, which is typically quite fast (unlike updating a Docker image). The structure lends itself to having as many volumes and scripts as are needed while abstracting the complexity away from the end user. - -How will you need to modify your application to optimize it for a containerized environment? - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/how-containerize-build-system - -作者:[Ravi Chandran][a] -选题:[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/ravichandran -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_2015-3-osdc-lead.png?itok=O6aivM_W (Containers on a ship on the ocean) -[2]: https://github.com/ravi-chandran/dockerize-tutorial -[3]: https://opensource.com/sites/default/files/uploads/build_sys_arch.jpg (Container build system architecture) -[4]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/build.sh -[5]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/shell.sh -[6]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/swbuilder/install_swbuilder.dockerfile -[7]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/swbuilder/scripts/run_build.sh diff --git a/translated/tech/20200414 How I containerize a build system.md b/translated/tech/20200414 How I containerize a build system.md new file mode 100644 index 0000000000..b7bc3f252c --- /dev/null +++ b/translated/tech/20200414 How I containerize a build system.md @@ -0,0 +1,163 @@ +[#]: collector: (lujun9972) +[#]: translator: (LazyWolfLin) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I containerize a build system) +[#]: via: (https://opensource.com/article/20/4/how-containerize-build-system) +[#]: author: (Ravi Chandran https://opensource.com/users/ravichandran) + +构建系统容器化指南 +====== +搭建一个通过容器分发应用的可复用系统可能很复杂,但这儿有个好方法。 +![Containers on a ship on the ocean][1] + +一个用于将源代码编译成可运行的应用的构建系统是由工具和流程共同组成。在编译过程中还涉及到代码从软件开发者流转到最终用户,无论最终用户是运维的同事还是部署的同事。 + +在使用容器搭建了一些构建系统后,我觉得有一个不错的可复用的方法值得分享。虽然这些构建系统被用于编译机器学习算法和为嵌入式硬件生成可加载的软件镜像上,但这个方法足够抽象,可用于任何基于容器的构建系统。 + +这个方法是关于通过简单和可维护的方式搭建或组织构建系统,但并不涉及处理特定编译器或工具容器化的技巧。它适用于软件开发人员构建软件并将可维护镜像交给其他技术人员(无论是系统管理员,运维工程师或者其他头衔)的常见情况。由于构建系统对于最终用户是透明的,因此他们能够专注于软件本身。 + +### 为什么要容器化构建系统? + +搭建基于容器的可复用构建系统可以为软件团队带来诸多好处: + + * **专注**:我希望专注于应用的开发。当我调用一个名为“build”的工具时,我希望这个工具集能生成一个随时可用的二进制文件。我不想浪费时间在构建系统的查错上。实际上,我宁愿不了解也不关心构建系统。 + * **一致的构建行为**:无论在哪种使用情况下,我都想确保整个团队使用相同版本的工具集并在构建时得到相同的结果。否则,我就得不断地处理“我这咋就是好的”的麻烦。在团队项目中,使用相同版本的工具集并对给定的输入源文件集产生一致的输出是非常重要。 + * **易于部署和升级**:即使向每个人都提供一套详细说明来为项目安装工具集,也可能会有人翻车。问题可能是由于每个人对自己的 Linux 环境的个性化修改导致的。在团队中使用不同的 Linux 发行版(或者其他操作系统),情况可能还会变得更复杂。当需要将工具集升级到下一版本时,问题很快就会变得更糟糕。使用容器和本指南将使得新版本升级非常简单。 + +我在项目中容器化构建系统的经验显然很有价值,因为它可以缓解上述问题。我倾向于使用 Docker 作为容器工具,虽然在相对特殊的环境中安装和网络配置仍可能出现问题,尤其是当你在一个使用复杂代理的企业环境中工作时。但至少现在我需要解决的构建系统问题已经很少了。 + +### 漫步容器化的构建系统 + +我创建了一个[教程存储库][2],随后你可以 clone 并检查它,或者按照本文内容进行操作。我将逐个介绍存储库中的文件。这个构建系统非常简单(它使用**gcc**)从而可以专注于构建系统结构上。 + +### 构建系统需求 + +我认为构建系统中有两个关键点: + + * **标准化构建调用**:我希望能够指定一些形如 **/path/to/workdir** 的工作目录来构建代码。我希望以如下形式调用构建: + + ./build.sh /path/to/workdir + + 为了使得示例的结构足够简单(以便说明),我将假定输出也在 **/path/to/workdir** 路径下的某处生成。(否则,将增加容器中显示的卷的数量,虽然这并不困难,但解释起来比较麻烦。) + * **通过 shell 自定义构建调用**:有时,工具集会以出乎意料的方式被调用。除了标准的工具集调用 **build.sh** 之外,如果需要还可以为 **build.sh** 添加一些选项。但我一直希望能够有一个可以直接调用工具集命令的 shell。在这个简单的示例中,有时我想尝试不同的 **gcc** 优化选项并查看效果。为此,我希望调用: + + ./shell.sh /path/to/workdir + + 这将让我得到一个容器内部的 Bash shell,并且可以调用工具集和访问我的**工作目录 workdir**,从而我可以根据需要尝试使用这个工具集。 + +### 构建系统架构 + +为了满足上述基本需求,这是我的构架系统架构: + +![Container build system architecture][3] + +在底部的 **workdir** 代表软件开发者用于构建的任意软件源码。通常,这个 **workdir** 是一个源代码的存储库。在构建之前,最终用户可以通过任何方式来操纵这个存储库。例如,如果他们使用 **git** 作为版本控制工具的话,可以使用 **git checkout** 切换到他们正在工作的功能分支上并添加或修改文件。这样可以使得构建系统独立于 **workdir** 之外。 + +顶部的三个模块共同代表了容器化的构建系统。最左边的黄色模块代表最终用户与构建系统交互的脚本(**build.sh** 和 **shell.sh**)。 + +在中间的红色模块是 Dockerfile 和相关的脚本 **build_docker_image.sh**。开发者(在这个例子中指我)通常将执行这个脚本并生成容器镜像(事实上我多次执行它直到一切正常为止,但这是另一个故事)。然后我将镜像分发给最终用户,例如通过 container trusted registry 进行分发。最终用户将需要这个镜像。另外,他们将 clone 构建系统存储库(即一个与[教程存储库][2]等效的存储库)。 + +当最终用户调用 **build.sh** 或者 **shell.sh** 时,容器内将执行右边的 **run_build.sh** 脚本。接下来我将详细解释这些脚本。这里的关键是最终用户不需要为了使用而去了解任何关于红色或者蓝色模块或者容器工作原理的知识。 + +### 构建系统细节 + +把教程存储库的文件结构映射到这个系统结构上。我曾将这个原型结构用于相对复杂构建系统,因此它的简单并不会造成任何限制。下面我列出存储库中相关文件的树结构。文件夹 **dockerize-tutorial** 能用构建系统的其他任何名称代替。在这个文件夹下,我用 **workdir** 的路径作参数调用 **build.sh** 或 **shell.sh**。 + +``` +dockerize-tutorial/ +├── build.sh +├── shell.sh +└── swbuilder +    ├── build_docker_image.sh +    ├── install_swbuilder.dockerfile +    └── scripts +        └── run_build.sh +``` + +请注意,我上面特意没列出 **example_workdir**,你能在教程存储库中找到。实际的源码通常存放在单独的存储库中,而不是构建工具库中的一部分;本教程为了不必处理两个存储库,所以我将它包含在这个存储库中。 + +如果你只对概念感兴趣,本教程并非必须的,因为我将解释所有文件。但是如果你继续本教程(并且已经安装 Docker),首先使用以下命令来构建容器镜像 **swbuilder:v1**: + +``` +cd dockerize-tutorial/swbuilder/ +./build_docker_image.sh +docker image ls  # resulting image will be swbuilder:v1 +``` + +然后调用 **build.sh**: + +``` +cd dockerize-tutorial +./build.sh ~/repos/dockerize-tutorial/example_workdir +``` + +下面是 [build.sh][4] 的代码。这个脚本从容器镜像 **swbuilder:v1** 实例化一个容器。而这个容器实例映射了两个卷:一个将文件夹 **example_workdir** 挂载到容器内部路径 **/workdir** 上,第二个则将容器外的文件夹 **dockerize-tutorial/swbuilder/scripts** 挂载到容器内部路径 **/scripts** 上。 + +``` +docker container run                              \ +    --volume $(pwd)/swbuilder/scripts:/scripts    \ +    --volume $1:/workdir                          \ +    --user $(id -u ${USER}):$(id -g ${USER})      \ +    --rm -it --name build_swbuilder swbuilder:v1  \ +    build +``` + +另外,**build.sh** 还会用你的用户名(以及组,本教程假设两者一致)去运行容器,以便在访问构建输出时不出现文件权限问题。 + +请注意,[**shell.sh**][5] 和 **build.sh** 大体上是一致的,除了两点不同:**build.sh** 会创建一个名为 **build_swbuilder** 的容器,而 **shell.sh** 则会创建一个名为 **shell_swbuilder** 的容器。这样一来,当其中一个脚本运行时另一个脚本被调用也不会产生冲突。 + +两个脚本之间的另一处关键不同则在于最后一个参数:**build.sh** 传入参数 **build** 而 **shell.sh** 则传入 **shell**。如果你看了用于构建容器镜像的 [Dockerfile][6],就会发现最后一行包含了下面的 **ENTRYPOINT** 语句。这意味着上面的 **docker container run** 调用将使用 **build** 或 **shell** 作为唯一的输入参数来执行 **run_build.sh** 脚本。 + +``` +# run bash script and process the input command +ENTRYPOINT [ "/bin/bash", "/scripts/run_build.sh"] +``` + +[**run_build.sh**][7] 使用这个输入参数来选择启动 Bash shell 还是调用 **gcc** 来构建 **helloworld.c** 项目。一个真正的构建系统通常会使用 Makefile 而非直接运行 **gcc**。 + +``` +cd /workdir + +if [ $1 = "shell" ]; then     +    echo "Starting Bash Shell" +    /bin/bash +elif [ $1 = "build" ]; then +    echo "Performing SW Build" +    gcc helloworld.c -o helloworld -Wall +fi +``` + +在使用时,如果你需要传入多个参数,当然也是可以的。我处理过的构建系统,构建通常是对给定的项目调用 **make**。如果一个构建系统有非常复杂的构建调用,则你可以让 **run_build.sh** 调用 **workdir** 下最终用户编写的特定脚本。 + +### 关于 scripts 文件夹的说明 + +你可能想知道为什么 **scripts** 文件夹位于目录树深处而不是位于存储库的顶层。两种方法都是可行的,但我不想鼓励最终用户到处乱翻并修改里面的脚本。将它放到更深的地方是一个让他们更难乱翻的方法。另外,我也可以添加一个 **.dockerignore** 文件去忽略 **scripts** 文件夹,因为它不是容器必需的部分。但因为它很小,所以我没有这样做。 + +### 简单而灵活 + +尽管这一方法很简单,但我将其用于某些非常特殊的构建系统时,发现它其实非常灵活。相对稳定的部分(例如,一年仅修改数次的给定工具集)被固定在容器镜像内。较为灵活的部分则以脚本的形式放在镜像外。这使我能够简单地通过修改脚本并将更改推送到构建系统存储库来修改调用工具集的方式。用户所需要做的是将更改拉到本地的构建系统存储库中,这通常是非常快的(与更新 Docker 镜像不同)。这种结构使其能够拥有尽可能多的卷和脚本,同时使最终用户摆脱复杂性。 + +你将如何修改你的应用来针对容器化环境进行优化呢? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/how-containerize-build-system + +作者:[Ravi Chandran][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/LazyWolfLin) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ravichandran +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_2015-3-osdc-lead.png?itok=O6aivM_W (Containers on a ship on the ocean) +[2]: https://github.com/ravi-chandran/dockerize-tutorial +[3]: https://opensource.com/sites/default/files/uploads/build_sys_arch.jpg (Container build system architecture) +[4]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/build.sh +[5]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/shell.sh +[6]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/swbuilder/install_swbuilder.dockerfile +[7]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/swbuilder/scripts/run_build.sh From 1e697f03270ae697cb3d3ddf55fd462d936825bd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 10 May 2020 22:07:54 +0800 Subject: [PATCH 0675/1809] PRF @geekpi --- ...rgerfs to increase your virtual storage.md | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/translated/tech/20200501 Using mergerfs to increase your virtual storage.md b/translated/tech/20200501 Using mergerfs to increase your virtual storage.md index 936ed454d9..24b851eca7 100644 --- a/translated/tech/20200501 Using mergerfs to increase your virtual storage.md +++ b/translated/tech/20200501 Using mergerfs to increase your virtual storage.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using mergerfs to increase your virtual storage) @@ -12,17 +12,15 @@ ![][1] -如果你想在一个媒体项目中用上多个磁盘或分区,而又不想丢失任何现有数据,但又想将所有文件都存放在一个驱动器下,该怎么办?这就是 mergefs 派上用场的地方! +如果你想在一个媒体项目中用到了多个磁盘或分区,不想丢失任何现有数据,但又想将所有文件都存放在一个驱动器下,该怎么办?这时,mergefs 就能派上用场! -[mergerfs][2] 是旨在简化跨多个商业存储设备文件的存储和管理的联合文件系统。 +[mergerfs][2] 是一个联合文件系统,旨在简化存储和管理众多商业存储设备上的文件。 -你需要从[这个][3] github 页面获取最新的 RPM。Fedora 的版本名称中带有 _**fc**_ 和版本号。例如,以下是 Fedora 31 的版本: - -[mergerfs-2.29.0-1.fc31.x86_64.rpm][4] +你需要从他们的 [GitHub][3] 页面获取最新的 RPM。Fedora 的版本名称中带有 “fc” 和版本号。例如,这是 Fedora 31 的版本: [mergerfs-2.29.0-1.fc31.x86_64.rpm][4]。 ### 安装和配置 mergefs -使用 sudo 安装已下载的 mergefs 软件包: +使用 `sudo` 安装已下载的 mergefs 软件包: ``` $ sudo dnf install mergerfs-2.29.0-1.fc31.x86_64.rpm @@ -47,7 +45,7 @@ total 2 -rw-rw-r--. 1 curt curt 0 Mar 8 17:21 Halloween hijinks.mkv ``` -在此例中挂载了两块磁盘,分别为 _disk1_ 和 _disk2_。两个驱动器都有一个包含文件的 _**Videos**_ 目录。 +在此例中挂载了两块磁盘,分别为 `disk1` 和 `disk2`。两个驱动器都有一个包含文件的 `Videos` 目录。 现在,我们将使用 mergefs 挂载这些驱动器,使它们看起来像一个更大的驱动器。 @@ -55,19 +53,17 @@ total 2 $ sudo mergerfs -o defaults,allow_other,use_ino,category.create=mfs,moveonenospc=true,minfreespace=1M /disk1:/disk2 /media ``` -mergefs 手册页非常广泛且复杂,因此我们将说明上面提到的选项。 - - * _defaults_:除非指定,否则将使用默认设置。 - * _allow_other_:允许 sudo 或 root 以外的用户查看文件系统。 - * _use_ino_:让 mergefs 提供文件/目录 inode 而不是 libfuse。虽然不是默认值,但建议你启用它,以便链接的文件共享相同的 inode 值。 - * _category.create=mfs_:根据可用空间在驱动器间传播文件。 - * _moveonenospc=true_:如果启用,那么如果写入失败,将进行扫描以查找具有最大可用空间的驱动器。 - * _minfreespace=1M_:最小使用空间值。 - * _disk1_:第一块硬盘。 - * _disk2_:第二块硬盘。 - * _/media_:挂载驱动器的目录。 - +mergefs 手册页非常庞杂,因此我们将说明上面提到的选项。 + * `defaults`:除非指定,否则将使用默认设置。 + * `allow_other`:允许 `sudo` 或 `root` 以外的用户查看文件系统。 + * `use_ino`:让 mergefs 提供文件/目录 inode 而不是 libfuse。虽然不是默认值,但建议你启用它,以便链接的文件共享相同的 inode 值。 + * `category.create=mfs`:根据可用空间在驱动器间传播文件。 + * `moveonenospc=true`:如果启用,那么如果写入失败,将进行扫描以查找具有最大可用空间的驱动器。 + * `minfreespace=1M`:最小使用空间值。 + * `disk1`:第一块硬盘。 + * `disk2`:第二块硬盘。 + * `/media`:挂载驱动器的目录。 看起来是这样的: @@ -84,7 +80,7 @@ $ df -hT | grep media 继续示例: -有一个叫 _Baby’s second Xmas.mkv_ 的 30M 视频。让我们将其复制到用 mergerfs 挂载的 _/media_ 文件夹中。 +有一个叫 `Baby's second Xmas.mkv` 的 30M 视频。让我们将其复制到用 mergerfs 挂载的 `/media` 文件夹中。 ``` $ ls -lh "Baby's second Xmas.mkv" @@ -103,7 +99,7 @@ $ df -hT | grep media 1:2 fuse.mergerfs 66M 31M 30M 51% /media ``` -从磁盘空间利用率中可以看到,因为 disk1 没有足够的可用空间,所以 mergefs 自动将文件复制到 disk2。 +从磁盘空间利用率中可以看到,因为 `disk1` 没有足够的可用空间,所以 mergefs 自动将文件复制到 `disk2`。 这是所有文件详情: @@ -135,7 +131,7 @@ via: https://fedoramagazine.org/using-mergerfs-to-increase-your-virtual-storage/ 作者:[Curt Warfield][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8ac77ea7f607be019e64d68afefb3b9ca9c4498e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 10 May 2020 22:08:20 +0800 Subject: [PATCH 0676/1809] PUB @geekpi https://linux.cn/article-12207-1.html --- ...0200501 Using mergerfs to increase your virtual storage.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200501 Using mergerfs to increase your virtual storage.md (98%) diff --git a/translated/tech/20200501 Using mergerfs to increase your virtual storage.md b/published/20200501 Using mergerfs to increase your virtual storage.md similarity index 98% rename from translated/tech/20200501 Using mergerfs to increase your virtual storage.md rename to published/20200501 Using mergerfs to increase your virtual storage.md index 24b851eca7..de9b8af2c7 100644 --- a/translated/tech/20200501 Using mergerfs to increase your virtual storage.md +++ b/published/20200501 Using mergerfs to increase your virtual storage.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12207-1.html) [#]: subject: (Using mergerfs to increase your virtual storage) [#]: via: (https://fedoramagazine.org/using-mergerfs-to-increase-your-virtual-storage/) [#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/) From 69366c195264f0bcdc9b13f5cfaa3d1a6d2f9e25 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Mon, 11 May 2020 00:11:45 +0800 Subject: [PATCH 0677/1809] TSL 20200506 Managing Git projects with submodules and subtrees --- ...t projects with submodules and subtrees.md | 212 ------------------ ...t projects with submodules and subtrees.md | 211 +++++++++++++++++ 2 files changed, 211 insertions(+), 212 deletions(-) delete mode 100644 sources/tech/20200506 Managing Git projects with submodules and subtrees.md create mode 100644 translated/tech/20200506 Managing Git projects with submodules and subtrees.md diff --git a/sources/tech/20200506 Managing Git projects with submodules and subtrees.md b/sources/tech/20200506 Managing Git projects with submodules and subtrees.md deleted file mode 100644 index 66f89ca545..0000000000 --- a/sources/tech/20200506 Managing Git projects with submodules and subtrees.md +++ /dev/null @@ -1,212 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Managing Git projects with submodules and subtrees) -[#]: via: (https://opensource.com/article/20/5/git-submodules-subtrees) -[#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) - -Managing Git projects with submodules and subtrees -====== -Submodules and subtrees help you manage child projects across multiple -repositories. -![Digital creative of a browser on the internet][1] - -If you are into open source development, you have probably worked with Git to manage source code. You might have come across projects with numerous dependencies and/or sub-projects. How do you manage them? - -For an open source organization, it can be tricky to achieve single-source documentation and dependency management for the community _and_ the product. The documentation and project often end up fragmented and redundant, which makes them difficult to maintain. - -### The need - -Suppose you want to use a single project as a child project inside a repository. The traditional method is just to copy the project to the parent repository. But, what if you want to use the same child project in many parent repositories? It wouldn't be feasible to copy the child project into every parent and have to make changes in all of them whenever you update it. This would create redundancy and inconsistency in the parent repositories and make it difficult to update and maintain the child project. - -### Git submodules and subtrees - -What if you could put one project within another using a single command? What if you could just add the project as a child to any number of projects and push changes on the go, whenever you want to? Git provides solutions for this: Git submodules and Git subtrees. These tools were created to support code-sharing development workflows on a more modular level, aspiring to bridge the gap between the Git repository's source-code management (SCM) and the sub-repos within it. - -![Cherry tree growing on a mulberry tree][2] - -Cherry tree growing on a mulberry tree - -This is a real-life scenario of the concepts this article will cover in detail. If you're already familiar with trees, here is what this model will look like: - -![Tree with subtrees][3] - -CC BY-SA opensource.com - -### What are Git submodules? - -Git provides submodules in its default package that enable Git repositories to be nested within other repositories. To be precise, the Git submodule points to a specific commit on the child repository. Here is what Git submodules look like in my [Docs-test][4] GitHub repo: - -![Git submodules screenshot][5] - -The format **[folder@commitId][6]** indicates that the repository is a submodule, and you can directly click on the folder to go to the child repository. The config file called **.gitmodules** contains all the submodule repository details. My repo's **.gitmodules** file looks like this: - -![Screenshot of .gitmodules file][7] - -You can use the following commands to use Git submodules in your repositories. - -#### Clone a repository and load submodules - -To clone a repository containing submodules: - - -``` -`$ git clone --recursive ` -``` - -If you have already cloned a repository and want to load its submodules: - - -``` -`$ git submodule update --init` -``` - -If there are nested submodules: - - -``` -`$ git submodule update --init --recursive` -``` - -#### Download submodules - -Downloading submodules sequentially can be a tedious task, so **clone** and **submodule update** will support the **\--jobs** or **-j** parameter. - -For example, to download eight submodules at once, use: - - -``` -$ git submodule update --init --recursive -j 8 -$ git clone --recursive --jobs 8 <URL to Git repo> -``` - -#### Pull submodules - -Before running or building the parent repository, you have to make sure that the child dependencies are up to date. - -To pull all changes in submodules: - - -``` -`$ git submodule update --remote` -``` - -#### Create repositories with submodules - -To add a child repository to a parent repository: - - -``` -`$ git submodule add ` -``` - -To initialize an existing Git submodule: - - -``` -`$ git submodule init` -``` - -You can also create branches and track commits in your submodules by adding **\--update** to your **submodule update** command: - - -``` -`$ git submodule update --remote` -``` - -#### Update submodule commits - -As explained above, a submodule is a link that points to a specific commit in the child repository. If you want to update the commit of the submodule, don't worry. You don't need to specify the latest commit explicitly. You can just use the general **submodule update** command: - - -``` -`$ git submodule update` -``` - -Just add and commit as you normally would to create and push the parent repository to GitHub. - -#### Delete a submodule from a parent repository - -Merely deleting a child project folder manually won't remove the child project from the parent repository. To delete a submodule named **childmodule**, use: - - -``` -`$ git rm -f childmodule` -``` - -Although Git submodules may appear easy to work with, it can be difficult for beginners to find their way around them. - -### What are Git subtrees? - -Git subtrees, introduced in Git 1.7.11, allow you to insert a copy of any repository as a subdirectory of another one. It is one of several ways Git projects can inject and manage project dependencies. It stores the external dependencies in regular commits. Git subtrees provide clean integration points, so they're easier to revert. - -If you use the [subtrees tutorial provided by GitHub][8] to use subtrees, you won't see a **.gittrees** config file in your local whenever you add a subtree. This makes it difficult to recognize subtrees because subtrees look like general folders, but they are copies of the child repository. The version of Git subtree with the **.gittrees** config file is not available with the default Git package, so to get the git-subtree with **.gittrees** config file, you must download git-subtree from the [**/contrib/subtree** folder][9] in the Git source repository. - -You can clone any repository containing subtrees, just like any other general repository, but it may take longer because entire copies of the child repository reside in the parent repository. - -You can use the following commands to use Git subtrees in your repositories. - -#### Add a subtree to a parent repository - -To add a new subtree to a parent repository, you first need to **remote add** it and then run the **subtree add** command, like: - - -``` -$ git remote add remote-name <URL to Git repo> -$ git subtree add --prefix=folder/ remote-name <URL to Git repo> subtree-branchname -``` - -This merges the whole child project's commit history to the parent repository. - -#### Push and pull changes to and from the subtree - - -``` -`$ git subtree push-all` -``` - -or - - -``` -`$ git subtree pull-all` -``` - -### Which should you use? - -Every tool has pros and cons. Here are some features that may help you decide which is best for your use case. - - * Git submodules have a smaller repository size since they are just links that point to a specific commit in the child project, whereas Git subtrees house the entire child project along with its history. - * Git submodules need to be accessible in a server, but subtrees are decentralized. - * Git submodules are mostly used in component-based development, whereas Git subtrees are used in system-based development. - - - -A Git subtree isn't a direct alternative to a Git submodule. There are certain caveats that guide where each can be used. If there is an external repository you own and are likely to push code back to, use Git submodule since it is easier to push. If you have third-party code that you are unlikely to push to, use Git subtree since it is easier to pull. - -Give Git subtrees and submodules a try and let me know how it goes in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/5/git-submodules-subtrees - -作者:[Manaswini Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/manaswinidas -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) -[2]: https://opensource.com/sites/default/files/uploads/640px-bialbero_di_casorzo.jpg (Cherry tree growing on a mulberry tree) -[3]: https://opensource.com/sites/default/files/subtree_0.png (Tree with subtrees) -[4]: https://github.com/manaswinidas/Docs-test/ -[5]: https://opensource.com/sites/default/files/uploads/git-submodules_github.png (Git submodules screenshot) -[6]: mailto:folder@commitId -[7]: https://opensource.com/sites/default/files/uploads/gitmodules.png (Screenshot of .gitmodules file) -[8]: https://help.github.com/en/github/using-git/about-git-subtree-merges -[9]: https://github.com/git/git/tree/master/contrib/subtree diff --git a/translated/tech/20200506 Managing Git projects with submodules and subtrees.md b/translated/tech/20200506 Managing Git projects with submodules and subtrees.md new file mode 100644 index 0000000000..a6902ac3b8 --- /dev/null +++ b/translated/tech/20200506 Managing Git projects with submodules and subtrees.md @@ -0,0 +1,211 @@ +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managing Git projects with submodules and subtrees) +[#]: via: (https://opensource.com/article/20/5/git-submodules-subtrees) +[#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) + +使用子模块和子仓库管理 Git 项目 +====== +使用子模块和子仓库来帮助你管理多个仓库中共有的子项目。 +![Digital creative of a browser on the internet][1] + +如果你参与了开源项目的开发,那么你可能会用 Git 来管理你的源码。你可能遇到过有很多依赖和/或子项目的项目。你怎么管理它们? + +对于一个开源组织,社区*和*产品想要实现单一来源文档和依赖管理比较棘手。文档和项目往往会碎片化和变得冗余,这致使它们很难维护。 + +### 必要性 + +假设你想要在一个仓库中把一个项目作为子项目来用。传统的方法是把该项目复制到父仓库中。但是,如果你想要在多个父项目中用同一个子项目呢?(如果)把子项目复制到所有父项目中,当有更新时,你不得不在每个父项目中都做修改,这是不太可行的。(因为)这会导致父项目中的冗余和数据不一致,也会使更新和维护子项目变得很困难。 + +### Git 子模块和子仓库 + +如果你可以用一条命令把一个项目放进另一个项目中,会怎样呢?如果你随时可以把一个项目作为子项目添加到任意数目的项目中,并可以同步更新修改呢?Git 提供了这类问题的解决方案:Git 子模块和 Git 子仓库。创建这些工具的目的是以更加模块化的水平来支持共用代码的开发工作流,(创建者)意在消除 Git 仓库源码管理source-code management与它下面的子仓库间的障碍。 + +![Cherry tree growing on a mulberry tree][2] + +生长在桑树上的樱桃树 + +下面是本文要详细介绍的概念的一个真实应用场景。如果你已经很熟悉 tree,这个模型看起来是下面这样: + +![Tree with subtrees][3] + +CC BY-SA opensource.com + +### Git 子模块是什么? + +Git 在它默认的包中提供了子模块,子模块可以把 Git 仓库嵌入到其他仓库中。确切地说,Git 子模块是指向子仓库中的某次提交。下面是我 [Docs-test][4] GitHub 仓库中的 Git 子模块: + +![Git submodules screenshot][5] + +**[文件夹@提交 Id][6]** 格式表明这个仓库是一个子模块,你可以直接点击文件夹进入该子仓库。名为 **.gitmodules** 的配置文件包含所有子模块仓库的详细信息。我的仓库的 **.gitmodules** 文件如下: + +![Screenshot of .gitmodules file][7] + +你可以用下面的命令在你的仓库中使用 Git 子模块: + +#### 克隆一个仓库并加载子模块 + +克隆一个含有子模块的仓库: + + +``` +`$ git clone --recursive ` +``` + +如果你之前已经克隆了仓库,现在想加载它的子模块: + + +``` +`$ git submodule update --init` +``` + +如果有嵌套的子模块: + + +``` +`$ git submodule update --init --recursive` +``` + +#### 下载子模块 + +串行地连续下载多个子模块是很枯燥的工作,所以 **clone** 和 **submodule update** 会支持 **\--jobs** 或 **-j** 参数: + +例如,想一次下载 8 个子模块,使用: + + +``` +$ git submodule update --init --recursive -j 8 +$ git clone --recursive --jobs 8 <URL to Git repo> +``` + +#### 拉取子模块 + +在运行或构建父项目之前,你需要确保依赖的子项目都是最新的。 + +拉取子模块的所有修改: + + +``` +`$ git submodule update --remote` +``` + +#### 使用 submodule 创建仓库: + +向一个父仓库添加子仓库: + + +``` +`$ git submodule add ` +``` + +初始化一个已存在的 Git 子模块: + + +``` +`$ git submodule init` +``` + +你也可以通过为 **submodule update** 命令添加 **\--update** 参数在子模块中创建分支和追踪提交: + + +``` +`$ git submodule update --remote` +``` + +#### 更新子模块提交 + +上面提到过,一个子模块就是一个指向子仓库中某次提交的链接。如果你想更新子模块的提交,不要担心。你不需要显式地指定最新的提交。你只需要使用通用的 **submodule update** 命令: + + +``` +`$ git submodule update` +``` + +就像你平时创建父仓库和把父仓库推送到 GitHub 那样添加和提交就可以了。 + +#### 从一个父仓库中删除一个子模块 + +仅仅手动删除一个子项目文件夹不会从父项目中移除这个子项目。想要删除名为 **childmodule** 的子模块,使用: + + +``` +`$ git rm -f childmodule` +``` + +虽然 Git 子模块看起来很容易上手,但是对于初学者来说,有一定的使用门槛。 + +### Git 子仓库是什么? + +Git 子仓库,是在 Git 1.7.11 引入的,让你可以把任何仓库的副本作为子目录嵌入另一个仓库中。它是 Git 项目可以注入和管理项目依赖的几种方法之一。它在常规的提交中保存了外部依赖信息。Git 子仓库提供了整洁的集成点,因此很容易复原它们。 + +如果你参考 [GitHub 提供的子仓库教程][8] 来使用子仓库,那么无论你什么时候添加子仓库,在本地都不会看到 **.gittrees** 配置文件。这让我们很难分辨哪个是子仓库,因为它们看起来很像普通的文件夹,但是它们却是子仓库的副本。默认的 Git 包中不提供带 **.gittrees** 配置文件的 Git 子仓库版本,因此如果你想要带 **.gittrees** 配置文件的 git-subtree,必须从 Git 源码仓库的 [**/contrib/subtree** 文件夹][9] 下载 git-subtree。 + +你可以像克隆其他常规的仓库那样克隆任何含有子仓库的仓库,但由于在父仓库中有整个子仓库的副本,因此克隆过程可能会持续很长时间。 + +你可以用下面的命令在你的仓库中使用 Git 子仓库。 + +#### 向父仓库中添加一个子仓库 + +想要向父仓库中添加一个子仓库,首先你需要执行 **remote add**,之后执行 **subtree add** 命令: + + +``` +$ git remote add remote-name <URL to Git repo> +$ git subtree add --prefix=folder/ remote-name <URL to Git repo> subtree-branchname +``` + +上面的命令会把整个子项目的提交历史合并到父仓库。 + +#### 向子仓库推送修改以及从子仓库拉取修改 + + +``` +`$ git subtree push-all` +``` + +或者 + + +``` +`$ git subtree pull-all` +``` + +### 你应该使用哪个? + +任何工具都有优缺点。下面是一些可能会帮助你决定哪种最适合你的特性: + + * Git 子模块的仓库占用空间更小,因为它们只是指向子项目的某次提交的链接,而 Git 子仓库保存了整个子项目及其提交历史。 + * Git 子模块需要在服务器中可访问,但子仓库是去中心化的。 + * Git 子模块大量用于基于组件的开发,而 Git 子仓库多用于基于系统的开发。 + + + +Git 子仓库并不是 Git 子模块的直接可替代项。有明确的说明来指导我们该使用哪种。如果有一个归属于你的外部仓库,使用场景是向它回推代码,那么就使用 Git 子模块,因为推送代码更容易。如果你有第三方代码,且不会向它推送代码,那么使用 Git 子仓库,因为拉取代码更容易。 + +自己尝试使用 Git 子仓库和子模块,然后在评论中留下你的使用感想。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/git-submodules-subtrees + +作者:[Manaswini Das][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/manaswinidas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://opensource.com/sites/default/files/uploads/640px-bialbero_di_casorzo.jpg (Cherry tree growing on a mulberry tree) +[3]: https://opensource.com/sites/default/files/subtree_0.png (Tree with subtrees) +[4]: https://github.com/manaswinidas/Docs-test/ +[5]: https://opensource.com/sites/default/files/uploads/git-submodules_github.png (Git submodules screenshot) +[6]: mailto:folder@commitId +[7]: https://opensource.com/sites/default/files/uploads/gitmodules.png (Screenshot of .gitmodules file) +[8]: https://help.github.com/en/github/using-git/about-git-subtree-merges +[9]: https://github.com/git/git/tree/master/contrib/subtree From 147eb6e5bb175c45ffb5c852982b1cbe57211a6f Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Mon, 11 May 2020 00:14:43 +0800 Subject: [PATCH 0678/1809] update --- ...200506 Managing Git projects with submodules and subtrees.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/translated/tech/20200506 Managing Git projects with submodules and subtrees.md b/translated/tech/20200506 Managing Git projects with submodules and subtrees.md index a6902ac3b8..a67f328d0c 100644 --- a/translated/tech/20200506 Managing Git projects with submodules and subtrees.md +++ b/translated/tech/20200506 Managing Git projects with submodules and subtrees.md @@ -181,8 +181,6 @@ $ git subtree add --prefix=folder/ remote-name <URL to Git repo> subtree-b * Git 子模块需要在服务器中可访问,但子仓库是去中心化的。 * Git 子模块大量用于基于组件的开发,而 Git 子仓库多用于基于系统的开发。 - - Git 子仓库并不是 Git 子模块的直接可替代项。有明确的说明来指导我们该使用哪种。如果有一个归属于你的外部仓库,使用场景是向它回推代码,那么就使用 Git 子模块,因为推送代码更容易。如果你有第三方代码,且不会向它推送代码,那么使用 Git 子仓库,因为拉取代码更容易。 自己尝试使用 Git 子仓库和子模块,然后在评论中留下你的使用感想。 From 6a4e47c17044d85f5f0b80b3c99da44da316ce4b Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Mon, 11 May 2020 00:36:01 +0800 Subject: [PATCH 0679/1809] APL --- ... Best Raspberry Pi Operating Systems for Various Purposes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md b/sources/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md index f4b09c9dbc..55c80a882a 100644 --- a/sources/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md +++ b/sources/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 15b9d60e87af0a7324d43143c28cb12d1ede4f3e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 11 May 2020 00:55:06 +0800 Subject: [PATCH 0680/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200511=20Can?= =?UTF-8?q?=E2=80=99t=20Install=20Deb=20File=20on=20Ubuntu=2020.04=3F=20He?= =?UTF-8?q?re=E2=80=99s=20What=20You=20Need=20to=20do!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md --- ...buntu 20.04- Here-s What You Need to do.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md diff --git a/sources/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md b/sources/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md new file mode 100644 index 0000000000..d5b106895b --- /dev/null +++ b/sources/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Can’t Install Deb File on Ubuntu 20.04? Here’s What You Need to do!) +[#]: via: (https://itsfoss.com/cant-install-deb-file-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Can’t Install Deb File on Ubuntu 20.04? Here’s What You Need to do! +====== + +_**Brief: Double clicking on the deb file doesn’t install it via the software center in Ubuntu 20.04? You are not the only one facing this issue. This tutorial shows how to fix it.**_ + +On the “[things to do after installing Ubuntu 20.04][1]” article, a few readers mentioned that they had trouble [installing software from the Deb file][2]. + +I found that strange because installing a program using the deb file is one of the simplest methods. All you have to do is to double click the downloaded file and it opens (by default) with the Software Center program. You click on install, it asks for your password and within a few seconds/minute, the software is installed. + +I had [upgraded to Ubuntu 20.04 from 19.10][3] and hadn’t faced this issue with it until today. + +I downloaded the .deb file for installing [Rocket Chat messenger][4] and when I double clicked on it to install this software, the file was opened with the archive manager. This is not what I expected. + +![DEB files opened with Archive Manager instead of Software Center][5] + +The “fix” is simple and I am going to show it to you in this quick tutorial. + +### Installing deb files in Ubuntu 20.04 + +For some reasons, the default software to open the deb file has been set to Archive Manager tool in Ubuntu 20.04. The Archive Manager tool is used for [extract zip][6] and other compressed files. + +The solution for this problem is pretty simple. You [change the default application in Ubuntu][7] for opening DEB files from Archive Manager to Software Install. Let me show you the steps. + +**Step 1:** Right click on the downloaded DEB file and select **Properties**: + +![][8] + +**Step 2:** Go to “**Open With**” tab, select “**Software Install**” app and click on “**Set as default**“. + +![][9] + +This way, all the deb files in the future will be opened with Software Install i.e. the software center applications. + +Confirm it by double clicking the DEB file and see if it open with the software center application or not. + +#### Ignorant bug or stupid feature? + +Why is deb files are supposed to be opened with Archive Manager is beyond comprehension. I do hope that this is a bug, not a weird feature like [not allowing drag and drop files on the desktop in Ubuntu 20.04][10]. + +Since we are discussing deb file installation, let me tell you about a nifty tool [gdebi][11]. It’s a lightweight application with the sole purpose of installing DEB file. Not always but some times, it can also handle the dependencies. + +You can learn more about [using gdebi and making it default for installing deb files here][12]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/cant-install-deb-file-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/ +[2]: https://itsfoss.com/install-deb-files-ubuntu/ +[3]: https://itsfoss.com/upgrade-ubuntu-version/ +[4]: https://rocket.chat/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/error-opening-deb-file.png?ssl=1 +[6]: https://itsfoss.com/unzip-linux/ +[7]: https://itsfoss.com/change-default-applications-ubuntu/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/open-deb-files.png?ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/deb-file-install-fix-ubuntu.png?fit=800%2C454&ssl=1 +[10]: https://itsfoss.com/add-files-on-desktop-ubuntu/ +[11]: https://launchpad.net/gdebi +[12]: https://itsfoss.com/gdebi-default-ubuntu-software-center/ From 217ea30828738e7dd5e297416f1e7f4f4c2ca49e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 11 May 2020 00:56:26 +0800 Subject: [PATCH 0681/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200509=20Ensm?= =?UTF-8?q?allening=20Go=20binaries=20by=20prohibiting=20comparisons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md --- ... Go binaries by prohibiting comparisons.md | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 sources/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md diff --git a/sources/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md b/sources/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md new file mode 100644 index 0000000000..61ad40c73e --- /dev/null +++ b/sources/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md @@ -0,0 +1,164 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ensmallening Go binaries by prohibiting comparisons) +[#]: via: (https://dave.cheney.net/2020/05/09/ensmallening-go-binaries-by-prohibiting-comparisons) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Ensmallening Go binaries by prohibiting comparisons +====== + +Conventional wisdom dictates that the larger the number of types declared in a Go program, the larger the resulting binary. Intuitively this makes sense, after all, what’s the point in defining a bunch of types if you’re not going to write code that operates on them. However, part of the job of a linker is to detect functions which are not referenced by a program–say they are part of a library of which only a subset of functionality is used–and remove them from the final output. Yet, the adage mo’ types, mo’ binary holds true for the majority of Go programs. + +In this post I’ll dig into what equality, in the context of a Go program, means and why changes [like this][1] have a measurable impact on the size of a Go program. + +### Defining equality between two values + +The Go spec defines the concepts of assignability and equality. Assignabiity is the act of assigning a value to an identifier. Not everything which is declared can be assigned, for example constants and functions. Equality is the act of comparing two identifies by asking _are their contents the same?_ + +Being a strongly typed language, the notion of sameness is fundamentally rooted in the identifier’s type. Two things can only be the same if they are of the same type. Beyond that, the type of the values defines how they are compared. + +For example, integers are compared arithmetically. For pointer types, equality is determining if the addresses they point too are the same. Reference types like maps and channels, like pointers, are considered to be the same if they have the same address. + +These are all examples of bitwise equality, that is, if the bit patterns of the memory that value occupies are the same, those values are equal. This is known as memcmp, short for memory comparison, as equality is defined by comparing the contents of two areas of memory. + +Hold on to this idea, I’ll come back to in a second. + +### Struct equality + +Beyond scalar types like integers, floats, and pointers is the realm of compound types; structs. All structs are laid out in memory in program order, thus this declaration: + +``` +type S struct { + a, b, c, d int64 +} +``` + +will consume 32 bytes of memory; 8 bytes for `a`, then 8 bytes for `b`, and so on. The spec says that _struct values are comparable if all their fields are comparable_. Thus two structs are equal iff each of their fields are equal. + +``` +a := S{1, 2, 3, 4} +b := S{1, 2, 3, 4} +fmt.Println(a == b) // prints true +``` + +Under the hood the compiler uses memcmp to compare the 32 bytes of `a` and `b`. + +### Padding and alignment + +However the simplistic bitwise comparison strategy will fail in situations like this: + +``` +type S struct { + a byte + b uint64 + c int16 + d uint32 +} + +func main() + a := S{1, 2, 3, 4} + b := S{1, 2, 3, 4} + fmt.Println(a == b) // prints true +} +``` + +The code compiles, the comparison is still true, but under the hood the compiler cannot rely on comparing the bit patterns of `a` and `b` because the structure contains _padding_. + +Go requires each field in a struct to be naturally aligned. 2 byte values must start on an even address, four byte values on an address divisible by 4, and so on[1][2]. The compiler inserts padding to ensure the fields are _aligned_ to according to their type and the underlying platform. In effect, after padding, this is what the compiler sees[2][3]: + +``` +type S struct { + a byte + _ [7]byte // padding + b uint64 + c int16 + _ [2]int16 // padding + d uint32 +} +``` + +Padding exists to ensure the correct field alignments, and while it does take up space in memory, the contents of those padding bytes are unknown. You might assume that, being Go, the padding bytes are always zero, but it turns out that’s not the case–the contents of padding bytes are simply not defined. Because they’re not defined to always be a certain value, doing a bitwise comparison may return false because the nine bytes of padding spread throughout the 24 bytes of `S` are may not be the same. + +The Go compiler solves this problem by generating what is known as an equality function. In this case `S`‘s equality function knows how to compare two values of type `S` by comparing only the fields in the function while skipping over the padding. + +### Type algorithms + +Phew, that was a lot of setup to illustrate why, for each type defined in a Go program, the compiler may generate several supporting functions, known inside the compiler as the type’s algorithms. In addition to the equality function the compiler will generate a hash function if the type is used as a map key. Like the equality function, the hash function must consider factors like padding when computing its result to ensure it remains stable. + +It turns out that it can be hard, and sometimes non obvious, to intuit when the compiler will generate these functions–it’s more than you’d expect–and it can be hard for the linker to eliminate the ones that are not needed as reflection often causes the linker to be more conservative when trimming types. + +### Reducing binary size by prohibiting comparisons + +Now we’re at a point to explain Brad’s change. By adding an incomparable field [3][4] to the type, the resulting struct is by extension incomparable, thus forcing the compiler to elide the generation of eq and hash algorithms, short circuiting the linkers elimination of those types and, in practice, reducing the size of the final binary. As an example of this technique, this program: + +``` +package main + +import "fmt" + +func main() { + type t struct { + // _ [0][]byte uncomment to prevent comparison + a byte + b uint16 + c int32 + d uint64 + } + var a t + fmt.Println(a) +} +``` + +when compiled with Go 1.14.2 (darwin/amd64), decreased from 2174088 to 2174056, a saving of 32 bytes. In isolation this 32 byte saving may seem like small beer, but consider that equality and hash functions can be generated for every type in the transitive closure of your program and all its dependencies, and the size of these functions varies depending on the size of the type and its complexity, prohibiting them can have a sizeable impact on the final binary over and above the old saw of `-ldflags="-s -w"`. + +The bottom line, if you don’t wish to make your types comparable, a hack like this enforces it at the source level while contributing to a small reduction in the size of your binary. + +* * * + +Addendum: thanks to Brad’s prodding, Go 1.15 already has a bunch of improvements by [Cherry Zhang][5] and [Keith Randall][6] that fix the most egregious of the failures to eliminate unnecessary equality and hash functions (although I suspect it was also to avoid the proliferation of this class of CLs). + + 1. On 32bit platforms `int64` and `uint64` values may not be 8 byte aligned as the natural alignment of the platform is 4 bytes. See [issue 599][7] for the gory details.[][8] + 2. 32 bit platforms would see `_ [3]byte` padding between the declaration of `a` and `b`. See previous.[][9] + 3. Brad used `[0]func()`, but any type that the spec limits or prohibits comparisons on will do. By declaring the array has zero elements the type has no impact on the size or alignment of the struct.[][10] + + + +#### Related posts: + + 1. [How the Go runtime implements maps efficiently (without generics)][11] + 2. [The empty struct][12] + 3. [Padding is hard][13] + 4. [Typed nils in Go 2][14] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2020/05/09/ensmallening-go-binaries-by-prohibiting-comparisons + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://github.com/golang/net/commit/e0ff5e5a1de5b859e2d48a2830d7933b3ab5b75f +[2]: tmp.uBLyaVR1Hm#easy-footnote-bottom-1-4116 (On 32bit platforms int64 and uint64 values may not be 8 byte aligned as the natural alignment of the platform is 4 bytes. See issue 599 for the gory details.) +[3]: tmp.uBLyaVR1Hm#easy-footnote-bottom-2-4116 (32 bit platforms would see _ [3]byte padding between the declaration of a and b. See previous.) +[4]: tmp.uBLyaVR1Hm#easy-footnote-bottom-3-4116 (Brad used [0]func(), but any type that the spec limits or prohibits comparisons on will do. By declaring the array has zero elements the type has no impact on the size or alignment of the struct.) +[5]: https://go-review.googlesource.com/c/go/+/231397 +[6]: https://go-review.googlesource.com/c/go/+/191198 +[7]: https://github.com/golang/go/issues/599 +[8]: tmp.uBLyaVR1Hm#easy-footnote-1-4116 +[9]: tmp.uBLyaVR1Hm#easy-footnote-2-4116 +[10]: tmp.uBLyaVR1Hm#easy-footnote-3-4116 +[11]: https://dave.cheney.net/2018/05/29/how-the-go-runtime-implements-maps-efficiently-without-generics (How the Go runtime implements maps efficiently (without generics)) +[12]: https://dave.cheney.net/2014/03/25/the-empty-struct (The empty struct) +[13]: https://dave.cheney.net/2015/10/09/padding-is-hard (Padding is hard) +[14]: https://dave.cheney.net/2017/08/09/typed-nils-in-go-2 (Typed nils in Go 2) From 74791ac8448d0bfe74d68dc43f9b3409e280c10b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 11 May 2020 00:57:08 +0800 Subject: [PATCH 0682/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200510=20Open?= =?UTF-8?q?=20source=20underpins=20coronavirus=20IoT=20and=20robotics=20so?= =?UTF-8?q?lutions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200510 Open source underpins coronavirus IoT and robotics solutions.md --- ... coronavirus IoT and robotics solutions.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20200510 Open source underpins coronavirus IoT and robotics solutions.md diff --git a/sources/tech/20200510 Open source underpins coronavirus IoT and robotics solutions.md b/sources/tech/20200510 Open source underpins coronavirus IoT and robotics solutions.md new file mode 100644 index 0000000000..5ce9ce0a1f --- /dev/null +++ b/sources/tech/20200510 Open source underpins coronavirus IoT and robotics solutions.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open source underpins coronavirus IoT and robotics solutions) +[#]: via: (https://opensource.com/article/20/5/robotics-covid19) +[#]: author: (Sam Bocetta https://opensource.com/users/sambocetta) + +Open source underpins coronavirus IoT and robotics solutions +====== +From sanitization of equipment and facilities to plotting the spread of +the virus, robots are playing an active role in combating COVID-19. +![Three giant robots and a person][1] + +The tech sector is quietly having a boom during the COVID-19 pandemic. Open source developers are getting involved with many aspects of the fight against the coronavirus, [using Python to visualize its spread][2] and helping to repurpose data acquisition systems to perform contact tracing. + +However, one of the most exciting areas of current research is the use of robotics to contain the spread of the coronavirus. In the last few weeks, robots have been deployed in critical environments—particularly in hospitals and on airplanes—to help staff sterilize surfaces and objects. + +Most of these robots are produced by tech startups, who have seen an opportunity to prove the worth of their proprietary systems. Many of them, however, rely on [open source cloud and IoT tools][3] that have been developed by the open source community. + +In this article, we'll take a look at how robotics are being used to fight the disease, the IoT infrastructure that underpins these systems, and finally, the security and privacy concerns that their increased use is highlighting. + +### Robots and COVID-19 + +Around the world, robots are being deployed to help the fight against COVID-19. The most direct use of robots has been in healthcare facilities, and China has taken the lead when it comes to deploying robots in hospitals. + +For example, a field hospital that recently opened in Wuhan—where the virus originated—is [making extensive use of robots][4] to help healthcare workers care for patients. Some of these robots provide food, drink, and medicine to patients, and others are used to clean parts of the hospital. + +Other companies, such as the Texas startup Xenex Disinfection Services, are using robots and UV light to deactivate viruses, bacteria, and spores on surfaces in airports. Still others, like Dimer UVC Innovations, are focusing on making robots that can [improve aircraft hygiene][5]. + +Not all of the "robots" deployed against the disease are anthropomorphic, though. The same field hospital in Wuhan that is using human-like robots is also making extensive use of less obviously "robotic" IoT devices. + +Patients entering the hospital are screened by networked 5G thermometers to alert staff for anyone showing a high fever, and patients wear smart bracelets and rings equipped with sensors. These are synced with CloudMinds' AI platform, and patients' vital signs, including temperature, heart rate, and blood oxygen levels, can be monitored. + +### Robots and the IoT + +Even when these robots appear to be independent entities, they make [extensive use of the IoT][6]. In other words, although patients may feel that they are being cared for by a robot that can make its own decisions, in reality, these robots are controlled by large, distributed sensing and data processing systems. + +Although many of the robots being deployed are the proprietary property of the tech firms who produce their hardware, their functioning is based on an ecosystem of software that is largely open source. + +This observation is an important one because it overturns one of the primary misconceptions about the [way that AI is used today][7][,][7] whether in a healthcare setting or elsewhere. Most research into robotics today does not seek to embed fully intelligent AI systems into robots themselves but, instead, uses centralized AI systems to control a wide variety of far less "smart" IoT devices. + +This observation, in turn, highlights two key points about the robots currently being developed and used to fight COVID-19. One is that they rely on a software ecosystem—much of it open source—that has been developed in a truly collaborative process involving thousands of engineers. The second is that the networked nature of these robots makes them vulnerable to exploitation. + +### Security and privacy + +This vulnerability to cybersecurity threats has led some analysts to raise questions about the wisdom of widespread deployment of IoT-driven robotics, whether in the healthcare system or anywhere else. Spyware in the IoT [remains a huge problem][8], and some fear that by integrating IoT systems into healthcare, we may be exposing more data—and more sensitive data—to intruders. + +Even where developers are careful to build security into these devices, the sheer number of components they rely on makes DevSecOps processes difficult to implement. Especially in this current time of crisis, many software engineers have been forced to accelerate the release of new components, and this could lead to them being vulnerable. If a company is rushing to bring a healthcare robot onto the market in response to COVID-19, it's unlikely that the open source code that these devices run on will be [properly audited][9]. + +And even if companies are able to maintain the integrity of their DevSecOps processes while still accelerating development, it's far from certain that patients themselves understand the privacy implications of delegating their care to IoT devices. Many lack the open source privacy tools [necessary to keep their data private][10] when browsing the internet, let alone those that should be deployed to protect sensitive healthcare data. + +### The future + +In short, the deployment of robots in the fight against COVID-19 is highlighting long-standing concerns about the integrity, security, and privacy of IoT systems more generally. Professionals in this field have long argued that [IoT audits][11] and [embedded Linux systems][12] should be the standard for IoT development, but in the current crisis, their warnings are likely to be ignored. + +This is worrying because it's likely that IoT systems will be increasingly used in healthcare in the coming decade. So whilst the COVID-19 pandemic will provide a proof of their utility in this sector, it should also not be used as an excuse to roll out poorly secured, poorly audited IoT software in highly sensitive environments. + +Open source isn’t just changing the way we interact with the world, it’s changing the way the world... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/robotics-covid19 + +作者:[Sam Bocetta][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sambocetta +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_robots.png?itok=TOZgajrd (Three giant robots and a person) +[2]: https://opensource.com/article/20/4/python-data-covid-19 +[3]: https://opensource.com/article/18/7/digital-transformation-strategy-think-cloud +[4]: https://www.cnbc.com/2020/03/18/how-china-is-using-robots-and-telemedicine-to-combat-the-coronavirus.html +[5]: https://www.therobotreport.com/company-offers-germ-killing-robot-to-airports-to-address-coronavirus-outbreak/ +[6]: https://www.cloudwards.net/what-is-the-internet-of-things/ +[7]: https://opensource.com/article/17/3/5-big-ways-ai-rapidly-invading-our-lives +[8]: https://blog.eccouncil.org/spyware-in-the-iot-what-does-it-mean-for-your-online-privacy/ +[9]: https://opensource.com/article/17/10/doc-audits +[10]: https://privacyaustralia.net/privacy-tools/ +[11]: https://opensource.com/article/19/11/how-many-iot-devices +[12]: https://opensource.com/article/17/3/embedded-linux-iot-ecosystem From 6c086fa8afdd2c955587eaf47c2d14eeba5ac6a7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 11 May 2020 08:42:30 +0800 Subject: [PATCH 0683/1809] translated --- ...fce With KDE Plasma Desktop Environment.md | 71 ------------------- ...fce With KDE Plasma Desktop Environment.md | 71 +++++++++++++++++++ 2 files changed, 71 insertions(+), 71 deletions(-) delete mode 100644 sources/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md create mode 100644 translated/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md diff --git a/sources/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md b/sources/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md deleted file mode 100644 index 61c2007784..0000000000 --- a/sources/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment) -[#]: via: (https://itsfoss.com/ubuntu-studio-opts-for-kde/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment -====== - -[Ubuntu Studio][1] is a popular [official flavour of Ubuntu][2] tailored for creative content creators involved in audio production, video, graphics, photography, and book publishing. It offers a lot of multimedia content creation applications out of the box with the best possible experience. - -After the recent 20.04 LTS release, the Ubuntu Studio team highlighted something very important in their [official announcement][3]. And, probably not everyone noticed the key information i.e Ubuntu Studio’s future. - -Ubuntu Studio 20.04 will be the last version to ship with the [Xfce desktop environment][4]. All the future releases will be using [KDE Plasma][5] instead. - -### Why is Ubuntu Studio ditching XFCE? - -![][6] - -As per their clarification, Ubuntu Studio isn’t focused on any particular look/feel but aims to provide the best user experience possible. And, KDE proves to be a better option. - -> Plasma has proven to have better tools for graphics artists and photographers, as can be seen in Gwenview, Krita, and even the file manager Dolphin. Additionally, it has Wacom tablet support better than any other desktop environment. - -> It has become so good that the majority of the Ubuntu Studio team is now using Kubuntu with Ubuntu Studio added-on via Ubuntu Studio Installer as their daily driver. With so many of us using Plasma, the timing just seems right to focus on a transition to Plasma with our next release. - -Of course every desktop environment has been tailored for something different. And, here, they think that KDE Plasma will be the most suitable desktop environment replacing XFCE to provide a better user experience to all the users. - -While I’m not sure how the users will react to this as every user has a different set of preferences. If the existing users won’t have a problem with KDE, it isn’t going to be a big deal. - -It is worth noting that Ubuntu Studio also mentioned why KDE is potentially a superior choice for them: - -> The Plasma desktop environment has, without Akonadi, become just as light in resource usage as Xfce, perhaps even lighter. Other audio-focused Linux distributions, such as Fedora Jam and KXStudio, have historically used the KDE Plasma desktop environment and done well with the audio. - -Also, they’ve highlighted [an article by Jason Evangelho at Forbes][7] where some benchmarks reveal that KDE is almost as light as Xfce. Even though that’s a good sign – we still have to wait for the users to test-drive the KDE-powered Ubuntu Studio. Only then we’ll be able to observe whether Ubuntu Studio’s decision to ditch XFCE desktop environment was the right thing to do. - -### What will change for Ubuntu Studio users after this change? - -The overall workflow may get affected (or improve) moving forward with KDE on Ubuntu Studio 20.10 and later. - -However, the upgrade process (from 20.04 to 20.10) will result in broken systems. So, a fresh install of Ubuntu Studio 20.10 or later versions will be the only way to go. - -They’ve also mentioned that they will be constantly evaluating for any duplication with the pre-installed apps. So, I believe more details will follow in the coming days. - -Ubuntu Studio is second distribution that has changed its main desktop environment in recent times. Earlier, [Lubuntu][8] switched to LXQt from LXDE. - -What do you think about this change? Feel free to share your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-studio-opts-for-kde/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://ubuntustudio.org/ -[2]: https://itsfoss.com/which-ubuntu-install/ -[3]: https://ubuntustudio.org/2020/04/ubuntu-studio-20-04-lts-released/ -[4]: https://xfce.org -[5]: https://kde.org/plasma-desktop -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-studio-kde-xfce.jpg?ssl=1 -[7]: https://www.forbes.com/sites/jasonevangelho/2019/10/23/bold-prediction-kde-will-steal-the-lightweight-linux-desktop-crown-in-2020 -[8]: https://itsfoss.com/lubuntu-20-04-review/ diff --git a/translated/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md b/translated/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md new file mode 100644 index 0000000000..1b9d4bb57a --- /dev/null +++ b/translated/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment) +[#]: via: (https://itsfoss.com/ubuntu-studio-opts-for-kde/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Ubuntu Studio 将用 KDE Plasma 桌面环境替换 Xfce +====== + +[Ubuntu Studio][1] 是一个流行的 [Ubuntu 官方变种][2],它是为从事音频制作、视频、图形、摄影和书籍出版的创意内容创建者量身定制的。它提供了许多拥有良好体验的开箱即用的多媒体内容创建应用。 + +在最近的 20.04 LTS 版本发布之后,Ubuntu Studio 团队在其[官方公告][3]中强调了一些非常重要的内容。而且,也许不是每个人都注意到关键信息,即 Ubuntu Studio 的未来。 + +Ubuntu Studio 20.04 将是带有 [Xfce 桌面环境][4]的最后一个版本。将来的所有发行版都将改用 [KDE Plasma][5]。 + +### 为什么 Ubuntu Studio 放弃 XFCE? + +![][6] + +据他们的澄清,Ubuntu Studio 并不致力于任何特定的外观,而是致力于提供最佳的用户体验。同时,KDE 被证明是一个更好的选择。 + +> Plasma 已被证明为图形艺术家和摄影师提供了更好的工具,例如在 Gwenview、Krita 甚至文件管理器 Dolphin 中都可以看到。此外,它对 Wacom 平板的支持比其他任何桌面环境都更好。 + +> 它已经变得不错,以至于大多数 Ubuntu Studio 团队现在都使用 Kubuntu,并通过 Ubuntu Studio Installer 将 Ubuntu Studio 作为日常附加驱动使用。由于我们中的许多人都在使用 Plasma,因此在我们的下一个版本中过渡到 Plasma 的时机似乎是正确的。 + +当然,每个桌面环境都针对不同的内容进行了量身定制。他们认为 KDE Plasma 将是取代 XFCE 的最适合的桌面环境,从而为所有用户提供更好的用户体验。 + +尽管我不确定用户对此会有何反应,因为每个用户都有不同的偏好。如果现有用户对 KDE 没有问题,那就没什么大不了的。 + +值得注意的是,Ubuntu Studio 还提到了为什么 KDE 可能是它们的更好选择: + +>在没有 Akonadi 的情况下,Plasma 桌面环境的资源使用与 Xfce 一样轻,甚至更轻。Fedora Jam 和 KXStudio 等其他以音频为重点的 Linux 发行版在历史上一直使用 KDE Plasma 桌面环境,并且在音频方面做得很好。 + +此外,他们还强调了[福布斯杂志中 Jason Evangelho 的文章][7],其中一些基准测试表明 KDE 几乎与 Xfce 一样轻。即使这是一个好征兆,我们仍然必须等待用户测试 KDE 驱动的 Ubuntu Studio。只有这样,我们才能观察 Ubuntu Studio 放弃 XFCE 桌面环境的决定是否正确。 + +### 更改后,Ubuntu Studio 用户将发生什么变化? + +在带 KDE 的 Ubuntu Studio 20.10 及更高版本上可能会影响(或改进)整个工作流程。 + +但是,升级过程(从 20.04 到 20.10)将导致系统损坏。因此,全新安装 Ubuntu Studio 20.10 或更高版本将是唯一的方法。 + +他们还提到,他们将不断评估与预安装的应用是否存在重复。因此,我相信在接下来的几天中将会有更多细节。 + +Ubuntu Studio 是最近第二个切换它主要桌面环境的发行版。先前,[Lubuntu] [8] 从 LXDE 切换到 LXQt。 + +你如何看待这种变化?欢迎在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-studio-opts-for-kde/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://ubuntustudio.org/ +[2]: https://itsfoss.com/which-ubuntu-install/ +[3]: https://ubuntustudio.org/2020/04/ubuntu-studio-20-04-lts-released/ +[4]: https://xfce.org +[5]: https://kde.org/plasma-desktop +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-studio-kde-xfce.jpg?ssl=1 +[7]: https://www.forbes.com/sites/jasonevangelho/2019/10/23/bold-prediction-kde-will-steal-the-lightweight-linux-desktop-crown-in-2020 +[8]: https://itsfoss.com/lubuntu-20-04-review/ From 11a1541e07790331c73bad8177b6b0b4d7996db6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 11 May 2020 08:48:20 +0800 Subject: [PATCH 0684/1809] translating --- ...etting started with FreeBSD as a desktop operating system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200508 Getting started with FreeBSD as a desktop operating system.md b/sources/tech/20200508 Getting started with FreeBSD as a desktop operating system.md index 0ce2dc4e32..2f1be1e803 100644 --- a/sources/tech/20200508 Getting started with FreeBSD as a desktop operating system.md +++ b/sources/tech/20200508 Getting started with FreeBSD as a desktop operating system.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 27acd36c548ab38b720fe293ff28beb5f985cea4 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Mon, 11 May 2020 21:42:52 +0800 Subject: [PATCH 0685/1809] TSL 20200404 Best Raspberry Pi Operating Systems for Various Purposes --- ... Operating Systems for Various Purposes.md | 296 ------------------ ... Operating Systems for Various Purposes.md | 296 ++++++++++++++++++ 2 files changed, 296 insertions(+), 296 deletions(-) delete mode 100644 sources/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md create mode 100644 translated/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md diff --git a/sources/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md b/sources/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md deleted file mode 100644 index 55c80a882a..0000000000 --- a/sources/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md +++ /dev/null @@ -1,296 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Best Raspberry Pi Operating Systems for Various Purposes) -[#]: via: (https://itsfoss.com/raspberry-pi-os/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Best Raspberry Pi Operating Systems for Various Purposes -====== - -[Raspberry Pi][1] is an indispensable single-board computer that comes in handy for a lot of work. Don’t believe me? Just [go through this list of Raspberry Pi projects][2] to get a gist of what this tiny device is capable of. - -Considering how useful a Raspberry Pi is – it is an important task to choose the right operating system for it. Of course, you can do a lot of things with Linux but an OS specially configured for a specific purpose can save you considerable time and effort. - -So, in this article, I will be mentioning some of the popular and useful operating systems tailored for Raspberry Pi. - -### Installing any OS on Raspberry Pi is really easy thanks to the Raspberry Pi Imager tool - -[Installing a Raspberry PI operating system on an SD card][3] is easier than ever before. You can simply get the [Raspberry Pi Imager][4] and get any Raspberry Pi OS installed quickly. Check the official video to see how easy it is. - -You may also utilize [NOOBS][5] (New Out Of the Box Software) to easily install different operating systems on Raspberry Pi. You might also get a pre-installed SD card from the list of their supported retailers mentioned in their [official NOOBS download page][5]. - -Feel free to explore more about installing the operating systems in their [official documentation][6]. - -[Raspberry Pi OS Download][4] - -Now that you know how to install it (and where to get it from), let me highlight a list of useful Raspberry Pi OS to help you out. - -### Various operating systems for Raspberry Pi - -Please keep in mind that I have taken some effort to list only those Raspberry Pi operating system projects that are being actively maintained. If a project gets discontinued in near future, let me know in the comment section and I’ll update this article. - -Another thing is that I have focused on the latest Raspberry 4 but this should not be considered a list of Raspberry Pi 4 OS. You should be able to use it on Raspberry Pi 3, 3 B+ and other variants as well but please check the official project websites for the exact details. - -**Note:** The list is in no particular order of ranking. - -#### 1\. Raspbian OS: The official Raspberry Pi OS - -![][7] - -Raspbian is the officially supported OS for Raspberry Pi boards. It comes baked in with several tools for education, programming, and general use. Specifically, it includes Python, Scratch, Sonic Pi, Java, and several other important packages. - -Originally, Raspbian is based on Debian and comes pre-installed with loads of useful packages. So, when you get this installed, you probably don’t need to install essentials separately – you should find almost everything pre-installed. - -Raspbian OS is actively maintained and it is one of the most popular Raspberry Pi OS out there. You can install it using [NOOBS][5] or follow the [official documentation][6] to get it installed. - -[Raspbian OS][8] - -#### 2\. Ubuntu MATE: For general purpose computing - -![][9] - -Even though Raspbian is the officially supported OS, it does not feature the latest and greatest packages. So, if you want quicker updates and potentially latest packages, you can try Ubuntu MATE for Raspberry Pi. - -Ubuntu MATE tailored as a Raspberry Pi OS is an incredibly lightweight distribution to have installed. It’s also popularly used on [NVIDIA’s Jetson Nano][10]. In other words, you can utilize it for several use-cases with the Raspberry Pi. - -To help you out, we also have a detailed guide on [how to install Ubuntu MATE on Raspberry Pi][11]. - -[Ubuntu MATE for Raspberry Pi][12] - -#### 3\. Ubuntu Server: To use it as a Linux server - -![][13] - -If you’re planning to use your Raspberry Pi as some sort of server for your project, Ubuntu Server can be a great choice to have installed. - -You can find both 32-bit and 64-bit images of the OS. And, depending on what board you have (if it supports 64-bit), you can go ahead and install the same. - -However, it is worth noting that Ubuntu Server isn’t tailored for desktop usage. So, you need to keep in mind that you will have no proper graphical user interface installed by default. - -[Ubuntu Server][14] - -#### 4\. LibreELEC: For media server - -![][15] - -While we already have a list of [media server software available for Linux][16], LibreELEC is one of them. - -It’s a great lightweight OS system capable enough to have [KODI][17] on your Raspberry Pi. You can try installing it using the Raspberry Pi Imager. - -You can easily head to their [official download webpage][18] and find a suitable installer image for your board. - -[LibreELEC][19] - -#### 5\. OSMC: For media server - -![][20] - -OSMC is yet another [popular media server software][16] for Linux. While considering the use of Raspberry Pi boards as media center devices, this is one of the best Raspberry Pi OS that you can recommend to someone. - -Similar to LibreELEC, OSMC also runs KODI to help you manage your media files and enjoy watching the content you already have. - -OSMC does not officially mention the support for **Raspberry Pi 4**. So, if you have Raspberry Pi 3 or lower, you should be good to go. - -[OSMC][21] - -#### 6\. RISC OS: The original ARM OS - -![][22] - -Originally crafted for ARM devices, RISC OS has been around for almost 30 years or so. - -We also have a separate detailed article on [RISC OS][23], if you’re curious to know more about it. Long story short, RISC OS is also tailored for modern ARM-based single-board computers like the Raspberry Pi. It presents a simple user interface with a focus on performance. - -Again, this is not something meant for the Raspberry Pi 4. So, only if you have a Raspberry Pi 3 or lower, you can give it a try. - -[RISC OS][24] - -#### 7\. Mozilla WebThings Gateway: For IoT projects - -![][25] - -As part of Mozilla’s [open-source implementation for IoT devices][26], WebThings Gateway lets you monitor and control all your connected IoT devices. - -You can follow the [official documentation][27] to check the requirements and the instructions to get it installed on a Raspberry Pi. Definitely, one of the most useful Raspberry Pi OS for IoT applications. - -[WebThings Gateway][28] - -#### 8\. Ubuntu Core: For IoT projects - -Yet another Raspberry Pi OS for potential [IoT][29] applications or just to simply test snaps – Ubuntu Core. - -Ubuntu core is specifically tailored for IoT devices or specifically Raspberry Pi, here. I wouldn’t make any claims about it- but Ubuntu Core is a suitable secure OS for Raspberry Pi boards. You can give this a try for yourself! - -[Ubuntu Core][30] - -#### 9\. DietPi: Lightweight Raspberry Pi OS - -![DietPi Screenshot via Distrowatch][31] - -DietPi is a lightweight [Debian][32] operating system that also claims to be lighter than the “Raspbian Lite” OS. - -While considering it as a lightweight Raspberry Pi OS, it offers a lot of features that could come in handy for several use-cases. Ranging from easy installers for software packages to a backup solution, there’s a lot to explore. - -If you’re aiming to get an OS with a low footprint but potentially better performance, you could give this a try. - -[DietPi][33] - -#### 10\. Lakka Linux: Make a retro gaming console - -![][34] - -Looking for a way to turn your Raspberry Pi to a retro gaming console? - -Lakka Linux distribution is originally built on the RetroArch emulator. So, you can have all your retro games on your Raspberry Pi in no time. - -We also have a separate article on [Lakka Linux][35] – if you’re curious to know about it. Or else, just go right ahead and test it out! - -[Lakka][36] - -#### 11\. RetroPie: For retro gaming - -![ ][37] - -RetroPie is yet another popular Raspberry Pi OS that turns it into a retro gaming console. It features several configuration tools so that you can customize the theme or just tweak the emulator to have the best retro games. - -It is worth noting that it does not include any copyrighted games. You can give it a try and see how it works! - -[RetroPie][38] - -#### 12\. Kali Linux: For hacking on budget - -![][39] - -Want to try and learn some ethical hacking skills on your Raspberry Pi? Kali Linux can be a perfect fit for it. And, yes, it usually supports the latest Raspberry Pi as soon as it launches. - -Not just limited to Raspberry Pi, but you can get a long list of other supported devices as well. Try it out and have fun! - -[Kali Linux][40] - -#### 13\. OpenMediaVault: For Network Attached Storage (NAS) - -![][41] - -If you’re trying to set up a [NAS][42] (Network Attached Storage) solution on minimal hardware, Raspberry Pi can help. - -Originally, based on Debian Linux, OpenMediaVault offers a bunch of features that include web-based administration capabilities, plugin support, and more. It does support most of the Raspberry Pi models – so you can try downloading it and get it installed! - -[OpenMediaVault][43] - -#### 14\. ROKOS: For crypto mining - -![][44] - -If you’re someone who’s interested in cryptocurrencies and bitcoins specifically, this could interest you. - -ROKOS is a Debian-based OS that basically lets you turn your Raspberry Pi into a node while having pre-installed drivers and packages for the same. Of course, you need to know how it works before getting it installed. So, I suggest you do some research if you’re not sure what you’re doing. - -[ROKOS][45] - -#### 15\. Alpine Linux: Lightweight security-focused Linux - -Nowadays, a lot of users are usually looking for security-focused and [privacy-focused distributions][46]. And, if you are one of them, you might as well try Alpine Linux for Raspberry Pi. - -It may not be as user-friendly as you’d expect (or beginner-friendly) if you’re just getting started with Raspberry Pi. But, if you want something different to start with, you can try Alpine Linux, which is a security-focused Linux distribution. - -[Alpine Linux][47] - -#### 16\. Kano OS: Operating system for kids’education - -![][48] - -If you’re looking for an open-source OS for Raspberry Pi to make things interesting to learn and educate kids, Kano OS is a good choice. - -It’s being actively maintained and the user experience for the desktop integration on Kano OS is quite simple and fun for someone to play and make kids learn from it. - -[Kano OS][49] - -#### 17\. KDE Plasma Bigscreen: To convert regular TVs into Smart TVs - -![][50] - -This is an under development project from KDE. With [KDE Plasma Bigscreen OS][51] installed on Raspberry Pi, you can use your regular TV like a smart TV. - -You don’t need a special remote to control the TV. You can use the regular remote control. - -Plasma Bigscreen also integrates [MyCroft open source AI][52] for voice control. - -The project is in beta phase so expect some bugs and issues if you are willing to give it a try. - -[Plasma Bigscreen][53] - -#### Wrapping Up - -I’m sure there are a lot of other operating systems tailored for Raspberry Pi – but I’ve tried to list the most popular or the useful ones that are actively maintained. - -If you think I missed one of best suited Raspberry Pi OS, feel free to let me know about it in the comments below! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/raspberry-pi-os/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://www.raspberrypi.org/ -[2]: https://itsfoss.com/raspberry-pi-projects/ -[3]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ -[4]: https://www.raspberrypi.org/downloads/ -[5]: https://www.raspberrypi.org/downloads/noobs/ -[6]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/raspbian_home_screen.jpg?resize=800%2C492&ssl=1 -[8]: https://www.raspbian.org/ -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Desktop-ubuntu.jpg?resize=800%2C600&ssl=1 -[10]: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-nano/ -[11]: https://itsfoss.com/ubuntu-mate-raspberry-pi/ -[12]: https://ubuntu-mate.org/raspberry-pi/ -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/ubunt-server.png?ssl=1 -[14]: https://ubuntu.com/download/raspberry-pi -[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/libreelec.jpg?resize=800%2C600&ssl=1 -[16]: https://itsfoss.com/best-linux-media-server/ -[17]: https://kodi.tv/ -[18]: https://libreelec.tv/downloads_new/ -[19]: https://libreelec.tv/ -[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/osmc-server.jpg?resize=800%2C450&ssl=1 -[21]: https://osmc.tv/ -[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/10/riscos5.1.jpg?resize=800%2C600&ssl=1 -[23]: https://itsfoss.com/risc-os-is-now-open-source/ -[24]: https://www.riscosopen.org/content/ -[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/web-things-gateway.png?ssl=1 -[26]: https://iot.mozilla.org/about/ -[27]: https://iot.mozilla.org/docs/gateway-getting-started-guide.html -[28]: https://iot.mozilla.org/gateway/ -[29]: https://en.wikipedia.org/wiki/Internet_of_things -[30]: https://ubuntu.com/download/raspberry-pi-core -[31]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/diet-pi.jpg?ssl=1 -[32]: https://www.debian.org/ -[33]: https://dietpi.com/ -[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/08/lakkaos.jpg?resize=1024%2C640&ssl=1 -[35]: https://itsfoss.com/lakka-retrogaming-linux/ -[36]: http://www.lakka.tv/ -[37]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/retro-pie.png?ssl=1 -[38]: https://retropie.org.uk/ -[39]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/kali-linux-pi.png?ssl=1 -[40]: https://www.offensive-security.com/kali-linux-arm-images/ -[41]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/openmediavault.jpg?ssl=1 -[42]: https://en.wikipedia.org/wiki/Network-attached_storage -[43]: https://www.openmediavault.org/ -[44]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rocos-bitcoin-pi.jpg?ssl=1 -[45]: https://rokos.space/ -[46]: https://itsfoss.com/privacy-focused-linux-distributions/ -[47]: https://alpinelinux.org/ -[48]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/kano-os-pi.jpeg?ssl=1 -[49]: https://kano.me/row/downloadable -[50]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/plasma-bigscreen-menu.jpg?ssl=1 -[51]: https://itsfoss.com/kde-plasma-bigscreen/ -[52]: https://itsfoss.com/mycroft-mark-2/ -[53]: https://plasma-bigscreen.org/#download-jumpto diff --git a/translated/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md b/translated/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md new file mode 100644 index 0000000000..f5fcff875b --- /dev/null +++ b/translated/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md @@ -0,0 +1,296 @@ +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Best Raspberry Pi Operating Systems for Various Purposes) +[#]: via: (https://itsfoss.com/raspberry-pi-os/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +不同需求下各自最适合的树莓派操作系统 +====== + +[树莓派][1] 是一种具有很多功能且使用便捷的不可或缺的卡片式计算机。不相信?那就[浏览下这个树莓派项目列表][2],来领会下这个小设备能做什么。 + +考虑到树莓派用途这么多,为它选择一个合适的操作系统就极其重要。当然,你可以用 Linux 做很多事,但是一个为某个目的特意配置的操作系统可以节省你大量的时间和精力。 + +因此,本文中我要介绍一些专门为树莓派量身定制的流行和有用的操作系统。 + +### 由于有树莓派镜像工具,安装任何操作系统到树莓派上都很容易 + +[把树莓派操作系统安装到 SD 卡上][3] 比以前容易得多。你可以很容易地下载[树莓派镜像][4]和很快地安装树莓派操作系统。看一下官方视频,你就知道有多简单。 + +你也可以使用 [NOOBS][5](New Out Of the Box Software)来很容易地安装不同的操作系统到树莓派上。你还可以从 [NOOBS官方下载页面][5] 提及的他们支持的零售商那里获取预先安装好系统的 SD 卡。 + +尽情去他们的[官方文档][6]里找更多关于安装操作系统的信息吧。 + +[下载树莓派操作系统][4] + +现在你知道了怎么安装它(以及从哪儿获取),让我来重点介绍下几个有用的树莓派操作系统来帮助你。 + +### 适用于树莓派的不同操作系统 + +请注意,我花了一些精力来筛选出那些被积极维护的树莓派操作系统项目。如果某个项目在不久的将来会停止维护,请在评论区告诉我,我会更新本文。 + +另一件事是,我关注到现在最新的版本是 Raspberry 4,但是下面的列表不应被认为是适 Raspberry 4 的操作系统列表。这些系统应该能用于树莓派 3、3B+ 和其他各种版本,但是请参照项目的官方网站核对详细信息。 + +**注意:** 排名不分先后。 + +#### 1\. Raspbian OS:官方的树莓派操作系统 + +![][7] + +Raspbian 是官方支持的树莓派板操作系统。它集成了很多工具,用于教育、编程以及其他广泛的用途。特别地,它包含 Python、Scratch、Sonic Pi、Java和一些其他的很重要的包。 + +最初,Raspbian 是基于 Debian 的,系统中预安装了很多有用的包。因此,当你安装 Raspbian 后,你可能就不需要特意安装基本工具了 — 你会发现大部分工具已经提前安装好了。 + +Raspbian OS 是被积极地维护着的,它也是最流行的树莓派操作系统之一。你可以使用 [NOOBS][5] 或参照[官方文档][6]来安装它。 + +[Raspbian OS][8] + +#### 2\. Ubuntu MATE:适合通用计算需求 + +![][9] + +虽然 Raspbian 是官方支持的操作系统,但是对于最新和最好的包它往往不能及时支持。因此,如果你想更新得更快并且在将来想用最新的包,你可以试试树莓派版本的 Ubuntu MATE。 + +树莓派定制版的 Ubuntu MATE 是很适合安装的不可思议的轻量级发行版本。它还被广泛用于 [NVIDIA 的 Jetson Nano][10]。换言之,你可以在树莓派的很多场景下使用它。 + +为了更好地帮助你,我们还有一份详细的教程:[怎样在树莓派上安装 Ubuntu MATE][11]。 + +[Ubuntu MATE for Raspberry Pi][12] + +#### 3\. Ubuntu Server:把树莓派作为一台 Linux 服务器来使用 + +![][13] + +如果你计划把你的树莓派当作你项目的服务器来使用,那么安装 Ubuntu Server 会是一个不错的选择。 + +Ubuntu Server 有 32 位和 64 位的镜像。你可以根据你的板的类型(是否支持 64 位)来选择对应的操作系统。 + +然而,值得注意的一点是 Ubuntu Server 不是为桌面用户定制的。因此,你需要留意 Ubuntu Server 默认不会安装图形用户界面。 + +[Ubuntu Server][14] + +#### 4\. LibreELEC:适合做媒体服务器 + +![][15] + +我们已经有一个 [Linux 下可用的媒体服务器软件][16],LibreELEC 在列表中。 + +它是一个伟大的轻量级操作系统,让你可以在树莓派上安装 [KODI][17]。你可以尝试使用 Raspberry Pi Imager 来安装它。 + +你可以很容易地找到他们的[官方下载页面][18],并找到适合你板子的安装镜像。 + +[LibreELEC][19] + +#### 5\. OSMC:适合做媒体服务器 + +![][20] + +OSMC 是另一个 Linux 下[流行的媒体服务器软件][16]。如果要把树莓派板作为媒体中心设备,那么 OSMC 是你可以向他人推荐的操作系统之一。 + +类似 LibreELEC,OSMC 也运行 KODI 来帮助你管理你的媒体文件和享受你已有的素材中。 + +OSMC 官方没有提及对 **Raspberry Pi 4** 的支持。因此,如果你的树莓派是 Raspberry Pi 3 或更早的版本,那么应该没有问题。 + +[OSMC][21] + +#### 6\. RISC OS:传统的 ARM 操作系统 + +![][22] + +ARM 设备的原始草稿版,RISC 已经存在了差不多 30 年了。 + +如果你想了解,我们也有篇详细介绍 [RISC OS][23] 的文章。简而言之,RISC OS 也是为诸如树莓派的现代基于 ARM 的卡片式计算机定制的。它的用于界面很简单,更专注于性能。 + +同样的,这个系统也不支持 Raspberry Pi 4。因此,如果你的树莓派是 Raspberry Pi 3 或更早的版本,你可以试一下。 + +[RISC OS][24] + +#### 7\. Mozilla WebThings Gateway:适合 IoT 项目 + +![][25] + +作为 Mozilla 的 [IoT 设备的开源实现][26] 的一部分,WebThings Gateway 让你可以监控和控制连接的 IoT 设备。 + +你可以参考[官方文档][27]来检查所需的环境,遵照指导把安装到树莓派上。它确实是适合 IoT 应用的最有用的树莓派操作系统之一。 + +[WebThings Gateway][28] + +#### 8\. Ubuntu Core:适合 IoT 项目 + +另一个适合 [IoT][29] 应用的树莓派操作系统,或者仅仅用来测试一下 — Ubuntu Core。 + +Ubuntu Core 是为 IoT 设备或特定的树莓派特意定制。我不会刻意主张大家使用它 — 但是 Ubuntu Core 是适合树莓派板的安全的操作系统。你可以自己尝试一下! + +[Ubuntu Core][30] + +#### 9\. DietPi:轻量级树莓派操作系统 + +![DietPi Screenshot via Distrowatch][31] + +DietPi 是一款轻量级的 [Debian][32] 操作系统,它还宣称比 “Raspbian Lite” 操作系统更轻量。 + +考虑到它是一款轻量级的树莓派操作系统,它在很多使用场景下以很便捷的方式提供了大量的功能。从简单的软件安装包到备份解决方案,还有很多功能等待发掘。 + +如果你想安装一个低内存占用而性能相对更好的操作系统,你可以尝试一下 DietPi。 + +[DietPi][33] + +#### 10\. Lakka Linux:打造复古的游戏控制台 + +![][34] + +想让你的树莓派变成一个复古的游戏控制台? + +Lakka Linux 发行版本最初是在 RetroArch 模拟器中构建的。因此,你可以立刻在树莓派上获得所有的复古游戏。 + +如果你想了解,我们也有一篇介绍 [Lakka Linux][35] 的文章。或者直接上手吧! + +[Lakka][36] + +#### 11\. RetroPie:适合复古游戏 + +![ ][37] + +RetroPie 是另一款可以让树莓派变成复古游戏控制台的树莓派操作系统。它提供了很多配置工具,因此你可以自定义主题,或者调整模拟器来找到最好的复古游戏。 + +值得注意的是它不包含任何有版权的游戏。你可以试一下,看看它是怎么工作的! + +[RetroPie][38] + +#### 12\. Kali Linux:适合低成本入侵 + +![][39] + +想要在你的树莓派上尝试和学习一些渗透测试技巧?Kali Linux 会是最佳选择。是的,Kali Linux 通常会支持最新的树莓派。 + +Kali Linux 不仅适合树莓派,它也支持很多其他设备。尝试一下,玩得愉快! + +[Kali Linux][40] + +#### 13\. OpenMediaVault:适合网络附加存储Network Attached Storage + +![][41] + +如果你想在最小的硬件上搭建 [NAS][42] 解决方案,树莓派可以帮助你。 + +OpenMediaVault 最初是基于 Debian Linux 的,提供了大量功能,如基于 web 的管理员能力、插件支持,等等。它支持大多数树莓派模块,因此你可以尝试下载并安装它! + +[OpenMediaVault][43] + +#### 14\. ROKOS:适合加密挖矿 + +![][44] + +如果你对加密货币和比特币很感兴趣,那么 ROKOS 会吸引你。 + +ROKOS 是基于 Debian 的操作系统,预安装的驱动和包基本可以让你的树莓派变成一个节点。当然,在安装之前你需要了解它是怎么工作的。因此,如果你对此不太了解,我建议你先调研下。 + +[ROKOS][45] + +#### 15\. Alpine Linux:专注于安全的轻量级 Linux + +当今年代,很多用户都在寻找专注于安全和[隐私的发行版本][46]。如果你也是其中一员,你可以试试在树莓派上安装 Alpine Linux。 + +如果你是个树莓派新手,它可能不像你想象的那样对用户友好(或对新手友好)。但是,如果你想尝试一些不一样的东西,那么你可以试试 Alpine Linux 这个专注于安全的 Linux 发行版本。 + +[Alpine Linux][47] + +#### 16\. Kano OS:适合儿童教育的操作系统 + +![][48] + +如果你在寻找一款能让学习变得有趣还能教育儿童的树莓派操作系统,那么 Kano OS 是个不错的选择。 + +它是被积极地维护着的,Kano 操作系统上的桌面对于儿童玩和学习的用户体验都是很简单的。 + +[Kano OS][49] + +#### 17\. KDE Plasma Bigscreen:适合把普通 TV 转换为智能 TV + +![][50] + +这是 KDE 的子开发项目。在树莓派上安装 [KDE Plasma Bigscreen OS][51] 后,你可以把普通 TV 变成智能 TV。 + +你不需要特殊的远程服务器来控制 TV。你可以使用普通的远程控制。 + +Plasma Bigscreen 也集成了 [MyCroft open source AI][52] 作为声控。 + +这个项目还在内测阶段,所以如果你想尝试,可能会有一些 bug 和问题。 + +[Plasma Bigscreen][53] + +#### 结语 + +我知道还有很多为树莓派定制的操作系统 — 但是我尽力列出了被积极维护的最流行的或最有用的操作系统。 + +如果你觉得我遗漏了最合适的树莓派操作系统,尽情在下面的评论去告诉我吧! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/raspberry-pi-os/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/ +[2]: https://itsfoss.com/raspberry-pi-projects/ +[3]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[4]: https://www.raspberrypi.org/downloads/ +[5]: https://www.raspberrypi.org/downloads/noobs/ +[6]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/raspbian_home_screen.jpg?resize=800%2C492&ssl=1 +[8]: https://www.raspbian.org/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Desktop-ubuntu.jpg?resize=800%2C600&ssl=1 +[10]: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-nano/ +[11]: https://itsfoss.com/ubuntu-mate-raspberry-pi/ +[12]: https://ubuntu-mate.org/raspberry-pi/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/ubunt-server.png?ssl=1 +[14]: https://ubuntu.com/download/raspberry-pi +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/libreelec.jpg?resize=800%2C600&ssl=1 +[16]: https://itsfoss.com/best-linux-media-server/ +[17]: https://kodi.tv/ +[18]: https://libreelec.tv/downloads_new/ +[19]: https://libreelec.tv/ +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/osmc-server.jpg?resize=800%2C450&ssl=1 +[21]: https://osmc.tv/ +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/10/riscos5.1.jpg?resize=800%2C600&ssl=1 +[23]: https://itsfoss.com/risc-os-is-now-open-source/ +[24]: https://www.riscosopen.org/content/ +[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/web-things-gateway.png?ssl=1 +[26]: https://iot.mozilla.org/about/ +[27]: https://iot.mozilla.org/docs/gateway-getting-started-guide.html +[28]: https://iot.mozilla.org/gateway/ +[29]: https://en.wikipedia.org/wiki/Internet_of_things +[30]: https://ubuntu.com/download/raspberry-pi-core +[31]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/diet-pi.jpg?ssl=1 +[32]: https://www.debian.org/ +[33]: https://dietpi.com/ +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/08/lakkaos.jpg?resize=1024%2C640&ssl=1 +[35]: https://itsfoss.com/lakka-retrogaming-linux/ +[36]: http://www.lakka.tv/ +[37]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/retro-pie.png?ssl=1 +[38]: https://retropie.org.uk/ +[39]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/kali-linux-pi.png?ssl=1 +[40]: https://www.offensive-security.com/kali-linux-arm-images/ +[41]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/openmediavault.jpg?ssl=1 +[42]: https://en.wikipedia.org/wiki/Network-attached_storage +[43]: https://www.openmediavault.org/ +[44]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rocos-bitcoin-pi.jpg?ssl=1 +[45]: https://rokos.space/ +[46]: https://itsfoss.com/privacy-focused-linux-distributions/ +[47]: https://alpinelinux.org/ +[48]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/kano-os-pi.jpeg?ssl=1 +[49]: https://kano.me/row/downloadable +[50]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/plasma-bigscreen-menu.jpg?ssl=1 +[51]: https://itsfoss.com/kde-plasma-bigscreen/ +[52]: https://itsfoss.com/mycroft-mark-2/ +[53]: https://plasma-bigscreen.org/#download-jumpto From 80266586e6d340b1bdf9613194876f790033ee74 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Mon, 11 May 2020 23:38:52 +0800 Subject: [PATCH 0686/1809] APL --- ...00509 Ensmallening Go binaries by prohibiting comparisons.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md b/sources/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md index 61ad40c73e..424434adbb 100644 --- a/sources/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md +++ b/sources/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a824deb9aeffbf71e5337f5dc595810a87040299 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 12 May 2020 00:11:28 +0800 Subject: [PATCH 0687/1809] PRF @messon007 --- ...12 Systemd Services- Reacting to Change.md | 211 +++++++++--------- 1 file changed, 102 insertions(+), 109 deletions(-) diff --git a/translated/tech/20180612 Systemd Services- Reacting to Change.md b/translated/tech/20180612 Systemd Services- Reacting to Change.md index 22c176ee80..8a7be7cde2 100644 --- a/translated/tech/20180612 Systemd Services- Reacting to Change.md +++ b/translated/tech/20180612 Systemd Services- Reacting to Change.md @@ -1,66 +1,59 @@ -Systemd服务:响应变更 +Systemd 服务:响应变化 ====== -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/webcam.png?itok=zzYUs5VK) +![](https://img.linux.net.cn/data/attachment/album/202005/12/001037iz91uu9b15dqb9w3.jpg) -[我有一个这样的电脑棒][1](图1),并将其用作通用服务器。它很小且安静,由于它是基于x86架构,因此我为我的打印机安装驱动没有任何问题,而且这就是它大多数时候干的事:与客厅的共享打印机和扫描仪通信。 +[我有一个这样的电脑棒][1](图1),我把它用作通用服务器。它很小且安静,由于它是基于 x86 架构的,因此我为我的打印机安装驱动没有任何问题,而且这就是它大多数时候干的事:与客厅的共享打印机和扫描仪通信。 ![ComputeStick][3] -一个英特尔电脑棒。欧元硬币大小。 +*一个英特尔电脑棒。欧元硬币大小。* -[Used with permission][4] +大多数时候它都是闲置的,尤其是当我们外出时,因此我认为用它作监视系统是个好主意。该设备没有自带的摄像头,也不需要一直监视。我也不想手动启动图像捕获,因为这样就意味着在出门前必须通过 SSH 登录,并在 shell 中编写命令来启动该进程。 -大多数时候,它都闲着,尤其是当我们外出时,因此我认为用它作监视系统是个好主意。该设备没有自带的摄像头,也不需要一直监视。我也不想手动启动图像捕获,因为这样就意味着在出门前必须通过SSH登录,并在shell中编写命令来启动该进程。 +因此,我以为应该这么做:拿一个 USB 摄像头,然后只需插入它即可自动启动监视系统。如果这个电脑棒重启后发现连接了摄像头也启动监视系统就更加分了。 -因此,我以为应该这么做:抓住USB摄像头,然后只需插入它即可自动启动监视系统。如果Stick重启后发现连接了摄像头也启动监视系统就更加分了。 +在先前的文章中,我们看到 systemd 服务既可以[手动启动或停止][5],也可以[在满足某些条件时启动或停止][6]。这些条件不限于操作系统在启动或关机时序中达到某种状态,还可以在你插入新硬件或文件系统发生变化时进行。你可以通过将 Udev 规则与 systemd 服务结合起来实现。 -在先前的文章中,我们看到[systemd服务可以手动启动或停止][5]或[在满足某些条件时][6]。这些条件不限于操作系统在启动或关机时序中达到某种状态,还可以在您插入新硬件或文件系统发生变化时进行。您可以通过将Udev规则与systemd服务结合起来实现。 +### 有 Udev 支持的热插拔 -### 有Udev(支持)的热插拔 +Udev 规则位于 `/etc/udev/rules` 目录中,通常是由导致一个动作action条件conditions赋值assignments的单行语句来描述。 -Udev规则位于 _/etc/udev/rules_ 目录中,通常是由导致一个 _动作(action)_ 的 _条件(conditions)_ 和 _赋值(assignments)_ 的单行语句来描述。 +有点神秘。让我们再解释一次: -有点神秘。让我们再试一次: +通常,在 Udev 规则中,你会告诉 systemd 当设备连接时需要查看什么信息。例如,你可能想检查刚插入的设备的品牌和型号是否与你让 Udev 等待的设备的品牌和型号相对应。这些就是前面提到的“条件”。 -通常,在Udev规则中,您告诉systemd当连接一个设备时需要查看什么信息。例如,您可能想检查刚插入的设备的品牌和型号是否与您让Udev等待的设备的品牌和型号相对应。这些就是前面提到的条件。 +然后,你可能想要更改一些内容,以便以后可以方便使用该设备。例如,更改设备的读写权限:如果插入 USB 打印机,你会希望用户能够从打印机读取信息(用户的打印应用程序需要知道其模型、制造商,以及是否准备好接受打印作业)并向其写入内容,即发送要打印的内容。更改设备的读写权限是通过你之前阅读的“赋值” 之一完成的。 -然后,您可能想要更改一些内容,以便以后可以轻松使用该设备。例如,更改设备的读写权限:如果插入USB打印机,您将希望用户能够从打印机读取信息(用户的打印应用程序需要知道其模型,制造商,以及是否准备好接受打印作业)并向其写入内容,即发送要打印的内容。更改设备的读写权限是通过您之前阅读的 _赋值(assignments)_ 之一完成的。 - -最后,您可能希望系统在满足上述条件时执行某些动作,例如在插入某个外接硬盘时启动备份程序以复制重要文件。这就是上面提到的 _动作(action)_ 的例子。 +最后,你可能希望系统在满足上述条件时执行某些动作,例如在插入某个外部硬盘时启动备份程序以复制重要文件。这就是上面提到的“动作”的例子。 了解这些之后, 来看看以下几点: ``` -ACTION=="add", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="e207", +ACTION=="add", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="e207", SYMLINK+="mywebcam", TAG+="systemd", MODE="0666", ENV{SYSTEMD_WANTS}="webcam.service" ``` 规则的第一部分, ``` -ACTION=="add", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="03f0", +ACTION=="add", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="e207" [etc... ] ``` -表明了执行您想让系统执行的其他动作之前设备必须满足的条件。设备必须被添加到(`ACTION=="add"`)机器上,并且必须添加到 `video4linux` 子系统中。为了确保仅在插入正确的设备时才应用该规则,您必须确保Udev正确识别设备的制造商(`ATTRS{idVendor}=="03f0"`)和型号(`ATTRS{idProduct}=="e207"`)。 +表明了执行你想让系统执行的其他动作之前设备必须满足的条件。设备必须被添加到(`ACTION=="add"`)机器上,并且必须添加到 `video4linux` 子系统中。为了确保仅在插入正确的设备时才应用该规则,你必须确保 Udev 正确识别设备的制造商(`ATTRS{idVendor}=="03f0"`)和型号(`ATTRS{idProduct}=="e207"`)。 在本例中,我们讨论的是这个设备(图2): ![webcam][8] -这个试验使用的是HP的摄像头。 +*这个试验使用的是 HP 的摄像头。* -[Used with permission][4] +注意怎样用 `==` 来表示这是一个逻辑操作。你应该像这样阅读上面的简要规则: -注意怎样用 `==` 来表示这是一个逻辑操作。您应该像这样阅读上面的简要规则: +> 如果添加了一个设备并且该设备由 video4linux 子系统控制,而且该设备的制造商编码是 03f0,型号是 e207,那么... -``` -如果添加了一个设备并且该设备由video4linux子系统控制 -而且该设备的制造商是03f0,型号是e207,那么... -``` - -但是,您从哪里获取的这些信息? 您在哪里找到触发事件的动作,制造商,模型等等?您可能必须使用多个来源。您可以通过将摄像头插入机器并运行 `lsusb` 来获得 `IdVendor` 和 `idProduct` : +但是,你从哪里获取的这些信息?你在哪里找到触发事件的动作、制造商、型号等?你可要使用多个来源。你可以通过将摄像头插入机器并运行 `lsusb` 来获得 `IdVendor` 和 `idProduct` : ``` lsusb @@ -74,74 +67,74 @@ Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub ``` -我用的摄像头是HP的,您在上面的列表中只能看到一个HP设备。 `ID` 告诉了制造商和型号,它们以冒号( `:` )分隔。如果您有同一制造商的多个设备,不确定哪个是哪个设备,请拔下摄像头,再次运行 `lsusb` , 看看少了什么。 +我用的摄像头是 HP 的,你在上面的列表中只能看到一个 HP 设备。`ID` 提供了制造商和型号,它们以冒号(`:`)分隔。如果你有同一制造商的多个设备,不确定哪个是哪个设备,请拔下摄像头,再次运行 `lsusb` , 看看少了什么。 或者... -拔下摄像头,等待几秒钟,运行命令 `udevadmin monitor --environment` ,然后重新插入摄像头。当您使用的是HP摄像头时,您将看到: +拔下摄像头,等待几秒钟,运行命令 `udevadmin monitor --environment` ,然后重新插入摄像头。当你使用的是HP摄像头时,你将看到: ``` udevadmin monitor --environment -UDEV [35776.495221] add /devices/pci0000:00/0000:00:1c.3/0000:04:00.0 -  /usb3/3-1/3-1:1.0/input/input21/event11 (input) -.MM_USBIFNUM=00 -ACTION=add -BACKSPACE=guess -DEVLINKS=/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event -  /dev/input/by-id/usb-Hewlett_Packard_HP_Webcam_HD_2300-event-if00 -DEVNAME=/dev/input/event11 +UDEV [35776.495221] add /devices/pci0000:00/0000:00:1c.3/0000:04:00.0 + /usb3/3-1/3-1:1.0/input/input21/event11 (input) +.MM_USBIFNUM=00 +ACTION=add +BACKSPACE=guess +DEVLINKS=/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event + /dev/input/by-id/usb-Hewlett_Packard_HP_Webcam_HD_2300-event-if00 +DEVNAME=/dev/input/event11 DEVPATH=/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/ -  usb3/3-1/3-1:1.0/input/input21/event11 -ID_BUS=usb -ID_INPUT=1 -ID_INPUT_KEY=1 -ID_MODEL=HP_Webcam_HD_2300 -ID_MODEL_ENC=HP\x20Webcam\x20HD\x202300 -ID_MODEL_ID=e207 -ID_PATH=pci-0000:04:00.0-usb-0:1:1.0 -ID_PATH_TAG=pci-0000_04_00_0-usb-0_1_1_0 -ID_REVISION=1020 -ID_SERIAL=Hewlett_Packard_HP_Webcam_HD_2300 -ID_TYPE=video -ID_USB_DRIVER=uvcvideo -ID_USB_INTERFACES=:0e0100:0e0200:010100:010200:030000: -ID_USB_INTERFACE_NUM=00 -ID_VENDOR=Hewlett_Packard -ID_VENDOR_ENC=Hewlett\x20Packard -ID_VENDOR_ID=03f0 -LIBINPUT_DEVICE_GROUP=3/3f0/e207:usb-0000:04:00.0-1/button -MAJOR=13 -MINOR=75 -SEQNUM=3162 -SUBSYSTEM=input -USEC_INITIALIZED=35776495065 -XKBLAYOUT=es -XKBMODEL=pc105 -XKBOPTIONS= + usb3/3-1/3-1:1.0/input/input21/event11 +ID_BUS=usb +ID_INPUT=1 +ID_INPUT_KEY=1 +ID_MODEL=HP_Webcam_HD_2300 +ID_MODEL_ENC=HPx20Webcamx20HDx202300 +ID_MODEL_ID=e207 +ID_PATH=pci-0000:04:00.0-usb-0:1:1.0 +ID_PATH_TAG=pci-0000_04_00_0-usb-0_1_1_0 +ID_REVISION=1020 +ID_SERIAL=Hewlett_Packard_HP_Webcam_HD_2300 +ID_TYPE=video +ID_USB_DRIVER=uvcvideo +ID_USB_INTERFACES=:0e0100:0e0200:010100:010200:030000: +ID_USB_INTERFACE_NUM=00 +ID_VENDOR=Hewlett_Packard +ID_VENDOR_ENC=Hewlettx20Packard +ID_VENDOR_ID=03f0 +LIBINPUT_DEVICE_GROUP=3/3f0/e207:usb-0000:04:00.0-1/button +MAJOR=13 +MINOR=75 +SEQNUM=3162 +SUBSYSTEM=input +USEC_INITIALIZED=35776495065 +XKBLAYOUT=es +XKBMODEL=pc105 +XKBOPTIONS= XKBVARIANT= ``` -可能看起来有很多信息要处理,但是,看一下这个:列表前面的 `ACTION` 字段, 它告诉您刚刚发生了什么事件,即一个设备被添加到系统中。您还可以在几行中看到设备名称的拼写,因此可以非常确定它就是您要找的设备。输出里还显示了制造商的ID(`ID_VENDOR_ID = 03f0`)和型号(`ID_VENDOR_ID = 03f0`)。 +可能看起来有很多信息要处理,但是,看一下这个:列表前面的 `ACTION` 字段, 它告诉你刚刚发生了什么事件,即一个设备被添加到系统中。你还可以在其中几行中看到设备名称的拼写,因此可以非常确定它就是你要找的设备。输出里还显示了制造商的ID(`ID_VENDOR_ID = 03f0`)和型号(`ID_VENDOR_ID = 03f0`)。 -这为您提供了规则条件部分需要的四个值中的三个。您可能也会想到它还给了您第四个,因为还有一行这样写道: +这为你提供了规则条件部分需要的四个值中的三个。你可能也会想到它还给了你第四个,因为还有一行这样写道: ``` SUBSYSTEM=input ``` -小心!尽管USB摄像头确实是提供输入的设备(键盘和鼠标也是),但它也属于 _usb_ 子系统和其他几个子系统。这意味着您的摄像头被添加到了多个子系统,并且看起来像多个设备。如果您选择了错误的子系统,那么您的规则可能无法按您期望的那样工作,或者根本无法工作。 +小心!尽管 USB 摄像头确实是提供输入的设备(键盘和鼠标也是),但它也属于 usb 子系统和其他几个子系统。这意味着你的摄像头被添加到了多个子系统,并且看起来像多个设备。如果你选择了错误的子系统,那么你的规则可能无法按你期望的那样工作,或者根本无法工作。 -因此,您必须检查的第三件事是摄像头添加到的所有子系统,并选择正确的那个。为此,请再次拔下摄像头,然后运行: +因此,第三件事就是检查网络摄像头被添加到的所有子系统,并选择正确的那个。为此,请再次拔下摄像头,然后运行: ``` ls /dev/video* ``` -这将向您显示连接到本机的所有视频设备。如果您使用的是笔记本,大多数笔记本都带有内置摄像头,它可能会显示为 `/dev/video0` 。重新插入摄像头,然后再次运行 `ls /dev/video*` 。 +这将向你显示连接到本机的所有视频设备。如果你使用的是笔记本,大多数笔记本都带有内置摄像头,它可能会显示为 `/dev/video0` 。重新插入摄像头,然后再次运行 `ls /dev/video*`。 -现在,您应该看到多一个视频设备(可能是`/dev/video1`)。 +现在,你应该看到多一个视频设备(可能是`/dev/video1`)。 -现在,您可以通过运行`udevadm info -a /dev/video1`找出它所属的所有子系统: +现在,你可以通过运行 `udevadm info -a /dev/video1` 找出它所属的所有子系统: ``` udevadm info -a /dev/video1 @@ -164,29 +157,30 @@ and the attributes from one single parent device. [etc...] ``` -输出持续了一段时间,但是您感兴趣的只是开始:`SUBSYSTEM =="video4linux"`。您可以将这行按文本复制并粘贴到规则中。输出的其余部分(为简便起见未显示)为您提供了更多的块,例如制造商和模型ID,您也可以以同样的格式复制并粘贴到规则中。 +输出持续了相当长的时间,但是你感兴趣的只是开头的部分:`SUBSYSTEM =="video4linux"`。你可以将这行文本直接复制粘贴到你的规则中。输出的其余部分(为简洁未显示)为你提供了更多的信息,例如制造商和型号 ID,同样是以你可以复制粘贴到你的规则中的格式。 -现在,您有了识别设备的方式并明确了什么事件应该触发该动作,该对设备进行修改了。 +现在,你有了识别设备的方式吗,并明确了什么事件应该触发该动作,该对设备进行修改了。 -规则的下一部分,`SYMLINK+="mywebcam", TAG+="systemd", MODE="0666"`告诉Udev做三件事:首先,您要创建设备的符号链接(例如 _/dev/video1_ 到 _/dev/mywebcam_ 。这是因为您无法预测系统默认情况下会把那个设备叫什么。当您拥有内置摄像头并热插拔一个新的时,内置摄像头通常为 _/dev/video0_ ,而外部摄像头通常为 _/dev/video1_ 。但是,如果您在插入外部USB摄像头的情况下重启计算机,则可能会相反,内部摄像头可能会变成 _/dev/video1_ ,而外部摄像头会变成 _/dev/video0_ 。这想告诉您的是,尽管您的图像捕获脚本(稍后将看到)总是需要指向外部摄像头设备,但是您不能依赖它是 _/dev/video0_ 或 _/dev/video1_ 。为了解决这个问题,您告诉Udev创建一个符号链接,该链接在设备被添加到 _video4linux_ 子系统的那一刻起就不会再变,您将使您的脚本指向该链接。 +规则的下一部分,`SYMLINK+="mywebcam", TAG+="systemd", MODE="0666"` 告诉 Udev 做三件事:首先,你要创建设备的符号链接(例如 `/dev/video1` 到 `/dev/mywebcam`。这是因为你无法预测系统默认情况下会把那个设备叫什么。当你拥有内置摄像头并热插拔一个新的时,内置摄像头通常为 `/dev/video0`,而外部摄像头通常为 `/dev/video1`。但是,如果你在插入外部 USB 摄像头的情况下重启计算机,则可能会相反,内部摄像头可能会变成 `/dev/video1` ,而外部摄像头会变成 `/dev/video0`。这想告诉你的是,尽管你的图像捕获脚本(稍后将看到)总是需要指向外部摄像头设备,但是你不能依赖它是 `/dev/video0` 或 `/dev/video1`。为了解决这个问题,你告诉 Udev 创建一个符号链接,该链接在设备被添加到 `video4linux` 子系统的那一刻起就不会再变,你将使你的脚本指向该链接。 -您要做的第二件事是将 `"systemd"` 添加到与此规则关联的Udev标记列表中。这告诉Udev,该规则触发的动作将由systemd管理,即它将是某种systemd服务。 +第二件事就是将 `systemd` 添加到与此规则关联的 Udev 标记列表中。这告诉 Udev,该规则触发的动作将由 systemd 管理,即它将是某种 systemd 服务。 -注意在两种情况下该如何使用 `+=` 运算符。这会将值添加到列表中,这意味着您可以向 `SYMLINK` 和 `TAG` 添加多个值。 +注意在这个两种情况下是如何使用 `+=` 运算符的。这会将值添加到列表中,这意味着你可以向 `SYMLINK` 和 `TAG` 添加多个值。 -另一方面,`MODE` 值只能包含一个值(因此,您可以使用简单的 `=` 赋值运算符)。`MODE` 的作用是告诉Udev谁可以读或写该设备。如果您熟悉 `chmod`(您读到此文, 应该会熟悉),您就也会熟悉[如何用数字表示权限][9]。这就是它的含义: `0666` 的含义是 “ _向所有人授予对设备的读写权限_ ”。 +另一方面,`MODE` 值只能包含一个值(因此,你可以使用简单的 `=` 赋值运算符)。`MODE` 的作用是告诉 Udev 谁可以读或写该设备。如果你熟悉 `chmod`(你读到此文, 应该会熟悉),你就也会熟悉[如何用数字表示权限][9]。这就是它的含义:`0666` 的含义是 “向所有人授予对设备的读写权限”。 -最后, `ENV{SYSTEMD_WANTS}="webcam.service"` 告诉Udev要运行什么systemd服务。 +最后, `ENV{SYSTEMD_WANTS}="webcam.service"` 告诉 Udev 要运行什么 systemd 服务。 -将此规则保存到 _/etc/udev/rules.d_ 目录名为 _90-webcam.rules_ (或类似的名称)的文件中,您可以通过重启机器或运行以下命令来加载它: +将此规则保存到 `/etc/udev/rules.d` 目录名为 `90-webcam.rules`(或类似的名称)的文件中,你可以通过重启机器或运行以下命令来加载它: ``` sudo udevadm control --reload-rules && udevadm trigger ``` -## 最后描述服务 +### 最后是服务 + +Udev 规则触发的服务非常简单: -Udev规则触发的服务非常简单: ``` # webcam.service @@ -195,57 +189,56 @@ Type=simple ExecStart=/home/[user name]/bin/checkimage.sh ``` -基本上,它只是运行存储在您个人 _bin/_ 中的 _checkimage.sh_ 脚本并将其放到后台。 [这是您在先前的部分中看过的内容][5]。 它看起来似乎很小,但那只是因为它是被Udev规则调用的,您刚刚创建了一种特殊的systemd单元,称为 _device_ 单元。 恭喜。 +基本上,它只是运行存储在你个人 `bin/` 中的 `checkimage.sh` 脚本并将其放到后台。[这是你在先前的文章中看过的内容][5]。它看起来似乎很小,但那只是因为它是被 Udev 规则调用的,你刚刚创建了一种特殊的 systemd 单元,称为 `device` 单元。 恭喜。 -至于 _webcam.service_ 调用的 _checkimage.sh_ 脚本,有几种方法从摄像头抓取图像并将其与前一个图像进行比较以检查变化(这是 _checkimage.sh_ 所做的事),但这是我的方法: +至于 `webcam.service` 调用的 `checkimage.sh` 脚本,有几种方法从摄像头抓取图像并将其与前一个图像进行比较以检查变化(这是 `checkimage.sh` 所做的事),但这是我的方法: ``` -#!/bin/bash +#!/bin/bash # This is the checkimage.sh script mplayer -vo png -frames 1 tv:// -tv driver=v4l2:width=640:height=480:device= -  /dev/mywebcam &>/dev/null -mv 00000001.png /home/[user name]/monitor/monitor.png + /dev/mywebcam &>/dev/null +mv 00000001.png /home/[user name]/monitor/monitor.png -while true -do - mplayer -vo png -frames 1 tv:// -tv driver=v4l2:width=640:height=480:device=/dev/mywebcam &>/dev/null - mv 00000001.png /home/[user name]/monitor/temp.png +while true +do + mplayer -vo png -frames 1 tv:// -tv driver=v4l2:width=640:height=480:device=/dev/mywebcam &>/dev/null + mv 00000001.png /home/[user name]/monitor/temp.png - imagediff=`compare -metric mae /home/[user name]/monitor/monitor.png /home/[user name] -  /monitor/temp.png /home/[user name]/monitor/diff.png 2>&1 > /dev/null | cut -f 1 -d " "` - if [ `echo "$imagediff > 700.0" | bc` -eq 1 ] - then - mv /home/[user name]/monitor/temp.png /home/[user name]/monitor/monitor.png - fi - - sleep 0.5 + imagediff=`compare -metric mae /home/[user name]/monitor/monitor.png /home/[user name] + /monitor/temp.png /home/[user name]/monitor/diff.png 2>&1 > /dev/null | cut -f 1 -d " "` + if [ `echo "$imagediff > 700.0" | bc` -eq 1 ] + then + mv /home/[user name]/monitor/temp.png /home/[user name]/monitor/monitor.png + fi + + sleep 0.5 done ``` -首先使用[MPlayer][10]从摄像头抓取一帧(_00000001.png_)。注意,我们怎样将 `mplayer` 指向Udev规则中创建的 `mywebcam` 符号链接,而不是指向 `video0` 或 `video1` 。然后,将图像传输到主目录中的 _monitor/_ 目录。然后执行一个无限循环,一次又一次地执行相同的操作,但还使用了[Image Magick的_compare_工具][11]来查看最后捕获的图像与 _monitor/_ 目录中已有的图像之间是否存在差异。 +首先使用[MPlayer][10]从摄像头抓取一帧(`00000001.png`)。注意,我们怎样将 `mplayer` 指向 Udev 规则中创建的 `mywebcam` 符号链接,而不是指向 `video0` 或 `video1`。然后,将图像传输到主目录中的 `monitor/` 目录。然后执行一个无限循环,一次又一次地执行相同的操作,但还使用了[Image Magick 的 compare 工具][11]来查看最后捕获的图像与 `monitor/` 目录中已有的图像之间是否存在差异。 如果图像不同,则表示摄像头的镜框里某些东西动了。该脚本将新图像覆盖原始图像,并继续比较以等待更多变动。 ### 插线 -所有东西准备好后,当您插入摄像头后,您的Udev规则将被触发并启动 _webcam.service_ 。 _webcam.service_ 将在后台执行 _checkimage.sh_ ,而 _checkimage.sh_ 将开始每半秒拍一次照。您会感觉到,因为摄像头的LED在每次拍照时将开始闪。 +所有东西准备好后,当你插入摄像头后,你的 Udev 规则将被触发并启动 `webcam.service`。 `webcam.service` 将在后台执行 `checkimage.sh` ,而 `checkimage.sh` 将开始每半秒拍一次照。你会感觉到,因为摄像头的 LED 在每次拍照时将开始闪。 -与往常一样,如果出现问题,请运行 +与往常一样,如果出现问题,请运行: ``` systemctl status webcam.service ``` -检查您的服务和脚本正在做什么。 +检查你的服务和脚本正在做什么。 ### 接下来 -您可能想知道:为什么要覆盖原始图像? 当然,系统检测到任何动静,您都想知道发生了什么,对吗?您是对的,但是如您在下一部分中将看到的那样,将它们保持原样,并使用另一种类型的systemd单元处理图像将更好,更清晰和更简单。 +你可能想知道:为什么要覆盖原始图像?当然,系统检测到任何动静,你都想知道发生了什么,对吗?你是对的,但是如你在下一部分中将看到的那样,将它们保持原样,并使用另一种类型的 systemd 单元处理图像将更好,更清晰和更简单。 -请稍等。 +请期待下一篇。 -通过Linux基金会和edX的免费["Linux简介"][12]课程了解有关Linux的更多信息。 -------------------------------------------------------------------------------- via: https://www.linux.com/blog/intro-to-linux/2018/6/systemd-services-reacting-change @@ -253,7 +246,7 @@ via: https://www.linux.com/blog/intro-to-linux/2018/6/systemd-services-reacting- 作者:[Paul Brown][a] 选题:[lujun9972][b] 译者:[messon007](https://github.com/messon007) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -261,10 +254,10 @@ via: https://www.linux.com/blog/intro-to-linux/2018/6/systemd-services-reacting- [b]: https://github.com/lujun9972 [1]: https://www.intel.com/content/www/us/en/products/boards-kits/compute-stick/stk1a32sc.html [2]: https://www.linux.com/files/images/fig01png -[3]: https://www.linux.com/sites/lcom/files/styles/floated_images/public/fig01.png?itok=cfEHN5f1 (ComputeStick) +[3]: https://lcom.static.linuxfound.org/sites/lcom/files/fig01.png [4]: https://www.linux.com/licenses/category/used-permission -[5]: https://www.linux.com/blog/learn/intro-to-linux/2018/5/writing-systemd-services-fun-and-profit -[6]: https://www.linux.com/blog/learn/2018/5/systemd-services-beyond-starting-and-stopping +[5]: https://linux.cn/article-9700-1.html +[6]: https://linux.cn/article-9703-1.html [7]: https://www.linux.com/files/images/fig02png [8]: https://www.linux.com/sites/lcom/files/styles/floated_images/public/fig02.png?itok=esFv4BdM (webcam) [9]: https://chmod-calculator.com/ From 26b71c999d7b8408ba10b0824fdcd9123185c496 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 12 May 2020 00:11:54 +0800 Subject: [PATCH 0688/1809] PUB @messon007 https://linux.cn/article-12211-1.html --- .../20180612 Systemd Services- Reacting to Change.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180612 Systemd Services- Reacting to Change.md (100%) diff --git a/translated/tech/20180612 Systemd Services- Reacting to Change.md b/published/20180612 Systemd Services- Reacting to Change.md similarity index 100% rename from translated/tech/20180612 Systemd Services- Reacting to Change.md rename to published/20180612 Systemd Services- Reacting to Change.md From c871b8d15bfe3ad0ad2fe85d0ba8e2a5a6e3bd51 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 12 May 2020 00:55:22 +0800 Subject: [PATCH 0689/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200511=20Tips?= =?UTF-8?q?=20and=20tricks=20for=20optimizing=20container=20builds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200511 Tips and tricks for optimizing container builds.md --- ... tricks for optimizing container builds.md | 201 ++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 sources/tech/20200511 Tips and tricks for optimizing container builds.md diff --git a/sources/tech/20200511 Tips and tricks for optimizing container builds.md b/sources/tech/20200511 Tips and tricks for optimizing container builds.md new file mode 100644 index 0000000000..0a4fbed8cb --- /dev/null +++ b/sources/tech/20200511 Tips and tricks for optimizing container builds.md @@ -0,0 +1,201 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tips and tricks for optimizing container builds) +[#]: via: (https://opensource.com/article/20/5/optimize-container-builds) +[#]: author: (Ravi Chandran https://opensource.com/users/ravichandran) + +Tips and tricks for optimizing container builds +====== +Try these techniques to minimize the number and length of your container +build iterations. +![Toolbox drawing of a container][1] + +How many iterations does it take to get a container configuration just right? And how long does each iteration take? Well, if you answered "too many times and too long," then my experiences are similar to yours. On the surface, creating a configuration file seems like a straightforward exercise: implement the same steps in a configuration file that you would perform if you were installing the system by hand. Unfortunately, I've found that it usually doesn't quite work that way, and a few "tricks" are handy for such DevOps exercises. + +In this article, I'll share some techniques I've found that help minimize the number and length of iterations. In addition, I'll outline a few good practices beyond the [standard ones][2]. + +In the [tutorial repository][3] from my previous article about [containerizing build systems][4], I've added a folder called **/tutorial2_docker_tricks** with an example covering some of the tricks that I'll walk through in this post. If you want to follow along and you have Git installed, you can pull it locally with: + + +``` +`$ git clone https://github.com/ravi-chandran/dockerize-tutorial` +``` + +The tutorial has been tested with Docker Desktop Edition, although it should work with any compatible Linux container system (like [Podman][5]). + +### Save time on container image build iterations + +If the Dockerfile involves downloading and installing a 5GB file, each iteration of **docker image build** could take a lot of time even with good network speeds. And forgetting to include one item to be installed can mean rebuilding all the layers after that point. + +One way around that challenge is to use a local HTTP server to avoid downloading large files from the internet multiple times during **docker image build** iterations. To illustrate this by example, say you need to create a container image with Anaconda 3 under Ubuntu 18.04. The Anaconda 3 installer is a ~0.5GB file, so this will be the "large" file for this example. + +Note that you don't want to use the **COPY** instruction, as it creates a new layer. You should also delete the large installer after using it to minimize the container image size. You could use [multi-stage builds][6], but I've found the following approach sufficient and quite effective. + +The basic idea is to use a Python-based HTTP server locally to serve the large file(s) and have the Dockerfile **wget** the large file(s) from this local server. Let's explore the details of how to set this up effectively. As a reminder, you can access the [full example][7]. + +The necessary contents of the folder **tutorial2_docker_tricks/** in this example repository are: + + +``` +tutorial2_docker_tricks/ +├── build_docker_image.sh                   # builds the docker image +├── run_container.sh                        # instantiates a container from the image +├── install_anaconda.dockerfile             # Dockerfile for creating our target docker image +├── .dockerignore                           # used to ignore contents of the installer/ folder from the docker context +├── installer                               # folder with all our large files required for creating the docker image +│   └── Anaconda3-2019.10-Linux-x86_64.sh   # from +└── workdir                                 # example folder used as a volume in the running container +``` + +The key steps of the approach are: + + * Place the large file(s) in the **installer/** folder. In this example, I have the large Anaconda installer file **Anaconda3-2019.10-Linux-x86_64.sh**. You won't find this file if you clone my [Git repository][8] because only you, as the container image creator, need this source file. The end users of the image don't. [Download the installer][9] to follow along with the example. + * Create the **.dockerignore** file and have it ignore the **installer/** folder to avoid Docker copying all the large files into the build context. + * In a terminal, **cd** into the **tutorial2_docker_tricks/** folder and execute the build script as **./build_docker_image.sh**. + * In **build_docker_image.sh**, start the Python HTTP server to serve any files from the **installer/** folder: [code] cd installer +python3 -m http.server --bind 10.0.2.15 8888 & +cd .. +``` +* If you're wondering about the strange internet protocol (IP) address, I'm working with a VirtualBox Linux VM, and **10.0.2.15** shows up as the address of the Ethernet adapter when I run **ifconfig**. This IP seems to be the convention used by VirtualBox. If your setup is different, you'll need to update this IP address to match your environment and then update **build_docker_image.sh** and **install_anaconda.dockerfile**. The server's port number is set to **8888** for this example. Note that the IP and port numbers could be passed in as build arguments, but I've hard-coded them for brevity. +* Since the HTTP server is set to run in the background, stop the server near the end of the script with the **kill -9** command using an [elegant approach][10] I found: [code]`kill -9 `ps -ef | grep http.server | grep 8888 | awk '{print $2}'` +``` + * Note that this same **kill -9** is also used earlier in the script (before starting the HTTP server). In general, when I iterate on any build script that I might deliberately interrupt, this ensures a clean start of the HTTP server each time. + * In the [Dockerfile][11], there is a **RUN wget** instruction that downloads the Anaconda installer from the local HTTP server. It also deletes the installer file and cleans up after the installation. Most importantly, all these actions are performed within the same layer to keep the image size to a minimum: [code] # install Anaconda by downloading the installer via the local http server +ARG ANACONDA +RUN wget --no-proxy -O ~/anaconda.sh \ +    && /bin/bash ~/anaconda.sh -b -p /opt/conda \ +    && rm ~/anaconda.sh \ +    && rm -fr /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/* +``` + * This file runs the wrapper script, **anaconda.sh**, and cleans up large files by removing them with **rm**. + * After the build is complete, you should see an image **anaconda_ubuntu1804:v1**. (You can list the images with **docker image ls**.) + * You can instantiate a container from this image using **./run_container.sh** at the terminal while in the folder **tutorial2_docker_tricks/**. You can verify that Anaconda is installed with: [code] $ ./run_container.sh +$ python --version +Python 3.7.5 +$ conda --version +conda 4.8.0 +$ anaconda --version +anaconda Command line client (version 1.7.2) +``` + * You'll note that **run_container.sh** sets up a volume **workdir**. In this example repository, the folder **workdir/** is empty. This is a convention I use to set up a volume where I can have my Python and other scripts that are independent of the container image. + + + +### Minimize container image size + +Each **RUN** command is equivalent to executing a new shell, and each **RUN** command creates a layer. The naive approach of mimicking installation instructions with separate **RUN** commands may eventually break at one or more interdependent steps. If it happens to work, it will typically result in a larger image. Chaining multiple installation steps in one **RUN** command and including the **autoremove**, **autoclean**, and **rm** commands (as in the example below) is useful to minimize the size of each layer. Some of these steps may not be needed, depending on what's being installed. However, since these steps take an insignificant amount of time, I always throw them in for good measure at the end of **RUN** commands invoking **apt-get**: + + +``` +RUN apt-get update \ +    && DEBIAN_FRONTEND=noninteractive \ +       apt-get -y --quiet --no-install-recommends install \ +       # list of packages being installed go here \ +    && apt-get -y autoremove \ +    && apt-get clean autoclean \ +    && rm -fr /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/* +``` + +Also, ensure that you have a **.dockerignore** file in place to ignore items that don't need to be sent to the Docker build context (such as the Anaconda installer file in the earlier example). + +### Organize the build tool I/O + +For software build systems, the build inputs and outputs—all the scripts that configure and invoke the tools—should be outside the image and the eventually running container. The container itself should remain stateless so that different users will have identical results with it. I covered this extensively in my [previous article][4] but wanted to emphasize it because it's been a useful convention for my work. These inputs and outputs are best accessed by setting up container volumes. + +I've had to use a container image that provides data in the form of source code and large pre-built binaries. As a software developer, I was expected to edit the code in the container. This was problematic, because containers are by default stateless: they don't save data within the container, because they're designed to be disposable. But I worked on it, and at the end of each day, I stopped the container and had to be careful not to remove it, because the state had to be maintained so I could continue work the next day. The disadvantage of this approach was that there would be a divergence of development state had there been more than one person working on the project. The value of having identical build systems across developers is somewhat lost with this approach. + +### Generate output as non-root user + +An important aspect of I/O concerns the ownership of the output files generated when running the tools in the container. By default, since Docker runs as **root**, the output files would be owned by **root**, which is unpleasant. You typically want to work as a non-root user. Changing the ownership after the build output is generated can be done with scripts, but it is an additional and unnecessary step. It's best to set the [**USER**][12] argument in the Dockerfile at the earliest point possible: + + +``` +ARG USERNAME +# other commands... +USER ${USERNAME} +``` + +The **USERNAME** can be passed in as a build argument (**\--build-arg**) when executing the **docker image build**. You can see an example of this in the example [Dockerfile][11] and corresponding [build script][13]. + +Some portions of the tools may also need to be installed as a non-root user. So the sequence of installations in the Dockerfile may need to be different from the way it's done if you are installing manually and directly under Linux. + +### Non-interactive installation + +Interactivity is the opposite of container automation. I've found the + + +``` +`DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends` +``` + +options for the **apt-get install** instruction (as in the example above) necessary to prevent the installer from opening dialog boxes. Note that these options should be used as part of the **RUN** instruction. The **DEBIAN_FRONTEND=noninteractive** should not be set as an environment variable (**ENV**) in the Dockerfile, as this [FAQ explains][14], as it will be inherited by the containers. + +### Log your build and run output + +Debugging why a build failed is a common task, and logs are a great way to do this. Save a TypeScript of everything that happened during the container image build or container run session using the **tee** utility in a Bash script. In other words, add **|& tee $BASH_SOURCE.log** to the end of the **docker image build** and the **docker image run** commands in your scripts. See the examples in the [image build][13] and [container run][15] scripts. + +What this **tee**-ing technique does is generate a file with the same name as the Bash script but with a **.log** extension appended to it so that you know which script it originated from. Everything you see printed to the terminal when running the script will get logged to this file with a similar name. + +This is especially valuable for users of your container images to report issues to you when something doesn't work. You can ask them to send you the log file to help diagnose the issue. Many tools generate so much output that it easily overwhelms the default size of the terminal's buffer. Relying only on the terminal's buffer capacity to copy-paste error messages may not be sufficient for diagnosing issues because earlier errors may have been lost. + +I've found this to be useful, even in the container image-building scripts, especially when using the Python-based HTTP server discussed above. The server generates so many lines during a download that it typically overwhelms the terminal's buffer. + +### Deal with proxies elegantly + +In my work environment, proxies are required to reach the internet for downloading the resources in **RUN apt-get** and **RUN wget** commands. The proxies are typically inferred from the environment variables **http_proxy** or **https_proxy**. While **ENV** commands can be used to hard-code such proxy settings in the Dockerfile, there are multiple issues with using **ENV** for proxies directly. + +If you are the only one who will ever build the container, then perhaps this will work. But the Dockerfile couldn't be used by someone else at a different location with a different proxy setting. Another issue is that the IT department could change the proxy at some point, resulting in a Dockerfile that won't work any longer. Furthermore, the Dockerfile is a precise document specifying a configuration-controlled system, and every change will be scrutinized by quality assurance. + +One simple approach to avoid hard-coding the proxy is to pass your local proxy setting as a build argument in the **docker image build** command: + + +``` +docker image build \ +    --build-arg MY_PROXY= +``` + +And then, in the Dockerfile, set the environment variables based on the build argument. In the example shown here, you can still set a default proxy value that can be overridden by the build argument above: + + +``` +# set a default proxy +ARG MY_PROXY=MY_PROXY= +ENV http_proxy=$MY_PROXY +ENV https_proxy=$MY_PROXY +``` + +### Summary + +These techniques have helped me significantly reduce the time it takes to create container images and debug them when they go wrong. I continue to be on the lookout for additional best practices to add to my list. I hope you find the above techniques useful. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/optimize-container-builds + +作者:[Ravi Chandran][a] +选题:[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/ravichandran +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/toolbox-learn-draw-container-yearbook.png?itok=xDbwz1pP (Toolbox drawing of a container) +[2]: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/ +[3]: https://github.com/ravi-chandran/dockerize-tutorial +[4]: https://opensource.com/article/20/4/how-containerize-build-system +[5]: https://podman.io/getting-started/installation +[6]: https://docs.docker.com/develop/develop-images/multistage-build/ +[7]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/tutorial2_docker_tricks/ +[8]: https://github.com/ravi-chandran/dockerize-tutorial/ +[9]: https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh +[10]: https://stackoverflow.com/a/37214138 +[11]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/tutorial2_docker_tricks/install_anaconda.dockerfile +[12]: https://docs.docker.com/engine/reference/builder/#user +[13]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/tutorial2_docker_tricks/build_docker_image.sh +[14]: https://docs.docker.com/engine/faq/ +[15]: https://github.com/ravi-chandran/dockerize-tutorial/blob/master/tutorial2_docker_tricks/run_container.sh From 5f7878abb20e02ef342f2b37dfb720fddbfbc26b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 12 May 2020 00:57:33 +0800 Subject: [PATCH 0690/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200511=20How?= =?UTF-8?q?=20I=20track=20my=20home's=20energy=20consumption=20with=20open?= =?UTF-8?q?=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200511 How I track my home-s energy consumption with open source.md --- ...e-s energy consumption with open source.md | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 sources/tech/20200511 How I track my home-s energy consumption with open source.md diff --git a/sources/tech/20200511 How I track my home-s energy consumption with open source.md b/sources/tech/20200511 How I track my home-s energy consumption with open source.md new file mode 100644 index 0000000000..10dfaa5f8e --- /dev/null +++ b/sources/tech/20200511 How I track my home-s energy consumption with open source.md @@ -0,0 +1,144 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I track my home's energy consumption with open source) +[#]: via: (https://opensource.com/article/20/5/energy-monitoring) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) + +How I track my home's energy consumption with open source +====== +These open source components help you find ways to save money and +conserve resources. +![lightbulb drawing outline][1] + +An important step towards optimizing energy consumption is knowing your actual consumption. My house was built during the oil crisis in the 1970s, and due to the lack of a natural gas connection, the builders decided to use electricity to do all of the heating (water and home heating). This is not unusual for this area of Germany, and it remains an appropriate solution in countries that depend highly on nuclear power. + +Electricity prices here are quite high (around € 0.28/kWh), so I decided to monitor my home's energy consumption to get a feel for areas where I could save some energy. + +I used to work for a company that sold energy-monitoring systems for industrial customers. While this company mostly used proprietary software, you can set up a similar smart monitoring and logging solution for your home based on open source components. This article will show you how. + +In Germany, the grid operator owns the electricity meter. The grid operator is obliged to provide an interface on its metering device to enable the customer to access the meter reading. Here is the metering device on my home: + +![Actaris ACE3000 electricity meter][2] + +Actaris ACE3000 Type 110 (dry contact located behind the marked cover) + +Generally, almost every metering device has at least a [dry contact][3]—as my electricity meter does—that you can use to log metering. As you can see, my electricity meter has two counters: The upper one is for the day tariff (6am to 10pm), and the lower one is for the night tariff (10pm to 6am). The night tariff is a bit cheaper. Two-tariff meters are usually found only in houses with electric heating. + +### Design + +A reliable energy-monitoring solution for private use should meet the following requirements: + + * Logging of metering impulses (dry contact) + * 24/7 operation + * Energy-saving operation + * Visualization of consumption data + * Long-term recording of consumption data + * Connectivity (e.g., Ethernet, USB, WiFi, etc.) + * Affordability + + + +I choose the Siemens SIMATIC IOT2020 as my hardware platform. This industrial-proven device is based on an Intel Quark x86 CPU, has programmable interrupts, and is compatible with many Arduino shields. + +![Siemens SIMATIC IOT2020][4] + +Siemens SIMATIC IOT2020 + +The Siemens device comes without an SD card and, therefore, without an operating system. Luckily, you can find a current Yocto-based Linux OS image and instructions on how to flash the SD card in the [Siemens forum][5]. + +In addition to the hardware platform, you also need some accessories. The following materials list shows the minimum components you need. Each item includes links to the parts I purchased, so you can get a sense of the project's costs. + +#### Materials list + + * [Siemens SIMATIC IoT2020 unit][6] + * [Siemens I/O Shield for SIMATIC IoT2000 series][7] + * [microSD card][8] (2GB or more) + * [CSL 300Mbit USB-WLAN adapter][9] + * 24V power supply (I used a 2.1A [TDK-Lambda DRB50-24-1][10], which I already owned). You could use a less expensive power supply with less power: the SIMATIC IOT2020 has a maximum current of 1.4A, and the dry contact needs an additional 0.1A (24V / 220Ω). + * 5 terminal blocks ([Weidmueller WDU 2.5mm][11]) + * 2 terminal cross-connecting bridges ([Weidmueller WQV][12]) + * [DIN rail][13] (~300 mm) + * [220Ω / 3W resistor][14] + * Wire + + + +Here is the assembled result: + +![Mounted and hooked up energy logger][15] + +Energy logger mounted and hooked up + +Unfortunately, I didn't have enough space at the rear wall of the cabinet; therefore, the DIN rail with the mounted parts lies on the ground. + +The connections between the meter and the Siemens device look like this: + +![Wiring between meter and energy logger][16] + +### How it works + +A dry contact is a current interface. When the electricity meter triggers, a current of 0.1A starts flowing between **s0+** and **s0-**. On **DI0**, the voltage rises to 24V and triggers an interrupt. When the electricity meter disconnects **s0+** and **s0-**, **DI0** is grounded over the resistor. + +On my device, the contact closes 1,000 times per kWh (this value varies between metering devices). + +To count these peaks reliably, I created [a C program][17] that registers an interrupt service routine on the DI0 input and counts upwards in memory. Once a minute, the values from memory are written to an [SQLite][18] database. + +The overall meter reading is also written to a text file and can be preset with a starting value. This acts as a copy of the overall metering value of the meter in the cabinet. + +![Energy logger architecture][19] + +Energy logger architecture + +The data is visualized using [Node-RED][20], and I can access overviews, like the daily consumption dashboard below, over a web-based GUI. + +![Node-RED based GUI][21] + +Daily overview in the Node-RED GUI + +For the daily overview, I calculate the hourly costs based on the consumption data (the large bar chart). On the top-left of the dashboard you can see the actual power; below that is the daily consumption (energy and costs). The water heater for the shower causes the large peak in the bar chart. + +### A reliable system + +Aside from a lost timestamp during a power failure (the real-time clock in the Siemens device is not backed by a battery by default), everything has been working fine for more than one-and-a-half years. + +If you can set up the whole Linux system completely from the command line, you'll get a reliable and flexible system with the ability to link interrupt service routines to the I/O level. + +Because the I/O Shield runs on standard control voltage (24V), you can extend its functionality with the whole range of standardized industrial components (e.g., relays, sensors, actors, etc.). And, due to its open architecture, this system can be extended easily and applied to other applications, like for monitoring gas or water consumption or as a weather station, a simple controller for tasks, and more. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/energy-monitoring + +作者:[Stephan Avenwedde][a] +选题:[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/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Collaboration%20for%20health%20innovation.png?itok=s4O5EX2w (lightbulb drawing outline) +[2]: https://opensource.com/sites/default/files/uploads/openenergylogger_1_electricity_meter.jpg (Actaris ACE3000 electricity meter) +[3]: https://en.wikipedia.org/wiki/Dry_contact +[4]: https://opensource.com/sites/default/files/uploads/openenergylogger_2_siemens_device.jpg (Siemens SIMATIC IOT2020) +[5]: https://support.industry.siemens.com/tf/ww/en/posts/new-example-image-version-online/189090/?page=0&pageSize=10 +[6]: https://de.rs-online.com/web/p/products/1244037 +[7]: https://de.rs-online.com/web/p/products/1354133 +[8]: https://de.rs-online.com/web/p/micro-sd-karten/7582584/ +[9]: https://www.amazon.de/300Mbit-WLAN-Adapter-Hochleistungs-Antennen-Dual-Band/dp/B00LLIOT34 +[10]: https://de.rs-online.com/web/p/products/8153133 +[11]: https://de.rs-online.com/web/p/din-schienenklemmen-ohne-sicherung/0425190/ +[12]: https://de.rs-online.com/web/p/din-schienenklemmen-zubehor/0202574/ +[13]: https://de.rs-online.com/web/p/din-schienen/2835729/ +[14]: https://de.rs-online.com/web/p/widerstande-durchsteckmontage/2142673/ +[15]: https://opensource.com/sites/default/files/uploads/openenergylogger_3_assembled_device.jpg (Mounted and hooked up energy logger) +[16]: https://opensource.com/sites/default/files/uploads/openenergylogger_4_wiring.png (Wiring between meter and energy logger) +[17]: https://github.com/hANSIc99/OpenEnergyLogger +[18]: https://www.sqlite.org/index.html +[19]: https://opensource.com/sites/default/files/uploads/openenergylogger_5_architecure.png (Energy logger architecture) +[20]: https://nodered.org/ +[21]: https://opensource.com/sites/default/files/uploads/openenergylogger_6_dashboard.png (Node-RED based GUI) From 8444eebe508b9f12b7074679ac15165965d2deea Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 12 May 2020 00:58:29 +0800 Subject: [PATCH 0691/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200511=20Modi?= =?UTF-8?q?fy=20a=20disk=20image=20to=20create=20a=20Raspberry=20Pi-based?= =?UTF-8?q?=20homelab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200511 Modify a disk image to create a Raspberry Pi-based homelab.md --- ... to create a Raspberry Pi-based homelab.md | 240 ++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 sources/tech/20200511 Modify a disk image to create a Raspberry Pi-based homelab.md diff --git a/sources/tech/20200511 Modify a disk image to create a Raspberry Pi-based homelab.md b/sources/tech/20200511 Modify a disk image to create a Raspberry Pi-based homelab.md new file mode 100644 index 0000000000..fd73137fea --- /dev/null +++ b/sources/tech/20200511 Modify a disk image to create a Raspberry Pi-based homelab.md @@ -0,0 +1,240 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Modify a disk image to create a Raspberry Pi-based homelab) +[#]: via: (https://opensource.com/article/20/5/disk-image-raspberry-pi) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) + +Modify a disk image to create a Raspberry Pi-based homelab +====== +Create a "private cloud at home" with a Raspberry Pi or other +single-board computer. +![Science lab with beakers][1] + +Building a [homelab][2] can be a fun way to entertain yourself while learning new concepts and experimenting with new technologies. Thanks to the popularity of single-board computers (SBCs), led by the [Raspberry Pi][3], it is easier than ever to build a multi-computer lab right from the comfort of your home. Creating a "private cloud at home" is also a great way to get exposure to cloud-native technologies for considerably less money than trying to replicate the same setup with a major cloud provider. + +This article explains how to modify a disk image for the Raspberry Pi or another SBC, pre-configure the host for SSH (secure shell), and disable the service that forces interaction for configuration on first boot. This is a great way to make your devices "boot and go," similar to cloud instances. Later, you can do more specialized, in-depth configurations using automated processes over an SSH connection. + +Also, as you add more Pis to your lab, modifying disk images lets you just write the image to an SD card, drop it into the Pi, and go! + +![Multiple Raspberry Pi computers, a switch, and a power bank][4] + +### Decompress and mount the image + +For this project, you need to modify a server disk image. I used the [Fedora Server 31 ARM][5] image during testing. After you download the disk image and [verify its checksum][6], you need to decompress and mount it to a location on the host computer's file system so you can modify it as needed. + +You can use the **[xz][7]** command to decompress the Fedora Server image by using the **\--decompress** argument: + + +``` +`xz --decompress Fedora-Server-armhfp-X-y.z-sda.raw.xz` +``` + +This leaves you with a raw, decompressed disk image (which automatically replaces the **.xz** compressed file). This raw disk image is just what it sounds like: a file containing all the data that would be on a formatted and installed disk. That includes partition information, the boot partition, the root partition, and any other partitions. You need to mount the partition you intend to work in, but to do that, you need information about where that partition starts in the disk image and the size of the sectors on the disk, so you can mount the file at the right sector. + +Luckily, you can use the [**fdisk**][8] command on a disk image just as easily as on a real disk and use the **\--list** or **-l** argument to view the list of partitions and their information: + + +``` +# Use fdisk to list the partitions in the raw image: +$ fdisk -l Fedora-Server-armhfp-31-1.9-sda.raw +Disk Fedora-Server-armhfp-X-y.z-sda.raw: 3.2 GiB, 3242196992 bytes, 6332416 sectors +Units: sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 512 bytes +I/O size (minimum/optimal): 512 bytes / 512 bytes +Disklabel type: dos +Disk identifier: 0xdaad9f57 + +Device                               Boot   Start     End Sectors  Size Id Type +Fedora-Server-armhfp-X-y.z-sda.raw1         8192  163839  155648   76M  c W95 F +Fedora-Server-armhfp-X-y.z-sda.raw2 *     163840 1163263  999424  488M 83 Linux +Fedora-Server-armhfp-X-y.z-sda.raw3      1163264 6047743 4884480  2.3G 83 Linux +``` + +All the information you need is available in this output. Line 3 indicates the sector size, both logical and physical: (512 bytes / 512 bytes). + +The list of devices shows the partitions inside the raw disk image. The first one, **Fedora-Server-armhfp-X-y.z-sda.raw1** is no doubt the bootloader partition because it is the first, small (only 76MB), and type W95 FAT32 (LBA), as identified by the Id "c," a FAT32 partition for booting off the SD card. + +The second partition is not very large either, just 488MB. This partition is a Linux native-type partition (Id 83), and it probably is the Linux boot partition containing the kernel and [initramfs][9]. + +The third partition is what you probably want: it is 2.3GB, so it should have the majority of the distribution on it, and it is a Linux-native partition type, which is expected. This should contain the partition and data you want to modify. + +The third partition starts on sector 1163264 (indicated by the "Start" column in the output of **fdisk**), so your mount offset is **595591168**, calculated by multiplying the sector size (512) by the start sector (1163264) (i.e., **512 * 1163264**). This means you need to mount the file with an offset of 595591168 to be in the right place at the mount point. + +ARMed (see what I did there?) with this information, you can now mount the third partition to a directory in your homedir: + + +``` +$ mkdir ~/mnt +$ sudo mount -o loop,offset=595591168 Fedora-Server-armhfp-X-y.z-sda.raw ~/mnt +$ ls ~/mnt +``` + +### Work directly within the disk image + +Once the disk image has been decompressed and mounted to a spot on the host computer, it is time to start modifying the image to suit your needs. In my opinion, the easiest way to make changes to the image is to use **chroot** to change the working root of your session to that of the mounted image. There's a tricky bit, though. + +When you change root, your session will use the binaries from the new root. Unless you are doing all of this from an ARM system, the architecture of the decompressed disk image will not be the same as the host system you are using. Even inside the **chroot**, the host system will not be able to make use of binaries with a different architecture. At least, not natively. + +Luckily, there is a solution: **qemu-user-static**. From the [Debian Wiki][10]: + +> "[qemu-user-static] provides the user mode emulation binaries, built statically. In this mode QEMU can launch Linux processes compiled for one CPU on another CPU… If binfmt-support package is installed, qemu-user-static package will register binary formats which the provided emulators can handle, so that it will be possible to run foreign binaries directly." + +This is exactly what you need to be able to work in the non-native architecture inside your chroot. If the host system is Fedora, install the **qemu-user-static** package with DNF, and restart **systemd-binfmt.service**: + + +``` +# Enable non-native arch chroot with DNF, adding new binary format information +# Output suppressed for brevity +$ dnf install qemu-user-static +$ systemctl restart systemd-binfmt.service +``` + +With this, you should be able to change root to the mounted disk image and run the **uname** command to verify that everything is working: + + +``` +sudo chroot ~/mnt/ /usr/bin/uname -a -r +Linux marvin 5.5.16-200.fc31.x86_64 #1 SMP Wed Apr 8 16:43:33 UTC 2020 armv7l armv7l armv7l GNU/Linux +``` + +Running **uname** from within the changed root shows **armv7l** in the output—the architecture of the raw disk image—and not the host machine. Everything is working as expected, and you can continue on to modify the image. + +### Modify the disk image + +Now that you can change directly into the ARM-based disk image and work in that environment, you can begin to make changes to the image itself. You want to set up the image so it can be booted and immediately accessed without having to do any additional setup directly on the Raspberry Pi. To do this, you need to install and enable sshd (the OpenSSH daemon) and add the authorized keys for SSH access. + +And to make this behave more like a cloud environment and realize the dream of a private cloud at home, add a local user, give that user **sudo** rights, and (to be just like the cloud heavyweights) allow that user to use **sudo** without a password. + +So, your to-do list is: + + * Install and enable SSHD (SSHD is already installed and enabled in the Fedora ARM image, but you may need to do this manually for your distribution) + * Set up a local user + * Allow the local user to use sudo (without a password, optional) + * Add authorized keys + * Allow root to SSH with the authorized keys (optional) + + + +I use the GitHub feature that allows you to upload your public SSH keys and make them available at **[https://github.com/<your_github_username>.keys][11]**. I find this to be a convenient way to distribute public keys, although I am paranoid enough that I always check that the downloaded keys match what I am expecting. If you don't want to use this method, you can copy your public keys into the **chroot** directly from your host computer, or you can host your keys on a web server that you control in order to use the same workflow. + +To start modifying the disk image, **chroot** into the mounted disk image again, this time starting a shell so multiple commands can be run: + + +``` +# Output of these commands (if any) are omitted for brevity +$ sudo chroot ~/mnt /bin/bash + +# Install openssh-server and enable it (already done on Fedora) +$ dnf install -y openssh-server +$ systemctl enable sshd.service + +# Allow root to SSH with your authorized keys +$ mkdir /root/.ssh + +# Download, or otherwise add to the authorized_keys file, your public keys +# Replace the URL with the path to your own public keys +$ curl -o /root/.ssh/authorized_keys +$ chmod 700 /root/.ssh +$ chmod 600 /root/.ssh/authorized_keys + +# Add a local user, and put them in the wheel group +# Change the group and user to whatever you desire +groupadd chris +useradd -g chris -G wheel -m -u 1000 chris + +# Download or add your authorized keys +# Change the homedir and URL as you've done above +mkdir /home/chris/.ssh +curl -o /home/chris/.ssh/authorized_keys +chmod 700 /home/chris/.ssh +chmod 600 /home/chris/.ssh/authorized_keys +chown -R chris.chris /home/chris/.ssh/ + +# Allow the wheel group (with your local user) to use suso without a password +echo "%wheel ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/91-wheel-nopasswd +``` + +This is all that generally needs to be done to set up SSH into a Raspberry Pi or other single-board computer on first boot. However, each distribution has its own quirks. For example, Rasbian already includes a local user, **pi**, and does not use the **wheel** group. So for Raspbian, it may be better to use the existing user or to delete the **pi** user and replace it with another. + +In the case of Fedora ARM, the image prompts you to finish setup on first boot. This defeats the purpose of the changes you made above, especially since it blocks startup entirely until setup is complete. Your goal is to make the Raspberry Pi function like part of a private cloud infrastructure, and that workflow includes setting up the host remotely via SSH when it starts up.  Disable the initial setup, controlled by the service **initial-setup.service**: + + +``` +# Disable the initial-setup.service for both the multi-user and graphical targets +unlink /etc/systemd/system/multi-user.target.wants/initial-setup.service +unlink /etc/systemd/system/graphical.target.wants/initial-setup.service +``` + +While you are in the change root, you can make any other changes you might want for your systems or just leave it at that and follow the cloud-native workflow of configuration over SSH after first boot. + +### Recompress and install the modified image + +With these changes to your system completed, all that is left is to recompress the disk image and install it on an SD card for your Raspberry Pi. + +Make sure to exit the chroot, then unmount the disk image: + + +``` +`$ sudo umount ~/mnt/` +``` + +Just as you decompressed the image initially, you can use the **xz** command again to compress the image. By using the **\--keep** argument, **xz** will leave the raw image rather than cleaning it up. While this uses more disk space, leaving the uncompressed image allows you to make incremental changes to the images you are working with without needing to decompress them each time. This is great for saving time while testing and tweaking images to your liking: + + +``` +# Compress the raw disk image to a .xz file, but keep the raw disk image +xz --compress Fedora-Server-armhfp-31-1.9-sda.raw --keep +``` + +The compression takes a while, so take this time to stand up, stretch, and get your blood flowing again. + +Once the compression is done, the new, modified disk image can be copied to an SD card to use with a Raspberry Pi. The standard **dd** method to copy the image to the SD card works fine, but I like to use Fedora's **arm-image-installer** because of the options it provides when working with unedited images. It also works great for edited images and is a little more user-friendly than the **dd** command. + +Make sure to check which disk the SD card is on and use that for the **\--media** argument: + + +``` +# Use arm-image-installer to copy the modified disk image to the SD card +arm-image-installer --image=Fedora-Server-armhfp-X-y.z-sda.raw.xz --target=rpi3 --media=/dev/sdc --norootpass --resizefs -y +``` + +Now you are all set with a new, modified Fedora Server ARM image for Raspberry Pis or other single board computers, ready to boot and immediately SSH into with your modifications. This method can also be used to make other changes, and you can use it with other distributions' raw disk images if you prefer them to Fedora. This is a good base to start building a private-cloud-at-home homelab. In future articles, I will guide you through setting up a homelab using cloud technologies and automation. + +### Further reading + +A lot of research went into learning how to do the things in this article. Two of the most helpful sources I found for learning how to customize disk images and work with non-native architectures are listed below. They were extremely helpful in rounding the corner from "I have no idea what I'm doing" to "OK, I can do this!" + + * [How to modify a raw disk image of your custom Linux distro][12] + * [Using DNF wiki][13] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/disk-image-raspberry-pi + +作者:[Chris Collins][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clcollins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/science_experiment_beaker_lab.png?itok=plKWRhlU (Science lab with beakers) +[2]: https://opensource.com/article/19/3/home-lab +[3]: https://opensource.com/resources/raspberry-pi +[4]: https://opensource.com/sites/default/files/uploads/raspberrypi_homelab.jpg (Multiple Raspberry Pi computers, a switch, and a power bank) +[5]: https://arm.fedoraproject.org/ +[6]: https://arm.fedoraproject.org/verify.html +[7]: https://tukaani.org/xz/ +[8]: https://en.wikipedia.org/wiki/Fdisk +[9]: https://wiki.debian.org/initramfs +[10]: https://wiki.debian.org/RaspberryPi/qemu-user-static +[11]: https://github.com/%3Cyour_github_username%3E.keys +[12]: https://www.linux.com/news/how-modify-raw-disk-image-your-custom-linux-distro/ +[13]: https://wiki.mageia.org/en/Using_DNF#Setting_up_a_container_for_a_non-native_architectur From cdc3319ccbe1418776d2d65f487bd1ec9c3caa9b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 12 May 2020 00:59:21 +0800 Subject: [PATCH 0692/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200511=20Star?= =?UTF-8?q?t=20using=20systemd=20as=20a=20troubleshooting=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200511 Start using systemd as a troubleshooting tool.md --- ...using systemd as a troubleshooting tool.md | 269 ++++++++++++++++++ 1 file changed, 269 insertions(+) create mode 100644 sources/tech/20200511 Start using systemd as a troubleshooting tool.md diff --git a/sources/tech/20200511 Start using systemd as a troubleshooting tool.md b/sources/tech/20200511 Start using systemd as a troubleshooting tool.md new file mode 100644 index 0000000000..372be7660e --- /dev/null +++ b/sources/tech/20200511 Start using systemd as a troubleshooting tool.md @@ -0,0 +1,269 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Start using systemd as a troubleshooting tool) +[#]: via: (https://opensource.com/article/20/5/systemd-troubleshooting-tool) +[#]: author: (David Both https://opensource.com/users/dboth) + +Start using systemd as a troubleshooting tool +====== +While systemd is not really a troubleshooting tool, the information in +its output points the way toward solving problems. +![Magnifying glass on code][1] + +No one would really consider systemd to be a troubleshooting tool, but when I encountered a problem on my webserver, my growing knowledge of systemd and some of its features helped me locate and circumvent the problem. + +The problem was that my server, yorktown, which provides name services, DHCP, NTP, HTTPD, and SendMail email services for my home office network, failed to start the Apache HTTPD daemon during normal startup. I had to start it manually after I realized that it was not running. The problem had been going on for some time, and I recently got around to trying to fix it. + +Some of you will say that systemd itself is the cause of this problem, and, based on what I know now, I agree with you. However, I had similar types of problems with SystemV. (In the [first article][2] in this series, I looked at the controversy around systemd as a replacement for the old SystemV init program and startup scripts. If you're interested in learning more about systemd, read the [second][3] and [third][4] articles, too.) No software is perfect, and neither systemd nor SystemV is an exception, but systemd provides far more information for problem-solving than SystemV ever offered. + +### Determining the problem + +The first step to finding the source of this problem is to determine the httpd service's status: + + +``` +[root@yorktown ~]# systemctl status httpd +● httpd.service - The Apache HTTP Server +   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) +   Active: failed (Result: exit-code) since Thu 2020-04-16 11:54:37 EDT; 15min ago +     Docs: man:httpd.service(8) +  Process: 1101 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE) + Main PID: 1101 (code=exited, status=1/FAILURE) +   Status: "Reading configuration..." +      CPU: 60ms + +Apr 16 11:54:35 yorktown.both.org systemd[1]: Starting The Apache HTTP Server... +Apr 16 11:54:37 yorktown.both.org httpd[1101]: (99)Cannot assign requested address: AH00072: make_sock: could not bind to address 192.168.0.52:80 +Apr 16 11:54:37 yorktown.both.org httpd[1101]: no listening sockets available, shutting down +Apr 16 11:54:37 yorktown.both.org httpd[1101]: AH00015: Unable to open logs +Apr 16 11:54:37 yorktown.both.org systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE +Apr 16 11:54:37 yorktown.both.org systemd[1]: httpd.service: Failed with result 'exit-code'. +Apr 16 11:54:37 yorktown.both.org systemd[1]: Failed to start The Apache HTTP Server. +[root@yorktown ~]# +``` + +This status information is one of the systemd features that I find much more useful than anything SystemV offers. The amount of helpful information here leads me easily to a logical conclusion that takes me in the right direction. All I ever got from the old **chkconfig** command is whether or not the service is running and the process ID (PID) if it is. That is not very helpful. + +The key entry in this status report shows that HTTPD cannot bind to the IP address, which means it cannot accept incoming requests. This indicates that the network is not starting fast enough to be ready for the HTTPD service to bind to the IP address because the IP address has not yet been set. This is not supposed to happen, so I explored my network service systemd startup configuration files; all appeared to be correct with the right "after" and "requires" statements. Here is the **/lib/systemd/system/httpd.service** file from my server: + + +``` +# Modifying this file in-place is not recommended, because changes                                                                                     +# will be overwritten during package upgrades.  To customize the                                                                                       +# behaviour, run "systemctl edit httpd" to create an override unit.                                                                                   +                                                                                                                                                      +# For example, to pass additional options (such as -D definitions) to                                                                                 +# the httpd binary at startup, create an override unit (as is done by                                                                                 +# systemctl edit) and enter the following:                                                                                                             +                                                                                                                                                      +#       [Service]                                                                                                                                     +#       Environment=OPTIONS=-DMY_DEFINE                                                                                                               +                                                                                                                                                      +[Unit]                                                                                                                                                 +Description=The Apache HTTP Server                                                                                                                     +Wants=httpd-init.service                                                                                                                               +After=network.target remote-fs.target nss-lookup.target httpd-init.service                                                                             +Documentation=man:httpd.service(8)                                                                                                                     +                                                                                                                                                      +[Service]                                                                                                                                             +Type=notify                                                                                                                                           +Environment=LANG=C                                                                                                                                     +                                                                                                                                                      +ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND                                                                                                       +ExecReload=/usr/sbin/httpd $OPTIONS -k graceful                                                                                                       +# Send SIGWINCH for graceful stop                                                                                                                     +KillSignal=SIGWINCH                                                                                                                                   +KillMode=mixed                                                                                                                                         +PrivateTmp=true                                                                                                                                       +                                                                                                                                                      +[Install]                                                                                                                                             +WantedBy=multi-user.target +``` + +The **httpd.service** unit file explicitly specifies that it should load after the **network.target** and the **httpd-init.service** (among others). I tried to find all of these services using the **systemctl list-units** command and searching for them in the resulting data stream. All were present and should have ensured that the httpd service did not load before the network IP address was set. + +### First solution + +A bit of searching on the internet confirmed that others had encountered similar problems with httpd and other services. This appears to happen because one of the required services indicates to systemd that it has finished its startup—but it actually spins off a child process that has not finished. After a bit more searching, I came up with a circumvention. + +I could not figure out why the IP address was taking so long to be assigned to the network interface card. So, I thought that if I could delay the start of the HTTPD service by a reasonable amount of time, the IP address would be assigned by that time. + +Fortunately, the **/lib/systemd/system/httpd.service** file above provides some direction. Although it says not to alter it, it does indicate how to proceed: Use the command **systemctl edit httpd**, which automatically creates a new file (**/etc/systemd/system/httpd.service.d/override.conf**) and opens the [GNU Nano][5] editor. (If you are not familiar with Nano, be sure to look at the hints at the bottom of the Nano interface.) + +Add the following text to the new file and save it: + + +``` +[root@yorktown ~]# cd /etc/systemd/system/httpd.service.d/ +[root@yorktown httpd.service.d]# ll +total 4 +-rw-r--r-- 1 root root 243 Apr 16 11:43 override.conf +[root@yorktown httpd.service.d]# cat override.conf +# Trying to delay the startup of httpd so that the network is +# fully up and running so that httpd can bind to the correct +# IP address +# +# By David Both, 2020-04-16 + +[Service] +ExecStartPre=/bin/sleep 30 +``` + +The **[Service]** section of this override file contains a single line that delays the start of the HTTPD service by 30 seconds. The following status command shows the service status during the wait time: + + +``` +[root@yorktown ~]# systemctl status httpd +● httpd.service - The Apache HTTP Server +   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) +  Drop-In: /etc/systemd/system/httpd.service.d +           └─override.conf +           /usr/lib/systemd/system/httpd.service.d +           └─php-fpm.conf +   Active: activating (start-pre) since Thu 2020-04-16 12:14:29 EDT; 28s ago +     Docs: man:httpd.service(8) +Cntrl PID: 1102 (sleep) +    Tasks: 1 (limit: 38363) +   Memory: 260.0K +      CPU: 2ms +   CGroup: /system.slice/httpd.service +           └─1102 /bin/sleep 30 + +Apr 16 12:14:29 yorktown.both.org systemd[1]: Starting The Apache HTTP Server... +Apr 16 12:15:01 yorktown.both.org systemd[1]: Started The Apache HTTP Server. +[root@yorktown ~]# +``` + +And this command shows the status of the HTTPD service after the 30-second delay expires. The service is up and running correctly: + + +``` +[root@yorktown ~]# systemctl status httpd +● httpd.service - The Apache HTTP Server +   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) +  Drop-In: /etc/systemd/system/httpd.service.d +           └─override.conf +           /usr/lib/systemd/system/httpd.service.d +           └─php-fpm.conf +   Active: active (running) since Thu 2020-04-16 12:15:01 EDT; 1min 18s ago +     Docs: man:httpd.service(8) +  Process: 1102 ExecStartPre=/bin/sleep 30 (code=exited, status=0/SUCCESS) + Main PID: 1567 (httpd) +   Status: "Total requests: 0; Idle/Busy workers 100/0;Requests/sec: 0; Bytes served/sec:   0 B/sec" +    Tasks: 213 (limit: 38363) +   Memory: 21.8M +      CPU: 82ms +   CGroup: /system.slice/httpd.service +           ├─1567 /usr/sbin/httpd -DFOREGROUND +           ├─1569 /usr/sbin/httpd -DFOREGROUND +           ├─1570 /usr/sbin/httpd -DFOREGROUND +           ├─1571 /usr/sbin/httpd -DFOREGROUND +           └─1572 /usr/sbin/httpd -DFOREGROUND + +Apr 16 12:14:29 yorktown.both.org systemd[1]: Starting The Apache HTTP Server... +Apr 16 12:15:01 yorktown.both.org systemd[1]: Started The Apache HTTP Server. +``` + +I could have experimented to see if a shorter delay would work as well, but my system is not that critical, so I decided not to. It works reliably as it is, so I am happy. + +Because I gathered all this information, I reported it to Red Hat Bugzilla as Bug [1825554][6]. I believe that it is much more productive to report bugs than it is to complain about them. + +### The better solution + +A couple of days after reporting this as a bug, I received a response indicating that systemd is just the manager, and if httpd needs to be ordered after some requirements are met, it needs to be expressed in the unit file. The response pointed me to the **httpd.service** man page. I wish I had found this earlier because it is a better solution than the one I came up with. This solution is explicitly targeted to the prerequisite target unit rather than a somewhat random delay. + +From the [**httpd.service** man page][7]: + +> **Starting the service at boot time** +> +> The httpd.service and httpd.socket units are _disabled_ by default. To start the httpd service at boot time, run: **systemctl enable httpd.service**. In the default configuration, the httpd daemon will accept connections on port 80 (and, if mod_ssl is installed, TLS connections on port 443) for any configured IPv4 or IPv6 address. +> +> If httpd is configured to depend on any specific IP address (for example, with a "Listen" directive) which may only become available during start-up, or if httpd depends on other services (such as a database daemon), the service _must_ be configured to ensure correct start-up ordering. +> +> For example, to ensure httpd is only running after all configured network interfaces are configured, create a drop-in file (as described above) with the following section: +> +> [Unit] +> After=network-online.target +> Wants=network-online.target + +I still think this is a bug because it is quite common—at least in my experience—to use a **Listen** directive in the **httpd.conf** configuration file. I have always used **Listen** directives, even on hosts with only a single IP address, and it is clearly necessary on hosts with multiple network interface cards (NICs) and internet protocol (IP) addresses. Adding the lines above to the **/usr/lib/systemd/system/httpd.service** default file would not cause problems for configurations that do not use a **Listen** directive and would prevent this problem for those that do. + +In the meantime, I will use the suggested solution. + +### Next steps + +This article describes a problem I had with starting the Apache HTTPD service on my server. It leads you through the problem determination steps I took and shows how I used systemd to assist. I also covered the circumvention I implemented using systemd and the better solution that followed from my bug report. + +As I mentioned at the start, it is very likely that this is the result of a problem with systemd, specifically the configuration for httpd startup. Nevertheless, systemd provided me with the tools to locate the likely source of the problem and to formulate and implement a circumvention. Neither solution really resolves the problem to my satisfaction. For now, the root cause of the problem still exists and must be fixed. If that is simply adding the recommended lines to the **/usr/lib/systemd/system/httpd.service** file, that would work for me. + +One of the things I discovered during this is process is that I need to learn more about defining the sequences in which things start. I will explore that in my next article, the fifth in this series. + +### Resources + +There is a great deal of information about systemd available on the internet, but much is terse, obtuse, or even misleading. In addition to the resources mentioned in this article, the following webpages offer more detailed and reliable information about systemd startup. + + * The Fedora Project has a good, practical [guide][8] [to systemd][8]. It has pretty much everything you need to know in order to configure, manage, and maintain a Fedora computer using systemd. + * The Fedora Project also has a good [cheat sheet][9] that cross-references the old SystemV commands to comparable systemd ones. + * For detailed technical information about systemd and the reasons for creating it, check out [Freedesktop.org][10]'s [description of systemd][11]. + * [Linux.com][12]'s "More systemd fun" offers more advanced systemd [information and tips][13]. + + + +There is also a series of deeply technical articles for Linux sysadmins by Lennart Poettering, the designer and primary developer of systemd. These articles were written between April 2010 and September 2011, but they are just as relevant now as they were then. Much of everything else good that has been written about systemd and its ecosystem is based on these papers. + + * [Rethinking PID 1][14] + * [systemd for Administrators, Part I][15] + * [systemd for Administrators, Part II][16] + * [systemd for Administrators, Part III][17] + * [systemd for Administrators, Part IV][18] + * [systemd for Administrators, Part V][19] + * [systemd for Administrators, Part VI][20] + * [systemd for Administrators, Part VII][21] + * [systemd for Administrators, Part VIII][22] + * [systemd for Administrators, Part IX][23] + * [systemd for Administrators, Part X][24] + * [systemd for Administrators, Part XI][25] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/systemd-troubleshooting-tool + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/find-file-linux-code_magnifying_glass_zero.png?itok=E2HoPDg0 (Magnifying glass on code) +[2]: https://opensource.com/article/20/4/systemd +[3]: https://opensource.com/article/20/4/systemd-startup +[4]: https://opensource.com/article/20/4/understanding-and-using-systemd-units +[5]: https://www.nano-editor.org/ +[6]: https://bugzilla.redhat.com/show_bug.cgi?id=1825554 +[7]: https://www.mankier.com/8/httpd.service#Description-Starting_the_service_at_boot_time +[8]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html +[9]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet +[10]: http://Freedesktop.org +[11]: http://www.freedesktop.org/wiki/Software/systemd +[12]: http://Linux.com +[13]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ +[14]: http://0pointer.de/blog/projects/systemd.html +[15]: http://0pointer.de/blog/projects/systemd-for-admins-1.html +[16]: http://0pointer.de/blog/projects/systemd-for-admins-2.html +[17]: http://0pointer.de/blog/projects/systemd-for-admins-3.html +[18]: http://0pointer.de/blog/projects/systemd-for-admins-4.html +[19]: http://0pointer.de/blog/projects/three-levels-of-off.html +[20]: http://0pointer.de/blog/projects/changing-roots +[21]: http://0pointer.de/blog/projects/blame-game.html +[22]: http://0pointer.de/blog/projects/the-new-configuration-files.html +[23]: http://0pointer.de/blog/projects/on-etc-sysinit.html +[24]: http://0pointer.de/blog/projects/instances.html +[25]: http://0pointer.de/blog/projects/inetd.html From ff398b5c4003a285cd4ce63af944d8ffd4dca16f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 12 May 2020 03:50:20 +0800 Subject: [PATCH 0693/1809] Revert "Translating by MjSeven" This reverts commit b8be7d43683d0dfc5a439c370b153abbb18fce97. --- ... to use pyenv to run multiple versions of Python on a Mac.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md b/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md index a77ff4ede5..4d15072b90 100644 --- a/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md +++ b/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (MjSeven) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8650af3c8ccef6e29dacca2028b0ce61ebaa763f Mon Sep 17 00:00:00 2001 From: guevaraya Date: Tue, 12 May 2020 05:53:55 +0800 Subject: [PATCH 0694/1809] Update 20200428 Open source has room for everyone.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申领文章 --- sources/tech/20200428 Open source has room for everyone.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200428 Open source has room for everyone.md b/sources/tech/20200428 Open source has room for everyone.md index bab55ddfbe..4804b15168 100644 --- a/sources/tech/20200428 Open source has room for everyone.md +++ b/sources/tech/20200428 Open source has room for everyone.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( guevaraya) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From fc4880425cdcd4ded5d34970d1f89e97732d273e Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 12 May 2020 08:44:41 +0800 Subject: [PATCH 0695/1809] translated --- ...in Ubuntu and Other Linux Distributions.md | 112 ------------------ ...in Ubuntu and Other Linux Distributions.md | 112 ++++++++++++++++++ 2 files changed, 112 insertions(+), 112 deletions(-) delete mode 100644 sources/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md create mode 100644 translated/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md b/sources/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md deleted file mode 100644 index 637f438ed8..0000000000 --- a/sources/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md +++ /dev/null @@ -1,112 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Fixing “Unable to parse package file /var/lib/apt/lists” Error in Ubuntu and Other Linux Distributions) -[#]: via: (https://itsfoss.com/unable-to-parse-package-file/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Fixing “Unable to parse package file /var/lib/apt/lists” Error in Ubuntu and Other Linux Distributions -====== - -I have discussed a number of [Ubuntu update errors][1] in the past. If you [use the command line to update Ubuntu][2], you might run into some ‘errors’. - -Some of these ‘errors’ are basically built-in features to prevent unwarranted changes to your system. I am not going into those details in this quick tutorial. - -In this quick tip, I’ll show you how to tackle the following error that you could encounter while updating your system or installing new software: - -**Reading package lists… Error! -E: Unable to parse package file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease -E: The package lists or status file could not be parsed or opened.** - -A similar error can be encountered in Debian: - -**E: Unable to parse package file /var/lib/apt/extended_states (1)** - -There is absolutely no need to panic even thought it says ‘**The package cache file is corrupted**‘. This is really easy to ‘fix’. - -### Handling “Unable to parse package file” error in Ubuntu and Debian-based Linux distributions - -![][3] - -Here’s what you need to do. Take a closer look at the name and path of the file the [Ubuntu][4] is complaining about. - -Reading package lists… Error! -**E: Unable to parse package file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease** -E: The package lists or status file could not be parsed or opened. - -For example, in the above error, it was complaining about /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease - -This gives you the idea that something is not right with this file. Now all you need to do is to remove this file and regenerate the cache. - -``` -sudo rm -``` - -So in my case, I could use this command: **sudo rm /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease** and then rebuild the cache with sudo apt update command. - -#### Step by step for beginners - -If you are familiar with Linux commands, you may know how to do delete the file with its absolute path. For novice users, let me guide you to safely delete the file. - -First, you should go to the directory where the file is stored: - -``` -cd /var/lib/apt/lists/ -``` - -Now delete the file which is not being parsed: - -``` -sudo rm archive.ubuntu.com_ubuntu_dists_bionic_InRelease -``` - -Now if you run the update again, the apt cache will be regenerated. - -``` -sudo apt update -``` - -#### Too many files cannot be parsed? - -This is fine if you have one or two files that are not being parsed while updating the system. But if the system complains about ten or twenty such files, removing them one by one is too tiring. - -What you can do in such a case to remove the entire cache and then generate it again: - -``` -sudo rm -r /var/lib/apt/lists/* -sudo apt update -``` - -#### Explanation of how it fixed your problem - -The /var/lib/apt is the directory where files and data related to the apt package manager are stored. The /var/lib/apt/lists is the directory which is used for storing information for each package resource specified in your system’s sources.list. - -In slightly non complicated terms, this /var/lib/apt/lists stores the package information cache. When you want to install or update a program, your system checks in this directory for the information on the said package. If it finds the detail on the package, then it goes to remote repository and actually download the program or its update. - -When you run the “sudo apt update”, it builds the cache. This is why even when you remove everything in the /var/lib/apt/lists directory, running the update will build a fresh cache. - -This is how it handles the issue of file not being parsed. Your system complained about a particular package or repository information that somehow got corrupted (either a failed download or manual change to sources.list). Removing that file (or everything) and rebuilding the cache solves the issue. - -#### Still facing error? - -This should fix the issue for you. But if the problem still persists or if you have some other related issue, let me know in the comment section and I’ll try to help you out. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/unable-to-parse-package-file/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/ubuntu-update-error/ -[2]: https://itsfoss.com/update-ubuntu/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/Unable-to-parse-package-file.png?ssl=1 -[4]: https://ubuntu.com/ diff --git a/translated/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md b/translated/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..cfad9fdfc4 --- /dev/null +++ b/translated/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fixing “Unable to parse package file /var/lib/apt/lists” Error in Ubuntu and Other Linux Distributions) +[#]: via: (https://itsfoss.com/unable-to-parse-package-file/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +修复 Ubuntu 和其他 Linux 发行版中的 “Unable to parse package file /var/lib/apt/lists” 错误 +====== + +过去,我已经讨论了许多 [Ubuntu 更新错误][1]。如果你[使用命令行更新 Ubuntu][2],那可能会遇到一些“错误”。 + +其中一些“错误”基本上是内置功能,可防止对系统进行不必要的更改。在本教程中,我不会涉及那些细节。 + +在本文中,我将向你展示如何解决在更新系统或安装新软件时可能遇到的以下错误: + +**Reading package lists… Error! +E: Unable to parse package file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease +E: The package lists or status file could not be parsed or opened.** + +在 Debian 中可能会遇到类似的错误: + +**E: Unable to parse package file /var/lib/apt/extended_states (1)** + +即使遇到 “**The package cache file is corrupted**” 也完全不必惊慌。这真的很容易“修复”。 + +### 在基于 Ubuntu 和 Debian 的 Linux 发行版中处理 “Unable to parse package file” 错误 + +![][3] + +以下是你需要做的。仔细查看 [Ubuntu][4] 报错文件的名称和路径。 + +Reading package lists… Error! +**E: Unable to parse package file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease** +E: The package lists or status file could not be parsed or opened. + +例如,上面的错误是在报 /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease 文件错误。 + +这让你想到这个文件不正确。现在,你需要做的就是删除该文件并重新生成缓存。 + +``` +sudo rm +``` + +因此,这里我可以使用以下命令:**sudo rm /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease**,然后使用 sudo apt update 命令重建缓存。 + +#### 给初学者的分步指导 + +如果你熟悉 Linux 命令,那么可能知道如何使用绝对路径删除文件。对于新手用户,让我指导你安全删除文件。 + +首先,你应该进入文件目录: + +``` +cd /var/lib/apt/lists/ +``` + +现在删除无法解析的文件: + +``` +sudo rm archive.ubuntu.com_ubuntu_dists_bionic_InRelease +``` + +现在,如果你再次运行更新,将重新生成 apt 缓存。 + +``` +sudo apt update +``` + +#### 有很多文件无法解析? + +如果你在更新系统时有一个或两个文件无法解析,那么问题不大。但是,如果系统报错有十个或二十个此类文件,那么一一删除它们就太累了。 + +在这种情况下,你可以执行以下操作来删除整个缓存,然后再次生成它: + +``` +sudo rm -r /var/lib/apt/lists/* +sudo apt update +``` + +#### 解释这为何能解决问题 + +/var/lib/apt 是与 apt 软件包管理器相关的文件和数据的存储目录。/var/lib/apt/lists 是用于保存系统 source.list 中指定的每个软件包资源信息的目录。 + +简单点来说,/var/lib/apt/lists 保存软件包信息缓存。当你要安装或更新程序时,系统会在此目录中检查该软件包中的信息。如果找到了该包的详细信息,那么它将进入远程仓库并实际下载程序或其更新。 + +当你运行 “sudo apt update” 时,它将构建缓存。这就是为什么即使删除 /var/lib/apt/lists 目录中的所有内容,运行更新也会建立新的缓存的原因。 + +这就是处理文件无法解析问题的方式。你的系统报某个软件包或仓库信息以某种方式损坏(下载失败或手动更改 sources.list)。删除该文件(或所有文件)并重建缓存即可解决此问题。 + +#### 仍然有错误? + +这应该能解决你的问题。但是,如果问题仍然存在,或者你还有其他相关问题,请在评论栏告诉我,我将尽力帮助你。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/unable-to-parse-package-file/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-update-error/ +[2]: https://itsfoss.com/update-ubuntu/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/Unable-to-parse-package-file.png?ssl=1 +[4]: https://ubuntu.com/ From f78f16c497b82f519a5f3842dcbea1735a9ce9d5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 12 May 2020 09:03:44 +0800 Subject: [PATCH 0696/1809] translating --- ...tall Deb File on Ubuntu 20.04- Here-s What You Need to do.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md b/sources/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md index d5b106895b..3aee14cf14 100644 --- a/sources/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md +++ b/sources/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d1ae6300992dba923927b26d72641e6233185313 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Tue, 12 May 2020 20:20:42 +0800 Subject: [PATCH 0697/1809] TSL --- ... Go binaries by prohibiting comparisons.md | 164 ------------------ ... Go binaries by prohibiting comparisons.md | 164 ++++++++++++++++++ 2 files changed, 164 insertions(+), 164 deletions(-) delete mode 100644 sources/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md create mode 100644 translated/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md diff --git a/sources/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md b/sources/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md deleted file mode 100644 index 424434adbb..0000000000 --- a/sources/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md +++ /dev/null @@ -1,164 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ensmallening Go binaries by prohibiting comparisons) -[#]: via: (https://dave.cheney.net/2020/05/09/ensmallening-go-binaries-by-prohibiting-comparisons) -[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) - -Ensmallening Go binaries by prohibiting comparisons -====== - -Conventional wisdom dictates that the larger the number of types declared in a Go program, the larger the resulting binary. Intuitively this makes sense, after all, what’s the point in defining a bunch of types if you’re not going to write code that operates on them. However, part of the job of a linker is to detect functions which are not referenced by a program–say they are part of a library of which only a subset of functionality is used–and remove them from the final output. Yet, the adage mo’ types, mo’ binary holds true for the majority of Go programs. - -In this post I’ll dig into what equality, in the context of a Go program, means and why changes [like this][1] have a measurable impact on the size of a Go program. - -### Defining equality between two values - -The Go spec defines the concepts of assignability and equality. Assignabiity is the act of assigning a value to an identifier. Not everything which is declared can be assigned, for example constants and functions. Equality is the act of comparing two identifies by asking _are their contents the same?_ - -Being a strongly typed language, the notion of sameness is fundamentally rooted in the identifier’s type. Two things can only be the same if they are of the same type. Beyond that, the type of the values defines how they are compared. - -For example, integers are compared arithmetically. For pointer types, equality is determining if the addresses they point too are the same. Reference types like maps and channels, like pointers, are considered to be the same if they have the same address. - -These are all examples of bitwise equality, that is, if the bit patterns of the memory that value occupies are the same, those values are equal. This is known as memcmp, short for memory comparison, as equality is defined by comparing the contents of two areas of memory. - -Hold on to this idea, I’ll come back to in a second. - -### Struct equality - -Beyond scalar types like integers, floats, and pointers is the realm of compound types; structs. All structs are laid out in memory in program order, thus this declaration: - -``` -type S struct { - a, b, c, d int64 -} -``` - -will consume 32 bytes of memory; 8 bytes for `a`, then 8 bytes for `b`, and so on. The spec says that _struct values are comparable if all their fields are comparable_. Thus two structs are equal iff each of their fields are equal. - -``` -a := S{1, 2, 3, 4} -b := S{1, 2, 3, 4} -fmt.Println(a == b) // prints true -``` - -Under the hood the compiler uses memcmp to compare the 32 bytes of `a` and `b`. - -### Padding and alignment - -However the simplistic bitwise comparison strategy will fail in situations like this: - -``` -type S struct { - a byte - b uint64 - c int16 - d uint32 -} - -func main() - a := S{1, 2, 3, 4} - b := S{1, 2, 3, 4} - fmt.Println(a == b) // prints true -} -``` - -The code compiles, the comparison is still true, but under the hood the compiler cannot rely on comparing the bit patterns of `a` and `b` because the structure contains _padding_. - -Go requires each field in a struct to be naturally aligned. 2 byte values must start on an even address, four byte values on an address divisible by 4, and so on[1][2]. The compiler inserts padding to ensure the fields are _aligned_ to according to their type and the underlying platform. In effect, after padding, this is what the compiler sees[2][3]: - -``` -type S struct { - a byte - _ [7]byte // padding - b uint64 - c int16 - _ [2]int16 // padding - d uint32 -} -``` - -Padding exists to ensure the correct field alignments, and while it does take up space in memory, the contents of those padding bytes are unknown. You might assume that, being Go, the padding bytes are always zero, but it turns out that’s not the case–the contents of padding bytes are simply not defined. Because they’re not defined to always be a certain value, doing a bitwise comparison may return false because the nine bytes of padding spread throughout the 24 bytes of `S` are may not be the same. - -The Go compiler solves this problem by generating what is known as an equality function. In this case `S`‘s equality function knows how to compare two values of type `S` by comparing only the fields in the function while skipping over the padding. - -### Type algorithms - -Phew, that was a lot of setup to illustrate why, for each type defined in a Go program, the compiler may generate several supporting functions, known inside the compiler as the type’s algorithms. In addition to the equality function the compiler will generate a hash function if the type is used as a map key. Like the equality function, the hash function must consider factors like padding when computing its result to ensure it remains stable. - -It turns out that it can be hard, and sometimes non obvious, to intuit when the compiler will generate these functions–it’s more than you’d expect–and it can be hard for the linker to eliminate the ones that are not needed as reflection often causes the linker to be more conservative when trimming types. - -### Reducing binary size by prohibiting comparisons - -Now we’re at a point to explain Brad’s change. By adding an incomparable field [3][4] to the type, the resulting struct is by extension incomparable, thus forcing the compiler to elide the generation of eq and hash algorithms, short circuiting the linkers elimination of those types and, in practice, reducing the size of the final binary. As an example of this technique, this program: - -``` -package main - -import "fmt" - -func main() { - type t struct { - // _ [0][]byte uncomment to prevent comparison - a byte - b uint16 - c int32 - d uint64 - } - var a t - fmt.Println(a) -} -``` - -when compiled with Go 1.14.2 (darwin/amd64), decreased from 2174088 to 2174056, a saving of 32 bytes. In isolation this 32 byte saving may seem like small beer, but consider that equality and hash functions can be generated for every type in the transitive closure of your program and all its dependencies, and the size of these functions varies depending on the size of the type and its complexity, prohibiting them can have a sizeable impact on the final binary over and above the old saw of `-ldflags="-s -w"`. - -The bottom line, if you don’t wish to make your types comparable, a hack like this enforces it at the source level while contributing to a small reduction in the size of your binary. - -* * * - -Addendum: thanks to Brad’s prodding, Go 1.15 already has a bunch of improvements by [Cherry Zhang][5] and [Keith Randall][6] that fix the most egregious of the failures to eliminate unnecessary equality and hash functions (although I suspect it was also to avoid the proliferation of this class of CLs). - - 1. On 32bit platforms `int64` and `uint64` values may not be 8 byte aligned as the natural alignment of the platform is 4 bytes. See [issue 599][7] for the gory details.[][8] - 2. 32 bit platforms would see `_ [3]byte` padding between the declaration of `a` and `b`. See previous.[][9] - 3. Brad used `[0]func()`, but any type that the spec limits or prohibits comparisons on will do. By declaring the array has zero elements the type has no impact on the size or alignment of the struct.[][10] - - - -#### Related posts: - - 1. [How the Go runtime implements maps efficiently (without generics)][11] - 2. [The empty struct][12] - 3. [Padding is hard][13] - 4. [Typed nils in Go 2][14] - - - --------------------------------------------------------------------------------- - -via: https://dave.cheney.net/2020/05/09/ensmallening-go-binaries-by-prohibiting-comparisons - -作者:[Dave Cheney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://dave.cheney.net/author/davecheney -[b]: https://github.com/lujun9972 -[1]: https://github.com/golang/net/commit/e0ff5e5a1de5b859e2d48a2830d7933b3ab5b75f -[2]: tmp.uBLyaVR1Hm#easy-footnote-bottom-1-4116 (On 32bit platforms int64 and uint64 values may not be 8 byte aligned as the natural alignment of the platform is 4 bytes. See issue 599 for the gory details.) -[3]: tmp.uBLyaVR1Hm#easy-footnote-bottom-2-4116 (32 bit platforms would see _ [3]byte padding between the declaration of a and b. See previous.) -[4]: tmp.uBLyaVR1Hm#easy-footnote-bottom-3-4116 (Brad used [0]func(), but any type that the spec limits or prohibits comparisons on will do. By declaring the array has zero elements the type has no impact on the size or alignment of the struct.) -[5]: https://go-review.googlesource.com/c/go/+/231397 -[6]: https://go-review.googlesource.com/c/go/+/191198 -[7]: https://github.com/golang/go/issues/599 -[8]: tmp.uBLyaVR1Hm#easy-footnote-1-4116 -[9]: tmp.uBLyaVR1Hm#easy-footnote-2-4116 -[10]: tmp.uBLyaVR1Hm#easy-footnote-3-4116 -[11]: https://dave.cheney.net/2018/05/29/how-the-go-runtime-implements-maps-efficiently-without-generics (How the Go runtime implements maps efficiently (without generics)) -[12]: https://dave.cheney.net/2014/03/25/the-empty-struct (The empty struct) -[13]: https://dave.cheney.net/2015/10/09/padding-is-hard (Padding is hard) -[14]: https://dave.cheney.net/2017/08/09/typed-nils-in-go-2 (Typed nils in Go 2) diff --git a/translated/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md b/translated/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md new file mode 100644 index 0000000000..ba2e321bb3 --- /dev/null +++ b/translated/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md @@ -0,0 +1,164 @@ +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ensmallening Go binaries by prohibiting comparisons) +[#]: via: (https://dave.cheney.net/2020/05/09/ensmallening-go-binaries-by-prohibiting-comparisons) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +通过禁止比较让 Go 二进制文件变小 +====== + +大家常规的认知是,Go 程序中声明的类型越多,生成的二进制文件就越大。这个符合直觉,毕竟如果你写的代码不去操作定义的类型,那么定义一堆类型就没有意义了。然而,链接器的部分工作就是检测程序没有引用的函数,比如仅仅有某个功能的子功能使用的库中的某些函数,然后把他们从最后的编译产出中删除。常言道,“类型越多,二进制文件越大“,对于多数 Go 程序还是正确的。 + +本文中我会深入讲解在 Go 程序的上下文中相等的意义,以及为什么[像这样][1]的修改会对 Go 程序的大小有重大的影响。 + +### 定义两个值相等 + +Go 的语法定义了赋值和相等的概念。赋值是把一个值赋给一个标识符的行为。并不是所有声明的标识符都可以被赋值,如常量和函数就不可以。相等是通过检查标识符的内容是否相等来比较两个标识符的行为。 + +作为强类型语言,“相同”的概念从根源上被植入标识符的类型中。两个标识符只有是相同类型的前提下,才有可能相同。除此之外,值的类型定义了如何比较该类型的两个值。 + +例如,整型是用算数方法进行比较的。对于指针类型,是否相等是指他们指向的地址是否相同。map 和 channel 等引用类型,跟指针类似,如果它们有相同的地址,那么就认为它们是相同的。 + +上面都是按位比较相等的例子,即值占用的位模式内存是相同的,那么这些值就相等。这个就是 memcmp,全称为 memory comparison,相等是通过比较两个内存区域的内容来定义的。 + +记住这个思路,我会很快回来的。 + +### 结构体相等 + +除了整型、浮点型和指针等标量类型,还有复合类型;结构体。所有的结构体以程序中的顺序被排列在内存中。因此下面这个声明 + +``` +type S struct { + a, b, c, d int64 +} +``` + +会占用 32 字节的内存空间;`a` 占用 8 个字节,`b` 占用 8 个字节,以此类推。Go 的规则说如果结构体所有的字段都是可以比较的,那么结构体的值就是可以比较的。因此如果两个结构体所有的字段都相等,那么它们就相等。 + +``` +a := S{1, 2, 3, 4} +b := S{1, 2, 3, 4} +fmt.Println(a == b) // prints true +``` + +编译器在底层使用 memcmp 来比较 `a` 的 32 个字节和 `b` 的 32 个字节。 + +### 填充和对齐 + +然而,在下面的场景下过分简单化的按位比较的策略会返回错误的结果: + +``` +type S struct { + a byte + b uint64 + c int16 + d uint32 +} + +func main() + a := S{1, 2, 3, 4} + b := S{1, 2, 3, 4} + fmt.Println(a == b) // prints true +} +``` + +编译代码后,这个比较表达式的结果还是 true,但是编译器在底层并不能仅依赖比较 `a` 和 `b` 的位模式,因为结构体有*填充*。 + +Go 要求结构体的所有字段都对齐。2 字节的值必须从偶数地址开始,4 字节的值必须从 4 的倍数地址开始,以此类推[1][2]。编译器根据字段的类型和底层平台加入了填充来确保字段都*对齐*。在填充之后,编译器实际上看到的是[2][3]: + +``` +type S struct { + a byte + _ [7]byte // padding + b uint64 + c int16 + _ [2]int16 // padding + d uint32 +} +``` + +填充的存在保证了字段正确对齐,而填充确实占用了内存空间,但是填充字节的内容是未知的。你可能会认为在 Go 中 填充字节都是 0,但实际上并不是 — 填充字节的内容是未定义的。由于它们并不是被定义为某个确定的值,因此按位比较会因为分布在 `s` 的 24 字节中的 9 个填充字节不一样而返回错误结果。 + +Go 通过生成相等函数来解决这个问题。在这个例子中,`s` 的相等函数只比较函数中的字段略过填充部分,这样就能正确比较类型 `s` 的两个值。 + +### 类型算法 + +嚄,需要做很多准备工作才能解释原因,对于 Go 程序中定义的每种类型,编译器都会生成几个支持它的函数,编译器内部把它们识别为类型的算法。如果类型是一个 map 的 key,那么除相等函数外,编译器还会生成一个哈希函数。为了维持稳定,哈希函数在计算结果时也会像相等函数一样考虑诸如填充等因素。 + +凭直觉判断编译器什么时候生成这些函数实际上很难,有时并不明显,(因为)这超出了你的预期,而且链接器也很难消除没有被使用的类型,因为反射往往导致链接器在裁剪类型时变得更保守。 + +### 通过禁止比较来减小二进制文件的大小 + +现在,我们能解释 Brad 的修改了。向类型添加一个不可比较的字段[3][4],结构体也随之变成不可比较的,从而强制编译器不再生成相等和哈希算法、规避了链接器对那些类型的消除、在实际应用中减小了生成的二进制文件的大小。作为这项技术的一个例子,下面的程序: + +``` +package main + +import "fmt" + +func main() { + type t struct { + // _ [0][]byte uncomment to prevent comparison + a byte + b uint16 + c int32 + d uint64 + } + var a t + fmt.Println(a) +} +``` + +用 Go 1.14.2(darwin/amd64)编译,大小从 2174088 降到了 2174056,节省了 32 字节。单独看节省的这 32 字节似乎微不足道,但是考虑到你的程序中每个类型及其传递闭包都会生成相等和哈希函数,还有他们的依赖,这些函数的大小随类型大小和复杂度的不同而不同,禁止它们会大大减小最终的二进制文件的大小,效果比之前使用 `-ldflags="-s -w"` 还要好。 + +最后总结一下,如果你不想把类型定义为可比较的,像这样的入侵可以在源码层级强制实现,而且会使生成的二进制文件变小。 + +* * * + +附录:在 Brad 的推动下,[Cherry Zhang][5] 和 [Keith Randall][6] 已经在 Go 1.15 做了大量的改进来修复最恶名昭彰的消除无用相等和哈希函数失败(虽然我猜想这也是为了避免这类 CL 的扩散)。 + + 1. 在 32 位平台上 `int64` 和 `unit64` 的值可能不是按 8 字节对齐的,因为平台原生的是以 4 字节对齐的。查看 [issue 599][7] 了解内部详细信息[][8]。 + 2. 32 位平台会在 `a` 和 `b` 的声明中填充 `_ [3]byte`。查看前面的内容[][9]。 + 3. Brad 使用的是`[0]func()`,但是所有能限制和禁止比较的类型都可以。添加了一个有 0 个元素的数组的声明后,结构体的大小和对齐不会受影响。[][10] + + + +#### 相关文章: + + 1. [Go 运行时如何高效地实现 map(不使用泛型)][11] + 2. [空结构体][12] + 3. [填充很难][13] + 4. [Go 中有类型的 nil 2][14] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2020/05/09/ensmallening-go-binaries-by-prohibiting-comparisons + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://github.com/golang/net/commit/e0ff5e5a1de5b859e2d48a2830d7933b3ab5b75f +[2]: tmp.uBLyaVR1Hm#easy-footnote-bottom-1-4116 (On 32bit platforms int64 and uint64 values may not be 8 byte aligned as the natural alignment of the platform is 4 bytes. See issue 599 for the gory details.) +[3]: tmp.uBLyaVR1Hm#easy-footnote-bottom-2-4116 (32 bit platforms would see _ [3]byte padding between the declaration of a and b. See previous.) +[4]: tmp.uBLyaVR1Hm#easy-footnote-bottom-3-4116 (Brad used [0]func(), but any type that the spec limits or prohibits comparisons on will do. By declaring the array has zero elements the type has no impact on the size or alignment of the struct.) +[5]: https://go-review.googlesource.com/c/go/+/231397 +[6]: https://go-review.googlesource.com/c/go/+/191198 +[7]: https://github.com/golang/go/issues/599 +[8]: tmp.uBLyaVR1Hm#easy-footnote-1-4116 +[9]: tmp.uBLyaVR1Hm#easy-footnote-2-4116 +[10]: tmp.uBLyaVR1Hm#easy-footnote-3-4116 +[11]: https://dave.cheney.net/2018/05/29/how-the-go-runtime-implements-maps-efficiently-without-generics (How the Go runtime implements maps efficiently (without generics)) +[12]: https://dave.cheney.net/2014/03/25/the-empty-struct (The empty struct) +[13]: https://dave.cheney.net/2015/10/09/padding-is-hard (Padding is hard) +[14]: https://dave.cheney.net/2017/08/09/typed-nils-in-go-2 (Typed nils in Go 2) From 22135999d1505f3f273fdff3674a5e9f45955128 Mon Sep 17 00:00:00 2001 From: Acceleratorrrr <542383480@qq.com> Date: Tue, 12 May 2020 17:29:41 +0100 Subject: [PATCH 0698/1809] translated/tech/20200427 How to secure your Linux email services with SSL-TLS.md --- ... your Linux email services with SSL-TLS.md | 209 ------------------ ... your Linux email services with SSL-TLS.md | 201 +++++++++++++++++ 2 files changed, 201 insertions(+), 209 deletions(-) delete mode 100644 sources/tech/20200427 How to secure your Linux email services with SSL-TLS.md create mode 100644 translated/tech/20200427 How to secure your Linux email services with SSL-TLS.md diff --git a/sources/tech/20200427 How to secure your Linux email services with SSL-TLS.md b/sources/tech/20200427 How to secure your Linux email services with SSL-TLS.md deleted file mode 100644 index 163e6b017f..0000000000 --- a/sources/tech/20200427 How to secure your Linux email services with SSL-TLS.md +++ /dev/null @@ -1,209 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to secure your Linux email services with SSL/TLS) -[#]: via: (https://opensource.com/article/20/4/securing-linux-email) -[#]: author: (Marc Skinner https://opensource.com/users/marc-skinner) - -How to secure your Linux email services with SSL/TLS -====== -Protect your Linux email services by understanding security -certificates. -![email or newsletters via inbox and browser][1] - -Traditionally, email services send data in an unprotected way—whether you are sending emails via SMTP or receiving them via IMAP or POP, the defaults are in cleartext. With more online applications enforcing encryption and the general consensus to protect your data, it's best to secure your email services with a Secure Sockets Layer/Transport Layer Security (SSL/TLS) security certificate. - -First, a quick review of email services and protocols. Email is sent via a service called Simple Mail Transport Protocol (SMTP) using TCP port 25. This protocol sends emails from server to server based on DNS mail exchanger (MX) record lookups. Once an email is on the email server, it is retrieved using one of two services: Internet Message Access Protocol (IMAP) using port TCP 143, or Post Office Protocol (POP3) using port TCP 110. All of these services, by default, send your email and authentication to/from these services in plain text—thus, it's very unprotected! - -To protect the email data and authentication, these services have added a security feature in which they can utilize an SSL/TLS certificate to wrap the data flow and communication with encryption. How SSL/TLS encryption secures information is beyond the scope of this article, but [Bryant Son's internet security article][2] covers it in great detail. At a high level, SSL/TLS encryption is a public/private encryption algorithm. - -By adding these security features into the services, they can listen on new TCP ports: - -Service | Default TCP Port | SSL/TLS Port ----|---|--- -SMTP | 25 | 587 -IMAP | 143 | 993 -POP3 | 110 | 995 - -### Generate SSL/TLS certificates - -SSL/TLS certificates can be generated for free using tools like [OpenSSL][3], or they can be purchased for a range of prices from public certificate authorities (CAs). In the past, generating your own certificate was easy and worked in most cases, but with the increasing demand for better security, most email clients don't trust self-generated SSL/TLS certificates without a manual exception. - -If your use case is private or for testing, then saving money with a self-generated certificate makes sense. But if you're rolling this out to a large group or have paying customers, then you're better served by purchasing a certificate from a public, trusted company that sells them. - -In either case, the process to start requesting a new certificate is to use the OpenSSL tooling on your Linux system to create a certificate signing request (CSR): - - -``` -`$ openssl req -new -newkey rsa:2048 -nodes -keyout mail.mydomain.key -out mail.mydomain.csr` -``` - -This command will create a new CSR and private key at the same time for the service you are trying to secure. The process will ask you a number of questions associated with the certificate: location details, server fully qualified domain name (FQDN), email contact information, etc. Once you have filled out the information, the key and CSR will be generated. - -#### If you generate your own certificate - -If you want to generate your own certificate, you must create your own [root CA][4] before issuing the CSR command above. You can create your own root CA with: - - -``` -`$ openssl genrsa -des3 -out myCA.key 2048` -``` - -It will prompt you to add a passphrase. Please give it a secure passphrase and don't lose it—this is your private root CA key, and as the name states, it's the root of all trust in your certificates. - -Next, generate the root CA certificate: - - -``` -`$ openssl req -x509 -new -nodes -key myCA.key -sha256 -days 1825 -out myCA.pem` -``` - -After answering a few more questions, you will generate a root CA certificate with a five-year lifespan. - -Using the CSR file from the steps above, you can request a new certificate to be generated and signed by the root CA you just created: - - -``` -`$ openssl x509 -req -in mail.mydomain.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out mail.mydomain.pem -days 1825 -sha256` -``` - -Enter your private root CA key passphrase to create and sign the certificate. - -Now you have the two files needed to configure your email services for enhanced security: the private key file, **mail.mydomain.key**, and the public certificate file, **mail.mydomain.pem**. - -#### If you purchase a certificate - -If you purchase a certificate from a vendor, it will ask you to upload that CSR to its system, as it is used as the input to generate the SSL/TLS certificate. The certificate will be accessible as a file (such as **mail.mydomain.pem**). Many SSL vendors also require you to download an intermediate certificate. If this is the case, you must combine the two certificate files into one, so the email service can process them both in combination. You can combine your certificate with a third-party intermediate certificate with: - - -``` -`$ cat mail.mydomain.pem gd_bundle-g2-g1.crt > mail.mydomain.pem` -``` - -Notice that the output's file extension is **.pem**, which stands for Privacy-Enhanced Mail. - -Now you have the two files you need to configure your email services for enhanced security: the private key file, **mail.mydomain.key**, and the public combined certificate file, **mail.mydomain.pem**. - -### Create a safe directory for your files - -Whether you created your own key or bought one from a vendor, create a safe, root-owned directory for the two files you created above. An example workflow to create a safe play would be: - - -``` -$ mkdir /etc/pki/tls -$ chown root:root /etc/pki/tls -$ chmod 700 /etc/pki/tls -``` - -Make sure to set the permissions on your files after you copy them into **/etc/pki/tls** with: - - -``` -`$ chmod 600 /etc/pki/tls/*` -``` - -### Configure your SMTP and IMAP services - -Next, configure both the SMTP and the IMAP services to use the new security certificates. The programs used in this example for SMTP and IMAP are **postfix** and **dovecot**. - -Edit ***/_****etc****_/*****postfix/main.cf** in your preferred text editor. Add the following lines: - - -``` -smtpd_use_tls = yes -smtpd_tls_cert_file = /etc/pki/tls/mail.mydomain.pem -smtpd_tls_key_file = /etc/pki/tls/mail.mydomain.key -``` - -### Customize your config - -The following options allow you to disable/enable different ciphers, protocols, etc.: - - -``` -smtpd_tls_eecdh_grade = strong -smtpd_tls_protocols= !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 -smtpd_tls_mandatory_protocols= !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 -smtpd_tls_mandatory_ciphers = high -smtpd_tls_security_level=may -smtpd_tls_ciphers = high -tls_preempt_cipherlist = yes -smtpd_tls_mandatory_exclude_ciphers = aNULL, MD5 , DES, ADH, RC4, PSD, SRP, 3DES, eNULL -smtpd_tls_exclude_ciphers = aNULL, MD5 , DES, ADH, RC4, PSD, SRP, 3DES, eNULL -smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 -smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 -``` - -Edit **/etc/dovecot/dovecot.conf** by adding these three lines: - - -``` -ssl = required -ssl_cert = </etc/pki/tls/mail.mydomain.pem -ssl_key = </etc/pki/tls/mail.mydomain.key -``` - -Add the following options to disable/enable different ciphers, protocols, and more (I'll leave understanding and considering these up to you): - - -``` -ssl_cipher_list = EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:ALL:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SSLv2 -ssl_prefer_server_ciphers = yes -ssl_protocols = !SSLv2 !SSLv3 !TLSv1 !TLSv1.1 -ssl_min_protocol = TLSv1.2 -``` - -### Set context for SELinux - -If your Linux distribution has SELinux enabled, set the correct SELinux context for your new certificate files. - -For Postfix SELinux: - - -``` -`$ chcon -u system_u -t cert_t mail.mydomain.*` -``` - -For Dovecot SELinux: - - -``` -`$ chcon -u system_u -t dovecot_cert_t mail.mydomain.*` -``` - -Restart both services and connect with your updated email client configurations. Some email clients will auto-detect the new port numbers; others will require you to update them. - -### Test your setup - -Quickly test from the command line with **openssl** and the **s_client** plugin: - - -``` -$ openssl s_client -connect mail.mydomain.com:993 -$ openssl s_client -starttls imap -connect mail.mydomain.com:143 -$ openssl s_client -starttls smtp -connect mail.mydomain.com:587 -``` - -These test commands will show a plethora of data about the connection, certificate, cipher, session, and protocol you're using. This is not only a good way to validate that the new configuration is working but also to confirm you're using the appropriate certificate and security settings you defined in the **postfix** or **dovecot** configuration files. - -Stay secure! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/securing-linux-email - -作者:[Marc Skinner][a] -选题:[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/marc-skinner -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/newsletter_email_mail_web_browser.jpg?itok=Lo91H9UH (email or newsletters via inbox and browser) -[2]: https://opensource.com/article/19/11/internet-security-tls-ssl-certificate-authority -[3]: https://www.openssl.org/ -[4]: https://en.wikipedia.org/wiki/Root_certificate diff --git a/translated/tech/20200427 How to secure your Linux email services with SSL-TLS.md b/translated/tech/20200427 How to secure your Linux email services with SSL-TLS.md new file mode 100644 index 0000000000..0c300160fe --- /dev/null +++ b/translated/tech/20200427 How to secure your Linux email services with SSL-TLS.md @@ -0,0 +1,201 @@ +[#]: collector: (lujun9972) +[#]: translator: (Acceleratorrrr) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to secure your Linux email services with SSL/TLS) +[#]: via: (https://opensource.com/article/20/4/securing-linux-email) +[#]: author: (Marc Skinner https://opensource.com/users/marc-skinner) + +如何利用 SSL/TLS 保护你的Linux邮箱服务 +====== + +通过理解安全证书来保护你的Linux邮箱服务。 +![email or newsletters via inbox and browser][1] + +通常,不管你是通过简单邮件传输协议(SMTP)或者邮局协议(POP)发送或者接受邮件,邮箱服务默认使用无保护明文来传输数据。近来随着数据加密成为越来越多程序的共识,你需要传输层安全性协议 / 安全套接层(SSL/TLS)的安全证书来保护你的邮箱服务。 + +首先,快速回顾一下邮箱服务和协议的基本流程。邮件通过简单邮件传输协议从端口25发出。这个协议依靠DNS邮件交换服务器里的地址信息来传输邮件。当邮件到达邮件服务器后,可以被以下两种服务中的任意一种检索:因特网信息访问协议(IMAP)使用端口143,或者邮局协议第3版本(POP3)使用端口110。然而,以上服务默认默认使用明文传输邮件和验证信息。这非常的不安全! + +以上服务已经添加了安全功能来保护邮件内容和验证信息,使它们可以利用SSL/TLS证书包裹和加密数据流。SSL/TLS如何加密数据的细节不在本文讨论范围,有兴趣的话可以阅读[布莱恩特关于网络安全的文章][2]。概括的说,SSL/TLS 加密本质是一种基于公钥和私钥的算法。 + +通过加入新的安全功能后,这些服务可以监听新的TCP端口: + +服务 | 默认TCP端口 | SSL/TLS 端口 +---|---|--- +SMTP | 25 | 587 +IMAP | 143 | 993 +POP3 | 110 | 995 + +### 生成 SSL/TLS 证书 + +[OpenSSL][3] 可以生成免费的 SSL/TLS 证书,或者你也可以从根证书颁发机构购买。过去,生成自签发证书十分简单而且通用,但是由于安全被日益重视,大部分的邮箱客户端是不信任自签发证书的,除非手动设置。 + +如果你只是自己使用或者做做测试,那就使用自签发证书省点钱吧。但是如果很多人或者客户也需要使用的话,那最好还是从受信任的根证书颁发机构购买。 + +总之,Linux 系统里的 OpenSSL 工具需要一个证书来生成凭证签发请求文件(CSR): + +``` +`$ openssl req -new -newkey rsa:2048 -nodes -keyout mail.mydomain.key -out mail.mydomain.csr` +``` + +这个命令会为你想保护的服务同时生成一个新的 CSR 文件和一个私匙。它会询问你一些证书相关的问题,如:路径,服务器的完整网络域名,邮件联系信息等等。当你输入完这些信息后,密匙和CSR文件就生成完毕了。 + +#### 如果你想生成自签发证书 + +如果你想要生成自签发证书的话,在运行以上 CSR 命令之前,你必须先创建一个[自签发证书机构][4]。 + +``` +`$ openssl genrsa -des3 -out myCA.key 2048` +``` + +命令行会提示你输入密码。请输入一个复杂点的密码而且不要弄丢了,因为这将会是自签发证书机构的密码,并且决定了其签发证书的受信任度。 + +接下来,生成自签发证书机构: + +``` +`$ openssl req -x509 -new -nodes -key myCA.key -sha256 -days 1825 -out myCA.pem` +``` + +在回答完一些问题后,你就拥有一个有效期为5年的自签发证书机构了。 + +用之前生成的 CSR 文件,你可以向刚生成的自签发证书机构请求生成一个新的证书。 + +``` +`$ openssl x509 -req -in mail.mydomain.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out mail.mydomain.pem -days 1825 -sha256` +``` + +输入自签发证书机构的密码来生成和签发证书。 + +现在你还需要两个文件来设置你的邮箱服务安全:私匙文件 **mail.mydomain.key**, 和证书文件 **mail.mydomain.pem**。 + +#### 如果你愿意购买证书 + +If you purchase a certificate from a vendor, it will ask you to upload that CSR to its system, as it is used as the input to generate the SSL/TLS certificate. The certificate will be accessible as a file (such as **mail.mydomain.pem**). Many SSL vendors also require you to download an intermediate certificate. If this is the case, you must combine the two certificate files into one, so the email service can process them both in combination. You can combine your certificate with a third-party intermediate certificate with: +如果你愿意从机构购买证书,则需要上传 CSR 文件到机构的系统中,它将会被用于生成 SSL/TLS 证书。证书可作为文件下载,比如 **mail.mydomain.pem**。很多SSL机构也需要你下载一个中间证书。这样的话,你必须把这个两个证书合并称一个,邮件服务才能够正常运行。可以使用以下命令把你的证书和第三方中间证书合并在一起: + +``` +`$ cat mail.mydomain.pem gd_bundle-g2-g1.crt > mail.mydomain.pem` +``` + +值得一提的是 **.pem** 文件后缀代表隐私增强邮件。 + +Now you have the two files you need to configure your email services for enhanced security: the private key file, **mail.mydomain.key**, and the public combined certificate file, **mail.mydomain.pem**. +现在你就有全部的设置邮箱服务安全所需文件了:私匙文件 **mail.mydomain.key**, 和证书文件 **mail.mydomain.pem**。 + +### 为你的文件生成一个安全的文件夹 + +不管你是的证书是自签发的或者从机构购买,你都需要生成一个安全的,管理员权限级别的文件夹用于保存这两个文件。可以使用以下命令来生成: + +``` +$ mkdir /etc/pki/tls +$ chown root:root /etc/pki/tls +$ chmod 700 /etc/pki/tls +``` + +在复制文件到 **/etc/pki/tls** 后,再次设置这些文件的权限: + +``` +`$ chmod 600 /etc/pki/tls/*` +``` + +### 配置你的 SMTP 和 IMAP 服务 + +接下来,让 SMTP 和 IMAP 服务使用新的安全证书。我们用 **postfix** and **dovecot** 来作为例子。 + +Edit ***/_****etc****_/*****postfix/main.cf** in your preferred text editor. Add the following lines: +用你顺手的编辑器来编辑 ***/_etc_/postfix/main.cf** 文件。添加以下几行: + +``` +smtpd_use_tls = yes +smtpd_tls_cert_file = /etc/pki/tls/mail.mydomain.pem +smtpd_tls_key_file = /etc/pki/tls/mail.mydomain.key +``` + +### 自定义选项 + +以下选项可以启用或禁用各种加密算法,协议等等: + +``` +smtpd_tls_eecdh_grade = strong +smtpd_tls_protocols= !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 +smtpd_tls_mandatory_protocols= !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 +smtpd_tls_mandatory_ciphers = high +smtpd_tls_security_level=may +smtpd_tls_ciphers = high +tls_preempt_cipherlist = yes +smtpd_tls_mandatory_exclude_ciphers = aNULL, MD5 , DES, ADH, RC4, PSD, SRP, 3DES, eNULL +smtpd_tls_exclude_ciphers = aNULL, MD5 , DES, ADH, RC4, PSD, SRP, 3DES, eNULL +smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 +smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 +``` + +**/etc/dovecot/dovecot.conf** 文件添加以下三行: + +``` +ssl = required +ssl_cert = </etc/pki/tls/mail.mydomain.pem +ssl_key = </etc/pki/tls/mail.mydomain.key +``` + +添加更多选项来启用或禁用各种加密算法,协议等等(可选): + +``` +ssl_cipher_list = EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:ALL:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SSLv2 +ssl_prefer_server_ciphers = yes +ssl_protocols = !SSLv2 !SSLv3 !TLSv1 !TLSv1.1 +ssl_min_protocol = TLSv1.2 +``` + +### 安全增强式Linux上下文设置 + +如果使用安全增强式Linux发行版,你需要给新证书文件配置正确的安全上下文。 + +Postfix SELinux 用户: + +``` +`$ chcon -u system_u -t cert_t mail.mydomain.*` +``` + +Dovecot SELinux 用户: + +``` +`$ chcon -u system_u -t dovecot_cert_t mail.mydomain.*` +``` + +Restart both services and connect with your updated email client configurations. Some email clients will auto-detect the new port numbers; others will require you to update them. +重启这些服务,然后联接上更新后的邮箱客户端。有些邮箱客户端会自动探测到新的端口,有些则需要你手动升级。 + +### 测试 + +用 **openssl** 命令行和 **s_client** 插件来简单测试一下: + +``` +$ openssl s_client -connect mail.mydomain.com:993 +$ openssl s_client -starttls imap -connect mail.mydomain.com:143 +$ openssl s_client -starttls smtp -connect mail.mydomain.com:587 +``` + +These test commands will show a plethora of data about the connection, certificate, cipher, session, and protocol you're using. This is not only a good way to validate that the new configuration is working but also to confirm you're using the appropriate certificate and security settings you defined in the **postfix** or **dovecot** configuration files. +这些测试命令会打印出很多信息,关于你使用的联接,证书,加密算法,会话和协议。这不仅是一个验证新设置的好方法,也可以检查你是否使用了适当的证书,以及 **postfix** 或者 **dovecot** 配置文件里的安全设置是否生效。 + +Stay secure! +保持安全! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/securing-linux-email + +作者:[Marc Skinner][a] +选题:[lujun9972][b] +译者:[Acceleratorrrr](https://github.com/Acceleratorrrr) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/marc-skinner +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/newsletter_email_mail_web_browser.jpg?itok=Lo91H9UH (email or newsletters via inbox and browser) +[2]: https://opensource.com/article/19/11/internet-security-tls-ssl-certificate-authority +[3]: https://www.openssl.org/ +[4]: https://en.wikipedia.org/wiki/Root_certificate From c3589f17ed70867e6b0b7ab4b1e1b297c82b67ea Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 13 May 2020 08:51:17 +0800 Subject: [PATCH 0699/1809] PRF @messon007 --- .../tech/20200416 Learning to love systemd.md | 343 +++++++++--------- 1 file changed, 168 insertions(+), 175 deletions(-) diff --git a/translated/tech/20200416 Learning to love systemd.md b/translated/tech/20200416 Learning to love systemd.md index 34bc8ea314..328716266c 100644 --- a/translated/tech/20200416 Learning to love systemd.md +++ b/translated/tech/20200416 Learning to love systemd.md @@ -1,291 +1,284 @@ [#]: collector: (lujun9972) [#]: translator: (messon007) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Learning to love systemd) [#]: via: (https://opensource.com/article/20/4/systemd) [#]: author: (David Both https://opensource.com/users/dboth) -学会爱上systemd +学会爱上 systemd ====== -systemd是所有进程的源头,负责将Linux主机启动到可以做生产性任务的状态。 -![Penguin driving a car with a yellow background][1] +> systemd 是所有进程之母,负责将 Linux 主机启动到可以做生产性任务的状态。 -systemd(是的,全小写,即使在句子开头也是小写),是init和SystemV init脚本的现代替代者。它还有更多功能。 +![](https://img.linux.net.cn/data/attachment/album/202005/13/085016gy86wj713zh7xq71.jpg) -当我想到init和SystemV时,像大多数系统管理员一样,我想到的是Linux的启动和关闭,而没有太多其他的,例如在服务启动和运行后对其进行管理。像init一样,systemd是所有进程的源头,它负责使Linux主机启动到可以做生产性任务的状态。 systemd设定的一些功能比老的init要广泛得多,它要管理正在运行的Linux主机的许多方面,包括挂载文件系统,管理硬件,处理定时器以及启动和管理生产性主机所需的系统服务。 +systemd(是的,全小写,即使在句子开头也是小写),是初始化程序(`init`)和 SystemV 初始化脚本的现代替代者。此外,它还有更多功能。 -本系列文章是基于我的部分三期Linux培训课程[_使用和管理Linux:从零开始进行学习系统管理_][2]的摘录,探讨了systemd在启动和启动完成后的功能。 +当我想到 `init` 和 SystemV 初始化时,像大多数系统管理员一样,我想到的是 Linux 的启动和关闭,而不是真正意义上的管理服务,例如在服务启动和运行后对其进行管理。像 `init` 一样,systemd 是所有进程之母,它负责使 Linux 主机启动到可以做生产性任务的状态。systemd 设定的一些功能比老的初始化程序要广泛得多,它要管理正在运行的 Linux 主机的许多方面,包括挂载文件系统、管理硬件、处理定时器以及启动和管理生产性主机所需的系统服务。 -### Linux启动 +本系列文章是基于我的三期 Linux 培训课程《[使用和管理 Linux:从零开始进行学习系统管理][2]》部分内容的摘录,探讨了 systemd 在启动和启动完成后的功能。 -Linux主机从关机状态到运行状态的完整启动过程很复杂,但它是开放的并且是可知的。在详细介绍之前,我将简要介绍一下从主机硬件被上电到系统准备好用户登录(的过程)。大多数时候,“启动过程”被作为单个概念来讨论,但这是不准确的。实际上,完整的引导和启动过程包含三个主要部分: +### Linux 引导 -   * **硬件引导:** 初始化系统硬件 - * **Linux引导:** 加载Linux内核和systemd - * **Linux启动:** systemd启动, 为生产工作做准备 - +Linux 主机从关机状态到运行状态的完整启动过程很复杂,但它是开放的并且是可知的。在详细介绍之前,我将简要介绍一下从主机硬件被上电到系统准备好用户登录的过程。大多数时候,“引导过程”被作为一个整体来讨论,但这是不准确的。实际上,完整的引导和启动过程包含三个主要部分: -Linux启动阶段在内核加载了init或systemd(取决于具体发行版使用的是旧的方式还是还是新的方式)之后开始。init和systemd程序启动并管理所有其他进程,他们在各自的系统上都被称为“所有进程之母”。 +* `硬件引导`:初始化系统硬件 +* `Linux 引导boot`:加载 Linux 内核和 systemd +* `Linux 启动startup`:systemd 为主机的生产性工作做准备 -将硬件引导与Linux引导及Linux启动区分开,并明确定义它们之间的分界点是很重要的。理解他们的差异以及他们每一个在使Linux系统进入生产准备状态所起的作用,才能够管理这些进程并更好地确定大部分人所谓的“启动”问题出在哪里。 +Linux 启动阶段始于内核加载了 `init` 或 systemd(取决于具体发行版使用的是旧的方式还是还是新的方式)之后。`init` 和 systemd 程序启动并管理所有其它进程,它们在各自的系统上都被称为“所有进程之母”。 -启动过程按照三步引导流程使Linux计算机进入可进行生产工作的状态。当内核将主机的控制权转移到systemd时,启动环节开始。 +将硬件引导与 Linux 引导及 Linux 启动区分开,并明确定义它们之间的分界点是很重要的。理解它们的差异以及它们每一个在使 Linux 系统进入生产状态所起的作用,才能够管理这些进程,并更好地确定大部分人所谓的“启动”问题出在哪里。 -### systemd之争 +启动过程按照三步引导流程,使 Linux 计算机进入可进行生产工作的状态。当内核将主机的控制权转移到 systemd 时,启动环节开始。 -systemd引起了系统管理员和其他负责维护Linux系统正常运行人员的广泛回应。systemd正在许多Linux系统中接管大量任务的事实造成了某些开发人群和系统管理员群组之间的阻挠和争议。 +### systemd 之争 -SystemV和systemd是执行Linux启动环节的两种不同的方法。 SystemV启动脚本和init程序是老的方法,而使用目标(targets)的systemd是新方法。尽管大多数现代Linux发行版都使用较新的systemd进行启动,关机和进程管理,但仍有一些发行版未采用。原因之一是某些发行版维护者和系统管理员喜欢老的SystemV方法,而不是新的systemd。 +systemd 引起了系统管理员和其它负责维护 Linux 系统正常运行人员的广泛争议。在许多 Linux 系统中,systemd 接管了大量任务,这在某些开发者和sysadmins群体中引起了反对和不和谐。 + +SystemV 和 systemd 是执行 Linux 启动环节的两种不同的方法。SystemV 启动脚本和 `init` 程序是老的方法,而使用目标target的 systemd 是新方法。尽管大多数现代 Linux 发行版都使用较新的 systemd 进行启动、关机和进程管理,但仍有一些发行版未采用。原因之一是某些发行版维护者和系统管理员喜欢老的 SystemV 方法,而不是新的 systemd。 我认为两者都有其优势。 -#### 为何我更喜欢SystemV +#### 为何我更喜欢 SystemV -我更喜欢SystemV,因为它更开放。使用Bash脚本来完成启动。内核启动init程序(编译后的二进制)后,init启动 **rc.sysinit** 脚本,该脚本执行许多系统初始化任务。 **rc.sysinit** 执行完后,init启动 **/etc/rc.d/rc** 脚本,该脚本依次启动 **/etc/rc.d/rcX.d** 中由SystemV启动脚本定义的各种服务。 其中“ X”是待启动的运行级别号。 +我更喜欢 SystemV,因为它更开放。使用 Bash 脚本来完成启动。内核启动 `init` 程序(这是一个编译后的二进制)后,`init` 启动 `rc.sysinit` 脚本,该脚本执行许多系统初始化任务。`rc.sysinit` 执行完后,`init` 启动 `/etc/rc.d/rc` 脚本,该脚本依次启动 `/etc/rc.d/rcX.d` 中由 SystemV 启动脚本定义的各种服务。其中 `X` 是待启动的运行级别号。 -除了init程序本身之外,所有这些程序都是开放且易于理解的脚本。可以通读这些脚本并确切了解整个启动过程中发生的事情,但是我不认为有太多系统管理员会实际这样做。每个启动脚本都被编了号,以便按特定顺序启动预期的服务。服务是串行启动的,一次只能启动一个服务。 +除了 `init` 程序本身之外,所有这些程序都是开放且易于理解的脚本。可以通读这些脚本并确切了解整个启动过程中发生的事情,但是我不认为有太多系统管理员真正做到这一点。每个启动脚本都被编了号,以便按特定顺序启动预期的服务。服务是串行启动的,一次只能启动一个服务。 -由Red Hat的Lennart Poettering和Kay Sievers开发的systemd是一个由大的已编译的二进制可执行文件构成的复杂系统,不访问其源码就无法理解。它是开源的,因此“访问其源代码”并不难,只是不太方便。systemd似乎表现出对Linux哲学多个原则的重大驳斥。作为二进制文件,systemd无法被直接打开供系统管理员查看或进行简单更改。systemd试图做所有事情,例如管理正在运行的服务,同时提供比SystemV更多的状态信息。它还管理硬件,进程,进程组,文件系统挂载等。 systemd几乎涉足于现代Linux主机的每方面,使它成为系统管理的一站式工具。所有这些都明显违反了"程序应该小且每个程序都应该只做一件事并且做好"的原则。 +systemd 是由 Red Hat 的 Lennart Poettering 和 Kay Sievers 开发的,它是一个由大型的、编译的二进制可执行文件构成的复杂系统,不访问其源码就无法理解。它是开源的,因此“访问其源代码”并不难,只是不太方便。systemd 似乎表现出对 Linux 哲学多个原则的重大驳斥。作为二进制文件,systemd 无法被直接打开供系统管理员查看或进行简单更改。systemd 试图做所有事情,例如管理正在运行的服务,同时提供明显比 SystemV 更多的状态信息。它还管理硬件、进程、进程组、文件系统挂载等。systemd 几乎涉足于现代 Linux 主机的每个方面,使它成为系统管理的一站式工具。所有这些都明显违反了“程序应该小,且每个程序都应该只做一件事并做好”的原则。 -#### 为何我更喜欢systemd +#### 为何我更喜欢 systemd -我更喜欢用systemd作为启动机制,因为它会根据启动阶段并行地启动尽可能多的服务。这样可以加快整个的启动速度,使得主机系统比SystemV更快地到达登录屏幕。 +我更喜欢用 systemd 作为启动机制,因为它会根据启动阶段并行地启动尽可能多的服务。这样可以加快整个的启动速度,使得主机系统比 SystemV 更快地到达登录屏幕。 -systemd几乎可以管理正在运行的Linux系统的各个方面。它可以管理正在运行的服务,同时提供比SystemV多得多的状态信息。它还管理硬件,进程和进程组,文件系统挂载等。 systemd几乎涉足于现代Linux操作系统的每方面,使其成为系统管理的一站式工具。(听起来熟悉吧?) +systemd 几乎可以管理正在运行的 Linux 系统的各个方面。它可以管理正在运行的服务,同时提供比SystemV 多得多的状态信息。它还管理硬件、进程和进程组、文件系统挂载等。systemd 几乎涉足于现代 Linux 操作系统的每方面,使其成为系统管理的一站式工具。(听起来熟悉吧?) -systemd工具是编译后的二进制文件,但该工具包是开放的,因为所有配置文件都是ASCII文本文件。可以通过各种GUI和命令行工具来修改启动配置,也可以添加或修改各种配置文件来满足特定的本地计算环境的需求。 +systemd 工具是编译后的二进制文件,但该工具包是开放的,因为所有配置文件都是 ASCII 文本文件。可以通过各种 GUI 和命令行工具来修改启动配置,也可以添加或修改各种配置文件来满足特定的本地计算环境的需求。 #### 真正的问题 -您认为我不能喜欢两种启动系统吗?我能,我会用它们中的任何一个。 +你认为我不能喜欢两种启动系统吗?我能,我会用它们中的任何一个。 -我认为,SystemV和systemd之间大多数争议的真正问题和根本原因在于,系统管理阶段[没有选择权][3]。使用SystemV还是systemd已经由各种发行版的开发人员,维护人员和打包人员选择了(但有充分的理由)。由于init极端的侵入性, 挖出(scooping out)并替换init系统会带来很多影响,发行版设计过程之外(的环节)很难处理这些影响。 +我认为,SystemV 和 systemd 之间大多数争议的真正问题和根本原因在于,在系统管理层面[没有选择权][3]。使用 SystemV 还是 systemd 已经由各种发行版的开发人员、维护人员和打包人员选择了(但有充分的理由)。由于 `init` 极端的侵入性,挖出并替换 `init` 系统会带来很多影响,会带来很多在发行版设计过程之外难以解决的后果。 -尽管该选择实际上是为我而选的,我通常最关心的是我的Linux主机仍然可以启动并正常工作。作为最终用户,甚至是系统管理员,我主要关心的是我是否可以完成我的工作,例如写我的书和这篇文章,安装更新以及编写脚本来自动化所有事情。只要我能做我的工作,我就不会真正在意发行版中使用的启动系统。 +尽管该选择实际上是为我而选的,但我的Linux主机能不能开机、能不能工作,这是我平时最关心的。作为最终用户,甚至是系统管理员,我主要关心的是我是否可以完成我的工作,例如写我的书和这篇文章,安装更新以及编写脚本来自动化所有事情。只要我能做我的工作,我就不会真正在意发行版中使用的启动系统。 在启动或服务管理出现问题时,我会在意。无论主机上使用哪种启动系统,我都足够了解如何沿着事件顺序来查找故障并进行修复。 #### 替换SystemV -以前曾有过用更现代的东西替代SystemV的尝试。在大约两个版本中,Fedora使用了一个叫作Upstart的东西来替换老化的SystemV,但是它没有替换init并且没有我能感知到的变化。由于Upstart并未对SystemV的问题进行任何重大更改,因此这个方向的努力很快就被systemd放弃了。 +以前曾有过用更现代的东西替代 SystemV 的尝试。大约在两个版本中,Fedora 使用了一个叫作 Upstart 的东西来替换老化的 SystemV,但是它没有取代 `init`,也没有提供我所注意到的任何变化。由于 Upstart 并未对 SystemV 的问题进行任何显著的改变,所以在这个方向上的努力很快就被放弃了,转而使用 systemd。 -尽管大部分Linux开发人员都认可替换旧的SystemV启动系统是个好主意,但许多开发人员和系统管理员并不喜欢systemd。与其重新讨论人们在systemd中遇到的或曾经遇到过的所有所谓的问题,不如带您去看两篇好文章,尽管有些陈旧,但它们涵盖了大多数内容。Linux内核的创建者Linus Torvalds对systemd似乎不感兴趣。在2014年ZDNet的文章_[Linus Torvalds和其他人对Linux上的systemd的看法][4]_中,Linus清楚地表达了他的感受。 +尽管大部分 Linux 开发人员都认可替换旧的 SystemV 启动系统是个好主意,但许多开发人员和系统管理员并不喜欢 systemd。与其重新讨论人们在 systemd 中遇到的或曾经遇到过的所有所谓的问题,不如带你去看两篇好文章,尽管有些陈旧,但它们涵盖了大多数内容。Linux 内核的创建者 Linus Torvalds 对 systemd 似乎不感兴趣。在 2014 年 ZDNet 的一篇文章《[Linus Torvalds 和其他人对 Linux 上的 systemd 的看法][4]》中,Linus 清楚地表达了他的感受。 ->“实际上我对systemd本身没有任何特别强烈的意见。我对一些核心开发人员有一些意见,我认为它们在对待bugs和兼容性方面过于轻率,而且我认为某些设计细节是疯狂的(例如,我不喜欢二进制日志),但这只是细节,不是大问题。” +> “实际上我对 systemd 本身没有任何特别强烈的意见。我对一些核心开发人员有一些问题,我认为他们在对待错误和兼容性方面过于轻率,而且我认为某些设计细节是疯狂的(例如,我不喜欢二进制日志),但这只是细节,不是大问题。” -如果您对Linus不太了解,我可以告诉您,如果他不喜欢某事,那么他非常直率,坦率,并且非常清楚这种不喜欢。他解决自己对事物不满的方式已经被社会更好地接受了。 +如果你对 Linus 不太了解的话,我可以告诉你,如果他不喜欢某事,他是非常直言不讳的,很明确,而且相当明确的表示不喜欢。他解决自己对事物不满的方式已经被社会更好地接受了。 -2013年,Poettering写了一篇很长的博客,其中他在揭穿[systemd的神话][5]的同时透露了创建它的一些原因。这是一本很好的读物,我强烈建议您阅读。 +2013 年,Poettering 写了一篇很长的博客,他在文章驳斥了[关于 systemd 的迷思][5],同时对创建 systemd 的一些原因进行了深入的剖析。这是一分很好的读物,我强烈建议你阅读。 -### systemd任务 +### systemd 任务 -根据编译过程中使用的选项(不在本系列中介绍),systemd可以有多达69个二进制可执行文件用于执行任务,其中包括: - - * systemd程序以1号进程(PID 1)运行,并提供使尽可能多服务并行启动的系统启动能力,它额外加快了总体启动时间。它还管理关机顺序。 - * systemctl程序提供了服务管理的用户接口。 - * 支持SystemV和LSB启动脚本,以便向后兼容。 -  * 服务管理和报告提供了比SystemV更多的服务状态数据。 - * 提供基本的系统配置工具,例如主机名,日期,语言环境,已登录用户的列表,正在运行的容器和虚拟机,系统帐户,运行时目录和设置;用于简易网络配置,网络时间同步,日志转发和名称解析的守护程序。 -  * 提供套接字管理。 - * systemd定时器提供类似cron的高级功能,包括在相对于系统启动,systemd启动,定时器上次启动时刻的某个时间点运行脚本。 - * 提供了一个工具来分析定时器规格中使用的日期和时间。 - * 能感知层次的文件系统挂载和卸载可以更安全地级联挂载的文件系统。 - * 允许主动的创建和管理临时文件,包括删除文件。 - * D-Bus的接口提供在插入或移除设备时运行脚本的能力。这允许将所有设备(无论是否可插拔)都被视为即插即用,从而大大简化了设备的处理。 - * 分析启动顺序的工具可用于查找耗时最多的服务。 -  * 包括用于存储系统消息的日志以及管理日志的工具。 +根据编译过程中使用的选项(不在本系列中介绍),systemd 可以有多达 69 个二进制可执行文件执行以下任务,其中包括: +* `systemd` 程序以 1 号进程(PID 1)运行,并提供使尽可能多服务并行启动的系统启动能力,它额外加快了总体启动时间。它还管理关机顺序。 +* `systemctl` 程序提供了服务管理的用户接口。 +* 支持 SystemV 和 LSB 启动脚本,以便向后兼容。 +* 服务管理和报告提供了比 SystemV 更多的服务状态数据。 +* 提供基本的系统配置工具,例如主机名、日期、语言环境、已登录用户的列表,正在运行的容器和虚拟机、系统帐户、运行时目录及设置,用于简易网络配置、网络时间同步、日志转发和名称解析的守护进程。 +* 提供套接字管理。 +* systemd 定时器提供类似 cron 的高级功能,包括在相对于系统启动、systemd 启动时间、定时器上次启动时间的某个时间点运行脚本。 +* 它提供了一个工具来分析定时器规范中使用的日期和时间。 +* 能感知分层的文件系统挂载和卸载功能可以更安全地级联挂载的文件系统。 +* 允许主动的创建和管理临时文件,包括删除。 +* D-Bus 的接口提供了在插入或移除设备时运行脚本的能力。这允许将所有设备(无论是否可插拔)都被视为即插即用,从而大大简化了设备的处理。 +* 分析启动环节的工具可用于查找耗时最多的服务。 +* 它包括用于存储系统消息的日志以及管理日志的工具。 ### 架构 -这些和更多的任务通过许多守护程序,控制程序和配置文件来支持。图1显示了许多属于systemd的组件。这是一个简化的图,旨在提供概要描述,因此它并不包括所有独立的程序或文件。它也不提供数据流的视角,数据流是如此复杂,因此在本系列文章的背景下没用。 +这些以及更多的任务通过许多守护程序、控制程序和配置文件来支持。图 1 显示了许多属于 systemd 的组件。这是一个简化的图,旨在提供概要描述,因此它并不包括所有独立的程序或文件。它也不提供数据流的视角,数据流是如此复杂,因此在本系列文章的背景下没用。 ![系统架构][6] -完整的systemd讲解就需要一本书。您不需要了解图1中的systemd组件是如何组合在一起的细节。了解支持各种Linux服务管理以及日志文件和日志处理的程序和组件就够了。 但是很明显,systemd并不是某些批评者所说的那样的庞然大物。 +*图 1:systemd 的架构,作者 Shmuel Csaba Otto Traian (CC BY-SA 3.0)* -### 作为1号进程的systemd +如果要完整地讲解 systemd 就需要一本书。你不需要了解图 1 中的 systemd 组件是如何组合在一起的细节。只需了解支持各种 Linux 服务管理以及日志文件和日志处理的程序和组件就够了。但是很明显, systemd 并不是某些批评者所宣称的那样,它是一个单一的怪物。 -systemd是1号进程(PID 1)。它的一些功能(比老的SystemV3 init要广泛得多)用于管理正在运行的Linux主机的许多方面,包括挂载文件系统以及启动和管理Linux生产主机所需的系统服务。与启动顺序无关的任何systemd任务都不在本文讨论范围之内(但本系列后面的一些文章将探讨其中的一些任务)。 +### 作为 1 号进程的 systemd -首先,systemd挂载 **/etc/fstab** 所定义的文件系统,包括所有交换文件或分区。此时,它可以访问位于 **/etc** 中的配置文件,包括它自己的配置文件。它使用其配置链接 **/etc/systemd/system/default.target** 来确定将主机引导至哪个状态或目标。 **default.target** 文件是指向真实目标文件的符号链接。对于桌面工作站,通常是 **graphical.target**,它相当于SystemV中的运行级别5。对于服务器,默认值更可能是 **multi-user.target**,相当于SystemV中的运行级别3。 **emergency.target** 类似于单用户模式。目标(targets)和服务(services)是systemd的单位。 +systemd 是 1 号进程(PID 1)。它的一些功能,比老的 SystemV3 `init` 要广泛得多,用于管理正在运行的 Linux 主机的许多方面,包括挂载文件系统以及启动和管理 Linux 生产主机所需的系统服务。与启动环节无关的任何 systemd 任务都不在本文讨论范围之内(但本系列后面的一些文章将探讨其中的一些任务)。 -下表(图2)将systemd目标与老的SystemV启动运行级别进行了比较。systemd提供systemd目标别名以便向后兼容。目标别名允许脚本(以及许多系统管理员)使用SystemV命令(如**init 3**)更改运行级别。当然,SystemV命令被转发给systemd进行解释和执行。 +首先,systemd 挂载 `/etc/fstab` 所定义的文件系统,包括所有交换文件或分区。此时,它可以访问位于 `/etc` 中的配置文件,包括它自己的配置文件。它使用其配置链接 `/etc/systemd/system/default.target` 来确定将主机引导至哪个状态或目标。`default.target` 文件是指向真实目标文件的符号链接。对于桌面工作站,通常是 `graphical.target`,它相当于 SystemV 中的运行级别 5。对于服务器,默认值更可能是 `multi-user.target`,相当于 SystemV 中的运行级别 3。`emergency.target` 类似于单用户模式。目标target服务service是 systemd 的单元unit。 -**systemd目标** | **SystemV运行级别** | **目标别名** | **描述** ---- | --- | ---- |- -default.target | | |此目标总是通过符号连接的方式成为“多用户目标”或“图形化目标”的别名。systemd始终使用 **default.target** 来启动系统。 ** default.target** 绝不应该设为 **halt.target**,**poweroff.target** 或 **reboot.target** 的别名 -graphic.target | 5 | runlevel5.target |带有GUI的 **Multi-user.target** -| 4 | runlevel4.target |未用。在SystemV中运行级别4与运行级别3相同。可以创建并自定义此目标以启动本地服务,而无需更改默认的 **multi-user.target** -multi-user.target | 3 | runlevel3.target |所有服务在运行,但仅有命令行界面(CLI) -| 2 | runlevel2.target |多用户,没有NFS,其他所有非GUI服务在运行 -rescue.target | 1 | runlevel1.target |基本系统,包括挂载文件系统,运行最基本的服务和主控制台的恢复shell -Emergency.target | S | |单用户模式-没有服务运行;不挂载文件系统。这是最基本的工作级别,只有主控制台上运行的一个紧急Shell供用户与系统交互 -halt.target | | |在不关电源的情况下停止系统 -reboot.target | 6 | runlevel6.target |重启 -poweroff.target | 0 | runlevel0.target |停止系统并关闭电源 +下表(图 2)将 systemd 目标与老的 SystemV 启动运行级别进行了比较。systemd 提供 systemd 目标别名以便向后兼容。目标别名允许脚本(以及许多系统管理员)使用 SystemV 命令(如 `init 3`)更改运行级别。当然,SystemV 命令被转发给 systemd 进行解释和执行。 -每个目标在其配置文件中都描述了一个依赖集。systemd启动必须的依赖,这些依赖是运行Linux主机到特定功能级别所需的服务。当目标配置文件中列出的所有依赖项被加载并运行后,系统就在该目标级别运行了。 在图2中,功能最多的目标位于表的顶部,从顶向下,功能逐步递减。 +systemd 目标 | SystemV 运行级别 | 目标别名 | 描述 +--- | --- | --- | --- +`default.target` | | | 此目标总是通过符号连接的方式成为 `multi-user.target` 或 `graphical.target` 的别名。systemd 始终使用 `default.target` 来启动系统。`default.target` 绝不应该设为 `halt.target`,`poweroff.target` 或 `reboot.target` 的别名。 +`graphic.target` | 5 | `runlevel5.target` |带有 GUI 的 `multi-user.target`。 + | 4 | `runlevel4.target` |未用。在 SystemV 中运行级别 4 与运行级别 3 相同。可以创建并自定义此目标以启动本地服务,而无需更改默认的 `multi-user.target`。 +`multi-user.target` | 3 | `runlevel3.target` |所有服务在运行,但仅有命令行界面(CLI)。 + | 2 | `runlevel2.target` | 多用户,没有 NFS,其它所有非 GUI 服务在运行。 +`rescue.target` | 1 | `runlevel1.target` | 基本系统,包括挂载文件系统,运行最基本的服务和主控制台的恢复 shell。 +`emergency.target` | S | |单用户模式:没有服务运行;不挂载文件系统。这是最基本的工作级别,只有主控制台上运行的一个紧急 Shell 供用户与系统交互。 +`halt.target` | | | 停止系统而不关闭电源。 +`reboot.target` | 6 | `runlevel6.target` | 重启。 +`poweroff.target` | 0 | `runlevel0.target` | 停止系统并关闭电源。 -systemd还会检查老的SystemV init目录,以确认是否存在任何启动文件。如果有,systemd会将它们作为配置文件以启动它们描述的服务。网络服务是一个很好的例子,在Fedora中它仍然使用SystemV启动文件。 +*图 2:SystemV 运行级别与 systemd 目标和一些目标别名的比较* -图3(如下)是直接从启动手册页复制来的。它显示了systemd启动期间普遍的事件顺序以及确保成功启动的基本顺序要求。 +每个目标在其配置文件中都描述了一个依赖集。systemd 启动必须的依赖项,这些依赖项是运行 Linux 主机到特定功能级别所需的服务。当目标配置文件中列出的所有依赖项被加载并运行后,系统就在该目标级别运行了。在图 2 中,功能最多的目标位于表的顶部,从顶向下,功能逐步递减。 + +systemd 还会检查老的 SystemV `init` 目录,以确认是否存在任何启动文件。如果有,systemd 会将它们作为配置文件以启动它们描述的服务。网络服务是一个很好的例子,在 Fedora 中它仍然使用 SystemV 启动文件。 + +图 3(如下)是直接从启动手册页复制来的。它显示了 systemd 启动期间一般的事件环节以及确保成功启动的基本顺序要求。 ``` -                                         cryptsetup-pre.target -                                                   | - (various low-level                                v -     API VFS mounts:                 (various cryptsetup devices...) -  mqueue, configfs,                                |    | -  debugfs, ...)                                    v    | -  |                                  cryptsetup.target  | -  |  (various swap                                 |    |    remote-fs-pre.target -  |   devices...)                                  |    |     |        | -  |    |                                           |    |     |        v -  |    v                       local-fs-pre.target |    |     |  (network file systems) -  |  swap.target                       |           |    v     v                 | -  |    |                               v           |  remote-cryptsetup.target  | -  |    |  (various low-level  (various mounts and  |             |              | -  |    |   services: udevd,    fsck services...)   |             |    remote-fs.target -  |    |   tmpfiles, random            |           |             |             / -  |    |   seed, sysctl, ...)          v           |             |            / -  |    |      |                 local-fs.target    |             |           / -  |    |      |                        |           |             |          / -  \\____|______|_______________   ______|___________/             |         / -                              \ /                                |        / -                               v                                 |       / -                        sysinit.target                           |      / -                               |                                 |     / -        ______________________/|\\_____________________           |    / -       /              |        |      |               \          |   / -       |              |        |      |               |          |  / -       v              v        |      v               |          | / -  (various       (various      |  (various            |          |/ -   timers...)      paths...)   |   sockets...)        |          | -       |              |        |      |               |          | -       v              v        |      v               |          | - timers.target  paths.target   |  sockets.target      |          | -       |              |        |      |               v          | -       v              \\_______ | _____/         rescue.service   | -                              \|/                     |          | -                               v                      v          | -                           basic.target         rescue.target    | -                               |                                 | -                       ________v____________________             | -                      /              |              \            | -                      |              |              |            | -                      v              v              v            | -                  display-    (various system   (various system  | -              manager.service     services        services)      | -                      |         required for        |            | -                      |        graphical UIs)       v            v -                      |              |            multi-user.target - emergency.service    |              |              | -         |            \\_____________ | _____________/ -         v                          \|/ - emergency.target                    v -                              graphical.target + cryptsetup-pre.target + | + (various low-level v + API VFS mounts: (various cryptsetup devices...) + mqueue, configfs, | | + debugfs, ...) v | + | cryptsetup.target | + | (various swap | | remote-fs-pre.target + | devices...) | | | | + | | | | | v + | v local-fs-pre.target | | | (network file systems) + | swap.target | | v v | + | | v | remote-cryptsetup.target | + | | (various low-level (various mounts and | | | + | | services: udevd, fsck services...) | | remote-fs.target + | | tmpfiles, random | | | / + | | seed, sysctl, ...) v | | / + | | | local-fs.target | | / + | | | | | | / + \____|______|_______________ ______|___________/ | / + \ / | / + v | / + sysinit.target | / + | | / + ______________________/|\_____________________ | / + / | | | \ | / + | | | | | | / + v v | v | | / + (various (various | (various | |/ + timers...) paths...) | sockets...) | | + | | | | | | + v v | v | | + timers.target paths.target | sockets.target | | + | | | | v | + v \_______ | _____/ rescue.service | + \|/ | | + v v | + basic.target rescue.target | + | | + ________v____________________ | + / | \ | + | | | | + v v v | + display- (various system (various system | + manager.service services services) | + | required for | | + | graphical UIs) v v + | | multi-user.target + emergency.service | | | + | \_____________ | _____________/ + v \|/ + emergency.target v + graphical.target ``` -**sysinit.target** 和 **basic.target** 目标可以看作启动过程中的检查点。尽管systemd的设计目标之一是并行启动系统服务,但是某些服务和功能目标必须先启动,然后才能启动其他服务和目标。直到该检查点所需的所有服务和目标被满足后才能通过这些检查点。 +*图 3: systemd 启动图* -当它依赖的所有单元都完成时,将到达 **sysinit.target**。所有这些单元,挂载文件系统,设置交换文件,启动udev,设置随机数生成器种子,启动低层服务以及配置安全服务(如果一个或多个文件系统是加密的)都必须被完成,但 **sysinit.target** 的这些任务可以并行执行。 +`sysinit.target` 和 `basic.target` 目标可以看作启动过程中的检查点。尽管 systemd 的设计目标之一是并行启动系统服务,但是某些服务和功能目标必须先启动,然后才能启动其它服务和目标。直到该检查点所需的所有服务和目标被满足后才能通过这些检查点。 -**sysinit.target** 将启动系统接近正常运行所需的所有低层服务和单元,以及转移到 **basic.target** 所需的服务和单元。 +当 `sysinit.target` 所依赖的所有单元都完成时,就会到达 `sysinit.target`。所有这些单元,包括挂载文件系统、设置交换文件、启动 Udev、设置随机数生成器种子、启动低层服务以及配置安全服务(如果一个或多个文件系统是加密的)都必须被完成,但在 `sysinit.target` 中,这些任务可以并行执行。 -在完成 **sysinit.target** 目标之后,systemd会启动实现下一个目标所需的所有单元。基本目标通过启动所有下一目标所需的单元来提供一些其他功能。包括设置如PATHs为各种可执行程序的路径,设置通信套接字和计时器之类。 +`sysinit.target` 启动了系统接近正常运行所需的所有低层服务和单元,它们也是进入 `basic.target` 所需的。 -最后,用户级目标 **multi-user.target** 或 **graphical.target** 被初始化。要满足图形目标的依赖必须先达到**multi-user.target**。图3中带下划线的目标是通常的启动目标。当达到这些目标之一时,启动就完成了。如果 **multi-user.target** 是默认设置,那么您应该在控制台上看到文本模式的登录界面。如果 **graphical.target** 是默认设置,那么您应该看到图形的登录界面。您看到的特定的GUI登录界面取决于您默认的显示管理器。 +在完成 `sysinit.target` 之后,systemd 会启动实现下一个目标所需的所有单元。`basic.target` 通过启动所有下一目标所需的单元来提供一些额外功能。包括设置为各种可执行程序目录的路径、设置通信套接字和计时器之类。 -引导手册页还描述并提供了引导到初始RAM磁盘和systemd关机过程的地图。 +最后,用户级目标 `multi-user.target` 或 `graphical.target` 被初始化。要满足 `graphical.target` 的依赖必须先达到 `multi-user.target`。图 3 中带下划线的目标是通常的启动目标。当达到这些目标之一时,启动就完成了。如果 `multi-user.target` 是默认设置,那么你应该在控制台上看到文本模式的登录界面。如果 `graphical.target` 是默认设置,那么你应该看到图形的登录界面。你看到的具体的 GUI 登录界面取决于你的默认显示管理器。 -systemd还提供了一个工具,该工具列出了完整启动或指定单元的依赖。单元是可控制的systemd资源实体,其范围从特定服务(例如httpd或sshd)到计时器,挂载,套接字等。尝试以下命令并滚动查看结果。 +引导手册页还描述并提供了引导到初始化 RAM 磁盘和 systemd 关机过程的图。 + +systemd 还提供了一个工具,该工具列出了完整的启动过程或指定单元的依赖项。单元是一个可控的 systemd 资源实体,其范围可以从特定服务(例如 httpd 或 sshd)到计时器、挂载、套接字等。尝试以下命令并滚动查看结果。 ``` -`systemctl list-dependencies graphical.target` +systemctl list-dependencies graphical.target ``` -注意,这完全展开了使系统进入图形目标运行模式所需的顶层目标单元列表。 也可以使用 **\-all** 选项来展开所有其他单元。 +注意,这会完全展开使系统进入 `graphical.target` 运行模式所需的顶层目标单元列表。也可以使用 `--all` 选项来展开所有其它单元。 ``` -`systemctl list-dependencies --all graphical.target` +systemctl list-dependencies --all graphical.target ``` -您可以使用 **less** 命令来搜索诸如“target”,“slice”和“ socket”之类的字符串。 +你可以使用 `less` 命令来搜索诸如 `target`、`slice` 和 `socket` 之类的字符串。 现在尝试下面的方法。 ``` -`systemctl list-dependencies multi-user.target` +systemctl list-dependencies multi-user.target ``` 和 - ``` -`systemctl list-dependencies rescue.target` +systemctl list-dependencies rescue.target ``` 和 - ``` -`systemctl list-dependencies local-fs.target` +systemctl list-dependencies local-fs.target ``` 和 - ``` -`systemctl list-dependencies dbus.service` -``` -``` -`systemctl list-dependencies graphic.target` +systemctl list-dependencies dbus.service ``` +这个工具帮助我可视化我正用的主机的启动依赖细节。继续花一些时间探索一个或多个 Linux 主机的启动树。但是要小心,因为 systemctl 手册页包含以下注释: - -这个工具帮助我可视化我正用的主机的启动依赖细节。继续花一些时间探索一个或多个Linux主机的启动树。但是要小心,因为systemctl手册页包含以下注释: - -> _“请注意,此命令仅列出当前被服务管理器加载到内存的单元。尤其是,此命令根本不适合用于获取特定单元的全部反向依赖列表,因为它不会列出被单元声明了但是未加载的依赖项。” _ +> “请注意,此命令仅列出当前被服务管理器加载到内存的单元。尤其是,此命令根本不适合用于获取特定单元的全部反向依赖关系列表,因为它不会列出被单元声明了但是未加载的依赖项。” ### 结尾语 -即使在深入研究systemd之前,很明显能看出它既强大又复杂。显然,systemd不是单一,庞大,整体且不可知的二进制文件。相反,它是由许多较小的组件和旨在执行特定任务的子命令组成。 +即使在没有深入研究 systemd 之前,很明显能看出它既强大又复杂。显然,systemd 不是单一、庞大、独体且不可知的二进制文件。相反,它是由许多较小的组件和旨在执行特定任务的子命令组成。 -本系列的下一篇文章将更详细地探讨systemd的启动,以及systemd的配置文件,更改默认的目标以及如何创建简单服务单元。 +本系列的下一篇文章将更详细地探讨 systemd 的启动,以及 systemd 的配置文件,更改默认的目标以及如何创建简单服务单元。 ### 资源 -互联网上有大量关于systemd的信息,但是很多都简短,晦涩甚至是误导。除了本文提到的资源外,以下网页还提供了有关systemd启动的更详细和可靠的信息。 +互联网上有大量关于 systemd 的信息,但是很多都很简短、晦涩甚至是带有误导。除了本文提到的资源外,以下网页还提供了有关 systemd 启动的更详细和可靠的信息。 - * Fedora项目有一个很好的,实用的[guide to systemd][7]。它有你需要知道的通过systemd来配置,管理和维护Fedora主机所需的几乎所有知识。 - * Fedora项目还有一个不错的[cheat sheet][8],将老的SystemV命令与对比的systemd命令相互关联。 -  * 有关systemd及其创建原因的详细技术信息,请查看[Freedesktop.org][9]的[systemd描述][10]。 - * [Linux.com][11]的“systemd的更多乐趣”提供了更高级的systemd [信息和技巧][12]。 +* Fedora 项目有一个很好的实用的 [systemd 指南][7]。它有你需要知道的通过 systemd 来配置、管理和维护 Fedora 主机所需的几乎所有知识。 +* Fedora 项目还有一个不错的[速记表][8],将老的 SystemV 命令与对比的 systemd 命令相互关联。 +* 有关 systemd 的详细技术信息及创建它的原因,请查看 [Freedesktop.org][9] 对 [systemd 描述][10]。 +* [Linux.com][11] 的“systemd 的更多乐趣”提供了更高级的 systemd [信息和技巧][12]。 +还有针对 Linux 系统管理员的一系列技术性很强的文章,作者是 systemd 的设计师和主要开发者 Lennart Poettering。这些文章是在 2010 年 4 月至 2011 年 9 月之间撰写的,但它们现在和那时一样有用。关于 systemd 及其生态的其它许多好文都基于这些论文。 -还有systemd的设计师和主要开发者Lennart Poettering撰写的针对Linux系统管理员的一系列技术文章。这些文章是在2010年4月至2011年9月之间撰写的,但它们现在和那时一样有用。关于systemd及其生态的其他许多好文都基于这些论文。 +* [重新思考 1 号进程][13] +* [systemd 系统管理员篇 I][14] +* [systemd 系统管理员篇 II][15] +* [systemd 系统管理员篇 III][16] +* [systemd 系统管理员篇 IV][17] +* [systemd 系统管理员篇 V][18] +* [systemd 系统管理员篇 VI][19] +* [systemd 系统管理员篇 VII][20] +* [systemd 系统管理员篇 VIII][21] +* [systemd 系统管理员篇 IX][22] +* [systemd 系统管理员篇 X][23] +* [systemd 系统管理员篇 XI][24] - * [重新思考1号进程][13] - * [systemd之系统管理员, I][14] - * [systemd之系统管理员, II][15] - * [systemd之系统管理员, III][16] - * [systemd之系统管理员, IV][17] - * [systemd之系统管理员, V][18] - * [systemd之系统管理员, VI][19] - * [systemd之系统管理员, VII][20] - * [systemd之系统管理员, VIII][21] - * [systemd之系统管理员, IX][22] - * [systemd之系统管理员, X][23] - * [systemd之系统管理员, XI][24] - - - -Mentor Graphics的Linux内核和系统程序员Alison Chiaken预览了此文... -------------------------------------------------------------------------------- via: https://opensource.com/article/20/4/systemd @@ -293,7 +286,7 @@ via: https://opensource.com/article/20/4/systemd 作者:[David Both][a] 选题:[lujun9972][b] 译者:[messon007](https://github.com/messon007) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From db3dd6c57fd7f8384e1f92c1a910b772287891f4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 13 May 2020 08:52:15 +0800 Subject: [PATCH 0700/1809] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @messon007 https://linux.cn/article-12214-1.html 升级三星了,辛苦了!! --- .../tech => published}/20200416 Learning to love systemd.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200416 Learning to love systemd.md (99%) diff --git a/translated/tech/20200416 Learning to love systemd.md b/published/20200416 Learning to love systemd.md similarity index 99% rename from translated/tech/20200416 Learning to love systemd.md rename to published/20200416 Learning to love systemd.md index 328716266c..ef70caee08 100644 --- a/translated/tech/20200416 Learning to love systemd.md +++ b/published/20200416 Learning to love systemd.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (messon007) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12214-1.html) [#]: subject: (Learning to love systemd) [#]: via: (https://opensource.com/article/20/4/systemd) [#]: author: (David Both https://opensource.com/users/dboth) From d99266c23770a1b9552bc482593e9c24aeb31c38 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 13 May 2020 08:55:14 +0800 Subject: [PATCH 0701/1809] translated --- ...h FreeBSD as a desktop operating system.md | 70 ------------------- ...h FreeBSD as a desktop operating system.md | 67 ++++++++++++++++++ 2 files changed, 67 insertions(+), 70 deletions(-) delete mode 100644 sources/tech/20200508 Getting started with FreeBSD as a desktop operating system.md create mode 100644 translated/tech/20200508 Getting started with FreeBSD as a desktop operating system.md diff --git a/sources/tech/20200508 Getting started with FreeBSD as a desktop operating system.md b/sources/tech/20200508 Getting started with FreeBSD as a desktop operating system.md deleted file mode 100644 index 2f1be1e803..0000000000 --- a/sources/tech/20200508 Getting started with FreeBSD as a desktop operating system.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with FreeBSD as a desktop operating system) -[#]: via: (https://opensource.com/article/20/5/furybsd-linux) -[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) - -Getting started with FreeBSD as a desktop operating system -====== -FuryBSD's live desktop environment lets you try it before committing to -it. -![web development and design, desktop and browser][1] - -[FreeBSD][2] is a great operating system, but, by design, it does not come with a desktop environment. Without installing additional software from FreeBSD's [ports and packages collection][3], FreeBSD is a command-line only experience. The screenshot below shows what logging into FreeBSD 12.1 looks like when every one of the "optional system components" is selected during installation. - -![FreeBSD][4] - -FreeBSD can be turned into a desktop operating system with any of a wide selection of desktop environments, but it takes time, effort, and [following a lot of written instructions][5]. Using the **desktop-installer** package, which provides the user with options in a text-based menu and helps automate much of the process, is still time-consuming. The biggest problem with either of these methods is that users might find out that their system is not fully compatible with FreeBSD after they have taken all the time to set things up. - -[FuryBSD][6] solves that problem by providing a live desktop image that users can evaluate before installing. Currently, FuryBSD provides an Xfce image and a KDE image. Each of these images provides an installation of FreeBSD that has a desktop environment pre-installed. If users try out the image and find that their hardware works, they can install FuryBSD and have a ready-to-go desktop operating system powered by FreeBSD. For the purposes of this article, I will be using the Xfce image, but the KDE image works the exact same way. - -Getting started with FuryBSD should be a familiar process to anyone who has installed a Linux distribution, any of the BSDs, or any other Unix-like open source operating system. Download the ISO from the FuryBSD website, copy it to a flash drive, and boot a computer from the flash drive. If booting from the flash drive fails, make sure Secure Boot is disabled. - -![FuryBSD Live XFCE Desktop][7] - -After booting from the flash drive, the desktop environment loads automatically. In addition to the Home, File System, and Trash icons, the live desktop has icons for a tool to configure Xorg, getting started instructions, the FuryBSD installer, and a system information utility. Other than these extras and some custom Xfce settings and wallpaper, the desktop environment does not come with much beyond the basic Xfce applications and Firefox. - -![FuryBSD Xorg Tool][8] - -Only basic graphics drivers are loaded at this point, but it is enough to check to see if the system's wired and wireless network interfaces are supported by FuryBSD. If none of the network interfaces is working automatically, the **Getting Started.txt** file contains instructions for attempting to configure network interfaces and other configuration tasks. If at least one of the network interfaces works, the **Configure Xorg** application can be used to install Intel, NVidia, or VirtualBox graphics drivers. The drivers will be downloaded and installed, and Xorg will need to be restarted. If the system does not automatically re-login to the live image user, the password is **furybsd**. Once they are configured, the graphics drivers will carry over to an installed system. - -![FuryBSD Installer - ZFS Configuration][9] - -If everything works well in the live environment, the FuryBSD installer can configure and install FuryBSD onto the computer. This installer runs in a terminal, but it provides the same options found in most other BSD and Linux installers. The user will be asked to set the system's hostname, configure ZFS storage, set the root password, add at least one non-root user, and configure the time and date settings. Once the process is complete, the system can be rebooted into a pre-configured FreeBSD with an Xfce (or KDE) desktop. FuryBSD did all the hard work and even took the extra effort to make the desktop look nice. - -![FuryBSD Post-Install XFCE Desktop][10] - -As noted above, the desktop environment does not come with a lot of pre-installed software, so installing additional packages is almost certainly necessary. The quickest way to do this is by using the **pkg** command in the terminal. This command behaves much like **dnf** and **apt**, so users coming from a Linux distribution that uses one of those should feel right at home when it comes to finding and installing packages. FreeBSD's package collection is large, so most of the big-name open source software packages are available. - -Users trying out FuryBSD without having much FreeBSD experience should consult the [FreeBSD Handbook][11] to learn more about how to do things the FreeBSD way. Users with experience using any Linux distribution or one of the other BSDs should be able to figure out a lot of things, but there are differences that the handbook can help clarify. Another great resource for learning more about the FreeBSD way of doing things is _[Absolute FreeBSD, 3rd Edition][12],_ by Michael W. Lucas. - -A brief overview of PC-BSD and thoughts about the distribution. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/5/furybsd-linux - -作者:[Joshua Allen Holm][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/holmja -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/web_browser_desktop_devlopment_design_system_computer.jpg?itok=pfqRrJgh (web development and design, desktop and browser) -[2]: https://www.freebsd.org -[3]: https://www.freebsd.org/ports/ -[4]: https://opensource.com/sites/default/files/uploads/freebsd.png (FreeBSD) -[5]: https://www.freebsdfoundation.org/freebsd/how-to-guides/installing-a-desktop-environment-on-freebsd/ -[6]: https://www.furybsd.org -[7]: https://opensource.com/sites/default/files/uploads/furybsd_live_xfce_desktop.png (FuryBSD Live XFCE Desktop) -[8]: https://opensource.com/sites/default/files/uploads/furybsd_xorg_tool.png (FuryBSD Xorg Tool) -[9]: https://opensource.com/sites/default/files/uploads/furybsd_installer_-_zfs_configuration.png (FuryBSD Installer - ZFS Configuration) -[10]: https://opensource.com/sites/default/files/uploads/furybsd_post-install_xfce_desktop.png (FuryBSD Post-Install XFCE Desktop) -[11]: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ -[12]: https://nostarch.com/absfreebsd3 diff --git a/translated/tech/20200508 Getting started with FreeBSD as a desktop operating system.md b/translated/tech/20200508 Getting started with FreeBSD as a desktop operating system.md new file mode 100644 index 0000000000..ceebbcfa81 --- /dev/null +++ b/translated/tech/20200508 Getting started with FreeBSD as a desktop operating system.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with FreeBSD as a desktop operating system) +[#]: via: (https://opensource.com/article/20/5/furybsd-linux) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) + +开始用 FreeBSD 作为桌面操作系统 +====== +FuryBSD 的 live 桌面环境能让你在实际使用之前先尝试。 +![web development and design, desktop and browser][1] + +[FreeBSD][2] 是一个很棒的操作系统,但是从设计上讲,它没有桌面环境。如果不从 FreeBSD 的 [ports 和软件包集][3]安装其他软件,那么 FreeBSD 仅能体验命令行。下面的截图显示了在安装过程中选择了每个“可选系统组件”后,登录 FreeBSD 12.1 的样子。 + +![FreeBSD][4] + +可以将 FreeBSD 变成包含各种桌面环境的操作系统,但是这需要时间、精力和[遵循大量书面说明][5]。使用使用 **desktop-installer** 包(为用户提供基于文本的菜单并帮助自动执行大部分过程)仍然非常耗时。这两种方法的最大问题是,用户在花了很多时间进行设置之后,可能会发现他们的系统与 FreeBSD 不完全兼容。 + +[FuryBSD][6] 通过提供 live 桌面镜像来解决此问题,用户可以在安装之前对其进行评估。目前,FuryBSD 提供 Xfce 镜像和 KDE 镜像。每个镜像都提供已预安装桌面环境的 FreeBSD。如果用户试用镜像并发现其硬件工作正常,那么他们可以安装 FuryBSD,并拥有由 FreeBSD 提供支持的即用桌面操作系统。在本文中,我将使用 Xfce 镜像,但 KDE 镜像的使用完全一样。 + +对于任何安装过 Linux 发行版、BSD 或任何其他类 Unix 的开源操作系统的人,开始用 FuryBSD 都应该是一个熟悉的过程。从 FuryBSD 网站下载 ISO,将它复制到闪存,然后从闪存启动计算机。如果从闪存引导失败,请确保安全引导已禁用。 + +![FuryBSD Live XFCE Desktop][7] + +从闪存启动后,桌面环境将自动加载。除了“家”、“文件系统”和“回收站”图标外,live 桌面还有用于配置 Xorg 的工具、入门指南、FuryBSD 安装程序和系统信息程序的图标。除了这些额外功能以及一些自定义的 Xfce 设置和墙纸外,桌面环境除了基本的 Xfce 应用和 Firefox 之外并没有其他功能。 + +![FuryBSD Xorg Tool][8] + +此时仅加载基本的图形驱动,但足以检查 FuryBSD 是否支持系统的有线和无线网络接口。如果没有网络接口自动工作,那么 **Getting Started.txt** 文件包含有关尝试配置网络接口和其他配置任务的说明。如果至少有一个网络接口有效,那么可以使用 **Configure Xorg** 应用安装 Intel、NVidia 或 VirtualBox 图形驱动。它将下载并安装驱动,并且需要重新启动 Xorg。如果系统未自动重新登录到 live 用户,那么密码为 **furybsd**。配置后,图形驱动将转移到已安装的系统中。 + +![FuryBSD Installer - ZFS Configuration][9] + +如果一切都可以在 live 环境中正常运行,那么 FuryBSD 安装程序可以将 FuryBSD 配置并安装到计算机上。该安装程序在终端中运行,但提供与大多数其他 BSD 和 Linux 安装程序相同的选项。系统将要求用户设置系统的主机名、配置 ZFS 存储,设置 root 密码,添加至少一个非 root 用户以及配置时间和日期。完成后,系统可以引导到预装有 Xfce (或 KDE)的 FreeBSD 中。FuryBSD 完成了所有困难的工作,甚至还花了很多精力使桌面看起来更漂亮。 + +![FuryBSD Post-Install XFCE Desktop][10] + +如上所述,桌面环境没有大量预装软件,因此几乎肯定要安装额外的软件包。最快的方法是在终端中使用 **pkg** 命令。该命令的行为很像 dnf 和 apt,因此来自 Linux 发行版的用户(使用其中之一)在查找和安装软件包时应该感到很熟悉。 FreeBSD的软件包集合很大,因此大多数知名的开源软件包都可用。 + +在没有太多 FreeBSD 经验的情况下尝试 FuryBSD 的用户应查阅 [FreeBSD 手册][11],以了解有关如何以 FreeBSD 的方式做事。有任何 Linux 发行版或其他 BSD 使用经验的用户应该能弄清很多事情,但是手册可以帮助你弄清一些差异。进一步了解 FreeBSD 的一个很好的资源是 Michael W. Lucas 的 _[Absolute FreeBSD,第三版][12]_。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/furybsd-linux + +作者:[Joshua Allen Holm][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/web_browser_desktop_devlopment_design_system_computer.jpg?itok=pfqRrJgh (web development and design, desktop and browser) +[2]: https://www.freebsd.org +[3]: https://www.freebsd.org/ports/ +[4]: https://opensource.com/sites/default/files/uploads/freebsd.png (FreeBSD) +[5]: https://www.freebsdfoundation.org/freebsd/how-to-guides/installing-a-desktop-environment-on-freebsd/ +[6]: https://www.furybsd.org +[7]: https://opensource.com/sites/default/files/uploads/furybsd_live_xfce_desktop.png (FuryBSD Live XFCE Desktop) +[8]: https://opensource.com/sites/default/files/uploads/furybsd_xorg_tool.png (FuryBSD Xorg Tool) +[9]: https://opensource.com/sites/default/files/uploads/furybsd_installer_-_zfs_configuration.png (FuryBSD Installer - ZFS Configuration) +[10]: https://opensource.com/sites/default/files/uploads/furybsd_post-install_xfce_desktop.png (FuryBSD Post-Install XFCE Desktop) +[11]: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ +[12]: https://nostarch.com/absfreebsd3 From 3fe37353aeb136862c7640c3f45aad3dd8628c9b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 13 May 2020 08:55:17 +0800 Subject: [PATCH 0702/1809] PRF --- published/20200416 Learning to love systemd.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/published/20200416 Learning to love systemd.md b/published/20200416 Learning to love systemd.md index ef70caee08..5cacf21a0c 100644 --- a/published/20200416 Learning to love systemd.md +++ b/published/20200416 Learning to love systemd.md @@ -24,9 +24,9 @@ systemd(是的,全小写,即使在句子开头也是小写),是初始 Linux 主机从关机状态到运行状态的完整启动过程很复杂,但它是开放的并且是可知的。在详细介绍之前,我将简要介绍一下从主机硬件被上电到系统准备好用户登录的过程。大多数时候,“引导过程”被作为一个整体来讨论,但这是不准确的。实际上,完整的引导和启动过程包含三个主要部分: -* `硬件引导`:初始化系统硬件 -* `Linux 引导boot`:加载 Linux 内核和 systemd -* `Linux 启动startup`:systemd 为主机的生产性工作做准备 +* 硬件引导:初始化系统硬件 +* Linux 引导boot:加载 Linux 内核和 systemd +* Linux 启动startup:systemd 为主机的生产性工作做准备 Linux 启动阶段始于内核加载了 `init` 或 systemd(取决于具体发行版使用的是旧的方式还是还是新的方式)之后。`init` 和 systemd 程序启动并管理所有其它进程,它们在各自的系统上都被称为“所有进程之母”。 From 2b31fa3a728d8721df0b67e9cd96d49b5907fe17 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 13 May 2020 09:03:24 +0800 Subject: [PATCH 0703/1809] translating --- ...tomizing my open source PHP framework for web development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200506 Customizing my open source PHP framework for web development.md b/sources/tech/20200506 Customizing my open source PHP framework for web development.md index 8247a6ad49..241f31754f 100644 --- a/sources/tech/20200506 Customizing my open source PHP framework for web development.md +++ b/sources/tech/20200506 Customizing my open source PHP framework for web development.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 818965736417b964267c63818f89a5cd43549941 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 13 May 2020 10:46:06 +0800 Subject: [PATCH 0704/1809] PRF --- published/20200417 How to compress files on Linux 5 ways.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20200417 How to compress files on Linux 5 ways.md b/published/20200417 How to compress files on Linux 5 ways.md index d0cb239d11..5ba0c7feeb 100644 --- a/published/20200417 How to compress files on Linux 5 ways.md +++ b/published/20200417 How to compress files on Linux 5 ways.md @@ -62,7 +62,7 @@ $ ls -l bigfile bigfile.zip ### gzip -`gzip` 命令非常容易使用。你只需要键入 `gzip`,紧随其后的是你想要压缩的文件名称。不像上述描述的命令,`gzip` 将“就地”加密文件。换句话说,原始文件将被加密文件替换。 +`gzip` 命令非常容易使用。你只需要键入 `gzip`,紧随其后的是你想要压缩的文件名称。不像上述描述的命令,`gzip` 将“就地”“加密”文件。换句话说,原始文件将被“加密”文件替换。 ``` $ gzip bigfile @@ -120,7 +120,7 @@ $ ls -l bigfile* #### 运行时间 -`xz` 命令似乎比其它命令需要花费更多的时间来加密文件。对于 `bigfile` 来说,大概的时间是: +`xz` 命令似乎比其它命令需要花费更多的时间来“加密”文件。对于 `bigfile` 来说,大概的时间是: ``` 命令 运行时间 From 656b0454fb8671392b432c07c1062cb2b97ac6bd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 13 May 2020 16:20:34 +0800 Subject: [PATCH 0705/1809] PRF @geekpi --- ...in Ubuntu and Other Linux Distributions.md | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/translated/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md b/translated/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md index cfad9fdfc4..7fc69dfdec 100644 --- a/translated/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md +++ b/translated/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md @@ -1,13 +1,13 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Fixing “Unable to parse package file /var/lib/apt/lists” Error in Ubuntu and Other Linux Distributions) [#]: via: (https://itsfoss.com/unable-to-parse-package-file/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -修复 Ubuntu 和其他 Linux 发行版中的 “Unable to parse package file /var/lib/apt/lists” 错误 +修复 Ubuntu 中的 “Unable to parse package file” 错误 ====== 过去,我已经讨论了许多 [Ubuntu 更新错误][1]。如果你[使用命令行更新 Ubuntu][2],那可能会遇到一些“错误”。 @@ -16,15 +16,19 @@ 在本文中,我将向你展示如何解决在更新系统或安装新软件时可能遇到的以下错误: -**Reading package lists… Error! +``` +Reading package lists… Error! E: Unable to parse package file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease -E: The package lists or status file could not be parsed or opened.** +E: The package lists or status file could not be parsed or opened. +``` 在 Debian 中可能会遇到类似的错误: -**E: Unable to parse package file /var/lib/apt/extended_states (1)** +``` +E: Unable to parse package file /var/lib/apt/extended_states (1) +``` -即使遇到 “**The package cache file is corrupted**” 也完全不必惊慌。这真的很容易“修复”。 +即使遇到 `The package cache file is corrupted` 也完全不必惊慌。这真的很容易“修复”。 ### 在基于 Ubuntu 和 Debian 的 Linux 发行版中处理 “Unable to parse package file” 错误 @@ -32,11 +36,13 @@ E: The package lists or status file could not be parsed or opened.** 以下是你需要做的。仔细查看 [Ubuntu][4] 报错文件的名称和路径。 +``` Reading package lists… Error! -**E: Unable to parse package file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease** +E: Unable to parse package file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease E: The package lists or status file could not be parsed or opened. +``` -例如,上面的错误是在报 /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease 文件错误。 +例如,上面的错误是在报 `/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease` 文件错误。 这让你想到这个文件不正确。现在,你需要做的就是删除该文件并重新生成缓存。 @@ -44,7 +50,7 @@ E: The package lists or status file could not be parsed or opened. sudo rm ``` -因此,这里我可以使用以下命令:**sudo rm /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease**,然后使用 sudo apt update 命令重建缓存。 +因此,这里我可以使用以下命令:`sudo rm /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_InRelease`,然后使用 `sudo apt update` 命令重建缓存。 #### 给初学者的分步指导 @@ -81,13 +87,13 @@ sudo apt update #### 解释这为何能解决问题 -/var/lib/apt 是与 apt 软件包管理器相关的文件和数据的存储目录。/var/lib/apt/lists 是用于保存系统 source.list 中指定的每个软件包资源信息的目录。 +`/var/lib/apt` 是与 apt 软件包管理器相关的文件和数据的存储目录。`/var/lib/apt/lists` 是用于保存系统 `source.list` 中指定的每个软件包资源信息的目录。 -简单点来说,/var/lib/apt/lists 保存软件包信息缓存。当你要安装或更新程序时,系统会在此目录中检查该软件包中的信息。如果找到了该包的详细信息,那么它将进入远程仓库并实际下载程序或其更新。 +简单点来说,`/var/lib/apt/lists` 保存软件包信息缓存。当你要安装或更新程序时,系统会在此目录中检查该软件包中的信息。如果找到了该包的详细信息,那么它将进入远程仓库并实际下载程序或其更新。 -当你运行 “sudo apt update” 时,它将构建缓存。这就是为什么即使删除 /var/lib/apt/lists 目录中的所有内容,运行更新也会建立新的缓存的原因。 +当你运行 `sudo apt update` 时,它将构建缓存。这就是为什么即使删除 `/var/lib/apt/lists` 目录中的所有内容,运行更新也会建立新的缓存的原因。 -这就是处理文件无法解析问题的方式。你的系统报某个软件包或仓库信息以某种方式损坏(下载失败或手动更改 sources.list)。删除该文件(或所有文件)并重建缓存即可解决此问题。 +这就是处理文件无法解析问题的方式。你的系统报某个软件包或仓库信息以某种方式损坏(下载失败或手动更改 `sources.list`)。删除该文件(或所有文件)并重建缓存即可解决此问题。 #### 仍然有错误? @@ -100,7 +106,7 @@ via: https://itsfoss.com/unable-to-parse-package-file/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a71aca861855cf4b13d2209368b2814df454a8e2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 13 May 2020 16:21:05 +0800 Subject: [PATCH 0706/1809] PUB @geekpi https://linux.cn/article-12216-1.html --- ...pt-lists- Error in Ubuntu and Other Linux Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md (98%) diff --git a/translated/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md b/published/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md similarity index 98% rename from translated/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md rename to published/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md index 7fc69dfdec..41c25c7d8d 100644 --- a/translated/tech/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md +++ b/published/20200508 Fixing -Unable to parse package file -var-lib-apt-lists- Error in Ubuntu and Other Linux Distributions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12216-1.html) [#]: subject: (Fixing “Unable to parse package file /var/lib/apt/lists” Error in Ubuntu and Other Linux Distributions) [#]: via: (https://itsfoss.com/unable-to-parse-package-file/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From f37554435ae620594fdd34c94cf042045ca6e6d2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 13 May 2020 21:57:51 +0800 Subject: [PATCH 0707/1809] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Acceleratorrrr 恭喜你完成了第一篇翻译贡献! --- ... your Linux email services with SSL-TLS.md | 101 +++++++++--------- 1 file changed, 48 insertions(+), 53 deletions(-) diff --git a/translated/tech/20200427 How to secure your Linux email services with SSL-TLS.md b/translated/tech/20200427 How to secure your Linux email services with SSL-TLS.md index 0c300160fe..7f2da93436 100644 --- a/translated/tech/20200427 How to secure your Linux email services with SSL-TLS.md +++ b/translated/tech/20200427 How to secure your Linux email services with SSL-TLS.md @@ -1,27 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (Acceleratorrrr) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to secure your Linux email services with SSL/TLS) [#]: via: (https://opensource.com/article/20/4/securing-linux-email) [#]: author: (Marc Skinner https://opensource.com/users/marc-skinner) -如何利用 SSL/TLS 保护你的Linux邮箱服务 +如何利用 SSL/TLS 保护你的 Linux 邮件服务 ====== -通过理解安全证书来保护你的Linux邮箱服务。 -![email or newsletters via inbox and browser][1] +> 通过理解安全证书来保护你的 Linux 邮件服务。 -通常,不管你是通过简单邮件传输协议(SMTP)或者邮局协议(POP)发送或者接受邮件,邮箱服务默认使用无保护明文来传输数据。近来随着数据加密成为越来越多程序的共识,你需要传输层安全性协议 / 安全套接层(SSL/TLS)的安全证书来保护你的邮箱服务。 +![](https://img.linux.net.cn/data/attachment/album/202005/13/215637khaogmririavnrlk.jpg) -首先,快速回顾一下邮箱服务和协议的基本流程。邮件通过简单邮件传输协议从端口25发出。这个协议依靠DNS邮件交换服务器里的地址信息来传输邮件。当邮件到达邮件服务器后,可以被以下两种服务中的任意一种检索:因特网信息访问协议(IMAP)使用端口143,或者邮局协议第3版本(POP3)使用端口110。然而,以上服务默认默认使用明文传输邮件和验证信息。这非常的不安全! +通常,不管你是通过简单邮件传输协议Simple Mail Transport Protocol(SMTP)或者互联网消息访问协议Internet Message Access Protocol(IMAP)或邮局协议Post Office Protocol(POP)发送或者接受邮件,邮件服务默认都是以无保护的明文来传输数据。近来随着数据加密成为越来越多程序的共识,你需要安全套接层Secure Sockets Layer/传输层安全性Transport Layer Security(SSL/TLS)的安全证书来保护你的邮件服务。 -以上服务已经添加了安全功能来保护邮件内容和验证信息,使它们可以利用SSL/TLS证书包裹和加密数据流。SSL/TLS如何加密数据的细节不在本文讨论范围,有兴趣的话可以阅读[布莱恩特关于网络安全的文章][2]。概括的说,SSL/TLS 加密本质是一种基于公钥和私钥的算法。 +首先,快速回顾一下邮件服务和协议的基本流程。邮件通过 SMTP 从 TCP 端口 25 发出。这个协议依靠 DNS 邮件交换服务器Mail eXchanger(MX)记录的地址信息来传输邮件。当邮件到达邮件服务器后,可以被以下两种服务中的任意一种检索:使用 TCP 端口 143 的 IMAP,或者使用 TCP 端口 110 的 POP3(邮局协议第 3 版)。然而,以上服务都默认使用明文传输邮件和认证信息。这非常的不安全! -通过加入新的安全功能后,这些服务可以监听新的TCP端口: +为了保护电子邮件数据和认证,这些服务都增加了一个安全功能,使它们可以利用 SSL/TLS 证书对数据流和通讯进行加密封装。SSL/TLS 是如何加密数据的细节不在本文讨论范围,有兴趣的话可以阅读 [Bryant Son 关于互联网安全的文章][2]了解更多细节。概括的说,SSL/TLS 加密是一种基于公钥和私钥的算法。 -服务 | 默认TCP端口 | SSL/TLS 端口 +通过加入这些安全功能后,这些服务将监听在新的 TCP 端口: + +服务 | 默认 TCP 端口 | SSL/TLS 端口 ---|---|--- SMTP | 25 | 587 IMAP | 143 | 993 @@ -29,63 +30,61 @@ POP3 | 110 | 995 ### 生成 SSL/TLS 证书 -[OpenSSL][3] 可以生成免费的 SSL/TLS 证书,或者你也可以从根证书颁发机构购买。过去,生成自签发证书十分简单而且通用,但是由于安全被日益重视,大部分的邮箱客户端是不信任自签发证书的,除非手动设置。 +[OpenSSL][3] 可以生成免费的 SSL/TLS 证书,或者你也可以从公共证书颁发机构Certificate Authoritie(CA)购买。过去,生成自签发证书十分简单而且通用,但是由于安全被日益重视,大部分的邮件客户端是不信任自签发证书的,除非手动设置。 -如果你只是自己使用或者做做测试,那就使用自签发证书省点钱吧。但是如果很多人或者客户也需要使用的话,那最好还是从受信任的根证书颁发机构购买。 +如果你只是自己使用或者做做测试,那就使用自签发证书省点钱吧。但是如果很多人或者客户也需要使用的话,那最好还是从受信任的证书颁发机构购买。 -总之,Linux 系统里的 OpenSSL 工具需要一个证书来生成凭证签发请求文件(CSR): +不管是哪种情况,开始请求新证书的过程是使用 Linux 系统上的 OpenSSL 工具来创建一个证书签发请求Certificate Signing Request完全合规域名Fully Qualified Domain Name(FQDN)、邮件联系信息等等。当你输入完这些信息后,私钥和 CSR 文件就生成完毕了。 #### 如果你想生成自签发证书 -如果你想要生成自签发证书的话,在运行以上 CSR 命令之前,你必须先创建一个[自签发证书机构][4]。 +如果你想要生成自签发证书的话,在运行以上 CSR 命令之前,你必须先创建一个[自己的根 CA][4]。你可以通过以下方法创建自己的根 CA。 ``` -`$ openssl genrsa -des3 -out myCA.key 2048` +$ openssl genrsa -des3 -out myCA.key 2048 ``` -命令行会提示你输入密码。请输入一个复杂点的密码而且不要弄丢了,因为这将会是自签发证书机构的密码,并且决定了其签发证书的受信任度。 +命令行会提示你输入一个密码。请输入一个复杂点的密码而且不要弄丢了,因为这将会是根 CA 私钥的密码,正如其名称所示,它是你的证书中所有信任关系的根。 -接下来,生成自签发证书机构: +接下来,生成根 CA 证书: ``` -`$ openssl req -x509 -new -nodes -key myCA.key -sha256 -days 1825 -out myCA.pem` +$ openssl req -x509 -new -nodes -key myCA.key -sha256 -days 1825 -out myCA.pem ``` -在回答完一些问题后,你就拥有一个有效期为5年的自签发证书机构了。 +在回答完一些问题后,你就拥有一个有效期为 5 年的根 CA 证书了。 -用之前生成的 CSR 文件,你可以向刚生成的自签发证书机构请求生成一个新的证书。 +用之前生成的 CSR 文件,你可以请求生成一个新证书,并由您刚才创建的根 CA 签名。 ``` -`$ openssl x509 -req -in mail.mydomain.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out mail.mydomain.pem -days 1825 -sha256` +$ openssl x509 -req -in mail.mydomain.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out mail.mydomain.pem -days 1825 -sha256 ``` -输入自签发证书机构的密码来生成和签发证书。 +输入你的根 CA 私钥的密码来创建和签署证书。 -现在你还需要两个文件来设置你的邮箱服务安全:私匙文件 **mail.mydomain.key**, 和证书文件 **mail.mydomain.pem**。 +现在你有了配置电子邮件服务以增强安全性所需的两个文件:私匙文件 `mail.mydomain.key` 和公开证书文件 `mail.mydomain.pem`。 #### 如果你愿意购买证书 -If you purchase a certificate from a vendor, it will ask you to upload that CSR to its system, as it is used as the input to generate the SSL/TLS certificate. The certificate will be accessible as a file (such as **mail.mydomain.pem**). Many SSL vendors also require you to download an intermediate certificate. If this is the case, you must combine the two certificate files into one, so the email service can process them both in combination. You can combine your certificate with a third-party intermediate certificate with: -如果你愿意从机构购买证书,则需要上传 CSR 文件到机构的系统中,它将会被用于生成 SSL/TLS 证书。证书可作为文件下载,比如 **mail.mydomain.pem**。很多SSL机构也需要你下载一个中间证书。这样的话,你必须把这个两个证书合并称一个,邮件服务才能够正常运行。可以使用以下命令把你的证书和第三方中间证书合并在一起: +如果你愿意从机构购买证书,则需要上传 CSR 文件到证书颁发机构的系统中,它将会被用于生成 SSL/TLS 证书。证书可作为文件下载,比如 `mail.mydomain.pem`。很多 SSL 机构也需要你下载一个中间证书。如果是这样的话,你必须把这个两个证书合并成一个,这样电子邮件服务就可以将这两个证书结合起来处理。可以使用以下命令把你的证书和第三方中间证书合并在一起: ``` -`$ cat mail.mydomain.pem gd_bundle-g2-g1.crt > mail.mydomain.pem` +$ cat mail.mydomain.pem gd_bundle-g2-g1.crt > mail.mydomain.pem ``` -值得一提的是 **.pem** 文件后缀代表隐私增强邮件。 +值得一提的是 `.pem` 文件后缀代表隐私增强邮件Privacy-Enhanced Mail。 -Now you have the two files you need to configure your email services for enhanced security: the private key file, **mail.mydomain.key**, and the public combined certificate file, **mail.mydomain.pem**. -现在你就有全部的设置邮箱服务安全所需文件了:私匙文件 **mail.mydomain.key**, 和证书文件 **mail.mydomain.pem**。 +现在你就有全部的设置邮件服务安全所需文件了:私匙文件 `mail.mydomain.key` 和组合的公开证书文件 `mail.mydomain.pem`。 ### 为你的文件生成一个安全的文件夹 -不管你是的证书是自签发的或者从机构购买,你都需要生成一个安全的,管理员权限级别的文件夹用于保存这两个文件。可以使用以下命令来生成: +不管你是的证书是自签发的或者从机构购买,你都需要生成一个安全的,管理员拥有的文件夹用于保存这两个文件。可以使用以下命令来生成: ``` $ mkdir /etc/pki/tls @@ -93,18 +92,17 @@ $ chown root:root /etc/pki/tls $ chmod 700 /etc/pki/tls ``` -在复制文件到 **/etc/pki/tls** 后,再次设置这些文件的权限: +在复制文件到 `/etc/pki/tls` 后,再次设置这些文件的权限: ``` -`$ chmod 600 /etc/pki/tls/*` +$ chmod 600 /etc/pki/tls/* ``` ### 配置你的 SMTP 和 IMAP 服务 -接下来,让 SMTP 和 IMAP 服务使用新的安全证书。我们用 **postfix** and **dovecot** 来作为例子。 +接下来,让 SMTP 和 IMAP 服务使用新的安全证书。我们用 `postfix` 和 `dovecot` 来作为例子。 -Edit ***/_****etc****_/*****postfix/main.cf** in your preferred text editor. Add the following lines: -用你顺手的编辑器来编辑 ***/_etc_/postfix/main.cf** 文件。添加以下几行: +用你顺手的编辑器来编辑 `/etc/postfix/main.cf` 文件。添加以下几行: ``` smtpd_use_tls = yes @@ -130,7 +128,7 @@ smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 ``` -**/etc/dovecot/dovecot.conf** 文件添加以下三行: +编辑 `/etc/dovecot/dovecot.conf` 文件,添加以下三行: ``` ssl = required @@ -138,7 +136,7 @@ ssl_cert = </etc/pki/tls/mail.mydomain.pem ssl_key = </etc/pki/tls/mail.mydomain.key ``` -添加更多选项来启用或禁用各种加密算法,协议等等(可选): +添加下列更多选项来启用或禁用各种加密算法、协议等等(我把这些留给你来理解): ``` ssl_cipher_list = EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:ALL:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SSLv2 @@ -147,28 +145,27 @@ ssl_protocols = !SSLv2 !SSLv3 !TLSv1 !TLSv1.1 ssl_min_protocol = TLSv1.2 ``` -### 安全增强式Linux上下文设置 +### 设置 SELinux 上下文 -如果使用安全增强式Linux发行版,你需要给新证书文件配置正确的安全上下文。 +如果你的 Linux 发行版启用了 SELinux,请为你的新证书文件设置正确的 SELinux 上下文。 -Postfix SELinux 用户: +对于 Postfix 设置 SELinux: ``` -`$ chcon -u system_u -t cert_t mail.mydomain.*` +$ chcon -u system_u -t cert_t mail.mydomain.* ``` -Dovecot SELinux 用户: +对于 Dovecot 设置 SELinux: ``` -`$ chcon -u system_u -t dovecot_cert_t mail.mydomain.*` +$ chcon -u system_u -t dovecot_cert_t mail.mydomain.* ``` -Restart both services and connect with your updated email client configurations. Some email clients will auto-detect the new port numbers; others will require you to update them. -重启这些服务,然后联接上更新后的邮箱客户端。有些邮箱客户端会自动探测到新的端口,有些则需要你手动升级。 +重启这些服务,并与你相应更新过的电子邮件客户端配置连接。有些电子邮件客户端会自动探测到新的端口,有些则需要你手动更新。 -### 测试 +### 测试配置 -用 **openssl** 命令行和 **s_client** 插件来简单测试一下: +用 `openssl` 命令行和 `s_client` 插件来简单测试一下: ``` $ openssl s_client -connect mail.mydomain.com:993 @@ -176,10 +173,8 @@ $ openssl s_client -starttls imap -connect mail.mydomain.com:143 $ openssl s_client -starttls smtp -connect mail.mydomain.com:587 ``` -These test commands will show a plethora of data about the connection, certificate, cipher, session, and protocol you're using. This is not only a good way to validate that the new configuration is working but also to confirm you're using the appropriate certificate and security settings you defined in the **postfix** or **dovecot** configuration files. -这些测试命令会打印出很多信息,关于你使用的联接,证书,加密算法,会话和协议。这不仅是一个验证新设置的好方法,也可以检查你是否使用了适当的证书,以及 **postfix** 或者 **dovecot** 配置文件里的安全设置是否生效。 +这些测试命令会打印出很多信息,关于你使用的连接、证书、加密算法、会话和协议。这不仅是一个验证新设置的好方法,也可以确认你使用了适当的证书,以及在 postfix 或 dovecot 配置文件中定义的安全设置正确。 -Stay secure! 保持安全! -------------------------------------------------------------------------------- @@ -189,13 +184,13 @@ via: https://opensource.com/article/20/4/securing-linux-email 作者:[Marc Skinner][a] 选题:[lujun9972][b] 译者:[Acceleratorrrr](https://github.com/Acceleratorrrr) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/marc-skinner [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/newsletter_email_mail_web_browser.jpg?itok=Lo91H9UH (email or newsletters via inbox and browser) -[2]: https://opensource.com/article/19/11/internet-security-tls-ssl-certificate-authority +[2]: https://linux.cn/article-11699-1.html [3]: https://www.openssl.org/ [4]: https://en.wikipedia.org/wiki/Root_certificate From ec783a97084d1b86d7da26a1841812d534c6142a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 13 May 2020 21:59:15 +0800 Subject: [PATCH 0708/1809] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Acceleratorrrr 本文首发地址:https://linux.cn/article-12217-1.html 你的 LCTT 专页地址: https://linux.cn/lctt/Acceleratorrrr 请注册以领取 LCCN: https://lctt.linux.cn/ --- ...27 How to secure your Linux email services with SSL-TLS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200427 How to secure your Linux email services with SSL-TLS.md (99%) diff --git a/translated/tech/20200427 How to secure your Linux email services with SSL-TLS.md b/published/20200427 How to secure your Linux email services with SSL-TLS.md similarity index 99% rename from translated/tech/20200427 How to secure your Linux email services with SSL-TLS.md rename to published/20200427 How to secure your Linux email services with SSL-TLS.md index 7f2da93436..48c2138c7a 100644 --- a/translated/tech/20200427 How to secure your Linux email services with SSL-TLS.md +++ b/published/20200427 How to secure your Linux email services with SSL-TLS.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Acceleratorrrr) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12217-1.html) [#]: subject: (How to secure your Linux email services with SSL/TLS) [#]: via: (https://opensource.com/article/20/4/securing-linux-email) [#]: author: (Marc Skinner https://opensource.com/users/marc-skinner) From 6ff2bee0376978c4caf528c1320c4c8f46893484 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 14 May 2020 03:53:08 +0800 Subject: [PATCH 0709/1809] =?UTF-8?q?Revert=20"=E7=94=B3=E8=AF=B7=E7=BF=BB?= =?UTF-8?q?=E8=AF=91:=2020200410=20Get=20started=20with=20Bash=20programmi?= =?UTF-8?q?ng.md"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4835064a97994bd2ec46166b1f8bedaaf1cc4838. --- sources/tech/20200410 Get started with Bash programming.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200410 Get started with Bash programming.md b/sources/tech/20200410 Get started with Bash programming.md index cadcef4c71..875adb9876 100644 --- a/sources/tech/20200410 Get started with Bash programming.md +++ b/sources/tech/20200410 Get started with Bash programming.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (mr-ping) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9dcc10f409448c416622e36ceefd8d1a040d5810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Thu, 14 May 2020 08:03:35 +0800 Subject: [PATCH 0710/1809] Translating --- ...odify a disk image to create a Raspberry Pi-based homelab.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200511 Modify a disk image to create a Raspberry Pi-based homelab.md b/sources/tech/20200511 Modify a disk image to create a Raspberry Pi-based homelab.md index fd73137fea..025d3a5f1c 100644 --- a/sources/tech/20200511 Modify a disk image to create a Raspberry Pi-based homelab.md +++ b/sources/tech/20200511 Modify a disk image to create a Raspberry Pi-based homelab.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 160f45ae52f2220b87e3edda9e86e2da398e33e6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 14 May 2020 08:41:14 +0800 Subject: [PATCH 0711/1809] translated --- ...buntu 20.04- Here-s What You Need to do.md | 77 ------------------- ...buntu 20.04- Here-s What You Need to do.md | 77 +++++++++++++++++++ 2 files changed, 77 insertions(+), 77 deletions(-) delete mode 100644 sources/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md create mode 100644 translated/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md diff --git a/sources/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md b/sources/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md deleted file mode 100644 index 3aee14cf14..0000000000 --- a/sources/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Can’t Install Deb File on Ubuntu 20.04? Here’s What You Need to do!) -[#]: via: (https://itsfoss.com/cant-install-deb-file-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Can’t Install Deb File on Ubuntu 20.04? Here’s What You Need to do! -====== - -_**Brief: Double clicking on the deb file doesn’t install it via the software center in Ubuntu 20.04? You are not the only one facing this issue. This tutorial shows how to fix it.**_ - -On the “[things to do after installing Ubuntu 20.04][1]” article, a few readers mentioned that they had trouble [installing software from the Deb file][2]. - -I found that strange because installing a program using the deb file is one of the simplest methods. All you have to do is to double click the downloaded file and it opens (by default) with the Software Center program. You click on install, it asks for your password and within a few seconds/minute, the software is installed. - -I had [upgraded to Ubuntu 20.04 from 19.10][3] and hadn’t faced this issue with it until today. - -I downloaded the .deb file for installing [Rocket Chat messenger][4] and when I double clicked on it to install this software, the file was opened with the archive manager. This is not what I expected. - -![DEB files opened with Archive Manager instead of Software Center][5] - -The “fix” is simple and I am going to show it to you in this quick tutorial. - -### Installing deb files in Ubuntu 20.04 - -For some reasons, the default software to open the deb file has been set to Archive Manager tool in Ubuntu 20.04. The Archive Manager tool is used for [extract zip][6] and other compressed files. - -The solution for this problem is pretty simple. You [change the default application in Ubuntu][7] for opening DEB files from Archive Manager to Software Install. Let me show you the steps. - -**Step 1:** Right click on the downloaded DEB file and select **Properties**: - -![][8] - -**Step 2:** Go to “**Open With**” tab, select “**Software Install**” app and click on “**Set as default**“. - -![][9] - -This way, all the deb files in the future will be opened with Software Install i.e. the software center applications. - -Confirm it by double clicking the DEB file and see if it open with the software center application or not. - -#### Ignorant bug or stupid feature? - -Why is deb files are supposed to be opened with Archive Manager is beyond comprehension. I do hope that this is a bug, not a weird feature like [not allowing drag and drop files on the desktop in Ubuntu 20.04][10]. - -Since we are discussing deb file installation, let me tell you about a nifty tool [gdebi][11]. It’s a lightweight application with the sole purpose of installing DEB file. Not always but some times, it can also handle the dependencies. - -You can learn more about [using gdebi and making it default for installing deb files here][12]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/cant-install-deb-file-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/ -[2]: https://itsfoss.com/install-deb-files-ubuntu/ -[3]: https://itsfoss.com/upgrade-ubuntu-version/ -[4]: https://rocket.chat/ -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/error-opening-deb-file.png?ssl=1 -[6]: https://itsfoss.com/unzip-linux/ -[7]: https://itsfoss.com/change-default-applications-ubuntu/ -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/open-deb-files.png?ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/deb-file-install-fix-ubuntu.png?fit=800%2C454&ssl=1 -[10]: https://itsfoss.com/add-files-on-desktop-ubuntu/ -[11]: https://launchpad.net/gdebi -[12]: https://itsfoss.com/gdebi-default-ubuntu-software-center/ diff --git a/translated/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md b/translated/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md new file mode 100644 index 0000000000..40630a5829 --- /dev/null +++ b/translated/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Can’t Install Deb File on Ubuntu 20.04? Here’s What You Need to do!) +[#]: via: (https://itsfoss.com/cant-install-deb-file-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +无法在 Ubuntu 20.04 上安装 Deb 文件?这是你需要做的! +====== + +_**简介:双击 deb 文件后无法通过 Ubuntu 20.04 的软件中心安装?你不是唯一遇到此问题的人。本教程展示了解决方法**_ + +在“[安装 Ubuntu 20.04 之后要做的事][1]”一文中,一些读者提到他们[用 Deb 文件安装软件][2]遇到了麻烦。 + +我发现这很奇怪,因为使用 deb 文件安装程序是最简单的方法之一。你要做的就是双击下载的文件,它会在软件中心中打开(默认情况下)。单击安装,它要求你输入密码,并在几秒钟/分钟内安装了该软件。 + +我[从 19.10 升级到 Ubuntu 20.04] [3]直到今天都没有遇到这个问题。 + +我下载了 .deb 文件来安装 [Rocket Chat Messenger][4],然后双击该文件安装时,文件用存档管理器打开。这不是我所期望的。 + +![DEB files opened with Archive Manager instead of Software Center][5] + +“修复”很简单,我将在本教程中向你展示。 + +### 在 Ubuntu 20.04 中安装 deb 文件 + +由于某些原因,在 Ubuntu 20.04 中 deb 文件的默认打开程序被设置为存档管理器。存档管理器是用于[解压 zip][6] 和其他压缩文件。 + +解决此问题的方法非常简单。[在 Ubuntu 中更改默认应用][7],将打开 DEB 文件从“存档管理器”改到“软件安装”。让我告诉你步骤。 + +**步骤 1:**右键单击下载的 DEB 文件,然后选择**属性**: + +![][8] + +**步骤 2:**进入“**打开方式**”标签,选择“**软件安装**”,然后点击“**设置为默认**”。 + +![][9] + +这样,以后所有的 deb 文件都将通过“软件安装”即软件中心打开。 + +双击 DEB 文件确认,看看是否在软件中心中打开。 + +#### 忽视的 bug 还是愚蠢的功能? + +为什么会用存档管理器打开 deb 文件让人无法理解。我确实希望这是一个 bug,而不是像[在 Ubuntu 20.04 中不允许在桌面上拖放文件][10]这样的怪异功能。 + +既然我们在讨论 deb 文件的安装,就让我告诉你一个不错的工具 [gdebi][11]。它是一个轻量级应用,其唯一目的是安装 DEB 文件。有时它也可以处理依赖关系。 + +你可以了解更多有关[使用 gdebi 并默认设为安装 deb 文件的工具][12]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/cant-install-deb-file-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/ +[2]: https://itsfoss.com/install-deb-files-ubuntu/ +[3]: https://itsfoss.com/upgrade-ubuntu-version/ +[4]: https://rocket.chat/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/error-opening-deb-file.png?ssl=1 +[6]: https://itsfoss.com/unzip-linux/ +[7]: https://itsfoss.com/change-default-applications-ubuntu/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/open-deb-files.png?ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/deb-file-install-fix-ubuntu.png?fit=800%2C454&ssl=1 +[10]: https://itsfoss.com/add-files-on-desktop-ubuntu/ +[11]: https://launchpad.net/gdebi +[12]: https://itsfoss.com/gdebi-default-ubuntu-software-center/ From 791752c478da8abe89b53d4f27d2239e25f4c866 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 14 May 2020 08:45:49 +0800 Subject: [PATCH 0712/1809] translating --- .../20200504 4 cool new projects to try in COPR for May 2020.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200504 4 cool new projects to try in COPR for May 2020.md b/sources/tech/20200504 4 cool new projects to try in COPR for May 2020.md index d1b4801083..f9db0a9f81 100644 --- a/sources/tech/20200504 4 cool new projects to try in COPR for May 2020.md +++ b/sources/tech/20200504 4 cool new projects to try in COPR for May 2020.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d1a56652f49eea8a2bf7842b4b9ea54e33775a5f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 15 May 2020 03:51:01 +0800 Subject: [PATCH 0713/1809] Revert "request translation" This reverts commit d3f8a3daa4173a8346747cb74b137fcf554b3a53. --- ...8 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md b/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md index b777bbe74e..569981ebea 100644 --- a/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md +++ b/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (bingzxy) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -7,7 +7,6 @@ [#]: via: (https://opensource.com/article/20/4/linux-story) [#]: author: (James Farrell https://opensource.com/users/jamesf) -bingzxy is translating My Linux Story: From 8-bit enthusiast to Unix sysadmin ====== How my early interest in computers got me hooked on a career as a From 22f8d383ad2382b5a94362a1b18c00d954d72902 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 15 May 2020 08:45:02 +0800 Subject: [PATCH 0714/1809] translated --- ...ource PHP framework for web development.md | 85 ------------------- ...ource PHP framework for web development.md | 83 ++++++++++++++++++ 2 files changed, 83 insertions(+), 85 deletions(-) delete mode 100644 sources/tech/20200506 Customizing my open source PHP framework for web development.md create mode 100644 translated/tech/20200506 Customizing my open source PHP framework for web development.md diff --git a/sources/tech/20200506 Customizing my open source PHP framework for web development.md b/sources/tech/20200506 Customizing my open source PHP framework for web development.md deleted file mode 100644 index 241f31754f..0000000000 --- a/sources/tech/20200506 Customizing my open source PHP framework for web development.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Customizing my open source PHP framework for web development) -[#]: via: (https://opensource.com/article/20/5/codeigniter) -[#]: author: (Wee Ben Sen https://opensource.com/users/bswee14) - -Customizing my open source PHP framework for web development -====== -Codeigniter is a PHP framework that empowers companies to develop -high-performance websites with flexibility and ease. -![Business woman on laptop sitting in front of window][1] - -PHP Codeigniter is an open source framework providing business applications with the easy-to-use PHP programming language and powerful tools for coding. It also provides business intelligence, server monitoring, development, and application integration facilities. It's a relatively quiet project that you don't hear much about, but it's got a lot going for it that many developers new to it find surprising and refreshing. - -I use [Codeigniter][2] at my job working for an online tuition service provider in Singapore. We offer services that aren't common enough to be the default feature set for templates or existing back-ends, so I need something that provides good, solid, raw materials I can build upon. Initially, I was considering other platforms such as Wordpress for our website; however, I arrived at Codeigniter due to its flexibility and integration of functions needed in the tuition-matching process. - -Here are the points that sold me on Codeigniter: - - * Database integration with MySQL—A major functionality is allowing clients to browse the tutor database and add tutors like a "shopping cart" similar to an e-commerce platform. - * Client interface system—Users can log in to manage preferences and edit their particulars, modify subject taught, areas traveled, mobile number, address, etc. - * Customized administrator panel—The administrator can access the client's submission with a customized admin panel, which is integrated with a customer service feature so the administrator can follow up individually. - * Payment system—The admin panel comes with an invoice and payments gateway, which is integrated with Paypal. - * CMS editor interface—The administrator is able to edit text and images in the blog and subject pages, as well as add new pages. - - - -The project took around six months to complete and another two months of debugging work. If I'd had to build all of it from scratch or try to rework an existing framework to suit our needs, it would have taken longer, and I probably wouldn't have ended up with what I needed for the demands of our customers. - -### Features and benefits - -There are many more features that draw developers to PHP Codeigniter, including error handling and code formatting, which are useful in every coding situation. It supports templates, which can be used to add functionality to an existing website or to generate new ones. There are many features available for a business that needs to use a web-based system, including the ability to use custom tags. Most can be used by even an average developer who does not have any prior experience in programming. - -The key features of Codeigniter are: - - * XML core services, - * HTTP/FTP core services - * AppData and PHP sandbox features - * XSLT and HTML templates - * Encrypted information transfer - * PCM Codeigniter server monitoring - * Application integration - * File Transfer Protocol (FTP) - * Help desk support - * Apache POI (content management infrastructure used for hosting a website) - - - -#### Compatibility - -Codeigniter is compatible with many leading software applications like PHP, MySQL, [MariaDB][3], [phpMyAdmin][4], [Apache][5], OpenBSD, XSLT, [SQLite][6], and more. A number of companies prefer to use Codeigniter products for their website requirements because they are easy to work with and integrate. If you're not comfortable creating your own website, you can find many developers and design agencies that provide custom web development services. - -#### Security - -Codeigniter also provides data security through SSL encryption. The encryption protects the data from external threats such as intruders and firewalls. The data storage facility also allows for security audits of the company's website. - -#### Other features - -A good PHP web development company uses several advanced and third-party technologies such as XML and PHP. It provides organizations with a complete platform to develop professional-looking, useful websites with a business application. Codeigniter makes it easy to use third party technology, and works with common web development software. This allows web agencies to easily create websites with their chosen modules. Most PHP developers offer support and training services for individuals, as well. - -### Using PHP framework Codeigniter - -Codeigniter allows businesses to have a complete package for PHP development that will offer the right combination of power, flexibility, and performance. So far, I am very pleased with our website and I have continuously upgraded and added new features along the way. I look forward to discovering what else I can do with our website using Codeigniter. Could it be right for you too? - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/5/codeigniter - -作者:[Wee Ben Sen][a] -选题:[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/bswee14 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) -[2]: https://codeigniter.com/ -[3]: http://mariadb.org/ -[4]: https://www.phpmyadmin.net/ -[5]: http://apache.org/ -[6]: http://sqlite.org/ diff --git a/translated/tech/20200506 Customizing my open source PHP framework for web development.md b/translated/tech/20200506 Customizing my open source PHP framework for web development.md new file mode 100644 index 0000000000..59573c643d --- /dev/null +++ b/translated/tech/20200506 Customizing my open source PHP framework for web development.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Customizing my open source PHP framework for web development) +[#]: via: (https://opensource.com/article/20/5/codeigniter) +[#]: author: (Wee Ben Sen https://opensource.com/users/bswee14) + +自定义用于 Web 开发的开源 PHP 框架 +====== +Codeigniter 是一个 PHP 框架,可以使公司进行开发具有灵活性和便捷性的高性能网站。 +![Business woman on laptop sitting in front of window][1] + +PHP Codeigniter 是一个开源框架,为商业应用提供易于使用的 PHP 编程语言和强大的编码工具。它还提供商务智能、服务器监视、开发和应用集成功能。这是一个相对安静的项目,你很少听到它,但它功能强大,许多刚接触的开发人员都对此感到惊讶和耳目一新。 + +我在新加坡的一家在线学习服务提供商处使用 [Codeigniter][2]。我们提供的服务不够普遍,无法成为模板或现有后端的默认功能集,因此我需要提供可以依靠的良好,坚实,原始的东西。最初,我考虑用其他平台(如 Wordpress)用于我们的网站。但是,我决定使用 Codeigniter,因为它的灵活性,以及在学费匹配过程中需要的整合功能。 + +以下是让我使用 Codeigniter 的原因: + + * 与 MySQL 的数据库集成—一种主要功能是允许客户端浏览导师数据库并添加导师,例如类似于电子商务平台的“购物车”。 +  * 客户端界面系统—用户可以登录管理首选项并编辑详细信息,修改所教的科目、地区、手机号码、地址等。 +  * 定制的管理员面板—管理员可以使用定制的管理面板访问客户提交的内容,它与客户服务功能集成在一起,因此管理员可以单独跟进。 +  * 付款系统—管理面板带有与 Paypal 集成的发票和付款网关。 +  * CMS 编辑器界面—管理员能够编辑博客和文章中的文本和图像,以及添加新页面。 + + +该项目花费了大约六个月的时间来完成,另外花了两个月的调试时间。如果我需要从头开始构建所有,或者尝试重新设计现有的框架以满足我们的需求,那将花费更长的时间,而且可能最终无法满足客户需求。 + +### 功能和优点 + +还有许多吸引开发人员使用 PHP Codeigniter 的功能,包括错误处理和代码格式化,这些功能在每种编码情景下都非常有用。它支持模板,可用于向现有网站添加功能或生成新网站。有许多基于 web 系统商业需要的功能,包括使用自定义标签。即使没有编程经验的普通开发人员也可以使用大多数工具。 + +Codeigniter 的主要功能是: + + * XML 核心服务, +  * HTTP/FTP 核心服务 +  * AppData 和 PHP 沙箱功能 +  * XSLT 和 HTML 模板 +  * 加密的信息传输 +  * PCM Codeigniter 服务器监控 +  * 应用集成 +  * 文件传输协议(FTP) +  * 服务台支持 +  * Apache POI(用于托管网站的内容管理基础架构) + + + +#### 兼容性 + +Codeigniter 与许多领先的软件程序兼容,例如 PHP、MySQL、[MariaDB][3]、[phpMyAdmin][4]、[Apache][5]、OpenBSD、XSLT、[SQLite][6] 等。许多公司更喜欢使用 Codeigniter 产品来满足网站要求,因为它们易于使用和集成。如果你不想创建自己的网站,你可以找到许多提供自定义 Web 开发服务的开发人员和设计机构。 + +#### 安全 + +Codeigniter 还通过 SSL 加密提供数据安全性。加密可以保护数据免受入侵者和防火墙等外部威胁的侵害。数据存储功能还允许对公司网站进行安全审核。 + +#### 其它功能 + +一家优秀的 PHP Web 开发公司使用几种高级和第三方技术,例如 XML 和 PHP。它提供组织一个完整的平台来开发具有专业外观、有用的商业网站。Codeigniter 让使用第三方技术变得容易,并可以与常见的 Web 开发软件一起使用。这使得 web 公司可以轻松地使用所选模块创建网站。大多数 PHP 开发者也为个人提供支持和培训服务。 + +### 使用 PHP 框架 Codeigniter + +Codeigniter 给企业提供完整的 PHP 开发包,它将提供功能,灵活性和性能的正确组合。到目前为止,我很满意我们的网站,一直以来,我不断升级和添加新的功能。我期待用 Codeigniter 对我们的网站做些其他什么。你也是这样么? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/codeigniter + +作者:[Wee Ben Sen][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bswee14 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) +[2]: https://codeigniter.com/ +[3]: http://mariadb.org/ +[4]: https://www.phpmyadmin.net/ +[5]: http://apache.org/ +[6]: http://sqlite.org/ From 836a09433ab2ba234605bcc7eceab32231f28a54 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 15 May 2020 08:50:00 +0800 Subject: [PATCH 0715/1809] translating --- ... to use pyenv to run multiple versions of Python on a Mac.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md b/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md index 4d15072b90..34a7802f28 100644 --- a/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md +++ b/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9e9d2098d8418d1979bd41625f4fc690d07e042e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 15 May 2020 10:53:22 +0800 Subject: [PATCH 0716/1809] PRF @lxbwolf --- ... Operating Systems for Various Purposes.md | 229 +++++++++++------- 1 file changed, 143 insertions(+), 86 deletions(-) diff --git a/translated/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md b/translated/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md index f5fcff875b..b52d656850 100644 --- a/translated/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md +++ b/translated/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md @@ -1,232 +1,278 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Best Raspberry Pi Operating Systems for Various Purposes) [#]: via: (https://itsfoss.com/raspberry-pi-os/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -不同需求下各自最适合的树莓派操作系统 +用于各种用途的最佳树莓派操作系统 ====== -[树莓派][1] 是一种具有很多功能且使用便捷的不可或缺的卡片式计算机。不相信?那就[浏览下这个树莓派项目列表][2],来领会下这个小设备能做什么。 +![](https://img.linux.net.cn/data/attachment/album/202005/15/105040b17d6v7gdmj63k3k.jpg) -考虑到树莓派用途这么多,为它选择一个合适的操作系统就极其重要。当然,你可以用 Linux 做很多事,但是一个为某个目的特意配置的操作系统可以节省你大量的时间和精力。 +[树莓派][1] 是一款不可缺少的单板电脑,在很多工作中都能派上用场。不相信?只要[看看这个树莓派项目列表][2],就能了解这个小小的设备能做什么。 -因此,本文中我要介绍一些专门为树莓派量身定制的流行和有用的操作系统。 +考虑到树莓派用途这么多,为它选择一个合适的操作系统就极其重要。当然,你可以用 Linux 做很多事,但专门为特定目的配置的操作系统可以为你节省大量的时间和精力。 + +因此,本文中我要介绍一些专门为树莓派量身定制的流行且实用的操作系统。 ### 由于有树莓派镜像工具,安装任何操作系统到树莓派上都很容易 -[把树莓派操作系统安装到 SD 卡上][3] 比以前容易得多。你可以很容易地下载[树莓派镜像][4]和很快地安装树莓派操作系统。看一下官方视频,你就知道有多简单。 +[在 SD 卡上安装树莓派操作系统][3]比以前容易得多。你只需下载[树莓派镜像][4]就可以快速地安装任何树莓派操作系统。请看下面的官方视频,你就知道有多简单。 -你也可以使用 [NOOBS][5](New Out Of the Box Software)来很容易地安装不同的操作系统到树莓派上。你还可以从 [NOOBS官方下载页面][5] 提及的他们支持的零售商那里获取预先安装好系统的 SD 卡。 +- [HOW TO INSTALL RASPBIAN OS to your Raspberry Pi with ease - Raspberry Pi Imager](https://youtu.be/J024soVgEeM) -尽情去他们的[官方文档][6]里找更多关于安装操作系统的信息吧。 +你也可以使用 [NOOBS][5](新开箱即用软件New Out Of the Box Software)在树莓派上轻松安装各种的操作系统。你还可以从他们的 [NOOBS 官方下载页面][5]提到的支持的零售商列表中获得预装 SD 卡。 -[下载树莓派操作系统][4] +欢迎在他们的[官方文档][6]中了解更多关于安装操作系统的信息。 -现在你知道了怎么安装它(以及从哪儿获取),让我来重点介绍下几个有用的树莓派操作系统来帮助你。 +- [下载树莓派操作系统][4] -### 适用于树莓派的不同操作系统 +现在你知道了怎么安装它(以及从哪儿获取),让我来重点介绍几个有用的树莓派操作系统,希望对你有所帮助。 -请注意,我花了一些精力来筛选出那些被积极维护的树莓派操作系统项目。如果某个项目在不久的将来会停止维护,请在评论区告诉我,我会更新本文。 +### 适用于树莓派的各种操作系统 -另一件事是,我关注到现在最新的版本是 Raspberry 4,但是下面的列表不应被认为是适 Raspberry 4 的操作系统列表。这些系统应该能用于树莓派 3、3B+ 和其他各种版本,但是请参照项目的官方网站核对详细信息。 +请注意,我花了一些精力筛选出了那些被积极维护的树莓派操作系统项目。如果某个项目在不久的将来会停止维护,请在评论区告诉我,我会更新本文。 + +另一件事是,我关注到现在最新的版本是树莓派 4,但是下面的列表不应被认为是树莓派 4 的操作系统列表,这些系统应该也能用于树莓派 3、3B+ 和其他变种,但是请参照项目的官方网站了解详细信息。 **注意:** 排名不分先后。 -#### 1\. Raspbian OS:官方的树莓派操作系统 +#### 1、Raspbian OS:官方的树莓派操作系统 ![][7] -Raspbian 是官方支持的树莓派板操作系统。它集成了很多工具,用于教育、编程以及其他广泛的用途。特别地,它包含 Python、Scratch、Sonic Pi、Java和一些其他的很重要的包。 +Raspbian OS 是官方支持的树莓派板卡操作系统。它集成了很多工具,用于教育、编程以及其他广泛的用途。具体来说,它包含了 Python、Scratch、Sonic Pi、Java 和其他一些重要的包。 -最初,Raspbian 是基于 Debian 的,系统中预安装了很多有用的包。因此,当你安装 Raspbian 后,你可能就不需要特意安装基本工具了 — 你会发现大部分工具已经提前安装好了。 +最初,Raspbian OS 是基于 Debian 的,并预装了大量有用的包。因此,当你安装 Raspbian OS 后,你可能就不需要特意安装基本工具了 — 你会发现大部分工具已经提前安装好了。 Raspbian OS 是被积极地维护着的,它也是最流行的树莓派操作系统之一。你可以使用 [NOOBS][5] 或参照[官方文档][6]来安装它。 -[Raspbian OS][8] +- [Raspbian OS][8] -#### 2\. Ubuntu MATE:适合通用计算需求 +#### 2、Ubuntu MATE:适合通用计算需求 ![][9] -虽然 Raspbian 是官方支持的操作系统,但是对于最新和最好的包它往往不能及时支持。因此,如果你想更新得更快并且在将来想用最新的包,你可以试试树莓派版本的 Ubuntu MATE。 +尽管 Raspbian 是官方支持的操作系统,但它的特点不是最新、最大的软件包。因此,如果你想更快的更新,想用最新的包,你可以试试 Ubuntu MATE 的树莓派版本。 -树莓派定制版的 Ubuntu MATE 是很适合安装的不可思议的轻量级发行版本。它还被广泛用于 [NVIDIA 的 Jetson Nano][10]。换言之,你可以在树莓派的很多场景下使用它。 +Ubuntu MATE 的树莓派定制版是值得安装的非常不错的轻量级发行版。它还被广泛用于 [NVIDIA 的 Jetson Nano][10]。换言之,你可以在树莓派的很多场景下使用它。 为了更好地帮助你,我们还有一份详细的教程:[怎样在树莓派上安装 Ubuntu MATE][11]。 -[Ubuntu MATE for Raspberry Pi][12] +- [Ubuntu MATE for Raspberry Pi][12] -#### 3\. Ubuntu Server:把树莓派作为一台 Linux 服务器来使用 +#### 3、Ubuntu Server:把树莓派作为一台 Linux 服务器来使用 ![][13] -如果你计划把你的树莓派当作你项目的服务器来使用,那么安装 Ubuntu Server 会是一个不错的选择。 +如果你计划把你的树莓派当作项目的某个服务器来使用,那么安装 Ubuntu Server 会是一个不错的选择。 -Ubuntu Server 有 32 位和 64 位的镜像。你可以根据你的板的类型(是否支持 64 位)来选择对应的操作系统。 +Ubuntu Server 有 32 位和 64 位的镜像。你可以根据你的板卡类型(是否支持 64 位)来选择对应的操作系统。 然而,值得注意的一点是 Ubuntu Server 不是为桌面用户定制的。因此,你需要留意 Ubuntu Server 默认不会安装图形用户界面。 -[Ubuntu Server][14] +- [Ubuntu Server][14] -#### 4\. LibreELEC:适合做媒体服务器 +#### 4、LibreELEC:适合做媒体服务器 ![][15] 我们已经有一个 [Linux 下可用的媒体服务器软件][16],LibreELEC 在列表中。 -它是一个伟大的轻量级操作系统,让你可以在树莓派上安装 [KODI][17]。你可以尝试使用 Raspberry Pi Imager 来安装它。 +它是一个很棒的轻量级操作系统,让你可以在树莓派上安装 [KODI][17]。你可以尝试使用树莓派镜像工具来安装它。 -你可以很容易地找到他们的[官方下载页面][18],并找到适合你板子的安装镜像。 +你可以很容易地找到他们的[官方下载页面][18],并找到适合你板卡的安装镜像。 -[LibreELEC][19] +- [LibreELEC][19] -#### 5\. OSMC:适合做媒体服务器 +#### 5、OSMC:适合做媒体服务器 ![][20] OSMC 是另一个 Linux 下[流行的媒体服务器软件][16]。如果要把树莓派板作为媒体中心设备,那么 OSMC 是你可以向他人推荐的操作系统之一。 -类似 LibreELEC,OSMC 也运行 KODI 来帮助你管理你的媒体文件和享受你已有的素材中。 +类似 LibreELEC,OSMC 也运行 KODI,可以帮助你管理你的媒体文件和欣赏你已有的素材。 -OSMC 官方没有提及对 **Raspberry Pi 4** 的支持。因此,如果你的树莓派是 Raspberry Pi 3 或更早的版本,那么应该没有问题。 +OSMC 没有正式提及对树莓派 4 的支持。因此,如果你的树莓派是树莓派 3 或更早的版本,那么应该没有问题。 -[OSMC][21] +- [OSMC][21] -#### 6\. RISC OS:传统的 ARM 操作系统 +#### 6、RISC OS:最初的 ARM 操作系统 ![][22] -ARM 设备的原始草稿版,RISC 已经存在了差不多 30 年了。 +RISC OS 最初是为 ARM 设备打造的,至今已有近 30 年左右的历史。 -如果你想了解,我们也有篇详细介绍 [RISC OS][23] 的文章。简而言之,RISC OS 也是为诸如树莓派的现代基于 ARM 的卡片式计算机定制的。它的用于界面很简单,更专注于性能。 +如果你想了解,我们也有篇详细介绍 [RISC OS][23] 的文章。简而言之,RISC OS 也是为诸如树莓派的现代基于 ARM 的单板计算机定制的。它的用户界面很简单,更专注于性能。 -同样的,这个系统也不支持 Raspberry Pi 4。因此,如果你的树莓派是 Raspberry Pi 3 或更早的版本,你可以试一下。 +同样的,这并不是为树莓派 4 量身定做的。因此,如果你的树莓派是 3 或更早的版本,你可以试一下。 -[RISC OS][24] +- [RISC OS][24] -#### 7\. Mozilla WebThings Gateway:适合 IoT 项目 +#### 7、Mozilla WebThings Gateway:适合 IoT 项目 ![][25] -作为 Mozilla 的 [IoT 设备的开源实现][26] 的一部分,WebThings Gateway 让你可以监控和控制连接的 IoT 设备。 +作为 Mozilla 的 [IoT 设备的开源实现][26]的一部分,WebThings Gateway 让你可以监控和控制所有连接的 IoT 设备。 你可以参考[官方文档][27]来检查所需的环境,遵照指导把安装到树莓派上。它确实是适合 IoT 应用的最有用的树莓派操作系统之一。 -[WebThings Gateway][28] +- [WebThings Gateway][28] -#### 8\. Ubuntu Core:适合 IoT 项目 +#### 8、Ubuntu Core:适合 IoT 项目 -另一个适合 [IoT][29] 应用的树莓派操作系统,或者仅仅用来测试一下 — Ubuntu Core。 +Ubuntu Core 是又一个树莓派操作系统,适用于潜在的 [IoT][29] 应用,或者只是测试一下 Snap。 -Ubuntu Core 是为 IoT 设备或特定的树莓派特意定制。我不会刻意主张大家使用它 — 但是 Ubuntu Core 是适合树莓派板的安全的操作系统。你可以自己尝试一下! +Ubuntu Core 是专门为 IoT 设备或者具体来说是树莓派定制的。我不会刻意宣传它 —— 但是 Ubuntu Core 是一款适合树莓派板卡的安全操作系统。你可以自己尝试一下! -[Ubuntu Core][30] +- [Ubuntu Core][30] -#### 9\. DietPi:轻量级树莓派操作系统 +#### 9、DietPi:轻量级树莓派操作系统 -![DietPi Screenshot via Distrowatch][31] +![][31] DietPi 是一款轻量级的 [Debian][32] 操作系统,它还宣称比 “Raspbian Lite” 操作系统更轻量。 -考虑到它是一款轻量级的树莓派操作系统,它在很多使用场景下以很便捷的方式提供了大量的功能。从简单的软件安装包到备份解决方案,还有很多功能等待发掘。 +虽然它被视作一款轻量级的树莓派操作系统,但它提供了很多功能,可以在多个使用场景中派上用场。从简单的软件安装包到备份解决方案,还有很多功能值得探索。 如果你想安装一个低内存占用而性能相对更好的操作系统,你可以尝试一下 DietPi。 -[DietPi][33] +- [DietPi][33] -#### 10\. Lakka Linux:打造复古的游戏控制台 +#### 10、Lakka Linux:打造复古的游戏主机 ![][34] -想让你的树莓派变成一个复古的游戏控制台? +想让你的树莓派变成一个复古的游戏主机? -Lakka Linux 发行版本最初是在 RetroArch 模拟器中构建的。因此,你可以立刻在树莓派上获得所有的复古游戏。 +Lakka Linux 发行版本最初是建立在 RetroArch 模拟器上的。因此,你可以立刻在树莓派上获得所有的复古游戏。 如果你想了解,我们也有一篇介绍 [Lakka Linux][35] 的文章。或者直接上手吧! -[Lakka][36] +- [Lakka][36] -#### 11\. RetroPie:适合复古游戏 +#### 11、RetroPie:适合复古游戏 -![ ][37] +![][37] -RetroPie 是另一款可以让树莓派变成复古游戏控制台的树莓派操作系统。它提供了很多配置工具,因此你可以自定义主题,或者调整模拟器来找到最好的复古游戏。 +RetroPie 是另一款可以让树莓派变成复古游戏主机的树莓派操作系统。它提供了几个配置工具,让你可以自定义主题,或者调整模拟器即可拥有最好的复古游戏。 值得注意的是它不包含任何有版权的游戏。你可以试一下,看看它是怎么工作的! -[RetroPie][38] +- [RetroPie][38] -#### 12\. Kali Linux:适合低成本入侵 +#### 12、Kali Linux:适合低成本渗透 ![][39] -想要在你的树莓派上尝试和学习一些渗透测试技巧?Kali Linux 会是最佳选择。是的,Kali Linux 通常会支持最新的树莓派。 +想要在你的树莓派上尝试和学习一些道德黑客技巧吗?[Kali Linux][64] 会是最佳选择。是的,Kali Linux 通常在最新的树莓派一发布就会支持它。 Kali Linux 不仅适合树莓派,它也支持很多其他设备。尝试一下,玩得愉快! -[Kali Linux][40] +- [Kali Linux][40] -#### 13\. OpenMediaVault:适合网络附加存储Network Attached Storage +#### 13、OpenMediaVault:适合网络附加存储(NAS) ![][41] -如果你想在最小的硬件上搭建 [NAS][42] 解决方案,树莓派可以帮助你。 +如果你想在极简的硬件上搭建 [NAS][42] 解决方案,树莓派可以帮助你。 -OpenMediaVault 最初是基于 Debian Linux 的,提供了大量功能,如基于 web 的管理员能力、插件支持,等等。它支持大多数树莓派模块,因此你可以尝试下载并安装它! +OpenMediaVault 最初是基于 Debian Linux 的,提供了大量功能,如基于 Web 的管理能力、插件支持,等等。它支持大多数树莓派型号,因此你可以尝试下载并安装它! -[OpenMediaVault][43] +- [OpenMediaVault][43] -#### 14\. ROKOS:适合加密挖矿 +#### 14、ROKOS:适合加密挖矿 ![][44] 如果你对加密货币和比特币很感兴趣,那么 ROKOS 会吸引你。 -ROKOS 是基于 Debian 的操作系统,预安装的驱动和包基本可以让你的树莓派变成一个节点。当然,在安装之前你需要了解它是怎么工作的。因此,如果你对此不太了解,我建议你先调研下。 +ROKOS 是基于 Debian 的操作系统,基本上可以让你把你的树莓派变成一个节点,同时预装了相应的驱动程序和软件包。当然,在安装之前你需要了解它是怎么工作的。因此,如果你对此不太了解,我建议你先调研下。 -[ROKOS][45] +- [ROKOS][45] -#### 15\. Alpine Linux:专注于安全的轻量级 Linux +#### 15、Alpine Linux:专注于安全的轻量级 Linux 当今年代,很多用户都在寻找专注于安全和[隐私的发行版本][46]。如果你也是其中一员,你可以试试在树莓派上安装 Alpine Linux。 -如果你是个树莓派新手,它可能不像你想象的那样对用户友好(或对新手友好)。但是,如果你想尝试一些不一样的东西,那么你可以试试 Alpine Linux 这个专注于安全的 Linux 发行版本。 +如果你是个树莓派新手,它可能不像你想象的那样对用户友好(或者说对初学者来说容易上手)。但是,如果你想尝试一些不一样的东西,那么你可以试试 Alpine Linux 这个专注于安全的 Linux 发行版本。 -[Alpine Linux][47] +- [Alpine Linux][47] -#### 16\. Kano OS:适合儿童教育的操作系统 +#### 16、Kano OS:适合儿童教育的操作系统 ![][48] 如果你在寻找一款能让学习变得有趣还能教育儿童的树莓派操作系统,那么 Kano OS 是个不错的选择。 -它是被积极地维护着的,Kano 操作系统上的桌面对于儿童玩和学习的用户体验都是很简单的。 +它正在积极维护中,而且 Kano OS 上的桌面集成的用户体验相当简单,玩起来也很有趣,可以让孩子们从中学习。 -[Kano OS][49] +- [Kano OS][49] -#### 17\. KDE Plasma Bigscreen:适合把普通 TV 转换为智能 TV +#### 17、KDE Plasma Bigscreen:把普通电视转换为智能电视 ![][50] -这是 KDE 的子开发项目。在树莓派上安装 [KDE Plasma Bigscreen OS][51] 后,你可以把普通 TV 变成智能 TV。 +这是 KDE 一个正在开发中的项目。在树莓派上安装 [KDE “等离子大屏”][51] 后,你可以把普通电视变成智能电视。 -你不需要特殊的远程服务器来控制 TV。你可以使用普通的远程控制。 +你不需要特殊的遥控器来控制电视,你可以使用普通的遥控器。 -Plasma Bigscreen 也集成了 [MyCroft open source AI][52] 作为声控。 +“等离子大屏”也集成了 [MyCroft 开源 AI][52] 作为声控。 -这个项目还在内测阶段,所以如果你想尝试,可能会有一些 bug 和问题。 +这个项目还在测试阶段,所以如果你想尝试,可能会有一些错误和问题。 -[Plasma Bigscreen][53] +- [Plasma Bigscreen][53] -#### 结语 +#### 18、Manjaro Linux:为你提供多功能的桌面体验 -我知道还有很多为树莓派定制的操作系统 — 但是我尽力列出了被积极维护的最流行的或最有用的操作系统。 +![][54] -如果你觉得我遗漏了最合适的树莓派操作系统,尽情在下面的评论去告诉我吧! +如果你想在树莓派上寻找一个基于 Arch 的 Linux 发行版,那么 Manjaro Linux 应该是一个很好的补充,它可以做很多事情,适合一般的计算任务。 + +Manjaro Linux ARM 版也支持最新的树莓派 4。它为你的树莓派或任何[树莓派替代品][55]提供了 XFCE 和 KDE Plasma 变体。 + +此外,它似乎还提供了树莓派设备上最快/最好的体验之一。如果你还没试过,那就试试吧! + +- [Manjaro ARM][56] + +#### 19、Volumio:作为一个开源音乐播放器使用 + +![][57] + +想做一个廉价的音乐发烧友系统?Volumio 应该可以帮到你。 + +它是一个自由而开源的操作系统([GitHub][58]),还支持集成多个设备的能力。你可以通过一个简单的 Web 控制界面,对所有连接的设备进行管理。除了免费版之外,它还提供了一个高级版,可以让你获得独家功能。 + +它也确实支持最新的树莓派 4。所以,如果你对调整已有的家庭立体声系统有一定的兴趣,想要获得最佳的音质,不妨试试这个。 + +- [Volumio][59] + +#### 20、FreeBSD + +不想使用 Linux 发行版?不用担心,你也可以用 FreeBSD 在树莓派上安装一个类 UNIX 操作系统。 + +如果你不知道的话,我们有一篇关于 [FreeBSD 项目][60]的详细文章。 + +一旦你按照他们的[官方说明][61]安装好之后,你可以利用它来进行任何 DIY 实验,或者只是把它作为一个轻量级的桌面系统来完成特定的任务。 + +- [FreeBSD][62] + +#### 21、NetBSD + +NetBSD 是另一个令人印象深刻的类 UNIX 操作系统,你可以在树莓派上安装。它的目标是成为一个跨多个系统的便携式操作系统。 + +如果你在其他系统中使用过它,你可能已经知道它的好处了。然而,它不仅仅是一个轻量级的便携式操作系统,它的特点是拥有一套有用的功能,可以完成各种任务。 + +- [NetBSD][63] + +### 结语 + +我相信还有很多为树莓派定制的操作系统 — 但是我尽力列出了被积极维护的最流行的或最有用的操作系统。 + +如果你觉得我遗漏了最合适树莓派的操作系统,尽情在下面的评论去告诉我吧! -------------------------------------------------------------------------------- @@ -235,7 +281,7 @@ via: https://itsfoss.com/raspberry-pi-os/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -243,7 +289,7 @@ via: https://itsfoss.com/raspberry-pi-os/ [b]: https://github.com/lujun9972 [1]: https://www.raspberrypi.org/ [2]: https://itsfoss.com/raspberry-pi-projects/ -[3]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[3]: https://linux.cn/article-12136-1.html [4]: https://www.raspberrypi.org/downloads/ [5]: https://www.raspberrypi.org/downloads/noobs/ [6]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md @@ -251,7 +297,7 @@ via: https://itsfoss.com/raspberry-pi-os/ [8]: https://www.raspbian.org/ [9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Desktop-ubuntu.jpg?resize=800%2C600&ssl=1 [10]: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-nano/ -[11]: https://itsfoss.com/ubuntu-mate-raspberry-pi/ +[11]: https://linux.cn/article-10817-1.html [12]: https://ubuntu-mate.org/raspberry-pi/ [13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/ubunt-server.png?ssl=1 [14]: https://ubuntu.com/download/raspberry-pi @@ -275,7 +321,7 @@ via: https://itsfoss.com/raspberry-pi-os/ [32]: https://www.debian.org/ [33]: https://dietpi.com/ [34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/08/lakkaos.jpg?resize=1024%2C640&ssl=1 -[35]: https://itsfoss.com/lakka-retrogaming-linux/ +[35]: https://linux.cn/article-10158-1.html [36]: http://www.lakka.tv/ [37]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/retro-pie.png?ssl=1 [38]: https://retropie.org.uk/ @@ -294,3 +340,14 @@ via: https://itsfoss.com/raspberry-pi-os/ [51]: https://itsfoss.com/kde-plasma-bigscreen/ [52]: https://itsfoss.com/mycroft-mark-2/ [53]: https://plasma-bigscreen.org/#download-jumpto +[54]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/manjaro-arm.jpg?w=800&ssl=1 +[55]: https://linux.cn/article-10823-1.html +[56]: https://manjaro.org/download/#raspberry-pi-4 +[57]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/volumio.jpg?w=800&ssl=1 +[58]: https://github.com/volumio +[59]: https://volumio.org/ +[60]: https://itsfoss.com/freebsd-interview-deb-goodkin/ +[61]: https://www.freebsdfoundation.org/freebsd/how-to-guides/installing-freebsd-for-raspberry-pi/ +[62]: https://www.freebsd.org/ +[63]: https://www.netbsd.org/ +[64]: https://linux.cn/article-10690-1.html From 705953932104d1946cb90ce7326b476b153ad818 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 15 May 2020 10:56:55 +0800 Subject: [PATCH 0717/1809] PUB @lxbwolf https://linux.cn/article-12219-1.html --- ...est Raspberry Pi Operating Systems for Various Purposes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md (99%) diff --git a/translated/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md b/published/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md similarity index 99% rename from translated/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md rename to published/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md index b52d656850..25ebd65fcd 100644 --- a/translated/tech/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md +++ b/published/20200404 Best Raspberry Pi Operating Systems for Various Purposes.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12219-1.html) [#]: subject: (Best Raspberry Pi Operating Systems for Various Purposes) [#]: via: (https://itsfoss.com/raspberry-pi-os/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From a8a6cac14a768e215324407f10783791fffa8cc9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 15 May 2020 11:22:31 +0800 Subject: [PATCH 0718/1809] PRF @geekpi --- ...buntu 20.04- Here-s What You Need to do.md | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/translated/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md b/translated/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md index 40630a5829..e5accd88eb 100644 --- a/translated/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md +++ b/translated/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Can’t Install Deb File on Ubuntu 20.04? Here’s What You Need to do!) @@ -10,13 +10,15 @@ 无法在 Ubuntu 20.04 上安装 Deb 文件?这是你需要做的! ====== -_**简介:双击 deb 文件后无法通过 Ubuntu 20.04 的软件中心安装?你不是唯一遇到此问题的人。本教程展示了解决方法**_ +> 双击 deb 文件后无法通过 Ubuntu 20.04 的软件中心安装?你不是唯一遇到此问题的人。本教程展示了解决方法。 + +![](https://img.linux.net.cn/data/attachment/album/202005/15/112149cfdyg556upv6vd66.jpg) 在“[安装 Ubuntu 20.04 之后要做的事][1]”一文中,一些读者提到他们[用 Deb 文件安装软件][2]遇到了麻烦。 我发现这很奇怪,因为使用 deb 文件安装程序是最简单的方法之一。你要做的就是双击下载的文件,它会在软件中心中打开(默认情况下)。单击安装,它要求你输入密码,并在几秒钟/分钟内安装了该软件。 -我[从 19.10 升级到 Ubuntu 20.04] [3]直到今天都没有遇到这个问题。 +我[从 19.10 升级到 Ubuntu 20.04][3]直到今天都没有遇到这个问题。 我下载了 .deb 文件来安装 [Rocket Chat Messenger][4],然后双击该文件安装时,文件用存档管理器打开。这不是我所期望的。 @@ -30,7 +32,7 @@ _**简介:双击 deb 文件后无法通过 Ubuntu 20.04 的软件中心安装 解决此问题的方法非常简单。[在 Ubuntu 中更改默认应用][7],将打开 DEB 文件从“存档管理器”改到“软件安装”。让我告诉你步骤。 -**步骤 1:**右键单击下载的 DEB 文件,然后选择**属性**: +**步骤 1:**右键单击下载的 .deb 文件,然后选择**属性**: ![][8] @@ -38,11 +40,11 @@ _**简介:双击 deb 文件后无法通过 Ubuntu 20.04 的软件中心安装 ![][9] -这样,以后所有的 deb 文件都将通过“软件安装”即软件中心打开。 +这样,以后所有的 .deb 文件都将通过“软件安装”即软件中心打开。 -双击 DEB 文件确认,看看是否在软件中心中打开。 +双击 .deb 文件确认,看看是否在软件中心中打开。 -#### 忽视的 bug 还是愚蠢的功能? +### 忽视的 bug 还是愚蠢的功能? 为什么会用存档管理器打开 deb 文件让人无法理解。我确实希望这是一个 bug,而不是像[在 Ubuntu 20.04 中不允许在桌面上拖放文件][10]这样的怪异功能。 @@ -57,13 +59,13 @@ via: https://itsfoss.com/cant-install-deb-file-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://itsfoss.com/author/abhishek/ [b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/ +[1]: https://linux.cn/article-12183-1.html [2]: https://itsfoss.com/install-deb-files-ubuntu/ [3]: https://itsfoss.com/upgrade-ubuntu-version/ [4]: https://rocket.chat/ From a0120f08376399cc2402e52faafb351b0c2b71e4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 15 May 2020 11:23:07 +0800 Subject: [PATCH 0719/1809] PUB @geekpi https://linux.cn/article-12220-1.html --- ...ll Deb File on Ubuntu 20.04- Here-s What You Need to do.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md (98%) diff --git a/translated/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md b/published/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md similarity index 98% rename from translated/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md rename to published/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md index e5accd88eb..bc6bc1aec8 100644 --- a/translated/tech/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md +++ b/published/20200511 Can-t Install Deb File on Ubuntu 20.04- Here-s What You Need to do.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12220-1.html) [#]: subject: (Can’t Install Deb File on Ubuntu 20.04? Here’s What You Need to do!) [#]: via: (https://itsfoss.com/cant-install-deb-file-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From b85efc1a50298b1395a1a76840c9390f2fdefcda Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 16 May 2020 11:37:10 +0800 Subject: [PATCH 0720/1809] PRF @geekpi --- ...fce With KDE Plasma Desktop Environment.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/translated/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md b/translated/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md index 1b9d4bb57a..9084834ad7 100644 --- a/translated/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md +++ b/translated/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment) @@ -10,7 +10,7 @@ Ubuntu Studio 将用 KDE Plasma 桌面环境替换 Xfce ====== -[Ubuntu Studio][1] 是一个流行的 [Ubuntu 官方变种][2],它是为从事音频制作、视频、图形、摄影和书籍出版的创意内容创建者量身定制的。它提供了许多拥有良好体验的开箱即用的多媒体内容创建应用。 +[Ubuntu Studio][1] 是一个流行的 [Ubuntu 官方变种][2],它是为从事音频制作、视频、图形、摄影和书籍出版的创意内容创建者量身定制的。它提供了许多多媒体内容创建应用,开箱即用,体验极佳。 在最近的 20.04 LTS 版本发布之后,Ubuntu Studio 团队在其[官方公告][3]中强调了一些非常重要的内容。而且,也许不是每个人都注意到关键信息,即 Ubuntu Studio 的未来。 @@ -20,31 +20,31 @@ Ubuntu Studio 20.04 将是带有 [Xfce 桌面环境][4]的最后一个版本。 ![][6] -据他们的澄清,Ubuntu Studio 并不致力于任何特定的外观,而是致力于提供最佳的用户体验。同时,KDE 被证明是一个更好的选择。 +据他们的澄清,Ubuntu Studio 并不专注于任何特定的外观/感受,而是旨在提供最佳的用户体验。同时,KDE 被证明是一个更好的选择。 -> Plasma 已被证明为图形艺术家和摄影师提供了更好的工具,例如在 Gwenview、Krita 甚至文件管理器 Dolphin 中都可以看到。此外,它对 Wacom 平板的支持比其他任何桌面环境都更好。 +> 事实证明,Plasma 为图形艺术家和摄影师提供了更好的工具,例如在 Gwenview、Krita 甚至文件管理器 Dolphin 中都可以看出。此外,它对 Wacom 平板的支持比其他任何桌面环境都更好。 -> 它已经变得不错,以至于大多数 Ubuntu Studio 团队现在都使用 Kubuntu,并通过 Ubuntu Studio Installer 将 Ubuntu Studio 作为日常附加驱动使用。由于我们中的许多人都在使用 Plasma,因此在我们的下一个版本中过渡到 Plasma 的时机似乎是正确的。 +> 它已经变得如此之好,以至于现在大部分 Ubuntu Studio 团队成员都在使用通过 Ubuntu Studio 安装程序添加了 Ubuntu Studio 的 Kubuntu 作为日常工作使用。既然我们中的这么多人都在使用 Plasma,因此在我们的下一个版本中过渡到 Plasma 似乎是个好时机。 -当然,每个桌面环境都针对不同的内容进行了量身定制。他们认为 KDE Plasma 将是取代 XFCE 的最适合的桌面环境,从而为所有用户提供更好的用户体验。 +当然,每一个桌面环境都是针对不同的用户量身定制的。在此,他们认为 KDE Plasma 是最适合取代 XFCE 的桌面环境,可以为所有用户提供更好的用户体验。 -尽管我不确定用户对此会有何反应,因为每个用户都有不同的偏好。如果现有用户对 KDE 没有问题,那就没什么大不了的。 +尽管我不确定用户对此会有何反应,因为每个用户都有不同的偏好。如果现有用户对 KDE 没有问题,那就没什么大问题。 值得注意的是,Ubuntu Studio 还提到了为什么 KDE 可能是它们的更好选择: ->在没有 Akonadi 的情况下,Plasma 桌面环境的资源使用与 Xfce 一样轻,甚至更轻。Fedora Jam 和 KXStudio 等其他以音频为重点的 Linux 发行版在历史上一直使用 KDE Plasma 桌面环境,并且在音频方面做得很好。 +> 在没有 Akonadi 的情况下,Plasma 桌面环境的资源使用与 Xfce 一样轻量级,甚至更轻。Fedora Jam 和 KXStudio 等其他以音频为重点的 Linux 发行版在历史上一直使用 KDE Plasma 桌面环境,并且在音频方面做得很好。 -此外,他们还强调了[福布斯杂志中 Jason Evangelho 的文章][7],其中一些基准测试表明 KDE 几乎与 Xfce 一样轻。即使这是一个好征兆,我们仍然必须等待用户测试 KDE 驱动的 Ubuntu Studio。只有这样,我们才能观察 Ubuntu Studio 放弃 XFCE 桌面环境的决定是否正确。 +此外,他们还强调了 [Jason Evangelho 在福布斯杂志上的一篇文章][7],其中一些基准测试表明 KDE 几乎与 Xfce 一样轻量级。尽管这是一个好的迹象,我们仍然需要等待用户试驾 KDE 驱动的 Ubuntu Studio。只有这样,我们才能观察到 Ubuntu Studio 放弃 XFCE 桌面环境的决定是否正确。 ### 更改后,Ubuntu Studio 用户将发生什么变化? -在带 KDE 的 Ubuntu Studio 20.10 及更高版本上可能会影响(或改进)整个工作流程。 +在带有 KDE 的 Ubuntu Studio 20.10 及更高版本上的整体工作流程可能会受到影响(或改善)。 -但是,升级过程(从 20.04 到 20.10)将导致系统损坏。因此,全新安装 Ubuntu Studio 20.10 或更高版本将是唯一的方法。 +但是,升级过程(从 20.04 到 20.10)会导致系统损坏。因此,全新安装 Ubuntu Studio 20.10 或更高版本将是唯一的方法。 -他们还提到,他们将不断评估与预安装的应用是否存在重复。因此,我相信在接下来的几天中将会有更多细节。 +他们还提到,他们还会不断评估与预安装的应用是否存在重复。所以,相信在未来的日子里,更多的细节也会随之而来。 -Ubuntu Studio 是最近第二个切换它主要桌面环境的发行版。先前,[Lubuntu] [8] 从 LXDE 切换到 LXQt。 +Ubuntu Studio 是最近一段时间内第二个改变了主桌面环境的发行版。先前,[Lubuntu][8] 从 LXDE 切换到 LXQt。 你如何看待这种变化?欢迎在下面的评论中分享你的想法。 @@ -55,7 +55,7 @@ via: https://itsfoss.com/ubuntu-studio-opts-for-kde/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 09830a985a037ed69c1db7c046f56bb9ebd5ef29 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 16 May 2020 11:37:37 +0800 Subject: [PATCH 0721/1809] PUB @geekpi https://linux.cn/article-12223-1.html --- ...dio To Replace Xfce With KDE Plasma Desktop Environment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md (98%) diff --git a/translated/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md b/published/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md similarity index 98% rename from translated/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md rename to published/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md index 9084834ad7..d349c73567 100644 --- a/translated/tech/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md +++ b/published/20200507 Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12223-1.html) [#]: subject: (Ubuntu Studio To Replace Xfce With KDE Plasma Desktop Environment) [#]: via: (https://itsfoss.com/ubuntu-studio-opts-for-kde/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 7237d17d242f02278e711696ef71a50261d8bde5 Mon Sep 17 00:00:00 2001 From: Acceleratorrrr <542383480@qq.com> Date: Sat, 16 May 2020 12:22:31 +0100 Subject: [PATCH 0722/1809] Translate request 20200408 --- ...08 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md b/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md index 569981ebea..ba7cfef720 100644 --- a/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md +++ b/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Acceleratorrrr) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c9e270c96c269f320109f5fd5c152a9c7a4e739b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 17 May 2020 11:02:32 +0800 Subject: [PATCH 0723/1809] PRF @geekpi --- ...h FreeBSD as a desktop operating system.md | 58 ++++++++++--------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/translated/tech/20200508 Getting started with FreeBSD as a desktop operating system.md b/translated/tech/20200508 Getting started with FreeBSD as a desktop operating system.md index ceebbcfa81..a8a049554b 100644 --- a/translated/tech/20200508 Getting started with FreeBSD as a desktop operating system.md +++ b/translated/tech/20200508 Getting started with FreeBSD as a desktop operating system.md @@ -1,44 +1,46 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with FreeBSD as a desktop operating system) [#]: via: (https://opensource.com/article/20/5/furybsd-linux) [#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) -开始用 FreeBSD 作为桌面操作系统 +使用 FreeBSD 作为桌面操作系统 ====== -FuryBSD 的 live 桌面环境能让你在实际使用之前先尝试。 -![web development and design, desktop and browser][1] -[FreeBSD][2] 是一个很棒的操作系统,但是从设计上讲,它没有桌面环境。如果不从 FreeBSD 的 [ports 和软件包集][3]安装其他软件,那么 FreeBSD 仅能体验命令行。下面的截图显示了在安装过程中选择了每个“可选系统组件”后,登录 FreeBSD 12.1 的样子。 - -![FreeBSD][4] - -可以将 FreeBSD 变成包含各种桌面环境的操作系统,但是这需要时间、精力和[遵循大量书面说明][5]。使用使用 **desktop-installer** 包(为用户提供基于文本的菜单并帮助自动执行大部分过程)仍然非常耗时。这两种方法的最大问题是,用户在花了很多时间进行设置之后,可能会发现他们的系统与 FreeBSD 不完全兼容。 - -[FuryBSD][6] 通过提供 live 桌面镜像来解决此问题,用户可以在安装之前对其进行评估。目前,FuryBSD 提供 Xfce 镜像和 KDE 镜像。每个镜像都提供已预安装桌面环境的 FreeBSD。如果用户试用镜像并发现其硬件工作正常,那么他们可以安装 FuryBSD,并拥有由 FreeBSD 提供支持的即用桌面操作系统。在本文中,我将使用 Xfce 镜像,但 KDE 镜像的使用完全一样。 - -对于任何安装过 Linux 发行版、BSD 或任何其他类 Unix 的开源操作系统的人,开始用 FuryBSD 都应该是一个熟悉的过程。从 FuryBSD 网站下载 ISO,将它复制到闪存,然后从闪存启动计算机。如果从闪存引导失败,请确保安全引导已禁用。 - -![FuryBSD Live XFCE Desktop][7] - -从闪存启动后,桌面环境将自动加载。除了“家”、“文件系统”和“回收站”图标外,live 桌面还有用于配置 Xorg 的工具、入门指南、FuryBSD 安装程序和系统信息程序的图标。除了这些额外功能以及一些自定义的 Xfce 设置和墙纸外,桌面环境除了基本的 Xfce 应用和 Firefox 之外并没有其他功能。 - -![FuryBSD Xorg Tool][8] - -此时仅加载基本的图形驱动,但足以检查 FuryBSD 是否支持系统的有线和无线网络接口。如果没有网络接口自动工作,那么 **Getting Started.txt** 文件包含有关尝试配置网络接口和其他配置任务的说明。如果至少有一个网络接口有效,那么可以使用 **Configure Xorg** 应用安装 Intel、NVidia 或 VirtualBox 图形驱动。它将下载并安装驱动,并且需要重新启动 Xorg。如果系统未自动重新登录到 live 用户,那么密码为 **furybsd**。配置后,图形驱动将转移到已安装的系统中。 - -![FuryBSD Installer - ZFS Configuration][9] - -如果一切都可以在 live 环境中正常运行,那么 FuryBSD 安装程序可以将 FuryBSD 配置并安装到计算机上。该安装程序在终端中运行,但提供与大多数其他 BSD 和 Linux 安装程序相同的选项。系统将要求用户设置系统的主机名、配置 ZFS 存储,设置 root 密码,添加至少一个非 root 用户以及配置时间和日期。完成后,系统可以引导到预装有 Xfce (或 KDE)的 FreeBSD 中。FuryBSD 完成了所有困难的工作,甚至还花了很多精力使桌面看起来更漂亮。 +> FuryBSD 的实时桌面环境能让你在实际使用之前先尝试。 ![FuryBSD Post-Install XFCE Desktop][10] -如上所述,桌面环境没有大量预装软件,因此几乎肯定要安装额外的软件包。最快的方法是在终端中使用 **pkg** 命令。该命令的行为很像 dnf 和 apt,因此来自 Linux 发行版的用户(使用其中之一)在查找和安装软件包时应该感到很熟悉。 FreeBSD的软件包集合很大,因此大多数知名的开源软件包都可用。 +[FreeBSD][2] 是一个很棒的操作系统,但是从设计上讲,它并没有自带桌面环境。如果不从 FreeBSD 的 [ports 和软件包集][3]安装其他软件,那么 FreeBSD 仅能体验命令行。下面的截图显示了在安装过程中选择了每个“可选系统组件”后,登录 FreeBSD 12.1 的样子。 -在没有太多 FreeBSD 经验的情况下尝试 FuryBSD 的用户应查阅 [FreeBSD 手册][11],以了解有关如何以 FreeBSD 的方式做事。有任何 Linux 发行版或其他 BSD 使用经验的用户应该能弄清很多事情,但是手册可以帮助你弄清一些差异。进一步了解 FreeBSD 的一个很好的资源是 Michael W. Lucas 的 _[Absolute FreeBSD,第三版][12]_。 +![FreeBSD][4] + +FreeBSD 可以用各种桌面环境中的任何一种来变成桌面操作系统,但是这需要时间、精力和[遵循大量书面说明][5]。使用使用 desktop-installer 包(为用户提供基于文本的菜单并帮助自动执行大部分过程)仍然非常耗时。这两种方法的最大问题是,用户可能在花了很多时间进行设置之后,可能会发现他们的硬件系统与 FreeBSD 不完全兼容。 + +[FuryBSD][6] 通过提供实时桌面镜像来解决此问题,用户可以在安装之前对其进行评估。目前,FuryBSD 提供 Xfce 镜像和 KDE 镜像。每个镜像都提供了一个已预安装桌面环境的 FreeBSD。如果用户试用该镜像并发现其硬件工作正常,那么他们可以安装 FuryBSD,并拥有一个由 FreeBSD 驱动的即用桌面操作系统。在本文中,我会使用 Xfce 镜像,但 KDE 镜像的工作原理完全一样。 + +对于安装过 Linux 发行版、BSD 或任何其他类 Unix 的开源操作系统的人,FuryBSD 的上手过程应该很熟悉。从 FuryBSD 网站下载 ISO,将它复制到闪存盘,然后从闪存盘启动计算机。如果从闪存盘引导失败,请确保“安全引导”已禁用。 + +![FuryBSD Live XFCE Desktop][7] + +从闪存盘启动后,桌面环境将自动加载。除了“家”、“文件系统”和“回收站”图标外,实时桌面还有用于配置 Xorg 的工具、入门指南、FuryBSD 安装程序和系统信息程序的图标。除了这些额外功能以及一些自定义的 Xfce 设置和壁纸外,桌面环境除了基本的 Xfce 应用和 Firefox 之外并没有其他功能。 + +![FuryBSD Xorg Tool][8] + +此时仅加载基本的图形驱动,但足以检查 FuryBSD 是否支持系统的有线和无线网络接口。如果网络接口没有一个能自动工作,那么 `Getting Started.txt` 文件包含有关尝试配置网络接口和其他配置任务的说明。如果至少有一个网络接口有效,那么可以使用 Configure Xorg 应用安装 Intel、NVidia 或 VirtualBox 图形驱动。它将下载并安装驱动,并且需要重新启动 Xorg。如果系统未自动重新登录到实时镜像用户,那么密码为 `furybsd`(你可以使用它来登录)。配置后,图形驱动将转移到已安装的系统中。 + +![FuryBSD Installer - ZFS Configuration][9] + +如果一切都可以在实时环境中正常运行,那么 FuryBSD 安装程序可以将 FuryBSD 配置并安装到计算机上。该安装程序在终端中运行,但提供与大多数其他 BSD 和 Linux 安装程序相同的选项。系统将要求用户设置系统的主机名、配置 ZFS 存储、设置 root 密码,添加至少一个非 root 用户以及配置时间和日期。完成后,系统可以引导到预装有 Xfce (或 KDE)的 FreeBSD 中。FuryBSD 完成了所有困难的工作,甚至还花了很多精力使桌面看起来更漂亮。 + + + +如上所述,桌面环境没有大量预装软件,因此几乎肯定要安装额外的软件包。最快的方法是在终端中使用 `pkg` 命令。该命令的行为很像 `dnf` 和 `apt`,因此使用过其中之一的来自 Linux 发行版的用户在查找和安装软件包时应该感到很熟悉。FreeBSD 的软件包集合非常多,因此大多数知名的开源软件包都可用。 + +如果用户在没有太多 FreeBSD 经验的情况下尝试 FuryBSD,应查阅 [FreeBSD 手册][11],以了解有关如何以 FreeBSD 的方式操作。有任何 Linux 发行版或其他 BSD 使用经验的用户应该能弄清很多事情,但是手册可以帮助你弄清一些差异。进一步了解 FreeBSD 的一个很好的资源是 Michael W. Lucas 的 《[Absolute FreeBSD,第三版][12]》。 -------------------------------------------------------------------------------- @@ -47,7 +49,7 @@ via: https://opensource.com/article/20/5/furybsd-linux 作者:[Joshua Allen Holm][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8df76ff5cc31d6a7cb54d079a2f25567133b2be2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 17 May 2020 11:04:30 +0800 Subject: [PATCH 0724/1809] PUB @geekpi https://linux.cn/article-12225-1.html --- ...ting started with FreeBSD as a desktop operating system.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200508 Getting started with FreeBSD as a desktop operating system.md (98%) diff --git a/translated/tech/20200508 Getting started with FreeBSD as a desktop operating system.md b/published/20200508 Getting started with FreeBSD as a desktop operating system.md similarity index 98% rename from translated/tech/20200508 Getting started with FreeBSD as a desktop operating system.md rename to published/20200508 Getting started with FreeBSD as a desktop operating system.md index a8a049554b..ef63e7b696 100644 --- a/translated/tech/20200508 Getting started with FreeBSD as a desktop operating system.md +++ b/published/20200508 Getting started with FreeBSD as a desktop operating system.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12225-1.html) [#]: subject: (Getting started with FreeBSD as a desktop operating system) [#]: via: (https://opensource.com/article/20/5/furybsd-linux) [#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) From 80f720e7768bc7fca07e7905de92c67f4a427e8e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 17 May 2020 19:23:16 +0800 Subject: [PATCH 0725/1809] APL --- sources/tech/20200429 Why strace doesn-t work in Docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200429 Why strace doesn-t work in Docker.md b/sources/tech/20200429 Why strace doesn-t work in Docker.md index 42414ad377..8085f90251 100644 --- a/sources/tech/20200429 Why strace doesn-t work in Docker.md +++ b/sources/tech/20200429 Why strace doesn-t work in Docker.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6dc1834b49d5102596e35b717af6c70e0e8eecec Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 17 May 2020 20:59:54 +0800 Subject: [PATCH 0726/1809] TSL&PRF @wxy --- ...00429 Why strace doesn-t work in Docker.md | 161 ------------------ ...00429 Why strace doesn-t work in Docker.md | 161 ++++++++++++++++++ 2 files changed, 161 insertions(+), 161 deletions(-) delete mode 100644 sources/tech/20200429 Why strace doesn-t work in Docker.md create mode 100644 translated/tech/20200429 Why strace doesn-t work in Docker.md diff --git a/sources/tech/20200429 Why strace doesn-t work in Docker.md b/sources/tech/20200429 Why strace doesn-t work in Docker.md deleted file mode 100644 index 8085f90251..0000000000 --- a/sources/tech/20200429 Why strace doesn-t work in Docker.md +++ /dev/null @@ -1,161 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why strace doesn't work in Docker) -[#]: via: (https://jvns.ca/blog/2020/04/29/why-strace-doesnt-work-in-docker/) -[#]: author: (Julia Evans https://jvns.ca/) - -Why strace doesn't work in Docker -====== - -While editing the capabilities page of the [how containers work][1] zine, I found myself trying to explain why `strace` doesn’t work in a Docker container. - -The problem here is – if you run `strace` in a Docker container, this happens: - -``` -$ docker run -it ubuntu:18.04 /bin/bash -$ # ... install strace ... -[email protected]:/# strace ls -strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted -``` - -strace works using the `ptrace` system call, so if `ptrace` isn’t allowed, it’s definitely not gonna work! This is pretty easy to fix – on my machine, this fixes it: - -``` -docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash -``` - -But I wasn’t interested in fixing it, I wanted to know why it happens. So why does strace not work, and why does `--cap-add=SYS_PTRACE` fix it? - -### hypothesis 1: container processes are missing the `CAP_SYS_PTRACE` capability - -I always thought the reason was that Docker container processes by default didn’t have the `CAP_SYS_PTRACE` capability. This is consistent with it being fixed by `--cap-add=SYS_PTRACE`, right? - -But this actually doesn’t make sense for 2 reasons. - -**Reason 1**: Experimentally, as a regular user, I can strace on any process run by my user. But if I check if my current process has the `CAP_SYS_PTRACE` capability, I don’t: - -``` -$ getpcaps $$ -Capabilities for `11589': = -``` - -**Reason 2**: `man capabilities` says this about `CAP_SYS_PTRACE`: - -``` -CAP_SYS_PTRACE - * Trace arbitrary processes using ptrace(2); -``` - -So the point of `CAP_SYS_PTRACE` is to let you ptrace **arbitrary** processes owned by any user, the way that root usually can. You shouldn’t need it to just ptrace a regular process owned by your user. - -And I tested this a third way – I ran a Docker container with `docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash`, dropped the `CAP_SYS_PTRACE` capability, and I could still strace processes even though I didn’t have that capability anymore. What? Why? - -### hypothesis 2: something about user namespaces??? - -My next (much less well-founded) hypothesis was something along the lines of “um, maybe the process is in a different user namespace and strace doesn’t work because of… reasons?” This isn’t really coherent but here’s what happened when I looked into it. - -Is the container process in a different user namespace? Well, in the container: - -``` -[email protected]:/# ls /proc/$$/ns/user -l -... /proc/1/ns/user -> 'user:[4026531837]' -``` - -On the host: - -``` -[email protected]:~$ ls /proc/$$/ns/user -l -... /proc/12177/ns/user -> 'user:[4026531837]' -``` - -Because the user namespace ID (`4026531837`) is the same, the root user in the container is the exact same user as the root user on the host. So there’s definitely no reason it shouldn’t be able to strace processes that it created! - -This hypothesis doesn’t make much sense but I hadn’t realized that the root user in a Docker container is the same as the root user on the host, so I thought that was interesting. - -### hypothesis 3: the ptrace system call is being blocked by a seccomp-bpf rule - -I also knew that Docker uses seccomp-bpf to stop container processes from running a lot of system calls. And ptrace is in the [list of system calls blocked by Docker’s default seccomp profile][2]! (actually the list of allowed system calls is a whitelist, so it’s just that ptrace is not in the default whitelist. But it comes out to the same thing.) - -That easily explains why strace wouldn’t work in a Docker container – if the `ptrace` system call is totally blocked, then of course you can’t call it at all and strace would fail. - -Let’s verify this hypothesis – if we disable all seccomp rules, can we strace in a Docker container? - -``` -$ docker run --security-opt seccomp=unconfined -it ubuntu:18.04 /bin/bash -$ strace ls -execve("/bin/ls", ["ls"], 0x7ffc69a65580 /* 8 vars */) = 0 -... it works fine ... -``` - -Yes! It works! Great. Mystery solved, except… - -### why does `--cap-add=SYS_PTRACE` fix the problem? - -What we still haven’t explained is: why does `--cap-add=SYS_PTRACE` would fix the problem? - -The man page for `docker run` explains the `--cap-add` argument this way: - -``` ---cap-add=[] - Add Linux capabilities -``` - -That doesn’t have anything to do with seccomp rules! What’s going on? - -### let’s look at the Docker source code. - -When the documentation doesn’t help, the only thing to do is go look at the source. - -The nice thing about Go is, because dependencies are often vendored in a Go repository, you can just grep the repository to figure out where the code that does a thing is. So I cloned `github.com/moby/moby` and grepped for some things, like `rg CAP_SYS_PTRACE`. - -Here’s what I think is going on. In containerd’s seccomp implementation, in [contrib/seccomp/seccomp_default.go][3], there’s a bunch of code that makes sure that if a process has a capability, then it’s also given access (through a seccomp rule) to use the system calls that go with that capability. - -``` -case "CAP_SYS_PTRACE": - s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{ - Names: []string{ - "kcmp", - "process_vm_readv", - "process_vm_writev", - "ptrace", - }, - Action: specs.ActAllow, - Args: []specs.LinuxSeccompArg{}, - }) -``` - -There’s some other code that seems to do something very similar in [profiles/seccomp/seccomp.go][4] in moby and the [default seccomp profile][5], so it’s possible that that’s what’s doing it instead. - -So I think we have our answer! - -### `--cap-add` in Docker does a little more than what it says - -The upshot seems to be that `--cap-add` doesn’t do exactly what it says it does in the man page, it’s more like `--cap-add-and-also-whitelist-some-extra-system-calls-if-required`. Which makes sense! If you have a capability like `CAP_SYS_PTRACE` which is supposed to let you use the `process_vm_readv` system call but that system call is blocked by a seccomp profile, that’s not going to help you much! - -So allowing the `process_vm_readv` and `ptrace` system calls when you give the container `CAP_SYS_PTRACE` seems like a reasonable choice. - -### that’s all! - -This was a fun small thing to investigate, and I think it’s a nice example of how containers are made of lots of moving pieces that work together in not-completely-obvious ways. - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/2020/04/29/why-strace-doesnt-work-in-docker/ - -作者:[Julia Evans][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://jvns.ca/ -[b]: https://github.com/lujun9972 -[1]: https://wizardzines.com/zines/containers -[2]: https://docs.docker.com/engine/security/seccomp/ -[3]: https://github.com/containerd/containerd/blob/4be98fa28b62e8a012491d655a4d6818ef87b080/contrib/seccomp/seccomp_default.go#L527-L537 -[4]: https://github.com/moby/moby/blob/cc0dfb6e7b22ad120c60a9ce770ea15415767cf9/profiles/seccomp/seccomp.go#L126-L132 -[5]: https://github.com/moby/moby/blob/master/profiles/seccomp/default.json#L723-L739 diff --git a/translated/tech/20200429 Why strace doesn-t work in Docker.md b/translated/tech/20200429 Why strace doesn-t work in Docker.md new file mode 100644 index 0000000000..dfd17d0fca --- /dev/null +++ b/translated/tech/20200429 Why strace doesn-t work in Docker.md @@ -0,0 +1,161 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why strace doesn't work in Docker) +[#]: via: (https://jvns.ca/blog/2020/04/29/why-strace-doesnt-work-in-docker/) +[#]: author: (Julia Evans https://jvns.ca/) + +为什么 strace 在 Docker 中不起作用? +====== + +在编辑“容器如何工作”杂志的能力页面时,我想试着解释一下为什么 `strace` 在 Docker 容器中无法工作。 + +这里的问题是 —— 如果我在笔记本上的 Docker 容器中运行 `strace`,就会出现这种情况: + +``` +$ docker run -it ubuntu:18.04 /bin/bash +$ # ... install strace ... +[email protected]:/# strace ls +strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted +``` + +`strace` 通过 `ptrace` 系统调用起作用,所以如果不允许使用 `ptrace`,它肯定是不能工作的! 这个问题很容易解决 —— 在我的机器上,是这样解决的: + +``` +docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash +``` + +但我对如何修复它不感兴趣,我想知道为什么会出现这种情况。那么,为什么 `strace` 不能工作,为什么`--cap-add=SYS_PTRACE` 可以解决这个问题? + +### 假设 1:容器进程缺少 `CAP_SYS_PTRACE` 能力。 + +我一直以为原因是 Docker 容器进程默认不具备 `CAP_SYS_PTRACE` 能力。这和它可以被 `--cap-add=SYS_PTRACE` 修复是一回事,是吧? + +但这实际上是不合理的,原因有两个。 + +原因 1:在实验中,作为一个普通用户,我可以对我的用户运行的任何进程进行 `strace`。但如果我检查我的当前进程是否有 `CAP_SYS_PTRACE` 能力,则没有: + +``` +$ getpcaps $$ +Capabilities for `11589': = +``` + +原因 2:`capabilities` 的手册页对 `CAP_SYS_PTRACE` 的介绍是: + +``` +CAP_SYS_PTRACE + * Trace arbitrary processes using ptrace(2); +``` + +所以,`CAP_SYS_PTRACE` 的作用是让你像 root 一样,可以对任何用户拥有的**任意**进程进行 `ptrace` 。你不需要用它来只是对一个由你的用户拥有的普通进程进行 `ptrace ` 。 + +我用第三种方法测试了一下 —— 我用 `docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash` 运行了一个 Docker 容器,去掉了 `CAP_SYS_PTRACE` 能力,但我仍然可以跟踪进程,虽然我已经没有这个能力了。什么?为什么? + +### 假设 2:关于用户命名空间的事情? + +我的下一个(没有那么充分的依据的)假设是“嗯,也许这个过程是在不同的用户命名空间里,而 `strace` 不能工作,因为某种原因而行不通?”这个问题其实并不连贯,但这是我观察时想到的。 + +容器进程是否在不同的用户命名空间中?嗯,在容器中: + +``` +root@e27f594da870:/# ls /proc/$$/ns/user -l +... /proc/1/ns/user -> 'user:[4026531837]' +``` + +在宿主机: + +``` +bork@kiwi:~$ ls /proc/$$/ns/user -l +... /proc/12177/ns/user -> 'user:[4026531837]' +``` + +因为用户命名空间 ID(`4026531837`)是相同的,所以容器中的 root 用户和主机上的 root 用户是完全相同的用户。所以,绝对没有理由不能够对它创建的进程进行 `strace`! + +这个假设并没有什么意义,但我(之前)没有意识到 Docker 容器中的 root 用户和主机上的 root 用户同一个,所以我觉得这很有意思。 + +### 假设 3:ptrace 系统的调用被 seccomp-bpf 规则阻止了 + +我也知道 Docker 使用 seccomp-bpf 来阻止容器进程运行许多系统调用。而 `ptrace` 在[被 Docker 默认的 seccomp 配置文件阻止的系统调用列表][2]中!(实际上,允许的系统调用列表是一个白名单,所以只是`ptrace` 不在默认的白名单中。但得出的结果是一样的。) + +这很容易解释为什么 `strace` 在 Docker 容器中不能工作 —— 如果 `ptrace` 系统调用完全被屏蔽了,那么你当然不能调用它,`strace` 就会失败。 + +让我们来验证一下这个假设 —— 如果我们禁用了所有的 seccomp 规则,`strace` 能在 Docker 容器中工作吗? + +``` +$ docker run --security-opt seccomp=unconfined -it ubuntu:18.04 /bin/bash +$ strace ls +execve("/bin/ls", ["ls"], 0x7ffc69a65580 /* 8 vars */) = 0 +... it works fine ... +``` + +是的,很好用!很好。谜底解开了,除了..... + +### 为什么 `--cap-add=SYS_PTRACE` 能解决问题? + +我们还没有解释的是:为什么 `--cap-add=SYS_PTRACE` 可以解决这个问题? + +`docker run` 的手册页是这样解释 `--cap-add` 参数的。 + +``` +--cap-add=[] + Add Linux capabilities +``` + +这跟 seccomp 规则没有任何关系! 怎么回事? + +### 我们来看看 Docker 源码 + +当文档没有帮助的时候,唯一要做的就是去看源码。 + +Go 语言的好处是,因为依赖关系通常是在一个 Go 仓库里,你可以通过 `grep` 来找出做某件事的代码在哪里。所以我克隆了 `github.com/moby/moby`,然后对一些东西进行 `grep`,比如 `rg CAP_SYS_PTRACE`。 + +我认为是这样的。在 `containerd` 的 seccomp 实现中,在 [contrib/seccomp/seccomp/seccomp_default.go][3] 中,有一堆代码确保如果一个进程有一个能力,那么它也会(通过 seccomp 规则)获得访问权限,以使用与该能力相关的系统调用。 + +``` +case "CAP_SYS_PTRACE": + s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{ + Names: []string{ + "kcmp", + "process_vm_readv", + "process_vm_writev", + "ptrace", + }, + Action: specs.ActAllow, + Args: []specs.LinuxSeccompArg{}, + }) +``` + +在 moby 中的 [profile/seccomp/seccomp.go][4] 和 [默认的 seccomp 配置文件][5]中,也有一些其他的代码似乎做了一些非常类似的事情,所以有可能就是这个代码在做这个事情。 + +所以我想我们有答案了! + +### Docker 中的 `--cap-add` 做的事情比它说的要多 + +结果似乎是,`--cap-add` 并不像手册页里说的那样,它更像是 `--cap-add-and-also-whiteelist-some-extra-system-calls-if-required`。这很有意义! 如果你具有一个像 `--CAP_SYS_PTRACE` 这样的能力,可以让你使用 `process_vm_readv` 系统调用,但是该系统调用被 seccomp 配置文件阻止了,那对你没有什么帮助! + +所以当你给容器 `CAP_SYS_PTRACE` 能力时,允许使用 `process_vm_readv` 和 `ptrace` 系统调用似乎是一个合理的选择。 + +### 就这样! + +这是个有趣的小事情,我认为这是一个很好的例子,说明了容器是由许多移动的部件组成的,它们以不完全显而易见的方式一起工作。 + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2020/04/29/why-strace-doesnt-work-in-docker/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://wizardzines.com/zines/containers +[2]: https://docs.docker.com/engine/security/seccomp/ +[3]: https://github.com/containerd/containerd/blob/4be98fa28b62e8a012491d655a4d6818ef87b080/contrib/seccomp/seccomp_default.go#L527-L537 +[4]: https://github.com/moby/moby/blob/cc0dfb6e7b22ad120c60a9ce770ea15415767cf9/profiles/seccomp/seccomp.go#L126-L132 +[5]: https://github.com/moby/moby/blob/master/profiles/seccomp/default.json#L723-L739 From bcaf11f79acae482402f031cca6526630ecd34d6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 17 May 2020 21:45:07 +0800 Subject: [PATCH 0727/1809] APL --- ...9 open source CSS frameworks for frontend web development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200413 9 open source CSS frameworks for frontend web development.md b/sources/tech/20200413 9 open source CSS frameworks for frontend web development.md index 0d2bd7ddc1..8ec2135449 100644 --- a/sources/tech/20200413 9 open source CSS frameworks for frontend web development.md +++ b/sources/tech/20200413 9 open source CSS frameworks for frontend web development.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1dbd625a5e4b51b65f474e5b12e5036ec83e4856 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 17 May 2020 23:19:36 +0800 Subject: [PATCH 0728/1809] TSL --- ...frameworks for frontend web development.md | 254 ------------------ ...frameworks for frontend web development.md | 250 +++++++++++++++++ 2 files changed, 250 insertions(+), 254 deletions(-) delete mode 100644 sources/tech/20200413 9 open source CSS frameworks for frontend web development.md create mode 100644 translated/tech/20200413 9 open source CSS frameworks for frontend web development.md diff --git a/sources/tech/20200413 9 open source CSS frameworks for frontend web development.md b/sources/tech/20200413 9 open source CSS frameworks for frontend web development.md deleted file mode 100644 index 8ec2135449..0000000000 --- a/sources/tech/20200413 9 open source CSS frameworks for frontend web development.md +++ /dev/null @@ -1,254 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (9 open source CSS frameworks for frontend web development) -[#]: via: (https://opensource.com/article/20/4/open-source-css-frameworks) -[#]: author: (Bryant Son https://opensource.com/users/brson) - -9 open source CSS frameworks for frontend web development -====== -Explore open source CSS frameworks and find the right one for your -project. -![Digital creative of a browser on the internet][1] - -When most people think about web development, HTML or JavaScript usually come to mind. They usually forget about the technology that has far more impact on the ability to enjoy a website: [cascading style sheets (CSS)][2]. CSS is both one of the most important and the most often forgotten parts of any webpage, even though it's one of the three cornerstone technologies of the World Wide Web, according to Wikipedia. - -This article explores nine popular, powerful, and open source frameworks that make CSS development straightforward for building beautiful website frontends. - -Name | What It Is | License ----|---|--- -[Bootstrap][3] | The most popular CSS framework; by Twitter | MIT -[PatternFly][4] | Open source framework; by Red Hat | MIT -[Material Components for the web][5] | Open source framework; by Google | MIT -[Pure][6] | Open source framework; by Yahoo | BSD -[Foundation][7] | Frontend framework; by Zurb Foundation | MIT -[Bulma][8] | Modern CSS framework based on Flexbox | MIT -[Skeleton][9] | Lightweight CSS framework | MIT -[Materialize][10] | CSS framework based on Material Design | MIT -[Bootflat][11] | Open source Flat UI kit based on Bootstrap 3.3.0 | MIT - -  - -If you prefer to follow along as I explore this live, you can watch my video. - -### Bootstrap - -[Bootstrap][12] is easily the most popular CSS framework, and it is the one that started all frontend web design. Developed by Twitter, Bootstrap offers usability, functionality, and extensibility. - -![Bootstrap homepage][13] - -Bootstrap also offers plenty of [examples][14] to get you started. - -![Bootstrap examples][15] - -With Bootstrap, you can stitch together different components and layouts to create an interesting page design. It also offers plenty of detailed documentation. - -![Bootstrap documentation][16] - -Bootstrap's [GitHub][3] repository lists more than 19,000 commits and 1,100 contributors. It is based on the MIT License, so (as with all of the frameworks on this list) you can jump in and contribute as well. - -![Bootstrap GitHub][17] - -### PatternFly - -[PatternFly][18] is an open source (under the MIT License) CSS framework by Red Hat. PatternFly takes a different approach than Bootstrap: While Bootstrap is meant for anyone interested in creating a beautiful website, PatternFly is primarily focused on enterprise application developers and provides components, such as bars, charts, and navigations, that are very appealing for creating powerful, metrics-driven dashboards. In fact, Red Hat uses this CSS framework for the design of its products, such as OpenShift. - -![PatternFly homepage][19] - -In addition to static HTML, PatternFly also supports the ReactJS framework, a popular JavaScript framework developed by Facebook. - -![PatternFly ReactJS support][20] - -PatternFly has many advanced components, such as bars, charts, [modals][21], and layouts, that are suitable for enterprise-level applications. - -![PatternFly chart component][22] - -PatternFly's [GitHub][4] page lists more than 1,050 commits and 44 contributors. PatternFly is getting a lot of attention, and you are more than welcome to contribute. - -![PatternFly GitHub][23] - -### Material Components for the web - -With its highly successful Android platform, Google set its own standard design guidelines with a concept called [Material Design][24]. The Material Design standards are intended to be reflected across all Google products, and they are also available to the general public and open source under the MIT License. - -![Material Design homepage][25] - -Material Design has a number of [Components][26], "interactive building blocks for creating a user interface." These buttons, cards, backdrops, and more can be used to create any type of user interface for a website or mobile application. - -![Material Components webpage][27] - -The maintainers provide thorough documentation for different platforms. - -![Material Design documentation][28] - -There are also step-by-step tutorials with exercises for accomplishing different goals. - -![Material Design tutorial][29] - -The Material Components GitHub page hosts repos for different platforms, including [Material Components for the web (MDC Web)][5] for website development. MDC Web has more than 5,700 commits and 349 contributors. - -![MDC Web GitHub][30] - -### Pure - -Bootstrap, Patternfly, and MDC Web are very powerful CSS frameworks, yet they can be quite heavy and complex. If you want a lightweight CSS framework that it is closer to coding CSS yourself yet helps you build a nice web page, try [Pure.css][31]. Pure is a lightweight CSS framework with a minimal footprint. It was developed by Yahoo and is open source under the BSD License. - -![Pure.css homepage][32] - -Despite its small size, Pure offers plenty of the components necessary to build a good-looking webpage. - -![Pure.css components][33] - -Pure's [GitHub][6] page shows more than 565 commits and 59 contributors. - -![Pure.css GitHub][34] - -### Foundation - -[Foundation][35] claims to be the most advanced responsive frontend framework in the world. It provides advanced features and tutorials for building professional websites. - -![Foundation homepage][36] - -The framework is [used][37] by many companies, organizations, and even politicians, and it has plenty of documentation available. - -![Foundation documentation][38] - -Foundation's [GitHub][7] page shows nearly 17,000 commits and 1,000 contributors. Like most of the other frameworks on this list, it's available under the MIT License. - -![Foundation GitHub][39] - -### Bulma - -[Bulma][40] is an open source framework based on Flexbox and available under the MIT License. Bulma is a pretty lightweight framework, as it requires only one CSS file. - -![Bulma homepage][41] - -Bulma has clean and simple docs that make it easy to choose the topics you want to explore. It also has a number of web components you can just pick up and use in your design. - -![Bulma documentation][42] - -Bulma's [GitHub][8] page lists more than 1,400 commits and 300 contributors. - -![Bulma GitHub][43] - -### Skeleton - -If even Pure is too heavy for you, there is an even lighter-weight framework called [Skeleton][44]. The Skeleton library is only about 400 lines long, and the framework provides only the essential components to start your CSS framework journey. - -![Skeleton homepage][45] - -Despite its simplicity, Skeleton offers detailed docs to help you get started right away. - -![Skeleton documentation][46] - -Skeleton's [GitHub][9] lists 167 commits and 22 contributors. However, it's not the most active project; its last update was in 2014, so it may need some maintenance before using it. Since it is released under the MIT License, feel free to do that yourself. - -![Skeleton GitHub][47] - -### Materialize - -[Materialize][48] is a responsive frontend framework based on Google's Material Design with additional themes and components developed by Materialize's contributors. - -![Materialize homepage][49] - -Materialize's documentation page is comprehensive and pretty easy to follow. Its components page includes buttons, cards, navigations, and more. - -![Materialize documentation][50] - -Materialize is an open source project under the MIT License, and its [GitHub][10] lists more than 3,800 commits and 250 contributors. - -![Materialize GitHub][51] - -### Bootflat - -[Bootflat][52] is an open source CSS framework derived from Twitter's Bootstrap. Compared to Bootstrap, Bootflat is simpler, with lighter-weight framework components. - -![Bootflat homepage][53] - -Bootflat's [documentation][54] almost seems inspired by IKEA—it shows an image of each component without much text. - -![Bootflat docs][55] - -Bootflat is available under the MIT License, and its [GitHub][11] page includes 159 commits and eight contributors, as of this writing. - -![Bootflat GitHub][56] - -### Which CSS framework should you choose? - -You have many options for open source CSS frameworks, depending on how feature-rich or simple you want the tooling to be. Like all technology decisions, there is no single right answer for everything or everyone; there is only the right choice for the given time and the given project. - -Give a few of these a spin and see which one you want to use in your next project. Also, did I miss any interesting open source CSS frameworks? Please share your feedback and ideas in the comments below. - -Which frontend framework should you pick for your next web app? Pam Selle will address this... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/open-source-css-frameworks - -作者:[Bryant Son][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/brson -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) -[2]: https://en.wikipedia.org/wiki/Cascading_Style_Sheets -[3]: https://github.com/twbs/bootstrap -[4]: https://github.com/patternfly/patternfly -[5]: https://github.com/material-components/material-components-web -[6]: https://github.com/pure-css/pure -[7]: https://github.com/foundation/foundation-sites -[8]: https://github.com/jgthms/bulma -[9]: https://github.com/dhg/Skeleton -[10]: https://github.com/Dogfalo/materialize -[11]: https://github.com/bootflat/bootflat.github.io -[12]: https://getbootstrap.com -[13]: https://opensource.com/sites/default/files/uploads/2_bootstrapscreenshot.jpg (Bootstrap homepage) -[14]: https://getbootstrap.com/docs/4.4/examples/ -[15]: https://opensource.com/sites/default/files/uploads/3_bootstrapsamples.jpg (Bootstrap examples) -[16]: https://opensource.com/sites/default/files/uploads/4_bootstrapdocs.jpg (Bootstrap documentation) -[17]: https://opensource.com/sites/default/files/uploads/5_bootstrapgithub.jpg (Bootstrap GitHub) -[18]: https://www.patternfly.org -[19]: https://opensource.com/sites/default/files/uploads/6_patternflyhomepage.jpg (PatternFly homepage) -[20]: https://opensource.com/sites/default/files/uploads/7_patternflyreactjs.jpg (PatternFly ReactJS support) -[21]: https://en.wikipedia.org/wiki/Modal_window -[22]: https://opensource.com/sites/default/files/uploads/8_patternflycomponents.jpg (PatternFly chart component) -[23]: https://opensource.com/sites/default/files/uploads/9_patternflygithub.jpg (PatternFly GitHub) -[24]: https://material.io -[25]: https://opensource.com/sites/default/files/uploads/10_materialhome.jpg (Material Design homepage) -[26]: https://material.io/components/ -[27]: https://opensource.com/sites/default/files/uploads/11_materialcomponents.jpg (Material Components webpage) -[28]: https://opensource.com/sites/default/files/uploads/12_materialdocs.jpg (Material Design documentation) -[29]: https://opensource.com/sites/default/files/uploads/13_materialtutorial.jpg (Material Design tutorial) -[30]: https://opensource.com/sites/default/files/uploads/15_materialgithub.jpg (MDC Web GitHub) -[31]: https://purecss.io -[32]: https://opensource.com/sites/default/files/uploads/16_purehome.jpg (Pure.css homepage) -[33]: https://opensource.com/sites/default/files/uploads/17_purecomponents.jpg (Pure.css components) -[34]: https://opensource.com/sites/default/files/uploads/18_puregithub.jpg (Pure.css GitHub) -[35]: https://get.foundation -[36]: https://opensource.com/sites/default/files/uploads/19_foundationhome.jpg (Foundation homepage) -[37]: https://zurb.com/responsive -[38]: https://opensource.com/sites/default/files/uploads/21_foundationdocs.jpg (Foundation documentation) -[39]: https://opensource.com/sites/default/files/uploads/22_foundationgithub.jpg (Foundation GitHub) -[40]: https://bulma.io -[41]: https://opensource.com/sites/default/files/uploads/23_bulmahome.jpg (Bulma homepage) -[42]: https://opensource.com/sites/default/files/uploads/24_bulmadoc.jpg (Bulma documentation) -[43]: https://opensource.com/sites/default/files/uploads/25_bulmagithub.jpg (Bulma GitHub) -[44]: http://getskeleton.com -[45]: https://opensource.com/sites/default/files/uploads/26_skeletonhome.jpg (Skeleton homepage) -[46]: https://opensource.com/sites/default/files/uploads/27_skeletondocs.jpg (Skeleton documentation) -[47]: https://opensource.com/sites/default/files/uploads/28_skeletongithub.jpg (Skeleton GitHub) -[48]: https://materializecss.com -[49]: https://opensource.com/sites/default/files/uploads/29_materializehome.jpg (Materialize homepage) -[50]: https://opensource.com/sites/default/files/uploads/30_materializedocs.jpg (Materialize documentation) -[51]: https://opensource.com/sites/default/files/uploads/31_materializegithub.jpg (Materialize GitHub) -[52]: http://bootflat.github.io -[53]: https://opensource.com/sites/default/files/uploads/32_bootflathome.jpg (Bootflat homepage) -[54]: http://bootflat.github.io/documentation.html -[55]: https://opensource.com/sites/default/files/uploads/33_bootflatdocs.jpg (Bootflat docs) -[56]: https://opensource.com/sites/default/files/uploads/34_bootflatgithub.jpg (Bootflat GitHub) diff --git a/translated/tech/20200413 9 open source CSS frameworks for frontend web development.md b/translated/tech/20200413 9 open source CSS frameworks for frontend web development.md new file mode 100644 index 0000000000..115b1aa911 --- /dev/null +++ b/translated/tech/20200413 9 open source CSS frameworks for frontend web development.md @@ -0,0 +1,250 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 open source CSS frameworks for frontend web development) +[#]: via: (https://opensource.com/article/20/4/open-source-css-frameworks) +[#]: author: (Bryant Son https://opensource.com/users/brson) + +9 个用于前端 Web 开发的开源 CSS 框架 +====== +> 探索开源 CSS 框架,找到适合你的项目的框架。 + +![Digital creative of a browser on the internet][1] + +当大多数人想到 Web 开发时,通常会想到 HTML 或 JavaScript。他们通常会忘记对网站的欣赏能力有更大影响的技术:[级联样式表][2]cascading style sheets(简称CSS)。据维基百科的说法,CSS 既是任何网页中最重要的部分,也是最常被遗忘的部分,尽管它是万维网的三大基石技术之一。 + +本文将探讨九种流行的、强大的、开源的框架,是这些框架让构建漂亮的网站前端的 CSS 开发变得简单明了。 + +名称 | 介绍| 许可证 +---|---|--- +[Bootstrap][3] | 最流行的 CSS 框架,来自 Twitter | MIT +[PatternFly][4] | 开源框架,来自 Red Hat | MIT +[MDC Web][5] | 开源框架;来自 Google | MIT +[Pure][6] | 开源框架;来自 Yahoo | BSD +[Foundation][7] | 前端框架了;来自 Zurb 基金会 | MIT +[Bulma][8] | 现代 CSS 框架,基于 Flexbox | MIT +[Skeleton][9] | 轻量级 CSS 框架 | MIT +[Materialize][10] | 基于 Material Design 的 CSS 框架 | MIT +[Bootflat][11] | 开源 Flat UI 工具,基于 Bootstrap 3.3.0 | MIT + +如果你更愿意跟着我一起探索这段直播,你可以看我的视频。  + +### Bootstrap + +[Bootstrap][2] 无疑是最流行的 CSS 框架,它是所有前端 Web 设计的开端。Bootstrap 由 Twitter 开发,提供了可用性、功能性和可扩展性。 + +![Bootstrap homepage][13] + +Bootstrap 还提供了大量的[例子][14]来帮助你入门。 + +![Bootstrap examples][15] + +使用 Bootstrap,你可以将不同的组件和布局拼接在一起,创造出一个有趣的页面设计。它还提供了大量详细的文档。 + +![Bootstrap documentation][16] + +Bootstrap 的 [GitHub][3] 仓库列出了超过 19000 个提交和 1100 个贡献者。它基于 MIT 许可证,所以(和这个列表中的所有框架一样)你也可以加入并贡献。 + +![Bootstrap GitHub][17] + +### PatternFly + +[PatternFly][18] 是由 Red Hat 开发的一个开源的(MIT 许可证)CSS 框架。PatternFly 采取了与 Bootstrap 不同的方法:Bootstrap 是为任何对创建一个漂亮网站感兴趣的人而设计的,而 PatternFly 主要针对企业级应用开发者,它提供的组件,如条形图、图表和导航,对于创建强大的、指标驱动的仪表盘非常有吸引力。事实上,Red Hat 在其产品(如 OpenShift)的设计中也使用了这个 CSS 框架。 + +![PatternFly homepage][19] + +除了静态 HTML 之外,PatternFly 还支持 ReactJS 框架,ReactJS 是 Facebook 开发的一个流行的 JavaScript 框架。 + +![PatternFly ReactJS support][20] + +PatternFly 有许多高级组件,如条形图、图表、[模态窗口][21]和布局等,适用于企业级应用。 + +![PatternFly chart component][22] + +PatternFly 的 [GitHub][4] 页面列出了超过 1050 个提交者和 44 个贡献者。PatternFly 得到了很多人的关注,欢迎大家踊跃贡献。 + +![PatternFly GitHub][23] + +### MDC Web + +凭借其大获成功的 Android 平台,谷歌以一个名为 [Material Design][24] 的概念制定了自己的标准设计准则。Material Design 标准旨在体现在所有谷歌的产品中,并且在 MIT 许可证下,这些标准也可以向大众和开放源代码。 + +![Material Design homepage][25] + +Material Design 有许多“用于创建用户界面的交互式构建块”的[组件][26]。这些按钮、卡片、背景等可用于创建网站或移动应用程序的任何类型的用户界面。 + +![Material Components webpage][27] + +维护人员为不同的平台提供了详尽的文档。 + +![Material Design documentation][28] + +还有分步教程,其中包含用于实现不同目标的练习。 + +![Material Design tutorial][29] + +Material 组件的 GitHub 页面承载了不同平台的版本库,包括用于网站开发的 [Material Web 组件(MDC Web)][5]。MDC Web 有超过 5700 个提交和 349 个贡献者。 + +![MDC Web GitHub][30] + +### Pure + +Bootstrap、Patternfly 和 MDC Web 都是非常强大的 CSS 框架,但是它们可能相当的笨重和复杂。如果你想要一个轻量级的 CSS 框架,它更接近于自己编写 CSS,但又能帮助你建立一个漂亮的网页,可以试试 [Pure.css][31]。Pure 是一个轻量级的 CSS 框架,它的体积很小。它是由 Yahoo 开发的,在 BSD 许可证下开源。 + +![Pure.css homepage][32] + +尽管体积小,但 Pure 提供了建立一个漂亮网页的很多必要的组件。 + +![Pure.css components][33] + +Pure 的 [GitHub][6] 页面显示它有超过 565 个提交和 59 个贡献者。 + +![Pure.css GitHub][34] + +### Foundation + +[Foundation][35] 号称是世界上最先进的响应式前端框架。它提供了先进的功能和教程,用于构建专业网站。 + +![Foundation homepage][36] + +该框架被许多公司、组织甚至政客[使用][37],并且有大量的文档可用。 + +![Foundation documentation][38] + +Foundation 的 [GitHub][7] 页面显示有近 17000 个提交和 1000 个贡献者。和这个列表中的大多数其他框架一样,它也是在 MIT 许可证下提供的。 + +![Foundation GitHub][39] + +### Bulma + +[Bulma][40] 是一个基于 Flexbox 的开源框架,在 MIT 许可证下提供。Bulma 是一个相当轻量级的框架,因为它只需要一个 CSS 文件。 + +![Bulma homepage][41] + +Bulma 有简洁明快的文档,让你可以很容易地选择你想要探索的主题。它也有很多的网页组件,你可以直接拿起来在设计中使用。 + +![Bulma documentation][42] + +Bulma 的 [GitHub][8] 页面列出了 1400 多个提交和 300 多个贡献者。 + +![Bulma GitHub][43] + +### Skeleton + +如果连 Pure 都觉得太重了,那么还有一个更轻量级的框架叫 [Skeleton][44]。Skeleton 库只有 400 行左右的长度,而且这个框架只提供了开始你的 CSS 框架之旅的基本组件。 + +![Skeleton homepage][45] + +尽管它很简单,但Skeleton提供了详细的文档,可以帮助你马上上手。 + +![Skeleton documentation][46] + +Skeleton 的 [GitHub][9] 列出了 167 个提交者和 22 个贡献者。然而,它不是很活跃,它的最后一次更新是在 2014 年,所以在使用之前可能需要一些维护。由于它是在 MIT 许可证下发布的,你可以自行维护。 + +![Skeleton GitHub][47] + +### Materialize + +[Materialize][48] 是一个基于 Google 的 Material Design 的响应式前端框架,带有由 Materialize 的贡献者开发的附加主题和组件。 + +![Materialize homepage][49] + +Materialize 的文档页面非常全面,而且相当容易理解。它的组件页面包括按钮、卡片、导航等等。 + +![Materialize documentation][50] + +Materialize 是 MIT 许可证下的开源项目,它的 [GitHub][10] 列出了超过 3800 个提交和 250 个贡献者。 + +![Materialize GitHub][51] + +### Bootflat + +[Bootflat][52] 是由 Twitter 的 Bootstrap 衍生出来的一个开源 CSS 框架。与 Bootstrap 相比, Bootflat 更简单,框架组件更轻量级。 + +![Bootflat homepage][53] + +Bootflat 的[文档][54]几乎像是受到了宜家的启发 —— 它显示的是每个组件的图片,没有太多的文字。 + +![Bootflat docs][55] + +Bootflat 是在 MIT 许可下提供的,其 [GitHub][11] 页面包括 159 个提交和 8 个贡献者。 + +![Bootflat GitHub][56] + +### 你应该选择哪个 CSS 框架? + +对于开源的 CSS 框架,你有很多选择,这取决于你想要的工具功能有多丰富或简单。就像所有的技术决定一样,没有任何一个正确的答案,只有在给定的时间和项目中才有正确的选择。 + +尝试一下其中的一些,看看要在下一个项目中使用哪个。另外,我有没有错过任何有趣的开源 CSS 框架?请在下面的评论中分享你的反馈和想法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/open-source-css-frameworks + +作者:[Bryant Son][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/brson +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://en.wikipedia.org/wiki/Cascading_Style_Sheets +[3]: https://github.com/twbs/bootstrap +[4]: https://github.com/patternfly/patternfly +[5]: https://github.com/material-components/material-components-web +[6]: https://github.com/pure-css/pure +[7]: https://github.com/foundation/foundation-sites +[8]: https://github.com/jgthms/bulma +[9]: https://github.com/dhg/Skeleton +[10]: https://github.com/Dogfalo/materialize +[11]: https://github.com/bootflat/bootflat.github.io +[12]: https://getbootstrap.com +[13]: https://opensource.com/sites/default/files/uploads/2_bootstrapscreenshot.jpg (Bootstrap homepage) +[14]: https://getbootstrap.com/docs/4.4/examples/ +[15]: https://opensource.com/sites/default/files/uploads/3_bootstrapsamples.jpg (Bootstrap examples) +[16]: https://opensource.com/sites/default/files/uploads/4_bootstrapdocs.jpg (Bootstrap documentation) +[17]: https://opensource.com/sites/default/files/uploads/5_bootstrapgithub.jpg (Bootstrap GitHub) +[18]: https://www.patternfly.org +[19]: https://opensource.com/sites/default/files/uploads/6_patternflyhomepage.jpg (PatternFly homepage) +[20]: https://opensource.com/sites/default/files/uploads/7_patternflyreactjs.jpg (PatternFly ReactJS support) +[21]: https://en.wikipedia.org/wiki/Modal_window +[22]: https://opensource.com/sites/default/files/uploads/8_patternflycomponents.jpg (PatternFly chart component) +[23]: https://opensource.com/sites/default/files/uploads/9_patternflygithub.jpg (PatternFly GitHub) +[24]: https://material.io +[25]: https://opensource.com/sites/default/files/uploads/10_materialhome.jpg (Material Design homepage) +[26]: https://material.io/components/ +[27]: https://opensource.com/sites/default/files/uploads/11_materialcomponents.jpg (Material Components webpage) +[28]: https://opensource.com/sites/default/files/uploads/12_materialdocs.jpg (Material Design documentation) +[29]: https://opensource.com/sites/default/files/uploads/13_materialtutorial.jpg (Material Design tutorial) +[30]: https://opensource.com/sites/default/files/uploads/15_materialgithub.jpg (MDC Web GitHub) +[31]: https://purecss.io +[32]: https://opensource.com/sites/default/files/uploads/16_purehome.jpg (Pure.css homepage) +[33]: https://opensource.com/sites/default/files/uploads/17_purecomponents.jpg (Pure.css components) +[34]: https://opensource.com/sites/default/files/uploads/18_puregithub.jpg (Pure.css GitHub) +[35]: https://get.foundation +[36]: https://opensource.com/sites/default/files/uploads/19_foundationhome.jpg (Foundation homepage) +[37]: https://zurb.com/responsive +[38]: https://opensource.com/sites/default/files/uploads/21_foundationdocs.jpg (Foundation documentation) +[39]: https://opensource.com/sites/default/files/uploads/22_foundationgithub.jpg (Foundation GitHub) +[40]: https://bulma.io +[41]: https://opensource.com/sites/default/files/uploads/23_bulmahome.jpg (Bulma homepage) +[42]: https://opensource.com/sites/default/files/uploads/24_bulmadoc.jpg (Bulma documentation) +[43]: https://opensource.com/sites/default/files/uploads/25_bulmagithub.jpg (Bulma GitHub) +[44]: http://getskeleton.com +[45]: https://opensource.com/sites/default/files/uploads/26_skeletonhome.jpg (Skeleton homepage) +[46]: https://opensource.com/sites/default/files/uploads/27_skeletondocs.jpg (Skeleton documentation) +[47]: https://opensource.com/sites/default/files/uploads/28_skeletongithub.jpg (Skeleton GitHub) +[48]: https://materializecss.com +[49]: https://opensource.com/sites/default/files/uploads/29_materializehome.jpg (Materialize homepage) +[50]: https://opensource.com/sites/default/files/uploads/30_materializedocs.jpg (Materialize documentation) +[51]: https://opensource.com/sites/default/files/uploads/31_materializegithub.jpg (Materialize GitHub) +[52]: http://bootflat.github.io +[53]: https://opensource.com/sites/default/files/uploads/32_bootflathome.jpg (Bootflat homepage) +[54]: http://bootflat.github.io/documentation.html +[55]: https://opensource.com/sites/default/files/uploads/33_bootflatdocs.jpg (Bootflat docs) +[56]: https://opensource.com/sites/default/files/uploads/34_bootflatgithub.jpg (Bootflat GitHub) From 70e1f934bfc672717e0e6c45d6920889c5c5bf37 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Mon, 18 May 2020 00:35:05 +0800 Subject: [PATCH 0729/1809] APL --- ...23 How to create a personal file server with SSH on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200323 How to create a personal file server with SSH on Linux.md b/sources/tech/20200323 How to create a personal file server with SSH on Linux.md index f758123bb1..5ccabcab09 100644 --- a/sources/tech/20200323 How to create a personal file server with SSH on Linux.md +++ b/sources/tech/20200323 How to create a personal file server with SSH on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f859e549d69db44bf1f87efeaff5fd738d71cedd Mon Sep 17 00:00:00 2001 From: Acceleratorrrr <542383480@qq.com> Date: Sun, 17 May 2020 21:58:31 +0100 Subject: [PATCH 0730/1809] translated/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md --- ... From 8-bit enthusiast to Unix sysadmin.md | 77 ------------------- ... From 8-bit enthusiast to Unix sysadmin.md | 76 ++++++++++++++++++ 2 files changed, 76 insertions(+), 77 deletions(-) delete mode 100644 sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md create mode 100644 translated/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md diff --git a/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md b/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md deleted file mode 100644 index 569981ebea..0000000000 --- a/sources/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (My Linux Story: From 8-bit enthusiast to Unix sysadmin) -[#]: via: (https://opensource.com/article/20/4/linux-story) -[#]: author: (James Farrell https://opensource.com/users/jamesf) - -My Linux Story: From 8-bit enthusiast to Unix sysadmin -====== -How my early interest in computers got me hooked on a career as a -sysadmin and Linux fan. -![Person typing on a 1980's computer][1] - -It all started in the mid-1980s with an [Apple ][c][2] that my parents purchased for our family. Although I enjoyed playing games, I quickly became fascinated with BASIC programming and how useful it could be for work and fun. This was an era when computers were viewed as little more than typewriters, so people with "advanced computer skills" could easily use them to their advantage. - -One example was using BASIC and a dot matrix printer to auto-generate punishment assignments. When I was assigned to write out 200 times some apologetic statements, I asked my teacher if it could be typed out. On confirmation, I wrote a 5 line BASIC program to generate it for me. Another example of subtle trickery was using non-WYSIWYG word processors, such as AppleWorks for micro-manipulation of fonts, line spacing, and margins to "stretch" term papers out to the required length. - -My obsession with computers quickly lead to an Apple ][gs with a RAM drive card and an x86 PC co-processor card. Modems and BBSs were getting hot, and having a dual-hardware system like this gave me all sorts of options for software. However, modem speeds of 2400bps put a real damper on getting anything more than a few KBs of fun downloads per day. I stuck with Apple as a hobby for some time, but that was soon to change. - -### Venturing into Unix - -My undergraduate program was BS in Computer Information Systems (CIS) and my graduate degree was MS in Computer Science. My undergraduate education program put me mostly into PCs and a little into timeshare mainframes. The real fun began in my graduate programs, where dial-in access to Unix machines with internet connections opened a whole new world of exploration. Although I still used my dual-processor ][gs for modem work and writing and printing papers, Unix systems really grabbed my attention with their general-access Telnet-based games, FTP archives, online email, and C programming. Gopher was popular and growing with people like me who were bound to plain terminal interfaces. - -My graduate program took a fateful turn for the better when I was assigned to the academic computing department, which was charged with running computer services for the school. The students had access to [Ultrix][3]-based systems with X Window terminals. Most were grayscale, as color processing was then a CPU intensive task and really affected system performance. The few color systems were nice, but those machines just dragged. - -This was a really fun time for me, as I was given root access to systems and assigned to system and network maintenance. I had some excellent mentors, and this strongly influenced my decision to get into system administration rather than programming (although I still really love programming to this day). - -### From Unix to Linux - -Scarcity is the mother of invention, and we students often got creative when we had to share the scant resources of the school's computer systems. We had three to five times more students than we had Ultrix workstations, so finding resources (especially at project delivery time) was often a challenge. There was a bank of 56k [PPP][4] modems available for remote system access when graphical displays were not needed. However, finding a machine with spare resources and sharing the system for source compilation often resulted in slow progress. Like most, I found working at night often helped, but I needed something else to let me iterate more quickly. - -Then one of the school's sysadmins suggested I check out a Unix system that was freely available. This was Linux, made available as 3.5" floppy images. Given our school's blazing fast T1 line, it was easy for me to search newsgroups and other sources to learn how to download it. It was all 32-bit Intel PC-based, a class of equipment that I did not own. - -Luckily, my work at the school gave me access to junk piles of old computers, so the wheels started turning. - -I found enough discarded PCs to build a solid 80386 PC with some decent RAM (I am sure well under 1GB), a workable graphic display, a thin-net (coax) Ethernet card, and a hard disk. The images I had were Linux kernel 0.98, and I don't recall it being part of an official distribution (it might have been SLS). What I do remember is that it came on a series of floppy images—the first booted the kernel and a minimal installer, next it formatted the drive, and then it asked for each successive floppy image to install the core GNU utilities. After the core was installed and the system bootable, you would download and install other package images, like compilers and such. - -This was a serious boon to me in my academic career. With no X Window server display running, this PC seriously outperformed the Ultrix workstations I had access to at school. I was allowed to connect this machine to the academic network, mount the school's student Network File System (NFS) shares, and access the internet directly. Since my graduate program used [GCC][5] (and sometimes Perl 4) for most student work, I could do my development work locally. This gave me exclusive access to a key resource that enabled me to iterate more quickly on my projects. - -All was not perfect, however. The hardware was a tiny bit unstable (likely why it was discarded), but I could deal with that. What really got me was how much Linux and Ultrix differed at the OS and system library level. I began to appreciate what it meant to port software to other platforms; I was free to develop wherever I wanted, but I had to deliver my projects as Ultrix compiled binaries. The C code that ran perfectly on one platform would crash on the other. This was very frustrating, but probably my rudest awakening was early Linux's handling of null-pointer dereferencing. Linux seemed happy to pass over these as a virtual no-op, but Ultrix promptly dumped core on [SIGSEGV][6]. This was quite a thing to find out when my first port to the target platform happened days before my project was due! This also made my exploration of C++ quite challenging, as my careless use of malloc()/free() along with automatic [constructor and destructor][7] processing peppered my projects with null pointer bombs all over the place. - -Toward the end of my graduate program, I upgraded to a complete beast of a workstation—an Intel 486DX2 66MHz with SCSI hard drives, a CD-ROM drive, a 1024x768 RGB monitor, and a 16550 UART serial card perfectly matched to my new US Robotics V.Everything modem. It could dual-boot Windows and Linux, but more importantly, the graphics card and processor allowed a much more pleasant (and faster) development environment. The old 386 was still in service back at the school, but most of my heavy work and hacking now happened at home. - -Similar to [Mike Harris' story][8] about Linux in the '90s, I really got into those CD bundles that were popular at the time. There was a new Micro Center computer store close to where I lived, and it was a goldmine of hobby PC parts, phenomenal technical books, and every conceivable Linux (and free Unix) CD archive. I remember [Yggdrasil][9] and [Slackware][10] being some of my favorite distributions. What was really incredible was the enormous size of CD storage—650MB! This was an essential resource for getting access to software. Yes, you could download the bits at 56k, but that was quite limiting. Not to mention the fact that most people could not afford to archive that much idle data for later perusal. - -### And on to today - -This is what kicked off my more than 25 years of system administration and open source software fun. Linux has been an important part of both my career and personal development. Nowadays, I am still heavily into Linux (mostly CentOS, RedHat, and Ubuntu), but often have fun with the likes of [FreeBSD][11] and other cool open source offerings. - -My forays into Linux led me to Opensource.com, where I hope to give back a little and help bootstrap new generations of hands-on computer fun. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/linux-story - -作者:[James Farrell][a] -选题:[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/jamesf -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) -[2]: https://en.wikipedia.org/wiki/Apple_IIc -[3]: https://en.wikipedia.org/wiki/Ultrix -[4]: https://en.wikipedia.org/wiki/Point-to-Point_Protocol -[5]: https://en.wikipedia.org/wiki/GNU_Compiler_Collection -[6]: https://en.wikipedia.org/wiki/Segmentation_fault -[7]: https://www.tutorialspoint.com/cplusplus/cpp_constructor_destructor.htm -[8]: https://opensource.com/article/19/11/learning-linux-90s -[9]: https://en.wikipedia.org/wiki/Yggdrasil_Linux/GNU/X -[10]: http://slackware.com -[11]: https://www.freebsd.org/ diff --git a/translated/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md b/translated/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md new file mode 100644 index 0000000000..75f6ba217b --- /dev/null +++ b/translated/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: (Acceleratorrrr) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (My Linux Story: From 8-bit enthusiast to Unix sysadmin) +[#]: via: (https://opensource.com/article/20/4/linux-story) +[#]: author: (James Farrell https://opensource.com/users/jamesf) + +我的 Linux 故事:从8比特爱好者到 Unix 系统管理员 +====== +我是如何从一个电脑爱好者成为职业系统管理员和 Linux 粉丝的 +![Person typing on a 1980's computer][1] + +故事得从1980年中期爸妈给家里购买[苹果 \]\[c][2] 开始。尽管很喜欢打游戏,但我还是很快被实用又好玩的 BASIC 编程迷住了。那个年代的人们还是把电脑当作打字机对待,所以懂电脑的人可以轻松使用他们的魔法。 + +用 BASIC 和点阵打印机自动生成惩罚作业来举个例子。被罚写两百遍道歉时,我问老师我可不可以打字代替手写。经过同意后,我写了5行 BASIC 语句来自动生成作业。另外一个小技巧是用非可视化文本编辑器,比如用 AppleWorks 微调字体,行距和边距,把学期报告扩充到要求的长度。 + +对电脑对喜爱很快让我接触到有 RAM 驱动和 x86 协处理器的苹果 ][gs。调制解调器和网络论坛刚开始火起来,它的双核处理器系统让我可以游刃有余的选择软件。但是由于调制解调器2400比特每秒的速度限制,下载任何超过几 KB 的东西都需要一天。我玩了不久之后就腻了。 + +### 探索 Unix + +我的本科专业是计算机信息系统,硕士专业是计算机科学。本科教育主要是学习硬件和一些分时系统。研究生的时候才开始真正有意思起来,拨号上网简直打开了新世界的大门。尽管我依然用着我的双核 ][gs 来进行调制解调还有写写作业,不过Unix 系统让我真的热爱上方便的远程登录类游戏,文件传输协议,在线邮箱和 C 语言。当时 Gopher 非常受欢迎,特别是在我们这群终端用户中。 + +被分到学院计算机部门是我本科命运般的转折点,这个部门主管学校的计算机服务。学生们必须要用 X 视窗终端来登陆 [Ultrix][3] 系统。大部分都是黑白界面,彩色处理在当时非常占 CPU 也很影响系统性能。也有一些做的不错的彩色系统,但是这些机器都很慢。 + +我很喜欢那个时候,我有系统管理员权限而且工作是维护系统和网络。有一些出色的同事教我,他们对我选择从事系统管理员而不是程序员起了关键作用(尽管我至今热爱编程)。 + +### 从 Unix 到 Linux + +稀缺是创造之母,当需要分享匮乏的学校电脑系统资源的时候,我们经常突发奇想。需要用电脑的学生是 Ultrix 工作站承受量的四到五倍,所以很难找到资源(特别是要交项目的时候)。虽然有一堆56k点对点协议的调制解调器处理远程系统访问,而且那时还不需要图像显示。但是发现一个有空余资源的机器然后分享出来的过程依然十分缓慢。和大部分人一样,我发现晚上加班很有效率,但我需要另外一些东西让我的项目迭代快一点。 + +后来学校但一个系统管理员建议我了解一个免费的 Unix 系统。那就是 Linux,被装在一个 3.5 英寸的软盘里。多亏我们学校超快的 T1 载波,让我很方便的查询到这个新群体和一些下载教程。这是一个我之前不曾接触过的32位网络计算机工具。 + +幸运的是,我的工作让我有机会使用一些淘汰的旧电脑,所以命运的齿轮又开始旋转起来。 + +我用一些报废的主机组装了一个可靠的,有足够 RAM 的80386台机(我确定不到 1GB),它有一个能用的显卡,一个细缆(同轴)以太网卡和一个硬盘。镜像用的是 Linux 内核0.98,不记得它是不是正式发行版的一部分了(可能是 SLS)。可我还能记得安装的一系列过程 - 首先启动内核和安装程序,然后格式化硬盘,接着要求每一个软盘安装 GNU 工具核心。核心装好之后,系统就可以启动了,你可以下载和安装其他的镜像包,比如编译器之类的。 + +这是我学术道路上巨大的福利。没有了 X 视窗显示,这台电脑性能比学校的 Ultrix 工作站强很多。学校允许我把这台机器连到校园网络,连接到学生网络文件系统,并且能直接接入内网。因为我研究生时主要用 [GNU 编译器套装][5] (还有 Perl 4)写作业,所以我可以进行本地开发。我可以使用这台主机作为独占资源来让我的项目更快迭代。 + +但是,这个方案不是完美的。硬件有时会有点不稳定(这可能就是放弃使用它的原因),但我都能搞定。操作系统和系统自带库层面才真正让我感受到 Linux 和 Ultrix 的不同。我开始领会到移植软件到其他操作系统的意义,我可以开发任何我想要的软件,但是我必须要把项目转换成 Ultrix 编译的二进制文件来传输。在一个平台上能运行的 C 语言可能在另一个平台出错。这让我非常沮丧,但是我可能本能的察觉到了早期 Linux 废弃空指针的方法。Linux 倾向于把它作为无操作处理,但是 Ultrix 会立即触发核心转储和段错误 [SIGSEGV][6]。这是正好在要交作业的几天之前,我第一次程序移植时的重大发现。这同时对我研究 C++ 造成了一些麻烦,因为我不小心使用同时使用 malloc()/free() 和自动[构造函数和析构函数]处理项目,结果空指针被炸得到处都是。 + +研究生快结束的时候,我用一颗英特尔 486DX2 66赫兹芯片和一块小型计算机系统接口硬盘,一块光驱和 一个1024x768 RGB 显示器将主机升级成了性能野兽。还把一个 16550 通用异步收发器完美组合到新的 US Robotics V.Everything 牌的调制解调器上。它可以跑 Windows 和 Linux 双系统,但最重要的是显卡和 CPU 的速度让开发环境幸福感倍增。那台旧的386依然在学校服役,不过我主要的工作都转移到了家里。 + +和 [麦克.哈里斯的故事][8] 里关于90年代的 Linux 类似,我真的对当时流行的光驱很着迷。我住的地方附近有小型电脑器材店,这个宝库充满了电脑配件,高级专业书籍和你能想到的任何 Linux (还有免费的 Unix)CD。我还记得[Yggdrasil][9]和[Slackware][10]是我最喜欢的发行版之一。更惊人的是 CD 650MB 巨大的存储量!使它成为软件必不可少载体。是的,你可以用56k 的速度下载,但是真的很慢。更别提大部分人负担不起将这么多闲置的数据存档供以后使用。 + +### 直到今天 + +就是这些开启了我长达25年的系统管理员和开源软件粉丝生涯。Linux 是我事业和个人开发中重要的一部分。最近我依旧醉心于 Linux (主要是 CentOS, RedHat, and Ubuntu),但也经常从[FreeBSD][11]和其他炫酷开源系统中体验乐趣。 + +Linux 领导了我涉足 Opensource.com,我希望能回馈社区同时为下一代电脑出一份力。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/linux-story + +作者:[James Farrell][a] +选题:[lujun9972][b] +译者:[Accelerator](https://github.com/Acceleratorrrr) +校对:[校对者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/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) +[2]: https://en.wikipedia.org/wiki/Apple_IIc +[3]: https://en.wikipedia.org/wiki/Ultrix +[4]: https://en.wikipedia.org/wiki/Point-to-Point_Protocol +[5]: https://en.wikipedia.org/wiki/GNU_Compiler_Collection +[6]: https://en.wikipedia.org/wiki/Segmentation_fault +[7]: https://www.tutorialspoint.com/cplusplus/cpp_constructor_destructor.htm +[8]: https://opensource.com/article/19/11/learning-linux-90s +[9]: https://en.wikipedia.org/wiki/Yggdrasil_Linux/GNU/X +[10]: http://slackware.com +[11]: https://www.freebsd.org/ From abffa4a760f6534f50768eae68f61d472cfed02c Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 18 May 2020 08:52:33 +0800 Subject: [PATCH 0731/1809] translated --- ...ew projects to try in COPR for May 2020.md | 108 ------------------ 1 file changed, 108 deletions(-) delete mode 100644 sources/tech/20200504 4 cool new projects to try in COPR for May 2020.md diff --git a/sources/tech/20200504 4 cool new projects to try in COPR for May 2020.md b/sources/tech/20200504 4 cool new projects to try in COPR for May 2020.md deleted file mode 100644 index f9db0a9f81..0000000000 --- a/sources/tech/20200504 4 cool new projects to try in COPR for May 2020.md +++ /dev/null @@ -1,108 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 cool new projects to try in COPR for May 2020) -[#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2020/) -[#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) - -4 cool new projects to try in COPR for May 2020 -====== - -![][1] - -COPR is a [collection][2] of personal repositories for software that isn’t carried in Fedora. Some software doesn’t conform to standards that allow easy packaging. Or it may not meet other Fedora standards, despite being free and open source. COPR can offer these projects outside the Fedora set of packages. Software in COPR isn’t supported by Fedora infrastructure or signed by the project. However, it can be a neat way to try new or experimental software. - -This article presents a few new and interesting projects in COPR. If you’re new to using COPR, see the [COPR User Documentation][3] for how to get started. - -### Ytop - -[Ytop][4] is a command-line system monitor similar to _htop_. The main difference between them is that _ytop_, on top of showing processes and their CPU and memory usage, shows graphs of system CPU, memory, and network usage over time. Additionally, _ytop_ shows disk usage and temperatures of the machine. Finally, _ytop_ supports multiple color schemes as well as an option to create new ones. - -![][5] - -#### Installation instructions - -The [repo][6] currently provides _ytop_ for Fedora 30, 31, 32, and Rawhide, as well as EPEL 7. To install _ytop_, use these commands [with _sudo_][7]: - -``` -sudo dnf copr enable atim/ytop -sudo dnf install ytop -``` - -### Ctop - -[Ctop][8] is yet another command-line system monitor. However, unlike _htop_ and _ytop_, _ctop_ focuses on showing resource usage of containers. _Ctop_ shows both an overview of CPU, memory, network and disk usage of all containers running on your machine, and more comprehensive information about a single container, including graphs of resource usage over time. Currently, _ctop_ has support for Docker and runc containers. - -![][9] - -#### Installation instructions - -The [repo][10] currently provides _ctop_ for Fedora 31, 32 and Rawhide, EPEL 7, as well as for other distributions. To install _ctop_, use these commands: - -``` -sudo dnf copr enable fuhrmann/ctop -sudo dnf install ctop -``` - -### Shortwave - -[Shortwave][11] is a program for listening to radio stations. Shortwave uses a community database of radio stations [www.radio-browser.info][12]. In this database, you can discover or search for radio stations, add them to your library, and listen to them. Additionally, Shortwave provides information about currently playing song and can record the songs as well. - -![][13] - -#### Installation instructions - -The [repo][14] currently provides Shortwave for Fedora 31, 32, and Rawhide. To install Shortwave, use these commands: - -``` -sudo dnf copr enable atim/shortwave -sudo dnf install shortwave -``` - -### Setzer - -[Setzer][15] is a LaTeX editor that can build pdf documents and view them as well. It provides templates for various types of documents, such as articles or presentation slides. Additionally, Setzer has buttons for a lot of special symbols, math symbols and greek letters. - -![][16] - -#### Installation instructions - -The [repo][17] currently provides Setzer for Fedora 30, 31, 32, and Rawhide. To install Setzer, use these commands: - -``` -sudo dnf copr enable lyessaadi/setzer -sudo dnf install setzer -``` - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2020/ - -作者:[Dominik Turecek][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/dturecek/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg -[2]: https://copr.fedorainfracloud.org/ -[3]: https://docs.pagure.org/copr.copr/user_documentation.html# -[4]: https://github.com/cjbassi/ytop -[5]: https://fedoramagazine.org/wp-content/uploads/2020/04/ytop.png -[6]: https://copr.fedorainfracloud.org/coprs/atim/ytop/ -[7]: https://fedoramagazine.org/howto-use-sudo/ -[8]: https://github.com/bcicen/ctop -[9]: https://fedoramagazine.org/wp-content/uploads/2020/04/ctop.png -[10]: https://copr.fedorainfracloud.org/coprs/fuhrmann/ctop/ -[11]: https://github.com/ranfdev/shortwave -[12]: http://www.radio-browser.info/gui/#!/ -[13]: https://fedoramagazine.org/wp-content/uploads/2020/04/shortwave.png -[14]: https://copr.fedorainfracloud.org/coprs/atim/shortwave/ -[15]: https://www.cvfosammmm.org/setzer/ -[16]: https://fedoramagazine.org/wp-content/uploads/2020/04/setzer.png -[17]: https://copr.fedorainfracloud.org/coprs/lyessaadi/setzer/ From 9c52171d8a60f01dfbe51c8e5de5a18bc4a7b590 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 18 May 2020 08:53:27 +0800 Subject: [PATCH 0732/1809] translated --- ...ew projects to try in COPR for May 2020.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 translated/tech/20200504 4 cool new projects to try in COPR for May 2020.md diff --git a/translated/tech/20200504 4 cool new projects to try in COPR for May 2020.md b/translated/tech/20200504 4 cool new projects to try in COPR for May 2020.md new file mode 100644 index 0000000000..12486623e9 --- /dev/null +++ b/translated/tech/20200504 4 cool new projects to try in COPR for May 2020.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 cool new projects to try in COPR for May 2020) +[#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2020/) +[#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) + +COPR 仓库中 4 个很酷的新项目(2020.05) +====== + +![][1] + +COPR 是个人软件仓库[集合][2],它不在 Fedora 中。这是因为某些软件不符合轻松打包的标准;或者它可能不符合其他 Fedora 标准,尽管它是自由而开源的。COPR 可以在 Fedora 套件之外提供这些项目。COPR 中的软件不受 Fedora 基础设施的支持,或者是由项目自己背书的。但是,这是一种尝试新的或实验性的软件的一种巧妙的方式。 + +本文介绍了 COPR 中一些有趣的新项目。如果你第一次使用 COPR,请参阅 [COPR 用户文档][3]。 + +### Ytop + +[ytop][4] 是类似于 _htop_ 的命令行系统监视器。它们之间的主要区别是 _ytop_ 在显示进程及 CPU 和内存使用率的顶部,还显示了系统 CPU、内存和网络使用率随时间变化的图表。此外,_ytop_ 显示磁盘使用情况和计算机温度。最后,_ytop_ 支持多种配色方案以及创建新配色的选项。 + +![][5] + +#### 安装说明 + +[仓库][6]当前为 Fedora 30、31、32 和 Rawhide 以及 EPEL 7 提供 _ytop_。要安装 _ytop_,请[带上 _sudo_][7] 使用以下命令: + +``` +sudo dnf copr enable atim/ytop +sudo dnf install ytop +``` + +### Ctop + +[ctop][8] 是另一个命令行系统监视器。但是,与 _htop_ 和 _ytop_ 不同,_ctop_ 专注于显示容器的资源使用情况。_ctop_ 同时显示计算机上运行的所有容器的CPU、内存、网络和磁盘使用情况的概要,以及单个容器的更全面的信息,包括一段时间内资源使用情况的图表。当前,_ctop_ 支持 Docker 和 runc 容器。 + +![][9] + +#### 安装说明 + +[仓库][10]当前为 Fedora 31、32 和 Rawhide 以及 EPEL 7 还有其他发行版提供安装包。要安装 _ctop_,请使用以下命令: + +``` +sudo dnf copr enable fuhrmann/ctop +sudo dnf install ctop +``` + +### Shortwave + +[shortwave][11] 是用于收听广播电台的程序。shortwave 使用广播电台的社区数据库 [www.radio-browser.info][12]。在此数据库中,你可以发现或搜索广播电台,将它们添加到库中,然后收听。此外,shortwave 还提供有关当前播放歌曲的信息,并且还可以记录这些歌曲。 + +![][13] + +#### 安装说明 + +[仓库][14] 当前为 Fedora 31、32 和 Rawhide 提供 shortwave。要安装 shortwave,请使用以下命令: + +``` +sudo dnf copr enable atim/shortwave +sudo dnf install shortwave +``` + +### Setzer + +[setzer][15] 是 LaTeX 编辑器,它可以构建 pdf 文档并查看它们。它提供了各种类型文档(例如文章或幻灯片)的模板。此外,setzer 还有许多特殊符号,数学符号和希腊字母的按钮。 + +![][16] + +#### 安装说明 + +[仓库][17] 当前为Fedora 30、31、32 和 Rawhide 提供 setzer。要安装 setzer,请使用以下命令: + +``` +sudo dnf copr enable lyessaadi/setzer +sudo dnf install setzer +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2020/ + +作者:[Dominik Turecek][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/dturecek/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg +[2]: https://copr.fedorainfracloud.org/ +[3]: https://docs.pagure.org/copr.copr/user_documentation.html# +[4]: https://github.com/cjbassi/ytop +[5]: https://fedoramagazine.org/wp-content/uploads/2020/04/ytop.png +[6]: https://copr.fedorainfracloud.org/coprs/atim/ytop/ +[7]: https://fedoramagazine.org/howto-use-sudo/ +[8]: https://github.com/bcicen/ctop +[9]: https://fedoramagazine.org/wp-content/uploads/2020/04/ctop.png +[10]: https://copr.fedorainfracloud.org/coprs/fuhrmann/ctop/ +[11]: https://github.com/ranfdev/shortwave +[12]: http://www.radio-browser.info/gui/#!/ +[13]: https://fedoramagazine.org/wp-content/uploads/2020/04/shortwave.png +[14]: https://copr.fedorainfracloud.org/coprs/atim/shortwave/ +[15]: https://www.cvfosammmm.org/setzer/ +[16]: https://fedoramagazine.org/wp-content/uploads/2020/04/setzer.png +[17]: https://copr.fedorainfracloud.org/coprs/lyessaadi/setzer/ \ No newline at end of file From ef0549578d51c854f86bd3cb0b7205426dc76b62 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 18 May 2020 08:58:09 +0800 Subject: [PATCH 0733/1809] translating --- .../tech/20200501 How to Handle Automatic Updates in Ubuntu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200501 How to Handle Automatic Updates in Ubuntu.md b/sources/tech/20200501 How to Handle Automatic Updates in Ubuntu.md index b62af6da74..7a973664ce 100644 --- a/sources/tech/20200501 How to Handle Automatic Updates in Ubuntu.md +++ b/sources/tech/20200501 How to Handle Automatic Updates in Ubuntu.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6bb18e06b06e5cb84ed8af9be74311daa8c942b9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 18 May 2020 09:50:02 +0800 Subject: [PATCH 0734/1809] PRF @wxy --- ...frameworks for frontend web development.md | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/translated/tech/20200413 9 open source CSS frameworks for frontend web development.md b/translated/tech/20200413 9 open source CSS frameworks for frontend web development.md index 115b1aa911..539b361992 100644 --- a/translated/tech/20200413 9 open source CSS frameworks for frontend web development.md +++ b/translated/tech/20200413 9 open source CSS frameworks for frontend web development.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (9 open source CSS frameworks for frontend web development) @@ -9,11 +9,12 @@ 9 个用于前端 Web 开发的开源 CSS 框架 ====== + > 探索开源 CSS 框架,找到适合你的项目的框架。 -![Digital creative of a browser on the internet][1] +![](https://img.linux.net.cn/data/attachment/album/202005/18/094922of81rqfiei8x78xi.jpg) -当大多数人想到 Web 开发时,通常会想到 HTML 或 JavaScript。他们通常会忘记对网站的欣赏能力有更大影响的技术:[级联样式表][2]cascading style sheets(简称CSS)。据维基百科的说法,CSS 既是任何网页中最重要的部分,也是最常被遗忘的部分,尽管它是万维网的三大基石技术之一。 +当大多数人想到 Web 开发时,通常会想到 HTML 或 JavaScript。他们通常会忘记对网站的欣赏能力有更大影响的技术:[级联样式表][2]cascading style sheets(简称 CSS)。据维基百科的说法,CSS 既是网页中最重要的部分,也是最常被遗忘的部分,尽管它是万维网的三大基石技术之一。 本文将探讨九种流行的、强大的、开源的框架,是这些框架让构建漂亮的网站前端的 CSS 开发变得简单明了。 @@ -21,16 +22,14 @@ ---|---|--- [Bootstrap][3] | 最流行的 CSS 框架,来自 Twitter | MIT [PatternFly][4] | 开源框架,来自 Red Hat | MIT -[MDC Web][5] | 开源框架;来自 Google | MIT -[Pure][6] | 开源框架;来自 Yahoo | BSD -[Foundation][7] | 前端框架了;来自 Zurb 基金会 | MIT +[MDC Web][5] | Material Design 组件开源框架,来自 Google | MIT +[Pure][6] | 开源框架,来自 Yahoo | BSD +[Foundation][7] | 前端框架,来自 Zurb 基金会 | MIT [Bulma][8] | 现代 CSS 框架,基于 Flexbox | MIT [Skeleton][9] | 轻量级 CSS 框架 | MIT [Materialize][10] | 基于 Material Design 的 CSS 框架 | MIT [Bootflat][11] | 开源 Flat UI 工具,基于 Bootstrap 3.3.0 | MIT -如果你更愿意跟着我一起探索这段直播,你可以看我的视频。  - ### Bootstrap [Bootstrap][2] 无疑是最流行的 CSS 框架,它是所有前端 Web 设计的开端。Bootstrap 由 Twitter 开发,提供了可用性、功能性和可扩展性。 @@ -41,11 +40,11 @@ Bootstrap 还提供了大量的[例子][14]来帮助你入门。 ![Bootstrap examples][15] -使用 Bootstrap,你可以将不同的组件和布局拼接在一起,创造出一个有趣的页面设计。它还提供了大量详细的文档。 +使用 Bootstrap,你可以将不同的组件和布局拼接在一起,创造出有趣的页面设计。它还提供了大量详细的文档。 ![Bootstrap documentation][16] -Bootstrap 的 [GitHub][3] 仓库列出了超过 19000 个提交和 1100 个贡献者。它基于 MIT 许可证,所以(和这个列表中的所有框架一样)你也可以加入并贡献。 +Bootstrap 的 [GitHub][3] 仓库有超过 19000 个提交和 1100 个贡献者。它基于 MIT 许可证,所以(和这个列表中的所有框架一样)你也可以加入并贡献。 ![Bootstrap GitHub][17] @@ -63,13 +62,13 @@ PatternFly 有许多高级组件,如条形图、图表、[模态窗口][21]和 ![PatternFly chart component][22] -PatternFly 的 [GitHub][4] 页面列出了超过 1050 个提交者和 44 个贡献者。PatternFly 得到了很多人的关注,欢迎大家踊跃贡献。 +PatternFly 的 [GitHub][4] 页面列出了超过 1050 个提交和 44 个贡献者。PatternFly 得到了很多人的关注,欢迎大家踊跃贡献。 ![PatternFly GitHub][23] ### MDC Web -凭借其大获成功的 Android 平台,谷歌以一个名为 [Material Design][24] 的概念制定了自己的标准设计准则。Material Design 标准旨在体现在所有谷歌的产品中,并且在 MIT 许可证下,这些标准也可以向大众和开放源代码。 +凭借其大获成功的安卓平台,谷歌以一个名为 [Material Design][24] 的概念制定了自己的标准设计准则。Material Design 标准旨在体现在所有谷歌的产品中,这些标准也可以面向大众,并且在 MIT 许可证下开源。 ![Material Design homepage][25] @@ -85,7 +84,7 @@ Material Design 有许多“用于创建用户界面的交互式构建块”的[ ![Material Design tutorial][29] -Material 组件的 GitHub 页面承载了不同平台的版本库,包括用于网站开发的 [Material Web 组件(MDC Web)][5]。MDC Web 有超过 5700 个提交和 349 个贡献者。 +Material 组件的 GitHub 页面承载了面向不同平台的存储库,包括用于网站开发的 [Material Web 组件(MDC Web)][5]。MDC Web 有超过 5700 个提交和 349 个贡献者。 ![MDC Web GitHub][30] @@ -123,7 +122,7 @@ Foundation 的 [GitHub][7] 页面显示有近 17000 个提交和 1000 个贡献 ![Bulma homepage][41] -Bulma 有简洁明快的文档,让你可以很容易地选择你想要探索的主题。它也有很多的网页组件,你可以直接拿起来在设计中使用。 +Bulma 有简洁明快的文档,让你可以很容易地选择你想要探索的主题。它也有很多网页组件,你可以直接拿起来在设计中使用。 ![Bulma documentation][42] @@ -133,15 +132,15 @@ Bulma 的 [GitHub][8] 页面列出了 1400 多个提交和 300 多个贡献者 ### Skeleton -如果连 Pure 都觉得太重了,那么还有一个更轻量级的框架叫 [Skeleton][44]。Skeleton 库只有 400 行左右的长度,而且这个框架只提供了开始你的 CSS 框架之旅的基本组件。 +如果连 Pure 都觉得太重了,那么还有一个叫 [Skeleton][44] 的更轻量级框架。Skeleton 库只有 400 行左右的长度,而且这个框架只提供了开始你的 CSS 框架之旅的基本组件。 ![Skeleton homepage][45] -尽管它很简单,但Skeleton提供了详细的文档,可以帮助你马上上手。 +尽管它很简单,但 Skeleton 提供了详细的文档,可以帮助你马上上手。 ![Skeleton documentation][46] -Skeleton 的 [GitHub][9] 列出了 167 个提交者和 22 个贡献者。然而,它不是很活跃,它的最后一次更新是在 2014 年,所以在使用之前可能需要一些维护。由于它是在 MIT 许可证下发布的,你可以自行维护。 +Skeleton 的 [GitHub][9] 列出了 167 个提交和 22 个贡献者。然而,它不是很活跃,它的最后一次更新是在 2014 年,所以在使用之前可能需要一些维护。由于它是在 MIT 许可证下发布的,你可以自行维护。 ![Skeleton GitHub][47] @@ -169,13 +168,13 @@ Bootflat 的[文档][54]几乎像是受到了宜家的启发 —— 它显示的 ![Bootflat docs][55] -Bootflat 是在 MIT 许可下提供的,其 [GitHub][11] 页面包括 159 个提交和 8 个贡献者。 +Bootflat 是在 MIT 许可证下提供的,其 [GitHub][11] 页面包括 159 个提交和 8 个贡献者。 ![Bootflat GitHub][56] ### 你应该选择哪个 CSS 框架? -对于开源的 CSS 框架,你有很多选择,这取决于你想要的工具功能有多丰富或简单。就像所有的技术决定一样,没有任何一个正确的答案,只有在给定的时间和项目中才有正确的选择。 +对于开源的 CSS 框架,你有很多选择,这取决于你想要的工具功能有多丰富或简单。就像所有的技术决定一样,没有一个正确的答案,只有在给定的时间和项目中才有正确的选择。 尝试一下其中的一些,看看要在下一个项目中使用哪个。另外,我有没有错过任何有趣的开源 CSS 框架?请在下面的评论中分享你的反馈和想法。 @@ -186,7 +185,7 @@ via: https://opensource.com/article/20/4/open-source-css-frameworks 作者:[Bryant Son][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 46c0639d570fbefd12e4e7428a945f56526f5fee Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 18 May 2020 09:51:25 +0800 Subject: [PATCH 0735/1809] PUB @wxy https://linux.cn/article-12227-1.html --- ...open source CSS frameworks for frontend web development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200413 9 open source CSS frameworks for frontend web development.md (99%) diff --git a/translated/tech/20200413 9 open source CSS frameworks for frontend web development.md b/published/20200413 9 open source CSS frameworks for frontend web development.md similarity index 99% rename from translated/tech/20200413 9 open source CSS frameworks for frontend web development.md rename to published/20200413 9 open source CSS frameworks for frontend web development.md index 539b361992..00ab65d520 100644 --- a/translated/tech/20200413 9 open source CSS frameworks for frontend web development.md +++ b/published/20200413 9 open source CSS frameworks for frontend web development.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12227-1.html) [#]: subject: (9 open source CSS frameworks for frontend web development) [#]: via: (https://opensource.com/article/20/4/open-source-css-frameworks) [#]: author: (Bryant Son https://opensource.com/users/brson) From c311a662172c4de7f2e1c1c35c05b88a4449a2a6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 18 May 2020 13:28:15 +0800 Subject: [PATCH 0736/1809] PRF @Acceleratorrrr --- ... From 8-bit enthusiast to Unix sysadmin.md | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/translated/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md b/translated/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md index 75f6ba217b..7822b37055 100644 --- a/translated/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md +++ b/translated/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md @@ -1,54 +1,56 @@ [#]: collector: (lujun9972) [#]: translator: (Acceleratorrrr) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (My Linux Story: From 8-bit enthusiast to Unix sysadmin) [#]: via: (https://opensource.com/article/20/4/linux-story) [#]: author: (James Farrell https://opensource.com/users/jamesf) -我的 Linux 故事:从8比特爱好者到 Unix 系统管理员 +我的 Linux 故事:从 8 位发烧友到 Unix 系统管理员 ====== -我是如何从一个电脑爱好者成为职业系统管理员和 Linux 粉丝的 -![Person typing on a 1980's computer][1] -故事得从1980年中期爸妈给家里购买[苹果 \]\[c][2] 开始。尽管很喜欢打游戏,但我还是很快被实用又好玩的 BASIC 编程迷住了。那个年代的人们还是把电脑当作打字机对待,所以懂电脑的人可以轻松使用他们的魔法。 +> 我是如何从一个电脑爱好者成为职业系统管理员和 Linux 粉丝的。 -用 BASIC 和点阵打印机自动生成惩罚作业来举个例子。被罚写两百遍道歉时,我问老师我可不可以打字代替手写。经过同意后,我写了5行 BASIC 语句来自动生成作业。另外一个小技巧是用非可视化文本编辑器,比如用 AppleWorks 微调字体,行距和边距,把学期报告扩充到要求的长度。 +![](https://img.linux.net.cn/data/attachment/album/202005/18/132731pnnzy7t5tz7hvc6z.jpg) -对电脑对喜爱很快让我接触到有 RAM 驱动和 x86 协处理器的苹果 ][gs。调制解调器和网络论坛刚开始火起来,它的双核处理器系统让我可以游刃有余的选择软件。但是由于调制解调器2400比特每秒的速度限制,下载任何超过几 KB 的东西都需要一天。我玩了不久之后就腻了。 +故事得从 1980 年中期我父母给家里购买[苹果 \]\[c][2] 开始。尽管很喜欢打游戏,但我还是很快被实用又好玩的 BASIC 编程迷住了。那个年代的人们还是把电脑当作小一点的打字机对待,所以拥有“高级电脑技能”的人可以轻松使用他们的魔法。 + +以用 BASIC 和点阵打印机自动生成惩罚作业来举个例子。被罚写两百遍道歉时,我问老师我可不可以用打字代替手写。经过同意后,我写了 5 行 BASIC 语句来自动生成作业。另外一个小技巧是用非可视化文本编辑器,比如用 AppleWorks 微调字体、行距和边距,把学期论文“拉长”到要求的篇幅。 + +对电脑的痴迷很快让我得到了带有内存驱动卡和 x86 协处理器的苹果 ][gs。那时候,调制解调器和 BBS 刚开始火起来,有了这样的双处理器系统后,我就可以安装各种琳琅满目的软件。但是由于调制解调器 2400bps 的速度限制,对我每天都要下载几 KB 的有趣东西形成了阻碍。我对苹果痴迷一段时间,不久之后就换了。 ### 探索 Unix -我的本科专业是计算机信息系统,硕士专业是计算机科学。本科教育主要是学习硬件和一些分时系统。研究生的时候才开始真正有意思起来,拨号上网简直打开了新世界的大门。尽管我依然用着我的双核 ][gs 来进行调制解调还有写写作业,不过Unix 系统让我真的热爱上方便的远程登录类游戏,文件传输协议,在线邮箱和 C 语言。当时 Gopher 非常受欢迎,特别是在我们这群终端用户中。 +我的本科专业是计算机信息系统,研究生专业是计算机科学。本科教育主要使用个人电脑,很少涉及大型分时系统。研究生的时候才开始真正有意思起来,拨号进入带有互联网连接的 Unix 简直打开了新世界的大门。尽管我依然用着我的双处理器 ][gs 来使用调制解调器还有写写论文,不过 Unix 系统真正吸引了我的注意力,因为它可以访问通用的 Telnet 游戏、文件传输协议(FTP)、在线邮箱和进行 C 语言编程。当时 Gopher 非常受欢迎,特别是在我们这群终端用户当中。 -被分到学院计算机部门是我本科命运般的转折点,这个部门主管学校的计算机服务。学生们必须要用 X 视窗终端来登陆 [Ultrix][3] 系统。大部分都是黑白界面,彩色处理在当时非常占 CPU 也很影响系统性能。也有一些做的不错的彩色系统,但是这些机器都很慢。 +被分到学院计算机部门是我研究生命运的转折点,这个部门主管学校的计算机服务。学生们可以使用 X Window 终端来登录基于 [Ultrix][3] 的系统。大部分都是灰度的黑白界面,彩色处理在当时非常占用 CPU,也很影响系统性能。也有一些彩色系统还不错,但是这些机器都很慢。 -我很喜欢那个时候,我有系统管理员权限而且工作是维护系统和网络。有一些出色的同事教我,他们对我选择从事系统管理员而不是程序员起了关键作用(尽管我至今热爱编程)。 +我很喜欢那个时候,我有系统管理员权限而且工作是维护系统和网络。我有一些很好的导师,他们对我选择从事系统管理员而不是程序员起了关键作用(尽管我至今仍然热爱编程)。 ### 从 Unix 到 Linux -稀缺是创造之母,当需要分享匮乏的学校电脑系统资源的时候,我们经常突发奇想。需要用电脑的学生是 Ultrix 工作站承受量的四到五倍,所以很难找到资源(特别是要交项目的时候)。虽然有一堆56k点对点协议的调制解调器处理远程系统访问,而且那时还不需要图像显示。但是发现一个有空余资源的机器然后分享出来的过程依然十分缓慢。和大部分人一样,我发现晚上加班很有效率,但我需要另外一些东西让我的项目迭代快一点。 +稀缺是创造之母,当需要分享匮乏的学校电脑系统资源的时候,我们学生们变得富有创造力。需要用电脑的学生是 Ultrix 工作站承受量的三到五倍,所以寻找资源往往是个难题(特别是要交付项目的时候)。在不需要图形化显示的时候,我们有一个 56k 的点对点协议的调制解调器池可供远程系统访问接入。但是找到一个有空余资源的机器并共享系统进行源码编译通常会导致进度缓慢。和大部分人一样,我发现晚上工作通常会有所帮助,但我还需要其它一些东西让我的项目迭代快一点。 -后来学校但一个系统管理员建议我了解一个免费的 Unix 系统。那就是 Linux,被装在一个 3.5 英寸的软盘里。多亏我们学校超快的 T1 载波,让我很方便的查询到这个新群体和一些下载教程。这是一个我之前不曾接触过的32位网络计算机工具。 +后来学校的一个系统管理员建议我去看一个免费提供的 Unix 系统。那就是 Linux,它被装在 3.5 英寸的软盘里。多亏我们学校超快的 T1 线路,我很容易就搜索到新闻组和其他资源来学习如何下载它。它全是基于 32 位的英特尔 PC 机的,而我并没有这一类的设备。 -幸运的是,我的工作让我有机会使用一些淘汰的旧电脑,所以命运的齿轮又开始旋转起来。 +幸运的是,我在学校的工作让我有机会接触到堆积如山的废旧电脑,所以命运的齿轮又开始旋转起来。 -我用一些报废的主机组装了一个可靠的,有足够 RAM 的80386台机(我确定不到 1GB),它有一个能用的显卡,一个细缆(同轴)以太网卡和一个硬盘。镜像用的是 Linux 内核0.98,不记得它是不是正式发行版的一部分了(可能是 SLS)。可我还能记得安装的一系列过程 - 首先启动内核和安装程序,然后格式化硬盘,接着要求每一个软盘安装 GNU 工具核心。核心装好之后,系统就可以启动了,你可以下载和安装其他的镜像包,比如编译器之类的。 +我找到了足够多的废旧 PC 组装了一个可靠的 80386 PC,带有足够内存(我确定不到 1GB),它有一个能用的显卡、一个细缆(同轴)以太网卡和一个硬盘。我所用的镜像是 Linux 内核 0.98,我不记得它是不是正式发行版的一部分了(可能是 SLS)。我所记得的是,它有一系列的软盘镜像,第一张软盘启动内核和一个最小安装程序,然后格式化硬盘,接着要求插入每个后续的软盘来安装 GNU 核心实用程序。在核心实用程序装好并引导系统之后,你可以下载和安装其他的软件包镜像,比如编译器之类的。 -这是我学术道路上巨大的福利。没有了 X 视窗显示,这台电脑性能比学校的 Ultrix 工作站强很多。学校允许我把这台机器连到校园网络,连接到学生网络文件系统,并且能直接接入内网。因为我研究生时主要用 [GNU 编译器套装][5] (还有 Perl 4)写作业,所以我可以进行本地开发。我可以使用这台主机作为独占资源来让我的项目更快迭代。 +这是我学术道路上巨大的福音。在没有运行 X Window 显示服务器的情况下,这台电脑性能比学校的 Ultrix 工作站强很多。学校允许我把这台机器连到校园网络,挂载学校的学生网络文件系统(NFS)共享,并且能直接访问互联网。因为我的研究生课程用 [GCC][5](还有 Perl 4)来完成大部分学生作业,所以我可以在本地进行开发工作。这使得我可以独享关键资源,从而使我能够更快速地迭代我的项目。 -但是,这个方案不是完美的。硬件有时会有点不稳定(这可能就是放弃使用它的原因),但我都能搞定。操作系统和系统自带库层面才真正让我感受到 Linux 和 Ultrix 的不同。我开始领会到移植软件到其他操作系统的意义,我可以开发任何我想要的软件,但是我必须要把项目转换成 Ultrix 编译的二进制文件来传输。在一个平台上能运行的 C 语言可能在另一个平台出错。这让我非常沮丧,但是我可能本能的察觉到了早期 Linux 废弃空指针的方法。Linux 倾向于把它作为无操作处理,但是 Ultrix 会立即触发核心转储和段错误 [SIGSEGV][6]。这是正好在要交作业的几天之前,我第一次程序移植时的重大发现。这同时对我研究 C++ 造成了一些麻烦,因为我不小心使用同时使用 malloc()/free() 和自动[构造函数和析构函数]处理项目,结果空指针被炸得到处都是。 +但是,这个方案不是完美的。硬件有时会有点不稳定(这可能就是它们被丢弃的原因),但我都能搞定。真正让我感受到的是 Linux 和 Ultrix 在操作系统和系统库层面的差异。我开始理解移植软件到其他操作系统的意义,我可以自由地在任何地方开发,但是我必须以 Ultrix 编译的二进制文件交付项目。在一个平台上完美运行的 C 语言代码可能在另一个平台出错。这非常令人沮丧,但是我可能本能的察觉到了早期 Linux 解引用空指针的方法。Linux 倾向于把它作为空操作处理,但是 Ultrix 会立即触发核心转储和段错误 [SIGSEGV][6]。这是我第一次程序移植时的重大发现,正好在要交作业的几天之前。这同时对我研究 C++ 造成了一些麻烦,因为我粗心地同时使用了 `malloc()`/`free()` 和自动[构造函数和析构函数][7]处理,让我的项目到处都是空指针炸弹。 -研究生快结束的时候,我用一颗英特尔 486DX2 66赫兹芯片和一块小型计算机系统接口硬盘,一块光驱和 一个1024x768 RGB 显示器将主机升级成了性能野兽。还把一个 16550 通用异步收发器完美组合到新的 US Robotics V.Everything 牌的调制解调器上。它可以跑 Windows 和 Linux 双系统,但最重要的是显卡和 CPU 的速度让开发环境幸福感倍增。那台旧的386依然在学校服役,不过我主要的工作都转移到了家里。 +研究生课程快结束的时候,我升级到了一台性能野兽工作站:一颗英特尔 486DX2 66MHz 芯片、一块 SCSI 硬盘、一块光驱和一个 1024x768 RGB 显示器,并且还用一个 16550 UART 串口卡完美地匹配了我的新 US Robotics V.Everything 牌调制解调器。它可以双启动 Windows 和 Linux 系统,但更重要的是显卡和 CPU 的速度让我的开发环境幸福感倍增。那台旧的 386 依然在学校服役,不过我我现在大部分繁重的功课和钻研都转移到了家里。 -和 [麦克.哈里斯的故事][8] 里关于90年代的 Linux 类似,我真的对当时流行的光驱很着迷。我住的地方附近有小型电脑器材店,这个宝库充满了电脑配件,高级专业书籍和你能想到的任何 Linux (还有免费的 Unix)CD。我还记得[Yggdrasil][9]和[Slackware][10]是我最喜欢的发行版之一。更惊人的是 CD 650MB 巨大的存储量!使它成为软件必不可少载体。是的,你可以用56k 的速度下载,但是真的很慢。更别提大部分人负担不起将这么多闲置的数据存档供以后使用。 +和 [Mike Harris][8] 关于 90 年代的 Linux 故事类似,我真的对当时流行的 CD 集合很着迷。我住的附近有家新开的 Micro Center 计算机商店,这个宝库充满了电脑配件、高级专业书籍和你能想到的各种 Linux(以及免费的 Unix)CD。我还记得 [Yggdrasil][9] 和 [Slackware][10] 是我最喜欢的发行版。真正让人难以置信的是 CD 存储空间的巨大容量 —— 650MB!使它成为获得软件的必不可少的载体。是的,你可以用 56k 的速度下载,但是真的很慢。更别提大部分人负担不起存档这么多供以后使用的闲置数据。 -### 直到今天 +### 而到了今天 -就是这些开启了我长达25年的系统管理员和开源软件粉丝生涯。Linux 是我事业和个人开发中重要的一部分。最近我依旧醉心于 Linux (主要是 CentOS, RedHat, and Ubuntu),但也经常从[FreeBSD][11]和其他炫酷开源系统中体验乐趣。 +就是这些开启了我长达 25 年的系统管理员的职业生涯和开源软件的乐趣。Linux 一直是我事业和个人开发中的重要组成部分。最近我依旧醉心于 Linux(主要是 CentOS、RedHat 和 Ubuntu),但也经常从 [FreeBSD][11] 和其他炫酷开源软件中得到乐趣。 -Linux 领导了我涉足 Opensource.com,我希望能回馈社区同时为下一代电脑出一份力。 +Linux 让我来到了 Opensource.com,我希望在这里能回馈社区,为新一代电脑爱好者出一份力。 -------------------------------------------------------------------------------- @@ -57,7 +59,7 @@ via: https://opensource.com/article/20/4/linux-story 作者:[James Farrell][a] 选题:[lujun9972][b] 译者:[Accelerator](https://github.com/Acceleratorrrr) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -70,7 +72,7 @@ via: https://opensource.com/article/20/4/linux-story [5]: https://en.wikipedia.org/wiki/GNU_Compiler_Collection [6]: https://en.wikipedia.org/wiki/Segmentation_fault [7]: https://www.tutorialspoint.com/cplusplus/cpp_constructor_destructor.htm -[8]: https://opensource.com/article/19/11/learning-linux-90s +[8]: https://linux.cn/article-11831-1.html [9]: https://en.wikipedia.org/wiki/Yggdrasil_Linux/GNU/X [10]: http://slackware.com [11]: https://www.freebsd.org/ From ca3fd63ce5b6757f2de6d2657c1eb784cdb3a74e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 18 May 2020 13:29:01 +0800 Subject: [PATCH 0737/1809] PUB @Acceleratorrrr https://linux.cn/article-12228-1.html --- ... My Linux Story- From 8-bit enthusiast to Unix sysadmin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md (99%) diff --git a/translated/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md b/published/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md similarity index 99% rename from translated/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md rename to published/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md index 7822b37055..60ab428ad3 100644 --- a/translated/tech/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md +++ b/published/20200408 My Linux Story- From 8-bit enthusiast to Unix sysadmin.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Acceleratorrrr) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12228-1.html) [#]: subject: (My Linux Story: From 8-bit enthusiast to Unix sysadmin) [#]: via: (https://opensource.com/article/20/4/linux-story) [#]: author: (James Farrell https://opensource.com/users/jamesf) From 07ac39b15ea3f514b0b4fb625f7edf21455ba11e Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 18 May 2020 17:42:33 +0800 Subject: [PATCH 0738/1809] remove useless articles --- ...epeat a Linux command until it succeeds.md | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 sources/tech/20200507 How to repeat a Linux command until it succeeds.md diff --git a/sources/tech/20200507 How to repeat a Linux command until it succeeds.md b/sources/tech/20200507 How to repeat a Linux command until it succeeds.md deleted file mode 100644 index 1eb586b267..0000000000 --- a/sources/tech/20200507 How to repeat a Linux command until it succeeds.md +++ /dev/null @@ -1,30 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to repeat a Linux command until it succeeds) -[#]: via: (https://www.linux.com/news/how-to-repeat-a-linux-command-until-it-succeeds/) -[#]: author: (Linux.com Editorial Staff https://www.linux.com/author/linuxdotcom/) - -How to repeat a Linux command until it succeeds -====== - -If you want to run a command on a Linux system until it succeeds, there are some really easy ways to do it that don’t require you to retype the command repeatedly or sit in front of your screen pressing !! Let’s look at the two options available with bash. - -Read More at [Network World][1] - --------------------------------------------------------------------------------- - -via: https://www.linux.com/news/how-to-repeat-a-linux-command-until-it-succeeds/ - -作者:[Linux.com Editorial Staff][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/author/linuxdotcom/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3541298/how-to-repeat-a-linux-command-until-it-succeeds.html From 82c5da5883c64d7c66364c89a244034090f3cd35 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 18 May 2020 17:49:21 +0800 Subject: [PATCH 0739/1809] PRF @geekpi --- ...ew projects to try in COPR for May 2020.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/translated/tech/20200504 4 cool new projects to try in COPR for May 2020.md b/translated/tech/20200504 4 cool new projects to try in COPR for May 2020.md index 12486623e9..e83f84b166 100644 --- a/translated/tech/20200504 4 cool new projects to try in COPR for May 2020.md +++ b/translated/tech/20200504 4 cool new projects to try in COPR for May 2020.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (4 cool new projects to try in COPR for May 2020) @@ -18,13 +18,13 @@ COPR 是个人软件仓库[集合][2],它不在 Fedora 中。这是因为某 ### Ytop -[ytop][4] 是类似于 _htop_ 的命令行系统监视器。它们之间的主要区别是 _ytop_ 在显示进程及 CPU 和内存使用率的顶部,还显示了系统 CPU、内存和网络使用率随时间变化的图表。此外,_ytop_ 显示磁盘使用情况和计算机温度。最后,_ytop_ 支持多种配色方案以及创建新配色的选项。 +[ytop][4] 是类似于 `htop` 的命令行系统监视器。它们之间的主要区别是,`ytop` 在显示进程及其 CPU 和内存使用率的顶部显示了系统的 CPU、内存和网络使用率随时间变化的图表。此外,`ytop` 还显示磁盘使用情况和计算机温度。最后,`ytop` 支持多种配色方案以及创建新配色的选项。 ![][5] #### 安装说明 -[仓库][6]当前为 Fedora 30、31、32 和 Rawhide 以及 EPEL 7 提供 _ytop_。要安装 _ytop_,请[带上 _sudo_][7] 使用以下命令: +[该仓库][6]当前为 Fedora 30、31、32 和 Rawhide 以及 EPEL 7 提供了 `ytop`。要安装 `ytop`,请[带上 sudo][7] 使用以下命令: ``` sudo dnf copr enable atim/ytop @@ -33,13 +33,13 @@ sudo dnf install ytop ### Ctop -[ctop][8] 是另一个命令行系统监视器。但是,与 _htop_ 和 _ytop_ 不同,_ctop_ 专注于显示容器的资源使用情况。_ctop_ 同时显示计算机上运行的所有容器的CPU、内存、网络和磁盘使用情况的概要,以及单个容器的更全面的信息,包括一段时间内资源使用情况的图表。当前,_ctop_ 支持 Docker 和 runc 容器。 +[ctop][8] 是另一个命令行系统监视器。但是,与 `htop` 和 `ytop` 不同,`ctop` 专注于显示容器的资源使用情况。`ctop` 同时显示计算机上运行的所有容器的 CPU、内存、网络和磁盘使用情况的概要,以及单个容器的更全面的信息,包括一段时间内资源使用情况的图表。当前,`ctop` 支持 Docker 和 runc 容器。 ![][9] #### 安装说明 -[仓库][10]当前为 Fedora 31、32 和 Rawhide 以及 EPEL 7 还有其他发行版提供安装包。要安装 _ctop_,请使用以下命令: +[该仓库][10]当前为 Fedora 31、32 和 Rawhide 以及 EPEL 7 还有其他发行版提供了安装包。要安装 `ctop`,请使用以下命令: ``` sudo dnf copr enable fuhrmann/ctop @@ -48,13 +48,13 @@ sudo dnf install ctop ### Shortwave -[shortwave][11] 是用于收听广播电台的程序。shortwave 使用广播电台的社区数据库 [www.radio-browser.info][12]。在此数据库中,你可以发现或搜索广播电台,将它们添加到库中,然后收听。此外,shortwave 还提供有关当前播放歌曲的信息,并且还可以记录这些歌曲。 +[shortwave][11] 是用于收听广播电台的程序。`shortwave` 使用广播电台的社区数据库 [www.radio-browser.info][12]。在此数据库中,你可以发现或搜索广播电台,将它们添加到库中,然后收听。此外,`shortwave` 还提供有关当前播放歌曲的信息,并且还可以记录这些歌曲。 ![][13] #### 安装说明 -[仓库][14] 当前为 Fedora 31、32 和 Rawhide 提供 shortwave。要安装 shortwave,请使用以下命令: +[该仓库][14] 当前为 Fedora 31、32 和 Rawhide 提供了 shortwave。要安装 `shortwave`,请使用以下命令: ``` sudo dnf copr enable atim/shortwave @@ -63,13 +63,13 @@ sudo dnf install shortwave ### Setzer -[setzer][15] 是 LaTeX 编辑器,它可以构建 pdf 文档并查看它们。它提供了各种类型文档(例如文章或幻灯片)的模板。此外,setzer 还有许多特殊符号,数学符号和希腊字母的按钮。 +[setzer][15] 是 LaTeX 编辑器,它可以构建 pdf 文档并查看它们。它提供了各种类型文档(例如文章或幻灯片)的模板。此外,`setzer` 还有许多特殊符号、数学符号和希腊字母的按钮。 ![][16] #### 安装说明 -[仓库][17] 当前为Fedora 30、31、32 和 Rawhide 提供 setzer。要安装 setzer,请使用以下命令: +[该仓库][17] 当前为 Fedora 30、31、32 和 Rawhide 提供了 `setzer`。要安装 `setzer`,请使用以下命令: ``` sudo dnf copr enable lyessaadi/setzer @@ -83,7 +83,7 @@ via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-202 作者:[Dominik Turecek][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -105,4 +105,4 @@ via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-202 [14]: https://copr.fedorainfracloud.org/coprs/atim/shortwave/ [15]: https://www.cvfosammmm.org/setzer/ [16]: https://fedoramagazine.org/wp-content/uploads/2020/04/setzer.png -[17]: https://copr.fedorainfracloud.org/coprs/lyessaadi/setzer/ \ No newline at end of file +[17]: https://copr.fedorainfracloud.org/coprs/lyessaadi/setzer/ From f8d772de7abe160ba132eff26cc68a314ad9cee5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 18 May 2020 17:50:05 +0800 Subject: [PATCH 0740/1809] PUB @geekpi https://linux.cn/article-12230-1.html --- ...0200504 4 cool new projects to try in COPR for May 2020.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200504 4 cool new projects to try in COPR for May 2020.md (98%) diff --git a/translated/tech/20200504 4 cool new projects to try in COPR for May 2020.md b/published/20200504 4 cool new projects to try in COPR for May 2020.md similarity index 98% rename from translated/tech/20200504 4 cool new projects to try in COPR for May 2020.md rename to published/20200504 4 cool new projects to try in COPR for May 2020.md index e83f84b166..9a63887910 100644 --- a/translated/tech/20200504 4 cool new projects to try in COPR for May 2020.md +++ b/published/20200504 4 cool new projects to try in COPR for May 2020.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12230-1.html) [#]: subject: (4 cool new projects to try in COPR for May 2020) [#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2020/) [#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) From 3ab640e83c51a06e2e0fdc978585cd021b8c332b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 18 May 2020 18:59:24 +0800 Subject: [PATCH 0741/1809] PRF @wxy --- ...he life-changing magic of git rebase -i.md | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/translated/tech/20200429 The life-changing magic of git rebase -i.md b/translated/tech/20200429 The life-changing magic of git rebase -i.md index 91739d2789..4536691b6b 100644 --- a/translated/tech/20200429 The life-changing magic of git rebase -i.md +++ b/translated/tech/20200429 The life-changing magic of git rebase -i.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (The life-changing magic of git rebase -i) @@ -12,53 +12,53 @@ > 让大家觉得你一次就能写出完美的代码,并让你的补丁更容易审核和合并。 -![Hands programming][1] +![](https://img.linux.net.cn/data/attachment/album/202005/18/185911fvwztwyp4lvbzkw4.jpg) -软件开发是混乱的。有很多错误的转折、有需要修复的错别字、有需要修正的错误、有需要稍后纠正临时和粗陋的代码,还有在开发过程中以后发现的错位问题。有了版本控制,在创建“完美”的最终产品(即准备提交给上游的补丁)的过程中,你会有一个记录着每一个错误的转折和修正的原始记录。就像电影中的片段一样,它们有些尴尬,有时还很有趣。就像电影中的花絮一样,它们会让人有点尴尬,有时也会让人觉得好笑。 +软件开发是混乱的。有很多错误的转折、有需要修复的错别字、有需要修正的错误、有需要稍后纠正的临时和粗陋的代码,还有在以后的开发过程中发现一次又一次的问题。有了版本控制,在创建“完美”的最终产品(即准备提交给上游的补丁)的过程中,你会有一个记录着每一个错误转折和修正的原始记录。就像电影中的花絮一样,它们会让人有点尴尬,有时也会让人觉得好笑。 -如果你能使用版本控制来定期保存你的工作线索,然后当你准备提交审核的东西时,可以隐藏所有这些私人草稿工作,只需提交一份单一的、完美的补丁就可以了,那不是很好吗?`git rebase -i`,是重写历史记录的完美方法,可以让大家觉得你一次就写出了完美的代码。 +如果你使用版本控制来定期保存你的工作线索,然后当你准备提交审核的东西时,又可以隐藏所有这些私人草稿工作,并只提交一份单一的、完美的补丁,那不是很好吗?`git rebase -i`,是重写历史记录的完美方法,可以让大家觉得你一次就写出了完美的代码! ### git rebase 的作用是什么? -如果你不熟悉 Git 的复杂性,这里简单介绍一下。在幕后,Git 将项目的不同版本与唯一标识符关联起来,这个标识符由父节点的唯一标识符的哈希以及新版本与其父节点的差异组成。这样就形成了一棵修订树,每个检出项目的人都会得到自己的副本。不同的人可以把项目往不同的方向发展,每个人的出发点都可能是不同的分支点。 +如果你不熟悉 Git 的复杂性,这里简单介绍一下。在幕后,Git 将项目的不同版本与唯一标识符关联起来,这个标识符由父节点的唯一标识符的哈希以及新版本与其父节点的差异组成。这样就形成了一棵修订树,每个签出项目的人都会得到自己的副本。不同的人可以把项目往不同的方向发展,每个方向都可能从不同的分支点开始。 ![Master branch vs. private branch][2] -*左边是 `origin` 版本库中的主分支,右边是你个人副本中的私有分支。* +*左边是 origin 版本库中的主分支,右边是你个人副本中的私有分支。* -有两种方法可以将你的工作与原始版本库中的主分支整合起来:一种是使用 合并:`git merge`,另一种是使用变基:`git rebase`。它们的工作方式非常不同。 +有两种方法可以将你的工作与原始版本库中的主分支整合起来:一种是使用合并:`git merge`,另一种是使用变基:`git rebase`。它们的工作方式非常不同。 -当你使用 `git merge` 时,会在主分支上创建一个新的提交,其中包括所有来自 `origin` 的修改和所有本地的修改。如果有任何冲突(例如,如果别人修改了你也在修改的文件),则将这些冲突标记出来,并且你有机会在将该“合并提交”提交到本地版本库之前解决这些冲突。当你将更改推送回父版本库时,所有的本地工作都会以分支的形式出现在 Git 仓库的其他用户面前。 +当你使用 `git merge` 时,会在主分支(`master`)上创建一个新的提交,其中包括所有来自原始位置(`origin`)的修改和所有本地的修改。如果有任何冲突(例如,如果别人修改了你也在修改的文件),则将这些冲突标记出来,并且你有机会在将这个“合并提交”提交到本地版本库之前解决这些冲突。当你将更改推送回父版本库时,所有的本地工作都会以分支的形式出现在 Git 版本库的其他用户面前。 -但是 `git rebase` 的工作方式不同。它回滚你的提交,并从主分支的顶端再次重放这些提交。这导致了两个主要的变化。首先,由于你的提交现在从一个不同的父节点分支出来,它们的哈希值会被重新计算,并且任何克隆了你的仓库的人都可能会有一个残破的仓库副本。第二,你没有一个合并提交,所以在将更改重放到主分支上时会识别出任何合并冲突,所以任何合并冲突都会被识别出来,因此,你需要在进行变基rebase之前修复它们。当你现在推送你的修改时,你的工作不会出现在分支上,并且看起来像是你把所有的修改都写到了主分支的最新的提交上。 +但是 `git rebase` 的工作方式不同。它会回滚你的提交,并从主分支(`master`)的顶端再次重放这些提交。这导致了两个主要的变化。首先,由于你的提交现在从一个不同的父节点分支出来,它们的哈希值会被重新计算,并且任何克隆了你的版本库的人都可能得到该版本库的一个残破副本。第二,你没有“合并提交”,所以在将更改重放到主分支上时会识别出任何合并冲突,因此,你需要在进行变基rebase之前先修复它们。现在,当你现在推送你的修改时,你的工作不会出现在分支上,并且看起来像是你是在主分支的最新的提交上写入了所有的修改。 ![Merge commits preserve history, and rebase rewrites history.][3] *合并提交(左)保留了历史,而变基(右)重写历史。* -然而,这两种方式都有一个坏处:在你准备好分享代码之前,每个人都可以看到你在本地处理问题时的所有涂鸦和编辑。这就是 `git rebase` 的 `--interactive`(或简写 `-i`)标志的作用。 +然而,这两种方式都有一个缺点:在你准备好分享代码之前,每个人都可以看到你在本地处理问题时的所有涂鸦和编辑。这就是 `git rebase` 的 `--interactive`(或简写 `-i`)标志发挥作用的地方。 -### 介绍 git rebase -i +### git rebase -i 登场 -`git rebase` 的最大优点是它重写了历史。但是,为什么仅止于假装你从后面的点分支出来呢?有一种更进一步方法可以重写你是如何准备就绪这些代码的:`git rebase -i`,交互式的 `git rebase`。 +`git rebase` 的最大优点是它可以重写历史。但是,为什么仅止于假装你从后面的点分支出来呢?有一种更进一步方法可以重写你是如何准备就绪这些代码的:`git rebase -i`,即交互式的 `git rebase`。 -这个功能就是 Git 中的 "神奇的时间机器” 功能。这个标志允许你在做变基时对修订历史记录进行复杂的修改。你可以隐藏你的错误! 将许多小的修改合并到一个原始的功能补丁中! 重新排序修改历史记录中的内容 +这个功能就是 Git 中的 “魔术时光机” 功能。这个标志允许你在做变基时对修订历史记录进行复杂的修改。你可以隐藏你的错误! 将许多小的修改合并到一个崭新的功能补丁中! 重新排列修改历史记录中的显示顺序! ![output of git rebase -i][4] -当你运行 `git rebase -i` 时,你会得到一个编辑器会话,其中列出了所有正在被变基的提交,并有一些选项可以对它们做什么。默认的选择是 `pick`。 +当你运行 `git rebase -i` 时,你会进入一个编辑器会话,其中列出了所有正在被变基的提交,以及可以对其执行的操作的多个选项。默认的选择是选择(`Pick`)。 - * `Pick`:会在你的历史记录中保留该提交。 - * `Reword`:允许你修改提交信息,可能是修复一个错别字或添加额外的注释。 - * `Edit`:允许你在重放分支的过程中对提交进行修改。 - * `Squash`:可以将多个提交合并为一个。 - * 你可以通过移动文件中的提交来重新排序。 +* `Pick`:会在你的历史记录中保留该提交。 +* `Reword`:允许你修改提交信息,可能是修复一个错别字或添加其它注释。 +* `Edit`:允许你在重放分支的过程中对提交进行修改。 +* `Squash`:可以将多个提交合并为一个。 +* 你可以通过在文件中移动来重新排序提交。 -当你完成后,只需保存最终结果,变基就会执行。在每个阶段,当你选择了修改提交(无论是用 `reword`、`edit`、`squash` 还是有冲突时),变基会停止,并允许你在继续提交之前进行适当的修改。 +当你完成后,只需保存最终结果,变基操作就会执行。在你选择修改提交的每个阶段(无论是用 `reword`、`edit`、`squash` 还是发生冲突时),变基都会停止,并允许你在继续提交之前进行适当的修改。 -上面这个例子的结果是 “One-liner bug fix” 和 “Integate new header everywhere” 被合并到一个提交中,而 “New header for docs website” 和 “D'oh - typo. Fixed” 合并到另一个提交中。就像变魔术一样,其他提交的工作还在你的分支中,但相关的提交已经从你的历史记录中消失了!这样一来,你就可以很容易地提交干净的提交。 +上面这个例子的结果是 “One-liner bug fix” 和 “Integate new header everywhere” 被合并到一个提交中,而 “New header for docs website” 和 “D'oh - typo. Fixed” 合并到另一个提交中。就像变魔术一样,其他提交的工作还在你的分支中,但相关的提交已经从你的历史记录中消失了! -这使得使用 `git send-email` 或者用你新整理好的补丁集在父版本库中创建一个拉取请求来提交一个干净的补丁给上游项目变得很容易。这有很多好处,包括让你的代码更容易审核,更容易接受,也更容易合并。 +这使得使用 `git send-email` 或者用你新整理好的补丁集在父版本库中创建一个拉取请求,然后来提交一个干净的补丁给上游项目变得很容易。这有很多好处,包括让你的代码更容易审核,更容易接受,也更容易合并。 -------------------------------------------------------------------------------- @@ -67,7 +67,7 @@ via: https://opensource.com/article/20/4/git-rebase-i 作者:[Dave Neary][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9e95e8ab91940fe240bb30a7b69972d4ee744676 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 18 May 2020 19:00:32 +0800 Subject: [PATCH 0742/1809] PUB @wxy https://linux.cn/article-12231-1.html --- .../20200429 The life-changing magic of git rebase -i.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200429 The life-changing magic of git rebase -i.md (98%) diff --git a/translated/tech/20200429 The life-changing magic of git rebase -i.md b/published/20200429 The life-changing magic of git rebase -i.md similarity index 98% rename from translated/tech/20200429 The life-changing magic of git rebase -i.md rename to published/20200429 The life-changing magic of git rebase -i.md index 4536691b6b..54665c70fe 100644 --- a/translated/tech/20200429 The life-changing magic of git rebase -i.md +++ b/published/20200429 The life-changing magic of git rebase -i.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12231-1.html) [#]: subject: (The life-changing magic of git rebase -i) [#]: via: (https://opensource.com/article/20/4/git-rebase-i) [#]: author: (Dave Neary https://opensource.com/users/dneary) From b046f4ff32363680c7ffe88ab720db3e2fbfe8ab Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 19 May 2020 08:36:15 +0800 Subject: [PATCH 0743/1809] translated --- ...un multiple versions of Python on a Mac.md | 186 ------------------ ...un multiple versions of Python on a Mac.md | 180 +++++++++++++++++ 2 files changed, 180 insertions(+), 186 deletions(-) delete mode 100644 sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md create mode 100644 translated/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md diff --git a/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md b/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md deleted file mode 100644 index 34a7802f28..0000000000 --- a/sources/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md +++ /dev/null @@ -1,186 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to use pyenv to run multiple versions of Python on a Mac) -[#]: via: (https://opensource.com/article/20/4/pyenv) -[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg) - -How to use pyenv to run multiple versions of Python on a Mac -====== -If you need to run a project that uses a Python version you don't have -installed on macOS, try pyenv. -![Searching for code][1] - -Managing a local Python development environment continues to be a challenge, even for experienced developers. While there are well-documented [strategies for package management][2], there is another step necessary to ensure you are running the version of Python you need when you need it. - -### Why does the version of Python matter? - -It's a strange concept at first, but programming languages change like any other software. They have bugs, fixes, and updates like any of your favorite [APIs][3] and any other software. Similarly again, different releases are identified by a three-digit number known as a [semantic version][4]. - -> 😭😭😭 [pic.twitter.com/yt1Z2439W8][5] -> -> — Denny Perez (@dennyperez18) [May 28, 2019][6] - -For many years, Python 2 was the commonly used major version of the programming language. In January 2020, Python 2 [reached end of life][7], and only Python 3 will be supported by the language's core maintainers from then forward. Python 3 is developing steadily, and releasing new updates regularly. That makes it important for me to regularly get those updates. - -Recently, I tried to run a project on macOS that depended on Python 3.5.9, a version that I did not have installed on my system. It might seem logical to think the Python package manager **pip** could install it*, but that wasn't the case: - - -``` -$ pip install python3.5.9 -Collecting python3.5.9 -  ERROR: Could not find a version that satisfies the requirement python3.5.9 (from versions: none) -ERROR: No matching distribution found for python3.5.9 -``` - -Alternatively, I could have downloaded that version from the official Python website, but how would I run it in on my Mac alongside my existing version of Python? Specifying the version of Python I intend to use every time I run the interpreter (python3.7 or python3.5 for example) seems error-prone at best. There has to be a better way. - -_(A note on the above: I know this makes no sense to seasoned Python developer, but it made sense to me at the time. I would happily talk about why I still think it should.)_ - -### Installing and setting up pyenv - -Thankfully, **pyenv** exists to work around this series of complexities. To start, I needed to install pyenv. I could clone and compile it myself [from source][8], but I prefer to manage packages like this through the Homebrew package manager: - - -``` -`$ brew install pyenv` -``` - -In order to use the version of Python through pyenv, it's essential to understand the shell's PATH variable. PATH determines where the shell searches for files by the name of the command. You must ensure the shell will find the version of Python run by pyenv, not the one installed by default (which is often called the _system version_). If you don't change the path, here is the result: - - -``` -$ which python -/usr/bin/python -``` - -That's the system version of Python. - -To set up pyenv correctly, you can run the following in Bash or zsh: - - -``` -`$ PATH=$(pyenv root)/shims:$PATH` -``` - -Now, if you check the version of Python, you'll see it is the one managed by pyenv: - - -``` -$ which python -/Users/my_username/.pyenv/shims/python -``` - -That export statement (PATH=) will only change for this shell instance, so make it a permanent change, you need to add it to your dotfiles. Since zsh is officially macOS's default shell, I'll focus on it. Append that same syntax to the **~/.zshrc** file: - - -``` -`$ echo 'PATH=$(pyenv root)/shims:$PATH' >> ~/.zshrc` -``` - -Now every time we run a command in zsh, it will use the pyenv version of Python. Note that I used single quotes with **echo** so it does not evaluate and expand the commands. - -The .zshrc file only manages zsh instances, so be sure to check what your shell is and edit the associated dotfiles. If you need to double-check what your default shell is, you can run **echo $SHELL**. If it's zsh, use the command above. If you use Bash, change **~/.zshrc** to **~/.bashrc**. You can dive deep into [path setting][9] in pyenv's README if you would like to learn more. - -### Using pyenv to manage Python versions - -Now that pyenv is in control, we can see it only has the system Python available to it: - - -``` -$ pyenv versions -system -``` - -As mentioned above, you absolutely do not want to use this version ([read more on why][10]). Now that pyenv is set up correctly, I want it to have a few different versions of Python that I regularly use. - -There is a way to see all Python versions available from all the different repositories pyenv has access to by running **pyenv install --list**. It's a long, overwhelming list that may be helpful to review in the future. For now, I stick with the latest of each dot-release (3.5.x or 3.6.x where x is the latest) found on the [Python download page][11]. With that in mind, I'll install 3.5.9 and 3.8.0: - - -``` -$ pyenv install 3.5.9 -$ pyenv install 3.8.0 -``` - -This will take a while, so get some tea (or read one of the links above). It's interesting to note that the output walks through the download and building of that version of Python. For example, the output shows that the file comes directly from [Python.org][12]. - -Once everything is installed, you can set up your defaults. I like to live at the cutting edge, so I set my global default Python version to the latest: - - -``` -`$ pyenv global 3.8.0` -``` - -And that version is immediately set in my shell. To confirm: - - -``` -$ python -V -Python 3.8.0 -``` - -The project I want to run works only with Python 3.5, so I'll set the version locally and confirm it's in use: - - -``` -$ pyenv local 3.5.9 -$ python -V -Python 3.5.9 -``` - -Because I used the **local** option with pyenv, it added a file to my current directory to track that information.  - - -``` -$ cat .python-version -3.5.9 -``` - -Now, I can finally set up a virtual environment for the project I want and be sure I'm running the right version of Python. - - -``` -$ python -m venv venv -$ source ./venv/bin/activate -(venv) $ which python -/Users/mbbroberg/Develop/my_project/venv/bin/python -``` - -To learn more, check out this tutorial about [managing virtual environments on a Mac][13]. - -### Wrapping up - -By default, running multiple Python versions can be a challenge. I find starting with pyenv ensures I have the versions of Python I need set up to run when I need them. - -Do you have other beginner or intermediate Python questions? Leave a comment, and we will consider them for a future article. - -Newcomers to python-ideas occasionally make reference to the idea of "Python 4000" when proposing... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/pyenv - -作者:[Matthew Broberg][a] -选题:[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/mbbroberg -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_python_programming.png?itok=ynSL8XRV (Searching for code) -[2]: https://opensource.com/article/19/4/managing-python-packages -[3]: https://opensource.com/article/19/5/api-evolution-right-way -[4]: https://semver.org/ -[5]: https://t.co/yt1Z2439W8 -[6]: https://twitter.com/dennyperez18/status/1133505310516232203?ref_src=twsrc%5Etfw -[7]: https://opensource.com/article/19/11/end-of-life-python-2 -[8]: https://github.com/pyenv/pyenv -[9]: https://github.com/pyenv/pyenv#understanding-path -[10]: https://opensource.com/article/19/5/python-3-default-mac -[11]: https://www.python.org/downloads/ -[12]: http://python.org -[13]: https://opensource.com/article/19/6/python-virtual-environments-mac diff --git a/translated/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md b/translated/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md new file mode 100644 index 0000000000..def57f9a21 --- /dev/null +++ b/translated/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md @@ -0,0 +1,180 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use pyenv to run multiple versions of Python on a Mac) +[#]: via: (https://opensource.com/article/20/4/pyenv) +[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg) + +如何在 Mac 上使用 pyenv 运行多个版本的 Python +====== +如果你需要运行 macOS 上没有安装的 Python 版本,请试试 pyenv。 +![Searching for code][1] + +即使对于有经验的开发人员,管理本地 Python 开发环境仍然是一个挑战。尽管有详细的[软件包管理策略][2],但仍需要采取另外的步骤来确保你在需要时运行所需的 Python 版本。 + +### 为什么 Python 版本重要? + +起初这是一个奇怪的概念,但是编程语言会像其他任何软件一样发生变化。它们有 bug,修复和更新,就像你喜欢的 [API][3] 和任何其他软件一样。同样,不同的发行版由称为[语义版本][4]的三位数标识。 + +> 😭😭😭 [pic.twitter.com/yt1Z2439W8][5] +> +> — Denny Perez (@dennyperez18) [May 28, 2019][6] + +多年来,Python 2 是该语言的常用主要版本。在 2020 年 1 月,Python 2 [到达最后寿命][7],此后,Python 的核心维护者将仅支持 Python 3。Python 3 稳步发展,并定期发布新更新。对我来说定期获取这些更新很重要。 + +最近,我尝试在依赖于 Python 3.5.9 的 macOS 上运行一个项目,但该版本尚未安装在系统上。我认为 Python 包管理器 **pip** 可以安装它,但事实并非如此: + + +``` +$ pip install python3.5.9 +Collecting python3.5.9 +  ERROR: Could not find a version that satisfies the requirement python3.5.9 (from versions: none) +ERROR: No matching distribution found for python3.5.9 +``` + +或者,我可以从官方 Python 网站下载该版本,但是除了现有的 Python 版本外,如何在 Mac 上运行它?每次运行指定 Python 解释器版本(例如 python3.7 或 python3.5)似乎很容易出错。一定会有更好的方法。 + +_(说明:我知道这对经验丰富的 Python 开发人员没有意义,但对当时的我来说是有意义的。我很乐意谈论为什么我仍然认为应该如此。)_ + +### 安装和设置 pyenv + +值得庆幸的是,**pyenv** 可以解决这一系列复杂性。首先,我需要安装 pyenv。我可以[从源码][8]自己克隆并编译它,但是我更喜欢通过 Homebrew 包管理器来管理软件包: + +``` +`$ brew install pyenv` +``` + +为了通过 pyenv 使用 Python 版本,必须了解 shell 的 PATH 变量。PATH 通过命令名称确定 shell 在哪里搜索文件。你必须确保 shell 程序能够找到 pyenv 运行的 Python 版本,而不是默认安装的版本(通常称为_系统版本_)。如果不更改路径,那么结果如下: + + +``` +$ which python +/usr/bin/python +``` + +这是 Python 的系统版本。 + +要正确设置 pyenv,可以在 Bash 或 zsh 中运行以下命令: + +``` +`$ PATH=$(pyenv root)/shims:$PATH` +``` + +现在,如果你检查 Python 的版本,你会看到它是 pyenv 管理的版本: + + +``` +$ which python +/Users/my_username/.pyenv/shims/python +``` + +该 export 语句(PATH=)仅会对该 shell 实例进行更改,为了永久更改,你需要将它添加到 dotfile 中。由于 zsh 是 macOS 的默认 shell,因此我将重点介绍它。将相同的语法添加到 **~/.zshrc** 文件中: + + +``` +`$ echo 'PATH=$(pyenv root)/shims:$PATH' >> ~/.zshrc` +``` + +现在,每次我们在 zsh 中运行命令时,它将使用 pyenv 版本的 Python。请注意,我在 **echo** 中使用了单引号,因此它不会评估和扩展命令。 + +.zshrc 文件仅管理 zsh 实例,因此请确保检查你的 shell 程序并编辑关联的 dotfile。如果需要再次检查默认 shell 程序,可以运行 **echo $SHELL**。如果是 zsh,请使用上面的命令。如果你使用 Bash,请将 **~/.zshrc** 更改为 **~/.bashrc**。如果您想了解更多信息,可以在pyenv的自述文件中深入研究[path setting] [9]。 + +### 使用 pyenv 管理 Python 版本 + +现在 pyenv 已经可用,我们可以看到它只有系统 Python 可用: + +``` +$ pyenv versions +system +``` + +如上所述,你绝对不想使用此版本([阅读更多有关信息][10])。现在 pyenv 已正确设置,我希望它有我经常使用的几个不同版本的 Python。 + +有一种方法可以通过运行 **pyenv install --list** 来查看 pyenv 可以访问的所有不同仓库中的所有 Python 版本。这是一个很长的列表,将来可能会有所帮助。目前,我决定在 [Python 下载页面][11]找到的每个最新的“点版本”(3.5.x 或 3.6.x,其中 x 是最新的)。因此,我将安装 3.5.9 和 3.8.0: + + +``` +$ pyenv install 3.5.9 +$ pyenv install 3.8.0 +``` + +这将需要一段时间,因此休息一会(或阅读上面的链接之一)。有趣的是,输出遍历了该版本的 Python 的下载和构建。例如,输出显示文件直接来自 [Python.org][12]。 + +安装完成后,你可以设置默认值。我喜欢最新的,因此将全局默认 Python 版本设置为最新版本: + + +``` +`$ pyenv global 3.8.0` +``` + +该版本立即在我的 shell 中设置完成。要确认: + + +``` +$ python -V +Python 3.8.0 +``` + +我要运行的项目仅适于 Python 3.5,因此我将在本地设置该版本并确认: + + +``` +$ pyenv local 3.5.9 +$ python -V +Python 3.5.9 +``` + +因为我在 pyenv 中使用了 **local** 选项,所以它向当前目录添加了一个文件来跟踪该信息。 + + +``` +$ cat .python-version +3.5.9 +``` + +现在,我终于可以为想要的项目设置虚拟环境,并确保运行正确版本的 Python。 + + +``` +$ python -m venv venv +$ source ./venv/bin/activate +(venv) $ which python +/Users/mbbroberg/Develop/my_project/venv/bin/python +``` + +要了解更多信息,请查看有关[在 Mac 上管理虚拟环境][13]的教程。 + +### 总结 + +默认情况下,运行多个 Python 版本可能是一个挑战。我发现 pyenv 可以确保在我需要时可以有我需要的 Python 版本。 + +你还有其他初学者或中级 Python 问题吗? 请发表评论,我们将在以后的文章中考虑它们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/pyenv + +作者:[Matthew Broberg][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mbbroberg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_python_programming.png?itok=ynSL8XRV (Searching for code) +[2]: https://opensource.com/article/19/4/managing-python-packages +[3]: https://opensource.com/article/19/5/api-evolution-right-way +[4]: https://semver.org/ +[5]: https://t.co/yt1Z2439W8 +[6]: https://twitter.com/dennyperez18/status/1133505310516232203?ref_src=twsrc%5Etfw +[7]: https://opensource.com/article/19/11/end-of-life-python-2 +[8]: https://github.com/pyenv/pyenv +[9]: https://github.com/pyenv/pyenv#understanding-path +[10]: https://opensource.com/article/19/5/python-3-default-mac +[11]: https://www.python.org/downloads/ +[12]: http://python.org +[13]: https://opensource.com/article/19/6/python-virtual-environments-mac From 327892064ad3d5d1ab9224b5577cc529c513419a Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 19 May 2020 08:48:12 +0800 Subject: [PATCH 0744/1809] translating --- ...20200326 Tricks for getting around your Linux file system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200326 Tricks for getting around your Linux file system.md b/sources/tech/20200326 Tricks for getting around your Linux file system.md index e8ed2b3869..bda5e2100c 100644 --- a/sources/tech/20200326 Tricks for getting around your Linux file system.md +++ b/sources/tech/20200326 Tricks for getting around your Linux file system.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 80407fb6d530994a3dfd172fb909d9ad2a9ffbe0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 19 May 2020 08:53:07 +0800 Subject: [PATCH 0745/1809] PRF @LazyWolfLin --- ...00414 How I containerize a build system.md | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/translated/tech/20200414 How I containerize a build system.md b/translated/tech/20200414 How I containerize a build system.md index b7bc3f252c..f1590ef480 100644 --- a/translated/tech/20200414 How I containerize a build system.md +++ b/translated/tech/20200414 How I containerize a build system.md @@ -1,69 +1,71 @@ [#]: collector: (lujun9972) [#]: translator: (LazyWolfLin) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How I containerize a build system) [#]: via: (https://opensource.com/article/20/4/how-containerize-build-system) [#]: author: (Ravi Chandran https://opensource.com/users/ravichandran) -构建系统容器化指南 +对构建系统进行容器化的指南 ====== -搭建一个通过容器分发应用的可复用系统可能很复杂,但这儿有个好方法。 -![Containers on a ship on the ocean][1] -一个用于将源代码编译成可运行的应用的构建系统是由工具和流程共同组成。在编译过程中还涉及到代码从软件开发者流转到最终用户,无论最终用户是运维的同事还是部署的同事。 +> 搭建一个通过容器分发应用的可复用系统可能很复杂,但这儿有个好方法。 -在使用容器搭建了一些构建系统后,我觉得有一个不错的可复用的方法值得分享。虽然这些构建系统被用于编译机器学习算法和为嵌入式硬件生成可加载的软件镜像上,但这个方法足够抽象,可用于任何基于容器的构建系统。 +![](https://img.linux.net.cn/data/attachment/album/202005/19/085248ausakkjfu05akqr2.jpg) -这个方法是关于通过简单和可维护的方式搭建或组织构建系统,但并不涉及处理特定编译器或工具容器化的技巧。它适用于软件开发人员构建软件并将可维护镜像交给其他技术人员(无论是系统管理员,运维工程师或者其他头衔)的常见情况。由于构建系统对于最终用户是透明的,因此他们能够专注于软件本身。 +一个用于将源代码转换成可运行的应用的构建系统是由工具和流程共同组成。在转换过程中还涉及到代码的受众从软件开发者转变为最终用户,无论最终用户是运维的同事还是部署的同事。 + +在使用容器搭建了一些构建系统后,我觉得有一个不错的可复用的方法值得分享。虽然这些构建系统被用于编译机器学习算法和为嵌入式硬件生成可加载的软件镜像,但这个方法足够抽象,可用于任何基于容器的构建系统。 + +这个方法是以一种易于使用和维护的方式搭建或组织构建系统,但并不涉及处理特定编译器或工具容器化的技巧。它适用于软件开发人员构建软件,并将可维护镜像交给其他技术人员(无论是系统管理员、运维工程师或者其他一些头衔)的常见情况。该构建系统被从终端用户中抽象出来,这样他们就可以专注于软件。 ### 为什么要容器化构建系统? 搭建基于容器的可复用构建系统可以为软件团队带来诸多好处: - * **专注**:我希望专注于应用的开发。当我调用一个名为“build”的工具时,我希望这个工具集能生成一个随时可用的二进制文件。我不想浪费时间在构建系统的查错上。实际上,我宁愿不了解也不关心构建系统。 + * **专注**:我希望专注于应用的开发。当我调用一个工具进行“构建”时,我希望这个工具集能生成一个随时可用的二进制文件。我不想浪费时间在构建系统的查错上。实际上,我宁愿不了解,或者说不关心构建系统。 * **一致的构建行为**:无论在哪种使用情况下,我都想确保整个团队使用相同版本的工具集并在构建时得到相同的结果。否则,我就得不断地处理“我这咋就是好的”的麻烦。在团队项目中,使用相同版本的工具集并对给定的输入源文件集产生一致的输出是非常重要。 - * **易于部署和升级**:即使向每个人都提供一套详细说明来为项目安装工具集,也可能会有人翻车。问题可能是由于每个人对自己的 Linux 环境的个性化修改导致的。在团队中使用不同的 Linux 发行版(或者其他操作系统),情况可能还会变得更复杂。当需要将工具集升级到下一版本时,问题很快就会变得更糟糕。使用容器和本指南将使得新版本升级非常简单。 + * **易于部署和升级**:即使向每个人都提供一套详细说明来安装一个项目的工具集,也可能会有人翻车。问题也可能是由于每个人对自己的 Linux 环境的个性化修改导致的。在团队中使用不同的 Linux 发行版(或者其他操作系统),情况可能还会变得更复杂。当需要将工具集升级到下一版本时,问题很快就会变得更糟糕。使用容器和本指南将使得新版本升级非常简单。 -我在项目中容器化构建系统的经验显然很有价值,因为它可以缓解上述问题。我倾向于使用 Docker 作为容器工具,虽然在相对特殊的环境中安装和网络配置仍可能出现问题,尤其是当你在一个使用复杂代理的企业环境中工作时。但至少现在我需要解决的构建系统问题已经很少了。 +对我在项目中使用的构建系统进行容器化的这些经验显然很有价值,因为它可以缓解上述问题。我倾向于使用 Docker 作为容器工具,虽然在相对特殊的环境中安装和网络配置仍可能出现问题,尤其是当你在一个使用复杂代理的企业环境中工作时。但至少现在我需要解决的构建系统问题已经很少了。 ### 漫步容器化的构建系统 -我创建了一个[教程存储库][2],随后你可以 clone 并检查它,或者按照本文内容进行操作。我将逐个介绍存储库中的文件。这个构建系统非常简单(它使用**gcc**)从而可以专注于构建系统结构上。 +我创建了一个[教程存储库][2],随后你可以克隆并检查它,或者按照本文内容进行操作。我将逐个介绍存储库中的文件。这个构建系统非常简单(它运行 `gcc`),从而可以让你专注于这个构建系统结构上。 ### 构建系统需求 我认为构建系统中有两个关键点: - * **标准化构建调用**:我希望能够指定一些形如 **/path/to/workdir** 的工作目录来构建代码。我希望以如下形式调用构建: + * **标准化构建调用**:我希望能够指定一些形如 `/path/to/workdir` 的工作目录来构建代码。我希望以如下形式调用构建: ./build.sh /path/to/workdir - 为了使得示例的结构足够简单(以便说明),我将假定输出也在 **/path/to/workdir** 路径下的某处生成。(否则,将增加容器中显示的卷的数量,虽然这并不困难,但解释起来比较麻烦。) - * **通过 shell 自定义构建调用**:有时,工具集会以出乎意料的方式被调用。除了标准的工具集调用 **build.sh** 之外,如果需要还可以为 **build.sh** 添加一些选项。但我一直希望能够有一个可以直接调用工具集命令的 shell。在这个简单的示例中,有时我想尝试不同的 **gcc** 优化选项并查看效果。为此,我希望调用: + 为了使得示例的结构足够简单(以便说明),我将假定输出也在 `/path/to/workdir` 路径下的某处生成。(否则,将增加容器中显示的卷的数量,虽然这并不困难,但解释起来比较麻烦。) + * **通过 shell 自定义构建调用**:有时,工具集会以出乎意料的方式被调用。除了标准的工具集调用 `build.sh` 之外,如果需要还可以为 `build.sh` 添加一些选项。但我一直希望能够有一个可以直接调用工具集命令的 shell。在这个简单的示例中,有时我想尝试不同的 `gcc` 优化选项并查看效果。为此,我希望调用: ./shell.sh /path/to/workdir - 这将让我得到一个容器内部的 Bash shell,并且可以调用工具集和访问我的**工作目录 workdir**,从而我可以根据需要尝试使用这个工具集。 + 这将让我得到一个容器内部的 Bash shell,并且可以调用工具集和访问我的工作目录(`workdir`),从而我可以根据需要尝试使用这个工具集。 -### 构建系统架构 +### 构建系统的架构 为了满足上述基本需求,这是我的构架系统架构: ![Container build system architecture][3] -在底部的 **workdir** 代表软件开发者用于构建的任意软件源码。通常,这个 **workdir** 是一个源代码的存储库。在构建之前,最终用户可以通过任何方式来操纵这个存储库。例如,如果他们使用 **git** 作为版本控制工具的话,可以使用 **git checkout** 切换到他们正在工作的功能分支上并添加或修改文件。这样可以使得构建系统独立于 **workdir** 之外。 +在底部的 `workdir` 代表软件开发者用于构建的任意软件源码。通常,这个 `workdir` 是一个源代码的存储库。在构建之前,最终用户可以通过任何方式来操纵这个存储库。例如,如果他们使用 `git` 作为版本控制工具的话,可以使用 `git checkout` 切换到他们正在工作的功能分支上并添加或修改文件。这样可以使得构建系统独立于 `workdir` 之外。 -顶部的三个模块共同代表了容器化的构建系统。最左边的黄色模块代表最终用户与构建系统交互的脚本(**build.sh** 和 **shell.sh**)。 +顶部的三个模块共同代表了容器化的构建系统。最左边的黄色模块代表最终用户与构建系统交互的脚本(`build.sh` 和 `shell.sh`)。 -在中间的红色模块是 Dockerfile 和相关的脚本 **build_docker_image.sh**。开发者(在这个例子中指我)通常将执行这个脚本并生成容器镜像(事实上我多次执行它直到一切正常为止,但这是另一个故事)。然后我将镜像分发给最终用户,例如通过 container trusted registry 进行分发。最终用户将需要这个镜像。另外,他们将 clone 构建系统存储库(即一个与[教程存储库][2]等效的存储库)。 +在中间的红色模块是 Dockerfile 和相关的脚本 `build_docker_image.sh`。开发运营者(在这个例子中指我)通常将执行这个脚本并生成容器镜像(事实上我多次执行它直到一切正常为止,但这是另一回事)。然后我将镜像分发给最终用户,例如通过容器信任注册库container trusted registry进行分发。最终用户将需要这个镜像。另外,他们将克隆构建系统的存储库(即一个与[教程存储库][2]等效的存储库)。 -当最终用户调用 **build.sh** 或者 **shell.sh** 时,容器内将执行右边的 **run_build.sh** 脚本。接下来我将详细解释这些脚本。这里的关键是最终用户不需要为了使用而去了解任何关于红色或者蓝色模块或者容器工作原理的知识。 +当最终用户调用 `build.sh` 或者 `shell.sh` 时,容器内将执行右边的 `run_build.sh` 脚本。接下来我将详细解释这些脚本。这里的关键是最终用户不需要为了使用而去了解任何关于红色或者蓝色模块或者容器工作原理的知识。 ### 构建系统细节 -把教程存储库的文件结构映射到这个系统结构上。我曾将这个原型结构用于相对复杂构建系统,因此它的简单并不会造成任何限制。下面我列出存储库中相关文件的树结构。文件夹 **dockerize-tutorial** 能用构建系统的其他任何名称代替。在这个文件夹下,我用 **workdir** 的路径作参数调用 **build.sh** 或 **shell.sh**。 +把教程存储库的文件结构映射到这个系统结构上。我曾将这个原型结构用于相对复杂构建系统,因此它的简单并不会造成任何限制。下面我列出存储库中相关文件的树结构。文件夹 `dockerize-tutorial` 能用构建系统的其他任何名称代替。在这个文件夹下,我用 `workdir` 的路径作参数调用 `build.sh` 或 `shell.sh`。 ``` dockerize-tutorial/ @@ -76,9 +78,9 @@ dockerize-tutorial/         └── run_build.sh ``` -请注意,我上面特意没列出 **example_workdir**,你能在教程存储库中找到。实际的源码通常存放在单独的存储库中,而不是构建工具库中的一部分;本教程为了不必处理两个存储库,所以我将它包含在这个存储库中。 +请注意,我上面特意没列出 `example_workdir`,但你能在教程存储库中找到它。实际的源码通常存放在单独的存储库中,而不是构建工具库中的一部分;本教程为了不必处理两个存储库,所以我将它包含在这个存储库中。 -如果你只对概念感兴趣,本教程并非必须的,因为我将解释所有文件。但是如果你继续本教程(并且已经安装 Docker),首先使用以下命令来构建容器镜像 **swbuilder:v1**: +如果你只对概念感兴趣,本教程并非必须的,因为我将解释所有文件。但是如果你继续本教程(并且已经安装 Docker),首先使用以下命令来构建容器镜像 `swbuilder:v1`: ``` cd dockerize-tutorial/swbuilder/ @@ -86,14 +88,14 @@ cd dockerize-tutorial/swbuilder/ docker image ls  # resulting image will be swbuilder:v1 ``` -然后调用 **build.sh**: +然后调用 `build.sh`: ``` cd dockerize-tutorial ./build.sh ~/repos/dockerize-tutorial/example_workdir ``` -下面是 [build.sh][4] 的代码。这个脚本从容器镜像 **swbuilder:v1** 实例化一个容器。而这个容器实例映射了两个卷:一个将文件夹 **example_workdir** 挂载到容器内部路径 **/workdir** 上,第二个则将容器外的文件夹 **dockerize-tutorial/swbuilder/scripts** 挂载到容器内部路径 **/scripts** 上。 +下面是 [build.sh][4] 的代码。这个脚本从容器镜像 `swbuilder:v1` 实例化一个容器。而这个容器实例映射了两个卷:一个将文件夹 `example_workdir` 挂载到容器内部路径 `/workdir` 上,第二个则将容器外的文件夹 `dockerize-tutorial/swbuilder/scripts` 挂载到容器内部路径 `/scripts` 上。 ``` docker container run                              \ @@ -104,18 +106,18 @@ docker container run                              \     build ``` -另外,**build.sh** 还会用你的用户名(以及组,本教程假设两者一致)去运行容器,以便在访问构建输出时不出现文件权限问题。 +另外,`build.sh` 还会用你的用户名(以及组,本教程假设两者一致)去运行容器,以便在访问构建输出时不出现文件权限问题。 -请注意,[**shell.sh**][5] 和 **build.sh** 大体上是一致的,除了两点不同:**build.sh** 会创建一个名为 **build_swbuilder** 的容器,而 **shell.sh** 则会创建一个名为 **shell_swbuilder** 的容器。这样一来,当其中一个脚本运行时另一个脚本被调用也不会产生冲突。 +请注意,[shell.sh][5] 和 `build.sh` 大体上是一致的,除了两点不同:`build.sh` 会创建一个名为 `build_swbuilder` 的容器,而 `shell.sh` 则会创建一个名为 `shell_swbuilder` 的容器。这样一来,当其中一个脚本运行时另一个脚本被调用也不会产生冲突。 -两个脚本之间的另一处关键不同则在于最后一个参数:**build.sh** 传入参数 **build** 而 **shell.sh** 则传入 **shell**。如果你看了用于构建容器镜像的 [Dockerfile][6],就会发现最后一行包含了下面的 **ENTRYPOINT** 语句。这意味着上面的 **docker container run** 调用将使用 **build** 或 **shell** 作为唯一的输入参数来执行 **run_build.sh** 脚本。 +两个脚本之间的另一处关键不同则在于最后一个参数:`build.sh` 传入参数 `build` 而 `shell.sh` 则传入 `shell`。如果你看了用于构建容器镜像的 [Dockerfile][6],就会发现最后一行包含了下面的 `ENTRYPOINT` 语句。这意味着上面的 `docker container run` 调用将使用 `build` 或 `shell` 作为唯一的输入参数来执行 `run_build.sh` 脚本。 ``` # run bash script and process the input command ENTRYPOINT [ "/bin/bash", "/scripts/run_build.sh"] ``` -[**run_build.sh**][7] 使用这个输入参数来选择启动 Bash shell 还是调用 **gcc** 来构建 **helloworld.c** 项目。一个真正的构建系统通常会使用 Makefile 而非直接运行 **gcc**。 +[run_build.sh][7] 使用这个输入参数来选择启动 Bash shell 还是调用 `gcc` 来构建 `helloworld.c` 项目。一个真正的构建系统通常会使用 Makefile 而非直接运行 `gcc`。 ``` cd /workdir @@ -129,17 +131,15 @@ elif [ $1 = "build" ]; then fi ``` -在使用时,如果你需要传入多个参数,当然也是可以的。我处理过的构建系统,构建通常是对给定的项目调用 **make**。如果一个构建系统有非常复杂的构建调用,则你可以让 **run_build.sh** 调用 **workdir** 下最终用户编写的特定脚本。 +在使用时,如果你需要传入多个参数,当然也是可以的。我处理过的构建系统,构建通常是对给定的项目调用 `make`。如果一个构建系统有非常复杂的构建调用,则你可以让 `run_build.sh` 调用 `workdir` 下最终用户编写的特定脚本。 ### 关于 scripts 文件夹的说明 -你可能想知道为什么 **scripts** 文件夹位于目录树深处而不是位于存储库的顶层。两种方法都是可行的,但我不想鼓励最终用户到处乱翻并修改里面的脚本。将它放到更深的地方是一个让他们更难乱翻的方法。另外,我也可以添加一个 **.dockerignore** 文件去忽略 **scripts** 文件夹,因为它不是容器必需的部分。但因为它很小,所以我没有这样做。 +你可能想知道为什么 `scripts` 文件夹位于目录树深处而不是位于存储库的顶层。两种方法都是可行的,但我不想鼓励最终用户到处乱翻并修改里面的脚本。将它放到更深的地方是一个让他们更难乱翻的方法。另外,我也可以添加一个 `.dockerignore` 文件去忽略 `scripts` 文件夹,因为它不是容器必需的部分。但因为它很小,所以我没有这样做。 ### 简单而灵活 -尽管这一方法很简单,但我将其用于某些非常特殊的构建系统时,发现它其实非常灵活。相对稳定的部分(例如,一年仅修改数次的给定工具集)被固定在容器镜像内。较为灵活的部分则以脚本的形式放在镜像外。这使我能够简单地通过修改脚本并将更改推送到构建系统存储库来修改调用工具集的方式。用户所需要做的是将更改拉到本地的构建系统存储库中,这通常是非常快的(与更新 Docker 镜像不同)。这种结构使其能够拥有尽可能多的卷和脚本,同时使最终用户摆脱复杂性。 - -你将如何修改你的应用来针对容器化环境进行优化呢? +尽管这一方法很简单,但我在几个相当不同的构建系统中使用过,发现它相当灵活。相对稳定的部分(例如,一年仅修改数次的给定工具集)被固定在容器镜像内。较为灵活的部分则以脚本的形式放在镜像外。这使我能够通过修改脚本并将更改推送到构建系统存储库中,轻松修改调用工具集的方式。用户所需要做的是将更改拉到本地的构建系统存储库中,这通常是非常快的(与更新 Docker 镜像不同)。这种结构使其能够拥有尽可能多的卷和脚本,同时使最终用户摆脱复杂性。 -------------------------------------------------------------------------------- @@ -147,8 +147,8 @@ via: https://opensource.com/article/20/4/how-containerize-build-system 作者:[Ravi Chandran][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/LazyWolfLin) -校对:[校对者ID](https://github.com/校对者ID) +译者:[LazyWolfLin](https://github.com/LazyWolfLin) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 89fa2de22af8fdfe08b9749bbf8e992c34c9e352 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 19 May 2020 08:57:32 +0800 Subject: [PATCH 0746/1809] PUB @LazyWolfLin https://linux.cn/article-12232-1.html --- .../20200414 How I containerize a build system.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200414 How I containerize a build system.md (99%) diff --git a/translated/tech/20200414 How I containerize a build system.md b/published/20200414 How I containerize a build system.md similarity index 99% rename from translated/tech/20200414 How I containerize a build system.md rename to published/20200414 How I containerize a build system.md index f1590ef480..e268f779ff 100644 --- a/translated/tech/20200414 How I containerize a build system.md +++ b/published/20200414 How I containerize a build system.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (LazyWolfLin) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12232-1.html) [#]: subject: (How I containerize a build system) [#]: via: (https://opensource.com/article/20/4/how-containerize-build-system) [#]: author: (Ravi Chandran https://opensource.com/users/ravichandran) From 1b60803cda0c08558054138a6c72d71d9fe5fe12 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Tue, 19 May 2020 23:14:18 +0800 Subject: [PATCH 0747/1809] hankchow translated --- ...508 5 ways to split your Linux terminal.md | 169 ------------------ ...508 5 ways to split your Linux terminal.md | 159 ++++++++++++++++ 2 files changed, 159 insertions(+), 169 deletions(-) delete mode 100644 sources/tech/20200508 5 ways to split your Linux terminal.md create mode 100644 translated/tech/20200508 5 ways to split your Linux terminal.md diff --git a/sources/tech/20200508 5 ways to split your Linux terminal.md b/sources/tech/20200508 5 ways to split your Linux terminal.md deleted file mode 100644 index 1809296e6a..0000000000 --- a/sources/tech/20200508 5 ways to split your Linux terminal.md +++ /dev/null @@ -1,169 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 ways to split your Linux terminal) -[#]: via: (https://opensource.com/article/20/5/split-terminal) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -5 ways to split your Linux terminal -====== -What's your favorite terminal multiplexer? Take our poll. Then read -about how Linux offers plenty of ways for you to split your terminal so -you can multitask. -![4 different color terminal windows with code][1] - -Is there anything better than a warmly flickering Linux terminal? - -Sure there is: two warmly flickering Linux terminals. In fact, the more, the better. - -Long ago, [terminals were physical devices][2], but of course, today, they're just emulated as an application on your computer. If you prefer the terminal as your interface, you probably know that one terminal is rarely enough. Inevitably, you're going to open a new terminal or a new tab so you can work in it while your first is busy compiling or converting or otherwise processing data. - -If you're a sysadmin, then you know you're going to need at least four open windows while you work on several systems at the same time. - -Terminal applications with tabs have existed on Linux for a long time, and luckily, that trend seems to have caught on such that it's an expected feature of a modern terminal. And yet, sometimes it's distracting or inconvenient to flip back and forth between tabs. - -The only answer is a split screen so that two or more terminals can exist at the same time within just one application window. There are many tools in your Linux kit to help you slice and dice your consoles. - -### Shells, terminals, and consoles - -Before you slice and dice screens, you should know the difference between a terminal, a shell, and a "console." To get the full picture, read my article on the subject over on the [Enable Sysadmin][2] blog. - -The short version: - - * A shell is an input and output screen with a prompt. There's technically a shell running somewhere underneath your [POSIX][3] desktop, even when it's not visible (because it's a shell that launched your user session). - * A terminal is an application running within a graphics server (such as X11 or Wayland) with a shell loaded into it. A terminal is only running when you have a terminal window launched. It's more or less a "portal" into your shell. - * "Console" or "virtual console" is a term usually used to imply a shell running outside of your desktop. You can get to a virtual console by pressing **Alt-Ctrl-F2** (more are usually available from **F3** up to **F7**, with **F1** or **F7** representing your desktop, depending on your distribution). - - - -Some applications let you split your shell or console, while others let you split your terminal. - -### tmux - -![tmux terminal][4] - -Arguably the most flexible and capable of screen splitters, [tmux][5] is a keyboard-centric terminal multiplexer, meaning that you can "layer" one console on top of another and then switch between the two. You can also split a console view in half (or thirds or fourths, and so on) so you can see other consoles next to it. - -All controls center around the keyboard, which means you never have to take your hand off the keys in search of a mouse, but also that you must learn some new keyboard combos. - -If you're using tmux primarily for screen splitting, then the only commands you really need are these: - - * **Ctrl-B %** for a vertical split (one shell on the left, one shell on the right) - * **Ctrl-B"** for a horizontal split (one shell at the top, one shell at the bottom) - * **Ctrl-B O** to make the other shell active - * **Ctrl-B ?** for help - * **Ctrl-B d** detach from Tmux, leaving it running in the background (use **tmux attach** to reenter) - - - -There are many benefits to tmux, including the ability to start a tmux session on one computer, and then join that same session from another computer remotely. It essentially daemonizes your shell. - -It's with tmux running on a Pi, for example, that I can stay logged into IRC on a permanent basis—I start tmux on the Pi, and then log in from whatever computer I happen to be on. When I log out, tmux continues to run, patiently waiting for me to reattach to the session from a different computer. - -### GNU Screen - -![GNU Screen terminal][6] - -Similar to tmux, [GNU Screen][7] is a shell multiplexer. You can detach and reattach from a running session, and you can split the screen both horizontally and vertically. - -Screen is a little clunkier than tmux. Its default key binding is **Ctrl-A**, which also happens to be Bash's keyboard shortcut to go to the beginning of a line. This means that if you have Screen running, you must press **Ctrl-A** twice instead of just once to go to the beginning of the line. Personally, I redefine the trigger key to **Ctrl-J** with this line in **$HOME/.screenrc**: - - -``` -`escape ^jJ` -``` - -Screen's split function works well, but it leaves out a few pleasantries that tmux lacks. For instance, when you split your shell, a new shell does not start in the other panel. You have to navigate to the other space with **Ctrl-A Tab** (or **Ctrl-J** if you redefine your keyboard shortcut as I do) and create a new shell manually with **Ctrl-A C**. - -Unlike tmux, a split doesn't go away when you exit a shell, which is a design feature that's quite nice in some instances but can also sometimes be cumbersome because it forces you to manage your splits manually. - -Still, Screen is a reliable and flexible application that you can run should you find that **tmux** is unavailable to you. - -Here are the basic split commands, using the default keyboard shortcuts: - - * **Ctrl-A |** for a vertical split (one shell on the left, one shell on the right) - * **Ctrl-A S** for a horizontal split (one shell at the top, one shell at the bottom) - * **Ctrl-A Tab** to make the other shell active - * **Ctrl-A ?** for help - * **Ctrl-A d** detach from Screen, leaving it running in the background (use **screen -r** to reenter) - - - -### Konsole - -![Konsole screen][8] - -[Konsole][9] is the terminal bundled along with the KDE Plasma desktop. Like KDE itself, Konsole is famous for being highly customizable and powerful. - -Among its many features is the ability to split its window, similar to both tmux and GNU Screen. Because Konsole is a graphical terminal, you can control its split-screen feature with your mouse instead of your keyboard. - -Splitting is found in the **View** menu of Konsole. You can split your window horizontally or vertically. To change which panel is active, just click on it. Each panel is a unique terminal, so it can have its own theme and tabs. - -Unlike tmux and GNU Screen, you can't detach and reattach from Konsole. Like most graphical applications, you use Konsole while you're physically in front of it, and you lose access to it when you're away (unless you use remote desktop software). - -### Emacs - -![Emacs rpg][10] - -Emacs isn't exactly a terminal multiplexer, but its interface supports splitting and resizing, and it has a built-in terminal. - -If you're in Emacs on a daily basis anyway, the ability to split your window between essentially different applications means you never have to leave the familiarity and comfort of your favorite text editor. Furthermore, because the Emacs **eshell** module is implemented in eLISP, you can interact with it using the same commands you use in Emacs itself, making it trivial to copy and yank long file paths or command output. - -If you're using Emacs in a graphical window, you can perform some actions with your mouse. It's faster to use keyboard shortcuts, and some are more or less required. For instance, you can change which panel is the active one by clicking into it, and you can resize the proportions of your split screen with your mouse. - -These are the important keyboard shortcuts: - - * **Ctrl-X 3** for a vertical split (one shell on the left, one shell on the right) - * **Ctrl-X 2** for a horizontal split (one shell at the top, one shell at the bottom) - * **Ctrl-X O** to make the other shell active (you can also do this with the mouse) - * **Ctrl-X 0** (that’s a zero) close the current panel - - - -Similar to tmux and GNU Screen, you can detach and reattach from Emacs as long as you run **emacs-client**. - -### Window manager - -![Ratpoison split screen][11] - -Should you think a text editor that can split its screen and load a terminal is amazing, imagine your desktop serving the same purpose. There are Linux desktops, like [Ratpoison][12], [Herbsluftwm][13], i3, Awesome, and even the KDE Plasma desktop with specific settings enabled, that present each application window to you as a fixed tile in a desktop grid. - -Instead of windows floating "above" your desktop, they remain in a predictable place so you can change from one to the other. You can open any number of terminals within your grid, emulating a terminal multiplexer. In fact, you could even load a terminal multiplexer in your desktop multiplexer. - -And there's nothing stopping you from loading Emacs with split buffers inside of that. No one knows what happens if you take it further than that, and most Linux users agree it's best not to find out. - -Unlike tmux and GNU Screen, you can't detach and reattach from your desktop unless you count using remote desktop software. - -### Other options - -Believe it or not, these aren't the only options you have to split your screen on Linux. There are other terminal emulators, like [Tilix][14] and Terminator before it, that can split into sections, and applications with embedded terminal components, and much more. Tell us your favorite way of splitting up your workspace in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/5/split-terminal - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/freedos.png?itok=aOBLy7Ky (4 different color terminal windows with code) -[2]: https://www.redhat.com/sysadmin/terminals-shells-consoles -[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[4]: https://opensource.com/sites/default/files/uploads/terminal-split-tmux2.png (tmux terminal) -[5]: https://github.com/tmux/tmux -[6]: https://opensource.com/sites/default/files/uploads/terminal-split-screen.png (GNU Screen terminal) -[7]: https://www.gnu.org/software/screen/ -[8]: https://opensource.com/sites/default/files/uploads/konsole.jpg (Konsole screen) -[9]: https://konsole.kde.org -[10]: https://opensource.com/sites/default/files/uploads/emacs-rpg_0.jpg (Emacs rpg) -[11]: https://opensource.com/sites/default/files/uploads/advent-ratpoison-split_0.jpg (Ratpoison split screen) -[12]: https://opensource.com/article/19/12/ratpoison-linux-desktop -[13]: https://opensource.com/article/19/12/herbstluftwm-linux-desktop -[14]: https://gnunn1.github.io/tilix-web/ diff --git a/translated/tech/20200508 5 ways to split your Linux terminal.md b/translated/tech/20200508 5 ways to split your Linux terminal.md new file mode 100644 index 0000000000..63783e1be2 --- /dev/null +++ b/translated/tech/20200508 5 ways to split your Linux terminal.md @@ -0,0 +1,159 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 ways to split your Linux terminal) +[#]: via: (https://opensource.com/article/20/5/split-terminal) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +5 种拆分 Linux 终端的方法 +====== +> 本文介绍了 Linux 提供的拆分终端的方法,它能够帮助你完成多任务工作。那么,你最喜欢哪一款终端复用工具呢? + +![4 different color terminal windows with code][1] + +没有什么问题是不能用一个 Linux 终端解决的,如果不行,那就用两个。 + +很早以前,[终端其实是一个物理设备][2],而现在的终端实际上是在计算机上被模拟出来的一个应用程序。当你使用终端和计算机进行交互的时候,就会发现,只打开一个终端是不够用的。在进行编译、数据处理等长时间任务的时候,你不得不打开一个新终端或新选项卡tab来同时进行其它工作。 + +如果你是系统管理员,你就需要更多的终端窗口,以便连接到多个不同的主机上并行工作了。 + +在 Linux 系统中,终端应用程序在很久之前已经开始带有选项卡功能了。而现在的终端应用程序里,选项卡已经是标配功能了,这是非常流行的趋势。尽管如此,工作的时候在多个选项卡之间来回切换,或多或少也会分散我们的注意力,甚至带来不便。 + +而最好的解决方案就是将整个屏幕划分为多个部分,这样多个终端就可以在同一个终端应用程序窗口中同时存在。Linux 套件中也有很多相关的工具可以实现这一功能。 + +### Shell、终端和控制台 + +在此之前,我们首先要明确 Shell、终端terminal控制台console这三个概念。想要详细了解的话,请参阅 [Enable Sysadmin][2] 博客上的相关文章。 + +太长不看版: + + * Shell 是带有命令提示符prompt的用于输入、输出的界面。准确地说,[POSIX][3] 桌面底层也运行着一个 Shell,无论这个 Shell 是否对用户可见,因为用户会话就是由这个 Shell 启动的。 + * 终端是在图形界面服务器(例如 X11 或 Wayland)中运行的应用程序,其中加载了一个 Shell。只有在终端窗口启动之后,才算是运行了一个终端。终端可以认为是操作 Shell 的一个入口。 + * 控制台(或称“虚拟控制台”)通常表示在桌面环境以外使用的 Shell,你可以通过 `Alt+Ctrl+F2` 进入控制台,通常情况下从 `F3` 到 `F7` 都是不同的控制台,其中桌面环境有可能是 `F1` 或者 `F7`,这在不同的发行版中可能会有所不同。 + +因此,一些应用程序提供的功能是拆分 Shell 或者控制台,一些应用程序的功能则是拆分终端。 + +### tmux + +![tmux terminal][4] + +[tmux][5] 可以说是最灵活最强大的屏幕拆分工具了,它通过键盘控制对多个终端的复用,因此你可以将一个控制台叠放在另一个控制台上面,并在两个控制台之间切换。你还可以将整个屏幕等分为多个控制台,以便同时观察不同控制台上的状况。 + +tmux 的所有操作都是通过键盘完成的,这就意味着你的手不需要离开键盘去寻找鼠标。为此,你需要记住一些按键组合。 + +如果你只用 tmux 来做屏幕拆分,那你只需要记住一下这些命令: + + * `Ctrl-B %` 竖直拆分屏幕(两个 Shell 分别位于左右) + * `Ctrl-B "` 水平拆分屏幕(两个 Shell 分别位于上下) + * `Ctrl-B O` 切换到另一个 Shell + * `Ctrl-B ?` 查看帮助 + * `Ctrl-B d` 断开 tmux 并让其在后台运行(可以使用 `tmux attach` 重新进入) + +tmux 的一大好处是,在一台计算机上启动 tmux 会话之后,也可以从另一台计算机上进入到这个会话,由此可以看出,tmux 对 Shell 进行了守护daemonize。 + +例如,当我在树莓派上运行 tmux,我就可以从计算机上连接到树莓派并登录 IRC,当我断开连接时,树莓派上的 tmux 会继续运行,并等待我的下一次连接,在此期间 IRC 是处于持续登录状态的。 + +### GNU Screen + +![GNU Screen terminal][6] + +[GNU Screen][7] 也是一个 Shell 复用工具,类似于 tmux,你可以在断开一个活动会话后重连到其中,它也支持竖直或水平拆分屏幕。 + +Screen 的灵活性比 tmux 要弱一些。它默认的绑定按键组合是 `Ctrl-A`,和 Bash 中光标移动到行首的快捷键是一样的。因此,当你正在运行 Screen 的时候,如果想要将光标移动到行首,就需要多按一次 `Ctrl-A`。而我自己的做法是,在 `$HOME/.screenrc` 文件中将绑定按键组合重新设置为 `Ctrl-J`。 + + +``` +`escape ^jJ` +``` + +尽管 Screen 在屏幕拆分功能上做得很好,但 tmux 上的一些缺点在 Screen 上也同样存在。例如在拆分 Shell 时,新的 Shell 不会在一个新的面板中启动,而是需要使用 `Ctrl-A Tab` 导航到另一个空间(如果你按照我的方式重新设置了按键组合,需要对应地把 `Ctrl-A` 改为 `Ctrl-J`),然后通过 `Ctrl-A C` 手动创建一个新的 Shell。 + +和 tmux 不同的是,Screen 在推出一个 Shell 的时候,屏幕拆分状态不会改变,这样的设计在某些情况下是比较适合的,但麻烦之处在于需要手动管理屏幕拆分状态。 + +尽管如此,Screen 还是一个相当可靠灵活的应用程序,在无法使用 tmux 的时候,你可以选择 Screen 作为备选方案。 + +在默认按键方案下,Screen 常用的基本命令包括: + + * `Ctrl-A |` 竖直拆分屏幕(两个 Shell 分别位于左右) + * `Ctrl-A S` 水平拆分屏幕(两个 Shell 分别位于上下) + * `Ctrl-A Tab` 切换到另一个 Shell + * `Ctrl-A ?` 查看帮助 + * `Ctrl-A d` 断开 Screen 并让其在后台运行(可以使用 `screen -r` 重新进入) + +### Konsole + +![Konsole screen][8] + +[Konsole][9] 是 KDE Plasma 桌面使用的终端应用程序。和 KDE 一样,Konsole 也以高度可定制、功能强大的特点而著称。 + +和 tmux、GNU Screen 类似,Konsole 也具有拆分屏幕的功能。由于 Konsole 是图形界面的终端,因此还可以用鼠标来控制它的屏幕拆分。 + +Konsole 的屏幕拆分功能在“查看View”菜单中。它也支持竖直和水平方向的拆分,只要点击鼠标就可以切换到另一个面板上。每个面板都是一个独立的终端,因此都可以拥有独立的主题和标签页。 + +Konsole 和 tmux、GNU Screen 最大的不同之处在于不能断开和重新连接 Konsole。除非使用远程桌面软件,否则只能在打开 Konsole 时使用,这一点和大多数图形界面应用程序是一样的。 + +### Emacs + +![Emacs rpg][10] + +严格来说,Emacs 并不算是一个终端复用工具,但它的使用界面支持拆分和调整大小,同时还带有一个内建的终端。 + +如果 Emacs 是你日常使用的文本编辑器,你就可以在不关闭编辑器的情况下,在不同的应用程序之间轻松互相切换。由于 Emacs eshell 模块是通过 eLISP 实现的,因此你可以在 Emacs 中使用相同的命令进行交互,让一些繁琐的操作变得更为简单。 + +如果你是在图形界面中使用 Emacs,还可以使用鼠标进行操作。例如通过点击切换面板、用鼠标调整拆分屏幕的的大小等等。尽管如此,键盘的操作速度还是更快,因此记住一些键盘快捷键还是很有必要的。 + +Emacs 的一些重要快捷键包括: + + * `Ctrl-X 3` 竖直拆分屏幕(两个 Shell 分别位于左右) + * `Ctrl-X 2` 水平拆分屏幕(两个 Shell 分别位于上下) + * `Ctrl-X O` 切换到另一个 Shell(你也可以使用鼠标操作) + * `Ctrl-X 0` 关闭当前面板 + +如果你运行了 emacs-client 的话,就可以像 tmux 和 GNU Screen 一样断开和重新连接到 Emacs 了。 + +### Window manager + +![Ratpoison split screen][11] + +除了文本编辑器之外,一些 Linux 桌面也同样具有拆分屏幕、加载终端这样的功能。例如 [Ratpoison][12]、[Herbsluftwm][13]、i3、Awesome,甚至是启用了特定设置的 KDE Plasma 桌面,都可以将多个应用程序在桌面上分块显示。 + +这些桌面可以让各个应用程序占据屏幕的固定位置,而不是逐个叠放在一起,因此你可以在多个应用程序窗口之间轻松切换。你还可以打开多个终端,以达到终端复用的目的。更进一步,你还可以在桌面复用工具中加载终端复用工具。 + +And there's nothing stopping you from loading Emacs with split buffers inside of that. No one knows what happens if you take it further than that, and most Linux users agree it's best not to find out. + +和 tmux、GNU Screen 不同,你在断开与桌面的连接后无法重新连接到同一个桌面会话,除非你使用了远程桌面软件进行连接。 + +### 更多选择 + +除了上面介绍到的工具以外,还有诸如 [Tilix][14]、Terminator 这样的终端模拟器,它们同样可以实现屏幕拆分、嵌入终端组件等功能。欢迎在评论区分享你喜欢的终端拆分工具。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/split-terminal + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/freedos.png?itok=aOBLy7Ky (4 different color terminal windows with code) +[2]: https://www.redhat.com/sysadmin/terminals-shells-consoles +[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[4]: https://opensource.com/sites/default/files/uploads/terminal-split-tmux2.png (tmux terminal) +[5]: https://github.com/tmux/tmux +[6]: https://opensource.com/sites/default/files/uploads/terminal-split-screen.png (GNU Screen terminal) +[7]: https://www.gnu.org/software/screen/ +[8]: https://opensource.com/sites/default/files/uploads/konsole.jpg (Konsole screen) +[9]: https://konsole.kde.org +[10]: https://opensource.com/sites/default/files/uploads/emacs-rpg_0.jpg (Emacs rpg) +[11]: https://opensource.com/sites/default/files/uploads/advent-ratpoison-split_0.jpg (Ratpoison split screen) +[12]: https://opensource.com/article/19/12/ratpoison-linux-desktop +[13]: https://opensource.com/article/19/12/herbstluftwm-linux-desktop +[14]: https://gnunn1.github.io/tilix-web/ From 89d9cdc7080dd9badf31861bf6f2b0e12adef68c Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 20 May 2020 08:44:30 +0800 Subject: [PATCH 0748/1809] translated --- ...w to Handle Automatic Updates in Ubuntu.md | 125 ------------------ ...w to Handle Automatic Updates in Ubuntu.md | 125 ++++++++++++++++++ 2 files changed, 125 insertions(+), 125 deletions(-) delete mode 100644 sources/tech/20200501 How to Handle Automatic Updates in Ubuntu.md create mode 100644 translated/tech/20200501 How to Handle Automatic Updates in Ubuntu.md diff --git a/sources/tech/20200501 How to Handle Automatic Updates in Ubuntu.md b/sources/tech/20200501 How to Handle Automatic Updates in Ubuntu.md deleted file mode 100644 index 7a973664ce..0000000000 --- a/sources/tech/20200501 How to Handle Automatic Updates in Ubuntu.md +++ /dev/null @@ -1,125 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Handle Automatic Updates in Ubuntu) -[#]: via: (https://itsfoss.com/auto-updates-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Handle Automatic Updates in Ubuntu -====== - -_**Brief: This tutorial teaches you how to handle the unattended upgrade i.e. the automatic system updates in Ubuntu Linux.**_ - -Sometimes, when you try to [shutdown your Ubuntu system][1], you may come across this screen that stops you from shutting down: - -**Unattended-upgrade in progress during shutdown, please don’t turn off the computer.** - -![Unattended Upgrade In Progress In Ubuntu][2] - -You might wonder what is this “unattended upgrade” and how come it is running without your knowledge. - -The reason is that [Ubuntu][3] takes your system’s security very seriously. By default, it automatically checks for system updates daily and if it finds any security updates, it downloads those updates and install them on its own. For normal system and application updates, it notifies you via the Software Updater tool. - -Since all this happens in the background, you don’t even realize it until you try to shutdown your system or try to install applications on your own. - -Trying to install a new software when these unattended upgrades are in progress leads to the famous [could not get lock error][4]. - -![][5] - -As you can see, the automatic updates present a couple of minor annoyance. You may choose to disable the auto updates but that would mean that you’ll have to check and [update your Ubuntu system][6] manually all the time. - -Do you really need to disable auto updates? - -Please note that this is a security feature. Linux allows you to do practically everything in your system even disabling these security features. -But in my opinion, as a regular user, _**you should not disable the automatic updates**_. It keeps your system safe after all. -For the sake of your system’s security, you may tolerate the minor annoyances that come with the automatic updates. - -Now that you have been warned and you think it is better to take up the additional task of manually updating your system, let’s see how to handle the auto updates. - -As always, there are two ways to do it: GUI and command line. I’ll show you both methods. - -I have used Ubuntu 20.04 here but the steps are valid for Ubuntu 18.04 and any other Ubuntu version. - -### Method 1: Disable automatic updates in Ubuntu graphically - -Go to the menu and look for ‘software & updates’ tool. - -![Software & Updates Settings][7] - -In here, go to Updates tab. Now look for the “Automatically check for updates”. By default it is set to Daily. - -You can change it to Never and your system will never check for updates on its own again. And if it won’t check for updates, it won’t find new updates to install. - -![Disable Auto Updates in Ubuntu Completely][8] - -If you do this, you must manually update your system from time to time. But that’s an additional chore to do and you may not remember it all the time. - -#### Slightly better way to handle auto updates in Ubuntu - -Personally, I would suggest to let it check for updates on its own. If you don’t want it installing the updates automatically, you can change that behavior to get notified about the availability of security updates. - -Keep “Automatically check for updates” to Daily and change “When there are security updates” option to “Display immediately” instead of “Download and install automatically”. - -![Get notified for security updates instead of automatically installing them][9] - -This way, it checks for updates and if there are updates, instead of installing them automatically in the background, the Software Updater tool notifies you that updates are available for your system. Your system already does that for normal system and software updates. - -![Get notified about security updates][10] - -With this setup, you won’t see the “unattended upgrades in progress” when you shutdown your system However, you may still encounter the ‘could not get lock’ error because two separate processes cannot use apt package manager at the same time. - -I believe this is a better solution, don’t you you think? - -As I promised both GUI and command line methods, let me show you how to disable unattended upgrades in the terminal. - -### How to disable automatic updates in Ubuntu using command line - -You’ll find the auto-upgrades settings in the **/etc/apt/apt.conf.d/20auto-upgrades** file. The default text editor in Ubuntu terminal is Nano so you can use this command to edit this configuration file: - -``` -sudo nano /etc/apt/apt.conf.d/20auto-upgrades -``` - -Now, if you don’t want your system to check for updates automatically, you can change the value of APT::Periodic::Update-Package-Lists to 0. - -``` -APT::Periodic::Update-Package-Lists "0"; -APT::Periodic::Unattended-Upgrade "0"; -``` - -If you want it to check for updates but don’t install the unattended-upgrades automatically, you can choose to set it like this: - -``` -APT::Periodic::Update-Package-Lists "1"; -APT::Periodic::Unattended-Upgrade "0"; -``` - -**In the end…** - -The automatic security updates are enabled automatically for a reason and I recommend you keep it like this. A couple of minor annoyances are not really worth risking the security of your system. What do you think? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/auto-updates-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/schedule-shutdown-ubuntu/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/unattended-upgrade-in-progress-in-ubuntu.png?ssl=1 -[3]: https://ubuntu.com/ -[4]: https://itsfoss.com/could-not-get-lock-error/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/Could_not_get_lock.jpg?ssl=1 -[6]: https://itsfoss.com/update-ubuntu/ -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-updates-settings-ubuntu-20-04.jpg?ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/disable-auto-updates-ubuntu.jpg?ssl=1 -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/handle-auto-updates-ubuntu.jpg?ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/updates-available-ubuntu.png?ssl=1 diff --git a/translated/tech/20200501 How to Handle Automatic Updates in Ubuntu.md b/translated/tech/20200501 How to Handle Automatic Updates in Ubuntu.md new file mode 100644 index 0000000000..f86886d82c --- /dev/null +++ b/translated/tech/20200501 How to Handle Automatic Updates in Ubuntu.md @@ -0,0 +1,125 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Handle Automatic Updates in Ubuntu) +[#]: via: (https://itsfoss.com/auto-updates-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Ubuntu 中处理自动更新 +====== + +_**简介:本教程教你如何处理无人值守的升级,即 Ubuntu Linux 的自动系统更新。**_ + +有时,当你尝试[关闭 Ubuntu 系统][1]时,可能看到这个阻止你关闭的页面: + +**关机正在进行无人值守升级,请不要关闭计算机。** + +![Unattended Upgrade In Progress In Ubuntu][2] + +你可能想知道什么是“无人值守的升级”,以及它是如何在你不知情的情况下运行的。 + +因为 [Ubuntu][3] 非常重视系统的安全性。默认情况下,它会每天自动检查系统更新,如果发现任何安全更新,那么会下载这些更新并自行安装。对于正常的系统和应用更新,它会通过软件更新程序通知你。 + +由于所有这些都是在后台发生的,因此你会直到关机或者尝试自己安装应用时才会意识到。 + +在进行这些无人值守的升级时尝试安装新软件会发生[无法获得锁的错误][4]。 + +![][5] + +如你所见,自动更新带来了一些小麻烦。你可以选择禁用自动更新,但这意味着你必须一直手动检查并[更新你的 Ubuntu 系统][6]。 + +你真的需要禁用自动更新吗? + +请注意,这是一项安全功能。Linux 实际上允许你禁用系统中的所有功能,甚至禁用这些安全功能。 +但是我认为,作为普通用户,_**你不应禁用自动更新**_。毕竟,它可以确保你的系统安全。 +为了确保系统的安全性,你可以忍受自动更新所带来的小麻烦。 + +现在,你已经收到警告,并认为最好承担手动更新系统的额外任务,让我们看看如何处理自动更新。 + +与往常一样,有两种方法可以做到:GUI 和命令行。 我将向您=你展示两种方法。 + +我在这里使用 Ubuntu 20.04,但是这些步骤对 Ubuntu 18.04 和任何其他 Ubuntu 版本均有效。 + +### 方法 1:以图形方式禁用 Ubuntu 中的自动更新 + +进入菜单并查找“软件和更新”工具。 + +![Software & Updates Settings][7] + +在此处,进入“更新”选项卡。查找“自动检查更新”。默认情况下,它设置为“每日”。 + +你可以将其更改为“从不”,你的系统将永远不会检查更新。如果不检查更新,它将不会找到要安装的新更新。 + +![Disable Auto Updates in Ubuntu Completely][8] + +如果这样做,那么必须不时手动更新系统。但是,这是额外的工作,你可能不会一直记得。 + +#### 在 Ubuntu 中处理自动更新的更好方法 + +就个人而言,我建议让它自己检查更新。如果你不希望它自动安装更新,那么可以更改该行为以通知有关安全更新的可用性。 + +保持“自动检查更新”为“每日”,然后将“有安全更新时”选项更改为“立即显示”,而不是“自动下载并安装”。 + +![Get notified for security updates instead of automatically installing them][9] + +这样,它会检查是否有更新,而不是在后台自动安装更新,软件更新程序会通知你更新可用于系统。你的系统已经完成正常的系统和软件更新。 + +![Get notified about security updates][10] + +使用此设置,关闭系统时将不会看到“正在进行的无人值守升级”。但是,由于两个不同的进程无法同时使用 apt 包管理器,因此你仍然可能会遇到“无法锁定”错误。 + +我相信这是一个更好的解决方案,你不认为是么? + +如我承诺的同时有 GUI 和命令行方法一样,让我向你展示如何在终端中禁用无人值守的升级。 + +### 如何在 Ubuntu 中使用命令行禁用自动更新 + +你可以在 **/etc/apt/apt.conf.d/20auto-upgrades** 中找到自动升级设置。Ubuntu 终端中的默认文本编辑器是 Nano,因此你可以使用以下命令来编辑此文件: + +``` +sudo nano /etc/apt/apt.conf.d/20auto-upgrades +``` + +现在,如果你不希望系统自动检查更新,那么可以将 APT::Periodic::Update-Package-Lists 的值更改为 0。 + +``` +APT::Periodic::Update-Package-Lists "0"; +APT::Periodic::Unattended-Upgrade "0"; +``` + +如果你希望它检查更新但不自动安装无人值守的升级,那么可以选择将其设置为: + +``` +APT::Periodic::Update-Package-Lists "1"; +APT::Periodic::Unattended-Upgrade "0"; +``` + +**最后** + +由于某种原因,启用了自动安全更新,建议你保持这种状态。小的烦恼实际上并不值得冒险损害系统安全性。你怎么看? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/auto-updates-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/schedule-shutdown-ubuntu/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/unattended-upgrade-in-progress-in-ubuntu.png?ssl=1 +[3]: https://ubuntu.com/ +[4]: https://itsfoss.com/could-not-get-lock-error/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/Could_not_get_lock.jpg?ssl=1 +[6]: https://itsfoss.com/update-ubuntu/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-updates-settings-ubuntu-20-04.jpg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/disable-auto-updates-ubuntu.jpg?ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/handle-auto-updates-ubuntu.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/updates-available-ubuntu.png?ssl=1 From 6c5fb3b3e545fb92239f2571725f041513310633 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 20 May 2020 08:50:16 +0800 Subject: [PATCH 0749/1809] translated --- ...to Check Uptime of MySQL-MariaDB Database Server on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md b/sources/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md index be88629967..a2070192d0 100644 --- a/sources/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md +++ b/sources/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3d60c1724cf2d17a06a2c51ee78abb22a7252c91 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Wed, 20 May 2020 22:37:27 +0800 Subject: [PATCH 0750/1809] TSL 20200323 How to create a personal file server with SSH on Linux --- ... personal file server with SSH on Linux.md | 137 ------------------ ... personal file server with SSH on Linux.md | 136 +++++++++++++++++ 2 files changed, 136 insertions(+), 137 deletions(-) delete mode 100644 sources/tech/20200323 How to create a personal file server with SSH on Linux.md create mode 100644 translated/tech/20200323 How to create a personal file server with SSH on Linux.md diff --git a/sources/tech/20200323 How to create a personal file server with SSH on Linux.md b/sources/tech/20200323 How to create a personal file server with SSH on Linux.md deleted file mode 100644 index 5ccabcab09..0000000000 --- a/sources/tech/20200323 How to create a personal file server with SSH on Linux.md +++ /dev/null @@ -1,137 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to create a personal file server with SSH on Linux) -[#]: via: (https://opensource.com/article/20/3/personal-file-server-ssh) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) - -How to create a personal file server with SSH on Linux -====== -Connecting to a remote Linux system over SSH is just plain easy. Here's -how to do it. -![Hand putting a Linux file folder into a drawer][1] - -The Raspberry Pi makes for a useful and inexpensive home server for lots of things. I most often use the [Raspberry Pi as a print server][2] to share a laser printer with other devices in our home or as a personal file server to store copies of projects and other data. - -I use this file server in various ways. Let's say I'm working on a project, such as a new book, and I want to make a snapshot copy of my work and all my associated files. In that case, I simply copy my **BookProject** folder to a **BookBackup** folder on the file server. - -Or if I'm cleaning up my local files, and I discover some files that I don't really need but I'm not yet ready to delete, I'll copy them to a **KeepForLater** folder on the file server. That's a convenient way to remove clutter from my everyday Linux system and offload infrequently used files to my personal file server. - -Setting up a Raspberry Pi—or any Linux system—as a personal file server doesn't require configuring Network File System (NFS) or Common Internet File System (CIFS) or tinkering with other file-sharing systems such as WebDAV. You can easily set up a remote file server using SSH. And here's how. - -### Set up SSHD on the remote system - -Your Linux system probably has the SSH daemon (sshd) installed. It may even be running by default. If not, you can easily set up SSH through whatever control panel you prefer on your Linux distribution. I run [Fedora ARM][3] on my Raspberry Pi, and I can access the control panel remotely by pointing my Pi's web browser to port 9090. (On my home network, the Raspberry Pi's IP address is **10.0.0.11**, so I connect to **10.0.0.11:9090**.) If the SSH daemon isn't running by default, you can set it to start automatically in Services in the control panel. - -![sshd in the list of system services][4] - -You can find sshd in the list of system services. - -![slider to activate sshd][5] - -Click the slider to activate **sshd** if it isn't already. - -### Do you have an account? - -Make sure you have an account on the remote system. It might be the same as the username you use on your local system, or it could be something different. - -On the popular Raspbian distribution, the default account username is **pi**. But other Linux distributions may require you to set up a unique new user when you install it. If you don't know your username, you can use your distribution's control panel to create one. On my Raspberry Pi, I set up a **jhall** account that matches the username on my everyday Linux desktop machine. - -![Set up a new account on Fedora Server][6] - -If you use Fedora Server, click the **Create New Account** button to set up a new account. - -![Set password or SSH key][7] - -Don't forget to set a password or add a public SSH key. - -### Optional: Share your SSH public key - -If you exchange your public SSH key with the remote Linux system, you can log in without having to enter a password. This step is optional; you can use a password if you prefer. - -You can learn more about SSH keys in these Opensource.com articles: - - * [Tools for SSH key management][8] - * [Graphically manage SSH keys with Seahorse][9] - * [How to manage multiple SSH keys][10] - * [How to enable SSH access using a GPG key for authentication][11] - - - -### Make a file manager shortcut - -Since you've started the SSH daemon on the remote system and set up your account username and password, all that's left is to map a shortcut to the other Linux system from your file manager. I use GNOME as my desktop, but the steps are basically the same for any Linux desktop. - -#### Make the initial connection - -In the GNOME file manager, look for the **+Other Locations** button in the left-hand navigation. Click that to open a **Connect to Server** prompt. Enter the address of the remote Linux server here, starting with the SSH connection protocol. - -![Creating a shortcut in GNOME file manager][12] - -The GNOME file manager supports a variety of connection protocols. To make a connection over SSH, start your server address with **sftp://** or **ssh://**. - -If your username is the same on your local Linux system and your remote Linux system, you can just enter the server's address and the folder location. To make my connection to the **/home/jhall** directory on my Raspberry Pi, I use: - - -``` -`sftp://10.0.0.11/home/jhall` -``` - -![GNOME file manager Connect to Server][13] - -If your username is different, you can specify your remote system's username with an **@** sign before the remote system's address. To connect to a Raspbian system on the other end, you might use: - - -``` -`sftp://pi@10.0.0.11/home/pi` -``` - -![GNOME file manager Connect to Server][14] - -If you didn't share your public SSH key, you may need to enter a password. Otherwise, the GNOME file manager should automatically open the folder on the remote system and let you navigate. - -![GNOME file manager connection][15] - -#### Create a shortcut so you can easily connect to the server later - -This is easy in the GNOME file manager. Right-click on the remote system's name in the navigation list, and select **Add Bookmark**. This creates a shortcut to the remote location. - -![GNOME file manager - adding bookmark][16] - -If you want to give the bookmark a more memorable name, you can right-click on the shortcut and choose **Rename**. - -### That's it! - -Connecting to a remote Linux system over SSH is just plain easy. And you can use the same method to connect to systems other than home file servers. I also have a shortcut that allows me to instantly access files on my provider's web server and another that lets me open a folder on my project server. SSH makes it a secure connection; all of my traffic is encrypted. Once I've opened the remote system over SSH, I can use the GNOME file manager to manage my remote files as easily as I'd manage my local folders. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/personal-file-server-ssh - -作者:[Jim Hall][a] -选题:[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/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) -[2]: https://opensource.com/article/18/3/print-server-raspberry-pi -[3]: https://arm.fedoraproject.org/ -[4]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-sshd.png (sshd in the list of system services) -[5]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-sshd-service.png (slider to activate sshd) -[6]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-accounts_create-user.png (Set up a new account on Fedora Server) -[7]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-accounts.png (Set password or SSH key) -[8]: https://opensource.com/article/20/2/ssh-tools -[9]: https://opensource.com/article/19/4/ssh-keys-seahorse -[10]: https://opensource.com/article/19/4/gpg-subkeys-ssh-manage -[11]: https://opensource.com/article/19/4/gpg-subkeys-ssh -[12]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-other-locations.png (Creating a shortcut in GNOME file manager) -[13]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-other-sftp.png (GNOME file manager Connect to Server) -[14]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-other-sftp-username.png (GNOME file manager Connect to Server) -[15]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-remote-jhall.png (GNOME file manager connection) -[16]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-remote-jhall-add-bookmark.png (GNOME file manager - adding bookmark) diff --git a/translated/tech/20200323 How to create a personal file server with SSH on Linux.md b/translated/tech/20200323 How to create a personal file server with SSH on Linux.md new file mode 100644 index 0000000000..82049848e6 --- /dev/null +++ b/translated/tech/20200323 How to create a personal file server with SSH on Linux.md @@ -0,0 +1,136 @@ +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to create a personal file server with SSH on Linux) +[#]: via: (https://opensource.com/article/20/3/personal-file-server-ssh) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) + +怎样在 Linux 下用 SSH 搭建私人文件服务器 +====== +通过 SSH 连接远程 Linux 系统很简单。下面是教程。 +![Hand putting a Linux file folder into a drawer][1] + +使用树莓派可以搭建对很多事物有用的廉价家庭服务器。我的树莓派最常用来做[打印服务器][2],可以在我的家庭网络中共享激光打印机,或作为私人文件服务器保存项目副本和其他数据。 + +我的文件服务器有很多用途。假设我现在有一个项目,比如一本新书,我想备份我的工作的快照和所有关联的文件。这种场景下,我只需要把 **BookProject** 文件夹复制到文件服务器的 **BookBackup** 文件夹。 + +或者我现在正在清理我的本地文件,我发现有些文件现在不需要,但是我不确定是否要删除,我会把它们复制到文件服务器的 **KeepForLater** 文件夹。对于清理我日常用的 Linux 系统上杂乱的文件,以及把不常用的文件备份到私人文件服务器,这是一种很方便的方法。 + +用树莓派或其他 Linux 系统搭建私人文件服务器不需要配置 NFS(网络文件系统Network File System>)或 CIFS(通用互联网文件系统Common Internet File System)或改造其他的文件共享系统如 WebDAV。你可以很轻松的使用 SSH 来搭建远程文件服务器。下面是教程。 + +### 在远程服务器上配置 SSHD + +你的 Linux 系统可能已经安装了 SSH daemon(sshd),甚至它是默认执行的。如果没有运行,你可以使用你 Linux 发行版本上你想要的任何控制面板来轻松配置 SSH。我在树莓派上运行了 [Fedora ARM][3],通过把树莓派的 web 浏览器指向 9090 端口,我可以远程访问控制面板。(在我的家庭网络中,树莓派的 IP 地址是 **10.0.0.11**,因此我连接的是 **10.0.0.11:9090**。)如果 SSH daemon 默认没有运行,你可以在控制面板的 Services 里把它设置为开机启动。 + +![sshd in the list of system services][4] + +你可以在系统服务列表里找到 sshd。 + +![slider to activate sshd][5] + +如果 **sshd** 没有开启,点击切换按钮打开它。 + +### 你有账号吗? + +你需要有个远程系统的账号。它可以与你本地系统的账号相同,也可以不同。 + +在流行的 Raspbian 发行版本上,默认的账号名是 **pi**。但是其他的 Linux 发行版本可能需要你在安装系统时就设置一个独一无二的新用户。如果你不知道你的用户名,你可以用系统的控制面板创建一个。在我的树莓派上,我创建了一个 **jhall** 账号,与我日常用的 Linux 桌面机器的用户名相同。 + +![Set up a new account on Fedora Server][6] + +如果你用的是 Fedora 服务器,你可以点击 **Create New Account** 按钮来创建新账号。 + +![Set password or SSH key][7] + +不要忘记设置密码或添加公钥。 + +### 可选:添加公钥 + +如果你把公钥添加到远程 Linux 系统上,你就可以不使用密码登录。这一步是可选的;如果你愿意,你仍可以用密码登录。 + +你可以在下面 Opensource.com 的文章中学到更多关于 SSH key 的信息: + + * [SSH key 管理工具][8] + * [用 Seahorse 对 SSH key 进行图形化管理][9] + * [如何管理多个 SSH key][10] + * [使用 GPG key 作为鉴权依据开启 SSH 访问][11] + + + +### 创建文件管理器快捷方式 + +现在你已经在远程系统上启动 SSH daemon 了,也设置了用户名和密码,最后一步就是在你本地的文件管理器中创建一个快捷方式,地址映射到远程 Linux 系统。我的桌面是 GNOME,但是在其他的 Linux 桌面上的基本操作步骤都是一样的。 + +#### 建立初始连接 + +在 GNOME 的文件管理器中,在左边导航栏找到 **+Other Locations** 按钮。点击它会出现一个 **Connect to Server** 提示框。在框中输入远程 Linux 服务器的地址,地址以 SSH 连接协议开头。 + +![Creating a shortcut in GNOME file manager][12] + +GNOME 文件管理器支持多种连接协议。以 **sftp://** 或 **ssh://** 开头的服务器地址,会创建 SSH 连接。 + +如果你远程 Linux 系统的用户名与本地的相同,那么你只需要输入服务器的地址和文件夹路径就可以了。比如要连接到我的树莓派的 **/home/jhall** 目录,我输入: + + +``` +`sftp://10.0.0.11/home/jhall` +``` + +![GNOME file manager Connect to Server][13] + +如果你远程 Linux 系统的用户名与本地的不同,你可以在远程系统地址前加 **@** 符号来指定远程系统的用户名。要连接到远程的 Raspbian 系统,你可能要输入: + + +``` +`sftp://pi@10.0.0.11/home/pi` +``` + +![GNOME file manager Connect to Server][14] + +如果你没有把公钥添加到远程服务器,那么你需要输入密码。如果你已经添加,GNOME 文件管理器应该会自动打开远程系统上的文件夹来让你跳转到不同的目录。 + +![GNOME file manager connection][15] + +#### 创建一个快捷方式,之后就可以轻松连接服务器 + +在 GNOME 文件管理器中,这很简单。右击导航栏中远程系统的名字,选择 **Add Bookmark** 。这一步操作就创建了连接到远程路径的快捷方式。 + +![GNOME file manager - adding bookmark][16] + +如果你想把标签中的快捷方式改成一个更容易记的名字,你可以右击快捷方式选择 **Rename**。 + +### 总结! + +通过 SSH 连接到远程 Linux 系统是很简单的事。你可以用相同的方式连接到家庭文件服务器以外的其他系统。我还创建了一个能让我立即访问我的提供商的 web 服务器上的文件的快捷方式和另一个能迅速打开我的项目服务器的文件夹的快捷方式。SSH 保证了它们是安全的连接;所有的传输都是加密的。当我通过 SSH 打开远程的文件时,我可以像在本地操作一样使用 GNOME 文件管理器轻松打开远程文件。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/personal-file-server-ssh + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) +[2]: https://opensource.com/article/18/3/print-server-raspberry-pi +[3]: https://arm.fedoraproject.org/ +[4]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-sshd.png (sshd in the list of system services) +[5]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-sshd-service.png (slider to activate sshd) +[6]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-accounts_create-user.png (Set up a new account on Fedora Server) +[7]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-accounts.png (Set password or SSH key) +[8]: https://opensource.com/article/20/2/ssh-tools +[9]: https://opensource.com/article/19/4/ssh-keys-seahorse +[10]: https://opensource.com/article/19/4/gpg-subkeys-ssh-manage +[11]: https://opensource.com/article/19/4/gpg-subkeys-ssh +[12]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-other-locations.png (Creating a shortcut in GNOME file manager) +[13]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-other-sftp.png (GNOME file manager Connect to Server) +[14]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-other-sftp-username.png (GNOME file manager Connect to Server) +[15]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-remote-jhall.png (GNOME file manager connection) +[16]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-remote-jhall-add-bookmark.png (GNOME file manager - adding bookmark) From 164bc75ed5f7c7d3350fafacb849389160c63fc8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 20 May 2020 23:11:37 +0800 Subject: [PATCH 0751/1809] TSL --- ...tration of Kubernetes clusters with k9s.md | 311 ------------------ ...tration of Kubernetes clusters with k9s.md | 232 +++++++++++++ 2 files changed, 232 insertions(+), 311 deletions(-) delete mode 100644 sources/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md create mode 100644 translated/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md diff --git a/sources/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md b/sources/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md deleted file mode 100644 index 03f563a952..0000000000 --- a/sources/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md +++ /dev/null @@ -1,311 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Speed up administration of Kubernetes clusters with k9s) -[#]: via: (https://opensource.com/article/20/5/kubernetes-administration) -[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) - -Speed up administration of Kubernetes clusters with k9s -====== -Check out this cool terminal UI for Kubernetes administration. -![Dogs playing chess][1] - -Usually, my articles about Kubernetes administration are full of kubectl commands for administration for your clusters. Recently, however, someone pointed me to the [k9s][2] project for a fast way to review and resolve day-to-day issues in Kubernetes. It's been a huge improvement to my workflow and I'll show you how to get started in this tutorial.  - -Installation can be done on a Mac, in Windows, and Linux. Instructions for each operating system can be found [here][2]. Be sure to complete installation to be able to follow along. - -I will be using Linux and Minikube, which is a lightweight way to run Kubernetes on a personal computer. Install it following [this tutorial][3] or by using the [documentation][4]. - -### Setting the k9s configuration file - -Once you've installed the k9s app, it's always good to start with the help command. - - -``` -$ k9s help -K9s is a CLI to view and manage your Kubernetes clusters. - -Usage: -  k9s [flags] -  k9s [command] - -Available Commands: -  help        Help about any command -  info        Print configuration info -  version     Print version/build info - -Flags: -  -A, --all-namespaces                 Launch K9s in all namespaces -      --as string                      Username to impersonate for the operation -      --as-group stringArray           Group to impersonate for the operation -      --certificate-authority string   Path to a cert file for the certificate authority -      --client-certificate string      Path to a client certificate file for TLS -      --client-key string              Path to a client key file for TLS -      --cluster string                 The name of the kubeconfig cluster to use -  -c, --command string                 Specify the default command to view when the application launches -      --context string                 The name of the kubeconfig context to use -      --demo                           Enable demo mode to show keyboard commands -      --headless                       Turn K9s header off -  -h, --help                           help for k9s -      --insecure-skip-tls-verify       If true, the server's caCertFile will not be checked for validity -      --kubeconfig string              Path to the kubeconfig file to use for CLI requests -  -l, --logLevel string                Specify a log level (info, warn, debug, error, fatal, panic, trace) (default "info") -  -n, --namespace string               If present, the namespace scope for this CLI request -      --readonly                       Disable all commands that modify the cluster -  -r, --refresh int                    Specify the default refresh rate as an integer (sec) (default 2) -      --request-timeout string         The length of time to wait before giving up on a single server request -      --token string                   Bearer token for authentication to the API server -      --user string                    The name of the kubeconfig user to use - -Use "k9s [command] --help" for more information about a command. -``` - -As you can see, there is a lot of functionality we can configure with k9s. The only step we need to take place to get off the ground is to write a configuration file. The **info** command will point us to where the application is looking for it. - - -``` -$ k9s info - ____  __.________ -|    |/ _/   __   \\______ -|      < \\____    /  ___/ -|    |  \   /    /\\___ \ -|____|__ \ /____//____  > -        \/            \/ - -Configuration:   /Users/jess/.k9s/config.yml -Logs:            /var/folders/5l/c1y1gcw97szdywgf9rk1100m0000gn/T/k9s-jess.log -Screen Dumps:    /var/folders/5l/c1y1gcw97szdywgf9rk1100m0000gn/T/k9s-screens-jess -``` - - By default, k9s expects a configuration file and will fail to run without one. The command will return without any message, but if we look at the log file we see an error. - - -``` -$ tail -1 /var/folders/5l/c1y1gcw97szdywgf9rk1100m0000gn/T/k9s-mbbroberg.log -10:56AM FTL Unable to connect to api server error="Missing or incomplete configuration info.  Please point to an existing, complete config file:\n\n  1. Via the command-line flag --kubeconfig\n  2. Via the KUBECONFIG environment variable\n  3. In your home directory as ~/.kube/config\n\nTo view or setup config directly use the 'config' command." -``` - -To add a file, make the directory if it doesn't already exist and then add one. - - -``` -$ mkdir -p ~/.k9s/ -$ touch ~/.k9s/config.yml -``` - -For this introduction, we will use the default config.yml recommendations from the k9s repository. The maintainers note that this format is subject to change, so we can [check here][5] for the latest version. - - -``` -k9s: -  refreshRate: 2 -  headless: false -  readOnly: false -  noIcons: false -  logger: -    tail: 200 -    buffer: 500 -    sinceSeconds: 300 -    fullScreenLogs: false -    textWrap: false -    showTime: false -  currentContext: minikube -  currentCluster: minikube -  clusters: -    minikube: -      namespace: -        active: "" -        favorites: -       - all -        - kube-system -        - default -      view: -        active: dp -  thresholds: -    cpu: -      critical: 90 -      warn: 70 -    memory: -      critical: 90 -      warn: 70 -``` - -We set k9s to look for a local minikube configuration, so I'm going to confirm minikube is online and ready to go.  - - -``` -$ minikube status -host: Running -kubelet: Running -apiserver: Running -kubeconfig: Configured -``` - -### Running k9s to explore a Kubernetes cluster - -### With a configuration file set and pointing at our local cluster, we can now run the **k9s** command. - - -``` -`$ k9s` -``` - -Once you start it up, the k9s text-based user interface (UI) will pop up. With no flag for a namespace, it will show you the pods in the default namespace. - -![K9s screenshot][6] - -If you run in an environment with a lot of pods, the default view can be overwhelming. Alternatively, we can focus on a given namespace. Exit the application and run **k9s -n <namespace>** where _<namespace>_ is an existing namespace. In the picture below, I ran **k9s -n minecraft,** and it shows my broken pod - -![K9s screenshot][7] - -So once you have k9s up and running, there are a bunch of things you can do quickly.  - -Navigating k9s happens through shortcut keys. We can always use arrow keys and the enter key to choose items listed. There are quite a few other universal keystrokes to navigate to different views: - - * **0**—Show all pods in all namespaces - - - -![K9s screenshot][8] - - * **d**—Describe the selected pod - - - -![K9s screenshot][9] - - * **l**—Show logs for the selected pod pod - - - -![Using k9s to show Kubernetes pod logs][10] - -You may notice that k9s is set to use [Vim command keys][11], including moving up and down using **J** and **K** keys. Good luck exiting, emacs users :) - -### Viewing different Kubernetes resources quickly - -Need to get to something that's not a pod? Yea I do too. There are a number of shortcuts that are available when we enter a colon (":") key. From there, you can use the following commands to navigate around there. - - * **:svc**—Jump to a services view. - - - -![K9s screenshot][12] - - * **:deploy**—Jump to a deployment view. - - - -![K9s screenshot][13] - - * **:rb**—Jump to a Rolebindings view for [role-based access control (RBAC)][14] management. - - - -![K9s screenshot][15] - - * **:namespace**—Jump back to the namespaces view. - - - -![K9s screenshot][16] - - * **:cj**—Jump to the cronjobs view to see what jobs are scheduled in the cluster. - - - -![K9s screenshot][17] - -The most used tool for this application will be the keyboard; to go up or down on any page, use the arrow keys. If you need to quit, remember to use Vim keybindings. Type **:q** and hit enter to leave. - -### Example of troubleshooting Kubernetes with k9s - -How does k9s help when something goes wrong? To walk through an example, I let several pods die due to misconfiguration. Below you can see my terrible hello deployment that's crashing. Once we highlight it, we press **d** to run a _describe_ command to see what is causing the failure. - -![K9s screenshot][18] - -![K9s screenshot][19] - -Skimming the events does not tell us a reason for the failure. Next, I hit the **esc** key and go check the logs by highlighting the pod and entering **<shift-l>**. - -![K9s screenshot][20] - -Unfortunately, the logs don't offer anything helpful either (probably because the deployment was never correctly configured), and the pod will not come up. - -I then **esc** to step back out, and I will see if deleting the pod will take care of this issue. To do so, I highlight the pod and use **<ctrl-d>**. Thankfully, k9s prompts users before deletion.  - -![K9s screenshot][21] - -While I did delete the pod, the deployment resource still exists, so a new pod will come back up. It will also continue to restart and crash for whatever reason (we don't know yet). - -Here is the point where I would repeat reviewing logs, describing resources, and use the **e** shortcut to even edit a running pod to troubleshoot the behavior. In this particular case, the failing pod is not configured to run in this environment. So let's delete the deployment to stop crash-then-reboot loop we are in. - -We can get to deployments by typing **:deploy** and clicking enter. From there we highlight and press **<ctrl-d>** to delete. - -![K9s screenshot][22] - -![K9s screenshot][23] - -And poof the deployment is gone! It only took a few keystrokes to clean up this failed deployment. - -### k9s is incredibly customizable - -So this application has a ton of customization options, down to the color scheme of the UI. Here are a few editable options you may be interested in: - - * Adjust where you put the config.yml file (so you can store it in [version control][24]) - * Add [custom aliases][25] to an **alias.yml** file - * Create [custom hotkeys][26] in a **hotkey.yml** file - * Explore available [plugins][27] or write your own - - - -The entire application is configured in YAML files, so customization will feel familiar to any Kubernetes administrator. - -### Simplify your life with k9s - -I'm prone to administrating over my team's systems in a very manual way, more for brain training than anything else. When I first heard about k9s, I thought, "This is just lazy Kubernetes," so I dismissed it and went back to doing my manual intervention everywhere. I actually started using it daily while working through my backlog, and I was blown away at how much faster it was to use than kubectl alone. Now I'm a convert.  - -It's important to know your tools and master the "hard way" of doing something. It is also important to remember, as far as administration goes, it's important to work smarter, not harder. Using k9s is the way I live up to that objective. I guess we can call it lazy Kubernetes administration, and that's okay. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/5/kubernetes-administration - -作者:[Jessica Cherry][a] -选题:[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/cherrybomb -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/game-dogs-chess-play-lead.png?itok=NAuhav4Z (Dogs playing chess) -[2]: https://github.com/derailed/k9s -[3]: https://opensource.com/article/18/10/getting-started-minikube -[4]: https://kubernetes.io/docs/tasks/tools/install-minikube/ -[5]: https://github.com/derailed/k9s#k9s-configuration -[6]: https://opensource.com/sites/default/files/uploads/k9s_1.png (K9s screenshot) -[7]: https://opensource.com/sites/default/files/uploads/k9s_2.png (K9s screenshot) -[8]: https://opensource.com/sites/default/files/uploads/k9s_3.png (K9s screenshot) -[9]: https://opensource.com/sites/default/files/uploads/k9s_5_0.png (K9s screenshot) -[10]: https://opensource.com/sites/default/files/uploads/k9s-show-logs-opensourcedotcom.png (Using k9s to show Kubernetes pod logs) -[11]: https://opensource.com/article/19/3/getting-started-vim -[12]: https://opensource.com/sites/default/files/uploads/k9s_5.png (K9s screenshot) -[13]: https://opensource.com/sites/default/files/uploads/k9s_6.png (K9s screenshot) -[14]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ -[15]: https://opensource.com/sites/default/files/uploads/k9s_7.png (K9s screenshot) -[16]: https://opensource.com/sites/default/files/uploads/k9s_8.png (K9s screenshot) -[17]: https://opensource.com/sites/default/files/uploads/k9s_9.png (K9s screenshot) -[18]: https://opensource.com/sites/default/files/uploads/k9s_10.png (K9s screenshot) -[19]: https://opensource.com/sites/default/files/uploads/k9s_11.png (K9s screenshot) -[20]: https://opensource.com/sites/default/files/uploads/k9s_12.png (K9s screenshot) -[21]: https://opensource.com/sites/default/files/uploads/k9s_13.png (K9s screenshot) -[22]: https://opensource.com/sites/default/files/uploads/k9s_14.png (K9s screenshot) -[23]: https://opensource.com/sites/default/files/uploads/k9s_15.png (K9s screenshot) -[24]: https://opensource.com/article/19/3/move-your-dotfiles-version-control -[25]: https://k9scli.io/topics/aliases/ -[26]: https://k9scli.io/topics/hotkeys/ -[27]: https://github.com/derailed/k9s/tree/master/plugins diff --git a/translated/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md b/translated/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md new file mode 100644 index 0000000000..811278a001 --- /dev/null +++ b/translated/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md @@ -0,0 +1,232 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Speed up administration of Kubernetes clusters with k9s) +[#]: via: (https://opensource.com/article/20/5/kubernetes-administration) +[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) + +用 k9s 加速 Kubernetes 集群管理 +====== + +> 看看这个很酷的 Kubernetes 管理的终端 UI。 + +![Dogs playing chess][1] + +通常情况下,我写的关于 Kubernetes 管理的文章中,都是做集群管理的 `kubectl` 命令。然而最近,有人给我介绍了 [k9s][2] 项目,可以让我快速查看和解决 Kubernetes 中的日常问题。这对我的工作流程有了很大的改善,我将在本教程中告诉你如何上手。  + +它的安装可以在 Mac、Windows 和 Linux 中进行。每种操作系统的说明可以在这里找到[这里][2]。请务必完成安装,以便能够跟上本教程。 + +我将使用 Linux 和 Minikube,这是一种在个人电脑上运行 Kubernetes 的轻量级方式。按照[此教程][3]或使用[该文档][4]来安装它。 + +### 设置 k9s 配置文件 + +安装好 `k9s` 应用后,从帮助命令开始总是很好的。 + +``` +$ k9s help +``` + +正如你所看到的,我们可以用 `k9s` 来配置很多功能。我们唯一需要进行的步骤就是写一个配置文件。而`info` 命令会告诉我们应用程序要在哪里找该配置文件。 + +``` +$ k9s info + ____  __.________ +|    |/ _/   __   \\______ +|      < \\____    /  ___/ +|    |  \   /    /\\___ \ +|____|__ \ /____//____  > +        \/            \/ + +Configuration:   /Users/jess/.k9s/config.yml +Logs:            /var/folders/5l/c1y1gcw97szdywgf9rk1100m0000gn/T/k9s-jess.log +Screen Dumps:    /var/folders/5l/c1y1gcw97szdywgf9rk1100m0000gn/T/k9s-screens-jess +``` + +如果要添加一个配置文件,该目录不存在的话就创建一个目录,然后添加一个配置文件。 + +``` +$ mkdir -p ~/.k9s/ +$ touch ~/.k9s/config.yml +``` + +在这篇介绍中,我们将使用 k9s 版本库中推荐的默认 `config.yml`。维护者注意,这种格式可能会有变化,所以我们可以[在这里查看][5]最新版本。 + +``` +k9s: +  refreshRate: 2 +  headless: false +  readOnly: false +  noIcons: false +  logger: +    tail: 200 +    buffer: 500 +    sinceSeconds: 300 +    fullScreenLogs: false +    textWrap: false +    showTime: false +  currentContext: minikube +  currentCluster: minikube +  clusters: +    minikube: +      namespace: +        active: "" +        favorites: +       - all +        - kube-system +        - default +      view: +        active: dp +  thresholds: +    cpu: +      critical: 90 +      warn: 70 +    memory: +      critical: 90 +      warn: 70 +``` + +我们设置了 `k9s` 寻找本地的 minikube 配置,所以我要确认 minikube 已经上线了,就可以使用了。 + +``` +$ minikube status +host: Running +kubelet: Running +apiserver: Running +kubeconfig: Configured +``` + +### 运行 k9s 来探索一个 Kubernetes 集群 + +有了配置文件,并指向我们的本地集群,我们现在可以运行 `k9s` 命令了。 + +``` +$ k9s +``` + +启动后,会弹出 `k9s` 基于文本的用户界面。在没有命名空间标志的情况下,它会向你显示默认命名空间中的 Pod。 + +![K9s screenshot][6] + +如果你运行在一个有很多 Pod 的环境中,默认的视图可能会让人不知所措。或者,我们可以将注意力集中在给定的命名空间上。退出应用程序,运行 `k9s -n `,其中 ``` 是已有的命名空间。在下图中,我运行了 `k9s -n minecraft`,它显示了我的损坏的 Pod: + +![K9s screenshot][7] + +所以,一旦你有了 `k9s` 后,有很多事情你可以更快地完成。  + +通过快捷键来导航 `k9s`,我们可以随时使用方向键和回车键来选择列出的项目。还有不少其他的通用快捷键来导航到不同的视图。 + +* `0`:显示在所有命名空间中的所有 Pod + ![K9s screenshot][8] +* `d`:描述所选的 Pod + ![K9s screenshot][9] +* `l`:显示所选的 Pod 的日志 + ![Using k9s to show Kubernetes pod logs][10] + +你可能会注意到 `k9s` 被设置为使用 [Vim 命令键][11],包括使用 `J` 和 `K` 键上下移动。Emacs 用户们,败退吧 :) + +### 快速查看不同的 Kubernetes 资源 + +需要去找一个不在 Pod 里的东西吗?是的,我也需要。当我们输入冒号(`:`)键时,可以使用很多快捷方式。从那里,你可以使用下面的命令来导航。 + +* `:svc`:跳转到服务视图 + ![K9s screenshot][12] +* `:deploy`:跳转到部署视图 + ![K9s screenshot][13] +* `:rb`:跳转到角色绑定视图,用于 [基于角色的访问控制(RBAC)][14]管理 + ![K9s screenshot][15] +* `:namespace`:跳转到命名空间视图 + ![K9s screenshot][16] +* `:cj`:跳转到 cronjob 视图,查看集群中计划了哪些作业。 + ![K9s screenshot][17] + +这个应用最常用的工具是键盘;要在任何页面上往上或往下翻页,请使用方向键。如果你需要退出,记得使用 Vim 键绑定。键入 `:q`,然后按回车键离开。 + +### 用 k9s 排除 Kubernetes 的故障示例 + +当出现故障的时候,`k9s` 怎么帮忙?举个例子,我让几个 Pod 由于配置错误而死机。下面你可以看到我那个可怜的 “hello” 部署死了。当我们将其高亮显示出来,可以按 `d` 运行 `describe` 命令,看看是什么原因导致了故障。 + +![K9s screenshot][18] + +![K9s screenshot][19] + +草草掠过那些事件并不能告诉我们故障原因。接下来,我按了 `esc` 键,然后通过高亮显示 Pod 并输入`shift-l` 来检查日志。 + +![K9s screenshot][20] + +不幸的是,日志也没有提供任何有用的信息(可能是因为部署从未正确配置过),而且 Pod也不会出现。 + +然后我使用 `esc` 退了出来,我看看删除 Pod 是否能解决这个问题。要做到这一点,我高亮显示 Pod,然后使用 `ctrl-d`。幸好 `k9s` 在删除前会提示用户。  + +![K9s screenshot][21] + +虽然我确实删除了这个 Pod,但部署资源仍然存在,所以新的 Pod 会重新出现。它还会继续重启并死掉,无论什么原因(我们还不知道)。 + +在这里,我会重复查看日志,描述资源,甚至使用 `e` 快捷方式来编辑运行中的 Pod 以排除故障行为。在这个特殊情况下,失败的 Pod 没有配置在这个环境下运行。因此,让我们删除部署来停止崩溃接着重启的循环。 + +我们可以通过键入 `:deploy` 并点击回车进入部署。从那里我们高亮显示并按 `ctrl-d` 来删除。 + +![K9s screenshot][22] + +![K9s screenshot][23] + +部署失败了! 只用了几个按键就把这个失败的部署给清理掉了。 + +### k9s 是极其可定制的 + +这个应用有很多自定义选项,乃至于 UI 的配色方案。这里有几个可编辑的选项,你可能会感兴趣。 + +* 调整你把 `config.yml` 文件放置的位置(这样你就可以把它存储在[版本控制][24]中)。 +* 在 `alias.yml` 文件中添加[自定义别名][25]。 +* 在 `hotkey.yml` 文件中创建[自定义热键][26]。 +* 探索现有的[插件][27]或编写自己的插件。 + +整个应用是在 YAML 文件中配置的,所以定制化对于任何 Kubernetes 管理员来说都会觉得很熟悉。 + +### 用 k9s 简化你的生活 + +我很容易在团队的系统上用非常人工的方式进行管理,更多的是为了锻炼脑力,而不是别的。当我第一次听说 `k9s` 的时候,我想,“这只是懒惰的 Kubernetes 而已。”于是我否定了它,回到了到处进行人工干预的状态。实际上,我在处理我的积压工作时就开始每天使用它,我觉得它的使用速度比单独使用 `kubectl` 快得多,这让我大吃一惊。现在,我已经皈依了。  + +了解你的工具并掌握做事情的“硬道理”很重要。还有一点很重要的是要记住,就管理而言,重要的是要更聪明地工作,而不是更努力。使用 `k9s`,就是我践行这个目标的方法。我想,我们可以把它叫做懒惰的 Kubernetes 管理,也没关系。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/kubernetes-administration + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cherrybomb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/game-dogs-chess-play-lead.png?itok=NAuhav4Z (Dogs playing chess) +[2]: https://github.com/derailed/k9s +[3]: https://opensource.com/article/18/10/getting-started-minikube +[4]: https://kubernetes.io/docs/tasks/tools/install-minikube/ +[5]: https://github.com/derailed/k9s#k9s-configuration +[6]: https://opensource.com/sites/default/files/uploads/k9s_1.png (K9s screenshot) +[7]: https://opensource.com/sites/default/files/uploads/k9s_2.png (K9s screenshot) +[8]: https://opensource.com/sites/default/files/uploads/k9s_3.png (K9s screenshot) +[9]: https://opensource.com/sites/default/files/uploads/k9s_5_0.png (K9s screenshot) +[10]: https://opensource.com/sites/default/files/uploads/k9s-show-logs-opensourcedotcom.png (Using k9s to show Kubernetes pod logs) +[11]: https://opensource.com/article/19/3/getting-started-vim +[12]: https://opensource.com/sites/default/files/uploads/k9s_5.png (K9s screenshot) +[13]: https://opensource.com/sites/default/files/uploads/k9s_6.png (K9s screenshot) +[14]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ +[15]: https://opensource.com/sites/default/files/uploads/k9s_7.png (K9s screenshot) +[16]: https://opensource.com/sites/default/files/uploads/k9s_8.png (K9s screenshot) +[17]: https://opensource.com/sites/default/files/uploads/k9s_9.png (K9s screenshot) +[18]: https://opensource.com/sites/default/files/uploads/k9s_10.png (K9s screenshot) +[19]: https://opensource.com/sites/default/files/uploads/k9s_11.png (K9s screenshot) +[20]: https://opensource.com/sites/default/files/uploads/k9s_12.png (K9s screenshot) +[21]: https://opensource.com/sites/default/files/uploads/k9s_13.png (K9s screenshot) +[22]: https://opensource.com/sites/default/files/uploads/k9s_14.png (K9s screenshot) +[23]: https://opensource.com/sites/default/files/uploads/k9s_15.png (K9s screenshot) +[24]: https://opensource.com/article/19/3/move-your-dotfiles-version-control +[25]: https://k9scli.io/topics/aliases/ +[26]: https://k9scli.io/topics/hotkeys/ +[27]: https://github.com/derailed/k9s/tree/master/plugins From 37349e4c597d34be907d03d885343f49398bd497 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 21 May 2020 08:45:59 +0800 Subject: [PATCH 0752/1809] translated --- ...r getting around your Linux file system.md | 146 ------------------ ...r getting around your Linux file system.md | 143 +++++++++++++++++ 2 files changed, 143 insertions(+), 146 deletions(-) delete mode 100644 sources/tech/20200326 Tricks for getting around your Linux file system.md create mode 100644 translated/tech/20200326 Tricks for getting around your Linux file system.md diff --git a/sources/tech/20200326 Tricks for getting around your Linux file system.md b/sources/tech/20200326 Tricks for getting around your Linux file system.md deleted file mode 100644 index bda5e2100c..0000000000 --- a/sources/tech/20200326 Tricks for getting around your Linux file system.md +++ /dev/null @@ -1,146 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Tricks for getting around your Linux file system) -[#]: via: (https://www.networkworld.com/article/3533421/tricks-for-getting-around-your-linux-file-system.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -Tricks for getting around your Linux file system -====== -The cd command is probably one of the first 10 that any Linux user learns, but it's not the only way to navigate the Linux file system.Here are some other ways. -Thinkstock - -Whether you're moving around the file system, looking for files or trying to move into important directories, Linux can provide a lot of help. In this post, we'll look at a number of tricks to make moving around the file system and both finding and using commands that you need a little easier. - -### Adding to your $PATH - -One of the easiest and most useful ways to ensure that you don't have to invest a lot of time into finding commands on a Linux system is to add the proper directories to your $PATH variable. The order of directories that you add to your $PATH variable is, however, very important. They determine the order in which the system will look through the directories to find the command to run -- stopping when it finds the first match. - -You might, for example, want to put your home directory first so that, if you create a script that has the same name as some other executable, it will be the one that you end up running whenever you type its name. - -[RELATED: Linux hardening: a 15-step checklist for a secure Linux server][1] - -To add your home directory to your $PATH variable, you could do this: - -``` -$ export PATH=~:$PATH -``` - -The **~** character represents your home directory. - -If you keep your scripts in your bin directory, this would work for you: - -``` -$ export PATH=~/bin:$PATH -``` - -You can then run a script located in your home directory like this: - -[][2] - -``` -$ myscript -Good morning, you just ran /home/myacct/bin/myscript -``` - -**IMPORTANT:** The commands shown above _add_ to your search path because $PATH (the current path) is included. They don't override it. Your search path should be configured in your **.bashrc** file, and any changes you intend to be permanent should be added there as well. - -### Using symbolic links - -Symbolic links provide an easy and obvious way to record the location of directories that you might need to use often. If you manage content for a web site, for example, you might want to get your account to "remember" where the web files are located by creating a link like this: - -``` -ln -s /var/www/html www -``` - -The order of the arguments is critical. The first (/var/www/html) is the target and the second is the name of the link that you will be creating. If you're not currently located in your home directory, the following command would do the same thing: - -``` -ln -s /var/www/html ~/www -``` - -After setting this up, you can use "cd www" to get to **/var/www/html**. - -### Using shopt - -The **shopt** command also provides a way to make moving to a different directory a bit easier. When you employ **shopt'**s **autocd** option, you can go to a directory simply by typing its name. For example: - -``` -$ shopt -s autocd -$ www -cd -- www -/home/myacct/www -$ pwd -P -/var/www/html - -$ ~/bin -cd -- /home/myacct/bin -$ pwd -/home/myacct/bin -``` - -In the first set of commands above, the **shopt** command's **autocd** option is enabled. Typing **www** then invokes a "cd www" command. Because this symbolic link was created in one of the **ln** command examples above, this moves us to **/var/www/html**. The **pwd -P** command displays the actual location. - -In the second set, typing **~/bin** invokes a **cd** into the **bin** directory in the user's home. - -Note that the **autocd** behavior will _not_ kick in when what you type is a command –  even if it's also the name of a directory. - -The **shopt** command is a bash builtin and has a lot of options. This one just means that you don't have to type "cd" before the name of each directory you want to move into. - -To see **shopt**'s other options, just type "shopt". - -### Using $CDPATH - -Probably one of the most useful tricks for moving into particular directories is adding the paths that you want to be able to move into easily to your **$CDPATH**. This creates a list of directories that will be moved into by typing only a portion of the full path names. - -There is one aspect of this that may be just a little tricky. Your **$CDPATH** needs to include the directories that _contain_ the directories that you want to move into, not the directories themselves. - -For example, say that you want to be able to move into the **/var/www/html** directory simply by typing "cd html" and into subdirectories in /var/log using only "cd" and the simple directory names. In this case, this **$CDPATH** would work: - -``` -$ CDPATH=.:/var/log:/var/www -``` - -Here's what you would see: - -``` -$ cd journal -/var/log/journal -$ cd html -/var/www/html -``` - -Your **$CDPATH** kicks in when what you type is _not_ a full path. Then it looks down its list of directories in order to see if the directory you identified exists in one of them. Once it finds a match, it takes you there. - -Keeping the "." at the beginning of your **$CDPATH** means that you can move into local directories without having to have them defined in the **$CDPATH**. - -``` -$ export CDPATH=".:$CDPATH" -$ Videos -cd -- Videos -/home/myacct/Videos -``` - -It's not hard to move around the Linux file system, but you can save a few brain cells if you use some handy tricks for getting to various locations easily. - -Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3533421/tricks-for-getting-around-your-linux-file-system.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3143050/linux/linux-hardening-a-15-step-checklist-for-a-secure-linux-server.html#tk.nww-fsb -[2]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) -[3]: https://www.facebook.com/NetworkWorld/ -[4]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20200326 Tricks for getting around your Linux file system.md b/translated/tech/20200326 Tricks for getting around your Linux file system.md new file mode 100644 index 0000000000..3883ab5c8d --- /dev/null +++ b/translated/tech/20200326 Tricks for getting around your Linux file system.md @@ -0,0 +1,143 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tricks for getting around your Linux file system) +[#]: via: (https://www.networkworld.com/article/3533421/tricks-for-getting-around-your-linux-file-system.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +使用 Linux 文件系统的技巧 +====== +cd 命令可能是任何 Linux 用户学习的前 10 个命令之一,但这并不是在 Linux 文件系统中切换的唯一方法,这里还有其他一些方法。 + +无论你是在文件系统中四处查看、寻找文件还是尝试进入重要目录,Linux 都可以提供很多帮助。在本文中,我们将介绍一些技巧,使你可以在文件系统中移动,查找和使用所需的命令也更加轻松。 + +### 添加到 $PATH + +确保你不必花费大量时间在 Linux 系统上查找命令的最简单、最有用的方法之一就是在 $PATH 变量中添加适当的目录。但是,添加到 $PATH 变量中的目录顺序非常重要。它们确定系统在目录中查找要运行命令的目录顺序--在找到第一个匹配项时停止。 + +例如,你可能希望将家目录放在第一个,这样,如果你创建的脚本与其他可执行文件有相同的名称,那么只要输入该脚本的名称,它便会运行。 + +要将家目录添加到 $PATH 变量中,可以执行以下操作: + +``` +$ export PATH=~:$PATH +``` + +**~** 字符代表家目录。 + +如果将脚本保存在 bin 目录中,下面的会有效: + + +``` +$ export PATH=~/bin:$PATH +``` + +然后,你可以运行位于家目录中的脚本,如下所示: + +[][2] + +``` +$ myscript +Good morning, you just ran /home/myacct/bin/myscript +``` + +**重要提示:**上面的命令_添加_搜索路径因为 $PATH (当前路径)包含了。它们不会覆盖它。你的搜索路径应该在 **.bashrc** 文件中配置,任何持久更改也需要在这里添加。 + +### 使用符号链接 + +符号链接提供了一种简单而明显的方式来记录可能经常需要使用的目录的位置。例如,如果你管理网站的内容,那么可能需要通过创建如下链接来使你的帐户“记住”网页文件的位置: + +``` +ln -s /var/www/html www +``` + +参数的顺序很重要。第一个(/var/www/html)是目标,第二个是你创建的链接的名称。如果你当前不在家目录中,那么以下命令将执行相同的操作: + +``` +ln -s /var/www/html ~/www +``` + +设置好之后,您可以使用 “cd www” 进入 **/var/www/html**。 + +### 使用 shopt + +**shopt** 命令还提供了一种让移动到其他目录更加容易的方法。当你使用 **shopt** 的 **autocd** 选项时,只需输入名称即可转到目录。例如: + +``` +$ shopt -s autocd +$ www +cd -- www +/home/myacct/www +$ pwd -P +/var/www/html + +$ ~/bin +cd -- /home/myacct/bin +$ pwd +/home/myacct/bin +``` + +在上面的第一组命令中,启用了 shopt 命令的 autocd 选项。输入 **www**,然后调用 “cd www” 命令。由于此符号链接是在上面的 **ln** 命令示例之一中创建的,因此将我们移至 **/var/www/html**。 **pwd -P** 命令显示实际位置。 + +在第二组中,键入 **~/bin** 会在用户家目录调用 **cd** 进入 **bin** 目录。 + +请注意,当你输入的是命令时,**autocd** 行为将_不会_生效,即使它也是目录的名称。 + +**shopt** 是 bash 内置,它有很多选项。这只是意味着你不必在要进入每个目录的名称之前输入 “cd”。 + +要查看 **shopt** 的其他选项,只需输入 “shopt”。 + +### 使用 $CDPATH + +进入特定目录的最有用技巧之一可能是将你希望能够轻松进入的路径添加到 **$CDPATH** 中。这将创建一个只需输入完整路径名的一部分即可进入的目录列表。 + +一方面,这可能有点棘手。你的 **$CDPATH** 需要包含要移动到的目录的目录,而不是目录本身。 + +例如,假设你希望仅通过输入 “cd html” 就可以移至 **/var/www/html** 目录,并仅使用 “cd” 和简单目录名即可移至 /var/log 中的子目录。在这种情况下,此 **$CDPATH** 将起作用: + +``` +$ CDPATH=.:/var/log:/var/www +``` + +你将看到: + +``` +$ cd journal +/var/log/journal +$ cd html +/var/www/html +``` + +当你输入的不是完整路径时,**$CDPATH** 就会生效。它向下查看其目录列表,以查看指定的目录是否存在于其中一个目录中。找到匹配项后,它将带你到那里。 + +保持 “.” 在 **$CDPATH** 开头意味着你可以进入本地目录,而不必在 **$CDPATH** 中定义它们。 + +``` +$ export CDPATH=".:$CDPATH" +$ Videos +cd -- Videos +/home/myacct/Videos +``` + +在 Linux 文件系统键切换并不难,但是如果你使用一些方便的技巧轻松地到达各个位置,那你可以节省一些大脑细胞。 + +加入 [Facebook][3] 和 [LinkedIn][4] 上的 Network World 社区,评论热门主题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3533421/tricks-for-getting-around-your-linux-file-system.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[2]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy) +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From fd8c410f4e9c279b469e37380d1ccae1cc67a7bf Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 21 May 2020 08:53:24 +0800 Subject: [PATCH 0753/1809] translating --- ....0 Released With Qt 5- Here-s How to Install it on Ubuntu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md b/sources/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md index 53e7ea3fa6..666c57c8ff 100644 --- a/sources/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md +++ b/sources/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8e1729ef37655b59ebf594e96647f9253fc5a9b6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 21 May 2020 10:28:23 +0800 Subject: [PATCH 0754/1809] PRF @geekpi --- ...ource PHP framework for web development.md | 57 +++++++++---------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/translated/tech/20200506 Customizing my open source PHP framework for web development.md b/translated/tech/20200506 Customizing my open source PHP framework for web development.md index 59573c643d..ea2a0c8886 100644 --- a/translated/tech/20200506 Customizing my open source PHP framework for web development.md +++ b/translated/tech/20200506 Customizing my open source PHP framework for web development.md @@ -1,50 +1,49 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Customizing my open source PHP framework for web development) [#]: via: (https://opensource.com/article/20/5/codeigniter) [#]: author: (Wee Ben Sen https://opensource.com/users/bswee14) -自定义用于 Web 开发的开源 PHP 框架 +自定义用于 Web 开发的开源 PHP 框架 Codeigniter ====== -Codeigniter 是一个 PHP 框架,可以使公司进行开发具有灵活性和便捷性的高性能网站。 -![Business woman on laptop sitting in front of window][1] -PHP Codeigniter 是一个开源框架,为商业应用提供易于使用的 PHP 编程语言和强大的编码工具。它还提供商务智能、服务器监视、开发和应用集成功能。这是一个相对安静的项目,你很少听到它,但它功能强大,许多刚接触的开发人员都对此感到惊讶和耳目一新。 +> Codeigniter 是一个 PHP 框架,可以使公司进行开发具有灵活性和便捷性的高性能网站。 -我在新加坡的一家在线学习服务提供商处使用 [Codeigniter][2]。我们提供的服务不够普遍,无法成为模板或现有后端的默认功能集,因此我需要提供可以依靠的良好,坚实,原始的东西。最初,我考虑用其他平台(如 Wordpress)用于我们的网站。但是,我决定使用 Codeigniter,因为它的灵活性,以及在学费匹配过程中需要的整合功能。 +![](https://img.linux.net.cn/data/attachment/album/202005/21/102637vslj5zqk52x98a52.jpg) -以下是让我使用 Codeigniter 的原因: +PHP Codeigniter 是一个开源框架,为商业应用提供易于使用的 PHP 编程语言和强大的编码工具。它还提供商务智能、服务器监视、开发和应用集成功能。这是一个相对冷清的项目,你很少听到它,但它功能强大,许多刚接触的开发人员都对此感到惊讶和耳目一新。 - * 与 MySQL 的数据库集成—一种主要功能是允许客户端浏览导师数据库并添加导师,例如类似于电子商务平台的“购物车”。 -  * 客户端界面系统—用户可以登录管理首选项并编辑详细信息,修改所教的科目、地区、手机号码、地址等。 -  * 定制的管理员面板—管理员可以使用定制的管理面板访问客户提交的内容,它与客户服务功能集成在一起,因此管理员可以单独跟进。 -  * 付款系统—管理面板带有与 Paypal 集成的发票和付款网关。 -  * CMS 编辑器界面—管理员能够编辑博客和文章中的文本和图像,以及添加新页面。 +我在新加坡的一家在线学习服务提供商处使用 [Codeigniter][2]。我们提供的服务并不算常见,没有可以作为模板的默认功能集或现有后台管理系统,所以我需要一个能提供良好的、可靠的、可以建立在此基础上的原始材料。最初,我考虑用其他平台(如 Wordpress)用于我们的网站。但是,我决定使用 Codeigniter,因为它的灵活性,以及集成了在我们的补课匹配过程中需要的功能。 +以下是打动我使用 Codeigniter 的原因: + +* 与 MySQL 数据库的集成 —— 主要功能是允许客户端浏览导师的数据库并添加导师,例如类似于电子商务平台的“购物车”。 +* 客户端界面系统 —— 用户可以登录来管理偏好并编辑详细信息,修改所教的科目、旅游的地区、手机号码、地址等。 +* 定制的管理员面板 —— 管理员可以使用定制的管理面板访问客户提交的资料,它与客户服务功能集成在一起,因此管理员可以单独跟进。 +* 付款系统 —— 管理面板带有与 Paypal 集成的发票和付款网关。 +* CMS 编辑器界面 —— 管理员能够编辑博客和文章中的文本和图像,以及添加新页面。 该项目花费了大约六个月的时间来完成,另外花了两个月的调试时间。如果我需要从头开始构建所有,或者尝试重新设计现有的框架以满足我们的需求,那将花费更长的时间,而且可能最终无法满足客户需求。 ### 功能和优点 -还有许多吸引开发人员使用 PHP Codeigniter 的功能,包括错误处理和代码格式化,这些功能在每种编码情景下都非常有用。它支持模板,可用于向现有网站添加功能或生成新网站。有许多基于 web 系统商业需要的功能,包括使用自定义标签。即使没有编程经验的普通开发人员也可以使用大多数工具。 +PHP Codeigniter还有很多吸引开发者的功能,包括错误处理和代码格式化,这些功能在各种编码情景下都非常有用。它支持模板,可用于向现有网站添加功能或生成新网站。有许多基于 web 系统商业需要的功能,包括使用自定义标签。即使没有编程经验的普通开发人员也可以使用大多数工具。 Codeigniter 的主要功能是: - * XML 核心服务, -  * HTTP/FTP 核心服务 -  * AppData 和 PHP 沙箱功能 -  * XSLT 和 HTML 模板 -  * 加密的信息传输 -  * PCM Codeigniter 服务器监控 -  * 应用集成 -  * 文件传输协议(FTP) -  * 服务台支持 -  * Apache POI(用于托管网站的内容管理基础架构) - - +* XML 核心服务, +* HTTP/FTP 核心服务 +* AppData 和 PHP 沙箱功能 +* XSLT 和 HTML 模板 +* 加密的信息传输 +* PCM Codeigniter 服务器监控 +* 应用集成 +* 文件传输协议(FTP) +* 服务台支持 +* Apache POI(用于托管网站的内容管理基础架构) #### 兼容性 @@ -52,15 +51,15 @@ Codeigniter 与许多领先的软件程序兼容,例如 PHP、MySQL、[MariaDB #### 安全 -Codeigniter 还通过 SSL 加密提供数据安全性。加密可以保护数据免受入侵者和防火墙等外部威胁的侵害。数据存储功能还允许对公司网站进行安全审核。 +Codeigniter 还通过 SSL 加密提供数据安全性。加密可以保护数据免受入侵者和防火墙外部威胁的侵害。数据存储功能还允许对公司网站进行安全审核。 #### 其它功能 -一家优秀的 PHP Web 开发公司使用几种高级和第三方技术,例如 XML 和 PHP。它提供组织一个完整的平台来开发具有专业外观、有用的商业网站。Codeigniter 让使用第三方技术变得容易,并可以与常见的 Web 开发软件一起使用。这使得 web 公司可以轻松地使用所选模块创建网站。大多数 PHP 开发者也为个人提供支持和培训服务。 +一家优秀的 PHP Web 开发公司会使用几种高级技术和第三方技术,例如 XML 和 PHP。它为企业提供了一个完整的平台,可以开发出具有看起来专业的、好用的商业网站。Codeigniter 使得第三方技术的使用变得容易,并可以与常见的 Web 开发软件一起使用。这使得 Web 公司可以轻松地使用所选模块创建网站。大多数 PHP 开发者也为个人提供支持和培训服务。 ### 使用 PHP 框架 Codeigniter -Codeigniter 给企业提供完整的 PHP 开发包,它将提供功能,灵活性和性能的正确组合。到目前为止,我很满意我们的网站,一直以来,我不断升级和添加新的功能。我期待用 Codeigniter 对我们的网站做些其他什么。你也是这样么? +Codeigniter 给企业提供了完整的 PHP 开发包,它将提供强大的功能、灵活性和性能完美结合在一起。到目前为止,我很满意我们的网站,并不断地升级和添加新的功能。并不断升级和增加新的功能。我期待着发现我们的网站还能用 Codeigniter 做些什么。你也是这样么? -------------------------------------------------------------------------------- @@ -69,7 +68,7 @@ via: https://opensource.com/article/20/5/codeigniter 作者:[Wee Ben Sen][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4604990f1f8cdb16d7b6e9938880b9e481d73bbd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 21 May 2020 10:29:05 +0800 Subject: [PATCH 0755/1809] PUB @geekpi https://linux.cn/article-12235-1.html --- ...mizing my open source PHP framework for web development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200506 Customizing my open source PHP framework for web development.md (98%) diff --git a/translated/tech/20200506 Customizing my open source PHP framework for web development.md b/published/20200506 Customizing my open source PHP framework for web development.md similarity index 98% rename from translated/tech/20200506 Customizing my open source PHP framework for web development.md rename to published/20200506 Customizing my open source PHP framework for web development.md index ea2a0c8886..de6b46f8b7 100644 --- a/translated/tech/20200506 Customizing my open source PHP framework for web development.md +++ b/published/20200506 Customizing my open source PHP framework for web development.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12235-1.html) [#]: subject: (Customizing my open source PHP framework for web development) [#]: via: (https://opensource.com/article/20/5/codeigniter) [#]: author: (Wee Ben Sen https://opensource.com/users/bswee14) From f98e265f66798b393972f5751b237bac7e878193 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 21 May 2020 13:24:46 +0800 Subject: [PATCH 0756/1809] PRF @HankChow --- ...508 5 ways to split your Linux terminal.md | 67 +++++++++---------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/translated/tech/20200508 5 ways to split your Linux terminal.md b/translated/tech/20200508 5 ways to split your Linux terminal.md index 63783e1be2..acb8f405ff 100644 --- a/translated/tech/20200508 5 ways to split your Linux terminal.md +++ b/translated/tech/20200508 5 ways to split your Linux terminal.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 ways to split your Linux terminal) @@ -9,9 +9,10 @@ 5 种拆分 Linux 终端的方法 ====== + > 本文介绍了 Linux 提供的拆分终端的方法,它能够帮助你完成多任务工作。那么,你最喜欢哪一款终端复用工具呢? -![4 different color terminal windows with code][1] +![](https://img.linux.net.cn/data/attachment/album/202005/21/132437ypzpqqppqh1qfznh.jpg) 没有什么问题是不能用一个 Linux 终端解决的,如果不行,那就用两个。 @@ -19,68 +20,67 @@ 如果你是系统管理员,你就需要更多的终端窗口,以便连接到多个不同的主机上并行工作了。 -在 Linux 系统中,终端应用程序在很久之前已经开始带有选项卡功能了。而现在的终端应用程序里,选项卡已经是标配功能了,这是非常流行的趋势。尽管如此,工作的时候在多个选项卡之间来回切换,或多或少也会分散我们的注意力,甚至带来不便。 +在 Linux 系统中,终端应用程序在很久之前就已经开始带有选项卡功能了。而现在的终端应用程序里,选项卡已经是标配功能了,这是非常流行的趋势。尽管如此,工作的时候在多个选项卡之间来回切换,或多或少也会分散我们的注意力,甚至带来不便。 -而最好的解决方案就是将整个屏幕划分为多个部分,这样多个终端就可以在同一个终端应用程序窗口中同时存在。Linux 套件中也有很多相关的工具可以实现这一功能。 +而最好的解决方案就是将整个屏幕划分为多个部分,这样多个终端就可以在同一个终端应用程序窗口中同时存在。Linux 发行版中也有很多相关的工具可以实现这一功能。 ### Shell、终端和控制台 在此之前,我们首先要明确 Shell、终端terminal控制台console这三个概念。想要详细了解的话,请参阅 [Enable Sysadmin][2] 博客上的相关文章。 -太长不看版: +简而言之: - * Shell 是带有命令提示符prompt的用于输入、输出的界面。准确地说,[POSIX][3] 桌面底层也运行着一个 Shell,无论这个 Shell 是否对用户可见,因为用户会话就是由这个 Shell 启动的。 - * 终端是在图形界面服务器(例如 X11 或 Wayland)中运行的应用程序,其中加载了一个 Shell。只有在终端窗口启动之后,才算是运行了一个终端。终端可以认为是操作 Shell 的一个入口。 - * 控制台(或称“虚拟控制台”)通常表示在桌面环境以外使用的 Shell,你可以通过 `Alt+Ctrl+F2` 进入控制台,通常情况下从 `F3` 到 `F7` 都是不同的控制台,其中桌面环境有可能是 `F1` 或者 `F7`,这在不同的发行版中可能会有所不同。 +* **Shell** 是带有命令提示符prompt的用于输入、输出的界面。准确地说,[POSIX][3] 桌面底层也运行着一个 Shell,即使这个 Shell 对用户不可见,因为用户会话就是由这个 Shell 启动的。 +* **终端**是在图形界面服务器(例如 X11 或 Wayland)中运行的应用程序,其中加载了一个 Shell。只有在终端窗口启动之后,才算是运行了一个终端。终端可以认为是操作 Shell 的一个入口。 +* **控制台**(或称“虚拟控制台”)通常表示在桌面环境以外使用的 Shell,你可以通过 `Alt+Ctrl+F2` 进入控制台,通常情况下从 `F3` 到 `F7` 都是不同的控制台,其中桌面环境有可能是 `F1` 或者 `F7`,这在不同的发行版中可能会有所不同。 -因此,一些应用程序提供的功能是拆分 Shell 或者控制台,一些应用程序的功能则是拆分终端。 +因此,有些应用程序提供的功能是拆分 Shell 或者控制台,有些应用程序的功能则是拆分终端。 ### tmux ![tmux terminal][4] -[tmux][5] 可以说是最灵活最强大的屏幕拆分工具了,它通过键盘控制对多个终端的复用,因此你可以将一个控制台叠放在另一个控制台上面,并在两个控制台之间切换。你还可以将整个屏幕等分为多个控制台,以便同时观察不同控制台上的状况。 +[tmux][5] 可以说是最灵活、最强大的屏幕拆分工具了,它通过键盘控制对多个终端的复用,因此你可以将一个控制台叠放在另一个控制台上面,并在两个控制台之间切换。你还可以将整个屏幕等分为多个控制台,以便同时观察不同控制台上的状况。 -tmux 的所有操作都是通过键盘完成的,这就意味着你的手不需要离开键盘去寻找鼠标。为此,你需要记住一些按键组合。 +`tmux` 的所有操作都是通过键盘完成的,这就意味着你的手不需要离开键盘去寻找鼠标。为此,你需要记住一些按键组合。 -如果你只用 tmux 来做屏幕拆分,那你只需要记住一下这些命令: +如果你只用 `tmux` 来做屏幕拆分,那你只需要记住一下这些命令: * `Ctrl-B %` 竖直拆分屏幕(两个 Shell 分别位于左右) * `Ctrl-B "` 水平拆分屏幕(两个 Shell 分别位于上下) * `Ctrl-B O` 切换到另一个 Shell * `Ctrl-B ?` 查看帮助 - * `Ctrl-B d` 断开 tmux 并让其在后台运行(可以使用 `tmux attach` 重新进入) + * `Ctrl-B d` 断开 `tmux` 并让其在后台运行(可以使用 `tmux attach` 重新进入) -tmux 的一大好处是,在一台计算机上启动 tmux 会话之后,也可以从另一台计算机上进入到这个会话,由此可以看出,tmux 对 Shell 进行了守护daemonize。 +`tmux` 的一大好处是,在一台计算机上启动 `tmux` 会话之后,也可以从另一台计算机上进入到这个会话,由此可以看出,`tmux` 对 Shell 进行了守护进程化daemonize。 -例如,当我在树莓派上运行 tmux,我就可以从计算机上连接到树莓派并登录 IRC,当我断开连接时,树莓派上的 tmux 会继续运行,并等待我的下一次连接,在此期间 IRC 是处于持续登录状态的。 +例如,当我在树莓派上运行 `tmux`,我就可以从计算机上连接到树莓派并登录 IRC,当我断开连接时,树莓派上的 `tmux` 会继续运行,并等待我的下一次连接,在此期间 IRC 是处于持续登录状态的。 ### GNU Screen ![GNU Screen terminal][6] -[GNU Screen][7] 也是一个 Shell 复用工具,类似于 tmux,你可以在断开一个活动会话后重连到其中,它也支持竖直或水平拆分屏幕。 - -Screen 的灵活性比 tmux 要弱一些。它默认的绑定按键组合是 `Ctrl-A`,和 Bash 中光标移动到行首的快捷键是一样的。因此,当你正在运行 Screen 的时候,如果想要将光标移动到行首,就需要多按一次 `Ctrl-A`。而我自己的做法是,在 `$HOME/.screenrc` 文件中将绑定按键组合重新设置为 `Ctrl-J`。 +[GNU Screen][7] 也是一个 Shell 复用工具,类似于 `tmux`,你可以在断开一个活动会话后重连到其中,它也支持竖直或水平拆分屏幕。 +`screen` 的灵活性比 `tmux` 要弱一些。它默认的绑定按键组合是 `Ctrl-A`,和 Bash 中光标移动到行首的快捷键是一样的。因此,当你正在运行 `screen` 的时候,如果想要将光标移动到行首,就需要多按一次 `Ctrl-A`。而我自己的做法是,在 `$HOME/.screenrc` 文件中将绑定按键组合重新设置为 `Ctrl-J`。 ``` -`escape ^jJ` +escape ^jJ ``` -尽管 Screen 在屏幕拆分功能上做得很好,但 tmux 上的一些缺点在 Screen 上也同样存在。例如在拆分 Shell 时,新的 Shell 不会在一个新的面板中启动,而是需要使用 `Ctrl-A Tab` 导航到另一个空间(如果你按照我的方式重新设置了按键组合,需要对应地把 `Ctrl-A` 改为 `Ctrl-J`),然后通过 `Ctrl-A C` 手动创建一个新的 Shell。 +尽管 `screen` 在屏幕拆分功能上做得很好,但 `tmux` 上的一些缺点在 Screen 上也同样存在。例如在拆分 Shell 时,在一个新的面板中不会启动新的 Shell ,而是需要使用 `Ctrl-A Tab` 导航到另一个面板(如果你按照我的方式重新设置了按键组合,需要对应地把 `Ctrl-A` 改为 `Ctrl-J`),然后通过 `Ctrl-A C` 手动创建一个新的 Shell。 -和 tmux 不同的是,Screen 在推出一个 Shell 的时候,屏幕拆分状态不会改变,这样的设计在某些情况下是比较适合的,但麻烦之处在于需要手动管理屏幕拆分状态。 +和 `tmux` 不同的是,`screen` 在退出一个 Shell 的时候,屏幕拆分状态不会改变,这样的设计在某些情况下是比较适合的,但麻烦之处在于需要手动管理屏幕拆分状态。 -尽管如此,Screen 还是一个相当可靠灵活的应用程序,在无法使用 tmux 的时候,你可以选择 Screen 作为备选方案。 +尽管如此,`screen` 还是一个相当可靠灵活的应用程序,在无法使用 `tmux` 的时候,你可以选择 `screen` 作为备选方案。 -在默认按键方案下,Screen 常用的基本命令包括: +在默认按键方案下,`screen` 常用的基本命令包括: * `Ctrl-A |` 竖直拆分屏幕(两个 Shell 分别位于左右) * `Ctrl-A S` 水平拆分屏幕(两个 Shell 分别位于上下) * `Ctrl-A Tab` 切换到另一个 Shell * `Ctrl-A ?` 查看帮助 - * `Ctrl-A d` 断开 Screen 并让其在后台运行(可以使用 `screen -r` 重新进入) + * `Ctrl-A d` 断开 `screen` 并让其在后台运行(可以使用 `screen -r` 重新进入) ### Konsole @@ -88,11 +88,11 @@ Screen 的灵活性比 tmux 要弱一些。它默认的绑定按键组合是 `Ct [Konsole][9] 是 KDE Plasma 桌面使用的终端应用程序。和 KDE 一样,Konsole 也以高度可定制、功能强大的特点而著称。 -和 tmux、GNU Screen 类似,Konsole 也具有拆分屏幕的功能。由于 Konsole 是图形界面的终端,因此还可以用鼠标来控制它的屏幕拆分。 +和 `tmux`、GNU Screen 类似,Konsole 也具有拆分屏幕的功能。由于 Konsole 是图形界面的终端,因此还可以用鼠标来控制它的屏幕拆分。 Konsole 的屏幕拆分功能在“查看View”菜单中。它也支持竖直和水平方向的拆分,只要点击鼠标就可以切换到另一个面板上。每个面板都是一个独立的终端,因此都可以拥有独立的主题和标签页。 -Konsole 和 tmux、GNU Screen 最大的不同之处在于不能断开和重新连接 Konsole。除非使用远程桌面软件,否则只能在打开 Konsole 时使用,这一点和大多数图形界面应用程序是一样的。 +Konsole 和 `tmux`、GNU Screen 最大的不同之处在于不能断开和重新连接 Konsole。除非使用远程桌面软件,否则只能在打开 Konsole 时使用,这一点和大多数图形界面应用程序是一样的。 ### Emacs @@ -108,28 +108,27 @@ Emacs 的一些重要快捷键包括: * `Ctrl-X 3` 竖直拆分屏幕(两个 Shell 分别位于左右) * `Ctrl-X 2` 水平拆分屏幕(两个 Shell 分别位于上下) - * `Ctrl-X O` 切换到另一个 Shell(你也可以使用鼠标操作) - * `Ctrl-X 0` 关闭当前面板 + * `Ctrl-X O` (大写字母 `O`)切换到另一个 Shell(你也可以使用鼠标操作) + * `Ctrl-X 0` (数字 `0`)关闭当前面板 如果你运行了 emacs-client 的话,就可以像 tmux 和 GNU Screen 一样断开和重新连接到 Emacs 了。 -### Window manager +### 窗口管理器 ![Ratpoison split screen][11] 除了文本编辑器之外,一些 Linux 桌面也同样具有拆分屏幕、加载终端这样的功能。例如 [Ratpoison][12]、[Herbsluftwm][13]、i3、Awesome,甚至是启用了特定设置的 KDE Plasma 桌面,都可以将多个应用程序在桌面上分块显示。 -这些桌面可以让各个应用程序占据屏幕的固定位置,而不是逐个叠放在一起,因此你可以在多个应用程序窗口之间轻松切换。你还可以打开多个终端,以达到终端复用的目的。更进一步,你还可以在桌面复用工具中加载终端复用工具。 +这些桌面可以让各个应用程序占据屏幕的固定位置,而不是浮在你的桌面“之上”,因此你可以在多个应用程序窗口之间轻松切换。你还可以打开多个终端,排布成网格,就像终端复用工具一样。更进一步,你还可以在你的桌面复用工具中加载一个终端复用工具。 -And there's nothing stopping you from loading Emacs with split buffers inside of that. No one knows what happens if you take it further than that, and most Linux users agree it's best not to find out. +而且,没有什么可以阻止你在里面载入 Emacs 并分割缓冲区。没有人知道,如果你把它更进一步,会发生什么,大多数 Linux 用户不会外传这种秘密。 -和 tmux、GNU Screen 不同,你在断开与桌面的连接后无法重新连接到同一个桌面会话,除非你使用了远程桌面软件进行连接。 +和 `tmux`、GNU Screen 不同,你在断开与桌面的连接后无法重新连接到同一个桌面会话,除非你使用了远程桌面软件进行连接。 ### 更多选择 除了上面介绍到的工具以外,还有诸如 [Tilix][14]、Terminator 这样的终端模拟器,它们同样可以实现屏幕拆分、嵌入终端组件等功能。欢迎在评论区分享你喜欢的终端拆分工具。 - -------------------------------------------------------------------------------- via: https://opensource.com/article/20/5/split-terminal @@ -137,7 +136,7 @@ via: https://opensource.com/article/20/5/split-terminal 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5880afedad4b77a17b5390fabbc9a573e8327554 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 21 May 2020 13:26:22 +0800 Subject: [PATCH 0757/1809] PUB @HankChow https://linux.cn/article-12236-1.html --- .../20200508 5 ways to split your Linux terminal.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200508 5 ways to split your Linux terminal.md (99%) diff --git a/translated/tech/20200508 5 ways to split your Linux terminal.md b/published/20200508 5 ways to split your Linux terminal.md similarity index 99% rename from translated/tech/20200508 5 ways to split your Linux terminal.md rename to published/20200508 5 ways to split your Linux terminal.md index acb8f405ff..3bc58045fa 100644 --- a/translated/tech/20200508 5 ways to split your Linux terminal.md +++ b/published/20200508 5 ways to split your Linux terminal.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12236-1.html) [#]: subject: (5 ways to split your Linux terminal) [#]: via: (https://opensource.com/article/20/5/split-terminal) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From d77fce2febc205ca95cee5b2c0d690659337e87e Mon Sep 17 00:00:00 2001 From: "qfzy1233@163.com" Date: Thu, 21 May 2020 16:59:45 +0800 Subject: [PATCH 0758/1809] Update 20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md --- ...Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md b/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md index 73e60dc17a..1f803fc2ca 100644 --- a/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md +++ b/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md @@ -7,7 +7,7 @@ [#]: via: (https://itsfoss.com/lubuntu-20-04-review/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) -Lubuntu 20.04 Review: Lightweight, Minimalistic, Polished +Lubuntu 20.04 简述: 轻量, 简约, 文雅 ====== _**Lubuntu 20.04 LTS is significantly different than its previous LTS version. It is aiming to give you a more polished experience rather than just focusing on older computer. Read more about it as I review Lubuntu 20.04.**_ From 1d3ea1677e89fe5cce98f42db79b9341704fa20e Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Thu, 21 May 2020 21:09:25 +0800 Subject: [PATCH 0759/1809] Update 20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md --- ...ew- Lightweight, Minimalistic, Polished.md | 128 +++++++++--------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md b/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md index 1f803fc2ca..a303a3853f 100644 --- a/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md +++ b/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md @@ -10,118 +10,118 @@ Lubuntu 20.04 简述: 轻量, 简约, 文雅 ====== -_**Lubuntu 20.04 LTS is significantly different than its previous LTS version. It is aiming to give you a more polished experience rather than just focusing on older computer. Read more about it as I review Lubuntu 20.04.**_ +_**Lubuntu20.04 LTS 与之前的 LTS 版本有很大的不同。它的旨在给你一个更完善的体验,而不仅仅是关注旧的电脑。阅读更多关于Lubuntu20.04的内容。**_ -### Lubuntu 20.04 Review: First LTS release with LXQt +### Lubuntu 20.04 一览: 第一个基于 LXQt 的长期支持版 -I have been using Lubuntu 20.04 from a few days before the release. I usually dwell in Arch world with Manjaro and Cinnamon desktop so using Lubuntu was a pleasant change for me. +我在 Lubuntu20.04 发行前几天就已经开始使用它了。我通常使用 Arch 阵营中 Manjaro 和 Cinnamon desktop,所以使用 Lubuntu 对我来说是一个愉快的改变。 -Here’s what I have noticed and felt about Lubuntu 20.04. +以下是我在使用 Lubuntu 20.04.时的一些感受和注记。 -#### Bye bye LXDE, Hello LXQt! +#### 再见LXDE,你好LXQt! -For a long time, [Lubuntu][1] relied on [LXDE][2] to provide a lightweight Linux experience. It now uses LXQt desktop environment. +很长一段时间以来,[Lubuntu][1]都依赖于[LXDE][2]来提供轻量级的Linux体验。现在它使用LXQt桌面环境。 -[LXDE][3] is based on GTK (the libraries used by GNOME) and more specifically on GTK+ 2 which is dated in 2020. Dissatisfied with GTK+ 3, LXDE developer Hong Jen Yee decided to port the entire desktop to Qt (the libraries used by KDE). LXDE, the Qt port of it, and the [Razor-qt][4] project were combined to form [LXQt][5]. Although today, LXDE and LXQt coexist as separate projects. +[LXDE][3]是基于 GTK (GNOME使用的库),更具体地说是基于2020年的 GTK+ 2。LXDE 开发人员 Hong Jen Yee 不满意 GTK+ 3,决定将整个桌面移植到Qt (KDE使用的库)。LXDE、it的Qt端口和[Razor-qt][4]项目合并形成[LXQt][5]。所以现在,LXDE和LXQt作为单独的项目共存。 -Since LXDE developer itself is focusing on LXQt, it makes no sense for Lubuntu to stick with a desktop environment that had its last stable release more than three years ago. +由于 LXDE 开发者本身关注于 LXQt ,所以 Lubuntu 死磕桌面环境是没有意义的,因为上一次稳定发行版已经是三年多以前的事情了。 -Lubuntu 18.04 is the last version of with [LXDE][3]. Fortunately it’s a long term support edition. It will be supported officially by Lubuntu team till 2021. +Lubuntu 18.04是[LXDE][3]的最后一个版本。幸运的是,这是一个长期支持版本。Lubuntu团队将提供支持直到2021年。 ![][6] -#### Not exclusively for older machines +#### 不仅适于老机器 -As the definition of “older machine” has changed in 2020 Lubuntu 18.04 is the last 32bit version. Nowadays even a 10 year old machine comes with at least 2 gigabytes of ram and a dual-core 64bit processor. +由于“老机器”的定义在2020年发生了变化,Lubuntu 18.04是最后一个32位版本。现在,即使是一台10年前的老机器也至少有2g的内存和一个双核64位处理器。 -As per that, [Lubuntu Team will no longer provide minimum system requirements and will no longer primarily focus on older hardware][7]. Although LXQt is still a lightweight, classic yet polished and feature rich desktop environment. +因此,Lubuntu 团队将不再提供最低的系统需求,也不再主要关注旧的硬件。尽管 LXQt 仍然是一个轻量级的、经典的、完善的、功能丰富的桌面环境。 -The First Lubuntu release with LXQt was 18.10, giving the developers three standard releases to perfect the LXQt desktop before the Lubuntu 20.04 LTS release, which is a good development strategy. +Lubuntu 的第一个 LXQt 发行版是18.10,在Lubuntu20.04 LTS 发行版之前,开发人员经历了三个标准发行版来完善 LXQt 桌面,这是一个很好的开发策略。 -#### Not the regular Ubiquity, Lubuntu 20.04 uses Calamares installer +#### 与以往不同的是 Lubuntu 20.04 使用 Calamares 安装器 -![Lubuntu 20.04 Calamares Installer][8] +![Lubuntu 20.04 Calamares 安装器][8] -A fresh installation begins with the new [Calamares][9] installer, in place of the Ubiquity installer that other [official Ubuntu flavors][10] use. +在新版本中全新的[Calamares][9]安装器,取代了其他[Ubuntu官方版本][10]使用的普遍安装程序。 -The whole process is done in approximately 10 minutes, slightly faster than the previous Lubuntu releases. +整个安装过程在大约10分钟内完成,比之前Lubuntu的版本稍微快一些。 -As the .iso comes with the essential applications pre-installed you can get your system fully configured pretty fast too. +由于镜像文件附带了预先安装的基本应用程序,你也可以很快地完全配置您的系统。 -#### No upgrade from Lubuntu 18.04 to Lubuntu 20.04 +#### 不要直接从 Lubuntu 18.04 升级到 Lubuntu 20.04 -Normally, you can [upgrade Ubuntu from one LTS to another LTS release][11]. But Lubuntu team advises not to upgrade from Lubuntu 18.04 to 20.04. They recommend a fresh install and rightly so. +通常,你可以[将Ubuntu从一个LTS版本升级到另一个LTS版本][11]。但是 Lubuntu 团队建议不要从 Lubuntu18.04升级到20.04。他们建议重新安装,这才是正确的。 -Lubuntu 18.04 used LXDE desktop while 20.04 uses LXQt. Due to the extensive changes in the desktop environments, upgrading to 20.04 from 18.04 will result in a broken system. +Lubuntu 18.04使用LXDE桌面,20.04使用LXQt。由于桌面环境的巨大变化,从18.04升级到20.04将导致系统崩溃。 -#### **More KDE and Qt applications** +#### **更多的KDE和Qt应用程序** ![][12] -Here are some of the applications that are available by default in this new release and as I can see, not all of them are lightweight and most of them are Qt-based. +下面是在这个新版本中默认可用的一些应用程序,正如我们所看到的,并非所有应用程序都是轻量级的,而且大多数应用程序都是基于qt的。 -Even the software center used is KDE’s Discover instead of Ubuntu’s GNOME software center. +甚至使用的软件中心也是 KDE 的 Discover,而不是 Ubuntu 的 GNOME 软件中心。 - * Ark – archive manager - * Bluedevil – bluetooth connector - * Discover Software Center – package management system - * FeatherPad – text editor - * FireFox – web browser - * K3b – CD/DVD burner - * Kcalc – calculator - * KDE partition manager – partition manager - * LibreOffice – Office suite (Qt interface version) - * LXimage-Qt – image viewer and screenshot tool - * Muon – package manager + * Ark – 压缩文件管理器 + * Bluedevil – 蓝牙连接管理 + * Discover Software Center – 包管理系统 + * FeatherPad – 文本编辑器 + * FireFox – 浏览器 + * K3b – CD/DVD 刻录器 + * Kcalc – 计算器 + * KDE partition manager – 分区管理工具 + * LibreOffice – 办公套件 (Qt 接口版本) + * LXimage-Qt – 图片查看及截图制作 + * Muon – 包管理器 - * Noblenote – note taker - * PCManFM-Qt – File manager - * Qlipper – clipboard manager - * qPDFview – PDF viewer - * PulseAudio – audio controller - * Qtransmission – bittorrent client (Qt interface version) - * Quassel – IRC client - * ScreenGrab – Screenshot creator - * Skanlite – scanning - * Startup Disk Creator – USB boot disk maker - * Trojita – email client - * VLC – media player + * Noblenote – 笔记工具 + * PCManFM-Qt – 文件管理器 + * Qlipper – 剪贴板管理工具 + * qPDFview – PDF 阅读器 + * PulseAudio – 音频控制器 + * Qtransmission – BT下载工具 (Qt 接口版本) + * Quassel – 实时聊天客户端 + * ScreenGrab – 截屏制作工具 + * Skanlite – 扫描工具 + * Startup Disk Creator – USB 启动盘制作工具 + * Trojita – 邮件客户端 + * VLC – 媒体播放器 * [MPV video player][13] -#### Testing Lubuntu 20.04 LTS +#### 测试 Lubuntu 20.04 LTS -Boot times on the LXQt version of Lubuntu are under a minute, booting from an SSD though. +LXQt 版Lubuntu的启动时间不到一分钟,不过是从SSD启动的。 -LXQt currently requires slightly more memory than the Gtk+ v2-based LXDE, but the alternative Gtk+ v3 toolkit would also have required more memory. +LXQt 目前需要的内存比基于 Gtk+ v2 的LXDE稍微多一点,但是另一种 Gtk+ v3 工具包也需要更多的内存。 -After a reboot the system runs approximately at a very low of 340 MB for the modern standards, 100 MB more than LXDE. +在重新启动之后,系统以非常低的内存占用情况运行,大约只有340 MB(按照现代标准),比LXDE多100 MB。 -![htop running on Lubuntu 20.04][14] +![htop 在 Lubuntu 20.04 上运行][14] -LXQt is not only for users with an older hardware but also for those who are seeking a simple and classic experience at their new machine. +LXQt 不仅适用于使用旧硬件的用户,也适用于那些希望在新机器上获得简单而经典体验的用户。 -The desktop layout looks similar to KDE’s Plasma desktop, don’t you think? +桌面布局看起来类似于 KDE 的 Plasma 桌面,你不这样认为吗? -![Lubuntu 20.04 Desktop][15] +![Lubuntu 20.04 桌面环境][15] -There’s an application menu in the lower-left corner, a taskbar for pinned and active applications, and a system tray in the lower-right corner. +在左下角有一个应用程序菜单,一个用于固定和活动应用程序的任务栏,右下角有一个系统托盘。 -Lubuntu in its LXQt version can be easily customized and everything is in the menu under preferences, with most key items under LXQt Settings. +Lubuntu 的 LXQt 版本可以很容易的定制,所有的东西都在菜单的首选项下,大部分的关键项目都在 LXQt 设置下。 -It is worth-mentioning that LXQt uses the popular [Openbox window manager][16] by default. +值得一提的是, LXQt 在默认情况下使用流行的[ Openbox 窗口管理器][16]。 -Like the last three releases, 20.04 LTS comes with a default dark theme Lubuntu Arc, but it is quick and easy to change it if it doesn’t suit your taste. +与前三个发行版一样,20.04 LTS 附带了一个默认的黑暗主题 Lubuntu ,但是如果不适合你的口味,可以快速、轻松地更改它。 -In daily use, Lubuntu 20.04 has proven to me completely trouble-free as every Ubuntu flavour in fact. +就日常使用而言,Lubuntu20.04 已经向我证明了它是完全没有问题的,因为它是 Ubuntu 的一个版本。 -#### Conclusion +#### 结论 -Lubuntu team has successfully made the transition to a modern, still lightweight and minimal desktop environment. LXDE looks like abandoned and it is a good thing to move away to an active project. +Lubuntu团队已经成功地过渡到一个现代的、依然轻量级的、最小的桌面环境。LXDE看起来被遗弃了,迁移到一个活跃的项目也是一件好事。 -I hope that Lubuntu 20.04 makes you as much enthusiastic as I am, and if so don’t hesitate to let me know at the comments below. Stay tuned! +我希望Lubuntu 20.04能够像我一样让你充满热情,如果是这样,请在下面的评论中告诉我。请继续关注! -------------------------------------------------------------------------------- @@ -129,7 +129,7 @@ via: https://itsfoss.com/lubuntu-20-04-review/ 作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[qfzy1233](https://github.com/qfzy1233) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a800366dee5e9a4ccf433ee486934f309410338c Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Thu, 21 May 2020 21:12:13 +0800 Subject: [PATCH 0760/1809] Rename sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md to translated/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md --- ...8 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md (100%) diff --git a/sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md b/translated/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md similarity index 100% rename from sources/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md rename to translated/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md From 5296c06b50143be1aecf58c0fe4e4f47ebb73bde Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 21 May 2020 21:32:36 +0800 Subject: [PATCH 0761/1809] APL --- .../tech/20190510 Learn to change history with git rebase.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sources/tech/20190510 Learn to change history with git rebase.md b/sources/tech/20190510 Learn to change history with git rebase.md index 4d46fef81f..7e2f6c943e 100644 --- a/sources/tech/20190510 Learn to change history with git rebase.md +++ b/sources/tech/20190510 Learn to change history with git rebase.md @@ -1,8 +1,5 @@ -Translating by Scoutydren.... - - [#]: collector: (lujun9972) -[#]: translator: (Scoutydren) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 01c8c99e9a86603429dc0a1c2353eae3ee70f39d Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 22 May 2020 08:41:57 +0800 Subject: [PATCH 0762/1809] translated --- ... MySQL-MariaDB Database Server on Linux.md | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) rename {sources => translated}/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md (66%) diff --git a/sources/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md b/translated/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md similarity index 66% rename from sources/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md rename to translated/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md index a2070192d0..247a2806c4 100644 --- a/sources/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md +++ b/translated/tech/20200506 Three Methods to Check Uptime of MySQL-MariaDB Database Server on Linux.md @@ -7,26 +7,26 @@ [#]: via: (https://www.2daygeek.com/check-mysql-mariadb-database-server-uptime-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Three Methods to Check Uptime of MySQL/MariaDB Database Server on Linux +在 Linux 上检查 MySQL/MariaDB 数据库正常运行时间的三种方法 ====== -We all know the purpose of the uptime command in Linux. +我们都知道在 Linux 中使用 uptime 命令的目的。 -This is used to check the **[uptime of the Linux system][1]** and how long the system runs without restarting. +它用于检查 **[Linux 系统的正常运行时间][1]**以及系统未重启运行的时间。 -The Linux admin job is to keep the system up and running. +Linux 管理员的工作是保持系统正常运行。 -If you want to check how long other services like **[Apache][2]**, MySQL, MariaDB, sftp, etc., are running on Linux, how do you do that? +如果要检查 Linux 上的其他服务(例如 **[Apache][2]**、MySQL、MariaDB、sftp 等)运行了多长时间,该怎么做? -Each service has their own command to check the uptime of service. +每个服务都有自己的命令来检查服务的正常运行时间。 -But you can also use other commands for this purpose. +但是你也可以为此使用其他命令。 -### Method-1: How to Check the Uptime of a MySQL/MariaDB Database Server on Linux Using the ps Command +### 方法 1:如何使用 ps 命令在 Linux 上检查 MySQL/MariaDB 数据库的正常运行时间 -The **[ps command][3]** stands for process status. This is one of the most basic commands that shows the system running processes with details. +**[ps命令][3]**代表进程状态。这是最基本的命令之一,它显示了系统正在运行的进程的详细信息。 -To do so, you first need to find the PID of **[MySQL][4]**/MariaDB using the **[pidof command][5]**. +为此,你首先需要使用 **[pidof 命令][5]查找 **[MySQL][4]**/MariaDB的 PID。 ``` # pidof mysqld | cut -d" " -f1 @@ -34,9 +34,9 @@ To do so, you first need to find the PID of **[MySQL][4]**/MariaDB using the **[ 2412 ``` -Once you have the MySQL/[**MariaDB**][6] PID, use the “etime” option with the ps command and get the uptime. +获取 MySQL/[**MariaDB**][6] 的 PID 后,请在 ps 命令中使用 “etime” 选项获得正常运行时间。 - * **etime:** elapsed time since the process was started, in the form of [[DD-]hh:]mm:ss. + * **etime:**自进程启动以来经过的时间,形式为 [[DD-]hh:]mm:ss。 @@ -47,7 +47,7 @@ Once you have the MySQL/[**MariaDB**][6] PID, use the “etime” option with th 2-08:49:30 ``` -Alternatively, use the “lstart” option with the ps command to get the uptime of a given PID. +或者,在 ps 命令中使用 “lstart” 选项来获取指定 PID 的正常运行时间。 ``` # ps -p 2412 -o lstart @@ -56,17 +56,17 @@ Alternatively, use the “lstart” option with the ps command to get the uptime Sat May 2 03:02:15 2020 ``` -The MySQL/MariaDB process has been running for 2 days, 03 hours, 02 minutes and 15 seconds. +MySQL/MariaDB 进程已经运行了 2 天 03 小时 02 分 15 秒。 -### Method-2: How to Check the Uptime of a MySQL/MariaDB Database Server on Linux Using the Systemctl Command +### 方法 2:如何使用 Systemctl 命令在 Linux 上检查 MySQL/MariaDB 数据库的正常运行时间 -The **[systemctl command][7]** is used to control the systemd system and service manager. +**[systemctl 命令][7]** 用于控制 systemd 系统和服务管理器。 -systemd is a new init system and system manager, that was adopted by most of Linux distributions now over the traditional SysVinit manager. +systemd 是新的 init 系统和系统管理器,现在大多数 Linux 发行版都淘汰了传统的 SysVinit 管理器而采用了systemd。 ``` # systemctl status mariadb -or +或者 # systemctl status mysql ● mariadb.service - MariaDB 10.1.44 database server @@ -95,13 +95,13 @@ Warning: Journal has been rotated since unit was started. Log output is incomple Hint: Some lines were ellipsized, use -l to show in full. ``` -### Method-3: How to Check the Uptime of a MySQL/MariaDB Database Server on Linux Using the MySQLAdmin Command +### 方法 3:如何使用 MySQLAdmin 命令在 Linux 上检查 MySQL/MariaDB 数据库的正常运行时间 -**[MySQLAdmin][8]** is a command-line utility for MySQL Server that is installed when installing the MySQL package. +**[MySQLAdmin][8]** 是安装 MySQL 软件包时安装的 MySQL 服务器命令行程序。 -The MySQLAdmin client allows you to perform some basic administrative functions on the MySQL server. +MySQLAdmin 客户端允许你在 MySQL 服务器上执行一些基本的管理功能。 -It is used to create a database, drop a database, set a root password, change the root password, check MySQL status, verify MySQL functionality, monitor mysql processes, and verify the configuration of the server. +它用于创建数据库、删除数据库、设置 root 密码、更改 root 密码、检查 MySQL 状态、验证 MySQL 功能、监视 mysql 进程以及验证服务器的配置。 ``` # mysqladmin -u root -pPassword version @@ -126,7 +126,7 @@ via: https://www.2daygeek.com/check-mysql-mariadb-database-server-uptime-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 857b4a97909200aba0d174447499fbdad66806ad Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 22 May 2020 09:14:28 +0800 Subject: [PATCH 0763/1809] translating --- ...thon templating languages you should (probably) never use.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200401 3 Python templating languages you should (probably) never use.md b/sources/tech/20200401 3 Python templating languages you should (probably) never use.md index e23b443b0d..7d73216ea5 100644 --- a/sources/tech/20200401 3 Python templating languages you should (probably) never use.md +++ b/sources/tech/20200401 3 Python templating languages you should (probably) never use.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 61327d3809182c7fd516594c7c1b8cf0ade000cc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 22 May 2020 09:17:37 +0800 Subject: [PATCH 0764/1809] TSL PART 1 --- ...Learn to change history with git rebase.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) rename {sources => translated}/tech/20190510 Learn to change history with git rebase.md (89%) diff --git a/sources/tech/20190510 Learn to change history with git rebase.md b/translated/tech/20190510 Learn to change history with git rebase.md similarity index 89% rename from sources/tech/20190510 Learn to change history with git rebase.md rename to translated/tech/20190510 Learn to change history with git rebase.md index 7e2f6c943e..03dbb641f9 100644 --- a/sources/tech/20190510 Learn to change history with git rebase.md +++ b/translated/tech/20190510 Learn to change history with git rebase.md @@ -7,19 +7,18 @@ [#]: via: (https://git-rebase.io/) [#]: author: (git-rebase https://git-rebase.io/) -Learn to change history with git rebase! +学习用 git 变基来改变历史! ====== -One of Git 's core value-adds is the ability to edit history. Unlike version control systems that treat the history as a sacred record, in git we can change history to suit our needs. This gives us a lot of powerful tools and allows us to curate a good commit history in the same way we use refactoring to uphold good software design practices. These tools can be a little bit intimidating to the novice or even intermediate git user, but this guide will help to demystify the powerful git-rebase . -``` -A word of caution : changing the history of public, shared, or stable branches is generally advised against. Editing the history of feature branches and personal forks is fine, and editing commits that you haven't pushed yet is always okay. Use git push -f to force push your changes to a personal fork or feature branch after editing your commits. -``` +[Git][1] 的核心的附加价值之一就是编辑历史记录的能力。不同于将历史记录视为神圣的记录的版本控制系统,在 Git 中,我们可以根据自己的需要修改历史记录。这为我们提供了很多强大的工具,让我们可以像使用重构来维护良好的软件设计实践一样,编织良好的提交历史。这些工具对于新手甚至是有经验的 Git 用户来说可能会有些生畏,但本指南将帮助我们揭秘强大的 git-rebase。 -Despite the scary warning, it's worth mentioning that everything mentioned in this guide is a non-destructive operation. It's actually pretty difficult to permanently lose data in git. Fixing things when you make mistakes is covered at the end of this guide. +> 值得注意的是:一般建议不要修改公共分支、共享分支或稳定分支的历史记录。编辑特性分支和个人分支的历史记录是可以的,编辑还没有推送的提交也是可以的。在编辑完提交后,使用 `git push -f` 来强制推送你的修改到个人分支或特性分支。 -### Setting up a sandbox +尽管有这么可怕的警告,但值得一提的是,本指南中提到的一切都是非破坏性操作。实际上,在 Git 中永久丢失数据是相当困难的。当你犯错时的修复方法在本指南的最后会涉及到。 -We don't want to mess up any of your actual repositories, so throughout this guide we'll be working with a sandbox repo. Run these commands to get started: +### 设置沙盒 + +我们不想破坏你的实际版本库,所以在整个指南中,我们将使用一个沙盒版本库。运行这些命令来开始工作。[^1] ``` git init /tmp/rebase-sandbox @@ -27,31 +26,30 @@ cd /tmp/rebase-sandbox git commit --allow-empty -m"Initial commit" ``` -If you run into trouble, just run rm -rf /tmp/rebase-sandbox and run these steps again to start over. Each step of this guide can be run on a fresh sandbox, so it's not necessary to re-do every task. +如果你遇到麻烦,只需运行 `rm -rf /tmp/rebase-sandbox`,然后重新运行这些步骤重新开始。本指南的每一步都可以在一个新的沙箱上运行,所以没有必要重做每个任务。 +### 修正最新的提交 -### Amending your last commit - -Let's start with something simple: fixing your most recent commit. Let's add a file to our sandbox - and make a mistake: +让我们从简单的事情开始:修复你最近的提交。让我们将一个文件添加到我们的沙盒中,并犯个错误。 ``` echo "Hello wrold!" >greeting.txt - git add greeting.txt - git commit -m"Add greeting.txt" +git add greeting.txt +git commit -m"Add greeting.txt" ``` -Fixing this mistake is pretty easy. We can just edit the file and commit with `--amend`, like so: +修复这个错误是非常容易的。我们只需要编辑文件,然后用 `--amend` 提交就可以了,就像这样: ``` echo "Hello world!" >greeting.txt - git commit -a --amend +git commit -a --amend ``` -Specifying `-a` automatically stages (i.e. `git add`'s) all files that git already knows about, and `--amend` will squash the changes into the most recent commit. Save and quit your editor (you have a chance to change the commit message now if you'd like). You can see the fixed commit by running `git show`: +指定 `-a` 会自动将所有 Git 已经知道的文件进行暂存(即 `--amend`),而 `--amend` 会将更改的内容压制到最近的提交中。保存并退出你的编辑器(如果你愿意的话,现在你有机会修改提交信息)。你可以通过运行 `--git show` 看到修复的提交。 ``` commit f5f19fbf6d35b2db37dcac3a55289ff9602e4d00 (HEAD -> master) -Author: Drew DeVault +Author: Drew DeVault Date: Sun Apr 28 11:09:47 2019 -0400 Add greeting.txt @@ -592,3 +590,5 @@ via: https://git-rebase.io/ [a]: https://git-rebase.io/ [b]: https://github.com/lujun9972 +[1]: https://git-scm.com/ +[2]: https://git-scm.com/docs/git-rebase From 34ea82a55a2721f03e5812add565ff1ad0d58fc8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 22 May 2020 10:17:58 +0800 Subject: [PATCH 0765/1809] PRF @lxbwolf --- ... Go binaries by prohibiting comparisons.md | 62 +++++++++---------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/translated/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md b/translated/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md index ba2e321bb3..b9fabc8f27 100644 --- a/translated/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md +++ b/translated/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Ensmallening Go binaries by prohibiting comparisons) @@ -10,25 +10,27 @@ 通过禁止比较让 Go 二进制文件变小 ====== -大家常规的认知是,Go 程序中声明的类型越多,生成的二进制文件就越大。这个符合直觉,毕竟如果你写的代码不去操作定义的类型,那么定义一堆类型就没有意义了。然而,链接器的部分工作就是检测程序没有引用的函数,比如仅仅有某个功能的子功能使用的库中的某些函数,然后把他们从最后的编译产出中删除。常言道,“类型越多,二进制文件越大“,对于多数 Go 程序还是正确的。 +![](https://img.linux.net.cn/data/attachment/album/202005/22/101617lcha7vvqzhh7d565.jpg) -本文中我会深入讲解在 Go 程序的上下文中相等的意义,以及为什么[像这样][1]的修改会对 Go 程序的大小有重大的影响。 +大家常规的认知是,Go 程序中声明的类型越多,生成的二进制文件就越大。这个符合直觉,毕竟如果你写的代码不去操作定义的类型,那么定义一堆类型就没有意义了。然而,链接器的部分工作就是检测没有被程序引用的函数(比如说它们是一个库的一部分,其中只有一个子集的功能被使用),然后把它们从最后的编译产出中删除。常言道,“类型越多,二进制文件越大”,对于多数 Go 程序还是正确的。 + +本文中我会深入讲解在 Go 程序的上下文中“相等”的意义,以及为什么[像这样][1]的修改会对 Go 程序的大小有重大的影响。 ### 定义两个值相等 -Go 的语法定义了赋值和相等的概念。赋值是把一个值赋给一个标识符的行为。并不是所有声明的标识符都可以被赋值,如常量和函数就不可以。相等是通过检查标识符的内容是否相等来比较两个标识符的行为。 +Go 的语法定义了“赋值”和“相等”的概念。赋值是把一个值赋给一个标识符的行为。并不是所有声明的标识符都可以被赋值,如常量和函数就不可以。相等是通过检查标识符的内容是否相等来比较两个标识符的行为。 作为强类型语言,“相同”的概念从根源上被植入标识符的类型中。两个标识符只有是相同类型的前提下,才有可能相同。除此之外,值的类型定义了如何比较该类型的两个值。 -例如,整型是用算数方法进行比较的。对于指针类型,是否相等是指他们指向的地址是否相同。map 和 channel 等引用类型,跟指针类似,如果它们有相同的地址,那么就认为它们是相同的。 +例如,整型是用算数方法进行比较的。对于指针类型,是否相等是指它们指向的地址是否相同。映射和通道等引用类型,跟指针类似,如果它们指向相同的地址,那么就认为它们是相同的。 -上面都是按位比较相等的例子,即值占用的位模式内存是相同的,那么这些值就相等。这个就是 memcmp,全称为 memory comparison,相等是通过比较两个内存区域的内容来定义的。 +上面都是按位比较相等的例子,即值占用的内存的位模式是相同的,那么这些值就相等。这就是所谓的 memcmp,即内存比较,相等是通过比较两个内存区域的内容来定义的。 -记住这个思路,我会很快回来的。 +记住这个思路,我过会儿再来谈。 ### 结构体相等 -除了整型、浮点型和指针等标量类型,还有复合类型;结构体。所有的结构体以程序中的顺序被排列在内存中。因此下面这个声明 +除了整型、浮点型和指针等标量类型,还有复合类型:结构体。所有的结构体以程序中的顺序被排列在内存中。因此下面这个声明: ``` type S struct { @@ -41,7 +43,7 @@ type S struct { ``` a := S{1, 2, 3, 4} b := S{1, 2, 3, 4} -fmt.Println(a == b) // prints true +fmt.Println(a == b) // 输出 true ``` 编译器在底层使用 memcmp 来比较 `a` 的 32 个字节和 `b` 的 32 个字节。 @@ -61,38 +63,38 @@ type S struct { func main() a := S{1, 2, 3, 4} b := S{1, 2, 3, 4} - fmt.Println(a == b) // prints true + fmt.Println(a == b) // 输出 true } ``` -编译代码后,这个比较表达式的结果还是 true,但是编译器在底层并不能仅依赖比较 `a` 和 `b` 的位模式,因为结构体有*填充*。 +编译代码后,这个比较表达式的结果还是 `true`,但是编译器在底层并不能仅依赖比较 `a` 和 `b` 的位模式,因为结构体有*填充*。 -Go 要求结构体的所有字段都对齐。2 字节的值必须从偶数地址开始,4 字节的值必须从 4 的倍数地址开始,以此类推[1][2]。编译器根据字段的类型和底层平台加入了填充来确保字段都*对齐*。在填充之后,编译器实际上看到的是[2][3]: +Go 要求结构体的所有字段都对齐。2 字节的值必须从偶数地址开始,4 字节的值必须从 4 的倍数地址开始,以此类推 [^1]。编译器根据字段的类型和底层平台加入了填充来确保字段都*对齐*。在填充之后,编译器实际上看到的是 [^2]: ``` type S struct { a byte - _ [7]byte // padding + _ [7]byte // 填充 b uint64 c int16 - _ [2]int16 // padding + _ [2]int16 // 填充 d uint32 } ``` 填充的存在保证了字段正确对齐,而填充确实占用了内存空间,但是填充字节的内容是未知的。你可能会认为在 Go 中 填充字节都是 0,但实际上并不是 — 填充字节的内容是未定义的。由于它们并不是被定义为某个确定的值,因此按位比较会因为分布在 `s` 的 24 字节中的 9 个填充字节不一样而返回错误结果。 -Go 通过生成相等函数来解决这个问题。在这个例子中,`s` 的相等函数只比较函数中的字段略过填充部分,这样就能正确比较类型 `s` 的两个值。 +Go 通过生成所谓的相等函数来解决这个问题。在这个例子中,`s` 的相等函数只比较函数中的字段略过填充部分,这样就能正确比较类型 `s` 的两个值。 ### 类型算法 -嚄,需要做很多准备工作才能解释原因,对于 Go 程序中定义的每种类型,编译器都会生成几个支持它的函数,编译器内部把它们识别为类型的算法。如果类型是一个 map 的 key,那么除相等函数外,编译器还会生成一个哈希函数。为了维持稳定,哈希函数在计算结果时也会像相等函数一样考虑诸如填充等因素。 +呵,这是个很大的设置,说明了为什么,对于 Go 程序中定义的每种类型,编译器都会生成几个支持函数,编译器内部把它们称作类型的算法。如果类型是一个映射的键,那么除相等函数外,编译器还会生成一个哈希函数。为了维持稳定,哈希函数在计算结果时也会像相等函数一样考虑诸如填充等因素。 -凭直觉判断编译器什么时候生成这些函数实际上很难,有时并不明显,(因为)这超出了你的预期,而且链接器也很难消除没有被使用的类型,因为反射往往导致链接器在裁剪类型时变得更保守。 +凭直觉判断编译器什么时候生成这些函数实际上很难,有时并不明显,(因为)这超出了你的预期,而且链接器也很难消除没有被使用的函数,因为反射往往导致链接器在裁剪类型时变得更保守。 ### 通过禁止比较来减小二进制文件的大小 -现在,我们能解释 Brad 的修改了。向类型添加一个不可比较的字段[3][4],结构体也随之变成不可比较的,从而强制编译器不再生成相等和哈希算法、规避了链接器对那些类型的消除、在实际应用中减小了生成的二进制文件的大小。作为这项技术的一个例子,下面的程序: +现在,我们来解释一下 Brad 的修改。向类型添加一个不可比较的字段 [^3],结构体也随之变成不可比较的,从而强制编译器不再生成相等函数和哈希函数,规避了链接器对那些类型的消除,在实际应用中减小了生成的二进制文件的大小。作为这项技术的一个例子,下面的程序: ``` package main @@ -101,7 +103,7 @@ import "fmt" func main() { type t struct { - // _ [0][]byte uncomment to prevent comparison + // _ [0][]byte // 取消注释以阻止比较 a byte b uint16 c int32 @@ -112,28 +114,24 @@ func main() { } ``` -用 Go 1.14.2(darwin/amd64)编译,大小从 2174088 降到了 2174056,节省了 32 字节。单独看节省的这 32 字节似乎微不足道,但是考虑到你的程序中每个类型及其传递闭包都会生成相等和哈希函数,还有他们的依赖,这些函数的大小随类型大小和复杂度的不同而不同,禁止它们会大大减小最终的二进制文件的大小,效果比之前使用 `-ldflags="-s -w"` 还要好。 +用 Go 1.14.2(darwin/amd64)编译,大小从 2174088 降到了 2174056,节省了 32 字节。单独看节省的这 32 字节似乎微不足道,但是考虑到你的程序中每个类型及其传递闭包都会生成相等和哈希函数,还有它们的依赖,这些函数的大小随类型大小和复杂度的不同而不同,禁止它们会大大减小最终的二进制文件的大小,效果比之前使用 `-ldflags="-s -w"` 还要好。 -最后总结一下,如果你不想把类型定义为可比较的,像这样的入侵可以在源码层级强制实现,而且会使生成的二进制文件变小。 +最后总结一下,如果你不想把类型定义为可比较的,可以在源码层级强制实现像这样的奇技淫巧,会使生成的二进制文件变小。 * * * -附录:在 Brad 的推动下,[Cherry Zhang][5] 和 [Keith Randall][6] 已经在 Go 1.15 做了大量的改进来修复最恶名昭彰的消除无用相等和哈希函数失败(虽然我猜想这也是为了避免这类 CL 的扩散)。 - - 1. 在 32 位平台上 `int64` 和 `unit64` 的值可能不是按 8 字节对齐的,因为平台原生的是以 4 字节对齐的。查看 [issue 599][7] 了解内部详细信息[][8]。 - 2. 32 位平台会在 `a` 和 `b` 的声明中填充 `_ [3]byte`。查看前面的内容[][9]。 - 3. Brad 使用的是`[0]func()`,但是所有能限制和禁止比较的类型都可以。添加了一个有 0 个元素的数组的声明后,结构体的大小和对齐不会受影响。[][10] - +附录:在 Brad 的推动下,[Cherry Zhang][5] 和 [Keith Randall][6] 已经在 Go 1.15 做了大量的改进,修复了最严重的故障,消除了无用的相等和哈希函数(虽然我猜想这也是为了避免这类 CL 的扩散)。 +[^1]: 在 32 位平台上 `int64` 和 `unit64` 的值可能不是按 8 字节对齐的,因为平台原生的是以 4 字节对齐的。查看 [议题 599][7] 了解内部详细信息。 +[^2]: 32 位平台会在 `a` 和 `b` 的声明中填充 `_ [3]byte`。参见前一条。 +[^3]: Brad 使用的是`[0]func()`,但是所有能限制和禁止比较的类型都可以。添加了一个有 0 个元素的数组的声明后,结构体的大小和对齐不会受影响。 #### 相关文章: - 1. [Go 运行时如何高效地实现 map(不使用泛型)][11] + 1. [Go 运行时如何高效地实现映射(不使用泛型)][11] 2. [空结构体][12] 3. [填充很难][13] - 4. [Go 中有类型的 nil 2][14] - - + 4. [Go 中有类型的 nil(2)][14] -------------------------------------------------------------------------------- @@ -142,7 +140,7 @@ via: https://dave.cheney.net/2020/05/09/ensmallening-go-binaries-by-prohibiting- 作者:[Dave Cheney][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d1ffed9a8a149524f00d34ab2816f2f7c6b827f1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 22 May 2020 10:18:30 +0800 Subject: [PATCH 0766/1809] PUB @lxbwolf https://linux.cn/article-12238-1.html --- ...509 Ensmallening Go binaries by prohibiting comparisons.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200509 Ensmallening Go binaries by prohibiting comparisons.md (99%) diff --git a/translated/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md b/published/20200509 Ensmallening Go binaries by prohibiting comparisons.md similarity index 99% rename from translated/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md rename to published/20200509 Ensmallening Go binaries by prohibiting comparisons.md index b9fabc8f27..1d1a6b1590 100644 --- a/translated/tech/20200509 Ensmallening Go binaries by prohibiting comparisons.md +++ b/published/20200509 Ensmallening Go binaries by prohibiting comparisons.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12238-1.html) [#]: subject: (Ensmallening Go binaries by prohibiting comparisons) [#]: via: (https://dave.cheney.net/2020/05/09/ensmallening-go-binaries-by-prohibiting-comparisons) [#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) From c341228e692fae3ff3fd6fb629473e5526489ce0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 22 May 2020 11:41:39 +0800 Subject: [PATCH 0767/1809] PRF @geekpi --- ...r getting around your Linux file system.md | 55 +++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/translated/tech/20200326 Tricks for getting around your Linux file system.md b/translated/tech/20200326 Tricks for getting around your Linux file system.md index 3883ab5c8d..474b6886dd 100644 --- a/translated/tech/20200326 Tricks for getting around your Linux file system.md +++ b/translated/tech/20200326 Tricks for getting around your Linux file system.md @@ -1,34 +1,36 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Tricks for getting around your Linux file system) [#]: via: (https://www.networkworld.com/article/3533421/tricks-for-getting-around-your-linux-file-system.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -使用 Linux 文件系统的技巧 +在 Linux 文件系统中导航的技巧 ====== -cd 命令可能是任何 Linux 用户学习的前 10 个命令之一,但这并不是在 Linux 文件系统中切换的唯一方法,这里还有其他一些方法。 + +> cd 命令可能是任何 Linux 用户学习的前 10 个命令之一,但这并不是在 Linux 文件系统中导航的唯一方法,这里还有其他一些方法。 + +![](https://img.linux.net.cn/data/attachment/album/202005/22/114058yrzlx94rz9lbx974.jpg) 无论你是在文件系统中四处查看、寻找文件还是尝试进入重要目录,Linux 都可以提供很多帮助。在本文中,我们将介绍一些技巧,使你可以在文件系统中移动,查找和使用所需的命令也更加轻松。 -### 添加到 $PATH +### 添加到 \$PATH -确保你不必花费大量时间在 Linux 系统上查找命令的最简单、最有用的方法之一就是在 $PATH 变量中添加适当的目录。但是,添加到 $PATH 变量中的目录顺序非常重要。它们确定系统在目录中查找要运行命令的目录顺序--在找到第一个匹配项时停止。 +确保你不必花费大量时间在 Linux 系统上查找命令的最简单、最有用的方法之一就是在 `$PATH` 变量中添加适当的目录。但是,添加到 `$PATH` 变量中的目录顺序非常重要。它们确定系统在目录中查找要运行命令的目录顺序--在找到第一个匹配项时停止。 例如,你可能希望将家目录放在第一个,这样,如果你创建的脚本与其他可执行文件有相同的名称,那么只要输入该脚本的名称,它便会运行。 -要将家目录添加到 $PATH 变量中,可以执行以下操作: +要将家目录添加到 `$PATH` 变量中,可以执行以下操作: ``` $ export PATH=~:$PATH ``` -**~** 字符代表家目录。 - -如果将脚本保存在 bin 目录中,下面的会有效: +`~` 字符代表家目录。 +如果将脚本保存在 `bin` 目录中,下面的会有效: ``` $ export PATH=~/bin:$PATH @@ -36,14 +38,12 @@ $ export PATH=~/bin:$PATH 然后,你可以运行位于家目录中的脚本,如下所示: -[][2] - ``` $ myscript Good morning, you just ran /home/myacct/bin/myscript ``` -**重要提示:**上面的命令_添加_搜索路径因为 $PATH (当前路径)包含了。它们不会覆盖它。你的搜索路径应该在 **.bashrc** 文件中配置,任何持久更改也需要在这里添加。 +**重要提示:**上面显示的命令会添加到你的搜索路径中,因为 `$PATH`(当前路径)被包含在内。它们不会覆盖它。你的搜索路径应该在你的 `.bashrc` 文件中配置,任何你打算永久化的更改也应该添加到那里。 ### 使用符号链接 @@ -53,17 +53,17 @@ Good morning, you just ran /home/myacct/bin/myscript ln -s /var/www/html www ``` -参数的顺序很重要。第一个(/var/www/html)是目标,第二个是你创建的链接的名称。如果你当前不在家目录中,那么以下命令将执行相同的操作: +参数的顺序很重要。第一个(`/var/www/html`)是目标,第二个是你创建的链接的名称。如果你当前不在家目录中,那么以下命令将执行相同的操作: ``` ln -s /var/www/html ~/www ``` -设置好之后,您可以使用 “cd www” 进入 **/var/www/html**。 +设置好之后,你可以使用 `cd www` 进入 `/var/www/html`。 ### 使用 shopt -**shopt** 命令还提供了一种让移动到其他目录更加容易的方法。当你使用 **shopt** 的 **autocd** 选项时,只需输入名称即可转到目录。例如: +`shopt` 命令还提供了一种让移动到其他目录更加容易的方法。当你使用 `shopt` 的 `autocd` 选项时,只需输入名称即可转到目录。例如: ``` $ shopt -s autocd @@ -79,23 +79,23 @@ $ pwd /home/myacct/bin ``` -在上面的第一组命令中,启用了 shopt 命令的 autocd 选项。输入 **www**,然后调用 “cd www” 命令。由于此符号链接是在上面的 **ln** 命令示例之一中创建的,因此将我们移至 **/var/www/html**。 **pwd -P** 命令显示实际位置。 +在上面的第一组命令中,启用了 `shopt` 命令的 `autocd` 选项。输入 `www`,就会调用 `cd www` 命令。由于此符号链接是在上面的 `ln` 命令示例之一中创建的,因此将我们移至 `/var/www/html`。 `pwd -P` 命令显示实际位置。 -在第二组中,键入 **~/bin** 会在用户家目录调用 **cd** 进入 **bin** 目录。 +在第二组中,键入 `~/bin` 会调用 `cd` 进入在用户家目录的 `bin` 目录。 -请注意,当你输入的是命令时,**autocd** 行为将_不会_生效,即使它也是目录的名称。 +请注意,当你输入的是命令时,`autocd` 行为将*不会*生效,即使它也是目录的名称。 -**shopt** 是 bash 内置,它有很多选项。这只是意味着你不必在要进入每个目录的名称之前输入 “cd”。 +`shopt` 是 bash 内置命令,它有很多选项。这只是意味着你不必在要进入每个目录的名称之前输入 `cd`。 -要查看 **shopt** 的其他选项,只需输入 “shopt”。 +要查看 `shopt` 的其他选项,只需输入 `shopt`。 -### 使用 $CDPATH +### 使用 \$CDPATH -进入特定目录的最有用技巧之一可能是将你希望能够轻松进入的路径添加到 **$CDPATH** 中。这将创建一个只需输入完整路径名的一部分即可进入的目录列表。 +可能进入特定目录的最有用技巧之一,就是将你希望能够轻松进入的路径添加到 `$CDPATH` 中。这将创建一个目录列表,只需输入完整路径名的一部分即可进入。 -一方面,这可能有点棘手。你的 **$CDPATH** 需要包含要移动到的目录的目录,而不是目录本身。 +一方面,这可能有点棘手。你的 `$CDPATH` 需要包含要移动到的目录的父目录,而不是目录本身。 -例如,假设你希望仅通过输入 “cd html” 就可以移至 **/var/www/html** 目录,并仅使用 “cd” 和简单目录名即可移至 /var/log 中的子目录。在这种情况下,此 **$CDPATH** 将起作用: +例如,假设你希望仅通过输入 `cd html` 就可以移至 `/var/www/html` 目录,并仅使用 `cd` 和简单目录名即可移至 `/var/log` 中的子目录。在这种情况下,此 `$CDPATH` 就可以起作用: ``` $ CDPATH=.:/var/log:/var/www @@ -110,9 +110,9 @@ $ cd html /var/www/html ``` -当你输入的不是完整路径时,**$CDPATH** 就会生效。它向下查看其目录列表,以查看指定的目录是否存在于其中一个目录中。找到匹配项后,它将带你到那里。 +当你输入的不是完整路径时,`$CDPATH` 就会生效。它向下查看其目录列表,以查看指定的目录是否存在于其中一个目录中。找到匹配项后,它将带你到那里。 -保持 “.” 在 **$CDPATH** 开头意味着你可以进入本地目录,而不必在 **$CDPATH** 中定义它们。 +在 `$CDPATH` 开头保持 `.` 意味着你可以进入本地目录,而不必在 `$CDPATH` 中定义它们。 ``` $ export CDPATH=".:$CDPATH" @@ -123,7 +123,6 @@ cd -- Videos 在 Linux 文件系统键切换并不难,但是如果你使用一些方便的技巧轻松地到达各个位置,那你可以节省一些大脑细胞。 -加入 [Facebook][3] 和 [LinkedIn][4] 上的 Network World 社区,评论热门主题。 -------------------------------------------------------------------------------- @@ -132,7 +131,7 @@ via: https://www.networkworld.com/article/3533421/tricks-for-getting-around-your 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a069d4c1d32f3b475c4a9a9d987f260b14a100ef Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 22 May 2020 11:42:17 +0800 Subject: [PATCH 0768/1809] PUB @geekpi https://linux.cn/article-12239-1.html --- ...200326 Tricks for getting around your Linux file system.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200326 Tricks for getting around your Linux file system.md (98%) diff --git a/translated/tech/20200326 Tricks for getting around your Linux file system.md b/published/20200326 Tricks for getting around your Linux file system.md similarity index 98% rename from translated/tech/20200326 Tricks for getting around your Linux file system.md rename to published/20200326 Tricks for getting around your Linux file system.md index 474b6886dd..d9d6cf1006 100644 --- a/translated/tech/20200326 Tricks for getting around your Linux file system.md +++ b/published/20200326 Tricks for getting around your Linux file system.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12239-1.html) [#]: subject: (Tricks for getting around your Linux file system) [#]: via: (https://www.networkworld.com/article/3533421/tricks-for-getting-around-your-linux-file-system.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From e3606e39f833a1e4e0b1a06631984c8873b681e0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 23 May 2020 00:39:22 +0800 Subject: [PATCH 0769/1809] TSL PART 2 --- ...Learn to change history with git rebase.md | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/translated/tech/20190510 Learn to change history with git rebase.md b/translated/tech/20190510 Learn to change history with git rebase.md index 03dbb641f9..3882711388 100644 --- a/translated/tech/20190510 Learn to change history with git rebase.md +++ b/translated/tech/20190510 Learn to change history with git rebase.md @@ -28,7 +28,7 @@ git commit --allow-empty -m"Initial commit" 如果你遇到麻烦,只需运行 `rm -rf /tmp/rebase-sandbox`,然后重新运行这些步骤重新开始。本指南的每一步都可以在一个新的沙箱上运行,所以没有必要重做每个任务。 -### 修正最新的提交 +### 修正最近的提交 让我们从简单的事情开始:修复你最近的提交。让我们将一个文件添加到我们的沙盒中,并犯个错误。 @@ -63,9 +63,9 @@ index 0000000..cd08755 +Hello world! ``` -### Fixing up older commits +### 修复更旧的提交 -Amending only works for the most recent commit. What happens if you need to correct an older commit? Let's start by setting up our sandbox accordingly: +`--amend` 只对最近的提交有效。如果你需要修正一个较旧的提交,会发生什么?让我们相应地从设置沙盒开始: ``` echo "Hello!" >greeting.txt @@ -77,14 +77,14 @@ git add farewell.txt git commit -m"Add farewell.txt" ``` -Looks like `greeting.txt` is missing "world". Let's write a commit normally which fixes that: +看起来 `greeting.txt ` 像是丢失了 `"world"`。让我们正常地写个提交来解决这个问题: ``` echo "Hello world!" >greeting.txt git commit -a -m"fixup greeting.txt" ``` -So now the files look correct, but our history could be better - let's use the new commit to "fixup" the last one. For this, we need to introduce a new tool: the interactive rebase. We're going to edit the last three commits this way, so we'll run `git rebase -i HEAD~3` (`-i` for interactive). This'll open your text editor with something like this: +现在文件看起来正确,但是我们的历史记录可以会更好一点 —— 让我们使用新的提交来“修复”(`fixup`)最后一个提交。为此,我们需要引入一个新工具:交互式变基。我们将以这种方式编辑最后三个提交,因此我们将运行`git rebase -i HEAD~3`(`-i` 代表交互式)。这样会打开文本编辑器,如下所示: ``` pick 8d3fc77 Add greeting.txt @@ -98,9 +98,9 @@ pick 0b9d0bb fixup greeting.txt # f, fixup = like "squash", but discard this commit's log message ``` -This is the rebase plan, and by editing this file you can instruct git on how to edit history. I've trimmed the summary to just the details relevant to this part of the rebase guide, but feel free to skim the full summary in your text editor. +这是变基计划,通过编辑此文件,你可以指导 Git 如何编辑历史记录。我已经将该摘要删节为仅与变基计划这一部分相关的细节,但是你可以在文本编辑器中浏览完整的摘要。 -When we save and close our editor, git is going to remove all of these commits from its history, then execute each line one at a time. By default, it's going to pick each commit, summoning it from the heap and adding it to the branch. If we don't edit this file at all, we'll end up right back where we started, picking every commit as-is. We're going to use one of my favorite features now: fixup. Edit the third line to change the operation from "pick" to "fixup" and move it to immediately after the commit we want to "fix up": +当我们保存并关闭编辑器时,Git 将从其历史记录中删除所有这些提交,然后一次执行每一行。默认情况下,它将选取(`pick`)每个提交,将其从堆中召唤出来并将其添加到分支中。如果我们对此文件根本没有做任何编辑,则将直接回到起点,按原样选取每个提交。现在,我们将使用我最喜欢的功能之一:修复(`fixup`)。编辑第三行,将操作从 `pick` 更改为 `fixup`,并将其立即移至我们要“修复”的提交之后: ``` pick 8d3fc77 Add greeting.txt @@ -108,9 +108,9 @@ fixup 0b9d0bb fixup greeting.txt pick 2a73a77 Add farewell.txt ``` -**Tip** : We can also abbreviate this with just "f" to speed things up next time. +**技巧**:我们也可以只用 `f` 来缩写它,以加快下次的速度。 -Save and quit your editor - git will run these commands. We can check the log to verify the result: +保存并退出编辑器,Git 将运行这些命令。我们可以检查日志以验证结果: ``` $ git log -2 --oneline @@ -118,9 +118,9 @@ fcff6ae (HEAD -> master) Add farewell.txt a479e94 Add greeting.txt ``` -### Squashing several commits into one +### 将多个提交压扁为一个 -As you work, you may find it useful to write lots of commits as you reach small milestones or fix bugs in previous commits. However, it may be useful to "squash" these commits together, to make a cleaner history before merging your work into master. For this, we'll use the "squash" operation. Let's start by writing a bunch of commits - just copy and paste this if you want to speed it up: +在工作时,当你达到较小的里程碑或修复以前的提交中的错误时,你可能会发现写很多提交很有用。但是,在将你的工作合并到 `master` 分支之前,将这些提交“压扁”(`squash`)在一起以使历史记录更清晰可能很有用。为此,我们将使用“压扁”(`squash `)操作。让我们从编写一堆提交开始,如果要加快速度,只需复制并粘贴这些: ``` git checkout -b squash @@ -131,7 +131,7 @@ for c in H e l l o , ' ' w o r l d; do done ``` -That's a lot of commits to make a file that says "Hello, world"! Let's start another interactive rebase to squash them together. Note that we checked out a branch to try this on, first. Because of that, we can quickly rebase all of the commits since we branched by using `git rebase -i master`. The result: +要做出一个写着 “Hello,world”的文件,要做很多事情!让我们开始另一个交互式变基,将它们压扁在一起。请注意,我们首先签出了一个分支来进行尝试。因此,因为我们使用 `git rebase -i master` 进行的分支,我们可以快速变基所有提交。结果: ``` pick 1e85199 Add 'H' to squash.txt @@ -154,9 +154,9 @@ pick 6b608ae Add 'd' to squash.txt # s, squash = use commit, but meld into previous commit ``` -**Tip** : your local master branch evolves independently of the remote master branch, and git stores the remote branch as `origin/master`. Combined with this trick, `git rebase -i origin/master` is often a very convenient way to rebase all of the commits which haven't been merged upstream yet! +**技巧**:你的本地 `master` 分支独立于远程 `master` 分支而发展,并且 Git 将远程分支存储为 `origin/master`。结合这种技巧,`git rebase -i origin/master` 通常是一种非常方便的方法,可以变基所有尚未合并到上游的提交! -We're going to squash all of these changes into the first commit. To do this, change every "pick" operation to "squash", except for the first line, like so: +我们将把所有这些更改压扁到第一个提交中。为此,将第一行除外的每个“选取”(`pick`)操作都更改为“压扁”(`squash `),如下所示: ``` pick 1e85199 Add 'H' to squash.txt @@ -173,7 +173,7 @@ squash a513fd1 Add 'l' to squash.txt squash 6b608ae Add 'd' to squash.txt ``` -When you save and close your editor, git will think about this for a moment, then open your editor again to revise the final commit message. You'll see something like this: +保存并关闭编辑器时,Git 会考虑片刻,然后再次打开编辑器以修改最终的提交消息。你会看到以下内容: ``` # This is a combination of 12 commits. @@ -242,11 +242,11 @@ Add 'd' to squash.txt # ``` -This defaults to a combination of all of the commit messages which were squashed, but leaving it like this is almost always not what you want. The old commit messages may be useful for reference when writing the new one, though. +默认情况下,这是所有要压扁的提交的消息的组合,但是像这样将其保留肯定不是你想要的。不过,旧的提交消息在编写新的提交消息时可能很有用,所以放在这里以供参考。 -**Tip** : the "fixup" command you learned about in the previous section can be used for this purpose, too - but it discards the messages of the squashed commits. +**提示**:你在上一节中了解的“修复”(`fixup`)命令也可以用于此目的,但它会丢弃压缩的提交消息。 -Let's delete everything and replace it with a better commit message, like this: +让我们删除所有内容,并用更好的提交消息替换它,如下所示: ``` Add squash.txt with contents "Hello, world" @@ -268,7 +268,7 @@ Add squash.txt with contents "Hello, world" # ``` -Save and quit your editor, then examine your git log - success! +保存并退出编辑器,然后检查你的 Git 日志,成功! ``` commit c785f476c7dff76f21ce2cad7c51cf2af00a44b6 (HEAD -> squash) @@ -278,7 +278,7 @@ Date: Sun Apr 28 14:21:56 2019 -0400 Add squash.txt with contents "Hello, world" ``` -Before we move on, let's pull our changes into the master branch and get rid of this scratch one. We can use `git rebase` like we use `git merge`, but it avoids making a merge commit: +在继续之前,让我们将所做的更改拉入 `master` 分支中,并摆脱掉这一草稿。我们可以像使用 `git merge` 一样使用 `git rebase`,但是它避免了创建合并提交: ``` git checkout master @@ -286,11 +286,11 @@ git rebase squash git branch -D squash ``` -We generally prefer to avoid using git merge unless we're actually merging unrelated histories. If you have two divergent branches, a git merge is useful to have a record of when they were... merged. In the course of your normal work, rebase is often more appropriate. +除非我们实际上正在合并无关的历史记录,否则我们通常希望避免使用 `git merge`。如果你有两个不同的分支,则 `git merge` 对于记录合并它们的时间非常有用。在正常工作过程中,变基通常更为合适。 -### Splitting one commit into several +### 将一个提交拆分为多个 -Sometimes the opposite problem happens - one commit is just too big. Let's look into splitting it up. This time, let's write some actual code. Start with a simple C program2 (you can still copy+paste this snippet into your shell to do this quickly): +有时会发生相反的问题:一个提交太大了。让我们来看一看拆分它们。这次,让我们写一些实际的代码。从一个简单的 C 程序 `program2 ` 开始(你仍然可以将此代码段复制并粘贴到你的 shell 中以快速执行此操作): ``` cat <main.c @@ -300,14 +300,14 @@ int main(int argc, char *argv[]) { EOF ``` -We'll commit this first. +首先提交它: ``` git add main.c git commit -m"Add C program skeleton" ``` -Next, let's extend the program a bit: +然后把这个程序扩展一些: ``` cat <main.c @@ -328,13 +328,13 @@ int main(int argc, char *argv[]) { EOF ``` -After we commit this, we'll be ready to learn how to split it up. +提交之后,我们就可以准备学习如何将其拆分: ``` git commit -a -m"Flesh out C program" ``` -The first step is to start an interactive rebase. Let's rebase both commits with `git rebase -i HEAD~2`, giving us this rebase plan: +第一步是启动交互式变基。让我们用 `git rebase -i HEAD~2` 来变基这两个提交,变基计划如下: ``` pick 237b246 Add C program skeleton @@ -347,7 +347,7 @@ pick b3f188b Flesh out C program # e, edit = use commit, but stop for amending ``` -Change the second commit's command from "pick" to "edit", then save and close your editor. Git will think about this for a second, then present you with this: +将第二个提交的命令从 `pick` 更改为 `edit`,然后保存并关闭编辑器。Git 会考虑一秒钟,然后向你建议: ``` Stopped at b3f188b... Flesh out C program @@ -360,7 +360,7 @@ Once you are satisfied with your changes, run git rebase --continue ``` -We could follow these instructions to add new changes to the commit, but instead let's do a "soft reset"3 by running `git reset HEAD^`. If you run `git status` after this, you'll see that it un-commits the latest commit and adds its changes to the working tree: +我们可以按照以下说明为提交添加新的更改,但我们可以通过运行 `git reset HEAD^` 来进行“软重置” [^3]。如果在此之后运行 `git status`,你将看到它取消提交最新的提交,并将其更改添加到工作树中: ``` Last commands done (2 commands done): @@ -379,7 +379,7 @@ Changes not staged for commit: no changes added to commit (use "git add" and/or "git commit -a") ``` -To split this up, we're going to do an interactive commit. This allows us to selectively commit only specific changes from the working tree. Run `git commit -p` to start this process, and you'll be presented with the following prompt: +为了对此进行拆分,我们将进行交互式提交。这使我们能够选择性地仅提交工作树中的特定更改。运行 `git commit -p` 开始这个过程,将出现以下提示: ``` diff --git a/main.c b/main.c @@ -404,7 +404,7 @@ index b1d9c2c..3463610 100644 Stage this hunk [y,n,q,a,d,s,e,?]? ``` -Git has presented you with just one "hunk" (i.e. a single change) to consider committing. This one is too big, though - let's use the "s" command to "split" up the hunk into smaller parts. +Git 仅向你提供了一个“大块”(即单个更改)以进行提交。不过,这太大了,让我们使用 `s` 命令将这个“大块”拆分成较小的部分。 ``` Split into 2 hunks. @@ -421,9 +421,9 @@ Split into 2 hunks. Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]? ``` -**Tip** : If you're curious about the other options, press "?" to summarize them. +**提示**:如果你对其他选项感到好奇,请按 `?` 汇总显示。 -This hunk looks better - a single, self-contained change. Let's hit "y" to answer the question (and stage that "hunk"), then "q" to "quit" the interactive session and proceed with the commit. Your editor will pop up to ask you to enter a suitable commit message. +这个大块看起来更好:单一、独立的更改。让我们按 `y` 来回答问题(并暂存那个“大块”),然后按 `q` 以“退出”交互式会话并继续进行提交。会弹出编辑器,要求输入合适的提交消息。 ``` Add get_name function to C program @@ -446,14 +446,14 @@ Add get_name function to C program # ``` -Save and close your editor, then we'll make the second commit. We could do another interactive commit, but since we just want to include the rest of the changes in this commit we'll just do this: +保存并关闭编辑器,然后我们进行第二次提交。我们可以执行另一个交互式提交,但是由于我们只想在此提交中包括其余更改,因此我们将执行以下操作: ``` git commit -a -m"Prompt user for their name" git rebase --continue ``` -That last command tells git that we're done editing this commit, and to continue to the next rebase command. That's it! Run `git log` to see the fruits of your labor: +最后一条命令告诉 Git 我们已经完成了此提交的编辑,并继续执行下一个变基命令。就是这样!运行 `git log` 来查看你的劳动成果: ``` $ git log -3 --oneline From d75d7b60d39651e1ff8860a7e7067c31535a0106 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 23 May 2020 10:24:29 +0800 Subject: [PATCH 0770/1809] TSL FIN --- ...Learn to change history with git rebase.md | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/translated/tech/20190510 Learn to change history with git rebase.md b/translated/tech/20190510 Learn to change history with git rebase.md index 3882711388..300afe1f7c 100644 --- a/translated/tech/20190510 Learn to change history with git rebase.md +++ b/translated/tech/20190510 Learn to change history with git rebase.md @@ -290,7 +290,7 @@ git branch -D squash ### 将一个提交拆分为多个 -有时会发生相反的问题:一个提交太大了。让我们来看一看拆分它们。这次,让我们写一些实际的代码。从一个简单的 C 程序 `program2 ` 开始(你仍然可以将此代码段复制并粘贴到你的 shell 中以快速执行此操作): +有时会发生相反的问题:一个提交太大了。让我们来看一看拆分它们。这次,让我们写一些实际的代码。从一个简单的 C 程序 [^2] 开始(你仍然可以将此代码段复制并粘贴到你的 shell 中以快速执行此操作): ``` cat <main.c @@ -462,9 +462,9 @@ fe19cc3 (HEAD -> master) Prompt user for their name 237b246 Add C program skeleton ``` -### Reordering commits +### 重新排序提交 -This one is pretty easy. Let's start by setting up our sandbox: +这很简单。 让我们从设置沙箱开始: ``` echo "Goodbye now!" >farewell.txt @@ -480,7 +480,7 @@ git add inquiry.txt git commit -m"Add inquiry.txt" ``` -The git log should now look like this: +Git 日志现在应如下所示: ``` f03baa5 (HEAD -> master) Add inquiry.txt @@ -488,7 +488,7 @@ a4cebf7 Add greeting.txt 90bb015 Add farewell.txt ``` -Clearly, this is all out of order. Let's do an interactive rebase of the past 3 commits to resolve this. Run `git rebase -i HEAD~3` and this rebase plan will appear: +显然,这都是乱序。让我们对过去的 3 个提交进行交互式变基来解决此问题。运行 `git rebase -i HEAD~3`,这个变基规划将出现: ``` pick 90bb015 Add farewell.txt @@ -503,7 +503,7 @@ pick f03baa5 Add inquiry.txt # These lines can be re-ordered; they are executed from top to bottom. ``` -The fix is now straightforward: just reorder these lines in the order you wish for the commits to appear. Should look something like this: +现在,解决方法很简单:只需按照你希望提交出现的顺序重新排列这些行。应该看起来像这样: ``` pick a4cebf7 Add greeting.txt @@ -511,35 +511,35 @@ pick f03baa5 Add inquiry.txt pick 90bb015 Add farewell.txt ``` -Save and close your editor and git will do the rest for you. Note that it's possible to end up with conflicts when you do this in practice - click here for help resolving conflicts. +保存并关闭你的编辑器,而 Git 将为你完成其余工作。请注意,在实践中这样做可能会导致冲突,参看下面章节以获取解决冲突的帮助。 ### git pull --rebase -If you've been writing some commits on a branch which has been updated upstream, normally `git pull` will create a merge commit. In this respect, `git pull`'s behavior by default is equivalent to: +如果你一直在上游更新的分支上编写一些提交,通常 `git pull` 将创建一个合并提交。在这方面,`git pull` 的默认行为等同于: ``` git fetch origin git merge origin/master ``` -There's another option, which is often more useful and leads to a much cleaner history: `git pull --rebase`. Unlike the merge approach, this is equivalent to the following: +还有另一种选择,它通常更有用,并且导致更清晰的历史记录:`git pull --rebase`。与合并方式不同,这基本上 [^4] 等效于以下内容: ``` git fetch origin git rebase origin/master ``` -The merge approach is simpler and easier to understand, but the rebase approach is almost always what you want to do if you understand how to use git rebase. If you like, you can set it as the default behavior like so: +合并方式更简单易懂,但是如果你了解如何使用 `git rebase`,那么变基方式几乎可以做到你想要做的任何事情。如果愿意,可以将其设置为默认行为,如下所示: ``` git config --global pull.rebase true ``` -When you do this, technically you're applying the procedure we discuss in the next section... so let's explain what it means to do that deliberately, too. +当你执行此操作时,从技术上讲,你将应用我们在下一节中讨论的过程...因此,让我们也解释一下故意执行此操作的含义。 -### Using git rebase to... rebase +### 使用 git rebase 来变基 -Ironically, the feature of git rebase that I use the least is the one it's named for: rebasing branches. Say you have the following branches: +具有讽刺意味的是,我最少使用的 Git 变基功能是它以之命名的功能:变基分支。假设你有以下分支: ``` o--o--o--o--> master @@ -547,14 +547,14 @@ o--o--o--o--> master \--o--> feature-2 ``` -It turns out feature-2 doesn't depend on any of the changes in feature-1, so you can just base it off of master. The fix is thus: +事实证明,`feature-2` 不依赖于 `feature-` 的任何更改,因此你可以将其作为基础。因此,解决方法是: ``` git checkout feature-2 git rebase master ``` -The non-interactive rebase does the default operation for all implicated commits ("pick")4, which simply rolls your history back to the last common anscestor and replays the commits from both branches. Your history now looks like this: +非交互式变基对所有牵连的提交(`pick`)[^5] 都执行默认操作,它简单地将你的历史回滚到最后一个共同的祖先,并从两个分支中重放提交。你的历史记录现在看起来像这样: ``` o--o--o--o--> master @@ -562,20 +562,23 @@ o--o--o--o--> master \--o--o--> feature-1 ``` -### Resolving conflicts +### 解决冲突 -The details on resolving merge conflicts are beyond the scope of this guide - keep your eye out for another guide for this in the future. Assuming you're familiar with resolving conflicts in general, here are the specifics that apply to rebasing. +解决合并冲突的详细信息不在本指南的范围内,将来请你注意另一篇指南。假设你熟悉通常的解决冲突的方法,那么这里是专门适用于变基的部分。 -The details on resolving merge conflicts are beyond the scope of this guide - keep your eye out for another guide for this in the future. Assuming you're familiar with resolving conflicts in general, here are the specifics that apply to rebasing. +有时,在进行变基时会遇到合并冲突,你可以像处理其他任何合并冲突一样处理该冲突。Git 将在受影响的文件中设置冲突标记,`git status` 将显示你需要解决的问题,并且你可以使用 `git add` 或 `git rm` 将文件标记为已解决。但是,在 `git rebase` 的上下文中,你应该注意两个选项。 -Sometimes you'll get a merge conflict when doing a rebase, which you can handle just like any other merge conflict. Git will set up the conflict markers in the affected files, `git status` will show you what you need to resolve, and you can mark files as resolved with `git add` or `git rm`. However, in the context of a git rebase, there are two options you should be aware of. +首先是如何完成冲突解决。解决由于 `git merge` 引起的冲突时,你将不会像使用 `git commit` 那样,适当的变基命令是 `git rebase --continue`。但是,还有一个可用的选项:`git rebase --skip`。 这将跳过你正在处理的提交,它不会包含在变基中。这在执行非交互性变基时最常见,这时 Git 不意识到它从“其他”分支中提取的提交是与“我们”分支上冲突的提交的更新版本。 -The first is how you complete the conflict resolution. Rather than `git commit` like you'll use when addressing conflicts that arise from `git merge`, the appropriate command for rebasing is `git rebase --continue`. However, there's another option available to you: `git rebase --skip`. This will skip the commit you're working on, and it won't be included in the rebase. This is most common when doing a non-interactive rebase, when git doesn't realize that a commit it's pulled from the "other" branch is an updated version of the commit that it conflicts with on "our" branch. +### 帮帮我! 我把它弄坏了! -### Help! I broke it! - -No doubt about it - rebasing can be hard sometimes. If you've made a mistake and in so doing lost commits which you needed, then `git reflog` is here to save the day. Running this command will show you every operation which changed a ref, or reference - that is, branches and tags. Each line shows you what the old reference pointed to, and you can `git cherry-pick`, `git checkout`, `git show`, or use any other operation on git commits once thought lost. +毫无疑问,变基有时会很难。如果你犯了一个错误,并因此而丢失了所需的提交,那么可以使用 `git reflog` 来节省下一天的时间。运行此命令将向你显示更改一个引用(即分支和标记)的每个操作。每行显示你旧的引用所指的内容,你可对你认为丢失的 Git 提交执行 `git cherry-pick`、`git checkout`、`git show` 或任何其他操作。 +[^1]: 我们添加了一个空的初始提交以简化本教程的其余部分,因为要对版本库的初始提交进行变基需要特殊的命令(即` git rebase --root`)。 +[^2]: 如果要编译此程序,请运行 `cc -o main main.c`,然后运行 `./main` 查看结果。 +[^3]: 实际上,这是“混合重置”。“软重置”(使用 `git reset --soft` 完成)将暂存更改,因此你无需再次 `git add` 添加它们,并且可以一次性提交所有更改。这不是我们想要的。我们希望选择性地暂存部分更改,以拆分提交。 +[^4]: 实际上,这取决于上游分支本身是否已变基或删除/压扁了某些提交。`git pull --rebase` 尝试通过在 `git rebase` 和 `git merge-base` 中使用 “fork-point” 机制来从这种情况中恢复,以避免变基非本地提交。 +[^5]: 实际上,这取决于 Git 的版本。从 2.26.0 版开始,默认的非交互行为以前与交互行为稍有不同,这种方式通常并不重要。 -------------------------------------------------------------------------------- @@ -583,7 +586,7 @@ via: https://git-rebase.io/ 作者:[git-rebase][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -592,3 +595,4 @@ via: https://git-rebase.io/ [b]: https://github.com/lujun9972 [1]: https://git-scm.com/ [2]: https://git-scm.com/docs/git-rebase + From a24b22cb80f4d3725bc03342368a44bc50abdb74 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 23 May 2020 11:20:58 +0800 Subject: [PATCH 0771/1809] PRF @geekpi --- ...un multiple versions of Python on a Mac.md | 68 ++++++++----------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/translated/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md b/translated/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md index def57f9a21..00e1d6a039 100644 --- a/translated/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md +++ b/translated/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to use pyenv to run multiple versions of Python on a Mac) @@ -9,14 +9,16 @@ 如何在 Mac 上使用 pyenv 运行多个版本的 Python ====== -如果你需要运行 macOS 上没有安装的 Python 版本,请试试 pyenv。 -![Searching for code][1] + +> 如果你在 macOS 上运行的项目需要没有安装的 Python 版本,请试试 pyenv。 + +![](https://img.linux.net.cn/data/attachment/album/202005/23/112041pawp65alw6tmea6l.jpg) 即使对于有经验的开发人员,管理本地 Python 开发环境仍然是一个挑战。尽管有详细的[软件包管理策略][2],但仍需要采取另外的步骤来确保你在需要时运行所需的 Python 版本。 ### 为什么 Python 版本重要? -起初这是一个奇怪的概念,但是编程语言会像其他任何软件一样发生变化。它们有 bug,修复和更新,就像你喜欢的 [API][3] 和任何其他软件一样。同样,不同的发行版由称为[语义版本][4]的三位数标识。 +起初这是一个奇怪的概念,但是编程语言会像其他任何软件一样发生变化。它们有错误、修复和更新,就像你喜欢的 [API][3] 和任何其他软件一样。同样,不同的发行版由称为[语义化版本][4]的三位数标识。 > 😭😭😭 [pic.twitter.com/yt1Z2439W8][5] > @@ -24,8 +26,7 @@ 多年来,Python 2 是该语言的常用主要版本。在 2020 年 1 月,Python 2 [到达最后寿命][7],此后,Python 的核心维护者将仅支持 Python 3。Python 3 稳步发展,并定期发布新更新。对我来说定期获取这些更新很重要。 -最近,我尝试在依赖于 Python 3.5.9 的 macOS 上运行一个项目,但该版本尚未安装在系统上。我认为 Python 包管理器 **pip** 可以安装它,但事实并非如此: - +最近,我试图在 macOS 上运行一个依赖于 Python 3.5.9 的项目,而我的系统上并没有安装这个版本。我认为 Python 包管理器 `pip` 可以安装它,但事实并非如此: ``` $ pip install python3.5.9 @@ -34,20 +35,19 @@ Collecting python3.5.9 ERROR: No matching distribution found for python3.5.9 ``` -或者,我可以从官方 Python 网站下载该版本,但是除了现有的 Python 版本外,如何在 Mac 上运行它?每次运行指定 Python 解释器版本(例如 python3.7 或 python3.5)似乎很容易出错。一定会有更好的方法。 +或者,我也可以从官方 Python 网站下载该版本,但我如何在我的 Mac 上与现有的 Python 版本一起运行?每次运行时指定 Python 解释器版本(例如 python3.7 或 python3.5)似乎很容易出错。一定会有更好的方法。 -_(说明:我知道这对经验丰富的 Python 开发人员没有意义,但对当时的我来说是有意义的。我很乐意谈论为什么我仍然认为应该如此。)_ +(说明:我知道这对经验丰富的 Python 开发人员没有意义,但对当时的我来说是有意义的。我很乐意谈一谈为什么我仍然认为它应该这样做。) ### 安装和设置 pyenv -值得庆幸的是,**pyenv** 可以解决这一系列复杂性。首先,我需要安装 pyenv。我可以[从源码][8]自己克隆并编译它,但是我更喜欢通过 Homebrew 包管理器来管理软件包: +值得庆幸的是,`pyenv` 可以绕开这一系列复杂的问题。首先,我需要安装 `pyenv`。我可以[从源码][8]克隆并编译它,但是我更喜欢通过 Homebrew 包管理器来管理软件包: ``` -`$ brew install pyenv` +$ brew install pyenv ``` -为了通过 pyenv 使用 Python 版本,必须了解 shell 的 PATH 变量。PATH 通过命令名称确定 shell 在哪里搜索文件。你必须确保 shell 程序能够找到 pyenv 运行的 Python 版本,而不是默认安装的版本(通常称为_系统版本_)。如果不更改路径,那么结果如下: - +为了通过 `pyenv` 使用 Python 版本,必须了解 shell 的 `PATH` 变量。`PATH` 决定了 shell 通过命令的名称来搜索文件的位置。你必须确保 shell 程序能够找到通过 `pyenv` 运行的 Python 版本,而不是默认安装的版本(通常称为*系统版本*)。如果不更改路径,那么结果如下: ``` $ which python @@ -56,61 +56,56 @@ $ which python 这是 Python 的系统版本。 -要正确设置 pyenv,可以在 Bash 或 zsh 中运行以下命令: +要正确设置 `pyenv`,可以在 Bash 或 zsh 中运行以下命令: ``` -`$ PATH=$(pyenv root)/shims:$PATH` +$ PATH=$(pyenv root)/shims:$PATH ``` -现在,如果你检查 Python 的版本,你会看到它是 pyenv 管理的版本: - +现在,如果你检查 Python 的版本,你会看到它是 `pyenv` 管理的版本: ``` $ which python /Users/my_username/.pyenv/shims/python ``` -该 export 语句(PATH=)仅会对该 shell 实例进行更改,为了永久更改,你需要将它添加到 dotfile 中。由于 zsh 是 macOS 的默认 shell,因此我将重点介绍它。将相同的语法添加到 **~/.zshrc** 文件中: - +该导出语句(`PATH=`)仅会对该 shell 实例进行更改,为了使更改永久生效,你需要将它添加到点文件当中。由于 zsh 是 macOS 的默认 shell,因此我将重点介绍它。将相同的语法添加到 `~/.zshrc` 文件中: ``` -`$ echo 'PATH=$(pyenv root)/shims:$PATH' >> ~/.zshrc` +$ echo 'PATH=$(pyenv root)/shims:$PATH' >> ~/.zshrc ``` -现在,每次我们在 zsh 中运行命令时,它将使用 pyenv 版本的 Python。请注意,我在 **echo** 中使用了单引号,因此它不会评估和扩展命令。 +现在,每次我们在 zsh 中运行命令时,它将使用 `pyenv` 版本的 Python。请注意,我在 `echo` 中使用了单引号,因此它不会评估和扩展命令。 -.zshrc 文件仅管理 zsh 实例,因此请确保检查你的 shell 程序并编辑关联的 dotfile。如果需要再次检查默认 shell 程序,可以运行 **echo $SHELL**。如果是 zsh,请使用上面的命令。如果你使用 Bash,请将 **~/.zshrc** 更改为 **~/.bashrc**。如果您想了解更多信息,可以在pyenv的自述文件中深入研究[path setting] [9]。 +`.zshrc` 文件仅管理 zsh 实例,因此请确保检查你的 shell 程序并编辑关联的点文件。如果需要再次检查默认 shell 程序,可以运行 `echo $SHELL`。如果是 zsh,请使用上面的命令。如果你使用 Bash,请将 `~/.zshrc` 更改为 `~/.bashrc`。如果你想了解更多信息,可以在 `pyenv` 的 `README` 中深入研究[路径设置][9]。 ### 使用 pyenv 管理 Python 版本 -现在 pyenv 已经可用,我们可以看到它只有系统 Python 可用: +现在 `pyenv` 已经可用,我们可以看到它只有系统 Python 可用: ``` $ pyenv versions system ``` -如上所述,你绝对不想使用此版本([阅读更多有关信息][10])。现在 pyenv 已正确设置,我希望它有我经常使用的几个不同版本的 Python。 - -有一种方法可以通过运行 **pyenv install --list** 来查看 pyenv 可以访问的所有不同仓库中的所有 Python 版本。这是一个很长的列表,将来可能会有所帮助。目前,我决定在 [Python 下载页面][11]找到的每个最新的“点版本”(3.5.x 或 3.6.x,其中 x 是最新的)。因此,我将安装 3.5.9 和 3.8.0: +如上所述,你绝对不想使用此版本([阅读更多有关信息][10])。现在 `pyenv` 已正确设置,我希望它能有我经常使用的几个不同版本的 Python。 +有一种方法可以通过运行 `pyenv install --list` 来查看 pyenv 可以访问的所有仓库中的所有 Python 版本。这是一个很长的列表,将来回顾的时候可能会有所帮助。目前,我决定在 [Python 下载页面][11]找到的每个最新的“点版本”(3.5.x 或 3.6.x,其中 x 是最新的)。因此,我将安装 3.5.9 和 3.8.0: ``` $ pyenv install 3.5.9 $ pyenv install 3.8.0 ``` -这将需要一段时间,因此休息一会(或阅读上面的链接之一)。有趣的是,输出遍历了该版本的 Python 的下载和构建。例如,输出显示文件直接来自 [Python.org][12]。 +这将需要一段时间,因此休息一会(或阅读上面的链接之一)。有趣的是,输出中显示了该版本的 Python 的下载和构建。例如,输出显示文件直接来自 [Python.org][12]。 安装完成后,你可以设置默认值。我喜欢最新的,因此将全局默认 Python 版本设置为最新版本: - ``` -`$ pyenv global 3.8.0` +$ pyenv global 3.8.0 ``` -该版本立即在我的 shell 中设置完成。要确认: - +该版本立即在我的 shell 中设置完成。确认一下: ``` $ python -V @@ -119,15 +114,13 @@ Python 3.8.0 我要运行的项目仅适于 Python 3.5,因此我将在本地设置该版本并确认: - ``` $ pyenv local 3.5.9 $ python -V Python 3.5.9 ``` -因为我在 pyenv 中使用了 **local** 选项,所以它向当前目录添加了一个文件来跟踪该信息。 - +因为我在 `pyenv` 中使用了 `local` 选项,所以它向当前目录添加了一个文件来跟踪该信息。 ``` $ cat .python-version @@ -136,7 +129,6 @@ $ cat .python-version 现在,我终于可以为想要的项目设置虚拟环境,并确保运行正确版本的 Python。 - ``` $ python -m venv venv $ source ./venv/bin/activate @@ -148,9 +140,9 @@ $ source ./venv/bin/activate ### 总结 -默认情况下,运行多个 Python 版本可能是一个挑战。我发现 pyenv 可以确保在我需要时可以有我需要的 Python 版本。 +默认情况下,运行多个 Python 版本可能是一个挑战。我发现 `pyenv` 可以确保在我需要时可以有我需要的 Python 版本。 -你还有其他初学者或中级 Python 问题吗? 请发表评论,我们将在以后的文章中考虑它们。 +你还有其他初学者或中级 Python 问题吗? 请发表评论,我们将在以后的文章中考虑介绍它们。 -------------------------------------------------------------------------------- @@ -159,7 +151,7 @@ via: https://opensource.com/article/20/4/pyenv 作者:[Matthew Broberg][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -177,4 +169,4 @@ via: https://opensource.com/article/20/4/pyenv [10]: https://opensource.com/article/19/5/python-3-default-mac [11]: https://www.python.org/downloads/ [12]: http://python.org -[13]: https://opensource.com/article/19/6/python-virtual-environments-mac +[13]: https://linux.cn/article-11086-1.html From 8d72aeeee5b5d0603acd46a586fb49356acd5afc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 23 May 2020 11:21:39 +0800 Subject: [PATCH 0772/1809] PUB @geekpi https://linux.cn/article-12241-1.html --- ...o use pyenv to run multiple versions of Python on a Mac.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200407 How to use pyenv to run multiple versions of Python on a Mac.md (99%) diff --git a/translated/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md b/published/20200407 How to use pyenv to run multiple versions of Python on a Mac.md similarity index 99% rename from translated/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md rename to published/20200407 How to use pyenv to run multiple versions of Python on a Mac.md index 00e1d6a039..3bcf991e02 100644 --- a/translated/tech/20200407 How to use pyenv to run multiple versions of Python on a Mac.md +++ b/published/20200407 How to use pyenv to run multiple versions of Python on a Mac.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12241-1.html) [#]: subject: (How to use pyenv to run multiple versions of Python on a Mac) [#]: via: (https://opensource.com/article/20/4/pyenv) [#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg) From 0649b38785676e7d93a9f1852737ba4efd28eebe Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 23 May 2020 13:06:35 +0800 Subject: [PATCH 0773/1809] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @qfzy1223 翻译后应该自己审阅一下。 --- ...ew- Lightweight, Minimalistic, Polished.md | 92 +++++++++---------- 1 file changed, 44 insertions(+), 48 deletions(-) diff --git a/translated/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md b/translated/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md index a303a3853f..2a85242dd2 100644 --- a/translated/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md +++ b/translated/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md @@ -1,127 +1,123 @@ [#]: collector: (lujun9972) [#]: translator: (qfzy1233) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Lubuntu 20.04 Review: Lightweight, Minimalistic, Polished) [#]: via: (https://itsfoss.com/lubuntu-20-04-review/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) -Lubuntu 20.04 简述: 轻量, 简约, 文雅 +Lubuntu 20.04 点评:轻量、简约、文雅 ====== -_**Lubuntu20.04 LTS 与之前的 LTS 版本有很大的不同。它的旨在给你一个更完善的体验,而不仅仅是关注旧的电脑。阅读更多关于Lubuntu20.04的内容。**_ +> Lubuntu 20.04 LTS 与之前的 LTS 版本有很大的不同。它旨在给你一个更完善的体验,而不仅仅是关注旧电脑。请阅读更多关于 Lubuntu 20.04 的内容。 -### Lubuntu 20.04 一览: 第一个基于 LXQt 的长期支持版 +### Lubuntu 20.04 点评:第一个基于 LXQt 的长期支持版 -我在 Lubuntu20.04 发行前几天就已经开始使用它了。我通常使用 Arch 阵营中 Manjaro 和 Cinnamon desktop,所以使用 Lubuntu 对我来说是一个愉快的改变。 +我在 Lubuntu 20.04 发行前几天就已经开始使用它了。我通常使用 Arch 阵营中 Manjaro 和 Cinnamon 桌面,所以使用 Lubuntu 对我来说是一个愉快的改变。 以下是我在使用 Lubuntu 20.04.时的一些感受和注记。 -#### 再见LXDE,你好LXQt! +#### 再见 LXDE,你好 LXQt! -很长一段时间以来,[Lubuntu][1]都依赖于[LXDE][2]来提供轻量级的Linux体验。现在它使用LXQt桌面环境。 +长期以来,[Lubuntu][1] 都依靠 [LXDE][2] 来提供轻量级的 Linux 体验。但现在,它使用的是 LXQt 桌面环境。 -[LXDE][3]是基于 GTK (GNOME使用的库),更具体地说是基于2020年的 GTK+ 2。LXDE 开发人员 Hong Jen Yee 不满意 GTK+ 3,决定将整个桌面移植到Qt (KDE使用的库)。LXDE、it的Qt端口和[Razor-qt][4]项目合并形成[LXQt][5]。所以现在,LXDE和LXQt作为单独的项目共存。 +[LXDE][3] 是基于 GTK(GNOME 所使用的库),更具体地说是基于 2020 年的 GTK+ 2。由于对 GTK+ 3 不满意,LXDE 开发人员 Hong Jen Yee 决定将整个桌面移植到 Qt(KDE 所使用的库)。LXDE 的 Qt 移植版本和 [Razor-qt][4] 项目合并形成 [LXQt][5]。所以现在,LXDE 和 LXQt 作为单独的项目而共存。 -由于 LXDE 开发者本身关注于 LXQt ,所以 Lubuntu 死磕桌面环境是没有意义的,因为上一次稳定发行版已经是三年多以前的事情了。 +既然 LXDE 开发者本身专注于 LXQt,那么 Lubuntu 坚持使用三年多前上一次稳定发布版的桌面环境 LXDE 是没有意义的。 -Lubuntu 18.04是[LXDE][3]的最后一个版本。幸运的是,这是一个长期支持版本。Lubuntu团队将提供支持直到2021年。 +因此,Lubuntu 18.04 是使用 [LXDE][3] 的最后一个版本。幸运的是,这是一个长期支持版本。Lubuntu 团队将提供支持直到 2021 年。 ![][6] #### 不仅适于老机器 -由于“老机器”的定义在2020年发生了变化,Lubuntu 18.04是最后一个32位版本。现在,即使是一台10年前的老机器也至少有2g的内存和一个双核64位处理器。 +随着在 2020 年“老机器”的定义发生了变化,Lubuntu 18.04 成为了最后一个 32 位版本。现在,即使是一台 10 年前的老机器也至少有 2G 的内存和一个双核 64 位处理器。 -因此,Lubuntu 团队将不再提供最低的系统需求,也不再主要关注旧的硬件。尽管 LXQt 仍然是一个轻量级的、经典的、完善的、功能丰富的桌面环境。 +因此,Lubuntu 团队将不再设置最低的系统需求,也不再主要关注旧硬件。尽管 LXQt 仍然是一个轻量级的、经典而不失精致的、功能丰富的桌面环境。 -Lubuntu 的第一个 LXQt 发行版是18.10,在Lubuntu20.04 LTS 发行版之前,开发人员经历了三个标准发行版来完善 LXQt 桌面,这是一个很好的开发策略。 +在 Lubuntu 20.04 LTS 发布之前,Lubuntu 的第一个 LXQt 发行版是 18.10,开发人员经历了三个标准发行版来完善 LXQt 桌面,这是一个很好的开发策略。 -#### 与以往不同的是 Lubuntu 20.04 使用 Calamares 安装器 +#### 不用常规的 Ubiquity,Lubuntu 20.04 使用的是 Calamares 安装程序 -![Lubuntu 20.04 Calamares 安装器][8] +![Lubuntu 20.04 Calamares 安装程序][8] -在新版本中全新的[Calamares][9]安装器,取代了其他[Ubuntu官方版本][10]使用的普遍安装程序。 +在新版本中使用了全新的 [Calamares][9] 安装程序,取代了其它 [Ubuntu 官方版本][10]使用的 Ubiquity 安装程序。 -整个安装过程在大约10分钟内完成,比之前Lubuntu的版本稍微快一些。 +整个安装过程在大约能在 10 分钟内完成,比之前 Lubuntu 的版本稍微快一些。 -由于镜像文件附带了预先安装的基本应用程序,你也可以很快地完全配置您的系统。 +由于镜像文件附带了预先安装的基本应用程序,所以你可以很快就可以完成系统的完全配置。 #### 不要直接从 Lubuntu 18.04 升级到 Lubuntu 20.04 -通常,你可以[将Ubuntu从一个LTS版本升级到另一个LTS版本][11]。但是 Lubuntu 团队建议不要从 Lubuntu18.04升级到20.04。他们建议重新安装,这才是正确的。 +通常,你可以[将 Ubuntu 从一个 LTS 版本升级到另一个 LTS 版本][11]。但是 Lubuntu 团队建议不要从 Lubuntu 18.04 升级到 20.04。他们建议重新安装,这才是正确的。 -Lubuntu 18.04使用LXDE桌面,20.04使用LXQt。由于桌面环境的巨大变化,从18.04升级到20.04将导致系统崩溃。 +Lubuntu 18.04 使用 LXDE 桌面,20.04 使用 LXQt。由于桌面环境的巨大变化,从 18.04 升级到 20.04 将导致系统崩溃。 -#### **更多的KDE和Qt应用程序** +#### 更多的 KDE 和 Qt 应用程序 ![][12] -下面是在这个新版本中默认可用的一些应用程序,正如我们所看到的,并非所有应用程序都是轻量级的,而且大多数应用程序都是基于qt的。 +下面是在这个新版本中默认提供的一些应用程序,正如我们所看到的,并非所有应用程序都是轻量级的,而且大多数应用程序都是基于 Qt 的。 甚至使用的软件中心也是 KDE 的 Discover,而不是 Ubuntu 的 GNOME 软件中心。 - * Ark – 压缩文件管理器 + * Ark – 归档文件管理器 * Bluedevil – 蓝牙连接管理 - * Discover Software Center – 包管理系统 + * Discover 软件中心 – 包管理系统 * FeatherPad – 文本编辑器 * FireFox – 浏览器 * K3b – CD/DVD 刻录器 * Kcalc – 计算器 - * KDE partition manager – 分区管理工具 - * LibreOffice – 办公套件 (Qt 接口版本) - * LXimage-Qt – 图片查看及截图制作 + * KDE 分区管理器 – 分区管理工具 + * LibreOffice – 办公套件(Qt 界面版本) + * LXimage-Qt – 图片查看器及截图制作 * Muon – 包管理器 - - * Noblenote – 笔记工具 * PCManFM-Qt – 文件管理器 * Qlipper – 剪贴板管理工具 * qPDFview – PDF 阅读器 * PulseAudio – 音频控制器 - * Qtransmission – BT下载工具 (Qt 接口版本) - * Quassel – 实时聊天客户端 + * Qtransmission – BT 下载工具(Qt 界面版本) + * Quassel – IRC 客户端 * ScreenGrab – 截屏制作工具 * Skanlite – 扫描工具 - * Startup Disk Creator – USB 启动盘制作工具 + * 启动盘创建工具 – USB 启动盘制作工具 * Trojita – 邮件客户端 * VLC – 媒体播放器 - * [MPV video player][13] - - + * [MPV 视频播放器][13] #### 测试 Lubuntu 20.04 LTS -LXQt 版Lubuntu的启动时间不到一分钟,不过是从SSD启动的。 +LXQt 版 Lubuntu 的启动时间不到一分钟,虽然是从 SSD 启动的。 -LXQt 目前需要的内存比基于 Gtk+ v2 的LXDE稍微多一点,但是另一种 Gtk+ v3 工具包也需要更多的内存。 +LXQt 目前需要的内存比基于 Gtk+ 2 的 LXDE 稍微多一点,但是另一种 Gtk+ 3 工具包也需要更多的内存。 -在重新启动之后,系统以非常低的内存占用情况运行,大约只有340 MB(按照现代标准),比LXDE多100 MB。 +在重新启动之后,系统以非常低的内存占用情况运行,大约只有 340 MB(按照现代标准),比 LXDE 多 100 MB。 ![htop 在 Lubuntu 20.04 上运行][14] -LXQt 不仅适用于使用旧硬件的用户,也适用于那些希望在新机器上获得简单而经典体验的用户。 +LXQt 不仅适用于硬件较旧的用户,也适用于那些希望在新机器上获得简约经典体验的用户。 -桌面布局看起来类似于 KDE 的 Plasma 桌面,你不这样认为吗? +桌面布局看起来类似于 KDE 的 Plasma 桌面,你觉得呢? ![Lubuntu 20.04 桌面环境][15] -在左下角有一个应用程序菜单,一个用于固定和活动应用程序的任务栏,右下角有一个系统托盘。 +在左下角有一个应用程序菜单,一个用于显示固定和活动的应用程序的任务栏,右下角有一个系统托盘。 -Lubuntu 的 LXQt 版本可以很容易的定制,所有的东西都在菜单的首选项下,大部分的关键项目都在 LXQt 设置下。 +Lubuntu 的 LXQt 版本可以很容易的定制,所有的东西都在菜单的首选项下,大部分的关键项目都在 LXQt “设置”中。 -值得一提的是, LXQt 在默认情况下使用流行的[ Openbox 窗口管理器][16]。 +值得一提的是,LXQt 在默认情况下使用流行的 [Openbox 窗口管理器][16]。 -与前三个发行版一样,20.04 LTS 附带了一个默认的黑暗主题 Lubuntu ,但是如果不适合你的口味,可以快速、轻松地更改它。 +与前三个发行版一样,20.04 LTS 附带了一个默认的黑暗主题 Lubuntu Arc,但是如果不适合你的口味,可以快速更换,也很方便。 -就日常使用而言,Lubuntu20.04 已经向我证明了它是完全没有问题的,因为它是 Ubuntu 的一个版本。 +就日常使用而言,事实证明,Lubuntu 20.04 向我证明,其实每一个 Ubuntu 的分支版本都完全没有问题。 #### 结论 -Lubuntu团队已经成功地过渡到一个现代的、依然轻量级的、最小的桌面环境。LXDE看起来被遗弃了,迁移到一个活跃的项目也是一件好事。 +Lubuntu 团队已经成功地过渡到一个现代的、依然轻量级的、极简的桌面环境。LXDE 看起来被遗弃了,迁移到一个活跃的项目也是一件好事。 -我希望Lubuntu 20.04能够像我一样让你充满热情,如果是这样,请在下面的评论中告诉我。请继续关注! +我希望 Lubuntu 20.04 能够让你和我一样热爱,如果是这样,请在下面的评论中告诉我。请继续关注! -------------------------------------------------------------------------------- @@ -130,7 +126,7 @@ via: https://itsfoss.com/lubuntu-20-04-review/ 作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] 译者:[qfzy1233](https://github.com/qfzy1233) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8fcc773133dc9ae5679f8209431789b1800e5586 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 23 May 2020 13:37:54 +0800 Subject: [PATCH 0774/1809] PUB @qfzy1223 https://linux.cn/article-12242-1.html --- ...ntu 20.04 Review- Lightweight, Minimalistic, Polished.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md b/translated/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md index 2a85242dd2..3b04dc37b8 100644 --- a/translated/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md +++ b/translated/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (qfzy1233) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12242-1.html) [#]: subject: (Lubuntu 20.04 Review: Lightweight, Minimalistic, Polished) [#]: via: (https://itsfoss.com/lubuntu-20-04-review/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) @@ -18,7 +18,7 @@ Lubuntu 20.04 点评:轻量、简约、文雅 以下是我在使用 Lubuntu 20.04.时的一些感受和注记。 -#### 再见 LXDE,你好 LXQt! +#### 再见 LXDE,你好 LXQt! 长期以来,[Lubuntu][1] 都依靠 [LXDE][2] 来提供轻量级的 Linux 体验。但现在,它使用的是 LXQt 桌面环境。 From 140327cab51c528e00a3f01cc20bfbb964092d34 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 23 May 2020 13:39:03 +0800 Subject: [PATCH 0775/1809] PUB @qfzy1223 https://linux.cn/article-12242-1.html --- ...8 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md (100%) diff --git a/translated/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md b/published/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md similarity index 100% rename from translated/tech/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md rename to published/20200428 Lubuntu 20.04 Review- Lightweight, Minimalistic, Polished.md From b876ff2b4eadcaa74f1247e0aa016eb40ea05f94 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Sat, 23 May 2020 19:11:29 +0800 Subject: [PATCH 0776/1809] APL --- .../tech/20200222 How to install TT-RSS on a Raspberry Pi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200222 How to install TT-RSS on a Raspberry Pi.md b/sources/tech/20200222 How to install TT-RSS on a Raspberry Pi.md index ec5a177314..beaff7bebd 100644 --- a/sources/tech/20200222 How to install TT-RSS on a Raspberry Pi.md +++ b/sources/tech/20200222 How to install TT-RSS on a Raspberry Pi.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f3a1f2c476122a72a5897c8a954de022fb059d4e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 23 May 2020 20:15:13 +0800 Subject: [PATCH 0777/1809] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lxbwolf subtree 这个词我遵照 GitHub 采用的译法,译做了 “子树”。 --- ...t projects with submodules and subtrees.md | 127 ++++++++---------- 1 file changed, 57 insertions(+), 70 deletions(-) diff --git a/translated/tech/20200506 Managing Git projects with submodules and subtrees.md b/translated/tech/20200506 Managing Git projects with submodules and subtrees.md index a67f328d0c..90a8bd29c8 100644 --- a/translated/tech/20200506 Managing Git projects with submodules and subtrees.md +++ b/translated/tech/20200506 Managing Git projects with submodules and subtrees.md @@ -1,84 +1,80 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Managing Git projects with submodules and subtrees) [#]: via: (https://opensource.com/article/20/5/git-submodules-subtrees) [#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) -使用子模块和子仓库管理 Git 项目 +使用子模块和子树来管理 Git 项目 ====== -使用子模块和子仓库来帮助你管理多个仓库中共有的子项目。 -![Digital creative of a browser on the internet][1] -如果你参与了开源项目的开发,那么你可能会用 Git 来管理你的源码。你可能遇到过有很多依赖和/或子项目的项目。你怎么管理它们? +> 使用子模块和子树来帮助你管理多个存储库中共有的子项目。 -对于一个开源组织,社区*和*产品想要实现单一来源文档和依赖管理比较棘手。文档和项目往往会碎片化和变得冗余,这致使它们很难维护。 +![](https://img.linux.net.cn/data/attachment/album/202005/23/201323myyhob22eg2y2jqt.jpg) + +如果你参与了开源项目的开发,那么你很可能已经用了 Git 来管理你的源码。你可能遇到过有很多依赖和/或子项目的项目。你是如何管理它们的? + +对于一个开源组织,要实现社区**和**产品的单一来源文档和依赖管理比较棘手。文档和项目往往会碎片化和变得冗余,这致使它们很难维护。 ### 必要性 -假设你想要在一个仓库中把一个项目作为子项目来用。传统的方法是把该项目复制到父仓库中。但是,如果你想要在多个父项目中用同一个子项目呢?(如果)把子项目复制到所有父项目中,当有更新时,你不得不在每个父项目中都做修改,这是不太可行的。(因为)这会导致父项目中的冗余和数据不一致,也会使更新和维护子项目变得很困难。 +假设你想把单个项目作为一个存储库内的子项目,传统的方法是把该项目复制到父存储库中,但是,如果你想要在多个父项目中使用同一个子项目呢?如果把子项目复制到所有父项目中,当有更新时,你都要在每个父项目中做修改,这是不太可行的。这会导致父项目中的冗余和数据不一致,使更新和维护子项目变得很困难。 -### Git 子模块和子仓库 +### Git 子模块和子树 -如果你可以用一条命令把一个项目放进另一个项目中,会怎样呢?如果你随时可以把一个项目作为子项目添加到任意数目的项目中,并可以同步更新修改呢?Git 提供了这类问题的解决方案:Git 子模块和 Git 子仓库。创建这些工具的目的是以更加模块化的水平来支持共用代码的开发工作流,(创建者)意在消除 Git 仓库源码管理source-code management与它下面的子仓库间的障碍。 +如果你可以用一条命令把一个项目放进另一个项目中,会怎样呢?如果你随时可以把一个项目作为子项目添加到任意数目的项目中,并可以同步更新修改呢?Git 提供了这类问题的解决方案:Git 子模块submodule和 Git 子树subtree。创建这些工具的目的是以更加模块化的水平来支持共用代码的开发工作流,旨在 Git 存储库源码管理source-code management(SCM)与它下面的子树之间架起一座桥梁。 ![Cherry tree growing on a mulberry tree][2] -生长在桑树上的樱桃树 +*生长在桑树上的樱桃树* -下面是本文要详细介绍的概念的一个真实应用场景。如果你已经很熟悉 tree,这个模型看起来是下面这样: +下面是本文要详细介绍的概念的一个真实应用场景。如果你已经很熟悉树形结构,这个模型看起来是下面这样: ![Tree with subtrees][3] -CC BY-SA opensource.com - ### Git 子模块是什么? -Git 在它默认的包中提供了子模块,子模块可以把 Git 仓库嵌入到其他仓库中。确切地说,Git 子模块是指向子仓库中的某次提交。下面是我 [Docs-test][4] GitHub 仓库中的 Git 子模块: +Git 在它默认的包中提供了子模块,子模块可以把 Git 存储库嵌入到其他存储库中。确切地说,Git 子模块指向子树中的某次提交。下面是我 [Docs-test][4] GitHub 存储库中的 Git 子模块的样子: ![Git submodules screenshot][5] -**[文件夹@提交 Id][6]** 格式表明这个仓库是一个子模块,你可以直接点击文件夹进入该子仓库。名为 **.gitmodules** 的配置文件包含所有子模块仓库的详细信息。我的仓库的 **.gitmodules** 文件如下: +[文件夹@提交 Id][6] 格式表明这个存储库是一个子模块,你可以直接点击文件夹进入该子树。名为 `.gitmodules` 的配置文件包含所有子模块存储库的详细信息。我的存储库的 `.gitmodules` 文件如下: ![Screenshot of .gitmodules file][7] -你可以用下面的命令在你的仓库中使用 Git 子模块: +你可以用下面的命令在你的存储库中使用 Git 子模块: -#### 克隆一个仓库并加载子模块 - -克隆一个含有子模块的仓库: +#### 克隆一个存储库并加载子模块 +克隆一个含有子模块的存储库: ``` -`$ git clone --recursive ` +$ git clone --recursive ``` -如果你之前已经克隆了仓库,现在想加载它的子模块: - +如果你之前已经克隆了存储库,现在想加载它的子模块: ``` -`$ git submodule update --init` +$ git submodule update --init ``` 如果有嵌套的子模块: - ``` -`$ git submodule update --init --recursive` +$ git submodule update --init --recursive ``` #### 下载子模块 -串行地连续下载多个子模块是很枯燥的工作,所以 **clone** 和 **submodule update** 会支持 **\--jobs** 或 **-j** 参数: +串行地连续下载多个子模块是很枯燥的工作,所以 `clone` 和 `submodule update` 会支持 `--jobs` (或 `-j`)参数: 例如,想一次下载 8 个子模块,使用: - ``` $ git submodule update --init --recursive -j 8 -$ git clone --recursive --jobs 8 <URL to Git repo> +$ git clone --recursive --jobs 8 ``` #### 拉取子模块 @@ -87,103 +83,94 @@ $ git clone --recursive --jobs 8 <URL to Git repo> 拉取子模块的所有修改: - ``` -`$ git submodule update --remote` +$ git submodule update --remote ``` -#### 使用 submodule 创建仓库: - -向一个父仓库添加子仓库: +#### 使用子模块创建存储库: +向一个父存储库添加子树: ``` -`$ git submodule add ` +$ git submodule add ``` 初始化一个已存在的 Git 子模块: - ``` -`$ git submodule init` +$ git submodule init ``` -你也可以通过为 **submodule update** 命令添加 **\--update** 参数在子模块中创建分支和追踪提交: - +你也可以通过为 `submodule update` 命令添加 `--update` 参数在子模块中创建分支和追踪提交: ``` -`$ git submodule update --remote` +$ git submodule update --remote ``` -#### 更新子模块提交 - -上面提到过,一个子模块就是一个指向子仓库中某次提交的链接。如果你想更新子模块的提交,不要担心。你不需要显式地指定最新的提交。你只需要使用通用的 **submodule update** 命令: +#### 更新子模块的提交 +上面提到过,一个子模块就是一个指向子树中某次提交的链接。如果你想更新子模块的提交,不要担心。你不需要显式地指定最新的提交。你只需要使用通用的 `submodule update` 命令: ``` -`$ git submodule update` +$ git submodule update ``` -就像你平时创建父仓库和把父仓库推送到 GitHub 那样添加和提交就可以了。 +就像你平时创建父存储库和把父存储库推送到 GitHub 那样添加和提交就可以了。 -#### 从一个父仓库中删除一个子模块 - -仅仅手动删除一个子项目文件夹不会从父项目中移除这个子项目。想要删除名为 **childmodule** 的子模块,使用: +#### 从一个父存储库中删除一个子模块 +仅仅手动删除一个子项目文件夹不会从父项目中移除这个子项目。想要删除名为 `childmodule` 的子模块,使用: ``` -`$ git rm -f childmodule` +$ git rm -f childmodule ``` 虽然 Git 子模块看起来很容易上手,但是对于初学者来说,有一定的使用门槛。 -### Git 子仓库是什么? +### Git 子树是什么? -Git 子仓库,是在 Git 1.7.11 引入的,让你可以把任何仓库的副本作为子目录嵌入另一个仓库中。它是 Git 项目可以注入和管理项目依赖的几种方法之一。它在常规的提交中保存了外部依赖信息。Git 子仓库提供了整洁的集成点,因此很容易复原它们。 +Git 子树 subtree,是在 Git 1.7.11 引入的,让你可以把任何存储库的副本作为子目录嵌入另一个存储库中。它是 Git 项目可以注入和管理项目依赖的几种方法之一。它在常规的提交中保存了外部依赖信息。Git 子树提供了整洁的集成点,因此很容易复原它们。 -如果你参考 [GitHub 提供的子仓库教程][8] 来使用子仓库,那么无论你什么时候添加子仓库,在本地都不会看到 **.gittrees** 配置文件。这让我们很难分辨哪个是子仓库,因为它们看起来很像普通的文件夹,但是它们却是子仓库的副本。默认的 Git 包中不提供带 **.gittrees** 配置文件的 Git 子仓库版本,因此如果你想要带 **.gittrees** 配置文件的 git-subtree,必须从 Git 源码仓库的 [**/contrib/subtree** 文件夹][9] 下载 git-subtree。 +如果你参考 [GitHub 提供的子树教程][8]来使用子树,那么无论你什么时候添加子树,在本地都不会看到 `.gittrees` 配置文件。这让我们很难分辨哪个是子树,因为它们看起来很像普通的文件夹,但是它们却是子树的副本。默认的 Git 包中不提供带 `.gittrees` 配置文件的 Git 子树版本,因此如果你想要带 `.gittrees` 配置文件的 git-subtree 命令,必须从 Git 源码存储库的 [/contrib/subtree 文件夹][9] 下载 git-subtree。 -你可以像克隆其他常规的仓库那样克隆任何含有子仓库的仓库,但由于在父仓库中有整个子仓库的副本,因此克隆过程可能会持续很长时间。 +你可以像克隆其他常规的存储库那样克隆任何含有子树的存储库,但由于在父存储库中有整个子树的副本,因此克隆过程可能会持续很长时间。 -你可以用下面的命令在你的仓库中使用 Git 子仓库。 +你可以用下面的命令在你的存储库中使用 Git 子树。 -#### 向父仓库中添加一个子仓库 - -想要向父仓库中添加一个子仓库,首先你需要执行 **remote add**,之后执行 **subtree add** 命令: +#### 向父存储库中添加一个子树 +想要向父存储库中添加一个子树,首先你需要执行 `remote add`,之后执行 `subtree add` 命令: ``` -$ git remote add remote-name <URL to Git repo> -$ git subtree add --prefix=folder/ remote-name <URL to Git repo> subtree-branchname +$ git remote add remote-name +$ git subtree add --prefix=folder/ remote-name subtree-branchname ``` -上面的命令会把整个子项目的提交历史合并到父仓库。 - -#### 向子仓库推送修改以及从子仓库拉取修改 +上面的命令会把整个子项目的提交历史合并到父存储库。 +#### 向子树推送修改以及从子树拉取修改 ``` -`$ git subtree push-all` +$ git subtree push-all ``` 或者 - ``` -`$ git subtree pull-all` +$ git subtree pull-all ``` ### 你应该使用哪个? 任何工具都有优缺点。下面是一些可能会帮助你决定哪种最适合你的特性: - * Git 子模块的仓库占用空间更小,因为它们只是指向子项目的某次提交的链接,而 Git 子仓库保存了整个子项目及其提交历史。 - * Git 子模块需要在服务器中可访问,但子仓库是去中心化的。 - * Git 子模块大量用于基于组件的开发,而 Git 子仓库多用于基于系统的开发。 + * Git 子模块的存储库占用空间更小,因为它们只是指向子项目的某次提交的链接,而 Git 子树保存了整个子项目及其提交历史。 + * Git 子模块需要在服务器中可访问,但子树是去中心化的。 + * Git 子模块大量用于基于组件的开发,而 Git 子树多用于基于系统的开发。 -Git 子仓库并不是 Git 子模块的直接可替代项。有明确的说明来指导我们该使用哪种。如果有一个归属于你的外部仓库,使用场景是向它回推代码,那么就使用 Git 子模块,因为推送代码更容易。如果你有第三方代码,且不会向它推送代码,那么使用 Git 子仓库,因为拉取代码更容易。 +Git 子树并不是 Git 子模块的直接可替代项。有明确的说明来指导我们该使用哪种。如果有一个归属于你的外部存储库,使用场景是向它回推代码,那么就使用 Git 子模块,因为推送代码更容易。如果你有第三方代码,且不会向它推送代码,那么使用 Git 子树,因为拉取代码更容易。 -自己尝试使用 Git 子仓库和子模块,然后在评论中留下你的使用感想。 +自己尝试使用 Git 子树和子模块,然后在评论中留下你的使用感想。 -------------------------------------------------------------------------------- @@ -192,7 +179,7 @@ via: https://opensource.com/article/20/5/git-submodules-subtrees 作者:[Manaswini Das][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9945ab96d6fe13a65d52f686e6fd45e8f7a28168 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 23 May 2020 20:15:44 +0800 Subject: [PATCH 0778/1809] PUB @lxbwolf https://linux.cn/article-12244-1.html --- ...0506 Managing Git projects with submodules and subtrees.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200506 Managing Git projects with submodules and subtrees.md (99%) diff --git a/translated/tech/20200506 Managing Git projects with submodules and subtrees.md b/published/20200506 Managing Git projects with submodules and subtrees.md similarity index 99% rename from translated/tech/20200506 Managing Git projects with submodules and subtrees.md rename to published/20200506 Managing Git projects with submodules and subtrees.md index 90a8bd29c8..d52aef42a6 100644 --- a/translated/tech/20200506 Managing Git projects with submodules and subtrees.md +++ b/published/20200506 Managing Git projects with submodules and subtrees.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12244-1.html) [#]: subject: (Managing Git projects with submodules and subtrees) [#]: via: (https://opensource.com/article/20/5/git-submodules-subtrees) [#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) From 52553ba6a3098e2bbf7d766f39fa6198adf32aea Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Sun, 24 May 2020 01:07:04 +0800 Subject: [PATCH 0779/1809] TSL --- ...How to install TT-RSS on a Raspberry Pi.md | 245 ------------------ ...How to install TT-RSS on a Raspberry Pi.md | 244 +++++++++++++++++ 2 files changed, 244 insertions(+), 245 deletions(-) delete mode 100644 sources/tech/20200222 How to install TT-RSS on a Raspberry Pi.md create mode 100644 translated/tech/20200222 How to install TT-RSS on a Raspberry Pi.md diff --git a/sources/tech/20200222 How to install TT-RSS on a Raspberry Pi.md b/sources/tech/20200222 How to install TT-RSS on a Raspberry Pi.md deleted file mode 100644 index beaff7bebd..0000000000 --- a/sources/tech/20200222 How to install TT-RSS on a Raspberry Pi.md +++ /dev/null @@ -1,245 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to install TT-RSS on a Raspberry Pi) -[#]: via: (https://opensource.com/article/20/2/ttrss-raspberry-pi) -[#]: author: (Patrick H. Mullins https://opensource.com/users/pmullins) - -How to install TT-RSS on a Raspberry Pi -====== -Read your news feeds while keeping your privacy intact with Tiny Tiny -RSS. -![Raspberries with pi symbol overlay][1] - -[Tiny Tiny RSS][2] (TT-RSS) is a free and open source web-based news feed (RSS/Atom) reader and aggregator. It's ideally suited to those who are privacy-focused and still rely on RSS for their daily news. Tiny Tiny RSS is self-hosted software, so you have 100% control of the server, your data, and your overall privacy. It also supports a wide range of plugins, add-ons, and themes, Want a dark mode interface? No problem. Want to filter your incoming news based on keywords? TT-RSS has you covered there, as well. - -![Tiny Tiny RSS screenshot][3] - -Now that you know what TT-RSS is and why you may want to use it, I'll explain everything you need to know about installing it on a Raspberry Pi or a Debian 10 server. - -### Install and configure TT-RSS - -To install TT-RSS on a Raspberry Pi, you must also install and configure the latest version of PHP (7.3 as of this writing), PostgreSQL for the database backend, the Nginx web server, Git, and finally, TT-RSS. - -#### 1\. Install PHP 7 - -Installing PHP 7 is, by far, the most involved part of this process. Thankfully, it's not as difficult as it might appear. Start by installing the following support packages: - - -``` -`$ sudo apt install -y ca-certificates apt-transport-https` -``` - -Now, add the repository PGP key: - - -``` -`$ wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -` -``` - -Next, add the PHP repository to your apt sources: - - -``` -`$ echo "deb https://packages.sury.org/php/ buster main" | sudo tee /etc/apt/sources.list.d/php.list` -``` - -Then update your repository index: - - -``` -`$ sudo apt update` -``` - -Finally, install PHP 7.3 (or the latest version) and some common components: - - -``` -`$ sudo apt install -y php7.3 php7.3-cli php7.3-fpm php7.3-opcache php7.3-curl php7.3-mbstring php7.3-pgsql php7.3-zip php7.3-xml php7.3-gd php7.3-intl` -``` - -The command above assumes you're using PostgreSQL as your database backend and installs **php7.3-pgsql**. If you'd rather use MySQL or MariaDB, you can easily change this to **php7.3-mysql**. - -Next, verify that PHP is installed and running on your Raspberry Pi: - - -``` -`$ php -v` -``` - -Now it's time to install and configure the webserver. - -#### 2\. Install Nginx - -Nginx can be installed via apt with: - - -``` -`$ sudo apt install -y nginx` -``` - -Modify the default Nginx virtual host configuration so that the webserver will recognize PHP files and know what to do with them: - - -``` -`$ sudo nano /etc/nginx/sites-available/default` -``` - -You can safely delete everything in the original file and replace it with: - - -``` -server { -        listen 80 default_server; -        listen [::]:80 default_server; - -        root /var/www/html; -        index index.html index.htm index.php; -        server_name _; - -        location / { -                try_files $uri $uri/ =404; -        } - -        location ~ \\.php$ { -          include snippets/fastcgi-php.conf; -          fastcgi_pass unix:/run/php/php7.3-fpm.sock; -        } - -} -``` - -Use **Ctrl+O** to save your new configuration file and then **Ctrl+X** to exit Nano. You can test your new configuration with: - - -``` -`$ nginx -t` -``` - -If there are no errors, restart the Nginx service: - - -``` -`$ systemctl restart nginx` -``` - -#### 3\. Install PostgreSQL - -Next up is installing the database server. Installing PostgreSQL on the Raspberry Pi is super easy: - - -``` -`$ sudo apt install -y postgresql postgresql-client postgis` -``` - -Check to see if the database server was successfully installed by entering: - - -``` -`$ psql --version` -``` - -#### 4\. Create the Tiny Tiny RSS database - -Before you can do anything else, you need to create a database that the TT-RSS software will use to store data. First, log into the PostgreSQL server: - - -``` -`sudo -u postgres psql` -``` - -Next, create a new user and assign a password: - - -``` -`CREATE USER username WITH PASSWORD 'your_password' VALID UNTIL 'infinity';` -``` - -Then create the database that will be used by TT-RSS: - - -``` -`CREATE DATABASE tinyrss;` -``` - -Finally, grant full permissions to the new user: - - -``` -`GRANT ALL PRIVILEGES ON DATABASE tinyrss to user_name;` -``` - -That's it for the database. You can exit the **psql** app by typing **\q**. - -#### 5\. Install Git - -Installing TT-RSS requires Git, so install Git with: - - -``` -`$ sudo apt install git -y` -``` - -Now, change directory to wherever Nginx serves web pages: - - -``` -`$ cd /var/www/html` -``` - -Then download the latest source for TT-RSS: - - -``` -`$ git clone https://git.tt-rss.org/fox/tt-rss.git tt-rss` -``` - -Note that this process creates a new **tt-rss** folder. - -#### 6\. Install and configure Tiny Tiny RSS - -It's finally time to install and configure your new TT-RSS server. First, verify that you can open **** in a web browser. If you get a **403 Forbidden** error, your permissions are not set properly on the **/var/www/html** folder. The following will usually fix this issue: - - -``` -`$ chmod 755 /var/www/html/ -v` -``` - -If everything goes as planned, you'll see the TT-RSS Installer page, and it will ask you for some database information. Just tell it the database username and password that you created earlier; the database name; **localhost** for the hostname; and **5432** for the port. - -Click **Test Configuration** to continue. If all went well, you should see a red button labeled **Initialize Database.** Click on it to begin the installation. Once finished, you'll have a configuration file that you can copy and save as **config.php** in the TT-RSS directory. - -After finishing with the installer, open your TT-RSS installation at **** and log in with the default credentials (username: **admin**, password: **password**). The system will recommend that you change the admin password as soon as you log in. I highly recommend that you follow that advice and change it as soon as possible. - -### Set up TT-RSS - -If all went well, you can start using TT-RSS right away. It's recommended that you create a new non-admin user, log in as the new user, and start importing your feeds, subscribing, and configuring it as you see fit. - -Finally, and this is super important, don't forget to read the [Updating Feeds][4] section on TT-RSS's wiki. It describes how to create a simple systemd service that will update your feeds. If you skip this step, your RSS feeds will not update automatically. - -### Conclusion - -Whew! That was a lot of work, but you did it! You now have your very own RSS aggregation server. Want to learn more about TT-RSS? I recommend checking out the official [FAQ][5], the [support][6] forum, and the detailed [installation][7] notes. Feel free to comment below if you have any questions or issues. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/ttrss-raspberry-pi - -作者:[Patrick H. Mullins][a] -选题:[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/pmullins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-raspberrypi_0.png?itok=Kczz87J2 (Raspberries with pi symbol overlay) -[2]: https://tt-rss.org/ -[3]: https://opensource.com/sites/default/files/uploads/tt-rss.jpeg (Tiny Tiny RSS screenshot) -[4]: https://tt-rss.org/wiki/UpdatingFeeds -[5]: https://tt-rss.org/wiki/FAQ -[6]: https://community.tt-rss.org/c/tiny-tiny-rss/support -[7]: https://tt-rss.org/wiki/InstallationNotes diff --git a/translated/tech/20200222 How to install TT-RSS on a Raspberry Pi.md b/translated/tech/20200222 How to install TT-RSS on a Raspberry Pi.md new file mode 100644 index 0000000000..16c49f98b5 --- /dev/null +++ b/translated/tech/20200222 How to install TT-RSS on a Raspberry Pi.md @@ -0,0 +1,244 @@ +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to install TT-RSS on a Raspberry Pi) +[#]: via: (https://opensource.com/article/20/2/ttrss-raspberry-pi) +[#]: author: (Patrick H. Mullins https://opensource.com/users/pmullins) + +怎样在树莓派上安装 TT-RSS +====== +使用 Tiny Tiny RSS 来保护你阅读新闻 feed 时的隐私。 +![Raspberries with pi symbol overlay][1] + +[Tiny Tiny RSS][2](TT-RSS)是一个免费开源的基于 web 的新闻 feed(RSS/Atom)阅读器和聚合工具。它非常适合那些对隐私很在意又依赖他们的日常消息的 RSS 的人。TT-RSS 是自运维的软件,因此你对服务器、你的数据以及你全部的隐私都有 100% 的掌控。它还支持大量的插件、扩展和主题。你喜欢深色的界面?没问题。你希望基于关键词过滤发来的消息?TT-RSS 也能让你得偿所愿。 + +![Tiny Tiny RSS screenshot][3] + +现在你知道 TT-RSS 是什么了,那么为什么你可能会想用它呢?我会讲述要把它安装到树莓派或 Debian 10 服务器上你需要了解的所有的东西。 + +### 安装和配置 TT-RSS + +要把 TT-RSS 安装到树莓派上,你还需要安装和配置最新版本的 PHP(本文撰写时 PHP 最新版本是 7.3)、后端数据库 PostgreSQL、Nginx web 服务器、Git,最后才是 TT-RSS。 + +#### 1\. 安装 PHP 7 + +安装 PHP 7 是整个过程中最重要的部分。幸运的是,它并不像看起来那样困难。从安装下面的支持包开始: + + +``` +`$ sudo apt install -y ca-certificates apt-transport-https` +``` + +现在,添加存储库 PGP key + + +``` +`$ wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -` +``` + +下一步,把 PHP 库添加到你的 apt 源: + + +``` +`$ echo "deb https://packages.sury.org/php/ buster main" | sudo tee /etc/apt/sources.list.d/php.list` +``` + +然后更新你的存储库索引: + + +``` +`$ sudo apt update` +``` + +最后,安装 PHP 7.3(或最新版本)和一些通用组件: + + +``` +`$ sudo apt install -y php7.3 php7.3-cli php7.3-fpm php7.3-opcache php7.3-curl php7.3-mbstring php7.3-pgsql php7.3-zip php7.3-xml php7.3-gd php7.3-intl` +``` + +上面的命令默认你使用的后端数据库是 PostgreSQL,会安装 **php7.3-pgsql**。如果你想用 MySQL 或 MariaDB,你可以把命令参数改为 **php7.3-mysql**。 + +下一步,确认 PHP 已安装并在你的树莓派上运行着: + + +``` +`$ php -v` +``` + +现在是时候安装和配置 webserver 了。 + +#### 2\. 安装 Nginx + +可以用下面的命令安装 Nginx: + + +``` +`$ sudo apt install -y nginx` +``` + +修改默认的 Nginx 虚拟主机配置,这样 webserver 才能识别 PHP 文件以及知道如何处理它们。 + + +``` +`$ sudo nano /etc/nginx/sites-available/default` +``` + +你可以安全地删除原文件中的所有内容,用下面的内容替换: + + +``` +server { +        listen 80 default_server; +        listen [::]:80 default_server; + +        root /var/www/html; +        index index.html index.htm index.php; +        server_name _; + +        location / { +                try_files $uri $uri/ =404; +        } + +        location ~ \\.php$ { +          include snippets/fastcgi-php.conf; +          fastcgi_pass unix:/run/php/php7.3-fpm.sock; +        } + +} +``` + +按 **Ctrl+O** 保存修改后的配置文件,然后按 **Ctrl+X** 退出 Nano。你可以用下面的命令测试你的新配置文件: + + +``` +`$ nginx -t` +``` + +如果没有报错,重启 Nginx 服务: + + +``` +`$ systemctl restart nginx` +``` + +#### 3\. 安装 PostgreSQL + +接下来是安装数据库服务器。在树莓派上安装 PostgreSQL 超级简单: + + +``` +`$ sudo apt install -y postgresql postgresql-client postgis` +``` + +输入下面的命令看一下数据库服务器安装是否成功: + + +``` +`$ psql --version` +``` + +#### 4\. 创建 Tiny Tiny RSS 数据库 + +在做其他事之前,你需要创建一个数数据库,用来给 TT-RSS 软件保存数据。首先,登录 PostgreSQL 服务器: + + +``` +`sudo -u postgres psql` +``` + +下一步,新建一个用户,设置密码: + + +``` +`CREATE USER username WITH PASSWORD 'your_password' VALID UNTIL 'infinity';` +``` + +然后创建一个给 TT-RSS 用的数据库: + + +``` +`CREATE DATABASE tinyrss;` +``` + +最后,给新建的用户赋最高权限: + + +``` +`GRANT ALL PRIVILEGES ON DATABASE tinyrss to user_name;` +``` + +这是安装数据库的步骤。你可以输入 **\q** 来退出 **psql** 程序。 + +#### 5\. 安装 Git + +安装 TT-RSS 需要用 Git,所以输入下面的命令安装 Git: + + +``` +`$ sudo apt install git -y` +``` + +现在,进入到 Nginx 服务器的根目录: + + +``` +`$ cd /var/www/html` +``` + +下载 TT-RSS 最新源码: + + +``` +`$ git clone https://git.tt-rss.org/fox/tt-rss.git tt-rss` +``` + +注意,这一步会创建一个 **tt-rss** 文件夹。 + +#### 6\. 安装和配置Tiny Tiny RSS + +现在是安装和配置你的新 TT-RSS 服务器的最后时刻了。首先,确认下你在浏览器中能打开 ****。如果浏览器显示 **403 Forbidden**,那么就证明 **/var/www/html** 文件夹的权限没有设置正确。下面的命令通常能解决这个问题: + + +``` +`$ chmod 755 /var/www/html/ -v` +``` + +如果一切正常,你会看到 TT-RSS 安装页面,它会让你输入一些数据的信息。你只需要输入前面你创建的数据库用户名和密码;数据库名;主机名填 **localhost**;端口填 **5432**。 + +点击 **检测配置**。如果一切正常,你会看到一个有**初始化数据库**标签的红色按钮。点击它来开始安装。结束后,你会看到一个配置文件,你可以把它复制到 TT-RSS 的目录,另存为 **config.php**。 + +安装过程结束后,浏览器输入 **** 打开 TT-RSS,使用默认的凭证登录(用户名:**admin**,密码:**password**)。登录后系统会提示你修改密码。我强烈建议你尽快修改密码。 + +### 配置 TT-RSS + +如果一切正常,你现在就可以开始使用 TT-RSS 了。建议你新建一个非管理员用户,使用新用户名登录,并开始导入你的 feed、订阅,按照你的意愿来配置它。 + +最后,并且是超级重要的事,不要忘了阅读 TT-RSS wiki 上的 [更新 Feed][4] 部分。它讲述了如何创建一个更新 feed 的简单系统服务。如果你跳过了这一步,你的 RSS feed 就不会自动更新。 + +### 总结 + +呵!工作量不小,但是你做完了!你现在有自己的 RSS 聚合服务器了。想了解 TT-RSS 更多的知识?我推荐你去看官方的 [FAQ][5],[支持的][6]论坛,和详细的[安装][7]笔记。如果你有任何问题,尽情地在下面评论吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/ttrss-raspberry-pi + +作者:[Patrick H. Mullins][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/pmullins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-raspberrypi_0.png?itok=Kczz87J2 (Raspberries with pi symbol overlay) +[2]: https://tt-rss.org/ +[3]: https://opensource.com/sites/default/files/uploads/tt-rss.jpeg (Tiny Tiny RSS screenshot) +[4]: https://tt-rss.org/wiki/UpdatingFeeds +[5]: https://tt-rss.org/wiki/FAQ +[6]: https://community.tt-rss.org/c/tiny-tiny-rss/support +[7]: https://tt-rss.org/wiki/InstallationNotes From 42a925e8608687ac1ac2001887392ec512e74e4e Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 25 May 2020 08:42:36 +0800 Subject: [PATCH 0780/1809] translated --- ...t 5- Here-s How to Install it on Ubuntu.md | 106 ------------------ ...t 5- Here-s How to Install it on Ubuntu.md | 105 +++++++++++++++++ 2 files changed, 105 insertions(+), 106 deletions(-) delete mode 100644 sources/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md create mode 100644 translated/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md diff --git a/sources/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md b/sources/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md deleted file mode 100644 index 666c57c8ff..0000000000 --- a/sources/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md +++ /dev/null @@ -1,106 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Audacious 4.0 Released With Qt 5: Here’s How to Install it on Ubuntu) -[#]: via: (https://itsfoss.com/audacious-4-release/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Audacious 4.0 Released With Qt 5: Here’s How to Install it on Ubuntu -====== - -[Audacious][1] is an open-source audio player available for multiple platforms that include Linux. Almost after 2 years of its last major release, Audacious 4.0 has arrived with some big changes. - -The latest release Audacious 4.0 comes with [Qt 5][2] UI by default. You can still go for the old GTK2 UI from the source – however, the new features will be added to the Qt UI only. - -Let’s take a look at what has changed and how to install the latest Audacious on your Linux system. - -### Audacious 4.0 Key Changes & Features - -![Audacious 4 Release][3] - -Of course, the major change would be the use of Qt 5 UI as the default. In addition to that, there are a lot of improvements and feature additions mentioned in their [official announcement post][4], here they are: - - * Clicking on playlist column headers sorts the playlist - * Dragging playlist column headers changes the column order - * Application-wide settings for volume and time step sizes - * New option to hide playlist tabs - * Sorting playlist by path now sorts folders after files - * Implemented additional MPRIS calls for compatibility with KDE 5.16+ - * New OpenMPT-based tracker module plugin - * New VU Meter visualization plugin - * Added option to use a SOCKS network proxy - * The Song Change plugin now works on Windows - * New “Next Album” and “Previous Album” commands - * The tag editor in Qt UI can now edit multiple files at once - * Implemented equalizer presets window for Qt UI - * Lyrics plugin gained the ability to save and load lyrics locally - * Blur Scope and Spectrum Analyzer visualizations ported to Qt - * MIDI plugin SoundFont selection ported to Qt - * JACK output plugin gained some new options - * Added option to endlessly loop PSF files - - - -If you didn’t know about it previously, you can easily get it installed and use the equalizer coupled with [LADSP][5] effects to tweak your music experience. - -![Audacious Winamp Classic Interface][6] - -### How to Install Audacious 4.0 on Ubuntu - -It is worth noting that the [unofficial PPA][7] is made available by [UbuntuHandbook][8]. You can simply follow the instructions below to install it on Ubuntu 16.04, 18.04, 19.10, and 20.04. - -1\. First, you have to add the PPA to your system by typing in the following command in the terminal: - -``` -sudo add-apt-repository ppa:ubuntuhandbook1/apps -``` - -3\. Next, you need to update/refresh the package information from the repositories/sources you have and proceed to install the app. Here’s how to do that: - -``` -sudo apt update -sudo apt install audacious audacious-plugins -``` - -That’s it. You don’t have to do anything else. In either case, if you want to [remove the PPA and the software][9], just type in the following commands in order: - -``` -sudo add-apt-repository --remove ppa:ubuntuhandbook1/apps -sudo apt remove --autoremove audacious audacious-plugins -``` - -You can also check out their GitHub page for more information on the source and potentially install it on other Linux distros as well, if that’s what you’re looking for. - -[Audacious Source Code][10] - -### Wrapping Up - -The new features and the Qt 5 UI switch should be a good thing to improve the user experience and the functionality of the audio player. If you’re a fan of the classic Winamp interface, it works just fine as well – but missing a few features as mentioned in their announcement post. - -You can try it out and let me know your thoughts in the comments below! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/audacious-4-release/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://audacious-media-player.org -[2]: https://doc.qt.io/qt-5/qt5-intro.html -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/audacious-4-release.jpg?ssl=1 -[4]: https://audacious-media-player.org/news/45-audacious-4-0-released -[5]: https://www.ladspa.org/ -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/audacious-winamp.jpg?ssl=1 -[7]: https://itsfoss.com/ppa-guide/ -[8]: http://ubuntuhandbook.org/index.php/2020/03/audacious-4-0-released-qt5-ui/ -[9]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/ -[10]: https://github.com/audacious-media-player/audacious diff --git a/translated/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md b/translated/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md new file mode 100644 index 0000000000..8493ff968c --- /dev/null +++ b/translated/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Audacious 4.0 Released With Qt 5: Here’s How to Install it on Ubuntu) +[#]: via: (https://itsfoss.com/audacious-4-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +使用 Qt 5 的 Audacious 4.0 发布:以下是在 Ubuntu 上安装它的方法 +====== + +[Audacious][1]是用于包括 Linux 在内的多个平台的开源音频播放器。继上次发布主版本将近 2 年后,Audacious 4.0 带来了一些重大变化。 + +最新版本的 Audacious 4.0 默认带 [Qt 5][2] UI。你仍然可以从源中使用旧的 GTK2 UI,但是,新功能仅会添加到 Qt UI 中。 + +让我们看下发生了什么变化以及如何在 Linux 系统上安装最新的 Audacious。 + +### Audacious 4.0 关键变化和功能 + +![Audacious 4 Release][3] + +当然,主要的变化是默认使用 Qt 5 UI。除此之外,他们的[官方公告][4]中提到了许多改进和功能补充,它们是: + + * 单击播放列表列头可对播放列表进行排序 +  * 拖动播放列表列头会更改列顺序 +  * 应用中的音量和时间步长设置 +  * 隐藏播放列表标签的新选项 +  * 按路径对播放列表排序现在将文件夹排序在文件后面 +  * 实现了额外的 MPRIS 调用,以与 KDE 5.16+ 兼容 +  * 新的基于 OpenMPT 的跟踪器模块插件 +  * 新的 VU Meter 可视化插件 +  * 添加了使用 SOCKS 网络代理的选项 +  * Song Change 插件现在可在 Windows 上使用 +  * 新的“下一张专辑”和“上一张专辑”命令 +  * Qt UI 中的标签编辑器现在可以一次编辑多个文件 +  * 为 Qt UI 实现均衡器预设窗口 +  * 歌词插件获得了在本地保存和加载歌词的功能 +  * 模糊范围和频谱分析器可视化已移植到 Qt +  * MIDI 插件 SoundFont 选择已移植到 Qt +  * JACK 输出插件获得了一些新选项 +  * 添加了无限循环 PSF 文件的选项 + + +如果你以前不了解它,你可以轻松安装它,并使用均衡器和 [LADSP][5] 效果器来调整音乐体验。 + +![Audacious Winamp Classic Interface][6] + +### 如何在 Ubuntu 上安装 Audacious 4.0 + +值得注意的是,[UbuntuHandbook][8] 提供了[非官方 PPA][7]。你可以按照以下说明在 Ubuntu 16.04、18.04、19.10 和 20.04 上进行安装。 + +1\. 首先,你必须在终端中输入以下命令将 PPA 添加到系统中: + +``` +sudo add-apt-repository ppa:ubuntuhandbook1/apps +``` + +2\. 接下来,你需要从仓库/源码中更新/刷新软件包信息,然后继续安装该应用。方法如下: + +``` +sudo apt update +sudo apt install audacious audacious-plugins +``` + +就是这样。你无需执行其他任何操作。无论什么情况,如果你想[删除 PPA 和软件][9],只需按顺序输入以下命令: + +``` +sudo add-apt-repository --remove ppa:ubuntuhandbook1/apps +sudo apt remove --autoremove audacious audacious-plugins +``` + +你也可以在它的 GitHub 页面上查看有关源码的更多信息,并根据需要在其他 Linux 发行版上进行安装。 + +[Audacious Source Code][10] + +### 总结 + +新功能和 Qt 5 UI 开关对于改善用户体验和音频播放器的功能应该是一件好事。如果你是经典 Winamp 界面的粉丝,它也可以正常工作。但缺少其公告中提到的一些功能。 + +你可以尝试一下,并在下面的评论中让我知道你的想法! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/audacious-4-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://audacious-media-player.org +[2]: https://doc.qt.io/qt-5/qt5-intro.html +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/audacious-4-release.jpg?ssl=1 +[4]: https://audacious-media-player.org/news/45-audacious-4-0-released +[5]: https://www.ladspa.org/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/audacious-winamp.jpg?ssl=1 +[7]: https://itsfoss.com/ppa-guide/ +[8]: http://ubuntuhandbook.org/index.php/2020/03/audacious-4-0-released-qt5-ui/ +[9]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/ +[10]: https://github.com/audacious-media-player/audacious From f41febeddd0bd1c590572a7beac23f4918b9f7c2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 25 May 2020 08:49:31 +0800 Subject: [PATCH 0781/1809] translating --- ...00304 Getting started with the Gutenberg editor in Drupal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md b/sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md index 6050adebfa..84c177f4de 100644 --- a/sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md +++ b/sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 376e2bcae07cd505448eecb6291ac5ea8b7a77d3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:42:06 +0800 Subject: [PATCH 0782/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20Usin?= =?UTF-8?q?g=20=E2=80=98apt=20search=E2=80=99=20and=20=E2=80=98apt=20show?= =?UTF-8?q?=E2=80=99=20Commands=20to=20Search=20and=20Find=20Details=20of?= =?UTF-8?q?=20Packages=20in=20Ubuntu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 Using ‘apt search- and ‘apt show- Commands to Search and Find Details of Packages in Ubuntu.md --- ...arch and Find Details of Packages in Ubuntu.md | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 sources/tech/20200525 Using ‘apt search- and ‘apt show- Commands to Search and Find Details of Packages in Ubuntu.md diff --git a/sources/tech/20200525 Using ‘apt search- and ‘apt show- Commands to Search and Find Details of Packages in Ubuntu.md b/sources/tech/20200525 Using ‘apt search- and ‘apt show- Commands to Search and Find Details of Packages in Ubuntu.md new file mode 100644 index 0000000000..d1d80bcb5d --- /dev/null +++ b/sources/tech/20200525 Using ‘apt search- and ‘apt show- Commands to Search and Find Details of Packages in Ubuntu.md @@ -0,0 +1,172 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using ‘apt search’ and ‘apt show’ Commands to Search and Find Details of Packages in Ubuntu) +[#]: via: (https://itsfoss.com/apt-search-command/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Using ‘apt search’ and ‘apt show’ Commands to Search and Find Details of Packages in Ubuntu +====== + +_**This is a detailed beginners guide to apt search command. Using apt search and apt show commands, you can get details of the available versions, dependencies, repositories and other important information about packages in Ubuntu.**_ + +Have you ever wondered if a certain package is available to install via [apt package manager][1]? + +Have you wondered if the package offered by [Ubuntu repositories][2] are the latest one or not? + +The apt package manager in [Ubuntu][3] and many other distribution provides two handy [apt command options][4] for this purpose. + +The apt search command looks for the provided string in the name and description of the packages. + +``` +apt search package_name +``` + +The apt show command provides detailed information on a package: + +``` +apt show package_name +``` + +The commands don’t require you to [be root in Ubuntu][5]. Here’s an example of these commands: + +![][6] + +### Why would you want to use apt search or apt show command? + +Let’s say you want to [install Gambas programming language in Ubuntu][7]. You are happy with your knowledge of the apt command so you decided to use the command line for installing application. + +You open a terminal and use the apt command to install gambas but it results in [unable to locate package error][8]. + +``` +sudo apt install gambas +Reading package lists... Done +Building dependency tree +Reading state information... Done +E: Unable to locate package gambas +``` + +Why did Ubuntu not find the gambas package? Because there is no such package called gambas. Instead, it is available as gambas3. This is a situation where you could take the advantage of the apt search command. + +Let’s move to apt show command. This command provides detailed information about a package, its repository, dependencies and a lot more. + +Knowing what version of a package is available from the official repository could help you in deciding whether you should install it from some other sources. + +Quick recall + +The apt package manager works on a local database/cache of available packages from various repositories. This database contains the information about the available package version, dependencies etc. It doesn’t contain the entire package itself. The packages are downloaded from the remote repositories. + +When you run the sudo apt update command, this cache is created/updated in the /var/lib/apt/lists/ directory. The apt search and apt show commands utilize this cache. + +The term package is used for an application, program, software. + +### Search for available packages using apt search command + +![][9] + +Let me continue the gambas example. Say, you search for + +``` +apt search gambas +``` + +It will give you a huge list of packages that have “gambas” in its name or description. This output list is in alphabetical order. + +Now, you’ll of course have to make some intelligent prediction about the package you want. In this example, the first result says “Complete visual development environment for Gambas”. This gives you a good hint that this is the main package you are looking for. + +![][10] + +Why so many packages associated with gambas? Because a number of these gambas packages are probably dependencies that will installed automatically if you install the gambas3 package. If you use the _‘apt show gambas3_‘ command, it will show all the dependencies that will be installed with gambas3 package. + +Some of these listed packages could be libraries that a developer may need in some special cases while developing her/his software. + +#### Use apt search for package name only + +By default, apt search command looks for the searched term in both the name of the package and its description. + +You may narrow down the search by instructing the apt command to search for package names only. + +``` +apt search --names-only search_term +``` + +If you are following this as a tutorial, give it a try. Check the output with search term ‘transitional’ with and without –names-only option and you’ll see how the output changes. + +``` +apt search transitional +apt search --names-only transitional +``` + +**Bonus Tip**: You can use ‘apt list –installed’ command to [look for installed packages in Ubuntu][11]. + +### Get detailed information on a package using apt show command + +The output of the apt search commands a brief introduction of the packages. If you want more details, use the apt show command. + +``` +apt show exact_package_name +``` + +The apt show command works on the exact package name and it gives you a lot more information on the package. You get: + + * Version information + * Repository information + * Origin and maintainer of the package information + * Where to file a bug + * Download and installation size + * Dependencies + * Detailed description of the package + * And a lot more + + + +Here’s an example: + +![][12] + +You need to give the exact package name otherwise the apt show won’t work. The good thing is that tab completion works apt show command. + +As you can see in the previous image, you have plenty of information that you may found helpful. + +The apt show command also works on installed packages. In that case, you can see which source the package was installed from. Was it a PPA or some third-party repository or universe or the main repository itself? + +Personally, I use apt show a lot. This helps me know if the package version provided by Ubuntu is the latest or not. Pretty handy tool! + +### Conclusion + +If you read my detailed [guide on the difference between apt and apt-get commands][13], you would know that this ‘apt search’ command works similar to ‘apt-cache search’. There is no such command as “apt-get search”. + +The purpose of creating apt command is to give you one tool with only enough option to manage the packages in your Debian/Ubuntu system. The apt-get, apt-cache and other apt tools still exist, and they can be used in scripting for more complex scenarios. + +I hope you found this introduction to **apt search** and **apt show** commands useful. I welcome your questions and suggestions on this topic. + +If you liked it, please share it on various Linux forums and communities you frequent. That helps us a lot. Thank you. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/apt-search-command/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://wiki.debian.org/Apt +[2]: https://itsfoss.com/ubuntu-repositories/ +[3]: https://ubuntu.com/ +[4]: https://itsfoss.com/apt-command-guide/ +[5]: https://itsfoss.com/root-user-ubuntu/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/apt-search-apt-show-example-800x493.png?resize=800%2C493&ssl=1 +[7]: https://itsfoss.com/install-gambas-ubuntu/ +[8]: https://itsfoss.com/unable-to-locate-package-error-ubuntu/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/apt-search-command.png?ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/apt-search-command-example.png?fit=800%2C297&ssl=1 +[11]: https://itsfoss.com/list-installed-packages-ubuntu/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/apt-show-command-example-800x474.png?resize=800%2C474&ssl=1 +[13]: https://itsfoss.com/apt-vs-apt-get-difference/ From 6c60cbd23cd910e1eb347b5fc2a987985a504c75 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:42:30 +0800 Subject: [PATCH 0783/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20How?= =?UTF-8?q?=20to=20Make=20a=20GIF=20in=20GIMP=20[Simple=20Tutorial]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 How to Make a GIF in GIMP -Simple Tutorial.md --- ... to Make a GIF in GIMP -Simple Tutorial.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20200525 How to Make a GIF in GIMP -Simple Tutorial.md diff --git a/sources/tech/20200525 How to Make a GIF in GIMP -Simple Tutorial.md b/sources/tech/20200525 How to Make a GIF in GIMP -Simple Tutorial.md new file mode 100644 index 0000000000..7a07e849c1 --- /dev/null +++ b/sources/tech/20200525 How to Make a GIF in GIMP -Simple Tutorial.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Make a GIF in GIMP [Simple Tutorial]) +[#]: via: (https://itsfoss.com/make-gif-in-gimp/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +How to Make a GIF in GIMP [Simple Tutorial] +====== + +Making a GIF can be fun and many users would like to know how to make one. You can create a GIF very easily with [GIMP][1], the powerful open-source image editing software. + +In this GIMP tutorial, I’ll show you how to create a simple GIF in GIMP. + +### Making a GIF in GIMP + +![][2] + +Using GIMP as an animation tool requires you to think of every layer as of an animation frame. In this tutorial, I will create a simple web banner based on It’s FOSS logo. I will use 2 images as my layers but feel free to add more when you make your own. + +The method that I use here is called “the **combine** method”, in which the new frame is added to the previous frame. My idea is to make a “flashing” web banner, to draw the attention at something important. + +I presume that you have [already installed GIMP in Ubuntu][3] or whichever operating system you are using. Let’s start making the GIF. + +#### Step 1 + +From the File menu, click on **Open as Layers** and select all the images you want to include in the GIF. Then click **Open**. + +![][4] + +You can order your images in the layers tab. The GIF sequence will start with your bottom layer and run through each layer bottom to top. + +![Change the order of layers][5] + +From the main menu select **Filters**, then **Animation** and finally click **Optimise (for GIF)**. + +![][6] + +What “Optimise” does? + +Optimise examines each layer, and reuses information from previous frames if they haven’t changed at the following frame. It only stores new values for pixels that change, and purges any duplicate parts. + +If a frame is exactly the same as the previous one, it removes that frame completely and the previous frame just stays on the screen for longer. + +To view GIF, from main menu click on **Filter** then **Animation** and **Playback**. + +![][7] + +Press the **Playback** button to start GIF. To save GIF on the File Menu select **File**, click on **Export as**. + +![][8] + +Name your GIF and choose the folder you want to save it in. On “**Select File Type**“, choose GIF Image. + +![Save As Gif][9] + +When prompted select ‘As Animation’, ‘Loop Forever’, set the desired delay value and to take effect click on “Use delay entered above for all frames”. + +The most important option is to set the frame disposal action as “**Cumulative layers (combine)**” to get the “**flashing**” effect for our banner. Click Export as a final step. + +![Gif Export Options][10] + +**Your GIF is ready!** + +![][11] + +This was an easy-to-follow, simple example, although GIMP has a much greater depth in animation creating and requires a good amount of study and practice to master it. + +If you are interested in more GIMP tutorials, you may read how to outline text in GIMP. Stay tuned at It’s FOSS for more such useful tips in the future. [Subscribing to the weekly newsletter][12] is the best way to stay updated. Enjoy! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/make-gif-in-gimp/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://www.gimp.org/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/create-gif-in-gimp.jpg?ssl=1 +[3]: https://itsfoss.com/gimp-2-10-release/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/1.-open-as-layers.jpeg?ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/layers-order.jpg?ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/2.-optimize-for-gif-1.png?fit=800%2C647&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/3.-playback.png?fit=800%2C692&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/4.-export-as.png?ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/5.-save-as-gif.png?fit=800%2C677&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/6.-export-options-1.png?ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/its-foss-logo.gif?fit=800%2C417&ssl=1 +[12]: https://itsfoss.com/subscribe-to-newsletter/ From 56b7fb2f2ed9751a0506056fc3b1ba3d14b39570 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:43:15 +0800 Subject: [PATCH 0784/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20Now?= =?UTF-8?q?=20You=20Can=20Run=20Linux=20Apps=20in=20Windows=20(Thanks=20to?= =?UTF-8?q?=20WSL)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md --- ...n Linux Apps in Windows (Thanks to WSL).md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md diff --git a/sources/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md b/sources/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md new file mode 100644 index 0000000000..e6e79cbb08 --- /dev/null +++ b/sources/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Now You Can Run Linux Apps in Windows (Thanks to WSL)) +[#]: via: (https://itsfoss.com/run-linux-apps-windows-wsl/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Now You Can Run Linux Apps in Windows (Thanks to WSL) +====== + +Microsoft’s recent “[Build 2020][1]” developer conference involved some interesting announcements. I’m not sure if it’s something to be excited about or skeptical about — but Microsoft you have our attention now more than ever. + +And, among all the announcements, the ability to run GUI apps on WSL (Windows Subsystem for Linux) gained the spotlight. + +Not to forget the [fiasco with Xamrin.Forms rebranding as MAUI][2] which conflicts with an existing open-source project ([Maui Project][3]) by Uri Herrera of [Nitrux Linux.][4] + +In case you didn’t know, WSL is an environment that lets you have a console-only Linux experience from within Windows 10. It is also one of the [best ways to run Linux commands in Windows.][5] + +While the announcement through a blog post ([DirectX ❤ Linux][6]) may have been a PR bait as [Liam Dawe thinks][7]. But, it’s still something worth talking about. + +### Support for Linux GUI Apps On WSL + +![][8] + +Recently, Microsoft announced a bunch of new features coming to WSL (a.k.a. WSL 2) during the online developer conference. + +The introduction of [Windows Package Manager][9], [Windows Terminal 1.0][10], and a couple others were some its highlights. + +But, the support for GPU hardware acceleration to **Windows Subsystem for Linux 2** was something significant. + +So, does this mean that you can run Linux apps on Windows using WSL? Looks like it… + +Microsoft plans to make it happen using a brand-new Linux kernel driver **dxgkrnl**. To give you a technical brief, I’d quote the description from their announcement here: + +![Linux Kernel Driver Wsl][11] + +> Dxgkrnl is a brand-new kernel driver for Linux that exposes the **/dev/dxg** device to user mode Linux. **/dev/dxg** exposes a set of IOCTL that closely mimic the native WDDM D3DKMT kernel service layer on Windows. Dxgkrnl inside the Linux kernel connects over the VM Bus to its big brother on the Windows host and uses this VM bus connection to communicate with the physical GPU. + +I’m no expert here but it means that the **Linux applications on WSL will have the same access to the GPU as native Windows applications do**. + +The support for GUI apps will be coming later this fall (not with May 2020 update) — so we’ll have to see when that happens. + +Microsoft is specifically targeting the developers who want the comfort of using their Linux IDE on Windows. Google is also targeting the same user base by [bringing GUI Linux apps to Chromebook][12]. + +Well, that’s good news for users who want to stick with Windows. But, is it really? + +### Microsoft Loves Linux — Do They Really? + +![Microsoft Loves Linux][13] + +It is definitely a good thing that they are embracing Linux and its benefits through their efforts of incorporating a Linux environment on Windows. + +But, how is it really going to help the **desktop Linux users**? I don’t see any real-word benefits from it as of now. + +You’re free to have a different opinion here. But, I think there’s no real value to the desktop users of Linux through the development of WSL. At least, none so far. + +It was interesting to notice that someone on [Linux Unplugged podcast][14] highlighted Microsoft’s move as something in the line of EEE (Embrace, extend, and extinguish) for which they’re known for. + +Maybe, who knows? Of course, the effort they’ve put to pull this off is worth appreciating — but it’s exciting and mystifying at the same time. + +### Does this mean Windows users will no longer switch to Linux? + +The reason why Microsoft is embracing Linux on its platform is that they know what it’s capable of and why developers (or users) prefer using. + +But, with the updates to WSL 2, I tend to agree to what Abhishek thinks if this continues: + +> Eventually, desktop Linux will be confined to become a desktop application under Windows… + +Well, of course, the native experience is still superior for the time being. And, it’ll be rare to see that the existing Linux desktop users will use Windows over it. But, that’s still something to worry about. + +What do you think about all this? I’m not ruling the advantages of WSL for users forced to use Windows — but do you think Microsoft’s progress with WSL is going to be something hostile in nature or something that will help Linux in the long run? + +Let me know your thoughts in the comments! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/run-linux-apps-windows-wsl/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.microsoft.com/build2020/ +[2]: https://itsfoss.com/microsoft-maui-kde-row/ +[3]: https://mauikit.org/ +[4]: https://itsfoss.com/nitrux-linux/ +[5]: https://itsfoss.com/run-linux-commands-in-windows/ +[6]: https://devblogs.microsoft.com/directx/directx-heart-linux/ +[7]: https://www.gamingonlinux.com/2020/05/microsoft-build-directx-and-linux-plus-more +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/Linux-GUI-app-Windows-WSL.png?ssl=1 +[9]: https://devblogs.microsoft.com/commandline/windows-package-manager-preview/ +[10]: https://devblogs.microsoft.com/commandline/windows-terminal-1-0/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/linux-kernel-driver-wsl.png?ssl=1 +[12]: https://itsfoss.com/linux-apps-chromebook/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/microsoft-loves-linux.jpg?ssl=1 +[14]: https://linuxunplugged.com/354 From b43ed403a7f4e9e9306f2ea7b9d27570312fa896 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:43:45 +0800 Subject: [PATCH 0785/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20Ubun?= =?UTF-8?q?tu=20Budgie=2020.04=20Review:=20Smooth,=20Polished=20&=20Plenty?= =?UTF-8?q?=20of=20Changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 Ubuntu Budgie 20.04 Review- Smooth, Polished - Plenty of Changes.md --- ...w- Smooth, Polished - Plenty of Changes.md | 177 ++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 sources/tech/20200525 Ubuntu Budgie 20.04 Review- Smooth, Polished - Plenty of Changes.md diff --git a/sources/tech/20200525 Ubuntu Budgie 20.04 Review- Smooth, Polished - Plenty of Changes.md b/sources/tech/20200525 Ubuntu Budgie 20.04 Review- Smooth, Polished - Plenty of Changes.md new file mode 100644 index 0000000000..93226912f5 --- /dev/null +++ b/sources/tech/20200525 Ubuntu Budgie 20.04 Review- Smooth, Polished - Plenty of Changes.md @@ -0,0 +1,177 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu Budgie 20.04 Review: Smooth, Polished & Plenty of Changes) +[#]: via: (https://itsfoss.com/ubuntu-budgie-20-04-review/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Ubuntu Budgie 20.04 Review: Smooth, Polished & Plenty of Changes +====== + +As we promised our readers, we’ll be reviewing all major flavors of [Ubuntu 20.04 LTS release][1]. In that continuation, here’s our take on the Ubuntu Budgie. + +![Ubuntu Budgie Desktop][2] + +[Ubuntu Budgie][3], as the name implies, is an [official flavor of Ubuntu][4] using the [Budgie desktop environment][5]. This flavor is a newer member of the Ubuntu family. Ubuntu Budgie’s first release was 16.04 and it was accepted as an official flavor with the 17.04 release. + +Their [goal][6] is to “combine the simplicity and elegance of the Budgie interface to produce a traditional desktop orientated distro with a modern paradigm”. + +### Ubuntu 20.04 Review: What has changed and what has not! + +There have been a surprising number of updates and improvements to [Ubuntu Budgie since the 18.04 LTS release][7]. + + * New stylish menu apple + * Budgie-based network manager applet as default + * New Window Shuffler allows you to tile applications from the keyboard + * New tool to quickly switch desktop layout + * 4k resolution support + * GNOME Firmware and Drawing are new default applications + * Backport packages have now been rebuilt for 20.04 + * Firefox is the default browser. + * Catfish file and text search is now the default + * budgie-nemo integration + * System Tray applet removed due to bugs + * Event alerts sounds are disabled by default + * Fix for keyboard shortcuts mysteriously going missing + * Better lock screen styling + * Files (Nautilus) has been replaced with Files (Nemo) due to community demand + * Plank dock has now been switched to the bottom of the screen, is transparent and has the bounce animations by default + * The Quick Notes and Hot Corners applets have been ported from Python to Vala to improve speed + * Celluloid replaces MPV + * GNOME dependencies have been updated + + + +![][8] + +Ubuntu Budgie now ships with the most recent release of the Budgie desktop environment (10.5.1). Improvements include: + + * New Raven section in Budgie Desktop Settings + * Raven Notification grouping and the ability to turn off notifications + * Icon Task List has been revamped + * Ability to set number of virtual desktops + + + +Ubuntu Budgie comes with a whole slew of Budgie applets and min-apps. They can be installed through Ubuntu Budgie Welcome. + +![Ubuntu Budgie Welcome][9] + + * WeatherShow – shows the forecast for the next five days and updates every 3 hours + * Wallstreet – a wallpaper utility that allows you to cycle through a folder of images + * Visual-space – a compact workspace switcher + * Dropby – this applet allows you to quickly manage USB thumb drives from the panel + * Kangaroo – quickly browser folders from the panel + * Trash applet – manage your trash can + * Fuzzyclock – shows time in a fuzzy way + * Workspace stopwatch – allows you to keep track of the time spent in each workspace + + + +For a complete list of changes and updates, visit the [changelog][10]. + +#### System Requirements + +Ubuntu Budgie 20.04 has updated the [system requirements][11]: + + * 4GB or more of RAM + * 64-bit capable Intel and AMD processors + * UEFI PCs booting in CSM mode + * Modern Intel-based Apple Macs + + + +As you can see, Budgie is not really a lightweight option here. + +#### Included Apps + +![][12] + +The following useful applications are included in Ubuntu Budgie by default: + + * AisleRiot Solitaire + * Geary + * Catfish search tool + * Cheese webcam tool + * GNOME Drawing + * GNOME 2048 + * GNOME Mahjongg + * GNOME Mines + * GNOME Sudoku + + + * Gthumb + * LibreOffice + * Maps + * Rhythmbox + * Tilix + * Ubuntu Budgie Welcome + * Evince document viewer + * Plank + * Celluloid + + + +![Ubuntu Budgie Ram Usage][13] + +### Installation + +Initially, I was unable to get Ubuntu Budgie to do into the live environment so that I could install it. It turned out that Ubuntu Budgie was trying to boot via EFI. I contacted the [Ubuntu Budgie forum][14] and was able to get a solution. + +Once the purple splash screen I had to hit ESC and select legacy. After that, it booted as normal and installed without issue. I have only run into this issue with Ubuntu Budgie. I downloaded and tried the Ubuntu MATE 20.04 ISO, but didn’t have a similar issue. + +### Experience with Ubuntu Budgie 20.04 + +![][15] + +Other than the minor installation issue, my time with Ubuntu Budgie was very pleasant. The Budgie desktop has come a long way since [Ikey][16] first created it and it has become a very mature option. The goal of Ubuntu Budgie is to “produce a traditional desktop orientated distro”. It does that in spades. All the changes that they have made continually add more polish to their product. + +Overall, Ubuntu Budgie is a very nice looking distro. From the default theme to wallpaper options, you can tell that a lot of effort was put into making the visual experience very appealing. + +One thing to keep in mind is that Ubuntu Budgie is not intended for low spec systems. I’m running it on my Dell Latitude D630. Without any applications open, it used about 700 MB of RAM. + +One part of Ubuntu Budgie that I enjoyed more than I should have, was the inclusion of the [Tilix terminal emulator][17]. Tilix allows you to add terminal windows to the right or below. It has a whole host of features and just loved using it. I’m planning to install on my other Linux systems. + +### Final Thoughts on Ubuntu Budgie 20.04 + +Ubuntu Budgie is a welcome addition to the litany of official flavors. Budgie feels very smooth and polished. It gets out of your way and lets you get work done. + +If you are tired of your current desktop environment and want to take a look at something new, check it out. If you’re happy with your current setup, check Ubuntu Budgie’s live DVD. You just might like it. + +![Ubuntu Budgie About][18] + +Have you already tried Ubuntu 20.04 Budgie? How’s your experience with it? If not, which Ubuntu 20.04 flavor are you using right now? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-budgie-20-04-review/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/download-ubuntu-20-04/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-busgie-desktop.png?resize=800%2C500&ssl=1 +[3]: https://ubuntubudgie.org/ +[4]: https://itsfoss.com/which-ubuntu-install/ +[5]: https://en.wikipedia.org/wiki/Budgie_(desktop_environment +[6]: https://ubuntubudgie.org/about-us/ +[7]: https://itsfoss.com/ubuntu-budgie-18-review/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-desktop-settings.jpeg?ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-welcome.png?resize=800%2C472&ssl=1 +[10]: https://ubuntubudgie.org/2020/04/21/ubuntu-budgie-20-04lts-release-notes-for-18-04-upgraders/ +[11]: https://ubuntubudgie.org/downloads/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-applications.jpeg?ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-ram-usage.png?resize=800%2C600&ssl=1 +[14]: https://discourse.ubuntubudgie.org/t/cant-get-ub-to-boot/3397 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-20-04.jpg?ssl=1 +[16]: https://itsfoss.com/ikey-doherty-serpent-interview/ +[17]: https://gnunn1.github.io/tilix-web/ +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-about.png?resize=800%2C648&ssl=1 From 80833cef50eccca48355dadf12b32961e241d4b0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:45:47 +0800 Subject: [PATCH 0786/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20How?= =?UTF-8?q?=20to=20Compress=20PDF=20in=20Linux=20[GUI=20&=20Terminal]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 How to Compress PDF in Linux -GUI - Terminal.md --- ...o Compress PDF in Linux -GUI - Terminal.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20200525 How to Compress PDF in Linux -GUI - Terminal.md diff --git a/sources/tech/20200525 How to Compress PDF in Linux -GUI - Terminal.md b/sources/tech/20200525 How to Compress PDF in Linux -GUI - Terminal.md new file mode 100644 index 0000000000..eba596bcb9 --- /dev/null +++ b/sources/tech/20200525 How to Compress PDF in Linux -GUI - Terminal.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Compress PDF in Linux [GUI & Terminal]) +[#]: via: (https://itsfoss.com/compress-pdf-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Compress PDF in Linux [GUI & Terminal] +====== + +_**Brief: Learn how to reduce the size of a PDF file in Linux. Both command line and GUI methods have been discussed.**_ + +I was filling some application form and it asked to upload the necessary documents in PDF format. Not a big issue. I gathered all the [scanned images and combined them in one PDF using gscan2pdf tool][1]. + +The problem came when I tried to upload this PDF file. The upload failed because it exceeded the maximum file size limit. This only meant that I needed to somehow reduce the size of the PDF file. + +Now, you may use an online PDF compressing website but I don’t trust them. A file with important documents uploading to an unknown server is not a good idea. You could never be sure that they don’t keep a copy your uploaded PDF document. + +This is the reason why I prefer compressing PDF files on my system rather than uploading it to some random server. + +In this quick tutorial, I’ll show you how to reduce the size of PDF files in Linux. I’ll show both command line and GUI methods. + +### Method 1: Reduce PDF file size in Linux command line + +![][2] + +You can use [Ghostscript][3] command line tool for compressing a PDF file. Most Linux distributions include the open source version of Ghostscript already. However, you can still try to install it just to make sure. + +On Debian/Ubuntu based distributions, use the following command to install Ghostscript: + +``` +sudo apt install ghostscript +``` + +Now that you have made sure that Ghostscript is installed, you can use the following command to reduce the size of your PDF file: + +``` +gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed_PDF_file.pdf input_PDF_file.pdf +``` + +In the above command, you should add the correct path of the input and out PDF file. + +The command looks scary and confusing. I advise copying and pasting most of it. What you need to know is the dPDFSETTINGS parameter. This is what determines the compression level and thus the quality of your compressed PDF file. + +dPDFSETTINGS | Description +---|--- +/prepress (default) | Higher quality output (300 dpi) but bigger size +/ebook | Medium quality output (150 dpi) with moderate output file size +/screen | Lower quality output (72 dpi) but smallest possible output file size + +Do keep in mind that some PDF files may not be compressed a lot or at all. Applying compression on some PDF files may even produce a file bigger than the original. There is not much you can do in such cases. + +### Method 2: Compress PDF files in Linux using GUI tool + +I understand that not everyone is comfortable with command line tool. The [PDF editors in Linux][4] doesn’t help much with compression. This is why we at It’s FOSS worked on creating a GUI version of the Ghostscript command that you saw above. + +[Panos][5] from It’s FOSS team [worked on creating a Python-Qt based GUI wrapper for the Ghostscript][6]. The tool gives you a simple UI where you can select your input file, select a compression level and click on the compress button to compress the PDF file. + +![][7] + +The compressed PDF file is saved in the same folder as the original PDF file. Your original PDF file remains untouched. The compressed file is renamed by appending -compressed to the original file name. + +If you are not satisfied with the compression, you can choose another compression level and compress the file again. + +You may find the source code of the PDF Compressor on our GitHub repository. To let you easily use the tool, we have packaged it in AppImage format. Please [refer to this guide to know how to use AppImage][8]. + +[Download PDF Compressor (AppImage)][9] + +Please keep in mind that the tool is in early stages of developments. You may experience some issues. If you do, please let us know in the comments or even better, [file a bug here][10]. + +We’ll try to add more packages (Snap, Deb, PPAs etc) in the future releases. If you have experience with the development and packaging, please feel free to give us a hand. + +Would you like It’s FOSS team to work on creating more such small desktop tools in future? Your feedback and suggestions are welcome. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/compress-pdf-linux/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/convert-multiple-images-pdf-ubuntu-1304/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/compress-pdf-linux.jpg?ssl=1 +[3]: https://www.ghostscript.com/ +[4]: https://itsfoss.com/pdf-editors-linux/ +[5]: https://github.com/libreazer +[6]: https://github.com/itsfoss/compress-pdf +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/compress-PDF.jpg?fit=800%2C448&ssl=1 +[8]: https://itsfoss.com/use-appimage-linux/ +[9]: https://github.com/itsfoss/compress-pdf/releases/download/0.1/compress-pdf-v0.1-x86_64.AppImage +[10]: https://github.com/itsfoss/compress-pdf/issues From 0b04425e3794f68c0be82a17e8ac509986c8046f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:46:16 +0800 Subject: [PATCH 0787/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20Copy?= =?UTF-8?q?Q=20Clipboard=20Manager=20for=20Keeping=20a=20Track=20of=20Clip?= =?UTF-8?q?board=20History?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 CopyQ Clipboard Manager for Keeping a Track of Clipboard History.md --- ...or Keeping a Track of Clipboard History.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sources/tech/20200525 CopyQ Clipboard Manager for Keeping a Track of Clipboard History.md diff --git a/sources/tech/20200525 CopyQ Clipboard Manager for Keeping a Track of Clipboard History.md b/sources/tech/20200525 CopyQ Clipboard Manager for Keeping a Track of Clipboard History.md new file mode 100644 index 0000000000..616ee5971a --- /dev/null +++ b/sources/tech/20200525 CopyQ Clipboard Manager for Keeping a Track of Clipboard History.md @@ -0,0 +1,113 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (CopyQ Clipboard Manager for Keeping a Track of Clipboard History) +[#]: via: (https://itsfoss.com/copyq-clipboard-manager/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +CopyQ Clipboard Manager for Keeping a Track of Clipboard History +====== + +How do you copy-paste text? Let me guess. You either use the right click menu to copy-paste or use Ctrl+C to copy a text and Ctrl+V to paste the text. The text copied this way is saved to ‘clipboard’. The [clipboard][1] is a special location in the memory of your system that stores cut or copied text (and in some cases images). + +But have you ever been in a situation where you had a text copied and then you copy another text and then realize you needed the text you copied earlier? Trust me, it happens a lot. + +Instead of wondering about finding the previous text to copy again, you can use a clipboard manager. + +A clipboard manager is a handy little tool that keeps a history of the text you had copied. If you need to use the earlier copied text, you can use the clipboard manager to copy it again. + +![Clipboard][2] + +There are several clipboard managers available for Linux. In this article, I’ll cover one such tool that goes by the name CopyQ. + +### CopyQ Clipboard Manager + +[CopyQ][3] is nifty clipboard manager that has plenty of features to manage your system’s clipboard. It is an open source software available for free for major Linux distributions. + +Like any other clipboard manager, CopyQ monitors the system clipboard and saves its content. It can save both text and images from the clipboard. + +CopyQ sits in the system tray and you can easily access it from there. From the system tray, just click on the text that you want. It will automatically copy this text and you would notice that the copied text moves on to the top of the saved clipboards. + +![][4] + +In the system tray, it shows only the five recent clips. You can open the main window using the “Show/hide main window” option in the system tray. CopyQ saves up to 200 clips. You may edit the clipboard items here. + +![][5] + +You may also set a keyboard shortcut to bring the clipboard with a few key combination. This option is available in Preferences->Shortcuts. + +![][6] + +If you decide to use it, I advise enabling the autostart so that CopyQ runs automatically when you start your system. By default, it saves 200 items in the history and that’s a lot in my opinion. You may want to change that as well. + +![][7] + +CopyQ is an advanced clipboard manager with plenty of additional features. You can search for text in the saved clipboard items. You can sort, create, edit or change the order of the clipboard items. + +You can ignore clipboard copied from some windows or containing some text. You can also temporarily disable clipboard saving. CopyQ also supports [Vim][8]-like editor and shortcut for Vim fans. + +There are many more features that you may explore on your own. For me, the most notable feature is that it gives me easy access to older copied text, and I am happy with that. + +### Installing CopyQ on Linux + +CopyQ is available for Linux, Windows and macOS. You can get the executable file for Windows and macOS [from its website][3]. + +For Linux, CopyQ is available in the repositories of all major Linux distributions. Which means that you can find it in your software center or install it using your distribution’s package manager. + +Ubuntu users may find it in the software center if [universe repository is enabled][9]. + +![CopyQ in Ubuntu Software Center][10] + +Alternatively, you can use the apt command to install it: + +``` +sudo apt install copyq +``` + +Ubuntu users also have the option to [use the official PPA][11] and always get the latest stable CopyQ version. For example, at the time of writing this article, CopyQ version in Ubuntu 20.04 is 3.10 while [PPA has newer version][12] 3.11. It’s your choice really. + +``` +sudo add-apt-repository ppa:hluk/copyq +sudo apt update +sudo apt install copyq +``` + +You may also want to know [how to remove PPA][13] later. + +### Do you use a clipboard manager? + +I find it surprising that many people are not even aware of an essential utility like clipboard manager. For me, it’s one of the [essential productivity tools on Linux][14]. + +As I mentioned at the beginning of the article, there are several clipboard managers available for Linux. CopyQ is one of such tools. Do you use or know of some other similar clipboard tool? Why not let us know in the comments? + +If you started using CopyQ after reading this article, do share your experience with it. What you liked and what you didn’t like? The comment section is all yours. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/copyq-clipboard-manager/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.computerhope.com/jargon/c/clipboar.htm +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/clipboard.png?ssl=1 +[3]: https://hluk.github.io/CopyQ/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/copyq-system-tray.png?ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/copyq-main-window.png?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/copyq-shortcuts.png?ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/copyq-auto-start.png?ssl=1 +[8]: https://itsfoss.com/vim-8-release-install/ +[9]: https://itsfoss.com/ubuntu-repositories/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/copyq-software-center.png?resize=800%2C474&ssl=1 +[11]: https://itsfoss.com/ppa-guide/ +[12]: https://launchpad.net/~hluk/+archive/ubuntu/copyq +[13]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/ +[14]: https://itsfoss.com/productivity-tips-ubuntu/ From 67b1f629460074c7f64d75d6627df88b8c741e21 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:46:40 +0800 Subject: [PATCH 0788/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20What?= =?UTF-8?q?=20to=20do=20When=20You=20See=20=E2=80=9CRepository=20does=20no?= =?UTF-8?q?t=20have=20a=20release=20file=E2=80=9D=20Error=20in=20Ubuntu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 What to do When You See -Repository does not have a release file- Error in Ubuntu.md --- ...ot have a release file- Error in Ubuntu.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20200525 What to do When You See -Repository does not have a release file- Error in Ubuntu.md diff --git a/sources/tech/20200525 What to do When You See -Repository does not have a release file- Error in Ubuntu.md b/sources/tech/20200525 What to do When You See -Repository does not have a release file- Error in Ubuntu.md new file mode 100644 index 0000000000..6cfd9f34de --- /dev/null +++ b/sources/tech/20200525 What to do When You See -Repository does not have a release file- Error in Ubuntu.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What to do When You See “Repository does not have a release file” Error in Ubuntu) +[#]: via: (https://itsfoss.com/repository-does-not-have-release-file-error-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +What to do When You See “Repository does not have a release file” Error in Ubuntu +====== + +One of the [several ways of installing software in Ubuntu][1] is by using PPA or adding third-party repositories. A few magical lines give you easy access to a software or its newer version that is not available by default in [Ubuntu][2]. + +All thing looks well and good until you get habitual of adding additional third-party repositories and one day, you see an error like this while [updating Ubuntu][3]: + +**E: The repository ‘ focal Release’ does not have a Release file. +N: Updating from such a repository can’t be done securely, and is therefore disabled by default. +N: See apt-secure(8) manpage for repository creation and user configuration details.** + +In this tutorial for Ubuntu beginners, I’ll explain what does this error mean, why do you see it and what can you do to handle this error? + +### Understanding “Repository does not have a release file” error + +![][4] + +Let’s go step by step here. The error message is: + +**E: The repository ‘ focal release’ does not have a release file** + +The important part of this error message is “focal release”. + +You probably already know that [each Ubuntu release has a codename][5]. For Ubuntu 20.04, the codename is Focal Fossa. The “focal” in the error message indicates Focal Fossa which is Ubuntu 20.04. + +The error is basically telling you that though you have added a third-party repository to your system’s sources list, this new repository is not available for your current Ubuntu version. + +_**Why so? Because probably you are using a new version of Ubuntu and the developer has not made the software available for this new version.**_ + +At this point, I highly recommend reading my detailed guides on [PPA][6] and [Ubuntu repositories][7]. These two articles will give you a better, in-depth knowledge of the topic. Trust me, you won’t be disappointed. + +### How to know if the PPA/third party is available for your Ubuntu version [Optional] + +First you should [check your Ubuntu version and its codename][8] using ‘lsb_release -a’ command: + +``` +[email protected]:~$ lsb_release -a +No LSB modules are available. +Distributor ID: Ubuntu +Description: Ubuntu 20.04 LTS +Release: 20.04 +Codename: focal +``` + +As you can see, the codename it shows is focal. Now the next thing you can do is to go to the website of the software in question. + +This could be the tricky part but you can figure it out with some patience and effort. + +In the example here, the error complained about ****. It is a PPA repository and you may easily find its webpage. How, you may ask. + +Use Google or a [Google alternative search engine][9] like Duck Duck Go and search for “ppa numix”. This should give you the first result from [launchpad.net][10] which is the website used for hosting PPA related code. + +On the webpage of the PPA, you can go to the “Overview of published packages” and filter it by the codename of your Ubuntu version: + +![][11] + +For non-PPA third-party repository, you’ll have to check of the official website of the software and see if the repository is available for your Ubuntu version or not. + +### What to do if the repository is not available for your Ubuntu version + +In case when the repository in question is not available for your Ubuntu version, here’s what you can do: + + * Delete the troublesome repository from your list of repository so that you don’t see the error every time you run the update. + * Get the software from another source (if it is possible). + + + +To delete the troublesome repository, start Software & Updates tool: + +![][12] + +Go to the Other Software tab and look for the repository in question. Highlight it and then click on Remove button to delete it from your system. + +![Remove Ppa][13] + +This will [delete the PPA][14] or the repository in question. + +Next step is to get the software from some other source and that’s totally subjective. In some cases, you can still download the DEB file from the PPA website and use the software (I have explained the steps in the [PPA guide][6]). Alternatively, you can check the project’s website if there is a Snap/Flatpak or Python version of the software available. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/repository-does-not-have-release-file-error-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-remove-software-manjaro/ +[2]: https://ubuntu.com/ +[3]: https://itsfoss.com/update-ubuntu/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/Repository-does-not-have-a-release-file.png?ssl=1 +[5]: https://itsfoss.com/linux-code-names/ +[6]: https://itsfoss.com/ppa-guide/ +[7]: https://itsfoss.com/ubuntu-repositories/ +[8]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ +[9]: https://itsfoss.com/privacy-search-engines/ +[10]: https://launchpad.net/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/check-repo-version.png?ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-updates-settings-ubuntu-20-04.jpg?ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/remove-ppa.jpg?ssl=1 +[14]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/ From 0e2d9b3eb48c0916dd972ce393d92d97e24d2383 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:47:00 +0800 Subject: [PATCH 0789/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20Ubun?= =?UTF-8?q?tu=20MATE=2020.04=20LTS=20Review:=20Better=20Than=20Ever?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 Ubuntu MATE 20.04 LTS Review- Better Than Ever.md --- ...MATE 20.04 LTS Review- Better Than Ever.md | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 sources/tech/20200525 Ubuntu MATE 20.04 LTS Review- Better Than Ever.md diff --git a/sources/tech/20200525 Ubuntu MATE 20.04 LTS Review- Better Than Ever.md b/sources/tech/20200525 Ubuntu MATE 20.04 LTS Review- Better Than Ever.md new file mode 100644 index 0000000000..ad62bc57e5 --- /dev/null +++ b/sources/tech/20200525 Ubuntu MATE 20.04 LTS Review- Better Than Ever.md @@ -0,0 +1,173 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu MATE 20.04 LTS Review: Better Than Ever) +[#]: via: (https://itsfoss.com/ubuntu-mate-20-04-review/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Ubuntu MATE 20.04 LTS Review: Better Than Ever +====== + +Ubuntu MATE 20.04 LTS is undoubtedly one of the most popular [official flavors of Ubuntu][1]. + +It’s not just me, but [Ubuntu 20.04 survey results][2] also pointed out the same. Popular or not, it is indeed an impressive Linux distribution specially for older hardware. As a matter of fact, it is also one of the [best lightweight Linux distros][3] available out there. + +So, I thought of trying it out for a while in a virtual machine setting to provide you an overview of what you can expect out of it. And, whether it’s worth trying out. + +### What’s New In Ubuntu MATE 20.04 LTS? + +[Subscribe to our YouTube channel for more Linux videos][4] + +The primary highlight on Ubuntu MATE 20.04 LTS would be the addition of MATE Desktop 1.24. + +You can expect all the new features of the MATE Desktop 1.24 to come packed in with Ubuntu MATE 20.04. In addition to that, there have been many significant changes, improvements, and additions. + +Here’s an overview of what has changed in Ubuntu MATE 20.04: + + * Addition of MATE Desktop 1.24 + * Numerous visual improvements + * Dozens of bugs fixed + * Based on [Linux Kernel 5.4][5] series + * Addition of experimental [ZFS][6] support + * Addition of GameMode from [Feral Interactive][7]. + * Several package updates + + + +Now, to get a better idea on Ubuntu MATE 20.04, I’ll give you some more details. + +### User Experience Improvements + +![][8] + +Considering that more users are leaning towards Linux on Desktop, the user experience plays a vital role in that. + +If it’s something easy to use and pleasant to look at that makes all the difference as the first impression. + +With Ubuntu MATE 20.04 LTS, I wasn’t disappointed either. Personally, I’m a fan of the latest [GNOME 3.36][9]. I like it on my [Pop OS 20.04][10] but with the presence of [MATE 1.24][11], it Ubuntu MATE was also a good experience. + +You will see some significant changes to the window manager including the addition of **invisible resize borders**, **icons rendering in HiDPI**, **rework of ALT+TAB workspace switcher pop ups**, and a couple of other changes that comes as part of the latest MATE 1.24 desktop. + +![][12] + +Also, **MATE Tweak** has got some sweet improvements where you get to preserve user preferences even if you change the layout of the desktop. The new **MATE Welcome screen** also informs the user about the ability to change the desktop layout, so they don’t have to fiddle around to know about it. + +Among other things, one of my favorite additions would be the **minimized app preview feature**. + +For instance, you have an app minimized but want to get a preview of it before launching it – now you can do that by simply hovering your mouse over the taskbar as shown in the image below. + +![][13] + +Now, I must mention that it does not work as expected for every application. So, I’d still say **this feature is buggy and needs improvements**. + +### App Additions or Upgrades + +![][14] + +With MATE 20.04, you will notice a new **Firmware updater** which is a GTK frontend for [fwupd][15]. You can manage your drivers easily using the updater. + +This release also **replaces** **Thunderbird with the Evolution** email client. While [Thunderbird][16] is a quite popular desktop email client, [Evolution][17] integrates better with the MATE desktop and proves to be more useful. + +![][18] + +Considering that we have MATE 1.24 on board, you will also find a **new time and date manager app**. Not just that, if you need a magnifier, [Magnus][19] comes baked in with Ubuntu MATE 20.04. + +![][20] + +Ubuntu MATE 20.04 also includes upgrades to numerous packages/apps that come pre-installed. + +![][21] + +While these are small additions – but help in a big way to make the distro more useful. + +### Linux Kernel 5.4 + +Ubuntu MATE 20.04 ships with the last major stable kernel release of 2019 i.e [Linux Kernel 5.4][5]. + +With this, you will be getting the native [exFAT support][22] and improved hardware support as well. Not to mention, the support for [WireGuard][23] VPN is also a nice thing to have. + +So, you will be noticing numerous benefits of Linux Kernel 5.4 including the kernel lock down feature. In case you’re curious, you can read our coverage on [Linux Kernel 5.4][5] to get more details on it. + +### Adding GameMode by Feral Interactive + +Feral Interactive – popularly known for bringing games to Linux platform came up with a useful command-line tool i.e. [GameMode][7]. + +You won’t get a GUI – but using the command-line you can apply temporary system optimizations before launching a game. + +While this may not make a big difference for every system but it’s best to have more resources available for gaming and the GameMode ensures that you get the necessary optimizations. + +### Experimental ZFS Install Option + +You get the support for ZFS as your root file system. It is worth noting that it is an experimental feature and should not be used if you’re not sure what you’re doing. + +To get a better idea of ZFS, I recommend you reading one of our articles on [What is ZFS][6] by [John Paul][24]. + +### Performance & Other Improvements + +Ubuntu MATE is perfectly tailored as a lightweight distro and also something fit for modern desktops. + +![][25] + +In this case, I didn’t run any specific benchmark tools- but for an average user, I didn’t find any performance issues in my virtual machine setting. If it helps, I tested this on a host system with an i5-7400 processor with a GTX 1050 graphics card coupled with 16 Gigs of RAM. And, 7 GB of RAM + 768 MB of graphics memory + 2 cores of my processor was allocated for the virtual machine. + +![][26] + +When you test it out yourself, feel free to let me know how it was for you. + +Overall, along with all the major improvements, there are subtle changes/fixes/improvements here and there that makes Ubuntu MATE 20.04 LTS a good upgrade. + +### Should You Upgrade? + +If you are running Ubuntu MATE 19.10, you should proceed upgrading it immediately as the support for it ends in **June 2020.** + +For Ubuntu MATE 18.04 users (**supported until April 2021**) – it depends on what works for you. If you need the features of the latest release, you should choose to upgrade it immediately. + +But, if you don’t necessarily need the new stuff, you can look around for the [list of existing bugs][27] and join the [Ubuntu MATE community][28] to know more about the issues revolving the latest release. + +Once you do the research needed, you can then proceed to upgrade your system to Ubuntu MATE 20.04 LTS which will be **supported until April 2023**. + +_**Have you tried the latest Ubuntu MATE 20.04 yet? What do you think about it? Let me know your thoughts in the comments.**_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-mate-20-04-review/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/which-ubuntu-install/ +[2]: https://ubuntu.com/blog/ubuntu-20-04-survey-results +[3]: https://itsfoss.com/lightweight-linux-beginners/ +[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[5]: https://itsfoss.com/linux-kernel-5-4/ +[6]: https://itsfoss.com/what-is-zfs/ +[7]: https://github.com/FeralInteractive/gamemode +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-20-04.jpg?ssl=1 +[9]: https://itsfoss.com/gnome-3-36-release/ +[10]: https://itsfoss.com/pop-os-20-04-review/ +[11]: https://mate-desktop.org/blog/2020-02-10-mate-1-24-released/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-desktop-layout.png?ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-minimized-app.png?ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-20-04-firmware.png?ssl=1 +[15]: https://fwupd.org +[16]: https://www.thunderbird.net/en-US/ +[17]: https://wiki.gnome.org/Apps/Evolution +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-evolution.png?ssl=1 +[19]: https://kryogenix.org/code/magnus/ +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-magnus.jpg?ssl=1 +[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-apps.png?ssl=1 +[22]: https://cloudblogs.microsoft.com/opensource/2019/08/28/exfat-linux-kernel/ +[23]: https://wiki.ubuntu.com/WireGuard +[24]: https://itsfoss.com/author/john/ +[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-system-reosource.jpg?ssl=1 +[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-focal-neofetch.png?ssl=1 +[27]: https://bugs.launchpad.net/ubuntu-mate +[28]: https://ubuntu-mate.community/ From 082304afe99219d190a18f32a2f577a88118c662 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:47:26 +0800 Subject: [PATCH 0790/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200524=20Diam?= =?UTF-8?q?ond=20interface=20composition=20in=20Go=201.14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200524 Diamond interface composition in Go 1.14.md --- ...iamond interface composition in Go 1.14.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sources/tech/20200524 Diamond interface composition in Go 1.14.md diff --git a/sources/tech/20200524 Diamond interface composition in Go 1.14.md b/sources/tech/20200524 Diamond interface composition in Go 1.14.md new file mode 100644 index 0000000000..611bb2c39e --- /dev/null +++ b/sources/tech/20200524 Diamond interface composition in Go 1.14.md @@ -0,0 +1,124 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Diamond interface composition in Go 1.14) +[#]: via: (https://dave.cheney.net/2020/05/24/diamond-interface-composition-in-go-1-14) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Diamond interface composition in Go 1.14 +====== + +Per the [overlapping interfaces proposal][1], Go 1.14 now permits embedding of interfaces with overlapping method sets. This is a brief post explain what this change means: + +Let’s start with the definition of the three key interfaces from the `io` package; `io.Reader`, `io.Writer`, and `io.Closer`: + +``` +package io + +type Reader interface { + Read([]byte) (int, error) +} + +type Writer interface { + Write([]byte) (int, error) +} + +type Closer interface { + Close() error +} +``` + +Just as embedding a type inside a struct allows the embedded type’s fields and methods to be accessed as if it were declared on the embedding type[1][2], the process is true for interfaces. Thus there is no difference between explicitly declaring + +``` +type ReadCloser interface { + Read([]byte) (int, error) + Close() error +} +``` + +and using embedding to compose the interface + +``` +type ReadCloser interface { + Reader + Closer +} +``` + +You can even mix and match + +``` +type WriteCloser interface { + Write([]byte) (int, error) + Closer +} +``` + +However, prior to Go 1.14, if you continued to compose interface declarations in this manner you would likely find that something like this, + +``` +type ReadWriteCloser interface { + ReadCloser + WriterCloser +} +``` + +would fail to compile + +``` +% go build interfaces.go +command-line-arguments +./interfaces.go:27:2: duplicate method Close +``` + +Fortunately, with Go 1.14 this is no longer a limitation, thus solving problems that typically occur with diamond-shaped embedding graphs. + +However, there is a catch that I ran into attempting to demonstrate this feature to the local user group–this feature is only enabled when the Go compiler uses the 1.14 (or later) spec. + +As near as I can make out the rules for which version of the Go spec is used during compilation appear to be: + + 1. If your source code is stored inside `GOPATH` (or you have _disabled_ modules with `GO111MODULE=off`) then the version of the Go spec used to compile with matches the version of the compiler you are using. Said another way, if you have Go 1.13 installed, your Go version is 1.13. If you have Go 1.14 installed, your version is 1.14. No surprises here. + 2. If your source code is stored outside `GOPATH` (or you have forced modules on with `GO111MODULE=on`) then the `go` tool will take the Go version from the `go.mod` file. + 3. If there is no Go version listed in `go.mod` then the version of the spec will be the version of Go installed. This is identical to point 1. + 4. If you are in module mode, either by being outside `GOPATH` or with `GO111MODULE=on`, but there is no `go.mod` file in the current, or any parent, directory then the version of the Go spec used to compile your code defaults to Go 1.13. + + + +The last point caught me out. + + 1. It is said that embedding promotes the type’s fields and methods.[][3] + + + +### Related posts: + + 1. [Struct composition with Go][4] + 2. [term: low level serial with a high level interface][5] + 3. [Accidental method value][6] + 4. [How does the go build command work ?][7] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2020/05/24/diamond-interface-composition-in-go-1-14 + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://github.com/golang/proposal/blob/master/design/6977-overlapping-interfaces.md +[2]: tmp.nUQHg5BP9T#easy-footnote-bottom-1-4179 (It is said that embedding promotes the type’s fields and methods.) +[3]: tmp.nUQHg5BP9T#easy-footnote-1-4179 +[4]: https://dave.cheney.net/2015/05/22/struct-composition-with-go (Struct composition with Go) +[5]: https://dave.cheney.net/2014/05/08/term-low-level-serial-with-a-high-level-interface (term: low level serial with a high level interface) +[6]: https://dave.cheney.net/2014/05/19/accidental-method-value (Accidental method value) +[7]: https://dave.cheney.net/2013/10/15/how-does-the-go-build-command-work (How does the go build command work ?) From bfc2e73b7e593a3f39c05cb017544a25e8b1e662 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 25 May 2020 10:47:46 +0800 Subject: [PATCH 0791/1809] PRF @wxy --- ...tration of Kubernetes clusters with k9s.md | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/translated/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md b/translated/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md index 811278a001..ce71f05b26 100644 --- a/translated/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md +++ b/translated/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md @@ -1,57 +1,57 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Speed up administration of Kubernetes clusters with k9s) [#]: via: (https://opensource.com/article/20/5/kubernetes-administration) [#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) -用 k9s 加速 Kubernetes 集群管理 +k9s:你没看错,这是一个加速 k8s 集群管理的工具 ====== > 看看这个很酷的 Kubernetes 管理的终端 UI。 -![Dogs playing chess][1] +![](https://img.linux.net.cn/data/attachment/album/202005/25/104742pqjmiroc44honcs5.jpg) -通常情况下,我写的关于 Kubernetes 管理的文章中,都是做集群管理的 `kubectl` 命令。然而最近,有人给我介绍了 [k9s][2] 项目,可以让我快速查看和解决 Kubernetes 中的日常问题。这对我的工作流程有了很大的改善,我将在本教程中告诉你如何上手。  +通常情况下,我写的关于 Kubernetes 管理的文章中用的都是做集群管理的 `kubectl` 命令。然而最近,有人给我介绍了 [k9s][2] 项目,可以让我快速查看并解决 Kubernetes 中的日常问题。这极大地改善了我的工作流程,我会在这篇教程中告诉你如何上手它。  -它的安装可以在 Mac、Windows 和 Linux 中进行。每种操作系统的说明可以在这里找到[这里][2]。请务必完成安装,以便能够跟上本教程。 +它可以安装在 Mac、Windows 和 Linux 中,每种操作系统的说明可以在[这里][2]找到。请先完成安装,以便能够跟上本教程。 -我将使用 Linux 和 Minikube,这是一种在个人电脑上运行 Kubernetes 的轻量级方式。按照[此教程][3]或使用[该文档][4]来安装它。 +我会使用 Linux 和 Minikube,这是一种在个人电脑上运行 Kubernetes 的轻量级方式。按照[此教程][3]或使用[该文档][4]来安装它。 ### 设置 k9s 配置文件 -安装好 `k9s` 应用后,从帮助命令开始总是很好的。 +安装好 `k9s` 应用后,从帮助命令开始总是很好的起点。 ``` $ k9s help ``` -正如你所看到的,我们可以用 `k9s` 来配置很多功能。我们唯一需要进行的步骤就是写一个配置文件。而`info` 命令会告诉我们应用程序要在哪里找该配置文件。 +正如你在帮助信息所看到的,我们可以用 `k9s` 来配置很多功能。我们唯一需要进行的步骤就是编写配置文件。而 `info` 命令会告诉我们该应用程序要在哪里找它的配置文件。 ``` $ k9s info - ____  __.________ -|    |/ _/   __   \\______ -|      < \\____    /  ___/ -|    |  \   /    /\\___ \ -|____|__ \ /____//____  > -        \/            \/ + ____ __.________ +| |/ _/ __ \______ +| < \____ / ___/ +| | \ / /\___ \ +|____|__ \ /____//____ > + \/ \/ -Configuration:   /Users/jess/.k9s/config.yml -Logs:            /var/folders/5l/c1y1gcw97szdywgf9rk1100m0000gn/T/k9s-jess.log -Screen Dumps:    /var/folders/5l/c1y1gcw97szdywgf9rk1100m0000gn/T/k9s-screens-jess +Configuration: /Users/jess/.k9s/config.yml +Logs: /var/folders/5l/c1y1gcw97szdywgf9rk1100m0000gn/T/k9s-jess.log +Screen Dumps: /var/folders/5l/c1y1gcw97szdywgf9rk1100m0000gn/T/k9s-screens-jess ``` -如果要添加一个配置文件,该目录不存在的话就创建一个目录,然后添加一个配置文件。 +如果要添加配置文件,该配置目录不存在的话就创建它,然后添加一个配置文件。 ``` $ mkdir -p ~/.k9s/ $ touch ~/.k9s/config.yml ``` -在这篇介绍中,我们将使用 k9s 版本库中推荐的默认 `config.yml`。维护者注意,这种格式可能会有变化,所以我们可以[在这里查看][5]最新版本。 +在这篇介绍中,我们将使用 `k9s` 版本库中推荐的默认 `config.yml`。维护者请注意,这种格式可能会有变化,可以[在这里查看][5]最新版本。 ``` k9s: @@ -73,7 +73,7 @@ k9s:       namespace:         active: ""         favorites: -       - all +        - all         - kube-system         - default       view: @@ -87,7 +87,7 @@ k9s:       warn: 70 ``` -我们设置了 `k9s` 寻找本地的 minikube 配置,所以我要确认 minikube 已经上线了,就可以使用了。 +我们设置了 `k9s` 寻找本地的 minikube 配置,所以我要确认 minikube 已经上线可以使用了。 ``` $ minikube status @@ -105,26 +105,26 @@ kubeconfig: Configured $ k9s ``` -启动后,会弹出 `k9s` 基于文本的用户界面。在没有命名空间标志的情况下,它会向你显示默认命名空间中的 Pod。 +启动后,会弹出 `k9s` 的基于文本的用户界面。在没有指定命名空间标志的情况下,它会向你显示默认命名空间中的 Pod。 ![K9s screenshot][6] -如果你运行在一个有很多 Pod 的环境中,默认的视图可能会让人不知所措。或者,我们可以将注意力集中在给定的命名空间上。退出应用程序,运行 `k9s -n `,其中 ``` 是已有的命名空间。在下图中,我运行了 `k9s -n minecraft`,它显示了我的损坏的 Pod: +如果你运行在一个有很多 Pod 的环境中,默认视图可能会让人不知所措。或者,我们可以将注意力集中在给定的命名空间上。退出该应用程序,运行 `k9s -n `,其中 `` 是已存在的命名空间。在下图中,我运行了 `k9s -n minecraft`,它显示了我损坏的 Pod: ![K9s screenshot][7] 所以,一旦你有了 `k9s` 后,有很多事情你可以更快地完成。  -通过快捷键来导航 `k9s`,我们可以随时使用方向键和回车键来选择列出的项目。还有不少其他的通用快捷键来导航到不同的视图。 +通过快捷键来导航 `k9s`,我们可以随时使用方向键和回车键来选择列出的项目。还有不少其他的通用快捷键可以导航到不同的视图。 * `0`:显示在所有命名空间中的所有 Pod ![K9s screenshot][8] * `d`:描述所选的 Pod - ![K9s screenshot][9] + ![K9s screenshot][9] * `l`:显示所选的 Pod 的日志 ![Using k9s to show Kubernetes pod logs][10] -你可能会注意到 `k9s` 被设置为使用 [Vim 命令键][11],包括使用 `J` 和 `K` 键上下移动。Emacs 用户们,败退吧 :) +你可能会注意到 `k9s` 设置为使用 [Vim 命令键][11],包括使用 `J` 和 `K` 键上下移动等。Emacs 用户们,败退吧 :) ### 快速查看不同的 Kubernetes 资源 @@ -141,11 +141,11 @@ $ k9s * `:cj`:跳转到 cronjob 视图,查看集群中计划了哪些作业。 ![K9s screenshot][17] -这个应用最常用的工具是键盘;要在任何页面上往上或往下翻页,请使用方向键。如果你需要退出,记得使用 Vim 键绑定。键入 `:q`,然后按回车键离开。 +这个应用最常用的工具是键盘;要在任何页面往上或下翻页,请使用方向键。如果你需要退出,记得使用 Vim 绑定键,键入 `:q`,然后按回车键离开。 ### 用 k9s 排除 Kubernetes 的故障示例 -当出现故障的时候,`k9s` 怎么帮忙?举个例子,我让几个 Pod 由于配置错误而死机。下面你可以看到我那个可怜的 “hello” 部署死了。当我们将其高亮显示出来,可以按 `d` 运行 `describe` 命令,看看是什么原因导致了故障。 +当出现故障的时候,`k9s` 怎么帮忙?举个例子,我让几个 Pod 由于配置错误而死亡。下面你可以看到我那个可怜的 “hello” 部署死了。当我们将其高亮显示出来,可以按 `d` 运行 `describe` 命令,看看是什么原因导致了故障。 ![K9s screenshot][18] @@ -155,15 +155,15 @@ $ k9s ![K9s screenshot][20] -不幸的是,日志也没有提供任何有用的信息(可能是因为部署从未正确配置过),而且 Pod也不会出现。 +不幸的是,日志也没有提供任何有用的信息(可能是因为部署从未正确配置过),而且 Pod 也没有出现。 -然后我使用 `esc` 退了出来,我看看删除 Pod 是否能解决这个问题。要做到这一点,我高亮显示 Pod,然后使用 `ctrl-d`。幸好 `k9s` 在删除前会提示用户。  +然后我使用 `esc` 退了出来,我看看删除 Pod 是否能解决这个问题。要做到这一点,我高亮显示该 Pod,然后使用 `ctrl-d`。幸好 `k9s` 在删除前会提示用户。  ![K9s screenshot][21] -虽然我确实删除了这个 Pod,但部署资源仍然存在,所以新的 Pod 会重新出现。它还会继续重启并死掉,无论什么原因(我们还不知道)。 +虽然我确实删除了这个 Pod,但部署资源仍然存在,所以新的 Pod 会重新出现。无论什么原因(我们还不知道),它还会继续重启并死掉。 -在这里,我会重复查看日志,描述资源,甚至使用 `e` 快捷方式来编辑运行中的 Pod 以排除故障行为。在这个特殊情况下,失败的 Pod 没有配置在这个环境下运行。因此,让我们删除部署来停止崩溃接着重启的循环。 +在这里,我会重复查看日志,描述资源,甚至使用 `e` 快捷方式来编辑运行中的 Pod 以排除故障行为。在这个特殊情况下,失败的 Pod 是因为没有配置在这个环境下运行。因此,让我们删除部署来停止崩溃接着重启的循环。 我们可以通过键入 `:deploy` 并点击回车进入部署。从那里我们高亮显示并按 `ctrl-d` 来删除。 @@ -171,13 +171,13 @@ $ k9s ![K9s screenshot][23] -部署失败了! 只用了几个按键就把这个失败的部署给清理掉了。 +这个有问题的部署被干掉了! 只用了几个按键就把这个失败的部署给清理掉了。 ### k9s 是极其可定制的 -这个应用有很多自定义选项,乃至于 UI 的配色方案。这里有几个可编辑的选项,你可能会感兴趣。 +这个应用有很多自定义选项、乃至于 UI 的配色方案。这里有几个可编辑的选项,你可能会感兴趣。 -* 调整你把 `config.yml` 文件放置的位置(这样你就可以把它存储在[版本控制][24]中)。 +* 调整你放置 `config.yml` 文件的位置(这样你就可以把它存储在[版本控制][24]中)。 * 在 `alias.yml` 文件中添加[自定义别名][25]。 * 在 `hotkey.yml` 文件中创建[自定义热键][26]。 * 探索现有的[插件][27]或编写自己的插件。 @@ -186,7 +186,7 @@ $ k9s ### 用 k9s 简化你的生活 -我很容易在团队的系统上用非常人工的方式进行管理,更多的是为了锻炼脑力,而不是别的。当我第一次听说 `k9s` 的时候,我想,“这只是懒惰的 Kubernetes 而已。”于是我否定了它,回到了到处进行人工干预的状态。实际上,我在处理我的积压工作时就开始每天使用它,我觉得它的使用速度比单独使用 `kubectl` 快得多,这让我大吃一惊。现在,我已经皈依了。  +我倾向于以一种非常手动的方式来管理我团队的系统,更多的是为了锻炼脑力,而不是别的。当我第一次听说 `k9s` 的时候,我想,“这只是懒惰的 Kubernetes 而已。”于是我否定了它,然后回到了到处进行人工干预的状态。实际上,当我在处理积压工作时就开始每天使用它,而让我震惊的是它比单独使用 `kubectl` 快得多。现在,我已经皈依了。  了解你的工具并掌握做事情的“硬道理”很重要。还有一点很重要的是要记住,就管理而言,重要的是要更聪明地工作,而不是更努力。使用 `k9s`,就是我践行这个目标的方法。我想,我们可以把它叫做懒惰的 Kubernetes 管理,也没关系。 @@ -197,7 +197,7 @@ via: https://opensource.com/article/20/5/kubernetes-administration 作者:[Jessica Cherry][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fe985a1944d86cea62046c05796335ec2e2cc330 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:48:46 +0800 Subject: [PATCH 0792/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200522=20Turn?= =?UTF-8?q?=20your=20Raspberry=20Pi=20homelab=20into=20a=20network=20files?= =?UTF-8?q?ystem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200522 Turn your Raspberry Pi homelab into a network filesystem.md --- ...ry Pi homelab into a network filesystem.md | 310 ++++++++++++++++++ 1 file changed, 310 insertions(+) create mode 100644 sources/tech/20200522 Turn your Raspberry Pi homelab into a network filesystem.md diff --git a/sources/tech/20200522 Turn your Raspberry Pi homelab into a network filesystem.md b/sources/tech/20200522 Turn your Raspberry Pi homelab into a network filesystem.md new file mode 100644 index 0000000000..1880949d15 --- /dev/null +++ b/sources/tech/20200522 Turn your Raspberry Pi homelab into a network filesystem.md @@ -0,0 +1,310 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Turn your Raspberry Pi homelab into a network filesystem) +[#]: via: (https://opensource.com/article/20/5/nfs-raspberry-pi) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) + +Turn your Raspberry Pi homelab into a network filesystem +====== +Add shared filesystems to your homelab with an NFS server. +![Blue folders flying in the clouds above a city skyline][1] + +A shared filesystem is a great way to add versatility and functionality to a homelab. Having a centralized filesystem shared to the clients in the lab makes organizing data, doing backups, and sharing data considerably easier. This is especially useful for web applications load-balanced across multiple servers and for persistent volumes used by [Kubernetes][2], as it allows pods to be spun up with persistent data on any number of nodes. + +Whether your homelab is made up of ordinary computers, surplus enterprise servers, or Raspberry Pis or other single-board computers (SBCs), a shared filesystem is a useful asset, and a network filesystem (NFS) server is a great way to create one. + +I have written before about [setting up a "private cloud at home][3]," a homelab made up of Raspberry Pis or other SBCs and maybe some other consumer hardware or a desktop PC. An NFS server is an ideal way of sharing data between these components. Since most SBCs' operating systems (OSes) run off an SD card, there are some challenges. SD cards suffer from increased failures, especially when used as the OS disk for a computer, and they are not made to be constantly read from and written to. What you really need is a real hard drive: they are generally cheaper per gigabyte than SD cards, especially for larger disks, and they are less likely to sustain failures. Raspberry Pi 4's now come with USB 3.0 ports, and USB 3.0 hard drives are ubiquitous and affordable. It's a perfect match. For this project, I will use a 2TB USB 3.0 external hard drive plugged into a Raspberry Pi 4 running an NFS server. + +![Raspberry Pi with a USB hard disk][4] + +(Chris Collins, [CC BY-SA 4.0][5]) + +### Install the NFS server software + +I am running Fedora Server on a Raspberry Pi, but this project can be done with other distributions as well. To run an NFS server on Fedora, you need the nfs-utils package, and luckily it is already installed (at least in Fedora 31). You also need the rpcbind package if you are planning to run NFSv3 services, but it is not strictly required for NFSv4. + +If these packages are not already on your system, install them with the **dnf** command: + + +``` +# Intall nfs-utils and rpcbind +$ sudo dnf install nfs-utils rpcbind +``` + +Raspbian is another popular OS used with Raspberry Pis, and the setup is almost exactly the same. The package names differ, but that is about the only major difference. To install an NFS server on a system running Raspbian, you need the following packages: + + * **nfs-common:** These files are common to NFS servers and clients + * **nfs-kernel-server:** The main NFS server software package + + + +Raspbian uses **apt-get** for package management (not **dnf**, as Fedora does), so use that to install the packages: + + +``` +# For a Raspbian system, use apt-get to install the NFS packages +$ sudo apt-get install nfs-common nfs-kernel-server +``` + +### Prepare a USB hard drive as storage + +As I mentioned above, a USB hard drive is a good choice for providing storage for Raspberry Pis or other SBCs, especially because the SD card used for the OS disk image is not ideal. For your private cloud at home, you can use cheap USB 3.0 hard drives for large-scale storage. Plug the disk in and use **fdisk** to find out the device ID assigned to it, so you can work with it. + + +``` +# Find your disk using fdisk +# Unrelated disk content omitted +$ sudo fdisk -l + +Disk /dev/sda: 1.84 TiB, 2000398933504 bytes, 3907029167 sectors +Disk model: BUP Slim BK +Units: sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 512 bytes +I/O size (minimum/optimal): 512 bytes / 512 bytes +Disklabel type: dos +Disk identifier: 0xe3345ae9 + +Device     Boot Start        End    Sectors  Size Id Type +/dev/sda1        2048 3907028991 3907026944  1.8T 83 Linux +``` + +For clarity, in the example output above, I omitted all the disks except the one I'm interested in. You can see the USB disk I want to use was assigned the device **/dev/sda**, and you can see some information about the model (**Disk model: BUP Slim BK**), which helps me identify the correct disk. The disk already has a partition, and its size confirms it is the disk I am looking for. + +_Note:_ Make sure to identify the correct disk and partition for your device. It may be different than the example above. + +Each partition created on a drive gets a special universally unique identifier (UUID). The computer uses the UUID to make sure it is mounting the correct partition to the correct location using the **/etc/fstab** config file. You can retrieve the UUID of the partition using the **blkid** command: + + +``` +# Get the block device attributes for the partition +# Make sure to use the partition that applies in your case.  It may differ. +$ sudo blkid /dev/sda1 + +/dev/sda1: LABEL="backup" UUID="bd44867c-447c-4f85-8dbf-dc6b9bc65c91" TYPE="xfs" PARTUUID="e3345ae9-01" +``` + +In this case, the UUID of **/dev/sda1** is **bd44867c-447c-4f85-8dbf-dc6b9bc65c91**. Yours will be different, so make a note of it. + +### Configure the Raspberry Pi to mount this disk on startup, then mount it + +Now that you have identified the disk and partition you want to use, you need to tell the computer how to mount it, to do so whenever it boots up, and to go ahead and mount it now. Because this is a USB disk and might be unplugged, you will also configure the Raspberry Pi to not wait on boot if the disk is not plugged in or is otherwise unavailable. + +In Linux, this is done by adding the partition to the **/etc/fstab** configuration file, including where you want it to be mounted and some arguments to tell the computer how to treat it. This example will mount the partition to **/srv/nfs**, so start by creating that path: + + +``` +# Create the mountpoint for the disk partition +$ sudo mkdir -p /srv/nfs +``` + +Next, modify the **/etc/fstab** file using the following syntax format: + + +``` +`                   ` +``` + +Use the UUID you identified earlier for the disk ID. As I mentioned in the prior step, the mountpoint is **/srv/nfs**. For the filesystem type, it is usually best to select the actual filesystem, but since this will be a USB disk, use **auto**. + +For the options values, use **nosuid,nodev,nofail**. + +#### An aside about man pages: + +That said, there are a _lot_ of possible options, and the manual (man) pages are the best way to see what they are. Investigating the man page for for fstab is a good place to start: + + +``` +# Open the man page for fstab +$ man fstab +``` + +This opens the manual/documentation associated with the fstab command. In the man page, each of the options is broken down to show what it does and the common selections. For example, **The fourth field (fs_mntopts)** gives some basic information about the options that work in that field and directs you to **man (8) mount** for more in-depth description of the mount options. That makes sense, as the **/etc/fstab** file, in essence, tells the computer how to automate mounting disks, in the same way you would manually use the mount command. + +You can get more information about the options you will use from mount's man page. The numeral 8, in parentheses, indicates the man page section. In this case, section 8 is for _System Administration tools and Daemons_. + +Helpfully, you can get a list of the standard sections from the man page for **man**. + +Back to mountng the disk, take a look at **man (8) mount**: + + +``` +# Open Section 8 of the man pages for mount +$ man (8) mount +``` + +In this man page, you can examine what the options listed above do: + + * **nosuid:** Do not honor the suid/guid bit. Do not allow any files that might be on the USB disk to be executed as root. This is a good security practice. + * **nodev:** Do not interpret characters or block special devices on the file system; i.e., do not honor any device nodes that might be on the USB disk. Another good security practice. + * **nofail:** Do not log any errors if the device does not exist. This is a USB disk and might not be plugged in, so it will be ignored if that is the case. + + + +Returning to the line you are adding to the **/etc/fstab** file, there are two final options: **fs_freq** and **fs_passno**. Their values are related to somewhat legacy options, and _most_ modern systems just use a **0** for both, especially for filesystems on USB disks. The fs_freq value relates to the dump command and making dumps of the filesystem. The fs_passno value defines which filesystems to **fsck** on boot and their order. If it's set, usually the root partition would be **1** and any other filesystems would be **2**. Set the value to **0** to skip using **fsck** on this partition. + +In your preferred editor, open the **/etc/fstab** file and add the entry for the partition on the USB disk, replacing the values here with those gathered in the previous steps. + + +``` +# With sudo, or as root, add the partition info to the /etc/fstab file +UUID="bd44867c-447c-4f85-8dbf-dc6b9bc65c91"    /srv/nfs    auto    nosuid,nodev,nofail,noatime 0 0 +``` + +### Enable and start the NFS server + +With the packages installed and the partition added to your **/etc/fstab** file, you can now go ahead and start the NFS server. On a Fedora system, you need to enable and start two services: **rpcbind** and **nfs-server**. Use the **systemctl** command to accomplish this: + + +``` +# Start NFS server and rpcbind +$ sudo systemctl enable rpcbind.service +$ sudo systemctl enable nfs-server.service +$ sudo systemctl start rpcbind.service +$ sudo systemctl start nfs-server.service +``` + +On Raspbian or other Debian-based distributions, you just need to enable and start the **nfs-kernel-server** service using the **systemctl** command the same way as above. + +#### RPCBind + +The rpcbind utility is used to map remote procedure call (RPC) services to ports on which they listen. According to the rpcbind man page: + +> "When an RPC service is started, it tells rpcbind the address at which it is listening, and the RPC program numbers it is prepared to serve. When a client wishes to make an RPC call to a given program number, it first contacts rpcbind on the server machine to determine the address where RPC requests should be sent." + +In the case of an NFS server, rpcbind maps the protocol number for NFS to the port on which the NFS server is listening. However, NFSv4 does not require the use of rpcbind. If you use _only_ NFSv4 (by removing versions two and three from the configuration), rpcbind is not required. I've included it here for backward compatibility with NFSv3. + +### Export the mounted filesystem + +The NFS server decides which filesystems are shared with (exported to) which remote clients based on another configuration file, **/etc/exports**. This file is just a map of host internet protocol (IP) addresses (or subnets) to the filesystems to be shared and some options (read-only or read-write, root squash, etc.). The format of the file is: + + +``` +`     (options)` +``` + +In this example, you will export the partition mounted to **/srv/nfs**. This is the "directory" piece. + +The second part, the host or hosts, includes the hosts you want to export this partition to. These can be specified as a single host with a fully qualified domain name or hostname, the IP address of the host, a number of hosts using wildcard characters to match domains (e.g., *.example.org), IP networks (e.g., classless inter-domain routing, or CIDR, notation), or netgroups. + +The third piece includes options to apply to the export: + + * **ro/rw:** Export the filesystem as read only or read write + * **wdelay:** Delay writes to the disk if another write is imminent to improve performance (this is _probably_ not as useful with a solid-state USB disk, if that is what you are using) + * **root_squash:** Prevent any root users on the client from having root access on the host, and set the root UID to **nfsnobody** as a security precaution + + + +Test exporting the partition you have mouted at **/srv/nfs** to a single client—for example, a laptop. Identify your client's IP address (my laptop's is **192.168.2.64**, but yours will likely be different). You could share it to a large subnet, but for testing, limit it to the single IP address. The CIDR notation for just this IP is **192.168.2.64/32**; a **/32** subnet is just a single IP. + +Using your preferred editor, edit the **/etc/exports** file with your directory, host CIDR, and the **rw** and **root_squash** options: + + +``` +# Edit your /etc/exports file like so, substituting the information from your systems +/srv/nfs    192.168.2.64/32(rw,root_squash) +``` + +_Note:_ If you copied the **/etc/exports** file from another location or otherwise overwrote the original with a copy, you may need to restore the SELinux context for the file. You can do this with the **restorecon** command: + + +``` +# Restore the SELinux context of the /etc/exports file +$ sudo restorecon /etc/exports +``` + +Once this is done, restart the NFS server to pick up the changes to the **/etc/exports** file: + + +``` +# Restart the nfs server +$ sudo systemctl restart nfs-server.service +``` + +### Open the firewall for the NFS service + +Some systems, by default, do not run a [firewall service][6]. Raspbian, for example, defaults to open iptables rules, with ports opened by different services immediately available from outside the machine. Fedora server, by contrast, runs the firewalld service by default, so you must open the port for the NFS server (and rpcbind, if you will be using NFSv3). You can do this with the **firewall-cmd** command. + +Check the zones used by firewalld and get the default zone. For Fedora Server, this will be the FedoraServer zone: + + +``` +# List the zones +# Output omitted for brevity +$ sudo firewall-cmd --list-all-zones + +# Retrieve just the default zone info +# Make a note of the default zone +$ sudo firewall-cmd --get-default-zone + +# Permanently add the nfs service to the list of allowed ports +$ sudo firewall-cmd --add-service=nfs --permanent + +# For NFSv3, we need to add a few more ports, nfsv3, rpc-mountd, rpc-bind +$ sudo firewall-cmd --add-service=(nfs3,mountd,rpc-bind) + +# Check the services for the zone, substituting the default zone in use by your system +$ sudo firewall-cmd --list-services --zone=FedoraServer + +# If all looks good, reload firewalld +$ sudo firewall-cmd --reload +``` + +And with that, you have successfully configured the NFS server with your mounted USB disk partition and exported it to your test system for sharing. Now you can test mounting it on the system you added to the exports list. + +### Test the NFS exports + +First, from the NFS server, create a file to read in the **/srv/nfs** directory: + + +``` +# Create a test file to share +echo "Can you see this?" >> /srv/nfs/nfs_test +``` + +Now, on the client system you added to the exports list, first make sure the NFS client packages are installed. On Fedora systems, this is the **nfs-utils** package and can be installed with **dnf**. Raspbian systems have the **libnfs-utils** package that can be installed with **apt-get**. + +Install the NFS client packages: + + +``` +# Install the nfs-utils package with dnf +$ sudo dnf install nfs-utils +``` + +Once the client package is installed, you can test out the NFS export. Again on the client, use the mount command with the IP of the NFS server and the path to the export, and mount it to a location on the client, which for this test is the **/mnt** directory. In this example, my NFS server's IP is **192.168.2.109**, but yours will likely be different: + + +``` +# Mount the export from the NFS server to the client host +# Make sure to substitute the information for your own hosts +$ sudo mount 192.168.2.109:/srv/nfs /mnt + +# See if the nfs_test file is visible: +$ cat /mnt/nfs_test +Can you see this? +``` + +Success! You now have a working NFS server for your homelab, ready to share files with multiple hosts, allow multi-read/write access, and provide centralized storage and backups for your data. There are many options for shared storage for homelabs, but NFS is venerable, efficient, and a great option to add to your "private cloud at home" homelab. Future articles in this series will expand on how to automatically mount NFS shares on clients and how to use NFS as a storage class for Kubernetes Persistent Volumes. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/nfs-raspberry-pi + +作者:[Chris Collins][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clcollins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_cloud21x_cc.png?itok=5UwC92dO (Blue folders flying in the clouds above a city skyline) +[2]: https://opensource.com/resources/what-is-kubernetes +[3]: https://opensource.com/article/20/5/disk-image-raspberry-pi +[4]: https://opensource.com/sites/default/files/uploads/raspberrypi_with_hard-disk.jpg (Raspberry Pi with a USB hard disk) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/article/18/9/linux-iptables-firewalld From 9e5006889aa4a9ce01cd5c177c853ada99936c4a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:49:11 +0800 Subject: [PATCH 0793/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200522=20Fast?= =?UTF-8?q?=20data=20modeling=20with=20JavaScript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200522 Fast data modeling with JavaScript.md --- ...0522 Fast data modeling with JavaScript.md | 452 ++++++++++++++++++ 1 file changed, 452 insertions(+) create mode 100644 sources/tech/20200522 Fast data modeling with JavaScript.md diff --git a/sources/tech/20200522 Fast data modeling with JavaScript.md b/sources/tech/20200522 Fast data modeling with JavaScript.md new file mode 100644 index 0000000000..9c565d6e90 --- /dev/null +++ b/sources/tech/20200522 Fast data modeling with JavaScript.md @@ -0,0 +1,452 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fast data modeling with JavaScript) +[#]: via: (https://opensource.com/article/20/5/data-modeling-javascript) +[#]: author: (Szymon https://opensource.com/users/schodevio) + +Fast data modeling with JavaScript +====== +This tutorial showcases a method to model data in just a few minutes. +![Analytics: Charts and Graphs][1] + +As a backend developer at the [Railwaymen][2], a software house in Kraków, Poland, some of my tasks rely on models that manipulate and customize data retrieved from a database. When I wanted to improve my skills in frontend frameworks, I [chose Vue][3], and I thought it would be good to have a similar way to model data in a store. I started with some libraries that I found through [NPM][4], but they offered many more features than I needed. + +So I decided to build my own solution, and I was very surprised that the base took less than 15 lines of code and is very flexible. I implemented this solution in an open source application which I developed and called [Evally][5] - a web app that helps businesses keep track of their employees' performance reviews and professional development. It reminds managers or HR representatives about employees' upcoming evaluations and gathers all of the data needed to assess their performance in the fairest way. + +### Model and list + +The only things you need to do are to create a class and use the defaultsDeep function in the [Lodash][6] JavaScript library: + + +``` +`_.defaultsDeep(object, [sources])` +``` + +Arguments: + + * `object (Object)`: The destination object + * `[sources] (...Object)`: The source objects + + + +Returns: + + * `(Object)`: Returns object + + + +This helper function: [Lodash Docs][7] + +> "Assigns recursively own and inherited enumerable string keyed properties of source objects to the destination object for all destination properties that resolve to undefined. Source objects are applied from left to right. Once a property is set, additional values of the same property are ignored." + +For example: + + +``` +_.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }) + // => { 'a': { 'b': 2, 'c': 3 } } +``` + +That's all! To try it out, create a file called **base.js** and import the defaultsDeep function from the Lodash package: + + +``` + // base.js + import defaultsDeep from "lodash/defaultsDeep"; +``` + +Next, create and export the Model class, where constructor will use the Lodash helper function to assign values to all passed attributes and initialize the attributes that were not received with default values: + + +``` + // base.js + // ... + + export class Model { +   constructor(attributes = {}) { +     defaultsDeep(this, attributes, this.defaults); +   } + } +``` + +Now, create your first real model, Employee, with attributes for firstName, lastName, position and hiredAt where "position" defines "Programmer" as the default value: + + +``` + // employee.js + import { Model } from "./base.js"; + + export class Employee extends Model { +   get defaults() { +     return { +       firstName: "", +       lastName: "", +       position: "Programmer", +       hiredAt: "" +     }; +   } + } +``` + +Next, begin creating employees: + + +``` +// app.js + import { Employee } from "./employee.js"; + + const programmer = new Employee({ +   firstName: "Will", +   lastName: "Smith" + }); + + // => Employee { + //   firstName: "Will", + //   lastName: "Smith", + //   position: "Programmer", + //   hiredAt: "", + //   constructor: Object + // } + + const techLeader = new Employee({ +   firstName: "Charles", +   lastName: "Bartowski", +   position: "Tech Leader" + }); + + // => Employee { + //   firstName: "Charles", + //   lastName: "Bartowski", + //   position: "Tech Leader", + //   hiredAt: "", + //   constructor: Object + // } +``` + +You have two employees, and the first one's position is assigned from the defaults. Here's how multiple employees can be defined: + + +``` + // base.js + + // ... + + export class List { +   constructor(items = []) { +     this.models = items.map(item => new this.model(item)); +   } + } + +[/code] [code] + + // employee.js + import { Model, List } from "./base.js"; + + // … + + export class EmployeesList extends List { +   get model() { +     return Employee; +   } + } +``` + +The List class constructor maps an array of received items into an array of desired models. The only requirement is to provide a correct model class name: + + +``` + // app.js + import { Employee, EmployeesList } from "./employee.js"; + + // … + + const employees = new EmployeesList([ +   { +     firstName: "Will", +     lastName: "Smith" +   }, +   { +     firstName: "Charles", +     lastName: "Bartowski", +     position: "Tech Leader" +   } + ]); + + // => EmployeesList {models: Array[2], constructor: Object} + //  models: Array[2] + //   0: Employee + //     firstName: "Will" + //     lastName: "Smith" + //     position: "Programmer" + //     hiredAt: "" + //     <constructor>: "Employee" + //   1: Employee + //     firstName: "Charles" + //     lastName: "Bartowski" + //     position: "Tech Leader" + //     hiredAt: "" + //     <constructor>: "Employee" + //   <constructor>: "EmployeesList" +``` + +### Ways to use this approach + +This simple solution allows you to keep your data structure in one place and avoid code repetition. The [DRY][8] principle rocks! You can also customize your models as needed, such as in the following examples. + +#### Custom getters + +Do you need one attribute to be dependent on the others? No problem; you can do this by improving your Employee model: + + +``` +// employee.js + import { Model } from "./base.js"; + + export class Employee extends Model { +   get defaults() { +     return { +       firstName: "", +       lastName: "", +       position: "Programmer", +       hiredAt: "" +     }; +   } + +   get fullName() { +     return [this.firstName, this.lastName].join(' ') +   } + + } + +[/code] [code] + +// app.js + import { Employee, EmployeesList } from "./employee.js"; + + // … + + console.log(techLeader.fullName); + // => Charles Bartowski +``` + +Now you don't have to repeat the code to do something as simple as displaying the employee's full name. + +#### Date formatting + +Model is a good place to define other formats for given attributes. The best examples are dates: + + +``` +// employee.js + import { Model } from "./base.js"; + import moment from 'moment'; + + export class Employee extends Model { +   get defaults() { +     return { +       firstName: "", +       lastName: "", +       position: "Programmer", +       hiredAt: "" +     }; +   } + +   get formattedHiredDate() { +     if (!this.hiredAt) return "---"; + +     return moment(this.hiredAt).format('MMMM DD, YYYY'); +   } + } + +[/code] [code] + +// app.js + import { Employee, EmployeesList } from "./employee.js"; + + // … + + techLeader.hiredAt = "2020-05-01"; + + console.log(techLeader.formattedHiredDate); + // => May 01, 2020 +``` + +Another case related to dates (which I discovered developing the Evally app) is the ability to operate with different date formats. Here's an example that uses datepicker: + + 1. All employees fetched from the database have the hiredAt date in the format: +YEAR-MONTH-DAY, e.g., 2020-05-01 + 2. You need to display the hiredAt date in a more friendly format: +MONTH DAY, YEAR, e.g., May 01, 2020 + 3. A datepicker uses the format: +DAY-MONTH-YEAR, e.g., 01-05-2020 + + + +Resolve this issue with: + + +``` +// employee.js + import { Model } from "./base.js"; + import moment from 'moment'; + + export class Employee extends Model { + +   // … + +   get formattedHiredDate() { +     if (!this.hiredAt) return "---"; + +     return moment(this.hiredAt).format('MMMM DD, YYYY'); +   } + +   get hiredDate() { +     return ( +       this.hiredAt +         ? moment(this.hiredAt).format('DD-MM-YYYY') +         : '' +     ); +   } + +   set hiredDate(date) { +     const mDate = moment(date, 'DD-MM-YYYY'); +  +     this.hiredAt = ( +       mDate.isValid() +         ? mDate.format('YYYY-MM-DD') +         : '' +     ); +   } + } +``` + +This adds getter and setter functions to handle datepicker's functionality. + + +``` + // Get date from server + techLeader.hiredAt = '2020-05-01'; + console.log(techLeader.formattedHiredDate); + // => May 01, 2020 + + // Datepicker gets date + console.log(techLeader.hiredDate); + // => 01-05-2020 + + // Datepicker sets new date + techLeader.hiredDate = '15-06-2020'; + + // Display new date + console.log(techLeader.formattedHiredDate); + // => June 15, 2020 +``` + +This makes it very simple to manage multiple date formats. + +#### Storage for model-related information + +Another use for a model class is storing general information related to the model, like paths for routing: + + +``` +// employee.js + import { Model } from "./base.js"; + import moment from 'moment'; + + export class Employee extends Model { + +   // … + +   static get routes() { +     return { +       employeesPath: '/api/v1/employees', +       employeePath: id => `/api/v1/employees/${id}` +     } +   } + + } + +[/code] [code] + + // Path for POST requests + console.log(Employee.routes.employeesPath) + + // Path for GET request + console.log(Employee.routes.employeePath(1)) +``` + +### Customize the list of models + +Don't forget about the List class, which you can customize as needed: + + +``` +// employee.js + import { Model, List } from "./base.js"; + + // … + + export class EmployeesList extends List { +   get model() { +     return Employee; +   } + +   findByFirstName(val) { +     return this.models.find(item => item.firstName === val); +   } + +   filterByPosition(val) { +     return this.models.filter(item => item.position === val); +   } + } + +[/code] [code] + + console.log(employees.findByFirstName('Will')) + // => Employee { + //   firstName: "Will", + //   lastName: "Smith", + //   position: "Programmer", + //   hiredAt: "", + //   constructor: Object + // } + + console.log(employees.filterByPosition('Tech Leader')) + // => [Employee] + //     0: Employee + //       firstName: "Charles" + //       lastName: "Bartowski" + //       position: "Tech Leader" + //       hiredAt: "" + //       <constructor>: "Employee" +``` + +### Summary + +This simple structure for data modeling in JavaScript should save you some development time. You can add new functions whenever you need them to keep your code cleaner and easier to maintain. All of this code is available in my [CodeSandbox][9], so try it out and let me know how it goes by leaving a comment below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/data-modeling-javascript + +作者:[Szymon][a] +选题:[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/schodevio +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/analytics-graphs-charts.png?itok=sersoqbV (Analytics: Charts and Graphs) +[2]: https://railwaymen.org/ +[3]: https://blog.railwaymen.org/vue-vs-react-which-one-is-better-for-your-app-similarities-differences +[4]: https://www.npmjs.com/ +[5]: https://github.com/railwaymen/evally +[6]: https://lodash.com/ +[7]: https://lodash.com/docs/4.17.15 +[8]: https://en.wikipedia.org/wiki/Don%27t_repeat_yourself +[9]: https://codesandbox.io/s/02jsdatamodels-1mhtb From 997550f2cdd3b4c257049a81661ee38dac63280c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:49:28 +0800 Subject: [PATCH 0794/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200522=20A=20?= =?UTF-8?q?beginner's=20guide=20to=20web=20scraping=20with=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200522 A beginner-s guide to web scraping with Python.md --- ...ner-s guide to web scraping with Python.md | 493 ++++++++++++++++++ 1 file changed, 493 insertions(+) create mode 100644 sources/tech/20200522 A beginner-s guide to web scraping with Python.md diff --git a/sources/tech/20200522 A beginner-s guide to web scraping with Python.md b/sources/tech/20200522 A beginner-s guide to web scraping with Python.md new file mode 100644 index 0000000000..010744161b --- /dev/null +++ b/sources/tech/20200522 A beginner-s guide to web scraping with Python.md @@ -0,0 +1,493 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A beginner's guide to web scraping with Python) +[#]: via: (https://opensource.com/article/20/5/web-scraping-python) +[#]: author: (Julia Piaskowski https://opensource.com/users/julia-piaskowski) + +A beginner's guide to web scraping with Python +====== +Get some hands-on experience with essential Python tools to scrape +complete HTML sites. +![HTML code][1] + +There are plenty of great books to help you learn Python, but who actually reads these A to Z? (Spoiler: not me). + +Many people find instructional books useful, but I do not typically learn by reading a book front to back. I learn by doing a project, struggling, figuring some things out, and then reading another book. So, throw away your book (for now), and let's learn some Python. + +What follows is a guide to my first scraping project in Python. It is very low on assumed knowledge in Python and HTML. This is intended to illustrate how to access web page content with Python library [requests][2] and parse the content using [BeatifulSoup4][3], as well as JSON and [pandas][4]. I will briefly introduce [Selenium][5], but I will not delve deeply into how to use that library—that topic deserves its own tutorial. Ultimately I hope to show you some tricks and tips to make web scraping less overwhelming. + +### Installing our dependencies + +All the resources from this guide are available at my [GitHub repo][6]. If you need help installing Python 3, check out the tutorials for [Linux][7], [Windows][8], and [Mac][9]. + + +``` +$ python3 -m venv +$ source venv/bin/activate +$ pip install requests bs4 pandas +``` + +If you like using JupyterLab, you can run all the code using this [notebook][10]. There are a lot of ways to [install JupyterLab][11], and this is one of them: + + +``` +# from the same virtual environment as above, run: +$ pip install jupyterlab +``` + +### Setting a goal for our web scraping project + +Now we have our dependencies installed, but what does it take to scrape a webpage?  + +Let's take a step back and be sure to clarify our goal. Here is my list of requirements for a successful web scraping project. + + * We are gathering information that is worth the effort it takes to build a working web scraper. + * We are downloading information that can be legally and ethically gathered by a web scraper. + * We have some knowledge of how to find the target information in HTML code. + * We have the right tools: in this case, it's the libraries **BeautifulSoup** and **requests**. + * We know (or are willing to learn) how to parse JSON objects. + * We have enough data skills to use **pandas**. + + + +A comment on HTML: While HTML is the beast that runs the Internet, what we mostly need to understand is how tags work. A tag is a collection of information sandwiched between angle-bracket enclosed labels. For example, here is a pretend tag, called "pro-tip": + + +``` +<pro-tip> All you need to know about html is how tags work </pro-tip> +``` + +We can access the information in there ("All you need to know…") by calling its tag "pro-tip." How to find and access a tag will be addressed further in this tutorial. For more of a look at HTML basics, check out [this article][12]. + +### What to look for in a web scraping project + +Some goals for gathering data are more suited for web scraping than others. My guidelines for what qualifies as a good project are as follows. + +There is no public API available for the data. It would be much easier to capture structured data through an API, and it would help clarify both the legality and ethics of gathering the data. There needs to be a sizable amount of structured data with a regular, repeatable format to justify this effort. Web scraping can be a pain. BeautifulSoup (bs4) makes this easier, but there is no avoiding the individual idiosyncrasies of websites that will require customization. Identical formatting of the data is not required, but it does make things easier. The more "edge cases" (departures from the norm) present, the more complicated the scraping will be. + +Disclaimer: I have zero legal training; the following is not intended to be formal legal advice. + +On the note of legality, accessing vast troves of information can be intoxicating, but just because it's possible doesn't mean it should be done. + +There is, thankfully, public information that can guide our morals and our web scrapers. Most websites have a [robots.txt][13] file associated with the site, indicating which scraping activities are permitted and which are not. It's largely there for interacting with search engines (the ultimate web scrapers). However, much of the information on websites is considered public information. As such, some consider the robots.txt file as a set of recommendations rather than a legally binding document. The robots.txt file does not address topics such as ethical gathering and usage of the data. + +Questions I ask myself before beginning a scraping project: + + * Am I scraping copyrighted material? + * Will my scraping activity compromise individual privacy? + * Am I making a large number of requests that may overload or damage a server? + * Is it possible the scraping will expose intellectual property I do not own? + * Are there terms of service governing use of the website, and am I following those? + * Will my scraping activities diminish the value of the original data? (for example, do I plan to repackage the data as-is and perhaps siphon off website traffic from the original source)? + + + +When I scrape a site, I make sure I can answer "no" to all of those questions. + +For a deeper look at the legal concerns, see the 2018 publications [Legality and Ethics of Web Scraping by Krotov and Silva][14] and [Twenty Years of Web Scraping and the Computer Fraud and Abuse Act by Sellars][15]. + +### Now it's time to scrape! + +After assessing the above, I came up with a project. My goal was to extract addresses for all Family Dollar stores in Idaho. These stores have an outsized presence in rural areas, so I wanted to understand how many there are in a rather rural state. + +The starting point is the [location page for Family Dollar][16]. + +![Family Dollar Idaho locations page][17] + +To begin, let's load up our prerequisites in our Python virtual environment. The code from here is meant to be added to a Python file (_scraper.py_ if you're looking for a name) or be run in a cell in JupyterLab. + + +``` +import requests # for making standard html requests +from bs4 import BeautifulSoup # magical tool for parsing html data +import json # for parsing data +from pandas import DataFrame as df # premier library for data organization +``` + +Next, we request data from our target URL. + + +``` +page = requests.get("") +soup = BeautifulSoup(page.text, 'html.parser') +``` + +BeautifulSoup will take HTML or XML content and transform it into a complex tree of objects. Here are several common object types that we will use. + + * **BeautifulSoup**—the parsed content + * **Tag**—a standard HTML tag, the main type of bs4 element you will encounter + * **NavigableString**—a string of text within a tag + * **Comment**—a special type of NavigableString + + + +There is more to consider when we look at **requests.get()** output. I've only used **page.text()** to translate the requested page into something readable, but there are other output types: + + * **page.text()** for text (most common) + * **page.content()** for byte-by-byte output + * **page.json()** for JSON objects + * **page.raw()** for the raw socket response (no thank you) + + + +I have only worked on English-only sites using the Latin alphabet. The default encoding settings in **requests** have worked fine for that. However, there is a rich internet world beyond English-only sites. To ensure that **requests** correctly parses the content, you can set the encoding for the text: + + +``` +page = requests.get(URL) +page.encoding = 'ISO-885901' +soup = BeautifulSoup(page.text, 'html.parser') +``` + +Taking a closer look at BeautifulSoup tags, we see: + + * The bs4 element **tag** is capturing an HTML tag + * It has both a name and attributes that can be accessed like a dictionary: **tag['someAttribute']** + * If a tag has multiple attributes with the same name, only the first instance is accessed. + * A tag's children are accessed via **tag.contents**. + * All tag descendants can be accessed with **tag.contents**. + * You can always access the full contents as a string with: **re.compile("your_string")** instead of navigating the HTML tree. + + + +### Determine how to extract relevant content + +Warning: this process can be frustrating. + +Extraction during web scraping can be a daunting process filled with missteps. I think the best way to approach this is to start with one representative example and then scale up (this principle is true for any programming task). Viewing the page's HTML source code is essential. There are a number of ways to do this. + +You can view the entire source code of a page using Python in your terminal (not recommended). Run this code at your own risk: + + +``` +print(soup.prettify()) +``` + +While printing out the entire source code for a page might work for a toy example shown in some tutorials, most modern websites have a massive amount of content on any one of their pages. Even the 404 page is likely to be filled with code for headers, footers, and so on. + +It is usually easiest to browse the source code via **View Page Source** in your favorite browser (right-click, then select "view page source"). That is the most reliable way to find your target content (I will explain why in a moment). + +![Family Dollar page source code][18] + +  + +In this instance, I need to find my target content—an address, city, state, and zip code—in this vast HTML ocean. Often, a simple search of the page source (**ctrl + F**) will yield the section where my target location is located. Once I can actually see an example of my target content (the address for at least one store), I look for an attribute or tag that sets this content apart from the rest. + +It would appear that first, I need to collect web addresses for different cities in Idaho with Family Dollar stores and visit those websites to get the address information. These web addresses all appear to be enclosed in a **href** tag. Great! I will try searching for that using the **find_all** command: + + +``` +dollar_tree_list = soup.find_all('href') +dollar_tree_list +``` + +Searching for **href** did not yield anything, darn. This might have failed because **href** is nested inside the class **itemlist**. For the next attempt, search on **item_list**. Because "class" is a reserved word in Python, **class_** is used instead. The bs4 function **soup.find_all()** turned out to be the Swiss army knife of bs4 functions. + + +``` +dollar_tree_list = soup.find_all(class_ = 'itemlist') +for i in dollar_tree_list[:2]: +  print(i) +``` + +Anecdotally, I found that searching for a specific class was often a successful approach. We can learn more about the object by finding out its type and length. + + +``` +type(dollar_tree_list) +len(dollar_tree_list) +``` + +The content from this BeautifulSoup "ResultSet" can be extracted using **.contents**. This is also a good time to create a single representative example. + + +``` +example = dollar_tree_list[2] # a representative example +example_content = example.contents +print(example_content) +``` + +Use **.attr** to find what attributes are present in the contents of this object. Note: **.contents** usually returns a list of exactly one item, so the first step is to index that item using the bracket notation. + + +``` +example_content = example.contents[0] +example_content.attrs +``` + +Now that I can see that **href** is an attribute, that can be extracted like a dictionary item: + + +``` +example_href = example_content['href'] +print(example_href) +``` + +### Putting together our web scraper + +All that exploration has given us a path forward. Here's the cleaned-up version of the logic we figured out above. + + +``` +city_hrefs = [] # initialise empty list + +for i in dollar_tree_list: +    cont = i.contents[0] +    href = cont['href'] +    city_hrefs.append(href) + +#  check to be sure all went well +for i in city_hrefs[:2]: +  print(i) +``` + +The output is a list of URLs of Family Dollar stores in Idaho to scrape. + +That said, I still don't have address information! Now, each city URL needs to be scraped to get this information. So we restart the process, using a single, representative example. + + +``` +page2 = requests.get(city_hrefs[2]) # again establish a representative example +soup2 = BeautifulSoup(page2.text, 'html.parser') +``` + +![Family Dollar map and code][19] + +The address information is nested within **type= "application/ld+json"**. After doing a lot of geolocation scraping, I've come to recognize this as a common structure for storing address information. Fortunately, **soup.find_all()** also enables searching on **type**. + + +``` +arco = soup2.find_all(type="application/ld+json") +print(arco[1]) +``` + +The address information is in the second list member! Finally! + +I extracted the contents (from the second list item) using **.contents** (this is a good default action after filtering the soup). Again, since the output of contents is a list of one, I indexed that list item: + + +``` +arco_contents = arco[1].contents[0] +arco_contents +``` + +Wow, looking good. The format presented here is consistent with the JSON format (also, the type did have "**json**" in its name). A JSON object can act like a dictionary with nested dictionaries inside. It's actually a nice format to work with once you become familiar with it (and it's certainly much easier to program than a long series of RegEx commands). Although this structurally looks like a JSON object, it is still a bs4 object and needs a formal programmatic conversion to JSON to be accessed as a JSON object: + + +``` +arco_json =  json.loads(arco_contents) + +[/code] [code] + +type(arco_json) +print(arco_json) +``` + +In that content is a key called **address** that has the desired address information in the smaller nested dictionary. This can be retrieved thusly: + + +``` +arco_address = arco_json['address'] +arco_address +``` + +Okay, we're serious this time. Now I can iterate over the list store URLs in Idaho: + + +``` +locs_dict = [] # initialise empty list + +for link in city_hrefs: +  locpage = requests.get(link)   # request page info +  locsoup = BeautifulSoup(locpage.text, 'html.parser') +      # parse the page's content +  locinfo = locsoup.find_all(type="application/ld+json") +      # extract specific element +  loccont = locinfo[1].contents[0]   +      # get contents from the bs4 element set +  locjson = json.loads(loccont)  # convert to json +  locaddr = locjson['address'] # get address +  locs_dict.append(locaddr) # add address to list +``` + +### Cleaning our web scraping results with pandas + +We have loads of data in a dictionary, but we have some additional crud that will make reusing our data more complex than it needs to be. To do some final data organization steps, we convert to a pandas data frame, drop the unneeded columns "**@type**" and "**country**"), and check the top five rows to ensure that everything looks alright. + + +``` +locs_df = df.from_records(locs_dict) +locs_df.drop(['@type', 'addressCountry'], axis = 1, inplace = True) +locs_df.head(n = 5) +``` + +Make sure to save results!! + + +``` +df.to_csv(locs_df, "family_dollar_ID_locations.csv", sep = ",", index = False) +``` + +We did it! There is a comma-separated list of all the Idaho Family Dollar stores. What a wild ride. + +### A few words on Selenium and data scraping + +[Selenium][5] is a common utility for automatic interaction with a webpage. To explain why it's essential to use at times, let's go through an example using Walgreens' website. **Inspect Element** provides the code for what is displayed in a browser: + +![Walgreens location page and code][20] + +  + +While **View Page Source** provides the code for what **requests** will obtain: + +![Walgreens source code][21] + +When these two don't agree, there are plugins modifying the source code—so, it should be accessed after the page has loaded in a browser. **requests** cannot do that, but **Selenium** can. + +Selenium requires a web driver to retrieve the content. It actually opens a web browser, and this page content is collected. Selenium is powerful—it can interact with loaded content in many ways (read the documentation). After getting data with **Selenium**, continue to use **BeautifulSoup** as before: + + +``` +url = "[https://www.walgreens.com/storelistings/storesbycity.jsp?requestType=locator\&state=ID][22]" +driver = webdriver.Firefox(executable_path = 'mypath/geckodriver.exe') +driver.get(url) +soup_ID = BeautifulSoup(driver.page_source, 'html.parser') +store_link_soup = soup_ID.find_all(class_ = 'col-xl-4 col-lg-4 col-md-4') +``` + +I didn't need Selenium in the case of Family Dollar, but I do keep it on hand for those times when rendered content differs from source code. + +### Wrapping up + +In conclusion, when using web scraping to accomplish a meaningful task: + + * Be patient + * Consult the manuals (these are very helpful) + + + +If you are curious about the answer: + +![Family Dollar locations map][23] + +There are many many Family Dollar stores in America. + +The complete source code is: + + +``` +import requests +from bs4 import BeautifulSoup +import json +from pandas import DataFrame as df + +page = requests.get("") +soup = BeautifulSoup(page.text, 'html.parser') + +# find all state links +state_list = soup.find_all(class_ = 'itemlist') + +state_links = [] + +for i in state_list: +    cont = i.contents[0] +    attr = cont.attrs +    hrefs = attr['href'] +    state_links.append(hrefs) + +# find all city links +city_links = [] + +for link in state_links: +    page = requests.get(link) +    soup = BeautifulSoup(page.text, 'html.parser') +    familydollar_list = soup.find_all(class_ = 'itemlist') +    for store in familydollar_list: +        cont = store.contents[0] +        attr = cont.attrs +        city_hrefs = attr['href'] +        city_links.append(city_hrefs) +# to get individual store links +store_links = [] + +for link in city_links: +    locpage = requests.get(link) +    locsoup = BeautifulSoup(locpage.text, 'html.parser') +    locinfo = locsoup.find_all(type="application/ld+json") +    for i in locinfo: +        loccont = i.contents[0] +        locjson = json.loads(loccont) +        try: +            store_url = locjson['url'] +            store_links.append(store_url) +        except: +            pass + +# get address and geolocation information +stores = [] + +for store in store_links: +    storepage = requests.get(store) +    storesoup = BeautifulSoup(storepage.text, 'html.parser') +    storeinfo = storesoup.find_all(type="application/ld+json") +    for i in storeinfo: +        storecont = i.contents[0] +        storejson = json.loads(storecont) +        try: +            store_addr = storejson['address'] +            store_addr.update(storejson['geo']) +            stores.append(store_addr) +        except: +            pass + +# final data parsing +stores_df = df.from_records(stores) +stores_df.drop(['@type', 'addressCountry'], axis = 1, inplace = True) +stores_df['Store'] = "Family Dollar" + +df.to_csv(stores_df, "family_dollar_locations.csv", sep = ",", index = False) +``` + +\-- +_Author's note: This article is an adaptation of a [talk I gave at PyCascades][24] in Portland, Oregon on February 9, 2020._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/web-scraping-python + +作者:[Julia Piaskowski][a] +选题:[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/julia-piaskowski +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus_html_code.png?itok=VjUmGsnl (HTML code) +[2]: https://requests.readthedocs.io/en/master/ +[3]: https://beautiful-soup-4.readthedocs.io/en/latest/ +[4]: https://pandas.pydata.org/ +[5]: https://www.selenium.dev/ +[6]: https://github.com/jpiaskowski/pycas2020_web_scraping +[7]: https://opensource.com/article/20/4/install-python-linux +[8]: https://opensource.com/article/19/8/how-install-python-windows +[9]: https://opensource.com/article/19/5/python-3-default-mac +[10]: https://github.com/jpiaskowski/pycas2020_web_scraping/blob/master/example/Familydollar_location_scrape-all-states.ipynb +[11]: https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html +[12]: https://opensource.com/article/20/4/build-websites +[13]: https://www.contentkingapp.com/academy/robotstxt/ +[14]: https://www.researchgate.net/publication/324907302_Legality_and_Ethics_of_Web_Scraping +[15]: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3221625 +[16]: https://locations.familydollar.com/id/ +[17]: https://opensource.com/sites/default/files/uploads/familydollar1.png (Family Dollar Idaho locations page) +[18]: https://opensource.com/sites/default/files/uploads/familydollar2.png (Family Dollar page source code) +[19]: https://opensource.com/sites/default/files/uploads/familydollar3.png (Family Dollar map and code) +[20]: https://opensource.com/sites/default/files/uploads/walgreens1.png (Walgreens location page and code) +[21]: https://opensource.com/sites/default/files/uploads/walgreens2.png (Walgreens source code) +[22]: https://www.walgreens.com/storelistings/storesbycity.jsp?requestType=locator\&state=ID +[23]: https://opensource.com/sites/default/files/uploads/family_dollar_locations.png (Family Dollar locations map) +[24]: https://2020.pycascades.com/talks/adventures-in-babysitting-webscraping-for-python-and-html-novices/ From f3703fd32c8b41f8f9517309fad1a8b28e677a2e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:49:49 +0800 Subject: [PATCH 0795/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200521=20Use?= =?UTF-8?q?=20the=20internet=20from=20the=20command=20line=20with=20curl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200521 Use the internet from the command line with curl.md --- ...nternet from the command line with curl.md | 186 ++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 sources/tech/20200521 Use the internet from the command line with curl.md diff --git a/sources/tech/20200521 Use the internet from the command line with curl.md b/sources/tech/20200521 Use the internet from the command line with curl.md new file mode 100644 index 0000000000..c580ea0879 --- /dev/null +++ b/sources/tech/20200521 Use the internet from the command line with curl.md @@ -0,0 +1,186 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use the internet from the command line with curl) +[#]: via: (https://opensource.com/article/20/5/curl-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Use the internet from the command line with curl +====== +Download our new curl cheat sheet. Curl is a fast and efficient way to +pull the information you need from the internet without using a +graphical interface. +![Cheat Sheet cover image][1] + +Curl is commonly considered a non-interactive web browser. That means it's able to pull information from the internet and display it in your terminal or save it to a file. This is literally what web browsers, such as Firefox or Chromium, do except they _render_ the information by default, while curl downloads and displays raw information. In reality, the curl command does much more and has the ability to transfer data to or from a server using one of many supported protocols, including HTTP, FTP, SFTP, IMAP, POP3, LDAP, SMB, SMTP, and many more. It's a useful tool for the average terminal user, a vital convenience for the sysadmin, and a quality assurance tool for microservices and cloud developers. + +Curl is designed to work without user interaction, so unlike Firefox, you must think about your interaction with online data from start to finish. For instance, if you want to view a web page in Firefox, you launch a Firefox window. After Firefox is open, you type the website you want to visit into the URL field or a search engine. Then you navigate to the site and click on the page you want to see. + +The same concepts apply to curl, except you do it all at once: you launch curl at the same time you feed it the internet location you want and tell it whether you want to the data to be saved in your terminal or to a file. The complexity increases when you have to interact with a site that requires authentication or with an API, but once you learn the **curl** command syntax, it becomes second nature. To help you get the hang of it, we collected the pertinent syntax information in a handy [cheat sheet][2]. + +### Download a file with curl + +You can download a file with the **curl** command by providing a link to a specific URL. If you provide a URL that defaults to **index.html**, then the index page is downloaded, and the file you downloaded is displayed on your terminal screen. You can pipe the output to less or tail or any other command: + + +``` +$ curl "" | tail -n 4 +    <h1>Example Domain</h1> +    <p>This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.</p> +    <p><a href="[https://www.iana.org/domains/example"\>More][3] information...</a></p> +</div></body></html> +``` + +Because some URLs contain special characters that your shell normally interprets, it's safest to surround your URL in quotation marks. + +Some files don't translate well to being displayed in a terminal. You can use the **\--remote-name** option to cause the file to be saved according to what it's called on the server: + + +``` +$ curl --remote-name "" +$ ls +linux-distro.iso +``` + +Alternatively, you can use the **\--output** option to name your download whatever you want: + + +``` +`curl "http://example.com/foo.html" --output bar.html` +``` + +### List contents of a remote directory with curl + +Because curl is non-interactive, it's difficult to browse a page for downloadable elements. Provided that the remote server you're connecting to allows it, you can use **curl** to list the contents of a directory: + + +``` +`$ curl --list-only "https://example.com/foo/"` +``` + +### Continue a partial download + +If you're downloading a very large file, you might find that you have to interrupt the download. Curl is intelligent enough to determine where you left off and continue the download. That means the next time you're downloading a 4GB Linux distribution ISO and something goes wrong, you never have to go back to the start. The syntax for **\--continue-at** is a little unusual: if you know the byte count where your download was interrupted, you can provide it; otherwise, you can use a lone dash (**-**) to tell curl to detect it automatically: + + +``` +`$ curl --remote-name --continue-at - "https://example.com/linux-distro.iso"` +``` + +### Download a sequence of files + +If you need to download several files—rather than just one big file—curl can help with that. Assuming you know the location and file-name pattern of the files you want to download, you can use curl's sequencing notation: the start and end point between a range of integers, in brackets. For the output filename, use **#1** to indicate the first variable: + + +``` +`$ curl "https://example.com/file_[1-4].webp" --output "file_#1.webp"` +``` + +If you need to use another variable to represent another sequence, denote each variable in the order it appears in the command. For example, in this command, **#1** refers to the directories **images_000** through **images_009**, while **#2** refers to the files **file_1.webp** through **file_4.webp**: + + +``` +$ curl "" \ +\--output "file_#1-#2.webp" +``` + +### Download all PNG files from a site + +You can do some rudimentary web scraping to find what you want to download, too, using only **curl** and **grep**. For instance, say you need to download all images associated with a web page you're archiving. First, download the page referencing the images. Pipe the page to grep with a search for the image type you're targeting (PNG in this example). Finally, create a **while** loop to construct a download URL and to save the files to your computer: + + +``` +$ curl |\ +grep --only-matching 'src="[^"]*.[png]"' |\ +cut -d\" -f2 |\ +while read i; do \ +curl " -o "${i##*/}"; \ +done +``` + +This is just an example, but it demonstrates how flexible curl can be when combined with a Unix pipe and some clever, but basic, parsing. + +### Fetch HTML headers + +Protocols used for data exchange have a lot of metadata embedded in the packets that computers send to communicate. HTTP headers are components of the initial portion of data. It can be helpful to view these headers (especially the response code) when troubleshooting your connection to a site: + + +``` +curl --head "" +HTTP/2 200 +accept-ranges: bytes +age: 485487 +cache-control: max-age=604800 +content-type: text/html; charset=UTF-8 +date: Sun, 26 Apr 2020 09:02:09 GMT +etag: "3147526947" +expires: Sun, 03 May 2020 09:02:09 GMT +last-modified: Thu, 17 Oct 2019 07:18:26 GMT +server: ECS (sjc/4E76) +x-cache: HIT +content-length: 1256 +``` + +### Fail quickly + +A 200 response is the usual HTTP indicator of success, so it's what you usually expect when you contact a server. The famous 404 response indicates that a page can't be found, and 500 means there was a server error. + +To see what errors are happening during negotiation, add the **\--show-error** flag: + + +``` +`$ curl --head --show-error "http://opensource.ga"` +``` + +These can be difficult for you to fix unless you have access to the server you're contacting, but curl generally tries its best to resolve the location you point it to. Sometimes when testing things over a network, seemingly endless retries just waste time, so you can force curl to exit upon failure quickly with the **\--fail-early** option: + + +``` +`curl --fail-early "http://opensource.ga"` +``` + +### Redirect query as specified by a 3xx response + +The 300 series of responses, however, are more flexible. Specifically, the 301 response means that a URL has been moved permanently to a different location. It's a common way for a website admin to relocate content while leaving a "trail" so people visiting the old location can still find it. Curl doesn't follow a 301 redirect by default, but you can make it continue on to a 301 destination by using the **\--location** option: + + +``` +$ curl "" | grep title +<title>301 Moved Permanently</title> +$ curl --location "" +<title>Internet Assigned Numbers Authority</title> +``` + +### Expand a shortened URL + +The **\--location** option is useful when you want to look at shortened URLs before visiting them. Shortened URLs can be useful for social networks with character limits (of course, this may not be an issue if you use a [modern and open source social network][4]) or for print media in which users can't just copy and paste a long URL. However, they can also be a little dangerous because their destination is, by nature, concealed. By combining the **\--head** option to view just the HTTP headers and the **\--location** option to unravel the final destination of a URL, you can peek into a shortened URL without loading the full resource: + + +``` +$ curl --head --location \ +"" +``` + +### [Download our curl cheat sheet][2] + +Once you practice thinking about the process of exploring the web as a single command, curl becomes a fast and efficient way to pull the information you need from the internet without bothering with a graphical interface. To help you build it into your usual workflow, we've created a [curl cheat sheet][2] with common curl uses and syntax, including an overview of using it to query an API. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/curl-cheat-sheet + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image) +[2]: https://opensource.com/downloads/curl-command-cheat-sheet +[3]: https://www.iana.org/domains/example"\>More +[4]: https://opensource.com/article/17/4/guide-to-mastodon From 85fc81ae0faa0846e6591d9e9f64c42b912353c2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 25 May 2020 10:49:54 +0800 Subject: [PATCH 0796/1809] PUB @wxy https://linux.cn/article-12247-1.html --- ...Speed up administration of Kubernetes clusters with k9s.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200506 Speed up administration of Kubernetes clusters with k9s.md (99%) diff --git a/translated/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md b/published/20200506 Speed up administration of Kubernetes clusters with k9s.md similarity index 99% rename from translated/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md rename to published/20200506 Speed up administration of Kubernetes clusters with k9s.md index ce71f05b26..2d3665fc79 100644 --- a/translated/tech/20200506 Speed up administration of Kubernetes clusters with k9s.md +++ b/published/20200506 Speed up administration of Kubernetes clusters with k9s.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12247-1.html) [#]: subject: (Speed up administration of Kubernetes clusters with k9s) [#]: via: (https://opensource.com/article/20/5/kubernetes-administration) [#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) From e70d2a86b4801b595c95ad19b4596da73b591302 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:50:22 +0800 Subject: [PATCH 0797/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200521=20Easy?= =?UTF-8?q?=20DNS=20configuration=20with=20PowerDNS=20for=20nameservers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200521 Easy DNS configuration with PowerDNS for nameservers.md --- ...iguration with PowerDNS for nameservers.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20200521 Easy DNS configuration with PowerDNS for nameservers.md diff --git a/sources/tech/20200521 Easy DNS configuration with PowerDNS for nameservers.md b/sources/tech/20200521 Easy DNS configuration with PowerDNS for nameservers.md new file mode 100644 index 0000000000..aa577d6aff --- /dev/null +++ b/sources/tech/20200521 Easy DNS configuration with PowerDNS for nameservers.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Easy DNS configuration with PowerDNS for nameservers) +[#]: via: (https://opensource.com/article/20/5/powerdns) +[#]: author: (Jonathan Garrido https://opensource.com/users/jgarrido) + +Easy DNS configuration with PowerDNS for nameservers +====== +Use PDNS to provide a stable and reliable Domain Name System (DNS) +server for your project. +![Computer laptop in space][1] + +A few months ago, we got a requirement to provide a stable and reliable Domain Name System ([DNS][2]) server for a new project. The project dealt with auto-deployment using containers and where each new environment would generate a unique, random URL. After a lot of research on possible solutions, we decided to give [PowerDNS][3] (PDNS) a try. + +At the outset, we discovered that PowerDNS is supported in all major Linux distros, is available under the GPL license, and keeps its repositories up to date. We also found neat and well-organized [documentation][4] on the official site and tons of how-to's around the web from people who really like and use the product. After reading a few pages and learning some basic commands, PDNS was installed, up, and running, and our journey began. + +### Database-driven + +PowerDNS keeps its records in a SQL database. This was new for us, and not having to use flat files to keep records was a good change. We picked MariaDB as our power tool of choice, and since there is tons of advance information about the proper settings for installing the nameserver, we could set up and harden our database flawlessly. + +### Easy configuration + +The second thing that engaged us was all the features PDNS has in its config file. This file, pdns.conf, has a lot of options that you can enable or disable just by adding or removing the # sign. This was truly amazing because it gave us the chance to integrate this new service into our current infrastructure with only the values that we want, no more, no less, just the features that we need. A quick example: + +Who can access your webserver? + + +``` +`webserver-allow-from=172.10.0.1,172.10.1.2` +``` + +Can I forward requests based in a domain? Sure! + + +``` +forward-zones=mylocal.io=127.0.0.1:5300 +forward-zones+=example.com=172.10.0.5:53 +forward-zones+=lucky.tech=172.10.1.5:53 +``` + +### API included + +We could activate using this config file, and this is when we started to meet PDNS's "power" by solving the first request from our development team, the API service. This feature gave us the ability to send requests to simply and cleanly create, modify, or remove records in our DNS server. + +This API has some basic security parameters, so in just a few steps, you can control who has the right to interact with the nameserver based on a combination of an IP address and a pre-share key as a way of authentication. Here's what the configuration for this looks like: + + +``` +api=yes +api-key=lkjdsfpoiernf +webserver-allow-from=172.10.7.13,172.10.7.5 +``` + +### Logging + +PDNS does an extraordinary job when it comes to logging. You can monitor your server and see how the machine is doing by using the log files and a simple built-in web server. Using a browser, you can see different types of statistics from the machine, like CPU usage and the DNS queries received. This is very valuable—for example, we were able to detect a few "not-so-healthy" PCs that were sending DNS requests to our server looking for sites that are related to malicious traffic. After digging into the logs, we could see where traffic was coming from and do a clean operation on those PCs. + +### Other features + +This is only a glimpse of all the things you can do with PowerDNS; there is much more to it. It is a complete nameserver with a lot of features and functionalities that make it worth giving it a try. + +At this moment, we are not implementing [DNSSEC][5], but it appears that it can be put into production quickly with just one click. Also, PowerDNS has a nice approach when it comes to separating the recursor service from the nameserver. I read that it also supports [DNS RPZ][6] (Response Policy Zones), and there are also some very nice and well-designed frontends available that let you manage your server using a simple web browser, like the one in the image below. + +![PowerDNS frontend][7] + +([PowerDNS documentation][4], MIT License) + +Believe it or not, you can boost your knowledge about DNS and IT ops a lot just by expending a few hours "playing" with PDNS. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/powerdns + +作者:[Jonathan Garrido][a] +选题:[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/jgarrido +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_space_graphic_cosmic.png?itok=wu493YbB (Computer laptop in space) +[2]: https://en.wikipedia.org/wiki/Domain_Name_System +[3]: https://www.powerdns.com/opensource.html +[4]: https://doc.powerdns.com/ +[5]: https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions +[6]: https://dnsrpz.info/ +[7]: https://opensource.com/sites/default/files/uploads/pdns.jpg (PowerDNS frontend) From 6c95315abb5654e1c9f481d816b88ccf95de216c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 10:51:27 +0800 Subject: [PATCH 0798/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200520=20How?= =?UTF-8?q?=20to=20configure=20your=20router=20using=20VTY=20shell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200520 How to configure your router using VTY shell.md --- ...o configure your router using VTY shell.md | 198 ++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 sources/tech/20200520 How to configure your router using VTY shell.md diff --git a/sources/tech/20200520 How to configure your router using VTY shell.md b/sources/tech/20200520 How to configure your router using VTY shell.md new file mode 100644 index 0000000000..29a427583a --- /dev/null +++ b/sources/tech/20200520 How to configure your router using VTY shell.md @@ -0,0 +1,198 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to configure your router using VTY shell) +[#]: via: (https://opensource.com/article/20/5/vty-shell) +[#]: author: (M Umer https://opensource.com/users/noisybotnet) + +How to configure your router using VTY shell +====== +Free range routing gives you options for implementing multiple +protocols. This guide will get you started. +![Multi-colored and directional network computer cables][1] + +Recently, I wrote an article explaining how we can implement Open Shortest Path First (OSPF) using the [Quagga][2] routing suite. There are multiple software suites that can be used instead of Quagga to implement different routing protocols. One such option is free range routing (FRR). + +### FRR + +[FRR][3] is a routing software suite, which has been derived from Quagga and is distributed under GNU GPL2 license. Like Quagga, it provides implementations of all major routing protocols such as OSPF, Routing Information Protocol (RIP), Border Gateway Protocol (BGP), and Intermediate system-to-intermediate system (IS-IS) for Unix-like platforms. + +Several companies, such as Big Switch Networks, Cumulus, Open Source Routing, and 6wind, who were behind the development of Quagga, created FRR to improve on Quagga's well-established foundations. + +#### Architecture + +FRR is a suite of daemons that work together to build the routing table. Each major protocol is implemented in its own daemon, and these daemons talk to the core and protocol-independent daemon Zebra, which provides kernel routing table updates, interface lookups, and redistribution of routes between different routing protocols. Each protocol-specific daemon is responsible for running the relevant protocol and building the routing table based on the information exchanged. + +![FRR architecture][4] + +### VTY shell + +[VTYSH][5] is an integrated shell for the FRR routing engine. It amalgamates all the CLI commands defined in each of the daemons and presents them to the user in a single shell. It provides a Cisco-like modal CLI, and many of the commands are similar to Cisco IOS commands. There are different modes to the CLI, and certain commands are only available within a specific mode. + +### Setup + +In this tutorial, we'll be implementing the routing information protocol (RIP) to configure dynamic routing using FRR. We can do this in two ways—either by editing the protocol daemon configuration file in an editor or by using the VTY shell. We'll be using the VTY shell in this example. Our setup includes two CentOS 7.7 hosts, named Alpha and Beta. Both hosts have two network interfaces and share access to the 192.168.122.0/24 network. We'll be advertising routes for 10.12.11.0/24 and 10.10.10.0/24 networks. + +**For Host Alpha:** + + * eth0 IP: 192.168.122.100/24 + * Gateway: 192.168.122.1 + * eth1 IP: 10.10.10.12/24 + + + +**For Host Beta:** + + * eth0 IP: 192.168.122.50/24 + * Gateway: 192.168.122.1 + * eth1 IP: 10.12.11.12/24 + + + +#### Installation of package + +First, we need to install the FRR package on both hosts; this can be done by following the instructions in the [official FRR documentation][6]. + +#### Enable IP forwarding + +For routing, we need to enable IP forwarding on both hosts since that will performed by the Linux kernel. + + +``` +sysctl -w net.ipv4.conf.all.forwarding = 1 + +sysctl -w net.ipv6.conf.all.forwarding = 1 +sysctl -p +``` + +#### Enabling the RIPD daemon + +Once installed, all the configuration files will be stored in the **/etc/frr** directory. The daemons must be explicitly enabled by editing the **/etc/frr/daemons** file. This file determines which daemons are activated when the FRR service is started. To enable a particular daemon, simply change the corresponding "no" to "yes." A subsequent service restart should start the daemon. + +![FRR daemon restart][7] + +#### Firewall configuration + +Since RIP protocol uses UDP as its transport protocol and is assigned port 520, we need to allow this port in `firewalld` configuration. + + +``` +firewall-cmd --add-port=520/udp –permanent + +firewalld-cmd -reload +``` + +We can now start the FRR service using: + + +``` +`systemctl start frr` +``` + +#### Configuration using VTY + +Now, we need to configure RIP using the VTY shell. + +On Host Alpha: + + +``` +[root@alpha ~]# vtysh + +Hello, this is FRRouting (version 7.2RPKI). +Copyright 1996-2005 Kunihiro Ishiguro, et al. + +alpha# configure terminal +alpha(config)# router rip +alpha(config-router)# network 192.168.122.0/24 +alpha(config-router)# network 10.10.10.0/24 +alpha(config-router)# route 10.10.10.5/24 +alpha(config-router)# do write +Note: this version of vtysh never writes vtysh.conf +Building Configuration... +Configuration saved to /etc/frr/ripd.conf +Configuration saved to /etc/frr/staticd.conf +alpha(config-router)# do write memory +Note: this version of vtysh never writes vtysh.conf +Building Configuration... +Configuration saved to /etc/frr/ripd.conf +Configuration saved to /etc/frr/staticd.conf +alpha(config-router)# exit +``` + +Similarly, on Host Beta: + + +``` +[root@beta ~]# vtysh + +Hello, this is FRRouting (version 7.2RPKI). +Copyright 1996-2005 Kunihiro Ishiguro, et al. + +beta# configure terminal +beta(config)# router rip +beta(config-router)# network 192.168.122.0/24 +beta(config-router)# network 10.12.11.0/24 +beta(config-router)# do write +Note: this version of vtysh never writes vtysh.conf +Building Configuration... +Configuration saved to /etc/frr/zebra.conf +Configuration saved to /etc/frr/ripd.conf +Configuration saved to /etc/frr/staticd.conf +beta(config-router)# do write memory +Note: this version of vtysh never writes vtysh.conf +Building Configuration... +Configuration saved to /etc/frr/zebra.conf +Configuration saved to /etc/frr/ripd.conf +Configuration saved to /etc/frr/staticd.conf +beta(config-router)# exit +``` + +Once done, check the routes on both hosts as follows: + + +``` +[root@alpha ~]# ip route show +default via 192.168.122.1 dev eth0 proto static metric 100 +10.10.10.0/24 dev eth1 proto kernel scope link src 10.10.10.12 metric 101 +10.12.11.0/24 via 192.168.122.50 dev eth0 proto 189 metric 20 +192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.100 metric 100 +``` + +We can see that the routing table on Alpha contains an entry of 10.12.11.0/24 via 192.168.122.50, which was offered through RIP. Similarly, on Beta, the table contains an entry of network 10.10.10.0/24 via 192.168.122.100. + + +``` +[root@beta ~]# ip route show +default via 192.168.122.1 dev eth0 proto static metric 100 +10.10.10.0/24 via 192.168.122.100 dev eth0 proto 189 metric 20 +10.12.11.0/24 dev eth1 proto kernel scope link src 10.12.11.12 metric 101 +192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.50 metric 100 +``` + +### Conclusion + +As you can see, the setup and configuration are relatively simple. To add complexity, we can add more network interfaces to the router to provide routing for more networks. The configurations can be made by editing the configuration files in an editor, but using VTY shell provides us a frontend to all FRR daemons in a single, combined session. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/vty-shell + +作者:[M Umer][a] +选题:[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/noisybotnet +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/connections_wires_sysadmin_cable.png?itok=d5WqHmnJ (Multi-colored and directional network computer cables) +[2]: https://opensource.com/article/20/4/quagga-linux +[3]: https://en.wikipedia.org/wiki/FRRouting +[4]: https://opensource.com/sites/default/files/uploads/frr_architecture.png (FRR architecture) +[5]: http://docs.frrouting.org/projects/dev-guide/en/latest/vtysh.html +[6]: http://docs.frrouting.org/projects/dev-guide/en/latest/building-frr-for-centos7.html +[7]: https://opensource.com/sites/default/files/uploads/frr_daemon_restart.png (FRR daemon restart) From a9c0409fc69e55ac57149d9d55d75a675a50e90a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 12:21:23 +0800 Subject: [PATCH 0799/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200521=20Glic?= =?UTF-8?q?o=20(Weighted=20Rock=20Paper=20Scissors)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200521 Glico (Weighted Rock Paper Scissors).md --- ...21 Glico (Weighted Rock Paper Scissors).md | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 sources/tech/20200521 Glico (Weighted Rock Paper Scissors).md diff --git a/sources/tech/20200521 Glico (Weighted Rock Paper Scissors).md b/sources/tech/20200521 Glico (Weighted Rock Paper Scissors).md new file mode 100644 index 0000000000..77e3cfb5ed --- /dev/null +++ b/sources/tech/20200521 Glico (Weighted Rock Paper Scissors).md @@ -0,0 +1,141 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Glico (Weighted Rock Paper Scissors)) +[#]: via: (https://theartofmachinery.com/2020/05/21/glico_weighted_rock_paper_scissors.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +Glico (Weighted Rock Paper Scissors) +====== + +This still isn’t the blog post I said I was going to write about now, but I figured some game theory would make a good post at the moment, especially when a lot of people I know are working at home with kids who need entertaining. Here’s some stuff about a traditional Japanese kids’ game called Glico, a form of weighted Rock Paper Scissors (RPS). + +### Glico + +I’ll assume you’re familiar with regular RPS. It’s pretty obvious how to play well: the three plays, “rock”, “paper” and “scissors”, are equally strong, so the only trick is to play them unpredictably enough. + +But what happens if the three plays have different values? Weighted RPS, under the name “Glico”, has been a well-known Japanese children’s game since at least before WWII, but let me explain an English adaptation. Traditionally it’s played starting at the bottom of a flight of stairs, and the aim is to get to the top first. Players can climb up steps by winning rounds of RPS. The trick is that the number of steps depends on the winning hand in each round. A player who wins with “rock” gets to climb up four steps by spelling out R-O-C-K, and similarly “paper” is worth five steps and “scissors” worth eight. This simple twist to the game creates whole new layers of offence and defence as players struggle to win with “scissors” as much as possible, without being too predictable and vulnerable. + +(The rules for the Japanese version vary by region, but usually “rock” is worth 3 steps, while “paper” and “scissors” are worth 6. The mnemonic is that “rock”, “paper” and “scissors” are referred to as グー, パー and チョキ respectively, and the words spelled out when playing are グリコ (“Glico”, a food/confectionary brand), パイナップル (pineapple) and チョコレート (chocolate).) + +Just a few notes before getting into the maths: The game works best with two players, but in the traditional rules for three or more players, each round is handled by having multiple rematches. Each time there’s a clear winning hand (e.g., two players with “paper” beating one with “rock”) the losers are eliminated until there’s one winner. That can take a long time, so cycling systematically between pairs of players might be faster for several players. (I’ll assume two players from now on.) Also, older kids sometimes add an extra challenge by requiring an exact landing at the top of the stairs to win. For example, if you’re five steps from the top, only “paper” will win; “scissors” will overshoot by three steps, and you’ll end up three steps back down from the top. Be warned: that makes gameplay a lot harder. + +### Calculating the optimal strategy + +Simple strategies like “just play rock” are what game theorists call “pure strategies”. By design, no pure strategy in RPS is better than all others, and an adaptive opponent can quickly learn to exploit any pure strategy (e.g., by always playing “paper” against someone who always plays “rock”). Any decent player will play RPS with something like a “mixed strategy” (selecting from the pure strategies at random, maybe with different probabilities). Game theory tells us that finite, two-player, zero-sum games always have optimal mixed strategies — i.e., a mixed strategy that’s as good or better than any other, even against an adaptive opponent. You might do better by exploiting a weak opponent, but you can’t do better against a perfect one. In plain RPS, the statistically unbeatable strategy is to play each hand with equal probability (\frac{1}{3}). + +Glico is made up of multiple rounds of weighted RPS. A truly optimal player won’t just use one set of probabilities (p_{r}), (p_{p}) and (p_{s}) for playing “rock”, “paper” and “scissors” each round. The optimal probabilities will vary depending the position of both players on the stairs. For example, a player who is four steps from winning is either happy with any winning hand, or only wants “rock”, depending on the rules, and (theoretically) both players should recognise that and adapt their probabilities accordingly. However, it’s more practical to play with an optimal greedy strategy — i.e., assuming everyone is just trying to get the maximum step value each round. + +I’ll calculate an optimal greedy strategy for weighted RPS in two ways. One way is longer but uses nothing but high school algebra and logical thinking, while the other way uses the power of linear programming. + +#### The longer way + +The greedy version of Glico has no end goal; the players are just trying to win points. It helps with solving the game if we make it zero sum — any time you win (N) points, your opponent loses (N) points, and vice versa. That just scales and shifts the score per round, so it doesn’t change the optimal strategy. Why do it? We know that optimal players can’t get any advantage over each other because the game is symmetric. If the game is zero sum, that means that no strategy can have an expected value of more than 0 points. That lets us write some equations. For example, playing “rock” might win you 4 points against “scissors”, or lose you 5 against “paper”. Against an optimal opponent, we can say + +[4p_{s} - 5p_{p} \leq 0] + +Is the inequality necessary? When would a pure strategy have a negative value against a non-adaptive but optimal player? Imagine if we added a fourth pure strategy, “bomb”, that simply gave 1000 points to the opponent. Obviously no optimal player would ever play “bomb”, so (p_{b} = 0). Playing “bomb” against an optimal player would have expected value -1000. We can say that some pure strategies are just _bad_: they have suboptimal value against an optimal opponent, and an optimal player will never play them. Other pure strategies have optimal value against an optimal opponent, and they’re reasonable to include in an optimal strategy. + +Bad pure strategies aren’t always as obvious as “bomb”, but we can argue that none of the pure strategies in RPS are bad. “Rock” is the only way to beat “scissors”, and “paper” is the only way to beat “rock”, and “scissors” is the only way to beat “paper”. At least one must be in the optimal strategy, so we can expect them all to be. So let’s make that (\leq) into (=), and add the equations for playing “paper” and “scissors”, plus the fact that these are probabilities that add up to 1: + +[\begin{matrix} {4p_{s} - 5p_{p}} & {= 0} \ {5p_{r} - 8p_{s}} & {= 0} \ {8p_{p} - 4p_{r}} & {= 0} \ {p_{r} + p_{p} + p_{s}} & {= 1} \ \end{matrix}] + +That’s a system of linear equations that can be solved algorithmically using Gaussian elimination — either by hand or by using any good numerical algorithms software. I won’t go into the details, but here’s the solution: + +[\begin{matrix} p_{r} & {= 0.4706} \ p_{p} & {= 0.2353} \ p_{s} & {= 0.2941} \ \end{matrix}] + +Even though it’s worth the least, an optimal player will play “rock” almost half the time to counterattack “scissors”. The rest of the time is split between “paper” and “scissors”, with a slight bias towards “scissors”. + +#### The powerful way + +The previous solution needed special-case analysis: it exploited the symmetry of the game, and made some guesses about how good/bad the pure strategies are. What about games that are more complex, or maybe not even symmetric (say, because one player has a handicap)? There’s a more general solution using what’s called linear programming (which dates to when “programming” just meant “scheduling” or “planning”). + +By the way, linear programming (LP) has a funny place in computer science. There are some industries and academic circles where LP and generalisations like mixed integer programming are super hot. Then there are computer science textbooks that never even mention them, so there are industries where the whole topic is pretty much unheard of. It might be because it wasn’t even known for a long time if LP problems can be solved in polynomial time (they can), so LP doesn’t have the same theoretical elegance as, say, shortest path finding, even if it has a lot of practical use. + +Anyway, solving weighted RPS with LP is pretty straightforward. We just need to describe the game using a bunch of linear inequalities in multiple variables, and express strategic value as a linear function that can be optimised. That’s very similar to what was done before, but this time we won’t try to guess at the values of any strategies. We’ll just assume we’re choosing values (p_{r}), (p_{p}) and (p_{s}) to play against an opponent who scores an average (v) against us each round. The opponent is smart enough to choose a strategy that’s as least as good as any pure strategy, so we can say + +[\begin{matrix} {4p_{s} - 5p_{p}} & {\leq v} \ {5p_{r} - 8p_{s}} & {\leq v} \ {8p_{p} - 4p_{r}} & {\leq v} \ \end{matrix}] + +The opponent can only play some combination of “rock”, “paper” and “scissors”, so (v) can’t be strictly greater than all of them — at least one of the inequalities above must be tight. To model the gameplay fully, the only other constraints we need are the rules of probability: + +[\begin{matrix} {p_{r} + p_{p} + p_{s}} & {= 1} \ p_{r} & {\geq 0} \ p_{p} & {\geq 0} \ p_{s} & {\geq 0} \ \end{matrix}] + +Now we’ve modelled the problem, we just need to express what needs to be optimised. That’s actually dead simple: we just want to minimise (v), the average score the opponent can win from us. An LP solver can find a set of values for all variables that minimises (v) within the constraints, and we can read off the optimal strategy directly. + +I’ve tried a few tools, and the [Julia][1] library [JuMP][2] has my current favourite FOSS API for throwaway optimisation problems. Here’s some code: + +``` +# You might need Pkg.add("JuMP"); Pkg.add("GLPK") +using JuMP +using GLPK + +game = Model(GLPK.Optimizer) + +@variable(game, 0 <= pr <= 1) +@variable(game, 0 <= pp <= 1) +@variable(game, 0 <= ps <= 1) +@variable(game, v) + +@constraint(game, ptotal, pr + pp + ps == 1) +@constraint(game, rock, 4*ps - 5*pp <= v) +@constraint(game, paper, 5*pr - 8*ps <= v) +@constraint(game, scissors, 8*pp - 4*pr <= v) + +@objective(game, Min, v) + +println(game) +optimize!(game) + +println("Opponent's value: ", value(v)) +println("Rock: ", value(pr)) +println("Paper: ", value(pp)) +println("Scissors: ", value(ps)) +``` + +Here’s the output: + +``` +Min v +Subject to + ptotal : pr + pp + ps = 1.0 + rock : 4 ps - 5 pp - v ≤ 0.0 + paper : 5 pr - 8 ps - v ≤ 0.0 + scissors : 8 pp - 4 pr - v ≤ 0.0 + pr ≥ 0.0 + pp ≥ 0.0 + ps ≥ 0.0 + pr ≤ 1.0 + pp ≤ 1.0 + ps ≤ 1.0 + +Opponent's value: 0.0 +Rock: 0.47058823529411764 +Paper: 0.23529411764705882 +Scissors: 0.29411764705882354 +``` + +As argued in the previous solution, the best value the opponent can get against the optimal player is 0. + +### What does optimality mean? + +The optimal solution was calculated assuming an all-powerful opponent. It guarantees that even the best weighted RPS player can’t get an advantage over you, but it turns out you can’t get an advantage over a terrible player, either, if you insist on playing this “optimal” strategy. That’s because weighted RPS has no bad plays, in the sense that “bomb” is bad. _Any_ strategy played against the above “optimal” strategy will have expected value of 0, so it’s really a defensive, or “safe” strategy. To play truly optimally and win against a bad player, you’ll have to adapt your strategy. For example, if your opponent plays “scissors” too often and “paper” not enough, you should adapt by playing “rock” more often. Of course, your opponent might just be pretending to be weak, and could start taking advantage of your deviation from the safe strategy. + +Games don’t always work out like that. For example, in theory, you could derive an optimal safe strategy for more complex games like poker. Such a strategy would tend to win against normal humans because even the best normal humans make bad poker plays. On the other hand, a “shark” at the table might be able to win against the “fish” faster by exploiting their weaknesses more aggressively. If you’re thinking of using LP to directly calculate a strategy for Texas Hold’em, though, sorry, but you’ll hit a combinatorial explosion of pure strategies as you account for all the cases like “if I’m dealt AJ on the big blind and I call a four-blind raise from the button preflop and then the flop is a rainbow 3K9…”. Only heavily simplified toy poker games are solvable with the general approach. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2020/05/21/glico_weighted_rock_paper_scissors.html + +作者:[Simon Arneaud][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://julialang.org/ +[2]: https://github.com/JuliaOpt/JuMP.jl From 84e17bfc8e7900790cdb2a5134ff3eb9aa4177c9 Mon Sep 17 00:00:00 2001 From: lnrCoder Date: Mon, 25 May 2020 18:39:18 +0800 Subject: [PATCH 0800/1809] translating --- ...5 Now You Can Run Linux Apps in Windows (Thanks to WSL).md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md b/sources/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md index e6e79cbb08..77e3ba785a 100644 --- a/sources/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md +++ b/sources/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lnrCoder) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -80,7 +80,7 @@ via: https://itsfoss.com/run-linux-apps-windows-wsl/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[lnrCoder](https://github.com/lnrCoder) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 845f2d3db0f92e736d88e2ccfa7e36d52e205cb3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:20:51 +0800 Subject: [PATCH 0801/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20How?= =?UTF-8?q?=20to=20Remove=20Files=20Older=20than=20N=20Days=20Using=20Tmpw?= =?UTF-8?q?atch/Tmpreaper=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 How to Remove Files Older than N Days Using Tmpwatch-Tmpreaper on Linux.md --- ... Days Using Tmpwatch-Tmpreaper on Linux.md | 198 ++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 sources/tech/20200525 How to Remove Files Older than N Days Using Tmpwatch-Tmpreaper on Linux.md diff --git a/sources/tech/20200525 How to Remove Files Older than N Days Using Tmpwatch-Tmpreaper on Linux.md b/sources/tech/20200525 How to Remove Files Older than N Days Using Tmpwatch-Tmpreaper on Linux.md new file mode 100644 index 0000000000..aa63946c77 --- /dev/null +++ b/sources/tech/20200525 How to Remove Files Older than N Days Using Tmpwatch-Tmpreaper on Linux.md @@ -0,0 +1,198 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Remove Files Older than N Days Using Tmpwatch/Tmpreaper on Linux) +[#]: via: (https://www.2daygeek.com/how-to-remove-files-older-than-n-days-using-tmpwatch-tmpreaper-on-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How to Remove Files Older than N Days Using Tmpwatch/Tmpreaper on Linux +====== + +You may have missed deleting files that are no longer needed on your computer in some directory. + +This can be “Download” or any other directory. + +It may have grown up over a period of time. + +If you have enough storage, you should remove them, as this will slow down your system when you list files. + +Also, it can be clumsy when you have thousands of files in one directory. + +It is very difficult to find a file in a specific directory when you do not know the file name you want to check. + +We can do this by using the find command with some combination, and we have written an article about this in the past. + + * [**Bash Script to Delete Files/Folders Older Than “X” Days in Linux**][1] + * [**How To Find And Delete Files Older Than “X” Days And “X” Hours In Linux?**][1] + * [**How To Automatically Delete Or Clean Up /tmp Folder Contents In Linux?**][1] + + + +Today we are going to show you how to achieve this using the Tmpwatch utility on Linux. + +### What is Tmpwatch + +Tmpwatch recursively removes files that have not been accessed for a specified period of time in the specified directories. + +Typically, it is used to automatically clean directories used for temporary file systems, such as / tmp and /var/tmp. + +It only remove empty directories, regular files, and symbolic links. + +It doesn’t switch to other file systems, and avoids the “lost+found” directory belonging to the root user. + +By default, tmpwatch deletes files based on their atime (access time), not their mtime (conversion time). + +You can change this behavior by adding other parameters in the tmpwatch command. + +**WARNING:** Please do not run “tmpwatch” or “tmpreaper” in “/” because there is no mechanism in the program to protect against this. + +### How to Install Tmpwatch on Linux + +Tmpwatch can be installed as follows from the distribution official repository. + +For **RHEL/CentOS 6** systems, use the **[yum command][2]** to install Tmpwatch. + +``` +$ sudo yum install -y tmpwatch +``` + +For **Debian** and **Ubuntu** systems, use the **[apt command][3]** or **[apt-get command][4]** to install Tmpreaper. + +``` +$ sudo apt-get install tmpreaper +``` + +For **openSUSE** systems, use the **[zypper command][5]** to install Tmpwatch. + +``` +$ sudo zypper install -y tmpwatch +``` + +For **Fedora** systems, use the **[dnf command][6]** to install Tmpwatch. + +``` +$ sudo dnf install -y tmpwatch +``` + +**Make a note:** If you are using Debian-based systems, use “tmpreaper” instead of tmpwatch. All examples will work as expected. + +### Understanding Key Options and Arguments + + * **atime** (File Last Access Time) – Access time shows the last time the data from a file was accessed by any of the process such as command or script, etc,. + * **mtime** (File Last Modify Time) – mtime shows when you modify a file contents or save a file. Most of the times ctime and mtime will be the same, unless the file attributes are updated. + * **ctime** (File Last Change Time) – ctime shows when your file metadata got changed. It means when the file attributes are changed like ownership or group, etc,. + * **dirmtime** (Directory Last modification time) – dirmtime shows when your directory last modified. + + + +The time parameter defines the threshold for removing files. + + * d – for days + * h – for hours + * m – for minutes + * s – for seconds + + + +### How to Removes Files That Haven’t Been Accessed for a Period of Time Using the Tmpwatch Command + +As I said at the beginning of the article, Tmpwatch deletes files by default (atime) depending on the time of access to the files. Also, since hours are the default parameter, you do not need to add the suffix to time if the action is performed using the hour unit. + +For example, run the command below to recursively remove files that have not been accessed for the past 5 hours. + +``` +# tmpwatch 5 /tmp +``` + +Run the command below to delete files that have not been modified for the last 10 hours. If you want to delete files using mtime, you need to add the “-m” option with the tmpwatch command. + +``` +# tmpwatch -m 10 /home/daygeek/Downloads +``` + +### How to Delete Files That Haven’t Been Accessed more than “X” Days Using the Tmpwatch Command + +If you want to delete files using days, you need to add the suffix “d”. The example below deletes files older than 30 days. + +``` +# tmpwatch 30d /home/daygeek/Downloads +``` + +### How to Delete All Files That Haven’t Been Accessed for a Period of Time Using the Tmpwatch Command + +The below command removes all file types, not just regular files, symbolic links and directories based on mtime. + +``` +# tmpwatch -am 12 /tmp +``` + +### How to Exclude a Directory with Tmpwatch + +The below command will delete all files and excludes directories that haven’t been modified for the past 10 hours. + +``` +# tmpwatch -am 10 --nodirs /home/daygeek/Downloads +``` + +### How to Exclude a Specific Path with Tmpwatch + +The command below will delete all files except the directory below which has not been modified for the past 10 hours. + +``` +# tmpwatch -am 10 --exclude=/home/daygeek/Downloads/Movies /home/daygeek/Downloads +``` + +### How to Exclude Specific Pattern with Tmpwatch + +The command below will delete all files except the Pattern below which has not been modified for the past 10 hours. + +``` +# tmpwatch -am 10 --exclude-pattern='*.pdf' /home/daygeek/Downloads +``` + +### How to Perform Dry Run with Tmpwatch Command + +Run the below command if you want to perform dry run. + +``` +# tmpwatch -t 5h /home/daygeek/Downloads +``` + +### How to Setup a Cronjob to Delete files Periodically Using Tmpwatch + +By default it leaves a **[cronjob][7]** file under the **“/etc/cron.daily/tmpreaper”** directory. This cronjob works according to the configuration file located in **“/etc/timereaper.conf”**. You can customize the file according to your needs. + +It runs once a day and deletes files older than 7 days. + +Alternatively, if you would like to perform an action routinely, you can manually add a conjob based on your needs. + +``` +# crontab -e + +0 10 * * * /usr/sbin/tmpwatch 15d /home/daygeek/Downloads +``` + +The above cronjob will delete files that are older than 15 days daily at 10AM. + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-remove-files-older-than-n-days-using-tmpwatch-tmpreaper-on-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/bash-script-to-delete-files-folders-older-than-x-days-in-linux/ +[2]: https://www.2daygeek.com/linux-yum-command-examples-manage-packages-rhel-centos-systems/ +[3]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[6]: https://www.2daygeek.com/linux-dnf-command-examples-manage-packages-fedora-centos-rhel-systems/ +[7]: https://www.2daygeek.com/linux-crontab-cron-job-to-schedule-jobs-task/ From 1ced5eeaa11b5af8a5a170d041398fa8b38ae5fb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:21:08 +0800 Subject: [PATCH 0802/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20How?= =?UTF-8?q?=20to=20Execute=20a=20Command=20or=20Script=20at=20Reboot=20or?= =?UTF-8?q?=20Startup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 How to Execute a Command or Script at Reboot or Startup.md --- ... Command or Script at Reboot or Startup.md | 159 ++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 sources/tech/20200525 How to Execute a Command or Script at Reboot or Startup.md diff --git a/sources/tech/20200525 How to Execute a Command or Script at Reboot or Startup.md b/sources/tech/20200525 How to Execute a Command or Script at Reboot or Startup.md new file mode 100644 index 0000000000..5d81b593de --- /dev/null +++ b/sources/tech/20200525 How to Execute a Command or Script at Reboot or Startup.md @@ -0,0 +1,159 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Execute a Command or Script at Reboot or Startup) +[#]: via: (https://www.2daygeek.com/execute-run-linux-scripts-command-at-reboot-startup/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How to Execute a Command or Script at Reboot or Startup +====== + +Well known services on Linux can be added on boot without any problems. + +For example, if you want to add Apache Httpd **[service on boot][1]**, you can do this with the help of the chkconfig and systemctl command. + +Sometimes you need to add a custom script or command or service on boot, and how to do it? + +You can do this using the below three methods. + +In this article, we will show you how to use these methods with examples. + +### Method-1: How to Run Script or Command at Reboot or Startup Using /etc/rc.d/rc.local File + +The **“/etc/rc.local”** file is traditionally executed after all normal computer services have been started at the end of the process of switching to a multiuser runlevel. + +This method also works on the systemd system. + +You need to add the location of your script to the “/etc/rc.d/rc.local” file to run on boot. + +Make sure the file has permission to run. + +``` +# chmod +x /etc/rc.d/rc.local +``` + +To demonstrate this, we are going to create a simple sample script. You can create any script as needed. + +``` +# vi /opt/scripts/run-script-on-boot.sh + +#!/bin/bash +date > /root/on-boot-output.txt +hostname > /root/on-boot-output.txt +``` + +Once the script is ready, set the executable permission. + +``` +# chmod +x /opt/scripts/run-script-on-boot.sh +``` + +Finally add the script to the bottom of the file. + +``` +# vi /etc/rc.d/rc.local + +/opt/scripts/run-script-on-boot.sh +``` + +**[Restart your system][2]** to check this. + +``` +# reboot +``` + +### Method-2: How to Execute a Command or Script at Reboot or Startup Using the crontab + +cron executes scheduled jobs automatically in the backend at a specific time. + +This can be easily accomplished using a special string called **“@reboot”** with **[cron job][3]**. + +@reboot is a special string and allows the user to run any command or script at startup (boot time). + +This example runs the “/opt/scripts/run-script-on-boot.sh” file on the system restart. + +We are going to use the same script as above. + +To do so, just add the following entry in the crontab file. + +``` +# crontab -e + +@reboot /opt/scripts/run-script-on-boot.sh +``` + +Restart your system to check this. + +``` +# reboot +``` + +### Method-3: How to Run a Command or Script at Reboot or Startup Using the systemd service unit + +This method only works on the systemd system. This method is very straightforward. + +We are going to use the same script above to demonstrate this. + +To do so, you need to create a systemd startup script and place it in the **“/etc/systemd/system/”** directory. + +This is our sample systemd startup unit script. + +``` +# vi sample-on-boot-script.service + +[Unit] +Description=Run a Custom Script at Startup +After=default.target + +[Service] +ExecStart=/opt/scripts/run-script-on-boot.sh + +[Install] +WantedBy=default.target +``` + +Once you place the unit script in the systemd location, run the following command to update the systemd configuration files and enable the service. + +``` +# systemctl daemon-reload +# systemctl enable sample-on-boot-script.service +``` + +Restart your system to check this. + +``` +# reboot +``` + +### Bonus Tips: + +If you want to run a script in the background, you need to add the trailing ampersand “&” symbol. + +``` +/Path/To/My_Script & +``` + +If you want to run the command as a different user, use the following format. + +``` +su - $USER -c /Path/To/My_Script +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/execute-run-linux-scripts-command-at-reboot-startup/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/enable-disable-services-on-boot-linux-chkconfig-systemctl-command/ +[2]: https://www.2daygeek.com/6-commands-to-shutdown-halt-poweroff-reboot-the-linux-system/ +[3]: https://www.2daygeek.com/linux-crontab-cron-job-to-schedule-jobs-task/ From 09d3980627207144fc8abc523fb0fdb22810c0e8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:21:25 +0800 Subject: [PATCH 0803/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20How?= =?UTF-8?q?=20to=20Manipulate=20an=20Ethernet=20Card=20Using=20the=20ethto?= =?UTF-8?q?ol=20Command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 How to Manipulate an Ethernet Card Using the ethtool Command.md --- ...Ethernet Card Using the ethtool Command.md | 314 ++++++++++++++++++ 1 file changed, 314 insertions(+) create mode 100644 sources/tech/20200525 How to Manipulate an Ethernet Card Using the ethtool Command.md diff --git a/sources/tech/20200525 How to Manipulate an Ethernet Card Using the ethtool Command.md b/sources/tech/20200525 How to Manipulate an Ethernet Card Using the ethtool Command.md new file mode 100644 index 0000000000..42c7bd824a --- /dev/null +++ b/sources/tech/20200525 How to Manipulate an Ethernet Card Using the ethtool Command.md @@ -0,0 +1,314 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Manipulate an Ethernet Card Using the ethtool Command) +[#]: via: (https://www.2daygeek.com/linux-ethtool-command-view-change-ethernet-adapter-settings-nic-card/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How to Manipulate an Ethernet Card Using the ethtool Command +====== + +Ethtool is used to view and modify network device driver parameters and hardware settings, especially for wired ethernet devices. + +You can change ethernet card parameters as required, including auto-negotiation, Speed, Duplex and Wake-on LAN. + +The configuration of your Ethernet card allows your computer to communicate effectively over the network. + +This tool provides many information about Ethernet devices connected to your Linux system. + +In this article, we will show you how to change the below parameters and how to view them. + +This article will help you troubleshoot Ethernet card related problems on a Linux system. + +The following information will help you understand how Ethernet card works. + + * **Half Duplex:** Half-duplex mode allows a device to either send or receive packets at a time. + * **Full Duplex:** Full-duplex mode allows a device to send and receive packets simultaneously. + * **Auto-Negotiation:** Auto-negotiation is a mechanism that allows a device to automatically choose the best network speed and mode of operation (full-duplex or half-dual mode). + * **Speed:** By default it uses maximum speed and you can change it according to your need. + * **Link detection:** Link detection shows the status of the network interface card. If it shows “no” then try restarting the interface. If the link detection still says “no”, check if there are any issues with the cables connected between the switch and the system. + + + +### How to Install ethtool on Linux + +By default ethtool should already be installed on most systems. If not, you can install it from the distribution official repository. + +For **RHEL/CentOS 6/7** systems, use the **[yum command][1]** to install ethtool. + +``` +$ sudo yum install -y ethtool +``` + +For **RHEL/CentOS 8** and **Fedora** systems, use the **[dnf command][2]** to install ethtool. + +``` +$ sudo yum install -y ethtool +``` + +For **Debian** based systems, use the **[apt command][3]** or **[apt-get command][4]** to install ethtool. + +``` +$ sudo apt-get install ethtool +``` + +For **openSUSE** systems, use the **[zypper command][5]** to install ethtool. + +``` +$ sudo zypper install -y ethtool +``` + +For **Arch Linux** systems, use the **[pacman command][6]** to install ethtool. + +``` +$ sudo pacman -S ethtool +``` + +### How to Check the Available Network Interface on Linux + +You can use the **[ip command][7]** or the **ifconfig command** (deprecated in modern distribution) to verify the name and other details of the available and active network interfaces. + +``` +# ip a +or +# ifconfig + +1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever +2: eth0: mtu 1500 qdisc mq state UP group default qlen 1000 + link/ether 00:10:22:35:23:sf brd ff:ff:ff:ff:ff:ff + inet 192.164.23.100/24 brd 192.164.23.255 scope global eth0 + valid_lft forever preferred_lft forever +``` + +### How to Check Network Interface Card (NIC) Information on Linux + +Once you have the Ethernet interface name, you can easily check the details of it using the ethtool command as shown below. + +On Linux, each network interface card (NIC) is assigned unique names, such as ethX, enpXXX, and so on. + + * The older Linux distribution used the **eth[X]** format. For example, RHEL 6 and their older versions. + * Modern Linux distributions use **enp[XXX]** or **ens[XXX]** formats. For example, most of the modern Linux distribution uses this format, including RHEL 7, Debian 10, Ubuntu 16.04 LTS. + + + +``` +# ethtool eth0 + +Settings for eth0: + Supported ports: [ TP ] + Supported link modes: 1000baseT/Full + 10000baseT/Full + Supported pause frame use: No + Supports auto-negotiation: No + Supported FEC modes: Not reported + Advertised link modes: Not reported + Advertised pause frame use: No + Advertised auto-negotiation: No + Advertised FEC modes: Not reported + Speed: 10000Mb/s + Duplex: Full + Port: Twisted Pair + PHYAD: 0 + Transceiver: internal + Auto-negotiation: off + MDI-X: Unknown + Supports Wake-on: uag + Wake-on: d + Link detected: yes +``` + +### How to Check Ethernet Card Driver and Firmware Version on Linux + +You can check driver version, firmware version, and bus details using the ethtool command with the **“-i”** option as shown below. + +``` +# ethtool -i eth0 + +driver: vmxnet3 +version: 1.4.16.0-k-NAPI +firmware-version: +expansion-rom-version: +bus-info: 0000:0b:00.0 +supports-statistics: yes +supports-test: no +supports-eeprom-access: no +supports-register-dump: yes +supports-priv-flags: no +``` + +### How to Check Network Usage Statistics on Linux + +You can view network usage statistics using the ethtool command with the **“-S”** option. It shows the bytes transferred, received, errors etc. + +``` +# ethtool -S eth0 + +NIC statistics: + Tx Queue#: 0 + TSO pkts tx: 2053 + TSO bytes tx: 7167572 + ucast pkts tx: 4028081 + ucast bytes tx: 399093197 + mcast pkts tx: 0 + mcast bytes tx: 0 + bcast pkts tx: 0 + bcast bytes tx: 0 + pkts tx err: 0 + pkts tx discard: 0 + drv dropped tx total: 0 + too many frags: 0 + giant hdr: 0 + hdr err: 0 + tso: 0 + ring full: 0 + pkts linearized: 0 + hdr cloned: 0 + giant hdr: 0 + Tx Queue#: 1 + TSO pkts tx: 1955 + TSO bytes tx: 6536945 + ucast pkts tx: 3711838 + ucast bytes tx: 346309662 + mcast pkts tx: 0 + mcast bytes tx: 0 + bcast pkts tx: 1186 + bcast bytes tx: 49812 + pkts tx err: 0 + pkts tx discard: 0 + drv dropped tx total: 0 + too many frags: 0 + giant hdr: 0 + hdr err: 0 + tso: 0 + ring full: 0 + pkts linearized: 0 + hdr cloned: 0 + giant hdr: 0 + Rx Queue#: 0 + LRO pkts rx: 0 + LRO byte rx: 0 + ucast pkts rx: 5084776 + ucast bytes rx: 4673133395 + mcast pkts rx: 0 + mcast bytes rx: 0 + bcast pkts rx: 154143 + bcast bytes rx: 45415676 + pkts rx OOB: 0 + pkts rx err: 0 + drv dropped rx total: 0 + err: 0 + fcs: 0 + rx buf alloc fail: 0 + Rx Queue#: 1 + LRO pkts rx: 0 + LRO byte rx: 0 + ucast pkts rx: 6346769 + ucast bytes rx: 4835534292 + mcast pkts rx: 0 + mcast bytes rx: 0 + bcast pkts rx: 3464 + bcast bytes rx: 714646 + pkts rx OOB: 0 + pkts rx err: 0 + drv dropped rx total: 0 + err: 0 + fcs: 0 + rx buf alloc fail: 0 + tx timeout count: 0 +``` + +### How to Change the Speed of Ethernet Device on Linux + +You can change the speed of the Ethernet as needed. When you make this change the interface will automatically go offline and you will need to bring it back online using the **[ifup command][8]** or the ip command or the nmcli command. + +``` +# ethtool -s eth0 speed 100 +# ip link set eth0 up +``` + +### How to Enable/Disable Auto-Negotiation for Ethernet Device on Linux + +You can enable or disable Auto-Negotiation using the ethtool command with the **“autoneg”** option as shown below. + +``` +# ethtool -s eth0 autoneg off +# ethtool -s eth0 autoneg on +``` + +### How to Change Multiple Parameters at Once + +If you want to change multiple parameters of the Ethernet interface simultaneously using the ethtool command, use the format below. + +``` +Syntax: +ethtool –s [device_name] speed [10/100/1000] duplex [half/full] autoneg [on/off] +``` + +``` +# ethtool –s eth0 speed 1000 duplex full autoneg off +``` + +### How to Check Auto-negotiation, RX and TX of a Particular Interface on Linux + +To view auto-negotiation details about a specific Ethernet device, use the below format. + +``` +# ethtool -a eth0 +``` + +### How to Identify a Specific NIC from Multiple Devices (Blink LED Port of NIC Card) + +This option is very useful if you want to identify a specific physical interface port among others. The below ethtool command blink the LED of the eth0 port. + +``` +# ethtool -p eth0 +``` + +### How to Set These Parameters in Linux Permanently + +After a system restarts the changes you made with ethtool will be reverted by default. + +To make custom settings permanent, you need to update your value in the network configuration file. Depending on your Linux distribution you may need to update this value to the correct file. + +For RHEL based systems. You must use the ETHTOOL_OPTS variables. + +``` +# vi /etc/sysconfig/network-scripts/ifcfg-eth0 + +ETHTOOL_OPTS="speed 1000 duplex full autoneg off" +``` + +For **Debian** based systems. + +``` +# vi /etc/network/interfaces + +post-up ethtool -s eth0 speed 1000 duplex full autoneg off +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-ethtool-command-view-change-ethernet-adapter-settings-nic-card/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/linux-yum-command-examples-manage-packages-rhel-centos-systems/ +[2]: https://www.2daygeek.com/linux-dnf-command-examples-manage-packages-fedora-centos-rhel-systems/ +[3]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[7]: https://www.2daygeek.com/ip-command-configure-network-interface-usage-linux/ +[8]: https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/ From fa9e6ca25d7097fd32ad4b5f3d4777f03c00de9c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:23:52 +0800 Subject: [PATCH 0804/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200520=20Fedo?= =?UTF-8?q?ra=20Silverblue,=20an=20introduction=20for=20developers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200520 Fedora Silverblue, an introduction for developers.md --- ...verblue, an introduction for developers.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20200520 Fedora Silverblue, an introduction for developers.md diff --git a/sources/tech/20200520 Fedora Silverblue, an introduction for developers.md b/sources/tech/20200520 Fedora Silverblue, an introduction for developers.md new file mode 100644 index 0000000000..a112f4ca6d --- /dev/null +++ b/sources/tech/20200520 Fedora Silverblue, an introduction for developers.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora Silverblue, an introduction for developers) +[#]: via: (https://fedoramagazine.org/fedora-silverblue-brings-future-tech-to-the-desktop/) +[#]: author: (Nick Hardiman https://fedoramagazine.org/author/nickhardiman/) + +Fedora Silverblue, an introduction for developers +====== + +![][1] + +The Fedora [Silverblue project][2] takes Fedora workstation, libostree and podman, puts them in a blender, and creates a new Immutable Fedora Workstation. Fedora Silverblue is an OS that stops you from changing the core system files arbitrarily, and readily allows you to change the environment system files. The article [What is Silverblue][3] describes the big picture, and this article drills down into details for the developer. + +Fedora Silverblue ties together a few different projects to make a system that is a git-like object, capable of layering packages, and has a container focused work flow. Silverblue is not the only distribution going down this road. It is the desktop equivalent of [CoreOS][4], the server OS used by [Red Hat Openshift][5]. + +Silverblue’s idea of ‘immutable’ has nothing to do with immutable layers in a container. Silverblue keeps system files immutable by making them read-only. + +### Why immutable? + +Has an upgrade left your system in an unusable state? Have you wondered why one server in a pool of identical machines is being weird? These problems can happen when one system library – one tiny little file out of hundreds – is corrupted, badly configured or the wrong version. Or maybe your upgrade works fine but it’s not what you’d hoped for, and you want to roll back to the previous state. + +An immutable OS is intended to stop problems like these biting you. This is not an easy thing to achieve – simple changes, like flipping the file system between read-write and read-only, may only change a fault-finding headache to a maintenance headache. + +Freezing the system is good news for sysadmins, but what about developers? Setting up a development environment means heavily customizing the system, and filling it with living code that changes over time. The answer is partly a case of combining components, and partly the ability to swap between OS versions. + +### How it works + +So how do you get the benefits of immutability without losing the ability to do your work? If you’re thinking ‘containers’, good guess – part of the solution uses [podman][6]. But much of the work happens underneath the container layer, at the OS level. + +Fedora Silverblue ties together a few different projects to turn an immutable OS into a usable workstation. Silverblue uses libostree to provide the base system, lets you edit config files in /etc/, and provides three different ways to install packages. + + * [rpm-ostree][7] installs RPM packages, similar to DNF in the traditional Fedora workstation. Use this for things that shouldn’t go in containers, like KVM/libvirt. + * [flatpak][8] installs packages from a central flathub repo. This is the one-stop shop for graphical desktop apps like LibreOffice. + * The traditional _dnf install_ still works, but only inside a [toolbox][9] (a Fedora container). A developer’s workbench goes in a toolbox. + + + +If you want to know more about these components, check out [Pieces of Silverblue][10]. + +### Rolling back and pinning upgrades + +All operating systems need upgrades. Features are added, security holes are plugged and bugs are squashed. But sometimes an upgrade is not a developer’s friend. + +A developer depends on many things to get the job done. A good development environment is stuffed with libraries, editors, toolchains and apps that are controlled by the OS, not the developer. An upgrade may cause trouble. Have any of these situations happened to you? + + * A new encryption library is too strict, and an upgrade stopped an API working. + * Code works well, but has deprecated syntax. An upgrade brought error-throwing misery. + * The development environment is lovingly hand-crafted. An upgrade broke dependencies and added conflicts. + + + +In a traditional environment, unpicking a troublesome upgrade is hard. In Silverblue, it’s easy. Silverblue keeps two copies of the OS – your current upgrade and your previous version. Point the OS at the previous version, reboot, and you’ve got your old system files back. + +You aren’t limited to two copies of your file system – you can keep more by pinning your favorite versions. Dusty Mabe, one of the engineers who has been working on the system since the [Project Atomic][11] days, describes how to pin extra copies of the OS in his article [Pinning Deployments in OSTree Based Systems][12]. + +Your home directory is not affected by rolling back. Rpm-ostree does not touch /etc/ and /var/. + +### System updates and package installs + +Silverblue’s rpm-ostree treats all the files as one object, stored in a repository. The working file system is a checked-out copy of this object. After a system update, you get two objects in that repository – one current object and one updated object. The updated object is checked out and becomes the new file system. + +You install your workhorse applications in toolboxes, which provide container isolation. And you install your desktop applications using Flatpak. + +This new OS requires a shift in approach. For instance, you don’t have to keep only one copy of your system files – you can store a few and select which one you use. That means you can swap back and forth between an old Fedora release and the rawhide (development) version in a matter of minutes. + +### Build your own Silverblue VM + +You can safely install Fedora Silverblue in a VM on your workstation. If you’ve got a hypervisor and half an hour to spare (10 minutes for ISO download, and 20 minutes for the build), you can see for yourself. + + 1. Download Fedora Silverblue ISO from + 2. (not Fedora workstation from ). + 3. Boot a VM with the Fedora Silverblue ISO. You can squeeze Fedora into compute resources of 1 CPU, 1024MiB of memory and 12GiB of storage, but bigger is better. + 4. Answer [Anaconda][13]’s questions. + 5. Wait for the [Gnome][14] desktop to appear. + 6. Answer [Initial Setup][15]’s questions. + + + +Then you’re ready to set up your developer’s tools. If you’re looking for an IDE, check these out. Use flatpak on the desktop to install them. + + * [Gnome Builder][16] (Gnome’s official IDE) + * [Eclipse][17] + * [Code::Blocks][18] + + + +Finally, use the CLI to create your first toolbox. Load it with modules using [npm][19], [gem][20], [pip][21], [git][22] or your other favorite tools. + +### Help! + +If you get stuck, ask questions at the [forum][23]. + +If you’re looking for ideas about how to use Silverblue, read articles in the [magazine][24]. + +### Is Silverblue for you? + +Silverblue is full of shiny new tech. That in itself is enough to attract the cool kids, like moths to a flame. But this OS is not for everyone. It’s a young system, so some bugs will still be lurking in there. And pioneering tech requires a change of habit – that’s extra cognitive load that the new user may not want to take on. + +The OS brings immutable benefits, like keeping your system files safe. It also brings some drawbacks, like the need to reboot after adding system packages. Silverblue also enables new ways of working. If you want to explore new directions in the OS, find out if Silverblue brings benefits to your work. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-silverblue-brings-future-tech-to-the-desktop/ + +作者:[Nick Hardiman][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/nickhardiman/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/silverblue-introfordev-816x345.png +[2]: https://silverblue.fedoraproject.org/ +[3]: https://fedoramagazine.org/what-is-silverblue/ +[4]: http://coreos.com/ +[5]: https://www.openshift.com/products/container-platform +[6]: https://github.com/containers/libpod +[7]: https://rpm-ostree.readthedocs.io/en/latest/ +[8]: https://docs.flatpak.org/en/latest/ +[9]: https://github.com/containers/toolbox +[10]: https://fedoramagazine.org/pieces-of-fedora-silverblue/ +[11]: https://www.projectatomic.io/ +[12]: https://www.projectatomic.io/blog/2018/05/pinning-deployments-ostree-based-systems/ +[13]: https://fedoraproject.org/wiki/Anaconda +[14]: https://www.gnome.org/ +[15]: https://fedoraproject.org/wiki/InitialSetup +[16]: https://wiki.gnome.org/Apps/Builder +[17]: https://www.eclipse.org/ide/ +[18]: http://www.codeblocks.org/ +[19]: https://www.npmjs.com/package/package +[20]: https://rubygems.org/ +[21]: https://pypi.org/ +[22]: https://git-scm.com/ +[23]: https://discussion.fedoraproject.org/c/desktop/silverblue/6 +[24]: https://fedoramagazine.org/?s=silverblue From 9a81323aeb5689bbd03073a0a69c98e589c3110e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:24:06 +0800 Subject: [PATCH 0805/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200518=20Usin?= =?UTF-8?q?g=20Fedora=20to=20implement=20REST=20API=20in=20JavaScript:=20p?= =?UTF-8?q?art=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200518 Using Fedora to implement REST API in JavaScript- part 2.md --- ...mplement REST API in JavaScript- part 2.md | 208 ++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 sources/tech/20200518 Using Fedora to implement REST API in JavaScript- part 2.md diff --git a/sources/tech/20200518 Using Fedora to implement REST API in JavaScript- part 2.md b/sources/tech/20200518 Using Fedora to implement REST API in JavaScript- part 2.md new file mode 100644 index 0000000000..b02822c4fa --- /dev/null +++ b/sources/tech/20200518 Using Fedora to implement REST API in JavaScript- part 2.md @@ -0,0 +1,208 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Fedora to implement REST API in JavaScript: part 2) +[#]: via: (https://fedoramagazine.org/using-fedora-to-implement-rest-api-in-javascript-part-2/) +[#]: author: (Vaclav Keil https://fedoramagazine.org/author/vaclavk/) + +Using Fedora to implement REST API in JavaScript: part 2 +====== + +![][1] + +In [part 1][2] previously, you saw how to quickly create a simple API service using Fedora Workstation, Express, and JavaScript. This article shows you the simplicity of how to create a new API. This part shows you how to: + + * Install a DB server + * Build a new route + * Connect a new datasource + * Use Fedora terminal to send and receive data + + + +### Generating an app + +Please refer to the [previous article][2] for more details. But to make things simple, change to your work directory and generate an app skeleton. +``` + +``` + +$ cd our-work-directory +$ npx express-generator –no-view –git /myApp +$ cd myApp +$ npm i +``` + +``` + +### Installing a database server + +In this part, we’ll install MariaDB database. MariaDB is the Fedora default database. + +``` +$ dnf module list mariadb | sort -u ## lists the streams available +$ sudo dnf module install mariadb:10.3 ##10.4 is the latest +``` + +_Note: the default profile is mariadb/server_. + +For those who need to spin up a Docker container a ready made container with Fedora 31 is available. + +``` +$ docker pull registry.fedoraproject.org/f31/mariadb +$ docker run -d --name mariadb_database -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 registry.fedoraproject.org/f31/mariadb +``` + +Now start the MariaDB service. + +``` +$ sudo systemctl start mariadb +``` + +If you’d like the service to start at boot, you can also enable it in systemd: + +``` +$ sudo systemctl enable mariadb ## start at boot +``` + +Next, setup the database as needed: + +``` +$ mysql -u root -p ## root password is blank +MariaDB> CREATE DATABASE users; +MariaDB> create user dbuser identified by ‘123456‘; +MariaDB> grant select, insert, update, create, drop on users.* to dbuser; +MariaDB> show grants for dbuser; +MariaDB> \q +``` + +A database connector is needed to use the database with Node.js. + +``` +$ npm install mariadb ## installs MariaDB Node.js connector +``` + +We’ll leverage Sequelize in this sample API. Sequelize is a promise-based Node.js ORM (Object Relational Mapper) for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server. + +``` +$ npm install sequelize ## installs Sequelize +``` + +### Connecting a new datasource + +Now, create a new _db_ folder and create a new file _sequelize.js_ there: + +``` +const Sequelize = require('sequelize'), + sequelize = new Sequelize(process.env.db_name || 'users', process.env.db_user || 'dbuser', process.env.db_pass || '123456', { + host: 'localhost', + dialect: 'mariadb', + ssl: true +}) + +module.exports = sequelize +``` + +_Note: For the sake of completeness I‘m including a link to the related Github repo: _ + +Let‘s create a new file _models/user.js_. A nice feature of a Sequelize model is that it helps us to create the necessary tables and colums automatically. The code snippet responsible for doing this is seen below: + +``` +sequelize.sync({ +force: false +}) +``` + +Note: never switch to true with a production database – it would _drop your tables at app start_! + +We will refer to the earlier created sequelize.js this way: + +``` +const sequelize = require('../db/sequelize') +``` + +### Building new routes + +Next, you’ll create a new file _routes/user.js_. You already have _routes/users.js_ from the previous article. You can copy and paste the code in and proceed with editing it. + +You’ll also need a reference to the previously created model. + +``` +const User = require('../models/user') +``` + +Change the route path to _/users_ and also create a new **post** method route. + +Mind the async – await keywords there. An interaction with a database will take some time and this one will do the trick. Yes, an async function returns a promise and this one makes promises easy to use. + +_Note: This code is not production ready, since it would also need to include an authentication feature._ + +We‘ll make the new route working this way: + +``` +const userRouter = require('./routes/user') +app.use(userRouter) +``` + +Let‘s also remove the existing _usersRouter_. The _routes/users.js_ can be deleted too. + +``` +$ npm start +``` + +With the above command, you can launch your new app. + +### Using the terminal to send and retrieve data + +Let’s create a new database record through the post method: + +``` +$ curl -d 'name=Adam' http://localhost:3000/users +``` + +To retrieve the data created through the API, do an HTTP GET request: + +``` +$ curl http://localhost:3000/users +``` + +The console output of the curl command is a JSON array containing data of all the records in the _Users_ table. + +_Note: This is not really the usual end result — an application consumes the API finally. The API will usually also have endpoints to update and remove data._ + +### More automation + +Let‘s assume we might want to create an API serving many tables. It‘s possible and very handy to automatically generate models for Sequelize from our database. Sequelize-auto will do the heavy lifting for us. The resulting files (_models.js_) would be placed and imported within the _/models_ directory. + +``` +$ npm install sequelize-auto +``` + +A node.js connector is needed to use this one and we have it already installed for MariaDB. + +### Conclusion + +It‘s possible to develop and run an API using Fedora, Fedora default MariaDB, JavaScript and efficiently develop a solution like with a noSQL database. For those used to working with MongoDB or a similar noSQL database, Fedora and MariaDB are important open-source enablers. + +* * * + +_Photo by [Mazhar Zandsalimi][3] on [Unsplash][4]._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/using-fedora-to-implement-rest-api-in-javascript-part-2/ + +作者:[Vaclav Keil][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/vaclavk/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/05/javascript-api-2-816x345.jpg +[2]: https://fedoramagazine.org/using-fedora-to-quickly-implement-rest-api-with-javascript/ +[3]: https://unsplash.com/@m47h4r?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://unsplash.com/s/photos/javascript?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 9bb29f07dfc3b6c63abcbff79ef2412830cae589 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:24:20 +0800 Subject: [PATCH 0806/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200515=20The?= =?UTF-8?q?=20pieces=20of=20Fedora=20Silverblue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200515 The pieces of Fedora Silverblue.md --- ...0200515 The pieces of Fedora Silverblue.md | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 sources/tech/20200515 The pieces of Fedora Silverblue.md diff --git a/sources/tech/20200515 The pieces of Fedora Silverblue.md b/sources/tech/20200515 The pieces of Fedora Silverblue.md new file mode 100644 index 0000000000..04bd4e1643 --- /dev/null +++ b/sources/tech/20200515 The pieces of Fedora Silverblue.md @@ -0,0 +1,172 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The pieces of Fedora Silverblue) +[#]: via: (https://fedoramagazine.org/pieces-of-fedora-silverblue/) +[#]: author: (Nick Hardiman https://fedoramagazine.org/author/nickhardiman/) + +The pieces of Fedora Silverblue +====== + +![][1] + +Fedora Silverblue provides a useful workstation build on an immutable operating system. In “[What is Silverblue?][2]“, you learned about the benefits that an immutable OS provides. But what pieces go into making it? This article examines some of the technology that powers Silverblue. + +### The filesystem + +Fedora Workstation users may find the idea of an immutable OS to be the most brain-melting part of Silverblue. What does that mean? Find some answers by taking a look at the filesystem. + +At first glance, the layout looks pretty much the same as a regular Fedora file system. It has some differences, like making _/home_ a symbolic link to _/var/home_. And you can get more answers by looking at how libostree works. libostree treats the whole tree like it’s an object, checks it into a code repository, and checks out a copy for your machine to use. + +#### libostree + +The [libostree project][3] supplies the goods for managing Silverblue’s file system. It is an upgrade system that the user can control using [rpm-ostree commands][4]. + +libostree knows nothing about packages—an upgrade means replacing one complete file system with another complete file system. libostree treats the file system tree as one atomic object (an unbreakable unit). In fact, the forerunner to Silverblue was named [Project Atomic][5]. + +The libostree project provides a library and set of tools. It’s an upgrade system that carries out these tasks. + + 1. Pull in a new file system + 2. Store the new file system + 3. Deploy the new file system + + + +##### Pull in a new file system + +Pulling in a new file system means copying an object (the entire file system) from a remote source to its own store. If you’ve worked with virtual machine image files, you already understand the concept of a file system object that you can copy. + +##### Store the new file system + +The libostree store has some source code control qualities—it stores many file system objects, and checks one out to be used as the root file system. libostree’s store has two parts: + + * a repository database at _/sysroot/ostree/repo/_ + * file systems in _/sysroot/ostree/deploy/fedora/deploy/_ + + + +libostree keeps track of what’s been checked in using commit IDs. Each commit ID can be found in a directory name, nested deep inside _/sysroot_ .A libostree commit ID is a long checksum, and looks similar to a git commit ID. + +``` +$ ls -d /sysroot/ostree/deploy/fedora/deploy/*/ +/sysroot/ostree/deploy/fedora/deploy/c4bf7a6339e6be97d0ca48a117a1a35c9c5e3256ae2db9e706b0147c5845fac4.0/ +``` + +_rpm-ostree status_ gives a little more information about that commit ID. The output is a little confusing; it can take a while to see this file system is Fedora 31. + +``` +$ rpm-ostree status +State: idle +AutomaticUpdates: disabled +Deployments: +● ostree://fedora:fedora/31/x86_64/silverblue + Version: 31.1.9 (2019-10-23T21:44:48Z) + Commit: c4bf7a6339e6be97d0ca48a117a1a35c9c5e3256ae2db9e706b0147c5845fac4 + GPGSignature: Valid signature by 7D22D5867F2A4236474BF7B850CB390B3C3359C4 +``` + +##### Deploy the new filesystem + +libostree deploys a new file system by checking out the new object from its store. libostree doesn’t check out a file system by copying all the files—it uses hard links instead. If you look inside the commit ID directory, you see something that looks suspiciously like the root directory. That’s because it _is_ the root directory. You can see these two directories are pointing to the same place by checking their inodes. + +``` +$ ls -di1 / /sysroot/ostree/deploy/fedora/deploy/*/ +260102 / +260102 /sysroot/ostree/deploy/fedora/deploy/c4bf7a6339e6be97d0ca48a117a1a35c9c5e3256ae2db9e706b0147c5845fac4.0/ +``` + +This is a fresh install, so there’s only one commit ID. After a system update, there will be two. If more copies of the file system are checked into libostree’s repo, more commit IDs appear here. + +##### Upgrade process + +Putting the pieces together, the update process looks like this: + + 1. libostree checks out a copy of the file system object from the repository + 2. DNF installs packages into the copy + 3. libostree checks in the copy as a new object + 4. libostree checks out the copy to become the new file system + 5. You reboot to pick up the new system files + + + +In addition to more safety, there is more flexibility. You can do new things with libostree’s repo, like store a few different file systems and check out whichever one you feel like using. + +#### Silverblue’s root file system + +Fedora keeps its system files in all the usual Linux places, such as _/boot_ for boot files, _/etc_ for configuration files, and _/home_ for user home directories. The root directory in Silverblue looks much like the root directory in traditional Fedora, but there are some differences. + + * The filesystem has been checked out by libostree + * Some directories are now symbolic links to new locations. For example, _/home_ is a symbolic link to _/var/home_ + * _/usr_ is a read-only directory + * There’s a new directory named _/sysroot_. This is libostree’s new home + + + +#### Juggling file systems + +You can store many file systems and switch between them. This is called _rebasing_, and it’s similar to git rebasing. In fact, upgrading Silverblue to the next Fedora version is not a big package install—it’s a pull from a remote repository and a rebase. + +You could store three copies with three different desktops: one KDE, one GNOME, and one XFCE. Or three different OS versions: how about keeping the current version, the nightly build, and an old classic? Switching between them is a matter of rebasing to the appropriate file system object. + +Rebasing is also how you upgrade from one Fedora release to the next. See “[How to rebase to Fedora 32 on Silverblue][6]” for more information. + +### Flatpak + +The [Flatpak project][7] provides a way of installing applications like LibreOffice. Applications are pulled from remote repositories like [Flathub][8]. It’s a kind of package manager, although you won’t find the word _package_ in the [docs][9]. Traditional Fedora variants like Fedora Workstation can also use Flatpak, but the sandboxed nature of flatpaks make it particularly good for Silverblue. This way you do not have to do the entire ostree update process every time you wish to install an application. + +Flatpak is well-suited to desktop applications, but also works for command line applications. You can install the [vim][10] editor with the command _flatpak install flathub org.vim.Vim_ and run it with _flatpak run org.vim.Vim_. + +### toolbox + +The [toolbox project][11] provides a traditional operating system inside a container. The idea is that you can mess with the mutable OS inside your toolbox (the Fedora container) as much as you like, and leave the immutable OS outside your toolbox untouched. You pack as many toolboxes as you want on your system, so you can keep work separated. Behind the scenes, the executable _/usr/bin/toolbox_ is a shell script that uses [podman][12]. + +A fresh install does not include a default toolbox. The _toolbox create_ command checks the OS version (by reading _/usr/lib/os-release_), looks for a matching version at the Fedora container registry, and downloads the container. + +``` +$ toolbox create +Image required to create toolbox container. +Download registry.fedoraproject.org/f31/fedora-toolbox:31 (500MB)? [y/N]: y +Created container: fedora-toolbox-31 +Enter with: toolbox enter +``` + +Hundreds of packages are installed inside the toolbox. The _dnf_ command and the usual Fedora repos are set up, ready to install more. The _ostree_ and _rpm-ostree_ commands are not included – no immutable OS here. + +Each user’s home directory is mounted on their toolbox, for storing content files outside the container. + +### Put the pieces together + +Spend some time exploring Fedora Silverblue and it will become clear how these components fit together. Like other Fedora variants, all these of tools come from open source projects. You can get as up close and personal as you want, from reading their docs to contributing code. Or you can [contribute to Silverblue][13] itself. + +Join the Fedora Silverblue conversations on [discussion.fedoraproject.org][14] or in [#silverblue on Freenode IRC][15]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/pieces-of-fedora-silverblue/ + +作者:[Nick Hardiman][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/nickhardiman/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/silverblue-pieces-816x345.png +[2]: https://fedoramagazine.org/what-is-silverblue/ +[3]: https://ostree.readthedocs.io/en/latest/ +[4]: https://rpm-ostree.readthedocs.io/en/latest/manual/administrator-handbook/#administering-an-rpm-ostree-based-system +[5]: https://www.projectatomic.io/ +[6]: https://fedoramagazine.org/how-to-rebase-to-fedora-32-on-silverblue/ +[7]: https://github.com/flatpak/flatpak +[8]: https://flathub.org/ +[9]: http://docs.flatpak.org/en/latest/index.html +[10]: https://www.vim.org/ +[11]: https://github.com/containers/toolbox +[12]: https://github.com/containers/libpod +[13]: https://silverblue.fedoraproject.org/contribute +[14]: https://discussion.fedoraproject.org/c/desktop/silverblue +[15]: https://webchat.freenode.net/#silverblue From a4cc8a15aa367e117409b5cfc7d565c150ed0738 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:24:34 +0800 Subject: [PATCH 0807/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200511=20How?= =?UTF-8?q?=20to=20manage=20network=20services=20with=20firewall-cmd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200511 How to manage network services with firewall-cmd.md --- ...nage network services with firewall-cmd.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 sources/tech/20200511 How to manage network services with firewall-cmd.md diff --git a/sources/tech/20200511 How to manage network services with firewall-cmd.md b/sources/tech/20200511 How to manage network services with firewall-cmd.md new file mode 100644 index 0000000000..5bfc5d947f --- /dev/null +++ b/sources/tech/20200511 How to manage network services with firewall-cmd.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to manage network services with firewall-cmd) +[#]: via: (https://fedoramagazine.org/how-to-manage-network-services-with-firewall-cmd/) +[#]: author: (dan01 https://fedoramagazine.org/author/dan01/) + +How to manage network services with firewall-cmd +====== + +![][1] + +In a previous article, you explored how to [control the firewall at the command line][2] in Fedora. + +Now you are going to see how to see how _add_, _remove_, and _list_ _services_, _protocols_ and _ports_ in order to _block_ or _allow_ them. + +### A short recap + +First, it’s a good idea to check the _status_ of your firewall, see if it’s running or not. You do this, as we previously learned, by using the state option (_firewall-cmd_ ‐‐_state_). + +The next step is to get the zone for the desired network interface. For example, I use a desktop that has two network interfaces: a _physical_ interface (_enp0s3_), representing my actual _network card_ and a _virtual_ interface (_virbr0_) used by virtualization software like _KVM_. To see what zones are active, run _firewall-cmd ‐‐get-active-zones_. + +Now that you know what zone you’re interested in, you can list the rules for the zone with _firewall-cmd ‐‐info-zone=FedoraWorkstation_. + +### Reading zone information + +To display information for a particular _zone_, run _firewall-cmd ‐‐zone=ZoneName ‐‐list-all_, or simply display information for the default zone with: + +``` +[dan@localhost ~]$ firewall-cmd --list-all +FedoraWorkstation (active) +target: default +icmp-block-inversion: no +interfaces: enp0s3 +sources: +services: dhcpv6-client mdns samba-client ssh +ports: 1025-65535/udp 1025-65535/tcp +protocols: +masquerade: no +forward-ports: +source-ports: +icmp-blocks: +rich rules: +``` + +Now, let’s explore the output. The first line is showing which _zone_ the following information applies to and if that zone is currently in use. + +The _target_ : _default_ simply tells us this is the default zone. This can be set or retrieved via the _‐‐set-default-zone=ZoneName_ and _‐‐get-default-zone_. + +_icmp-block-inversion_, indicates if [ICMP][3] requests are blocked. For example if the machine responds to _ping_ requests from other machines on the network. The _interfaces_ field shows all interfaces that adopt this zone. + +### Handling services, ports, and protocols + +Now focus on the _services_, _ports_, and _protocols_ rows. By default, the firewall will block all ports, services and protocols. Only the listed ones will be allowed. + +You can see the allowed services are very basic client services in this case. For example, accessing a shared folder on the network (_samba-client_), to talk to a _DNS_ server or connect to a machine via SSH (the _ssh_ service). You can think of a _service_ as a protocol in combination to a port, for instance the ssh service is using the SSH protocol and, by convention, port 22. By allowing the ssh service, what you’re really doing is allowing incoming connections that use the ssh protocol at default port 22. + +Notice, services that have the _client_ word in their name, as a rule of thumb, refer to outgoing connections, i.e. _connections_ that you make with your IP as source going to the outside, as opposed to the SSH **service, for example, that will accept incoming connections (listening to connection coming from outside at you). + +You can look up services in the file _/etc/services_. For example if you wish to know what port and protocol these service uses: + +``` +[dan@localhost ~]$ cat /etc/services | grep ssh +ssh 22/tcp # The Secure Shell (SSH) Protocol +ssh 22/udp # The Secure Shell (SSH) Protocol +``` + +You can see SSH uses both TCP and UDP port 22. Also, if you wish to see all available services, just use _firewall-cmd ‐‐get-services_. + +#### Opening a port + +If you want to block a port, service, or protocol, all you have to do if make sure it’s not listed here. By extension, if you want to allow a service, you need add it to your list. + +Let’s say you want to open the port _5000_ for _TCP_ ****connection. To do this, run: + +``` +sudo firewall-cmd --zone=FedorwaWorkstation --permanent --add-port=5000/tcp +``` + +Notice that you need to specify the zone for which the rule applies. When you add the rule, you also need to specify if it is a _TCP_ or _UDP_ port via as indicated above. The _permanent_ parameter sets the rule to persist even after a system reboot. + +Look at the information for your zone again: + +``` +[dan@localhost ~]$ firewall-cmd --list-all +FedoraWorkstation (active) +target: default +icmp-block-inversion: no +interfaces: enp0s3 +sources: +services: dhcpv6-client mdns samba-client ssh +ports: 1025-65535/udp 1025-65535/tcp 5000/tcp +protocols: +masquerade: no +forward-ports: +source-ports: +icmp-blocks: +rich rules: +``` + +Similarly, if you wish to remove this port from the list, run: + +``` +sudo firewall-cmd --zone=FedorwaWorkstation --permanent --remove-port=5000/tcp +``` + +The very same _remove_ (_‐‐remove-protocol_, _‐‐remove-service_) and _add_ (_‐‐add-protocol_, _‐‐add-service_) options are also available for _services_ and _protocols_. + +* * * + +_Photo by [T. Kaiser][4] on [Unsplash][5]_. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-manage-network-services-with-firewall-cmd/ + +作者:[dan01][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/dan01/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/05/services-firewall-cmd-816x345.jpg +[2]: https://fedoramagazine.org/control-the-firewall-at-the-command-line/ +[3]: https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol +[4]: https://unsplash.com/@tkaiser?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[5]: https://unsplash.com/s/photos/poke-hole?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 10715ad02a9f2ee0e6aaee6124d19db770a95829 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:28:15 +0800 Subject: [PATCH 0808/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20Davi?= =?UTF-8?q?d=20vs=20Goliath!=20Microsoft=20and=20an=20Obscure=20KDE=20Proj?= =?UTF-8?q?ect=20Fight=20Over=20=E2=80=9CMAUI=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 David vs Goliath- Microsoft and an Obscure KDE Project Fight Over -MAUI.md --- ...an Obscure KDE Project Fight Over -MAUI.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20200525 David vs Goliath- Microsoft and an Obscure KDE Project Fight Over -MAUI.md diff --git a/sources/tech/20200525 David vs Goliath- Microsoft and an Obscure KDE Project Fight Over -MAUI.md b/sources/tech/20200525 David vs Goliath- Microsoft and an Obscure KDE Project Fight Over -MAUI.md new file mode 100644 index 0000000000..4ab2c75f54 --- /dev/null +++ b/sources/tech/20200525 David vs Goliath- Microsoft and an Obscure KDE Project Fight Over -MAUI.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (David vs Goliath! Microsoft and an Obscure KDE Project Fight Over “MAUI”) +[#]: via: (https://itsfoss.com/microsoft-maui-kde-row/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +David vs Goliath! Microsoft and an Obscure KDE Project Fight Over “MAUI” +====== + +Remember the [interview with Uri Herrera][1], the creator of [Nitrux Linux][2]? Uri also works on couple of other Linux-related projects and one of them is Maui project. + +The MauiKit (styled as MAUI) is an acronym for Multi-Adaptable User Interfaces. It is an open source framework for developing cross-platform applications. It’s been in development since 2018 and it is now a [part of KDE’s incubation program KDE Invent][3]. + +Why am I talking about Maui? Because Microsoft has [renamed one of its project (Xamarin.Forms) to .NET MAUI][4]. This MAUI in .NET MAUI stands for Multi-platform App UI. It is also a framework for building cross-platform application. + +You see the confusion here? Both MAUI projects are frameworks for building cross-platform applications. + +### The debate over the use of “MAUI” + +![][5] + +MauiKit developers are obviously [not happy with this move by Microsoft][6]. + +> We like to believe that this an unfortunate event caused by an oversight during the brainstorming session to select a new and appealing name for their product and not an attempt at using the brand weight and marketing-might that a corporation such as Microsoft and their subsidiary Xamarin possess to step over a competing framework. A UI framework that, as of today, is still the first result in Google when searching for the term “Maui UI framework” but that due to the might of GitHub (another Microsoft subsidiary) and Microsoft’s website (specifically, their blog) SEO that will change over time. + +A couple of issues were opened on the GitHub repository of .NET MAUI to bring their attention to this name clash. + +The discussion got heated as some Microsoft MVPs and contributors (not Microsoft employees) started making arguments like MauiKit is a small project with fewer GitHub stars and no big companies use it. + +Microsoft’s Program Manager [David Ortinau][7] closed the thread with the message, “official legal name is .NET Multi-platform App UI and MAUI is an acronym, code name. This has been through legal review”. + +![Microsoft’s official response][8] + +This is the [main thread][9] that you can follow on GitHub if you want. + +### Is it really an issue? + +It may seem like a non-issue at the first glance but two projects with the same aim and same name are bound to create confusion. It would have been best that Microsoft had avoided it altogether. + +By the way, this is not the first time Microsoft has a name clash with a Linux-related project. As [Phoronix noted][10], a few years ago it was GNOME developers frustrated with Microsoft over naming a project GVFS (later renamed to Virtual File System for Git) as it collided with their GVFS (GNOME Virtual File-System) + +By the looks of it, Microsoft is not going to backtrack on MAUI. It could even go ahead and trademark MAUI. They have got all the money and power after all. + +I wonder what would have been the case if an obscure small project used the same name as one of Microsoft’s projects. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/microsoft-maui-kde-row/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/nitrux-linux/ +[2]: https://nxos.org/ +[3]: https://invent.kde.org/maui/mauikit +[4]: https://devblogs.microsoft.com/dotnet/introducing-net-multi-platform-app-ui/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/david-vs-goliath.jpg?ssl=1 +[6]: https://nxos.org/news/official-statement-regarding-xamarin-forms-rebranding-as-maui/ +[7]: https://github.com/davidortinau +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/microsoft-response-maui.png?ssl=1 +[9]: https://github.com/dotnet/maui/issues/35 +[10]: https://www.phoronix.com/scan.php?page=news_item&px=Microsoft-KDE-MAUI From 9207fb03447d80e0434819047af8293002c85caf Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:28:50 +0800 Subject: [PATCH 0809/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20How?= =?UTF-8?q?=20to=20Properly=20Install=20and=20Setup=20KDE=20Plasma=20on=20?= =?UTF-8?q?Arch=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md --- ...tall and Setup KDE Plasma on Arch Linux.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md diff --git a/sources/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md b/sources/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md new file mode 100644 index 0000000000..afccc10512 --- /dev/null +++ b/sources/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Properly Install and Setup KDE Plasma on Arch Linux) +[#]: via: (https://itsfoss.com/install-kde-arch-linux/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +How to Properly Install and Setup KDE Plasma on Arch Linux +====== + +I believe you followed the [fantastic It’s FOSS guide on installing Arch Linux][1]. The guide ends with steps mentioning the installation procedure for [GNOME desktop][2]. + +Now, not everyone is a GNOME fan and several readers requested that we show them how to configure the [KDE desktop][3] on [Arch Linux][4]. + +And thus I created this guide to demonstrate the steps for properly installing and configuring KDE desktop (also known as KDE Plasma desktop) on Arch Linux. + +### How to install and setup KDE desktop environment on Arch Linux + +![][5] + +Please keep in mind that KDE doesn’t allow login as root directly. If you have installed Arch Linux and using it as root, you should create a new user and give it sudo rights for running commands as root. + +If you just have a bare minimum installation of Arch Linux, you probably are logging into a TTY terminal. If you are using some other desktop environment, steps remain the same. + +Let’s go! + +#### Step 1: Create a sudo user (if you have only root user) + +You can use the [useradd command][6] for creating a new user. I am creating user named dimitrios (that’s my name). You can use something that matches your name. + +The option -m creates a home directory for the newly created user. + +``` +useradd -m dimitrios +``` + +You should also set a password for this user. Use this command: + +``` +passwd dimitrios +``` + +Now that you have created the user, give it sudo access. First, install sudo and a [command line text editor][7] like [nano][8]: + +``` +pacman -S sudo nano +``` + +The configuration file for sudo is /etc/sudoers. It should always be edited with the visudo command. visudo locks the sudoers file, saves edits to a temporary file, and checks that file’s grammar before copying it to /etc/sudoers. + +To use nano as the visudo editor, use: + +``` +EDITOR=nano visudo +``` + +Add the following line like I do in the example, then save and exit. + +``` +dimitrios ALL=(ALL) ALL +``` + +![Adding Sudoer in Arch Linux][9] + +Save your changes and exit the editor. You now have a sudo user on Arch Linux. + +#### Step 2: Installing KDE Plasma desktop + +To run KDE desktop, you need the following packages: + + * [Xorg][10] group + * [KDE Plasma][3] Desktop Environment + * [Wayland][11] session for KDE Plasma + * [KDE applications][12] group (consists of KDE specific applications including the Dolphin manager and other useful apps) + + + +You can install of the above using the following command: + +``` +pacman -S xorg plasma plasma-wayland-session kde-applications +``` + +Once installed, enable the Display Manager and Network Manager services: + +``` +systemctl enable sddm.service +systemctl enable NetworkManager.service +``` + +Almost there. Shutdown your system: + +``` +shutdown now +``` + +Power on your system and you should see the KDE login. Do you remember the password you set up for your sudo user? Use it to login. + +![Arch KDE Plasma Desktop][13] + +#### What next? + +You may want to explore the [essential pacman commands][14], to know what’s going on with the [Arch User Repository][15] and learn more about [AUR helpers][16]. + +I hope you found this tutorial helpful in installing KDE desktop on Arch Linux. Please let us know in the comments below, if you encountered any obstacle or difficulty during the installation. + +What’s your favourite Desktop environment or Window Manager? Let us know and don’t forget to subscribe on our social media. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-kde-arch-linux/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-arch-linux/ +[2]: https://www.gnome.org/ +[3]: https://kde.org/plasma-desktop +[4]: https://www.archlinux.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/install-kde-arch-linux.png?ssl=1 +[6]: https://linuxhandbook.com/useradd-command/ +[7]: https://itsfoss.com/command-line-text-editors-linux/ +[8]: https://www.nano-editor.org/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/adding-sudoer-arch-linux.png?ssl=1 +[10]: https://wiki.archlinux.org/index.php/Xorg +[11]: https://wiki.archlinux.org/index.php/Wayland +[12]: https://www.archlinux.org/groups/x86_64/kde-applications/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/Arch-Plasma-desktop.jpg?fit=800%2C450&ssl=1 +[14]: https://itsfoss.com/pacman-command/ +[15]: https://itsfoss.com/aur-arch-linux/ +[16]: https://itsfoss.com/best-aur-helpers/ From ca0dfc6dcb034a7191028ca2ebe2ce527912a9c4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:29:02 +0800 Subject: [PATCH 0810/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20EU?= =?UTF-8?q?=20Parliament=20Strongly=20Recommends=20Developing=20and=20Usin?= =?UTF-8?q?g=20Open=20Source=20Software?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 EU Parliament Strongly Recommends Developing and Using Open Source Software.md --- ...veloping and Using Open Source Software.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20200525 EU Parliament Strongly Recommends Developing and Using Open Source Software.md diff --git a/sources/tech/20200525 EU Parliament Strongly Recommends Developing and Using Open Source Software.md b/sources/tech/20200525 EU Parliament Strongly Recommends Developing and Using Open Source Software.md new file mode 100644 index 0000000000..bfeb5635ce --- /dev/null +++ b/sources/tech/20200525 EU Parliament Strongly Recommends Developing and Using Open Source Software.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (EU Parliament Strongly Recommends Developing and Using Open Source Software) +[#]: via: (https://itsfoss.com/eu-parliament-recommends-open-source/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +EU Parliament Strongly Recommends Developing and Using Open Source Software +====== + +Europe is choosing open source more than ever. Not just limited to [EU Commissions’ decision to use Signal messaging app][1] but also [open science][2] and the [adoption of open source software by European universities][3]. + +Now, in a recent [press release][4] by the [European Pirate Party][5], it looks like the EU Parliament is urging EU institutions to use open-source software. All thanks to the Pirate amendments for encouraging the use of open-source software. + +The EU Parliament not just encourages the use of open-source software, but they have also advised to prioritize development of open-source software by the EU institutions. + +So, not just aiming to adopt using open-source software but to develop open-source software. And, that’s definitely good news! + +More use of open-source software, why not? To give you some more details, here’s what they mentioned in the press release: + +> **In practice, from now on, all IT solutions developed by and for the EU institutions will first need to be assessed against the possibility of using Open Source solutions. Assessments will then have to be reported back to the Budgetary Control Committee of the Parliament on an annual basis, during the discharge procedure. This is a strong call for enhancing our important citizens right to transparent and trustworthy information.** + +### Important decision to remove vendor lock-ins + +![Public Money Public Code Campaign][6] + +No matter who made this happen — this decision of preferring open-source software over proprietary will not just help the open-source community but also helps the EU institutions in a variety of ways. + +Especially, relying on open-source software removes the overhead of vendor lock-ins. In other words, an EU institution does not have to rely on vendor to manage/maintain the software. + +The press release also addressed this by mentioning: + +> It is essential for the European institutions to retain control over its own technical systems, especially in a context of disinformation and foreign interference. Open Source promotes local technical support, leads to rapid development of software and helps to avoid dependency on specific suppliers or vendor lock-in effects, which exist when only one company is in charge of software or even the entire IT infrastructure supply. + +Any responsible local organization can take up the task while the community can still help in any way it can. This could also reduce the cost of maintaining the software among other things like improving the security of a software in a collaborative manner. + +### Is this a big win for open-source community? + +![][7] + +Yes, and no. We’ve seen a lot of recommendations made by the governments (or the EU government in general) to choose open-source software to keep things more secure yet transparent. + +Pirate’s Vice-President of EU Parliament, **Marcel Kolaja**, mentions some advantages of this decision as well: + +_It’s a milestone for transparent and open digitization of the European institutions. From now on, the Open Source ecosystem has a stepping ground for offering Open Source solutions and the Pirates will gladly play the role of the guardians and will try to solve and highlight any attempt to bypass this strong recommendation. It’s a really important step to remove vendor lock-ins in the Parliament“_ + +So, this will definitely help them earn trust of their citizens by providing digital transparency while also encouraging public participation to improve the software as well. Of course, this will also help introduce the concept of open-source software to many who were unaware of it in some way. + +Also, ensuring open-source software for publicly financed software will enhance the meaning of freedom of speech/privacy/press. + +In a nutshell, these decisions do have a positive impact in one way or the other. + +But, the implementations of these decisions will decide how effective it’s going to be to put the words in action. + +### Wrapping Up + +I’m happy with the decision by EU Parliament here — even though I’m not a European. I guess, this should encourage other government bodies to take similar decisions or steps to ensure digital transparency while earning the trust of their citizens. + +To get more details on the decision, you can refer to the [official press release by the European Pirate Party][4]. + +What do you think about it? Let me know your thoughts in the comments below! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/eu-parliament-recommends-open-source/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/eu-commission-switches-to-signal/ +[2]: https://ec.europa.eu/research/openscience/index.cfm?pg=openaccess +[3]: https://opensource.com/article/20/5/open-source-higher-education +[4]: https://european-pirateparty.eu/european-parliament-strongly-recommends-any-software-developed-by-and-for-the-eu-institutions-to-be-made-publicly-available-under-free-and-open-source-software-licence/ +[5]: https://en.wikipedia.org/wiki/European_Pirate_Party +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/public-money-public-code.png?resize=800%2C420&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/eu-parliament-open-source.jpg?ssl=1 From 6ba0ab8899cf86263ced1a0be65a9cf6516626fa Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:29:16 +0800 Subject: [PATCH 0811/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20Lang?= =?UTF-8?q?uageTool=20Review:=20Free=20and=20Open=20Source=20Grammar=20Che?= =?UTF-8?q?cker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 LanguageTool Review- Free and Open Source Grammar Checker.md --- ...w- Free and Open Source Grammar Checker.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 sources/tech/20200525 LanguageTool Review- Free and Open Source Grammar Checker.md diff --git a/sources/tech/20200525 LanguageTool Review- Free and Open Source Grammar Checker.md b/sources/tech/20200525 LanguageTool Review- Free and Open Source Grammar Checker.md new file mode 100644 index 0000000000..afd1a08e49 --- /dev/null +++ b/sources/tech/20200525 LanguageTool Review- Free and Open Source Grammar Checker.md @@ -0,0 +1,155 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (LanguageTool Review: Free and Open Source Grammar Checker) +[#]: via: (https://itsfoss.com/languagetool-review/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +LanguageTool Review: Free and Open Source Grammar Checker +====== + +This week’s open source software highlight is [LanguageTool][1]. It is a proofreading software that checks the grammar, style and spelling in more than 20 languages. + +I have been using it for past several days and I feel confident enough to review it and share my experience with it. I have used the popular proofreading tool [Grammarly][2] in the past and I’ll make some comparison between these two tools. + +### LanguageTool: Open source proofreading software + +![][3] + +[LanguageTool][1] grammar checker is available in [multiple formats][4]: + + * You can copy-paste your text on its website. + * You can install browser extension that will check for errors as you type anything, anywhere in the web browser. + * You can install a Java-based desktop application for offline usage. + * You can install add-on for LibreOffice and MS Office. + * Add-ons are also [available for a number of other software][5] like Sublime Text, Thunderbird, Vim, Visual Studio Code etc. + * [Android app][6] is also available. + * API is also available if you want to use LanguageTool in your software or service. API offering comes under premium services. + + + +You can find source code of LanguageTool and its related assets on [their GitHub repository][7]. + +[LanguageTool also has a premium version][8] that you can purchase. The premium version offers additional error checks. + +I am using LanguageTool premium version as a browser extension. Almost all the writing I do is online and thus the browser extension is perfect for me. + +The most convenient way to try LanguageTool is by using its browser extension. Install the browser add-on and next time you type anything in the browser, LanguageTool will start checking your text for grammatical and spelling errors. It will also check for styling errors. + +### Experience with LanguageTool: How good is it? + +LanguageTool leaves a good first impression. It starts checking for errors as you start typing. + +Different types of errors have different color codes. Spelling mistakes are highlighted in red color, grammatical mistakes are in yellow colors and styling errors have a blueish shade. + +Clicking on the error suggestion replaces your text with the suggested one. You may also ignore the suggestion. You’ll also see number of issues identified by LanguageTool in the current text check. + +![Spelling mistake identified by LanguageTool][9] + +#### Personal dictionary + +You can also create your personal directory and add words in it. This is helpful because no proofreading tool can give a green light to technical terms like systemd, iptables and brand names like [WireGuard][10]. To avoid these words labeled as spelling mistakes, add them to your personal dictionary. + +You may edit your personal dictionary from your LanguageTool account. + +![LanguageTool Personal Dictionary][11] + +#### Details on the error suggestion + +If it finds grammatical errors, it also gives a quick explanation of the error. You can get more details by clicking the tool tip which takes you to a reputable external source. + +![You can get additional details on the errors][12] + +#### Synonym suggestion (in beta) + +If you double-click on a word, it will also suggest synonyms. + +![][13] + +#### Are there any privacy issues? + +If you use the online services of LanguageTool, your text is sent to their servers over an **encrypted** connection. All their servers are hosted at Hetzner Online GmbH in Germany. + +LanguageTool states that it doesn’t store any text that you check using its services. You can read their privacy policy [here][14]. + +The free to use languagetool.org website shows ads (there are no third-party ads in the browser add-on). To test their claim of “sending text over an encrypted server”, I typed sample text containing words like vacuum cleaner, laptop etc. + +Thankfully, the displayed ad on their website was nothing related to the text I typed. I haven’t noticed any vacuum cleaner ads on the websites I visit or on Facebook. That’s a good thing. + +#### It doesn’t work flawlessly all the time + +No software is perfect and LanguageTool is not an exception. While it is helpful in finding obvious spelling and grammatical mistakes, it struggles in some simple scenario. + +For example, if a sentence contains several blank spaces together, LanguageTool failed to find an issue with that. + +![Too many whitespaces and yet it went undetected][15] + +This is weird because if I look at their ‘error rules’, I can see a [whitespace repetition rule][16]. I think this rule is applicable only for the Java-based LanguageTool apps, not the browser add-on I am using. + +I also found some other cases where LanguageTool should have identified errors but it didn’t. For example, it didn’t alert for the missing ‘to’ in the text below: + +![LanguageTool fails to find the missing “to”][17] + +When I checked it against the [Grammarly free version][2], it was able to point it out. + +![Grammarly was quick to identify it][18] + +I also found an infinite loop of suggestion. It first suggests using syntaxes as plural of syntax. + +![Suggestion for using ‘syntaxes’][19] + +And then it doesn’t accept ‘syntaxes’ as a valid word. + +![And then it doesn’t accept ‘syntaxes’][20] + +I have seen such “infinite error loop” with Grammarly as well in the past, so I won’t be too hard on LanguageTool for such issues. + +### Conclusion + +Despite some hiccups, I am satisfied with LanguageTool proofreading tool. Both free and premium version are good enough for finding obvious spelling mistakes and grammatical errors. + +The premium version offers over 2500 additional error checks and it costs around $15-$70 per year depending on your geographical region. This is a lot cheaper than [Grammarly][2] which costs $140 per year. + +I opted for the premium version because it will help this open-source project. Premium users also get email support. + +You are not forced to go premium, of course. You can use the free version and if you have some questions or need support, there is a [community forum][21] that you can join for free. + +LanguageTool can certainly be considered one of the [essential open-source tools for writers][22]. I am going to continue using LanguageTool. If you find grammatical or spelling mistakes in It’s FOSS articles in the future, blame LanguageTool, not me. Just kidding :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/languagetool-review/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://languagetool.org/ +[2]: https://itsfoss.com/recommends/grammarly/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/languagetool.png?fit=800%2C593&ssl=1 +[4]: https://languagetool.org/compare +[5]: http://wiki.languagetool.org/software-that-supports-languagetool-as-a-plug-in-or-add-on +[6]: https://play.google.com/store/apps/details?id=org.softcatala.corrector +[7]: https://github.com/languagetool-org/ +[8]: https://languagetoolplus.com/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/langaugetool-error-detection.png?ssl=1 +[10]: https://itsfoss.com/wireguard/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/languagetool-personal-dictionary.png?ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/languagetool-error-explanation.png?ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/languagetool-synonym-suggestion.png?ssl=1 +[14]: https://languagetoolplus.com/legal/privacy +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/languagetool-whitespaces.png?ssl=1 +[16]: https://community.languagetool.org/rule/show/WHITESPACE_RULE?lang=en +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/languagetool-suggestion-3.jpg?fit=800%2C219&ssl=1 +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/languagetool-suggestion-grammarly.jpg?fit=800%2C272&ssl=1 +[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/languagetool-suggestion.png?ssl=1 +[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/languagetool-suggestion-1.png?ssl=1 +[21]: https://forum.languagetool.org/ +[22]: https://itsfoss.com/open-source-tools-writers/ From 2d30146fe39432d4f01154c8d2e247a0292d66ca Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:29:31 +0800 Subject: [PATCH 0812/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20In?= =?UTF-8?q?=20Free=20Software,=20the=20Community=20is=20the=20Most=20Impor?= =?UTF-8?q?tant=20Ingredient:=20Jerry=20Bezencon=20of=20Linux=20Lite=20[In?= =?UTF-8?q?terview]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 In Free Software, the Community is the Most Important Ingredient- Jerry Bezencon of Linux Lite -Interview.md --- ...Jerry Bezencon of Linux Lite -Interview.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/20200525 In Free Software, the Community is the Most Important Ingredient- Jerry Bezencon of Linux Lite -Interview.md diff --git a/sources/tech/20200525 In Free Software, the Community is the Most Important Ingredient- Jerry Bezencon of Linux Lite -Interview.md b/sources/tech/20200525 In Free Software, the Community is the Most Important Ingredient- Jerry Bezencon of Linux Lite -Interview.md new file mode 100644 index 0000000000..b34f3508de --- /dev/null +++ b/sources/tech/20200525 In Free Software, the Community is the Most Important Ingredient- Jerry Bezencon of Linux Lite -Interview.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (In Free Software, the Community is the Most Important Ingredient: Jerry Bezencon of Linux Lite [Interview]) +[#]: via: (https://itsfoss.com/linux-lite-interview/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +In Free Software, the Community is the Most Important Ingredient: Jerry Bezencon of Linux Lite [Interview] +====== + +You are probably aware of [Linux Lite][1]. It is a [lightweight Linux distribution][2] based on Ubuntu. If you have an older system with 1 GB of RAM, Linux Lite becomes an excellent choice for you. + +We have covered Linux Lite releases several times on It’s FOSS and if you are a regular reader, you would have come across it. + +![][3] + +We talked to Jerry Bezencon, the creator of Linux Lite project, to know some background details on this project. + +### Interview with Jerry Bezencon of Linux Lite + +Jerry is based in Auckland, New Zealand, and he devotes a good deal of time and effort on Linux Lite project. Jerry shares his vision of the project in this interview. + +_**Tell us about the origins of Linux Lite. When did you create it first and what made you create it in the first place?**_ + +Linux Lite was started in 2012 for 3 important reasons. One, I wanted to dispel myths that a Linux based operating system was hard to use. Two, at that time, there was a shortage of simple, intuitive desktop experiences on Linux that offered long-term support. Three, I had used Linux for over 10 years before starting Linux Lite. + +I felt I needed to give back to a community that had given so much to me. A community that taught me that by sharing code and knowledge, one could have a dramatically positive impact over peoples computing experiences. + +_**How is Linux Lite different from so many other Ubuntu-based distributions?**_ + +Our approach to problem solving and our support. The first sits within the system itself. Lite Tweaks is a good example of this. We try to think of all the things that could possibly go wrong with a computer system, then write applications that fix those problems as easily as possible, should they occur. There is a lot of foresight in the team. + +The second is our approach to support. This mainly comes in 2 forms. Our massive built-in and online Help Manual and [our large forum community][4] full of some of the nicest people I’ve ever dealt with in the free software and open source community. + +_**How do you and your team work on developing Linux Lite?**_ + +There are 24 hours in a day. With 6 – 8 hours for sleep and another 6 – 8 hours for my other job, that’s more than enough time to put towards any project, hobby or job, or all 3. + +I take a more professional approach to code writing. I’ll come up with an idea, mock-up the UI then write the base code, or the whole application myself. If I need help, I prefer to hire and pay via our generous donators, freelancers. + +That way I can set a budget, the user gets a solid, well-written application by a qualified professional who is fluent in that language, and get I exactly what I ask for on time and without the usual flame wars and egos that can exist in some teams. + +By using professional, paid programmers, I avoid all the negativity completely. Application writing has become an extremely peaceful and rewarding exercise. + +_**What are you most proud of about this project?**_ + +![Linux Lite Interview][5] + +I’m most proud of the community that has stayed loyal to us throughout the years. In a business, your staff are your most valuable asset, in free software, the community is the most important ingredient. + +_**What are your future plans with Linux Lite?**_ + +To always strive to look for ways to make a person’s computing experience simpler, faster and trouble free. Our target audience shouldn’t have to dive into the terminal to try and fix things. To continue to build a feature-complete operating system that is light on resources. + +_**What new features can we expect in Linux Lite in upcoming versions?**_ + +Due to tradition, we like to keep those as surprises. I never run out of ideas. Some nights I get no sleep because my mind is buzzing with ideas for our next application, or how to solve an ongoing, difficult bug. + +_**Are there any features that you really want to implement but haven’t been able to do so far?**_ + +You can always do more to enhance an operating system. I’m currently working on our most ambitious application to date. One that doesn’t need a GUI and that sits within the system, anticipates problems and solves them before they are seen by the user. It will have a Reports feature so that those who like to know what is going on, can see for themselves what the code is doing. It will, of course, be free software. My first foray into A.I. that I hope other Linux systems can benefit from in the future. + +_**Have you achieved the goal for which you started the project?**_ + +Goal setting is ongoing. There’s no such thing as the perfect operating system. But there is no harm in aiming for that. + +_**How can the users and readers help the project?**_ + +In the usual ways. Documentation, coding, volunteering on the Forums, buying merchandise, writing blogs, donating, making videos, starting websites like yours – the list goes on. + +* * * + +We hope you like reading about the background of open source projects. You may [read more interviews with various project leaders][6]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-lite-interview/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxliteos.com/ +[2]: https://itsfoss.com/lightweight-linux-beginners/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/Linux_Lite.jpg?ssl=1 +[4]: https://www.linuxliteos.com/forums/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/linux-lite-interview.png?ssl=1 +[6]: https://itsfoss.com/interviews/ From c7da27e4e28b56d43e13959b004d917019004109 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:29:49 +0800 Subject: [PATCH 0813/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20How?= =?UTF-8?q?=20to=20Install=20Linux=20Mint=20in=20VirtualBox=20[Screenshot?= =?UTF-8?q?=20Tutorial]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 How to Install Linux Mint in VirtualBox -Screenshot Tutorial.md --- ...Mint in VirtualBox -Screenshot Tutorial.md | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 sources/tech/20200525 How to Install Linux Mint in VirtualBox -Screenshot Tutorial.md diff --git a/sources/tech/20200525 How to Install Linux Mint in VirtualBox -Screenshot Tutorial.md b/sources/tech/20200525 How to Install Linux Mint in VirtualBox -Screenshot Tutorial.md new file mode 100644 index 0000000000..1fc324e817 --- /dev/null +++ b/sources/tech/20200525 How to Install Linux Mint in VirtualBox -Screenshot Tutorial.md @@ -0,0 +1,194 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Install Linux Mint in VirtualBox [Screenshot Tutorial]) +[#]: via: (https://itsfoss.com/install-linux-mint-in-virtualbox/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +How to Install Linux Mint in VirtualBox [Screenshot Tutorial] +====== + +_**Brief: One of safest and easiest ways to try Linux Mint is inside a virtual machine. Your real system doesn’t change at all. Learn how to install Linux Mint in VirtualBox in this tutorial.**_ + +[Linux Mint][1] is considered one of the [best distributions for new Linux users][2]. Its flagship Cinnamon DE is one of the most popular desktop environment giving your system a look and feel of classic Window-styled desktop. + +If you want to try Linux Mint and see if it fits your need, you could try installing it in a virtual machine. This way, you run Linux Mint inside your current system without changing your system’s partition or boot order. One of the safest way out there as you get to run Linux like a regular desktop application inside your current operating system. + +![][3] + +Oracle’s open source virtualization tool [VirtualBox][4] is available for free on all major desktop operating systems i.e. Windows, Linux and macOS. + +In this beginner’s tutorial, I’ll show you the steps for installing Linux Mint in VirtualBox. I am including the screenshots for each step so that you can easily follow the tutorial. + +### Installing Linux Mint in VirtualBox + +You can follow the steps on any operating system be it Windows, Linux or macOS. You just need to install VirtualBox on your operating system and rest of the steps remain the same. + +**Step 1:** [Download VirtualBox from its website][4] and install it by double-clicking on the downloaded file. + +![][5] + +Next, install the latest version of Linux Mint’s ISO file from its website. + +[Download Linux Mint ISO][6] + +**Step 2:** Once your virtual Box is up & running we are ready to get started. Click the New button, click Next on the virtual machine wizard. + +![Create a new Virtual Machine][7] + +Initially you need to specify the following: + + * Name: Any preferred name for your VM like Linux Mint + * Type: Linux + * Version: Ubuntu (64 bit) as Linux Mint is an Ubuntu-based distribution + + + +Before configuring any hardware resource value, please make sure that are aware of the [system requirements][8]. + +2 GB RAM would be okay but won’t give you a good experience. 3 GB is a comfortable amount if your system has 8 GB of RAM. I choose to set my Virtual Machine to 4096 MB (4 GB) because my system has plenty of RAM. + +RAM consumption + +One of the common confusion is regarding the RAM consumption. Let’s say your Windows system has 8 GB of RAM and you assign 3 GB of RAM to Linux Mint in VirtualBox. + +If you are running Linux Mint inside VirtualBox, your real system (called host system) will have 5 GB of RAM available for consumption. + +If you are not running Linux Mint inside VirtualBox, at that moment, the entire 8 GB will be available to the host system. + +**Step 3:** Next, choose a Virtual Hard disk now option and click create. + +Choose the virtual storage allocation method (Recommended Dynamically allocated). Set your storage location for virtual hard disk by browsing drive and then specify the size of virtual hard disk (it could be anything from 12-20 GB). + +![Dynamic allocation can save you space if you don’t need the maximum allowance][9] + +**Step (4 (optional advanced settings):** Once Virtual machine has been created, click on the settings button in menu: + +![][10] + +Now, go to the Display section. Specify the Video memory (128 MB) and check “Enable 3D Acceleration”. + +![Don’t forget to enable the 3D Acceleration][11] + +Then click on System Tab → Processor and choose how many threads would you like to allocate. + +My system is a 4 core/4 thread system and I choose to assign half of the CPU capability i.e. 2 threads. + +![Select CPU cores as per the distribution requirements][12] + +Once you have configured everything click ok. + +**Step 5:** In the System settings, go to Storage (from the left sidebar). Click on the [Optical Drive] Empty as shown in the image below. + +You’ll be asked to browse to the Linux Mint ISO file you had downloaded earlier. + +![][13] + +Once you select your ISO, click on the start button and that’s it! Now the ISO will start running as if you are booting from a live USB. + +Next, you need to press enter whilst your option is start Linux Mint as per the picture below. + +![][14] + +**Step 6:** Let’s start the installation procedure. + +Choose the language you want for your Linux Mint virtual machine. + +![Choose your native language][15] + +I’m based in the UK, so I have a UK keyboard layout. You can choose the one you want. + +![Choose your keyboard layout according to your hardware configuration][16] + +You may check the box to download and install any third-party software during the installation. + +![You may install media codecs while installing Linux Mint][17] + +You can proceed to erase the disk and install Linux Mint. + +Erase disk? Really? + +This step may seem scary because you may think that it will harm your real system. + +Let me assure you that it won’t do any damage to your actual disk. Remember you created 10-20 GB of virtual disk in step 3? Now you are inside that disk. + +When it asks for erasing the disk, it is erasing the virtual disk created for it. It doesn’t impact your real system disk and its data. + +![It is safe to erase your disk only at a Virtual Machine level][18] + +Next, select your time zone and click continue. You may [change time zone in Linux][19] later as well. + +![][20] + +You will be prompted to create your user account, your host name (computer’s name) and to choose a password. Once done, click continue to finalize the installation. + +![][21] + +Please wait a few minutes for the process to complete. + +![Wait a few minutes for the process to finish][22] + +The installation has now finished. Click on “Restart now”. + +![Well done! You have successfully installed Linux Mint][23] + +When you reach this step, Linux Mint will be installed and ready to use! + +![][24] + +You don’t have an installation medium so just power off the virtual machine. + +![][25] + +Now to use your virtual machine, click on the start button. + +![][26] + +You can explore a fully functional system, and at this time if you shut down Linux Mint like it was physically installed, it will automatically power off the virtual machine. + +![][27] + +Enjoy Linux Mint in VirtualBox. I hope you were able to install Linux Mint in VirtualBox. If you face any issues, please let me know in the comment section. I’ll try to help you out. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-linux-mint-in-virtualbox/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxmint.com/ +[2]: https://itsfoss.com/best-linux-beginners/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/install-linux-mint-in-virtualbox.png?ssl=1 +[4]: https://www.virtualbox.org/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/download-virtulabox.jpg?ssl=1 +[6]: https://www.linuxmint.com/download.php +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/1.-Create-new.jpg?ssl=1 +[8]: https://blog.linuxmint.com/?p=3832 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/2.-Create-virtual-hard-disk.jpg?resize=800%2C472&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/3.-settings.jpg?resize=800%2C470&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/4.-display.jpg?resize=800%2C472&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/5.-cpu.jpg?resize=800%2C468&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/6.-choose-iso.jpg?resize=800%2C472&ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/7.-boot.jpg?resize=800%2C459&ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/8.-choose-language.png?resize=800%2C679&ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/9.-English-UK.png?resize=800%2C679&ssl=1 +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/10.-install-third-party-software.png?resize=800%2C679&ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/11.-installation-type.png?resize=800%2C679&ssl=1 +[19]: https://itsfoss.com/change-timezone-ubuntu/ +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/12.-timezone.png?resize=800%2C679&ssl=1 +[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/13.-user-account.png?resize=800%2C679&ssl=1 +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/14.-installation-screen.png?resize=800%2C679&ssl=1 +[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/15.-installation-finish.png?resize=800%2C679&ssl=1 +[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/16.-remove-the-media.png?resize=800%2C679&ssl=1 +[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/17.-power-off.png?resize=800%2C678&ssl=1 +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/18.-init-the-fresh-installed-mint.png?resize=800%2C476&ssl=1 +[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/19.-Linux-mint-19.3-final.png?resize=800%2C469&ssl=1 From 4f6126afefe8cb23c222b5872e9014ae825860ed Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:30:11 +0800 Subject: [PATCH 0814/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20Trac?= =?UTF-8?q?k=20Your=20Screen=20Time=20in=20Linux=20with=20ActivityWatch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 Track Your Screen Time in Linux with ActivityWatch.md --- ...Screen Time in Linux with ActivityWatch.md | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 sources/tech/20200525 Track Your Screen Time in Linux with ActivityWatch.md diff --git a/sources/tech/20200525 Track Your Screen Time in Linux with ActivityWatch.md b/sources/tech/20200525 Track Your Screen Time in Linux with ActivityWatch.md new file mode 100644 index 0000000000..ddf6b2e9cc --- /dev/null +++ b/sources/tech/20200525 Track Your Screen Time in Linux with ActivityWatch.md @@ -0,0 +1,131 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Track Your Screen Time in Linux with ActivityWatch) +[#]: via: (https://itsfoss.com/activitywatch/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Track Your Screen Time in Linux with ActivityWatch +====== + +_**Brief: ActivityWatch is an open-source privacy-friendly app that tracks how you spend your time on a desktop computer or on a mobile device.**_ + +### ActivityWatch: An open-source app to track how much time you spend on which application + +![ActivityWatch lets you check the time spent on various applications][1] + +[ActivityWatch][2] is a cross-platform open-source app that helps you track time to gauge your productivity. It lets you track the time you spent on applications, browsers, and if you were AFK (away from keyboard) or the system was hibernating. + +Not just limited to tracking time, but it offers a bunch of useful features with visualizations that help you easily analyze how you spent time to potentially improve your productivity. + +![][3] + +It’s a great alternative to proprietary options like [RescueTime][4] and [ManicTime][5]. + +ActivityWatch is available for Linux, Windows, macOS and [Android][6]. It also offers browser extensions for both Chrome and Firefox. As of now, there’s no app available for iOS on the App Store. + +![][7] + +It’s fairly new to the scene and is being actively developed to address any existing issues and introduce new features like the ability to sync your activity data across multiple devices. + +_**For privacy-focused users, I should mention that the data collected is stored locally on your device. That’s a good thing as you can track your spent time without being tracked by someone else.**_ + +### Features of ActivityWatch + +![][8] + +Basically, ActivityWatch lets you monitor your activity to analyze bad screen time or improve the time management for what you do on your device. + +To break it down, it offers several useful options that I’d like to highlight here: + + * Summary of your daily activity with apps/programs sorted as per the time spent using it. + * Track the time of your browser activity using the extension to get the exact data on time spent on every active tab. + * Tracks AFK and not-AFK time. (AFK — abbreviation for “Away From Keyboard” i.e. you’re not in front of your computer) + * Offers different visualizations of timelines to monitor your activity + * Ability to track the time you spend writing code on an editor using [watchers][9]. + * History of your activity to analyze your productivity + * Categorize the time spent to help you analyze in detail + * Lets you add more categories and tweak the duration of timeline. + * Ability to export/import your data as [JSON][10] file. + * Experimental stopwatch feature + * Stores data locally to respect user privacy. + + + +### Installing ActivityWatch on Linux + +_**Note:** If your Linux distribution does not support system tray icons, you will have to follow the [documentation][11] for a workaround._ + +Unfortunately, you won’t find an AppImage, Flatpak or Snap for it. + +However, you do get an [AUR][12] package to install for Manjaro or Arch Linux. + +For all other Linux distributions, you get a ZIP file which includes an **aw-qt** application to run. + +To do that, you have to [extract the zip archive file][13] and then run the binary to install it by double-clicking on the aw-qt application. + +![Aw Qt][14] + +You can also use the terminal as follows: + +``` +cd activitywatch-v0.9.2-linux-x86_64 +sudo ./aw-qt +``` + +The location and filename of the extracted folder might differ – so make sure you navigate to the correct directory and then use the commands above. Once done, you can access ActivityWatch from the system tray icon or simply head to [localhost:5600][15] to access it. + +You can also check out their [GitHub page][16] or the [official website][2] to explore more about it. + +[Download ActivityWatch][2] + +Just for your information, if you plan on using ActivityWatch regularly, you should move the downloaded files to the /opt directory and create a link to aw-qt executable in /usr/share/bin directory. This way, the application will be available as a regular command for all the users on the system. A similar method has been demonstrated in the [PopcornTime installation tutorial][17]. + +### My Thoughts On ActivityWatch + +![][18] + +The time tracking works perfectly fine on [Pop!_OS 20.04][19] with the system tray icon support. You might encounter a bug that doesn’t let you access ActivityWatch from your system tray icon (which is also a [known issue on GitHub][20]). In that case, you need to access it through [localhost:5600][15]. + +Personally, I’m quite satisfied with the features offered considering that I use it on my desktop and have no plans to use it on my smartphone. + +I’d definitely recommend you try this nice open-source project and support them along the way. If you like the project, feel free to show your appreciation by adding a star or sponsoring [their GitHub repository][21]. + +Feel free to let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/activitywatch/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/activitywatch.png?fit=800%2C607&ssl=1 +[2]: https://activitywatch.net/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/activitywatch-afk.jpg?ssl=1 +[4]: https://itsfoss.com/recommends/rescuetime/ +[5]: https://www.manictime.com/ +[6]: https://play.google.com/store/apps/details?id=net.activitywatch.android +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/activitywatch-timeline.jpg?ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/activitywatch-settings.jpg?ssl=1 +[9]: https://docs.activitywatch.net/en/latest/watchers.html +[10]: https://en.wikipedia.org/wiki/JSON +[11]: https://docs.activitywatch.net/en/latest/getting-started.html +[12]: https://aur.archlinux.org/packages/activitywatch-bin/ +[13]: https://itsfoss.com/unzip-linux/ +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/aw-qt.jpg?ssl=1 +[15]: https://itsfoss.com/activitywatch/5600 +[16]: https://github.com/ActivityWatch +[17]: https://itsfoss.com/popcorn-time-ubuntu-linux/ +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/activitywatch-screenshot.jpg?ssl=1 +[19]: https://itsfoss.com/pop-os-20-04-review/ +[20]: https://github.com/ActivityWatch/activitywatch/issues/208 +[21]: https://github.com/ActivityWatch/activitywatch From 9a6e76ae7a9261fcac0b177f4f59bf4e20b93767 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:30:32 +0800 Subject: [PATCH 0815/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20How?= =?UTF-8?q?=20to=20Assign=20Static=20IP=20Address=20on=20Ubuntu=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 How to Assign Static IP Address on Ubuntu Linux.md --- ...ssign Static IP Address on Ubuntu Linux.md | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 sources/tech/20200525 How to Assign Static IP Address on Ubuntu Linux.md diff --git a/sources/tech/20200525 How to Assign Static IP Address on Ubuntu Linux.md b/sources/tech/20200525 How to Assign Static IP Address on Ubuntu Linux.md new file mode 100644 index 0000000000..87ddb6b839 --- /dev/null +++ b/sources/tech/20200525 How to Assign Static IP Address on Ubuntu Linux.md @@ -0,0 +1,179 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Assign Static IP Address on Ubuntu Linux) +[#]: via: (https://itsfoss.com/static-ip-ubuntu/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +How to Assign Static IP Address on Ubuntu Linux +====== + +_**Brief: In this tutorial, you’ll learn how to assign static IP address on Ubuntu and other Linux distributions. Both command line and GUI methods have been discussed.**_ + +IP addresses on Linux Systems in most cases are assigned by [Dynamic Host Configuration Protocol][1] (DHCP) servers. IP addresses assigned this way are dynamic which means that the IP address might change when you [restart your Ubuntu system][2]. It’s not necessary but it may happen. + +_**Dynamic IP is not an issue for normal desktop Linux users in most cases**_. It could become an issue if you have employed some special kind of networking between your computers. + +For example, you can [share your keyboard and mouse between Ubuntu and Raspberry Pi][3]. The configuration uses IP addresses of both system. If the IP address changes dynamically, then your setup won’t work. + +Another use case is with servers or remotely administered desktops. It is easier to set static addresses on those systems for connection stability and consistency between the users and applications. + +In this tutorial, I’ll show you how to set up static IP address on Ubuntu based Linux distributions. Let me show you the command line way first and then I’ll show the graphical way of doing it on desktop. + +### Method 1: Assign static IP in Ubuntu using command line + +![][4] + +**Note for desktop users**: Use static IP only when you need it. Automatic IP saves you a lot of headache in handling network configuration. + +#### Step 1: Get the name of network interface and the default gateway + +The first thing you need to know is the name of the network interface for which you have to set up the static IP. + +You can either use ip command or the network manager CLI like this: + +``` +nmcli d +``` + +In my case, it shows my Ethernet (wired) network is called enp0s25: + +``` +Ubuntu> nmcli d +DEVICE TYPE STATE CONNECTION +enp0s25 ethernet unmanaged -- +lo loopback unmanaged -- +``` + +Next, you should note the [default gateway IP using the Linux command][5] **ip route**: + +``` +ip route +default via 192.168.31.1 dev enp0s25 proto dhcp metric 600 +169.254.0.0/16 dev enp0s25 scope link metric 1000 +192.168.31.0/24 dev enp0s25 proto kernel scope link src 192.168.31.36 metric 600 +``` + +As you can guess, the default gateway is 192.168.31.1 for me. + +#### Step 2: Locate Netplan configuration + +Ubuntu 18.04 LTS and later versions use [Netplan][6] for managing the network configuration. Netplan configuration are driven by .yaml files located in **/etc/netplan** directory. + +By default, you should see a .yaml file named something like 01-network-manager-all.yaml, 50-cloud-init.yaml, 01-netcfg.yaml. + +Whatever maybe the name, its content should look like this: + +``` +# Let NetworkManager manage all devices on this system +network: + version: 2 + renderer: NetworkManager +``` + +You need to edit this file for using static IP. + +#### Step 3: Edit Netplan configuration for assigning static IP + +_**Just for the sake of it, make a backup of your yaml file.**_ + +Please make sure to use the correct yaml file name in the commands from here onward. + +Use nano editor with sudo to open the yaml file like this: + +``` +sudo nano /etc/netplan/01-netcfg.yaml +``` + +Please note that _**yaml files use spaces for indentation**_. If you use tab or incorrect indention, your changes won’t be saved. + +You should edit the file and make it look like this by providing the actual details of your IP address, gateway, interface name etc. + +``` +network: + version: 2 + renderer: networkd + ethernets: + enp0s25: + dhcp4: no + addresses: + - 192.168.31.16/24 + gateway4: 192.168.31.1 + nameservers: + addresses: [8.8.8.8, 1.1.1.1] +``` + +In the above file, I have set the static IP to 192.168.31.16. + +Save the file and apply the changes with this command: + +``` +sudo netplan apply +``` + +You can verify it by [displaying your ip address in the terminal][7] with ‘ip a’ command. + +Revert the changes and go back to dynamic IP + +If you don’t want to use the static IP address anymore, you can revert easily. + +If you have backed up the original yaml file, you can delete the new one and use the backup one. + +Otherwise, you can change the yaml file again and make it look like this: + +``` +network: + version: 2 + renderer: networkd + ethernets: + enp0s25: + dhcp4: yes +``` + +### Method 2: Switch to static IP address in Ubuntu graphically + +If you are on desktop, using the graphical method is easier and faster. + +Go to the settings and look for network settings. Click the gear symbol adjacent to your network connection. + +![][8] + +Next, you should go to the IPv4 tab. Under the IPv4 Method section, click on Manual. + +In the Addresses section, enter the IP static IP address you want, netmask is usually 24 and you already know your gateway IP with the ip route command. + +You may also change the DNS server if you want. You can keep Routes section to Automatic. + +![][9] + +Once everything is done, click on Apply button. See, how easy it is to set a static IP address graphically. + +If you haven’t read my previous article on [how to change MAC Address][10], you may want to read in conjunction with this one. + +More networking related articles will be rolling out, let me know your thoughts at the comments below and stay connected to our social media. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/static-ip-ubuntu/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol +[2]: https://itsfoss.com/schedule-shutdown-ubuntu/ +[3]: https://itsfoss.com/keyboard-mouse-sharing-between-computers/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/static-ip-ubuntu.jpg?ssl=1 +[5]: https://linuxhandbook.com/find-gateway-linux/ +[6]: https://netplan.io/ +[7]: https://itsfoss.com/check-ip-address-ubuntu/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/assign-static-ip-1.jpg?ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/assign-static-ip-2.jpg?ssl=1 +[10]: https://itsfoss.com/change-mac-address-linux/ From b100e995321d9fe3acf42f57cc723c62e6ded7c9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:30:53 +0800 Subject: [PATCH 0816/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20Encr?= =?UTF-8?q?ypt=20Your=20Files=20Before=20Uploading=20it=20to=20Cloud=20Wit?= =?UTF-8?q?h=20Cryptomator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 Encrypt Your Files Before Uploading it to Cloud With Cryptomator.md --- ... Uploading it to Cloud With Cryptomator.md | 184 ++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 sources/tech/20200525 Encrypt Your Files Before Uploading it to Cloud With Cryptomator.md diff --git a/sources/tech/20200525 Encrypt Your Files Before Uploading it to Cloud With Cryptomator.md b/sources/tech/20200525 Encrypt Your Files Before Uploading it to Cloud With Cryptomator.md new file mode 100644 index 0000000000..eda3a2990e --- /dev/null +++ b/sources/tech/20200525 Encrypt Your Files Before Uploading it to Cloud With Cryptomator.md @@ -0,0 +1,184 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Encrypt Your Files Before Uploading it to Cloud With Cryptomator) +[#]: via: (https://itsfoss.com/cryptomator/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Encrypt Your Files Before Uploading it to Cloud With Cryptomator +====== + +_**Open source software highlight of this week is Cryptomator. It is a unique free and open-source encryption software that lets you encrypt your data before uploading it to the cloud.**_ + +There are several [cloud services available for Linux][1] and almost all of them do not offer [end to end encryption][2], at least not by default. + +Usually, the connection between your device and the server is secure. But your data stored on the server is not encrypted. Employees with direct access to the infrastructure at your cloud service providers may access this data. + +Of course, these companies have strict policies against such intrusion but a rogue employee can do a lot of damage. Remember the incident when a [departing Twitter employee deactivated the account of US President Donald Trump][3]. + +If you are one of the privacy cautious people, you would want the ease of cloud storage but with the added security layer of encrypted storage. + +Now some [services like pCloud do provide end to end encryption][4] but that comes at an additional cost. If you could afford that, well and good. If not, you can use a free and open source tool like [Cryptomator][5]. + +Cryptomator helps you secure your data by encrypting it before uploading it to any cloud storage services. In this article, I’m going to highlight the key features of Cryptomator along with instructions to use it. + +### Cryptomator: Add an encryption layer to your cloud data + +![][6] + +Cryptomator is a solution to encrypt your data locally before uploading it to the cloud. + +With this, you can create vaults locally and sync them to the cloud storage services you use. + +It’s very easy to use and you don’t need to have any specific technical knowledge to encrypt your data – that’s what Cryptomator is tailored for. + +### Features of Cryptomator + +Cryptomator is a simple encryption tool with the essential features. Here’s what it offers: + + * [AES][7] and 256-bit Encryption for files. + * Ability to create a vault and sync it with the cloud storage service + * Optional recovery key for your master password of the vault + * Cross-platform support (Linux, Windows, macOS, Android, and iOS) + * Supports the dark theme for a one-time license fee. + * Supports [WebDAV][8], [FUSE][9], and [Dokany][10] for easy integration with your operating system. + + + +Do note that the [Android][11] and [iOS][12] apps are paid apps that you have to purchase separately while the desktop program is completely free to use. Also, you need to purchase a one-time license to unlock the dark mode. Don’t blame them please. They need to make some money in order to develop this open source software. + +### Installing Cryptomator on Linux + +Cryptomater provides an AppImage file that you can download to get started on any Linux distribution. + +You can get it from its [official download page][13]. In case you don’t know, please read [how to use an AppImage file][14] to get started. + +[Download Cryptomator][5] + +### How To Use Cryptomator? + +Attention! + +Encryption is a double-edged sword. It can protect you and it can hurt you as well. +If you are encrypting your data and you forgot your encryption key, you’ll lose access to that data forever. +Cryptomator provides a recovery key option so please be careful with both password and the recovery key. Don’t forget it or lose the recovery key. + +Once you have installed Cryptomator, it’s really easy to use it following the user interface or the [official documentation][15]. + +But, to save you some time, I’ll highlight a few important things that you should know: + +#### Setup Your Vault + +![][16] + +After launching Cryptomator, you need to create the vault where you want to have your encrypted data. + +This can be an existing location or a new custom directory as per your requirements. + +Now that you proceed creating a new vault, you will also observe that you can open an existing vault as well (if you had one already). So, always have a backup of your vault, just in case. + +![][17] + +Here, I am assuming that you are a new user. So, obviously, proceed to create a new vault and give it a name: + +![][18] + +Next, you need to specify a storage location. If you already use OneDrive, Dropbox, Google Drive, or something similar, it might detect it automatically. + +![][19] + +However, if it doesn’t, like in my case (I use [pCloud][20]), you can select the cloud-synced directory or any other custom location manually. + +Once you select the location, you just need to create a password for it. It’s best to create a strong password that you can remember. + +![][21] + +Also, I’d suggest you to opt for the recovery key and store it in a separate USB drive or just print it on a paper. + +![][22] + +And, that’s it. You’re done creating your secure vault that you can sync with the cloud. + +![][23] + +Now, how do you add files to it? Let’s take a look: + +#### Adding Files To A Vault + +_**Note:** You can’t just go into the folder that you created from the file manager and files there. Follow the steps below to add files properly in your encrypted vault._ + +Once you’ve created your vault, you just need to unlock it by typing the password as shown in the image below. If you’re on your personal computer, you can choose to save the password without needing to enter it every time you access the vault. However, I advise not to do that. Manually entering the password help in remembering it. + +![][24] + +Next, after unlocking the vault, you just need to click on “**Reveal Vault**” or reveal drive to open it using **File Manager** where you can access/modify or add files to it. + +#### Backup / Recover Your Vault + +You should simply copy-paste the folder you create to another USB drive or somewhere else other than your cloud storage folder to ensure that you have a backup of your vault. + +![][25] + +It’s important to have the **masterkey.cryptomator** file of the vault in order to open it. + +#### Upgrades, Preferences & Settings + +Note + +You should enable the auto-updates feature to ensure that you will have the most stable and error-free version automatically. + +Apart from the most important functions of the Cryptomator app, you will get a couple of other features to tweak, such as: + + * Change the type of your virtual drive + * Tweak the vault to read-only mode + + + +You can explore the **Vault options** and the settings on Cryptomator to know about what else you can do. + +**Wrapping Up** + +Now that you know about Cryptomator, you can easily encrypt your important data locally before uploading them to the cloud. + +What do you think about Cryptomator? Let us know your thoughts in the comments down below! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/cryptomator/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/cloud-services-linux/ +[2]: https://en.wikipedia.org/wiki/End-to-end_encryption +[3]: https://www.theverge.com/2017/11/2/16600732/donald-trump-twitter-account-gone-realdonaldtrump +[4]: https://partner.pcloud.com/r/22317 +[5]: https://cryptomator.org/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/cryptomator-ft.jpg?ssl=1 +[7]: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard +[8]: https://en.wikipedia.org/wiki/WebDAV +[9]: https://en.wikipedia.org/wiki/Filesystem_in_Userspace +[10]: https://en.wikipedia.org/wiki/Dokan_Library +[11]: https://play.google.com/store/apps/details?id=org.cryptomator&hl=en_US +[12]: https://apps.apple.com/us/app/cryptomator/id953086535 +[13]: https://cryptomator.org/downloads/ +[14]: https://itsfoss.com/use-appimage-linux/ +[15]: https://docs.cryptomator.org +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/cryptomator-add-vault.jpg?ssl=1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/cryptomator-create-open-vault.jpg?ssl=1 +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/cryptomator-add-vault-name.jpg?ssl=1 +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/cryptomator-vault-location.jpg?ssl=1 +[20]: https://itsfoss.com/recommends/pcloud/ +[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/cryptomator-pass.jpg?ssl=1 +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/cryptomator-recovery.jpg?ssl=1 +[23]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/cryptomator-vault-success.jpg?ssl=1 +[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/cryptomator-unlock.jpg?ssl=1 +[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/cryptomator-master.jpg?ssl=1 From ac5ac32ce713162b310dac9e128b587373705ce8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:31:14 +0800 Subject: [PATCH 0817/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20Debi?= =?UTF-8?q?an=E2=80=99s=20Decision=20to=20Drop=20Old=20Drivers=20has=20Ups?= =?UTF-8?q?et=20Vintage=20Hardware=20Users?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 Debian-s Decision to Drop Old Drivers has Upset Vintage Hardware Users.md --- ...rivers has Upset Vintage Hardware Users.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20200525 Debian-s Decision to Drop Old Drivers has Upset Vintage Hardware Users.md diff --git a/sources/tech/20200525 Debian-s Decision to Drop Old Drivers has Upset Vintage Hardware Users.md b/sources/tech/20200525 Debian-s Decision to Drop Old Drivers has Upset Vintage Hardware Users.md new file mode 100644 index 0000000000..fb2b9005ea --- /dev/null +++ b/sources/tech/20200525 Debian-s Decision to Drop Old Drivers has Upset Vintage Hardware Users.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Debian’s Decision to Drop Old Drivers has Upset Vintage Hardware Users) +[#]: via: (https://itsfoss.com/debian-dropping-old-drivers/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Debian’s Decision to Drop Old Drivers has Upset Vintage Hardware Users +====== + +It is always a tough decision to drop support for older hardware for the latest Linux distribution releases. Just like [Ubuntu decided to drop support for 32-bit systems][1], Debian’s X Strike Force (XFS) team decided to drop a list of input and video drivers. + +### Debian is considering to drop support for really old hardware + +![][2] + +In case you didn’t know, the XFS team is responsible for maintaining packages the [X Window System][3] in [Debian][4]. And, the list of drivers that [they want to remove][5] are: + + * xserver-xorg-input-aiptek + * xserver-xorg-input-elographics + * xserver-xorg-input-mtrack + * xserver-xorg-input-mutouch + * xserver-xorg-input-void + * server-xorg-video-ast + * xserver-xorg-video-mach64 + + + * xserver-xorg-video-neomagic + * xserver-xorg-video-r128 + * xserver-xorg-video-savage + * xserver-xorg-video-siliconmotion + * xserver-xorg-video-sisusb + * xserver-xorg-video-tdfx + * xserver-xorg-video-trident + + + +So, Mach 64, [ATI Rage R128][6], Savage, Silicon Motion, SiS, Trident, and NeoMagic are some of the graphics chipsets that would be affected. The reason (as stated by them) to drop these drivers is: + +> They are either unmaintained upstream or provide no value to the distribution. + +Now, that could make sense, if the packages are no longer maintained. But, upstream some of these X.org drivers are still **maintained** even if there are no frequent updates to them. For instance, in 2018, a [new display driver update was released for the ATI RAGE 128][7], as reported by Phoronix. + +### Vintage hardware owners are going to be upset + +Obviously, the vintage hardware users aren’t quite happy with the decision because a handful of people still own (or actively use) old hardware i.e. around 20 years older. + +From the original list of drivers mentioned in the [bug report][5], **Geode display driver** was initially decided to be removed but wasn’t dropped. + +It was also reported that the “**xserver-xorg-video-r128**” driver is required for older Apple hardware (iMac). And, a user reported about the missing video driver on his iMac. + +For most of the users, this decision may not actually affect any “production” systems because I don’t think anyone is probably going to utilize 20-year old hardware for commercial purposes. + +The hobbyists and collectors who like to preserve older tech are surely going to be impacted by this decision. + +### Wrapping Up + +In my opinion, dropping the support for incredibly dated hardware is not entirely a bad move. + +But, if there is a demand for the support of vintage hardware, the fair share of users who want the drivers to be added in Debian should help maintain those packages. If not, I don’t think it won’t be a wise choice to have an unmaintained piece of code in Debian. + +What do you think about this? Feel free to share your thoughts in the comments below! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/debian-dropping-old-drivers/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-drops-32-bit-desktop/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/debian-bug-report-driver-drop.jpg?ssl=1 +[3]: https://en.wikipedia.org/wiki/X_Window_System +[4]: https://www.debian.org/ +[5]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955603 +[6]: https://en.wikipedia.org/wiki/ATI_Rage_series +[7]: https://www.phoronix.com/scan.php?page=news_item&px=ATI-RAGE-128-DDX-6.11.0 From ee5cb891e1be650e339460d43f7e511f3a758f2c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:31:49 +0800 Subject: [PATCH 0818/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20Foli?= =?UTF-8?q?ate:=20A=20Modern=20eBook=20Reader=20App=20for=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 Foliate- A Modern eBook Reader App for Linux.md --- ...te- A Modern eBook Reader App for Linux.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20200525 Foliate- A Modern eBook Reader App for Linux.md diff --git a/sources/tech/20200525 Foliate- A Modern eBook Reader App for Linux.md b/sources/tech/20200525 Foliate- A Modern eBook Reader App for Linux.md new file mode 100644 index 0000000000..fed582f7d9 --- /dev/null +++ b/sources/tech/20200525 Foliate- A Modern eBook Reader App for Linux.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Foliate: A Modern eBook Reader App for Linux) +[#]: via: (https://itsfoss.com/foliate-ebook-viewer/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Foliate: A Modern eBook Reader App for Linux +====== + +_**Brief: Foliate is simple and elegant open source eBook viewer that provides a Kindle-like reading experience on Linux desktop.**_ + +### Foliate provides modern reading experience on Linux desktop + +![][1] + +While we already have a list of [best eBook readers for Linux][2], I recently came across another eBook viewer for Linux. It is called [Foliate][3]. + +Foliate is a modern GTK eBook viewer that offers quite a lot of essential features. If you own an Amazon Kindle or some other eBook reader, you probably miss that kind of reading experience on the desktop. + +Foliate addresses those complaints. Foliate shows an estimate of remaining reading time and pages in the book. You can add bookmarks, highlight text and add notes. You can export this data or sync them easily. + +![Foliate Ebook Viewer Features][4] + +You can also look up for words using Wiktionary and Wikipedia. You can switch between two page view and scroll view. It also has several themes to suit you reading preference. + +![][5] + +And the best thing is that it is being actively maintained and developed. + +### Features of Foliate + +![][6] + +Let’s take a look at all the features Foliate offers: + + * Supports .epub, .mobi, .azw, and .azw3 files. It DOES NOT support PDF files. + * It lets you read the eBook on a two-page view mode and offers a scroll view mode as well. + * Ability to customize font, line-spacing, margins, and brightness + * Default themes include Light, sepia, dark, Solarized dark/light, Gruvbox light/dark, Grey, Nord, and invert mode. + * You can also add custom themes to tweak the appearance of the eBook viewer + * Reading progress slider with chapter marks + * Bookmarks and annotations support + * Ability to find a text in the book + * Ability to zoom in and zoom out + * Enable/Disable sidebar for navigation + * Quick dictionary lookup using [Wiktionary][7] and [Wikipedia][8] + * Translation of text using Google Translate + * Touchpad gestures—use a two-finger swipe to turn the page + * Text-to-Speech support with [eSpeak NG][9] and [Festival][10] + + + +**Recommended Read:** + +![][11] + +#### [What Amazon Kindle? Here’s an Open Source eBook Reader][12] + +Open Book is an open source eBook reader that you can tweak to your liking. Free from proprietary stuff, Open Book is a dream come true for open source enthusiasts. + +### Installing Foliate on Linux + +For Ubuntu and Debian based Linux distributions, you can get the .deb file from its [GitHub releases section][13] to download the. [Installing applications from deb file][14] is as easy as double clicking on it. + +For other Linux distributions like Fedora, Arch, SUSE etc, Foliate is available as [Flatpak][15] and [Snap][16] package. In if you don’t know how to use them, you may follow our guide on [using flatpak][17] and using [snap packages][18] in Linux to get started with it. + +You can explore its [GitHub page][19] to build from source if you need it. + +[Download Foliate App][20] + +**Wrapping Up** + +I tried it on **Pop!_OS 19.10** using the latest **.deb** file available on GitHub and it worked well. I liked its features though I don’t read a lot on my desktop. + +Have you tried Foliate yet? Feel free to share your experience with it. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/foliate-ebook-viewer/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/foliate-app.jpg?ssl=1 +[2]: https://itsfoss.com/best-ebook-readers-linux/ +[3]: https://johnfactotum.github.io/foliate/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/foliate-ebook-viewer-features.jpg?ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/foliate-screenshot.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/foliate-options.jpg?ssl=1 +[7]: https://en.wiktionary.org/wiki/Wiktionary:Main_Page +[8]: https://en.wikipedia.org/wiki/Main_Page +[9]: https://github.com/espeak-ng/espeak-ng +[10]: http://www.cstr.ed.ac.uk/projects/festival/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/open-book-under-development-feature.jpeg?fit=800%2C450&ssl=1 +[12]: https://itsfoss.com/open-book/ +[13]: https://github.com/johnfactotum/foliate/releases +[14]: https://itsfoss.com/install-deb-files-ubuntu/ +[15]: https://flathub.org/apps/details/com.github.johnfactotum.Foliate +[16]: https://snapcraft.io/foliate +[17]: https://itsfoss.com/flatpak-guide/ +[18]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ +[19]: https://github.com/johnfactotum/foliate +[20]: tmp.6FO70BtAuy From 50d57652952aaff599d39e1631f4ff77e6cd335c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:32:05 +0800 Subject: [PATCH 0819/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20Linu?= =?UTF-8?q?x=20Mint=2020:=20Release=20Date,=20Features=20and=20Everything?= =?UTF-8?q?=20Important=20Associated=20With=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 Linux Mint 20- Release Date, Features and Everything Important Associated With it.md --- ...Everything Important Associated With it.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20200525 Linux Mint 20- Release Date, Features and Everything Important Associated With it.md diff --git a/sources/tech/20200525 Linux Mint 20- Release Date, Features and Everything Important Associated With it.md b/sources/tech/20200525 Linux Mint 20- Release Date, Features and Everything Important Associated With it.md new file mode 100644 index 0000000000..ffd052c4c7 --- /dev/null +++ b/sources/tech/20200525 Linux Mint 20- Release Date, Features and Everything Important Associated With it.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Mint 20: Release Date, Features and Everything Important Associated With it) +[#]: via: (https://itsfoss.com/linux-mint-20/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Linux Mint 20: Release Date, Features and Everything Important Associated With it +====== + +_**A continually updated article that lists all the new features in the upcoming Linux Mint 20 release.**_ + +[Ubuntu 20.04 LTS release][1] is just around the corner. This is a good news for Linux Mint users as well. A new Ubuntu LTS release means that a new major Linux Mint release will follow soon. + +Why? Because Linux Mint is based on the long term support (LTS) release of Ubuntu. Mint 18 series was based on Ubuntu 16.04 LTS, Mint 19 was based on Ubuntu 18.04 LTS and Linux Mint is going + +Unlike Ubuntu, [Linux Mint][2] doesn’t have a set release schedule. Keeping the past trends in mind, I can make an intelligent guess that Linux Mint 20 should be releasing in June this year. + +### New Features Coming in Linux Mint 20 “Ulyana” + +![][3] + +Let’s take a look at some of the main proposed new features and changes in Linux Mint 20, code-named Ulyana. + +#### Performance improvement to Nemo file manager + +One of the planned performance improvement in the Nemo file manager is the way it handles the thumbnails. You might not have realized but thumbnail generations takes considerable system resources (and disk space as well). Try opening a folder with a few thousands images and you’ll notice that CPU consumption goes up. + +In Linux Mint 20, the aim is to prioritize content and navigation and to delay thumbnails as much as possible. This means that the content of folders shows up with generic icons before the thumbnails are rendered. It won’t be pleasing to the eyes, but you’ll notice the improvement in performance. + +#### Two refreshed color variants + +By default Linux Mint has a green/mint accent. There are a few more color accents available. Linux Mint 20 refreshes the pink and blue colors in its kitty. + +Here’s the new Aqua accent color: + +![Linux Mint Aqua][4] + +And the new Pink accent color: + +![Linux Mint Pink][5] + +#### Sharing files across network becomes simple with this new tool + +Linux Mint 20 will feature a [new GUI tool][6] for easily sharing files on the local network without any additional configuration. + +![New tool for sharing files across the network][7] + +#### Better desktop integration for Electron apps + +[Electron][8] is an open source framework that allows to build cross-platform desktop applications using web technologies. Some people call it the lazy approach because the application runs on top of Chromium web browser. However, this allows developers to easily make their applications available for Linux (and macOS). [Slack on Linux][9] is one of many such examples. + +Linux Mint 20 will have better support for Electron applications with improved integration of system tray and desktop notifications. + +#### Fractional scaling with improved multi-monitor support + +![][10] + +A proposed change is to include fractional scaling in Linux Mint 20 that too with multi-monitor support. If you have a combination of HiDPI and non-HiDPI monitors, you should be able to select the different resolution, refresh rate and different fractional scaling for each of them. + +#### No more 32 bit + +Though Ubuntu 18.04 dropped 32-bit ISO 2 years ago, Linux Mint 19 series kept on providing 32-bit ISO to download and install. + +This changes in Linux Mint 20. There is no 32-bit version of Linux Mint 20 anymore. This is because 32-bit support completely disappears from Ubuntu 20.04. + +#### What else? + +A lot of visual changes come with the release of Cinnamon 4.6 desktop version. + +There should be a few ‘under the hood’ changes coming from Ubuntu 20.04 such as Linux Kernel 5.4, removal of Python 2 support, inclusion of [Wireguard VPN][11] etc. + +I’ll update this article with more features as the development progresses. Stay tuned! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-mint-20/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-20-04-release-features/ +[2]: https://www.linuxmint.com/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Linux-Mint-20.png?ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/mint-20-aqua.jpg?ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/mint-20-pink-1.jpg?ssl=1 +[6]: https://blog.linuxmint.com/?p=3863 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/mint-20-warpinator-1.png?ssl=1 +[8]: https://www.electronjs.org/ +[9]: https://itsfoss.com/slack-use-linux/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/monitor_display_Linux_mint_20.png?ssl=1 +[11]: https://itsfoss.com/wireguard/ From a074eda472b1debee67d373a41ade208afe36f78 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:32:56 +0800 Subject: [PATCH 0820/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200516=20Fati?= =?UTF-8?q?h=E2=80=99s=20question?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200516 Fatih-s question.md --- sources/tech/20200516 Fatih-s question.md | 214 ++++++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 sources/tech/20200516 Fatih-s question.md diff --git a/sources/tech/20200516 Fatih-s question.md b/sources/tech/20200516 Fatih-s question.md new file mode 100644 index 0000000000..1225c624a8 --- /dev/null +++ b/sources/tech/20200516 Fatih-s question.md @@ -0,0 +1,214 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fatih’s question) +[#]: via: (https://dave.cheney.net/2020/05/16/fatihs-question) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Fatih’s question +====== + +A few days ago Fatih posted [this question][1] on twitter. + +I’m going to attempt to give my answer, however to do that I need to apply some simplifications as my previous attempts to answer it involved a lot of phrases like _a pointer to a pointer_, and other unhelpful waffling. Hopefully my simplified answer can be useful in building a mental framework to answer Fatih’s original question. + +### Restating the question + +Fatih’s original tweet showed [four different variations][2] of `json.Unmarshal`. I’m going to focus on the last two, which I’ll rewrite a little: + +``` +package main + +import ( + "encoding/json" + "fmt" +) + +type Result struct { + Foo string `json:"foo"` +} + +func main() { + content := []byte(`{"foo": "bar"}`) + var result1, result2 *Result + + err := json.Unmarshal(content, &result1) + fmt.Println(result1, err) // &{bar} + + err = json.Unmarshal(content, result2) + fmt.Println(result2, err) // json: Unmarshal(nil *main.Result) +} +``` + +Restated in words, `result1` and `result2` are the same type; `*Result`. Decoding into `result1` works as expected, whereas decoding into `result2` causes the `json` package to complain that the value passed to `Unmarshal` is `nil`. However, both values were declared without an initialiser so both would have taken on the type’s zero value, `nil`. + +Eagle eyed readers will have spotted that the reason for the difference is the first` `invocation is passed `&result1`, while the second is passed `result2`, but this explanation is unsatisfactory because the documentation for `json.Unmarshal` states: + +> Unmarshal parses the JSON-encoded data and stores the result in the value pointed to by v. **If v is nil or not a pointer**, Unmarshal returns an InvalidUnmarshalError. + +Which is confusing because `result1` and `result2` _are_ pointers. Furthermore, without initialisation, both _are_ `nil`. Now, the documentation is correct (as you’d expect from a package that has been hammered on for a decade), but explaining _why_ takes a little more investigation. + +### Functions receive a copy of their arguments + +Every assignment in Go is a copy, this includes function arguments and return values. + +``` +package main + +import ( + "fmt" +) + +func increment(v int) { + v++ +} + +func main() { + v := 1 + increment(v) + fmt.Println(v) // 1 +} +``` + +In this example, `increment` is operating on a _copy_ of `main`‘s `v`. This is because the `v` declared in `main` and `increment`‘s `v` parameter have different addresses in memory. Thus changes to `increment`‘s `v` cannot affect the contents of `main`‘s `v`. + +``` +package main + +import ( + "fmt" +) + +func increment(v *int) { + *v++ +} + +func main() { + v := 1 + increment(&v) + fmt.Println(v) // 2 +} +``` + +If we wanted to write `increment` in a way that it could affect the contents of its caller we would need to pass a reference, a pointer, to `main.v`.[1][3] This example demonstrates why `json.Unmarshal` needs a pointer to the value to decode JSON into. + +### Pointers to pointers + +Returning to the original question, both `result1` and `result2` are declared as `*Result`, that is, pointers to a `Result` value. We established that you have to pass the address of caller’s value to `json.Unmarshal` otherwise it won’t be able to alter the contents of the caller’s value. Why then must we pass the address of `result1`, a `**Result`, a pointer to a pointer to a `Result`, for the operation to succeed. + +To explain this another detour is required. Consider this code: + +``` +package main + +import ( + "encoding/json" + "fmt" +) + +type Result struct { + Foo *string `json:"foo"` +} + +func main() { + content := []byte(`{"foo": "bar"}`) + var result1 *Result + + err := json.Unmarshal(content, &result1) + fmt.Printf("%#v %v", result1, err) // &main.Result{Foo:(*string)(0xc0000102f0)} +} +``` + +In this example `Result` contains a pointer typed field, `Foo *string`. During JSON decoding `Unmarshal` allocated a new `string` value, stored the value `bar` in it, then placed the address of the string in `Result.Foo`. This behaviour is quite handy as it frees the caller from having to initialise `Result.Foo` and makes it easier to detect when a field was not initialised because the JSON did not contain a value. Beyond the convenience this offers for simple examples it would be prohibitively difficult for the caller to properly initialise all the reference type fields in a structure before decoding unknown JSON without first inspecting the incoming JSON which itself may be problematic if the input is coming from an `io.Reader` without the ability to rewind the input. + +> To unmarshal JSON into a pointer, Unmarshal first handles the case of the JSON being the JSON literal null. In that case, Unmarshal sets the pointer to nil. Otherwise, Unmarshal unmarshals the JSON into the value pointed at by the pointer. **If the pointer is nil, Unmarshal allocates a new value for it to point to**. + +`json.Unmarshal`‘s handling of pointer fields is clearly documented, and works as you would expect, allocating a new value whenever there is a need to decode into a pointer shaped field. It is this behaviour that gives us a hint to what is happening in the original example. + +We’ve seen that when `json.Unmarshal` encounters a field which points to `nil` it will allocate a new value of the correct type and assign its address the field before proceeding. Not only is does behaviour is applied recursively–for example in the case of a complex structure which contains pointers to other structures–but it also applies to the _value passed to `Unmarshal`._ + +``` +package main + +import ( + "encoding/json" + "fmt" +) + +func main() { + content := []byte(`1`) + var result *int + + err := json.Unmarshal(content, &result) + fmt.Println(*result, err) // 1 +} +``` + +In this example `result` is not a struct, but a simple `*int` which, lacking an initialiser, defaults to `nil`. After JSON decoding, `result` now points to an `int` with the value `1`. + +### Putting the pieces together + +Now I think I’m ready to take a shot at answering Fatih’s question. + +`json.Unmarshal` requires the address of the variable you want to decode into, otherwise it would decode into a temporary copy which would be discard on return. Normally this is done by declaring a value, then passing its address, or explicitly initialising the the value + +``` +var result1 Result +err := json.Unmarshal(content, &result1) // this is fine + +var result2 = new(Result) +err = json.Unmarshal(content, result2) // and this + +var result3 = &Result{} +err = json.Unmarshal(content, result3) // this is also fine +``` + +In all three cases the address that the `*Result` points too is not `nil`, it points to initialised memory that `json.Unmarshal` decodes into. + +Now consider what happens when `json.Unmarshal` encounters this + +``` +var result4 *Result +err = json.Unmarshal(content, result4) // err json: Unmarshal(nil *main.Result) +``` + +`result2`, `result3`, and the expression `&result1` point to a `Result`. However `result4`, even though it has the same type as the previous three, does not point to initialised memory, it points to `nil`. Thus, according to the examples we saw previously, before `json.Unmarshal` can decode into it, the memory `result4` points too must be initialised. + +However, because each function receives a copy of its arguments, the caller’s `result4` variable and the copy inside `json.Unmarshal` are unique. `json.Unmarshal` can allocate a new `Result` value and decode into it, but it cannot alter `result4` to point to this new value because it was not provided with a reference to `result4`, only a copy of its contents. + + 1. This does not violate the _everything is a copy_ rule, a copy of a pointer to `main.v` still points to `main.v`.[][4] + + + +#### Related posts: + + 1. [Should methods be declared on T or *T][5] + 2. [Ice cream makers and data races][6] + 3. [Understand Go pointers in less than 800 words or your money back][7] + 4. [Slices from the ground up][8] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2020/05/16/fatihs-question + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://twitter.com/fatih/status/1260683136842608640 +[2]: https://play.golang.org/p/g2yUIYrV67F +[3]: tmp.dRxkHxYRQS#easy-footnote-bottom-1-4153 (This does not violate the everything is a copy rule, a copy of a pointer to main.v still points to main.v.) +[4]: tmp.dRxkHxYRQS#easy-footnote-1-4153 +[5]: https://dave.cheney.net/2016/03/19/should-methods-be-declared-on-t-or-t (Should methods be declared on T or *T) +[6]: https://dave.cheney.net/2014/06/27/ice-cream-makers-and-data-races (Ice cream makers and data races) +[7]: https://dave.cheney.net/2017/04/26/understand-go-pointers-in-less-than-800-words-or-your-money-back (Understand Go pointers in less than 800 words or your money back) +[8]: https://dave.cheney.net/2018/07/12/slices-from-the-ground-up (Slices from the ground up) From 85223b7b6fc6efa04dd9bc3fade491f9e0890128 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:33:33 +0800 Subject: [PATCH 0821/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200223=20The?= =?UTF-8?q?=20Zen=20of=20Go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200223 The Zen of Go.md --- sources/tech/20200223 The Zen of Go.md | 414 +++++++++++++++++++++++++ 1 file changed, 414 insertions(+) create mode 100644 sources/tech/20200223 The Zen of Go.md diff --git a/sources/tech/20200223 The Zen of Go.md b/sources/tech/20200223 The Zen of Go.md new file mode 100644 index 0000000000..c4143aed32 --- /dev/null +++ b/sources/tech/20200223 The Zen of Go.md @@ -0,0 +1,414 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Zen of Go) +[#]: via: (https://dave.cheney.net/2020/02/23/the-zen-of-go) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +The Zen of Go +====== + +_This article was derived from my [GopherCon Israel 2020][1] presentation. It’s also quite long. If you’d prefer a shorter version, head over to [the-zen-of-go.netlify.com][2]_. + +_A recording of the presentation is available on [YouTube][3]._ + +* * * + +### How should I write good code? + +Something that I’ve been thinking about a lot recently, when reflecting on the body of my own work, is a common subtitle, _how should I write good code?_ Given nobody actively seeks to write _bad_ code, this leads to the question; _how do you know when you’ve written good Go code?_ + +If there’s a continuum between good and bad, how to do we know what the good parts are? What are its properties, its attributes, its hallmarks, its patterns, and its idioms? + +### Idiomatic Go + +![][4] + +Which brings me to idiomatic Go. To say that something is idiomatic is to say that it follows the style of the time. If something is not idiomatic, it is not following the prevailing style. It is unfashionable. + +More importantly, to say to someone that their code is not idiomatic does not explain _why_ it’s not idiomatic. Why is this? Like all truths, the answer is found in the dictionary. + +> idiom (noun): a group of words established by usage as having a meaning not deducible from those of the individual words. + +Idioms are hallmarks of shared values. Idiomatic Go is not something you learn from a book, it’s something that you acquire by being part of a community. + +![][5] + +My concern with the mantra of idiomatic Go is, in many ways, it can be exclusionary. It’s saying “you can’t sit with us.” After all, isn’t that what we mean when critique of someone’s work as non-idiomatic? They didn’t do It right. It doesn’t look right. It doesn’t follow the style of time. + +I offer that idiomatic Go is not a suitable mechanism for teaching how to write good Go code because it is defined, fundamentally, by telling someone they did it wrong. Wouldn’t it be better if the advice we gave didn’t alienate the author right at the point they were most willing to accept it? + +### Proverbs + +Stepping away problematic idioms, what other cultural artefacts do Gophers have? Perhaps we can turn to Rob Pike’s wonderful [Go Proverbs][6]. Are these suitable teaching tools? Will these tell newcomers how to write good Go code? + +In general, I don’t think so. This is not to dismiss Pike’s work, it is just that the Go Proverbs, like Segoe Kensaku’s original, are observations, not statements of value. Again, the dictionary comes to the rescue: + +> proverb (noun): a short, well-known pithy saying, stating a general truth or piece of advice. + +The goal of the Go Proverbs are to reveal a deeper truth about the design of the language, but how useful is advice like the _empty interface says nothing_ to a novice from a language that doesn’t have structural typing? + +It’s important to recognise that, in a growing community, at any time the people learning Go far outnumber those who claim to have mastered the language. Thus proverbs are perhaps not the best teaching tool in this scenario. + +### Engineering Values + +Dan Luu found [an old presentation][7] by Mark Lucovsky about the engineering culture of the windows team around the windows NT-windows 2000 timeframe. The reason I mention it is Lukovsky’s description of a culture as a common way of evaluating designs and making tradeoffs. + +![][8] + +There are many ways of discussing culture, but with respect to an engineering culture Lucovsky’s description is apt. The central idea is _values guide decisions in an unknown design space_. The values of the NT team were; portability, reliability, security, and extensibility. Engineering values are, crudely translated, the way things are done around here. + +### Go’s values + +What are the explicit values of Go? What are the core beliefs or philosophy that define the way a Go programmer interprets the world? How are they promulgated? How are they taught? How are they enforced? How do they change over time? + +How will you, as a newly minted Go programmer, inculcate the engineering values of Go? Or, how will you, a seasoned Go professional promulgate your values to a future generations? And just so we’re clear, this process of knowledge transfer is not optional. Without new blood and new ideas, our community become myopic and wither. + +#### The values of other languages + +To set the scene for what I’m getting at we can look to other languages we see examples of their engineering values. + +For example, C++ (and by extension Rust) believe that a programmer _should not have to pay for a feature they do not use_. If a program does not use some computationally expensive feature of the language, then it shouldn’t be forced to shoulder the cost of that feature. This value extends from the language, to its standard library, and is used as a yardstick for judging the design of all code written in C++. + +In Java, and Ruby, and Smalltalk, the core value that _everything is an object_ drives the design of programs around message passing, information hiding, and polymorphism. Designs that shoehorn a procedural style, or even a functional style, into these languages are considered to be wrong–or as Gophers would say, non idiomatic. + +Turning to our own community, what are the engineering values that bind Go programmers? Discourse in our community is often fractious, so deriving a set of values from first principles would be a formidable challenge. Consensus is critical, but exponentially more difficult as the number of contributors to the discussion increases. But what if someone had done the hard work for us. + +### The Zen of ~~Python~~ Go + +Several decades ago Tim Peters sat down and penned _[PEP-20][9]_, the Zen of Python. Peters’ attempted to document the engineering values that he saw Guido van Rossum apply in his role as BDFL for Python. + +For the remainder of this article, I’m going to look towards the Zen of Python and ask, is there anything that can inform the engineering values of Go programmers? + +### A good package starts with a good name + +Let’s start with something spicy, + +> “Namespaces are one honking great idea–let’s do more of those!” + +The Zen of Python, Item 19 + +This is pretty unequivocal, Python programmers should use namespaces. Lots of them. + +In Go parlance a namespace is a package. I doubt there is any question that grouping things into packages is good for design and potentially reuse. But there might be some confusion, especially if you’re coming with a decade of experience in another language, about the right way to do this. + +In Go each package should have a purpose, and the best way to know a package’s purpose is by its name—a noun. A package’s name describes what it provides. So too reinterpret Peters’ words, every Go package should have a single purpose. + +This is not a new idea, [I’ve been saying this a while][10], but why should you do this rather than approach where packages are used for fine grained taxonomy? Why, because change. + +> “Design is the art of arranging code to work today, and be changeable forever.” + +Sandi Metz + +Change is the name of the game we’re in. What we do as programmers is manage change. When we do that well we call it design, or architecture. When we do it badly we call it technical debt, or legacy code. + +If you are writing a program that works perfectly, one time, for one fixed set of inputs then nobody cares if the code is good or bad because ultimately the output of the program is all the business cares about. + +But this is _never_ true. Software has bugs, requirements change, inputs change, and very few programs are written solely to be executed once, thus your program _will_ change over time. Maybe it’s you who’ll be tasked with this, more likely it will be someone else, but someone has to change that code. Someone has to maintain that code. + +So, how can we make it easy to for programs to change? Interfaces everywhere? Make everything mockable? Pernicious dependency injection? Well, maybe, for some classes of programs, but not many, those techniques will be useful. However, for the majority of programs, designing something to be flexible up front is over engineering. + +What if, instead, we take a position that rather than enhancing components, we replace them. Then the best way to know when something needs to be replaced, is when it doesn’t do what it says on the tin. + +A good package starts with choosing a good name. Think of your package’s name as an elevator pitch, using just one word, to describe what it provides. When the name no longer matches the requirement, find a replacement. + +### Simplicity matters + +> “Simple is better than complex.” + +The Zen of Python, Item 3 + +PEP-20 says simple is better than complex, I couldn’t agree more. A couple of years ago I made this tweet; + +> Most programming languages start out aiming to be simple, but end up just settling for being powerful. +> +> — Dave Cheney (@davecheney) [December 2, 2014][11] + +My observation, at least at the time, was that I couldn’t think of a language introduced in my life time that didn’t purport to be simple. Each new language offered as a justification, and an enticement, their inherent simplicity. But as I researched, I found that simplicity was not a core value of the many of the languages considered Go’s contemporaries. [1][12] Maybe this is just a cheap shot, but could it be that either these languages aren’t simple, or they don’t _think_ of themselves as being simple. They don’t consider simplicity to be a core value. + +Call me old fashioned, but when did being simple fall out of style? Why does the commercial software development industry continually, gleefully, forget this fundamental truth? + +> “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” + +C. A. R. Hoare, The Emperor’s Old Clothes, 1980 Turing Award Lecture + +Simple does not mean easy, we know that. Often it is more work to make something simple to use, than easy to build. + +> “Simplicity is prerequisite for reliability.” + +Edsger W Dijkstra, EWD498, 18 June 1975 + +Why should we strive for simplicity? Why is important that Go programs be simple? Simple doesn’t mean crude, it means readable and maintainable. Simple doesn’t mean unsophisticated, it means reliable, relatable, and understandable. + +> “Controlling complexity is the essence of computer programming.” + +Brian W. Kernighan, _Software Tools_ (1976) + +Whether Python abides by its mantra of simplicity is a matter for debate, but Go holds simplicity as a core value. I think that we can all agree that when it comes to Go, simple code is preferable to clever code. + +### Avoid package level state + +> “Explicit is better than implicit.” + +_The Zen of Python, Item_ 2 + +This is a place where I think Peters’ was more aspirational than factual. Many things in Python are not explicit; decorators, dunder methods, and so on. Without doubt they are powerful, there’s a reason those features exists. Each feature is something someone cared enough about to do the work to implement it, especially the complicated ones. But heavy use of those features makes is harder for the reader to predict the cost of an operation. + +The good news is we have a choice, as Go programmers, to choose to make our code explicit. Explicit could mean many things, perhaps you may be thinking explicit is just a nice way of saying bureaucratic and long winded, but that’s a superficial interpretation. It’s a misnomer to focus only on the syntax on the page, to fret about line lengths and DRYing up expressions. The more valuable, in my opinon, place to be explicit are to do with coupling and with state. + +Coupling is a measure of the amount one thing depends on another. If two things are tightly coupled, they move together. An action that affects one is directly reflected in another. Imagine a train, each carriage joined–ironically the correct word is coupled–together; where the engine goes, the carriages follow. + +Another way to describe coupling is the word cohesion. Cohesion measures how well two things naturally belong together. We talk about a cohesive argument, or a cohesive team; all their parts fit together as if they were designed that way. + +Why does coupling matter? Because just like trains, when you need to change a piece of code, all the code that is tightly coupled to it must change. A prime example, someone release a new version of their API and now your code doesn’t compile. + +APIs are an unavoidable source of coupling but there are more insidious forms of coupling. Clearly everyone knows that if an API’s signature changes the data passing into and out of that call changes. It’s right there in the signature of the function; I take values of these types and return values of other types. But what if the API passed data another way? What if every time you called this API the result was based on the previous time you called that API even though you didn’t change your parameters. + +This is state, and management of state is _the_ problem in computer science. + +``` +package counter + +var count int + +func Increment(n int) int { + count += n + return count +} +``` + +Suppose we have this simple `counter` package. You can call `Increment` to increment the counter, you can even get the value back if you `Increment` with a value of zero. + +Suppose you had to test this code, how would you reset the counter after each test? Suppose you wanted to run those tests in parallel, could you do it? Now suppose that you wanted to count more than one thing per program, could you do it? + +No, of course not. Clearly the answer is to encapsulate the `count` variable in a type. + +``` +package counter + +type Counter struct { + count int +} + +func (c *Counter) Increment(n int) int { + c.count += n + return c.count +} +``` + +Now imagine that this problem isn’t restricted to just counters, but your applications main business logic. Can you test it in isolation? Can you test it in parallel? Can you use more than one instance at a time? If the answer those question is _no_, the reason is package level state. + +Avoid package level state. Reduce coupling and spooky action at a distance by providing the dependencies a type needs as fields on that type rather than using package variables. + +### Plan for failure, not success + +> “Errors should never pass silently.” + +_The Zen of Python, Item 1_0 + +It’s been said of languages that favour exception handling follow the Samurai principle; _return victorious or not at all_. In exception based languages functions only return valid results. If they don’t succeed then control flow takes an entirely different path. + +Unchecked exceptions are clearly an unsafe model to program in. How can you possibly write code that is robust in the presence of errors when you don’t know which statements could throw an exception? Java tried to make exceptions safer by introducing the notion of a checked exception which, to the best of my knowledge, has not been repeated in another mainstream language. There are plenty of languages which use exceptions but they all, with the singular exception of Java, do so in the unchecked variety. + +Obviously Go chose a different path. Go programmers believe that robust programs are composed from pieces that handle the failure cases _before_ they handle the happy path. In the space that Go was designed for; server programs, multi threaded programs, programs that handle input over the network, dealing with unexpected data, timeouts, connection failures and corrupted data must be front and centre of the programmer’s mind if they are to produce robust programs. + +> “I think that error handling should be explicit, this should be a core value of the language.” + +Peter Bourgon, [GoTime #91][13] + +I want to echo Peter’s assertion, as it was the impetus for this article. I think so much of the success of Go is due to the explicit way errors are handled. Go programmers thinks about the failure case first. We solve the “what if…​” case first. This leads to programs where failures are handled at the point of writing, rather than the point they occur in production. + +The verbosity of + +``` +if err != nil { + return err +} +``` + +is outweighed by the value of deliberately handling each failure condition at the point at which they occur. Key to this is the cultural value of handling each and every error explicitly. + +### Return early rather than nesting deeply + +> “Flat is better than nested.” + +The Zen of Python, Item 5 + +This is sage advice coming from a language where indentation is the primary form of control flow. How can we interpret this advice in terms of Go? `gofmt` controls the overall whitespace of a Go program so there’s not thing doing there. + +I wrote earlier about package names, and there is probably some advice here about avoiding a complicated package hierarchy. In my experience the more a programmer tries to subdivide and taxonimise their Go codebase the more they risk hitting the dead end that is package import loops. + +I think the best application of item 5’s advice is the control flow _within_ a function. Simply put, avoid control flow that requires deep indentation. + +> “Line of sight is a straight line along which an observer has unobstructed vision.” + +May Ryer, [Code: Align the happy path to the left edge][14] + +Mat Ryer describes this idea as line of sight coding. Light of sight coding means things like: + + * Using guard clauses to return early if a precondition is not met. + * Placing the successful return statement at the end of the function rather than inside a conditional block. + * Reducing the overall indentation level of the function by extracting functions and methods. + + + +Key to this advice is the thing that you care about, the thing that the function does, is never in danger of sliding out of sight to the right of your screen. This style has a bonus side effect that you’ll avoid pointless arguments about line lengths on your team. + +Every time you indent you add another precondition to the programmers stack, consuming one of their 7 ±2 short term memory slots. Rather than nesting deeply, keep the successful path of the function close to the left hand side of your screen. + +### If you think it’s slow, prove it with a benchmark + +> “In the face of ambiguity, refuse the temptation to guess.” + +The Zen of Python, Item 12 + +Programming is based on mathematics and logic, two concepts which rarely involve the element of chance. But there are many things we, as programmers, guess about every day. What does this variable do? What does this parameter do? What happens if I pass `nil` here? What happens if I call `Register` twice? There’s actually a lot of guesswork in modern programming, especially when it comes to using libraries you didn’t write. + +> “APIs should be easy to use and hard to misuse.” + +Josh Bloch + +One of the best ways I know to help a programmer avoid having to guess is to, when building an API, [focus on the default use case][15]. Make it as easy as you can for the caller to do the most common thing. However, I’ve written and talked a lot about API design in the past, so instead my interpretation of item 12 is; _don’t guess about performance_. + +Despite how you may feel about Knuth’s advice, one of the drivers of Go’s success is its efficient execution. You can write efficient programs in Go and thus people _will_ choose Go because of this. There are a lot of misconceptions about performance, so my request is, when you’re looking to performance tune your code or you’re facing some dogmatic advice like defer is slow, CGO is expensive, or always use atomics not mutexes, don’t guess. + +Don’t complicate your code because of outdated dogma, and, if you think something is slow, first prove it with a benchmark. Go has excellent benchmarking and profiling tools that come in the distribution for free. Use them to find your bottlenecks. + +### Before you launch a goroutine, know when it will stop + +At this point I think I think I’ve mined the valuable points from PEP-20 and possibly stretched its reinterpretation beyond the point of good taste. I think that’s fine, because although this was a useful rhetorical device, ultimately we are talking about two different languages. + +> “You type g o, a space, and then a function call. Three keystrokes, you can’t make it much shorter than that. Three keystrokes and you’ve just started a sub process.” + +Rob Pike, [Simplicity is Complicated][16], dotGo 2015 + +The next two suggestions I’ll dedicate to goroutines. Goroutines are the signature feature of the language, our answer for first class concurrency. They are so easy to use, just put the word `go` in front of the statement and you’ve launched that function asynchronously. It’s so simple, no threads, no stack sizes, no thread pool executors, no ID’s, no tracking completion status. + +Goroutines are cheap. Because of the runtime’s ability to multiplex goroutines onto a small pool of threads (which you don’t have to manage), hundreds of thousands, millions of goroutines are easily accommodated. This opens up designs that would be not be practical under competing concurrency models like threads or evented callbacks. + +But as cheap as goroutines are, they’re not free. At a minimum there’s a few kilobytes for their stack, which, when you’re getting up into the 10^6 goroutines, does start to add up. This is not to say you shouldn’t use millions of goroutines if that is what the design calls for, but when you do, it’s critical that you keep track of them because 10^6 of anything can consume a non trivial amount of resources in aggregate. + +Goroutines are the key to resource ownership in Go. To be useful a goroutine has to do something, and that means it almost always holds reference to, or ownership of, a resource; a lock, a network connection, a buffer with data, the sending end of a channel. While that goroutine is alive, the lock is held, the network connection remains open, the buffer retained and the receivers of the channel will continue to wait for more data. + +The simplest way to free those resources is to tie them to the lifetime of the goroutine–when the goroutine exits, the resource has been freed. So while it’s near trivial to start a goroutine, before you write those three letters, g o and a space, make sure you have an answer to these questions: + + * **Under what condition will a goroutine stop?** Go doesn’t have a way to tell a goroutine to exit. There is no stop or kill function, for good reason. If we cannot command a goroutine to stop, we must instead ask it, politely. Almost always this comes down to a channel operation. Range loops over a channel exit when the channel is closed. A channel will become selectable if it is closed. The signal from one goroutine to another is best expressed as a closed channel. + * **What is required for that condition to arise?** If channels are both the vehicle to communicate between goroutines and the mechanism for them to signal completion, the next question to the programmer becomes, who will close the channel, when will that happen? + * **What signal will you use to know the goroutine has stopped?** When you signal a goroutine to stop, that stopping will happen at some time in the future relative to the goroutine’s frame of reference. It might happen quickly in terms of human perception, but computers execute billions of instructions every second, and from the point of view of each goroutine, their execution of instructions is unsynchronised. The solution is often to use a channel to signal back or a waitgroup where a fan in approach is needed. + + + +### Leave concurrency to the caller + +It is likely that in any serious Go program you write there will be concurrency involved. This raises the problem, many of the libraries and code that we write fall into this a one goroutine per connection, or worker pattern. How will you manage the lifetime of those goroutines? + +`net/http` is a prime example. Shutting down the server owning the listening socket is relatively straight forward, but what about a goroutines spawned from that accepting socket? `net/http` does provide a context object inside the request object which can be used to signal–to code that is listening–that the request should be canceled, thereby terminating the goroutine, however it is less clear how to know when all of these things have been done. It’s one thing to call `context.Cancel`, its another to know that the cancellation has completed.[2][17] + +The point I want to make about `net/http` is that its a counter example to good practice. Because each connection is handled by a goroutine spawned inside the `net/http.Server` type, the program, living outside the `net/http` package, does not have an ability to control the goroutines spawned for the accepting socket. + +This is an area of design that is still evolving, with efforts like go-kit’s `run.Group` and the Go team’s [`ErrGroup`][18] which provide a framework to execute, cancel and wait on functions run asynchronously. + +The bigger design maxim here is for library writers, or anyone writing code that could be run asynchronously, leave the responsibility of starting to goroutine to your caller. Let the caller choose how they want to start, track, and wait on your functions execution. + +### Write tests to lock in the behaviour of your package’s API + +Perhaps you were hoping to read an article from me where I didn’t rant about testing. Sadly, today is not that day. + +Your tests are the contract about what your software does and does not do. Unit tests at the package level should lock in the behaviour of the package’s API. They describe, in code, what the package promises to do. If there is a unit test for each input permutation, you have defined the contract for what the code will do _in code_, not documentation. + +This is a contract you can assert as simply as typing `go test`. At any stage, you can _know_ with a high degree of confidence, that the behaviour people relied on before your change continues to function after your change. + +Tests lock in api behaviour. Any change that adds, modifies or removes a public api must include changes to its tests. + +### Moderation is a virtue + +Go is a simple language, only 25 keywords. In some ways this makes the features that are built into the language stand out. Equally these are the features that the language sells itself on, lightweight concurrency, structural typing. + +I think all of us have experienced the confusion that comes from trying to use all of Go’s features at once. Who was so excited to use channels that they used them as much as they could, as often as they could? Personally for me I found the result was hard to test, fragile, and ultimately overcomplicated. Am I alone? + +I had the same experience with goroutines, attempting to break the work into tiny units I created a hard to manage hurd of Goroutines and ultimately missed the observation that most of my goroutines were always blocked waiting for their predecessor– the code was ultimately sequential and I had added a lot of complexity for little real world benefit. Who has experienced something like this? + +I had the same experience with embedding. Initially I mistook it for inheritance. Then later I recreated the fragile base class problem by composing complicated types, which already had several responsibilities, into more complicated mega types. + +This is potentially the least actionable piece of advice, but one I think is important enough to mention. The advice is always the same, all things in moderation, and Go’s features are no exception. If you can, don’t reach for a goroutine, or a channel, or embed a struct, anonymous functions, going overboard with packages, interfaces for everything, instead prefer simpler approach rather than the clever approach. + +### Maintainability counts + +I want to close with one final item from PEP-20, + +> “Readability Counts.” + +The Zen of Python, Item 7 + +So much has been said, about the importance of readability, not just in Go, but all programming languages. People like me who stand on stages advocating for Go use words like simplicity, readability, clarity, productivity, but ultimately they are all synonyms for one word–_maintainability_. + +The real goal is to write maintainable code. Code that can live on after the original author. Code that can exist not just as a point in time investment, but as a foundation for future value. It’s not that readability doesn’t matter, maintainability matters _more_. + +Go is not a language that optimises for clever one liners. Go is not a language which optimises for the least number of lines in a program. We’re not optimising for the size of the source code on disk, nor how long it takes to type the program into an editor. Rather, we want to optimise our code to be clear to the reader. Because its the reader who’s going to have to maintain this code. + +If you’re writing a program for yourself, maybe it only has to run once, or you’re the only person who’ll ever see it, then do what ever works for you. But if this is a piece of software that more than one person will contribute to, or that will be used by people over a long enough time that requirements, features, or the environment it runs in may change, then your goal must be for your program to be maintainable. If software cannot be maintained, then it will be rewritten; and that could be the last time your company will invest in Go. + +Can the thing you worked hard to build be maintained after you’re gone? What can you do today to make it easier for someone to maintain your code tomorrow? + +##### [the-zen-of-go.netlify.com][2] + + 1. This part of the talk had several screenshots of the landing pages for the websites for [Ruby][19], [Swift][20], [Elm][21], [Go][22], [NodeJS][23], [Python][24], [Rust][25], highlighting how the language described itself.[][26] + 2. I tend to pick on `net/http` a lot, and this is not because it is bad, in fact it is the opposite, it is the most successful, oldest, most used API in the Go codebase. And because of that its design, evolution, and shortcoming have been thoroughly picked over. Think of this as flattery, not criticism.[][27] + + + +#### Related posts: + + 1. [Never start a goroutine without knowing how it will stop][28] + 2. [Simplicity Debt][29] + 3. [Curious Channels][30] + 4. [Let’s talk about logging][31] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2020/02/23/the-zen-of-go + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://www.gophercon.org.il +[2]: https://the-zen-of-go.netlify.com +[3]: https://www.youtube.com/watch?v=yd_rtwYaXps +[4]: https://dave.cheney.net/wp-content/uploads/2020/02/1011226.jpg +[5]: https://dave.cheney.net/wp-content/uploads/2020/02/mean-girls-you-cant-sit-with-us-main.jpg +[6]: http://go-proverbs.github.io +[7]: https://danluu.com/microsoft-culture/ +[8]: https://dave.cheney.net/wp-content/uploads/2020/02/Lucovsky.001.jpeg +[9]: https://www.python.org/dev/peps/pep-0020/ +[10]: https://dave.cheney.net/2019/01/08/avoid-package-names-like-base-util-or-common +[11]: https://twitter.com/davecheney/status/539576755254611968?ref_src=twsrc%5Etfw +[12]: tmp.iUoDiQyXMU#easy-footnote-bottom-1-3936 (This part of the talk had several screenshots of the landing pages for the websites for Ruby, Swift, Elm, Go, NodeJS, Python, Rust, highlighting how the language described itself.) +[13]: https://changelog.com/gotime/91 +[14]: https://medium.com/@matryer/line-of-sight-in-code-186dd7cdea88 +[15]: http://sweng.the-davies.net/Home/rustys-api-design-manifesto +[16]: https://www.youtube.com/watch?v=rFejpH_tAHM +[17]: tmp.iUoDiQyXMU#easy-footnote-bottom-2-3936 (I tend to pick on net/http a lot, and this is not because it is bad, in fact it is the opposite, it is the most successful, oldest, most used API in the Go codebase. And because of that its design, evolution, and shortcoming have been thoroughly picked over. Think of this as flattery, not criticism.) +[18]: https://godoc.org/golang.org/x/sync/errgroup +[19]: https://www.ruby-lang.org/en/ +[20]: https://swift.org +[21]: https://elm-lang.org +[22]: https://golang.org +[23]: https://nodejs.org/en/ +[24]: https://www.python.org +[25]: https://www.rust-lang.org +[26]: tmp.iUoDiQyXMU#easy-footnote-1-3936 +[27]: tmp.iUoDiQyXMU#easy-footnote-2-3936 +[28]: https://dave.cheney.net/2016/12/22/never-start-a-goroutine-without-knowing-how-it-will-stop (Never start a goroutine without knowing how it will stop) +[29]: https://dave.cheney.net/2017/06/15/simplicity-debt (Simplicity Debt) +[30]: https://dave.cheney.net/2013/04/30/curious-channels (Curious Channels) +[31]: https://dave.cheney.net/2015/11/05/lets-talk-about-logging (Let’s talk about logging) From a82f1747f4854b20a2eafb9462cbfade8d976f8e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:36:07 +0800 Subject: [PATCH 0822/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200525=20How?= =?UTF-8?q?=20Cloud-init=20can=20be=20used=20for=20your=20Raspberry=20Pi?= =?UTF-8?q?=20homelab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200525 How Cloud-init can be used for your Raspberry Pi homelab.md --- ...n be used for your Raspberry Pi homelab.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/tech/20200525 How Cloud-init can be used for your Raspberry Pi homelab.md diff --git a/sources/tech/20200525 How Cloud-init can be used for your Raspberry Pi homelab.md b/sources/tech/20200525 How Cloud-init can be used for your Raspberry Pi homelab.md new file mode 100644 index 0000000000..32d5026812 --- /dev/null +++ b/sources/tech/20200525 How Cloud-init can be used for your Raspberry Pi homelab.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Cloud-init can be used for your Raspberry Pi homelab) +[#]: via: (https://opensource.com/article/20/5/cloud-init-raspberry-pi-homelab) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) + +How Cloud-init can be used for your Raspberry Pi homelab +====== +Automate adding new devices and users to your homelab while getting to +know a cloud-industry standard. +![gears and lightbulb to represent innovation][1] + +[Cloud-init][2] is a standard—it would not be a stretch to say it is _the_ standard—that cloud providers use to provide initialization and configuration data to cloud instances. It is used most often on the first boot of a new instance to automate network setup, account creation, and SSH (secure shell) key installation—anything required to bring a new system online so that it is accessible by the user. + +In a previous article, [_Modify a disk image to create a Raspberry Pi-based homelab_][3], I showed how to customize the operating system image for single-board computers like the Raspberry Pi to accomplish a similar goal. With Cloud-init, there is no need to add custom data to the image. Once it is enabled in your images, your virtual machines, physical servers, even tiny Raspberry Pis can behave like cloud instances in your own "private cloud at home." New machines can just be plugged in, turned on, and automatically become part of your [homelab][4]. + +To be honest, Cloud-init is not designed with homelabs in mind. As I mentioned, you can easily modify the disk image for a given set of systems to enable SSH access and configure them after the first boot. Cloud-init is designed for large-scale cloud providers that need to accommodate many customers, maintain a small set of images, and provide a mechanism for those customers to access instances without customizing an image for each of them. A homelab with a single administrator does not face the same challenges. + +Cloud-init is not without merit in the homelab, though. Education is one of my goals for the private cloud at home project, and setting up Cloud-init for your homelab is a great way to gain experience with a technology used heavily by cloud providers, large and small. Cloud-init is also an alternative to other initial-configuration options. Rather than customizing each image, ISO, etc. for every device in your homelab and face tedious updates when you want to make changes, you can just enable Cloud-init. This reduces technical debt—and is there anything worse than _personal_ technical debt? Finally, using Cloud-init in your homelab allows your private cloud instances to behave the same as any public cloud instances you have or may have in the future—a true [hybrid cloud][5]. + +### About Cloud-init + +When an instance configured for Cloud-init boots up and the service (actually, four services in systemd implementations to handle dependencies during the boot process) starts, it checks its configuration for a [datasource][6] to determine what type of cloud it is running in. Each major cloud provider has a datasource configuration that tells the instance where and how to retrieve configuration information. The instance then uses the datasource information to retrieve configuration information provided by the cloud provider, such as networking information and instance-identification information, and configuration data provided by the customer, such as authorized keys to be copied, user accounts to be created, and many other possible tasks. + +After retrieving the data, Cloud-init then configures the instance: setting up networking, copying the authorized keys, etc., and finally completing the boot process. Then it is accessible to the remote user, ready for further configuration with tools like [Ansible][7] or [Puppet][8] or prepared to receive a workload and begin its assigned tasks. + +### Configuration data + +As mentioned above, the configuration data used by Cloud-init comes from two potential sources: the cloud provider and the instance user. In a homelab, you fill both roles: providing networking and instance information as the cloud provider and providing configuration information as the user. + +#### The cloud provider metadata file + +In your cloud provider role, your homelab datasource will offer your private cloud instances a metadata file. The [metadata][9] file contains information such as the instance ID, cloud type, Python version (Cloud-init is written in and uses Python), or a public SSH key to be assigned to the host. The metadata file may also contain networking information if you're not using DHCP (or the other mechanisms Cloud-init supports, such as a config file in the image or kernel parameters). + +#### The user-provided user-data file + +The real meat of Cloud-init's value is in the user-data file. Provided by the user to the cloud provider and included in the datasource, the [user-data][10] file is what turns an instance from a generic machine into a member of the user's fleet. The user-data file can come in the form of an executable script, working the same as the script would in normal circumstances, or as a cloud-config YAML file, which makes use of [Cloud-init's modules][11] to perform configuration tasks. + +### Datasource + +The datasource is a service provided by the cloud provider that offers the metadata and user-data files to the instances. Instance images or ISOs are configured to tell the instance what datasource is being used. + +For example, Amazon AWS provides a [link-local][12] file that will respond to HTTP requests from an instance with the instance's custom data. Other cloud providers have their own mechanisms, as well. Luckily for the private cloud at home project, there are also NoCloud data sources. + +[NoCloud][13] datasources allow configuration information to be provided via the kernel command as key-value pairs or as user-data and metadata files provided as mounted ISO filesystems. These are useful for virtual machines, especially paired with automation to create the virtual machines. + +There is also a NoCloudNet datasource that behaves similarly to the AWS EC2 datasource, providing an IP address or DNS name from which to retrieve user data and metadata via HTTP. This is most helpful for the physical machines in your homelab, such as Raspberry Pis, [NUCs][14], or surplus server equipment. While NoCloud could work, it requires more manual attention—an anti-pattern for cloud instances. + +### Cloud-init for the homelab + +I hope this gives you an idea of what Cloud-init is and how it may be helpful in your homelab. It is an incredible tool that is embraced by major cloud providers, and using it at home can be educational and fun and help you automate adding new physical or virtual servers to your lab. Future articles will detail how to create both simple static and more complex dynamic Cloud-init services and guide you in incorporating them into your private cloud at home. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/cloud-init-raspberry-pi-homelab + +作者:[Chris Collins][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clcollins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation) +[2]: https://cloudinit.readthedocs.io/ +[3]: https://opensource.com/article/20/5/disk-image-raspberry-pi +[4]: https://opensource.com/article/19/3/home-lab +[5]: https://www.redhat.com/en/topics/cloud-computing/what-is-hybrid-cloud +[6]: https://cloudinit.readthedocs.io/en/latest/topics/datasources.html +[7]: https://www.ansible.com/ +[8]: https://puppet.com/ +[9]: https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html# +[10]: https://cloudinit.readthedocs.io/en/latest/topics/format.html +[11]: https://cloudinit.readthedocs.io/en/latest/topics/modules.html +[12]: https://en.wikipedia.org/wiki/Link-local_address +[13]: https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html +[14]: https://en.wikipedia.org/wiki/Next_Unit_of_Computing From 98102bb5eb81c9f644b86f244656f4216853fe6c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:39:14 +0800 Subject: [PATCH 0823/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020170112=20Writ?= =?UTF-8?q?ing=20Advanced=20Web=20Applications=20with=20Go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20170112 Writing Advanced Web Applications with Go.md --- ...iting Advanced Web Applications with Go.md | 658 ++++++++++++++++++ 1 file changed, 658 insertions(+) create mode 100644 sources/tech/20170112 Writing Advanced Web Applications with Go.md diff --git a/sources/tech/20170112 Writing Advanced Web Applications with Go.md b/sources/tech/20170112 Writing Advanced Web Applications with Go.md new file mode 100644 index 0000000000..f46521e8a7 --- /dev/null +++ b/sources/tech/20170112 Writing Advanced Web Applications with Go.md @@ -0,0 +1,658 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Writing Advanced Web Applications with Go) +[#]: via: (https://www.jtolio.com/2017/01/writing-advanced-web-applications-with-go) +[#]: author: (jtolio.com https://www.jtolio.com/) + +Writing Advanced Web Applications with Go +====== + +Web development in many programming environments often requires subscribing to some full framework ethos. With [Ruby][1], it’s usually [Rails][2] but could be [Sinatra][3] or something else. With [Python][4], it’s often [Django][5] or [Flask][6]. With [Go][7], it’s… + +If you spend some time in Go communities like the [Go mailing list][8] or the [Go subreddit][9], you’ll find Go newcomers frequently wondering what web framework is best to use. [There][10] [are][11] [quite][12] [a][13] [few][14] [Go][15] [frameworks][16] ([and][17] [then][18] [some][19]), so which one is best seems like a reasonable question. Without fail, though, the strong recommendation of the Go community is to [avoid web frameworks entirely][20] and just stick with the standard library as long as possible. Here’s [an example from the Go mailing list][21] and here’s [one from the subreddit][22]. + +It’s not bad advice! The Go standard library is very rich and flexible, much more so than many other languages, and designing a web application in Go with just the standard library is definitely a good choice. + +Even when these Go frameworks call themselves minimalistic, they can’t seem to help themselves avoid using a different request handler interface than the default standard library [http.Handler][23], and I think this is the biggest source of angst about why frameworks should be avoided. If everyone standardizes on [http.Handler][23], then dang, all sorts of things would be interoperable! + +Before Go 1.7, it made some sense to give in and use a different interface for handling HTTP requests. But now that [http.Request][24] has the [Context][25] and [WithContext][26] methods, there truly isn’t a good reason any longer. + +I’ve done a fair share of web development in Go and I’m here to share with you both some standard library development patterns I’ve learned and some code I’ve found myself frequently needing. The code I’m sharing is not for use instead of the standard library, but to augment it. + +Overall, if this blog post feels like it’s predominantly plugging various little standalone libraries from my [Webhelp non-framework][27], that’s because it is. It’s okay, they’re little standalone libraries. Only use the ones you want! + +If you’re new to Go web development, I suggest reading the Go documentation’s [Writing Web Applications][28] article first. + +### Middleware + +A frequent design pattern for server-side web development is the concept of _middleware_, where some portion of the request handler wraps some other portion of the request handler and does some preprocessing or routing or something. This is a big component of how [Express][29] is organized on [Node][30], and how Express middleware and [Negroni][17] middleware works is almost line-for-line identical in design. + +Good use cases for middleware are things such as: + + * making sure a user is logged in, redirecting if not, + * making sure the request came over HTTPS, + * making sure a session is set up and loaded from a session database, + * making sure we logged information before and after the request was handled, + * making sure the request was routed to the right handler, + * and so on. + + + +Composing your web app as essentially a chain of middleware handlers is a very powerful and flexible approach. It allows you to avoid a lot of [cross-cutting concerns][31] and have your code factored in very elegant and easy-to-maintain ways. By wrapping a set of handlers with middleware that ensures a user is logged in prior to actually attempting to handle the request, the individual handlers no longer need mistake-prone copy-and-pasted code to ensure the same thing. + +So, middleware is good. However, if Negroni or other frameworks are any indication, you’d think the standard library’s `http.Handler` isn’t up to the challenge. Negroni adds its own `negroni.Handler` just for the sake of making middleware easier. There’s no reason for this. + +Here is a full middleware implementation for ensuring a user is logged in, assuming a `GetUser(*http.Request)` function but otherwise just using the standard library: + +``` +func RequireUser(h http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + user, err := GetUser(req) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + if user == nil { + http.Error(w, "unauthorized", http.StatusUnauthorized) + return + } + h.ServeHTTP(w, req) + }) +} +``` + +Here’s how it’s used (just wrap another handler!): + +``` +func main() { + http.ListenAndServe(":8080", RequireUser(http.HandlerFunc(myHandler))) +} +``` + +Express, Negroni, and other frameworks expect this kind of signature for a middleware-supporting handler: + +``` +type Handler interface { + // don't do this! + ServeHTTP(rw http.ResponseWriter, req *http.Request, next http.HandlerFunc) +} +``` + +There’s really no reason for adding the `next` argument - it reduces cross-library compatibility. So I say, don’t use `negroni.Handler` (or similar). Just use `http.Handler`! + +### Composability + +Hopefully I’ve sold you on middleware as a good design philosophy. + +Probably the most commonly-used type of middleware is request routing, or muxing (seems like we should call this demuxing but what do I know). Some frameworks are almost solely focused on request routing. [gorilla/mux][32] seems more popular than any other part of the [Gorilla][33] library. I think the reason for this is that even though the Go standard library is completely full featured and has a good [ServeMux][34] implementation, it doesn’t make the right thing the default. + +So! Let’s talk about request routing and consider the following problem. You, web developer extraordinaire, want to serve some HTML from your web server at `/hello/` but also want to serve some static assets from `/static/`. Let’s take a quick stab. + +``` +package main + +import ( + "net/http" +) + +func hello(w http.ResponseWriter, req *http.Request) { + w.Write([]byte("hello, world!")) +} + +func main() { + mux := http.NewServeMux() + mux.Handle("/hello/", http.HandlerFunc(hello)) + mux.Handle("/static/", http.FileServer(http.Dir("./static-assets"))) + http.ListenAndServe(":8080", mux) +} +``` + +If you visit `http://localhost:8080/hello/`, you’ll be rewarded with a friendly “hello, world!” message. + +If you visit `http://localhost:8080/static/` on the other hand (assuming you have a folder of static assets in `./static-assets`), you’ll be surprised and frustrated. This code tries to find the source content for the request `/static/my-file` at `./static-assets/static/my-file`! There’s an extra `/static` in there! + +Okay, so this is why `http.StripPrefix` exists. Let’s fix it. + +``` +mux.Handle("/static/", http.StripPrefix("/static", + http.FileServer(http.Dir("./static-assets")))) +``` + +`mux.Handle` combined with `http.StripPrefix` is such a common pattern that I think it should be the default. Whenever a request router processes a certain amount of URL elements, it should strip them off the request so the wrapped `http.Handler` doesn’t need to know its absolute URL and only needs to be concerned with its relative one. + +In [Russ Cox][35]’s recent [TiddlyWeb backend][36], I would argue that every time `strings.TrimPrefix` is needed to remove the full URL from the handler’s incoming path arguments, it is an unnecessary cross-cutting concern, unfortunately imposed by `http.ServeMux`. (An example is [line 201 in tiddly.go][37].) + +I’d much rather have the default `mux` behavior work more like a directory of registered elements that by default strips off the ancestor directory before handing the request to the next middleware handler. It’s much more composable. To this end, I’ve written a simple muxer that works in this fashion called [whmux.Dir][38]. It is essentially `http.ServeMux` and `http.StripPrefix` combined. Here’s the previous example reworked to use it: + +``` +package main + +import ( + "net/http" + + "gopkg.in/webhelp.v1/whmux" +) + +func hello(w http.ResponseWriter, req *http.Request) { + w.Write([]byte("hello, world!")) +} + +func main() { + mux := whmux.Dir{ + "hello": http.HandlerFunc(hello), + "static": http.FileServer(http.Dir("./static-assets")), + } + http.ListenAndServe(":8080", mux) +} +``` + +There are other useful mux implementations inside the [whmux][39] package that demultiplex on various aspects of the request path, request method, request host, or pull arguments out of the request and place them into the context, such as a [whmux.IntArg][40] or [whmux.StringArg][41]. This brings us to [contexts][42]. + +### Contexts + +Request contexts are a recent addition to the Go 1.7 standard library, but the idea of [contexts has been around since mid-2014][43]. As of Go 1.7, they were added to the standard library ([“context”][42]), but are available for older Go releases in the original location ([“golang.org/x/net/context”][44]). + +First, here’s the definition of the `context.Context` type that `(*http.Request).Context()` returns: + +``` +type Context interface { + Done() <-chan struct{} + Err() error + Deadline() (deadline time.Time, ok bool) + + Value(key interface{}) interface{} +} +``` + +Talking about `Done()`, `Err()`, and `Deadline()` are enough for an entirely different blog post, so I’m going to ignore them at least for now and focus on `Value(interface{})`. + +As a motivating problem, let’s say that the `GetUser(*http.Request)` method we assumed earlier is expensive, and we only want to call it once per request. We certainly don’t want to call it once to check that a user is logged in, and then again when we actually need the `*User` value. With `(*http.Request).WithContext` and `context.WithValue`, we can pass the `*User` down to the next middleware precomputed! + +Here’s the new middleware: + +``` +type userKey int + +func RequireUser(h http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + user, err := GetUser(req) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + if user == nil { + http.Error(w, "unauthorized", http.StatusUnauthorized) + return + } + ctx := r.Context() + ctx = context.WithValue(ctx, userKey(0), user) + h.ServeHTTP(w, req.WithContext(ctx)) + }) +} +``` + +Now, handlers that are protected by this `RequireUser` handler can load the previously computed `*User` value like this: + +``` +if user, ok := req.Context().Value(userKey(0)).(*User); ok { + // there's a valid user! +} +``` + +Contexts allow us to pass optional values to handlers down the chain in a way that is relatively type-safe and flexible. None of the above context logic requires anything outside of the standard library. + +#### Aside about context keys + +There was a curious piece of code in the above example. At the top, we defined a `type userKey int`, and then always used it as `userKey(0)`. + +One of the possible problems with contexts is the `Value()` interface lends itself to a global namespace where you can stomp on other context users and use conflicting key names. Above, we used `type userKey` because it’s an unexported type in your package. It will never compare equal (without a cast) to any other type, including `int`, in Go. This gives us a way to namespace keys to your package, even though the `Value()` method is still a sort of global namespace. + +Because the need for this is so common, the `webhelp` package defines a [GenSym()][45] helper that will create a brand new, never-before-seen, unique value for use as a context key. + +If we used [GenSym()][45], then `type userKey int` would become `var userKey = webhelp.GenSym()` and `userKey(0)` would simply become `userKey`. + +#### Back to whmux.StringArg + +Armed with this new context behavior, we can now present a `whmux.StringArg` example: + +``` +package main + +import ( + "fmt" + "net/http" + + "gopkg.in/webhelp.v1/whmux" +) + +var ( + pageName = whmux.NewStringArg() +) + +func page(w http.ResponseWriter, req *http.Request) { + name := pageName.Get(req.Context()) + + fmt.Fprintf(w, "Welcome to %s", name) +} + +func main() { + // pageName.Shift pulls the next /-delimited string out of the request's + // URL.Path and puts it into the context instead. + pageHandler := pageName.Shift(http.HandlerFunc(page)) + + http.ListenAndServe(":8080", whmux.Dir{ + "wiki": pageHandler, + }) +} +``` + +### Pre-Go-1.7 support + +Contexts let you do some pretty cool things. But let’s say you’re stuck with something before Go 1.7 (for instance, App Engine is currently Go 1.6). + +That’s okay! I’ve backported all of the neat new context features to Go 1.6 and earlier in a forwards compatible way! + +With the [whcompat][46] package, `req.Context()` becomes `whcompat.Context(req)`, and `req.WithContext(ctx)` becomes `whcompat.WithContext(req, ctx)`. The `whcompat` versions work with all releases of Go. Yay! + +There’s a bit of unpleasantness behind the scenes to make this happen. Specifically, for pre-1.7 builds, a global map indexed by `req.URL` is kept, and a finalizer is installed on `req` to clean up. So don’t change what `req.URL` points to and this will work fine. In practice it’s not a problem. + +`whcompat` adds additional backwards-compatibility helpers. In Go 1.7 and on, the context’s `Done()` channel is closed (and `Err()` is set), whenever the request is done processing. If you want this behavior in Go 1.6 and earlier, just use the [whcompat.DoneNotify][47] middleware. + +In Go 1.8 and on, the context’s `Done()` channel is closed when the client goes away, even if the request hasn’t completed. If you want this behavior in Go 1.7 and earlier, just use the [whcompat.CloseNotify][48] middleware, though beware that it costs an extra goroutine. + +### Error handling + +How you handle errors can be another cross-cutting concern, but with good application of context and middleware, it too can be beautifully cleaned up so that the responsibilities lie in the correct place. + +Problem statement: your `RequireUser` middleware needs to handle an authentication error differently between your HTML endpoints and your JSON API endpoints. You want to use `RequireUser` for both types of endpoints, but with your HTML endpoints you want to return a user-friendly error page, and with your JSON API endpoints you want to return an appropriate JSON error state. + +In my opinion, the right thing to do is to have contextual error handlers, and luckily, we have a context for contextual information! + +First, we need an error handler interface. + +``` +type ErrHandler interface { + HandleError(w http.ResponseWriter, req *http.Request, err error) +} +``` + +Next, let’s make a middleware that registers the error handler in the context: + +``` +var errHandler = webhelp.GenSym() // see the aside about context keys + +func HandleErrWith(eh ErrHandler, h http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + ctx := context.WithValue(whcompat.Context(req), errHandler, eh) + h.ServeHTTP(w, whcompat.WithContext(req, ctx)) + }) +} +``` + +Last, let’s make a function that will use the registered error handler for errors: + +``` +func HandleErr(w http.ResponseWriter, req *http.Request, err error) { + if handler, ok := whcompat.Context(req).Value(errHandler).(ErrHandler); ok { + handler.HandleError(w, req, err) + return + } + log.Printf("error: %v", err) + http.Error(w, "internal server error", http.StatusInternalServerError) +} +``` + +Now, as long as everything uses `HandleErr` to handle errors, our JSON API can handle errors with JSON responses, and our HTML endpoints can handle errors with HTML responses. + +Of course, the [wherr][49] package implements this all for you, and the [whjson][49] package even implements a friendly JSON API error handler. + +Here’s how you might use it: + +``` +var userKey = webhelp.GenSym() + +func RequireUser(h http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + user, err := GetUser(req) + if err != nil { + wherr.Handle(w, req, wherr.InternalServerError.New("failed to get user")) + return + } + if user == nil { + wherr.Handle(w, req, wherr.Unauthorized.New("no user found")) + return + } + ctx := r.Context() + ctx = context.WithValue(ctx, userKey, user) + h.ServeHTTP(w, req.WithContext(ctx)) + }) +} + +func userpage(w http.ResponseWriter, req *http.Request) { + user := req.Context().Value(userKey).(*User) + w.Header().Set("Content-Type", "text/html") + userpageTmpl.Execute(w, user) +} + +func username(w http.ResponseWriter, req *http.Request) { + user := req.Context().Value(userKey).(*User) + w.Header().Set("Content-Type", "application/json") + json.NewEncoder(w).Encode(map[string]interface{}{"user": user}) +} + +func main() { + http.ListenAndServe(":8080", whmux.Dir{ + "api": wherr.HandleWith(whjson.ErrHandler, + RequireUser(whmux.Dir{ + "username": http.HandlerFunc(username), + })), + "user": RequireUser(http.HandlerFunc(userpage)), + }) +} +``` + +#### Aside about the spacemonkeygo/errors package + +The default [wherr.Handle][50] implementation understands all of the [error classes defined in the wherr top level package][51]. + +These error classes are implemented using the [spacemonkeygo/errors][52] library and the [spacemonkeygo/errors/errhttp][53] extensions. You don’t have to use this library or these errors, but the benefit is that your error instances can be extended to include HTTP status code messages and information, which once again, provides for a nice elimination of cross-cutting concerns in your error handling logic. + +See the [spacemonkeygo/errors][52] package for more details. + +_**Update 2018-04-19:** After a few years of use, my friend condensed some lessons we learned and the best parts of `spacemonkeygo/errors` into a new, more concise, better library, over at [github.com/zeebo/errs][54]. Consider using that instead!_ + +### Sessions + +Go’s standard library has great support for cookies, but cookies by themselves aren’t usually what a developer thinks of when she thinks about sessions. Cookies are unencrypted, unauthenticated, and readable by the user, and perhaps you don’t want that with your session data. + +Further, sessions can be stored in cookies, but could also be stored in a database to provide features like session revocation and querying. There’s lots of potential details about the implementation of sessions. + +Request handlers, however, probably don’t care too much about the implementation details of the session. Request handlers usually just want a bucket of keys and values they can store safely and securely. + +The [whsess][55] package implements middleware for registering an arbitrary session store (a default cookie-based session store is provided), and implements helpers for retrieving and saving new values into the session. + +The default cookie-based session store implements encryption and authentication via the excellent [nacl/secretbox][56] package. + +Usage is like this: + +``` +func handler(w http.ResponseWriter, req *http.Request) { + ctx := whcompat.Context(req) + sess, err := whsess.Load(ctx, "namespace") + if err != nil { + wherr.Handle(w, req, err) + return + } + if loggedIn, _ := sess.Values["logged_in"].(bool); loggedIn { + views, _ := sess.Values["views"].(int64) + sess.Values["views"] = views + 1 + sess.Save(w) + } +} + +func main() { + http.ListenAndServe(":8080", whsess.HandlerWithStore( + whsess.NewCookieStore(secret), http.HandlerFunc(handler))) +} +``` + +### Logging + +The Go standard library by default doesn’t log incoming requests, outgoing responses, or even just what port the HTTP server is listening on. + +The [whlog][57] package implements all three. The [whlog.LogRequests][58] middleware will log requests as they start. The [whlog.LogResponses][59] middleware will log requests as they end, along with status code and timing information. [whlog.ListenAndServe][60] will log the address the server ultimately listens on (if you specify “:0” as your address, a port will be randomly chosen, and [whlog.ListenAndServe][60] will log it). + +[whlog.LogResponses][59] deserves special mention for how it does what it does. It uses the [whmon][61] package to instrument the outgoing `http.ResponseWriter` to keep track of response information. + +Usage is like this: + +``` +func main() { + whlog.ListenAndServe(":8080", whlog.LogResponses(whlog.Default, handler)) +} +``` + +#### App engine logging + +App engine logging is unconventional crazytown. The standard library logger doesn’t work by default on App Engine, because App Engine logs _require_ the request context. This is unfortunate for libraries that don’t necessarily run on App Engine all the time, as their logging information doesn’t make it to the App Engine request-specific logger. + +Unbelievably, this is fixable with [whgls][62], which uses my terrible, terrible (but recently improved) [Goroutine-local storage library][63] to store the request context on the current stack, register a new log output, and fix logging so standard library logging works with App Engine again. + +### Template handling + +Go’s standard library [html/template][64] package is excellent, but you’ll be unsurprised to find there’s a few tasks I do with it so commonly that I’ve written additional support code. + +The [whtmpl][65] package really does two things. First, it provides a number of useful helper methods for use within templates, and second, it takes some friction out of managing a large number of templates. + +When writing templates, one thing you can do is call out to other registered templates for small values. A good example might be some sort of list element. You can have a template that renders the list element, and then your template that renders your list can use the list element template in turn. + +Use of another template within a template might look like this: + +``` +
    + {{ range .List }} + {{ template "list_element" . }} + {{ end }} +
+``` + +You’re now rendering the `list_element` template with the list element from `.List`. But what if you want to also pass the current user `.User`? Unfortunately, you can only pass one argument from one template to another. If you have two arguments you want to pass to another template, with the standard library, you’re out of luck. + +The [whtmpl][65] package adds three helper functions to aid you here, `makepair`, `makemap`, and `makeslice` (more docs under the [whtmpl.Collection][66] type). `makepair` is the simplest. It takes two arguments and constructs a [whtmpl.Pair][67]. Fixing our example above would look like this now: + +``` +
    + {{ $user := .User }} + {{ range .List }} + {{ template "list_element" (makepair . $user) }} + {{ end }} +
+``` + +The second thing [whtmpl][65] does is make defining lots of templates easy, by optionally automatically naming templates after the name of the file the template is defined in. + +For example, say you have three files. + +Here’s `pkg.go`: + +``` +package views + +import "gopkg.in/webhelp.v1/whtmpl" + +var Templates = whtmpl.NewCollection() +``` + +Here’s `landing.go`: + +``` +package views + +var _ = Templates.MustParse(`{{ template "header" . }} + +

Landing!

`) +``` + +And here’s `header.go`: + +``` +package views + +var _ = Templates.MustParse(`My website!`) +``` + +Now, you can import your new `views` package and render the `landing` template this easily: + +``` +func handler(w http.ResponseWriter, req *http.Request) { + views.Templates.Render(w, req, "landing", map[string]interface{}{}) +} +``` + +### User authentication + +I’ve written two Webhelp-style authentication libraries that I end up using frequently. + +The first is an OAuth2 library, [whoauth2][68]. I’ve written up [an example application that authenticates with Google, Facebook, and Github][69]. + +The second, [whgoth][70], is a wrapper around [markbates/goth][71]. My portion isn’t quite complete yet (some fixes are still necessary for optional App Engine support), but will support more non-OAuth2 authentication sources (like Twitter) when it is done. + +### Route listing + +Surprise! If you’ve used [webhelp][27] based handlers and middleware for your whole app, you automatically get route listing for free, via the [whroute][72] package. + +My web serving code’s `main` method often has a form like this: + +``` +switch flag.Arg(0) { +case "serve": + panic(whlog.ListenAndServe(*listenAddr, routes)) +case "routes": + whroute.PrintRoutes(os.Stdout, routes) +default: + fmt.Printf("Usage: %s \n", os.Args[0]) +} +``` + +Here’s some example output: + +``` +GET /auth/_cb/ +GET /auth/login/ +GET /auth/logout/ +GET / +GET /account/apikeys/ +POST /account/apikeys/ +GET /project// +GET /project//control// +POST /project//control//sample/ +GET /project//control/ + Redirect: f(req) +POST /project//control/ +POST /project//control_named//sample/ +GET /project//control_named/ + Redirect: f(req) +GET /project//sample// +GET /project//sample//similar[/<*>] +GET /project//sample/ + Redirect: f(req) +POST /project//search/ +GET /project/ + Redirect: / +POST /project/ +``` + +### Other little things + +[webhelp][27] has a number of other subpackages: + + * [whparse][73] assists in parsing optional request arguments. + * [whredir][74] provides some handlers and helper methods for doing redirects in various cases. + * [whcache][75] creates request-specific mutable storage for caching various computations and database loaded data. Mutability helps helper functions that aren’t used as middleware share data. + * [whfatal][76] uses panics to simplify early request handling termination. Probably avoid this package unless you want to anger other Go developers. + + + +### Summary + +Designing your web project as a collection of composable middlewares goes quite a long way to simplify your code design, eliminate cross-cutting concerns, and create a more flexible development environment. Use my [webhelp][27] package if it helps you. + +Or don’t! Whatever! It’s still a free country last I checked. + +#### Update + +Peter Kieltyka points me to his [Chi framework][77], which actually does seem to do the right things with respect to middleware, handlers, and contexts - certainly much more so than all the other frameworks I’ve seen. So, shoutout to Peter and the team at Pressly! + +-------------------------------------------------------------------------------- + +via: https://www.jtolio.com/2017/01/writing-advanced-web-applications-with-go + +作者:[jtolio.com][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.jtolio.com/ +[b]: https://github.com/lujun9972 +[1]: https://www.ruby-lang.org/ +[2]: http://rubyonrails.org/ +[3]: http://www.sinatrarb.com/ +[4]: https://www.python.org/ +[5]: https://www.djangoproject.com/ +[6]: http://flask.pocoo.org/ +[7]: https://golang.org/ +[8]: https://groups.google.com/d/forum/golang-nuts +[9]: https://www.reddit.com/r/golang/ +[10]: https://revel.github.io/ +[11]: https://gin-gonic.github.io/gin/ +[12]: http://iris-go.com/ +[13]: https://beego.me/ +[14]: https://go-macaron.com/ +[15]: https://github.com/go-martini/martini +[16]: https://github.com/gocraft/web +[17]: https://github.com/urfave/negroni +[18]: https://godoc.org/goji.io +[19]: https://echo.labstack.com/ +[20]: https://medium.com/code-zen/why-i-don-t-use-go-web-frameworks-1087e1facfa4 +[21]: https://groups.google.com/forum/#!topic/golang-nuts/R_lqsTTBh6I +[22]: https://www.reddit.com/r/golang/comments/1yh6gm/new_to_go_trying_to_select_web_framework/ +[23]: https://golang.org/pkg/net/http/#Handler +[24]: https://golang.org/pkg/net/http/#Request +[25]: https://golang.org/pkg/net/http/#Request.Context +[26]: https://golang.org/pkg/net/http/#Request.WithContext +[27]: https://godoc.org/gopkg.in/webhelp.v1 +[28]: https://golang.org/doc/articles/wiki/ +[29]: https://expressjs.com/ +[30]: https://nodejs.org/en/ +[31]: https://en.wikipedia.org/wiki/Cross-cutting_concern +[32]: https://github.com/gorilla/mux +[33]: https://github.com/gorilla/ +[34]: https://golang.org/pkg/net/http/#ServeMux +[35]: https://swtch.com/~rsc/ +[36]: https://github.com/rsc/tiddly +[37]: https://github.com/rsc/tiddly/blob/8f9145ac183e374eb95d90a73be4d5f38534ec47/tiddly.go#L201 +[38]: https://godoc.org/gopkg.in/webhelp.v1/whmux#Dir +[39]: https://godoc.org/gopkg.in/webhelp.v1/whmux +[40]: https://godoc.org/gopkg.in/webhelp.v1/whmux#IntArg +[41]: https://godoc.org/gopkg.in/webhelp.v1/whmux#StringArg +[42]: https://golang.org/pkg/context/ +[43]: https://blog.golang.org/context +[44]: https://godoc.org/golang.org/x/net/context +[45]: https://godoc.org/gopkg.in/webhelp.v1#GenSym +[46]: https://godoc.org/gopkg.in/webhelp.v1/whcompat +[47]: https://godoc.org/gopkg.in/webhelp.v1/whcompat#DoneNotify +[48]: https://godoc.org/gopkg.in/webhelp.v1/whcompat#CloseNotify +[49]: https://godoc.org/gopkg.in/webhelp.v1/wherr +[50]: https://godoc.org/gopkg.in/webhelp.v1/wherr#Handle +[51]: https://godoc.org/gopkg.in/webhelp.v1/wherr#pkg-variables +[52]: https://godoc.org/github.com/spacemonkeygo/errors +[53]: https://godoc.org/github.com/spacemonkeygo/errors/errhttp +[54]: https://github.com/zeebo/errs +[55]: https://godoc.org/gopkg.in/webhelp.v1/whsess +[56]: https://godoc.org/golang.org/x/crypto/nacl/secretbox +[57]: https://godoc.org/gopkg.in/webhelp.v1/whlog +[58]: https://godoc.org/gopkg.in/webhelp.v1/whlog#LogRequests +[59]: https://godoc.org/gopkg.in/webhelp.v1/whlog#LogResponses +[60]: https://godoc.org/gopkg.in/webhelp.v1/whlog#ListenAndServe +[61]: https://godoc.org/gopkg.in/webhelp.v1/whmon +[62]: https://godoc.org/gopkg.in/webhelp.v1/whgls +[63]: https://godoc.org/github.com/jtolds/gls +[64]: https://golang.org/pkg/html/template/ +[65]: https://godoc.org/gopkg.in/webhelp.v1/whtmpl +[66]: https://godoc.org/gopkg.in/webhelp.v1/whtmpl#Collection +[67]: https://godoc.org/gopkg.in/webhelp.v1/whtmpl#Pair +[68]: https://godoc.org/gopkg.in/go-webhelp/whoauth2.v1 +[69]: https://github.com/go-webhelp/whoauth2/blob/v1/examples/group/main.go +[70]: https://godoc.org/gopkg.in/go-webhelp/whgoth.v1 +[71]: https://github.com/markbates/goth +[72]: https://godoc.org/gopkg.in/webhelp.v1/whroute +[73]: https://godoc.org/gopkg.in/webhelp.v1/whparse +[74]: https://godoc.org/gopkg.in/webhelp.v1/whredir +[75]: https://godoc.org/gopkg.in/webhelp.v1/whcache +[76]: https://godoc.org/gopkg.in/webhelp.v1/whfatal +[77]: https://github.com/pressly/chi From cf932f8491c9912993e8f0cb7fca8f71264c1beb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:39:40 +0800 Subject: [PATCH 0824/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020160302=20Go?= =?UTF-8?q?=20channels=20are=20bad=20and=20you=20should=20feel=20bad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20160302 Go channels are bad and you should feel bad.md --- ...hannels are bad and you should feel bad.md | 443 ++++++++++++++++++ 1 file changed, 443 insertions(+) create mode 100644 sources/tech/20160302 Go channels are bad and you should feel bad.md diff --git a/sources/tech/20160302 Go channels are bad and you should feel bad.md b/sources/tech/20160302 Go channels are bad and you should feel bad.md new file mode 100644 index 0000000000..0ad2a5ed97 --- /dev/null +++ b/sources/tech/20160302 Go channels are bad and you should feel bad.md @@ -0,0 +1,443 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Go channels are bad and you should feel bad) +[#]: via: (https://www.jtolio.com/2016/03/go-channels-are-bad-and-you-should-feel-bad) +[#]: author: (jtolio.com https://www.jtolio.com/) + +Go channels are bad and you should feel bad +====== + +_Update: If you’re coming to this blog post from a compendium titled “Go is not good,” I want to make it clear that I am ashamed to be on such a list. Go is absolutely the least worst programming language I’ve ever used. At the time I wrote this, I wanted to curb a trend I was seeing, namely, overuse of one of the more warty parts of Go. I still think channels could be much better, but overall, Go is wonderful. It’s like if your favorite toolbox had [this][1] in it; the tool can have uses (even if it could have had more uses), and it can still be your favorite toolbox!_ + +_Update 2: I would be remiss if I didn’t point out this excellent survey of real issues: [Understanding Real-World Concurrency Bugs In Go][2]. A significant finding of this survey is that… Go channels cause lots of bugs._ + +I’ve been using Google’s [Go programming language][3] on and off since mid-to-late 2010, and I’ve had legitimate product code written in Go for [Space Monkey][4] since January 2012 (before Go 1.0!). My initial experience with Go was back when I was researching Hoare’s [Communicating Sequential Processes][5] model of concurrency and the [π-calculus][6] under [Matt Might][7]’s [UCombinator research group][8] as part of my ([now redirected][9]) PhD work to better enable multicore development. Go was announced right then (how serendipitous!) and I immediately started kicking tires. + +It quickly became a core part of Space Monkey development. Our production systems at Space Monkey currently account for over 425k lines of pure Go (_not_ counting all of our vendored libraries, which would make it just shy of 1.5 million lines), so not the most Go you’ll ever see, but for the relatively young language we’re heavy users. We’ve [written about our Go usage][10] before. We’ve open-sourced some fairly heavily used libraries; many people seem to be fans of our [OpenSSL bindings][11] (which are faster than [crypto/tls][12], but please keep openssl itself up-to-date!), our [error handling library][13], [logging library][14], and [metric collection library/zipkin client][15]. We use Go, we love Go, we think it’s the least bad programming language for our needs we’ve used so far. + +Although I don’t think I can talk myself out of mentioning my widely avoided [goroutine-local-storage library][16] here either (which even though it’s a hack that you shouldn’t use, it’s a beautiful hack), hopefully my other experience will suffice as valid credentials that I kind of know what I’m talking about before I explain my deliberately inflamatory post title. + +![][17] + +### Wait, what? + +If you ask the proverbial programmer on the street what’s so special about Go, she’ll most likely tell you that Go is most known for channels and goroutines. Go’s theoretical underpinnings are heavily based in Hoare’s CSP model, which is itself incredibly fascinating and interesting and I firmly believe has much more to yield than we’ve appropriated so far. + +CSP (and the π-calculus) both use communication as the core synchronization primitive, so it makes sense Go would have channels. Rob Pike has been fascinated with CSP (with good reason) for a [considerable][18] [while][19] [now][20]. + +But from a pragmatic perspective (which Go prides itself on), Go got channels wrong. Channels as implemented are pretty much a solid anti-pattern in my book at this point. Why? Dear reader, let me count the ways. + +#### You probably won’t end up using just channels. + +Hoare’s Communicating Sequential Processes is a computational model where essentially the only synchronization primitive is sending or receiving on a channel. As soon as you use a mutex, semaphore, or condition variable, bam, you’re no longer in pure CSP land. Go programmers often tout this model and philosophy through the chanting of the [cached thought][21] “[share memory by communicating][22].” + +So let’s try and write a small program using just CSP in Go! Let’s make a high score receiver. All we will do is keep track of the largest high score value we’ve seen. That’s it. + +First, we’ll make a `Game` struct. + +``` +type Game struct { + bestScore int + scores chan int +} +``` + +`bestScore` isn’t going to be protected by a mutex! That’s fine, because we’ll simply have one goroutine manage its state and receive new scores over a channel. + +``` +func (g *Game) run() { + for score := range g.scores { + if g.bestScore < score { + g.bestScore = score + } + } +} +``` + +Okay, now we’ll make a helpful constructor to start a game. + +``` +func NewGame() (g *Game) { + g = &Game{ + bestScore: 0, + scores: make(chan int), + } + go g.run() + return g +} +``` + +Next, let’s assume someone has given us a `Player` that can return scores. It might also return an error, cause hey maybe the incoming TCP stream can die or something, or the player quits. + +``` +type Player interface { + NextScore() (score int, err error) +} +``` + +To handle the player, we’ll assume all errors are fatal and pass received scores down the channel. + +``` +func (g *Game) HandlePlayer(p Player) error { + for { + score, err := p.NextScore() + if err != nil { + return err + } + g.scores <- score + } +} +``` + +Yay! Okay, we have a `Game` type that can keep track of the highest score a `Player` receives in a thread-safe way. + +You wrap up your development and you’re on your way to having customers. You make this game server public and you’re incredibly successful! Lots of games are being created with your game server. + +Soon, you discover people sometimes leave your game. Lots of games no longer have any players playing, but nothing stopped the game loop. You are getting overwhelmed by dead `(*Game).run` goroutines. + +**Challenge:** fix the goroutine leak above without mutexes or panics. For real, scroll up to the above code and come up with a plan for fixing this problem using just channels. + +I’ll wait. + +For what it’s worth, it totally can be done with channels only, but observe the simplicity of the following solution which doesn’t even have this problem: + +``` +type Game struct { + mtx sync.Mutex + bestScore int +} + +func NewGame() *Game { + return &Game{} +} + +func (g *Game) HandlePlayer(p Player) error { + for { + score, err := p.NextScore() + if err != nil { + return err + } + g.mtx.Lock() + if g.bestScore < score { + g.bestScore = score + } + g.mtx.Unlock() + } +} +``` + +Which one would you rather work on? Don’t be deceived into thinking that the channel solution somehow makes this more readable and understandable in more complex cases. Teardown is very hard. This sort of teardown is just a piece of cake with a mutex, but the hardest thing to work out with Go-specific channels only. Also, if anyone replies that channels sending channels is easier to reason about here it will cause me an immediate head-to-desk motion. + +Importantly, this particular case might actually be _easily_ solved _with channels_ with some runtime assistance Go doesn’t provide! Unfortunately, as it stands, there are simply a surprising amount of problems that are solved better with traditional synchronization primitives than with Go’s version of CSP. We’ll talk about what Go could have done to make this case easier later. + +**Exercise:** Still skeptical? Try making both solutions above (channel-only vs. mutex-only) stop asking for scores from `Players` once `bestScore` is 100 or greater. Go ahead and open your text editor. This is a small, toy problem. + +The summary here is that you will be using traditional synchronization primitives in addition to channels if you want to do anything real. + +#### Channels are slower than implementing it yourself + +One of the things I assumed about Go being so heavily based in CSP theory is that there should be some pretty killer scheduler optimizations the runtime can make with channels. Perhaps channels aren’t always the most straightforward primitive, but surely they’re efficient and fast, right? + +![][23] + +As [Dustin Hiatt][24] points out on [Tyler Treat’s post about Go][25], + +> Behind the scenes, channels are using locks to serialize access and provide threadsafety. So by using channels to synchronize access to memory, you are, in fact, using locks; locks wrapped in a threadsafe queue. So how do Go’s fancy locks compare to just using mutex’s from their standard library `sync` package? The following numbers were obtained by using Go’s builtin benchmarking functionality to serially call Put on a single set of their respective types. + +``` +> BenchmarkSimpleSet-8 3000000 391 ns/op +> BenchmarkSimpleChannelSet-8 1000000 1699 ns/o +> +``` + +It’s a similar story with unbuffered channels, or even the same test under contention instead of run serially. + +Perhaps the Go scheduler will improve, but in the meantime, good old mutexes and condition variables are very good, efficient, and fast. If you want performance, you use the tried and true methods. + +#### Channels don’t compose well with other concurrency primitives + +Alright, so hopefully I have convinced you that you’ll at least be interacting with primitives besides channels sometimes. The standard library certainly seems to prefer traditional synchronization primitives over channels. + +Well guess what, it’s actually somewhat challenging to use channels alongside mutexes and condition variables correctly! + +One of the interesting things about channels that makes a lot of sense coming from CSP is that channel sends are synchronous. A channel send and channel receive are intended to be synchronization barriers, and the send and receive should happen at the same virtual time. That’s wonderful if you’re in well-executed CSP-land. + +![][26] + +Pragmatically, Go channels also come in a buffered variety. You can allocate a fixed amount of space to account for possible buffering so that sends and receives are disparate events, but the buffer size is capped. Go doesn’t provide a way to have arbitrarily sized buffers - you have to allocate the buffer size in advance. _This is fine_, I’ve seen people argue on the mailing list, _because memory is bounded anyway._ + +Wat. + +This is a bad answer. There’s all sorts of reasons to use an arbitrarily buffered channel. If we knew everything up front, why even have `malloc`? + +Not having arbitrarily buffered channels means that a naive send on _any_ channel could block at any time. You want to send on a channel and update some other bookkeeping under a mutex? Careful! Your channel send might block! + +``` +// ... +s.mtx.Lock() +// ... +s.ch <- val // might block! +s.mtx.Unlock() +// ... +``` + +This is a recipe for dining philosopher dinner fights. If you take a lock, you should quickly update state and release it and not do anything blocking under the lock if possible. + +There is a way to do a non-blocking send on a channel in Go, but it’s not the default behavior. Assume we have a channel `ch := make(chan int)` and we want to send the value `1` on it without blocking. Here is the minimum amount of typing you have to do to send without blocking: + +``` +select { +case ch <- 1: // it sent +default: // it didn't +} +``` + +This isn’t what naturally leaps to mind for beginning Go programmers. + +The summary is that because many operations on channels block, it takes careful reasoning about philosophers and their dining to successfully use channel operations alongside and under mutex protection, without causing deadlocks. + +#### Callbacks are strictly more powerful and don’t require unnecessary goroutines. + +![][27] + +Whenever an API uses a channel, or whenever I point out that a channel makes something hard, someone invariably points out that I should just spin up a goroutine to read off the channel and make whatever translation or fix I need as it reads of the channel. + +Um, no. What if my code is in a hotpath? There’s very few instances that require a channel, and if your API could have been designed with mutexes, semaphores, and callbacks and no additional goroutines (because all event edges are triggered by API events), then using a channel forces me to add another stack of memory allocation to my resource usage. Goroutines are much lighter weight than threads, yes, but lighter weight doesn’t mean the lightest weight possible. + +As I’ve formerly [argued in the comments on an article about using channels][28] (lol the internet), your API can _always_ be more general, _always_ more flexible, and take drastically less resources if you use callbacks instead of channels. “Always” is a scary word, but I mean it here. There’s proof-level stuff going on. + +If someone provides a callback-based API to you and you need a channel, you can provide a callback that sends on a channel with little overhead and full flexibility. + +If, on the other hand, someone provides a channel-based API to you and you need a callback, you have to spin up a goroutine to read off the channel _and_ you have to hope that no one tries to send more on the channel when you’re done reading so you cause blocked goroutine leaks. + +For a super simple real-world example, check out the [context interface][29] (which incidentally is an incredibly useful package and what you should be using instead of [goroutine-local storage][16]): + +``` +type Context interface { + ... + // Done returns a channel that closes when this work unit should be canceled. + Done() <-chan struct{} + + // Err returns a non-nil error when the Done channel is closed + Err() error + ... +} +``` + +Imagine all you want to do is log the corresponding error when the `Done()` channel fires. What do you have to do? If you don’t have a good place you’re already selecting on a channel, you have to spin up a goroutine to deal with it: + +``` +go func() { + <-ctx.Done() + logger.Errorf("canceled: %v", ctx.Err()) +}() +``` + +What if `ctx` gets garbage collected without closing the channel `Done()` returned? Whoops! Just leaked a goroutine! + +Now imagine we changed `Done`’s signature: + +``` +// Done calls cb when this work unit should be canceled. +Done(cb func()) +``` + +First off, logging is so easy now. Check it out: `ctx.Done(func() { log.Errorf("canceled: %v", ctx.Err()) })`. But lets say you really do need some select behavior. You can just call it like this: + +``` +ch := make(chan struct{}) +ctx.Done(func() { close(ch) }) +``` + +Voila! No expressiveness lost by using a callback instead. `ch` works like the channel `Done()` used to return, and in the logging case we didn’t need to spin up a whole new stack. I got to keep my stack traces (if our log package is inclined to use them); I got to avoid another stack allocation and another goroutine to give to the scheduler. + +Next time you use a channel, ask yourself if there’s some goroutines you could eliminate if you used mutexes and condition variables instead. If the answer is yes, your code will be more efficient if you change it. And if you’re trying to use channels just to be able to use the `range` keyword over a collection, I’m going to have to ask you to put your keyboard away or just go back to writing Python books. + +![more like Zooey De-channel, amirite][30] + +#### The channel API is inconsistent and just cray-cray + +Closing or sending on a closed channel panics! Why? If you want to close a channel, you need to either synchronize its closed state externally (with mutexes and so forth that don’t compose well!) so that other writers don’t write to or close a closed channel, or just charge forward and close or write to closed channels and expect you’ll have to recover any raised panics. + +This is such bizarre behavior. Almost every other operation in Go has a way to avoid a panic (type assertions have the `, ok =` pattern, for example), but with channels you just get to deal with it. + +Okay, so when a send will fail, channels panic. I guess that makes some kind of sense. But unlike almost everything else with nil values, sending to a nil channel won’t panic. Instead, it will block forever! That’s pretty counter-intuitive. That might be useful behavior, just like having a can-opener attached to your weed-whacker might be useful (and found in Skymall), but it’s certainly unexpected. Unlike interacting with nil maps (which do implicit pointer dereferences), nil interfaces (implicit pointer dereferences), unchecked type assertions, and all sorts of other things, nil channels exhibit actual channel behavior, as if a brand new channel was just instantiated for this operation. + +Receives are slightly nicer. What happens when you receive on a closed channel? Well, that works - you get a zero value. Okay that makes sense I guess. Bonus! Receives allow you to do a `, ok =`-style check if the channel was open when you received your value. Thank heavens we get `, ok =` here. + +But what happens if you receive from a nil channel? _Also blocks forever!_ Yay! Don’t try and use the fact that your channel is nil to keep track of if you closed it! + +### What are channels good for? + +Of course channels are good for some things (they are a generic container after all), and there are certain things you can only do with them (`select`). + +#### They are another special-cased generic datastructure + +Go programmers are so used to arguments about generics that I can feel the PTSD coming on just by bringing up the word. I’m not here to talk about it so wipe the sweat off your brow and let’s keep moving. + +Whatever your opinion of generics is, Go’s maps, slices, and channels are data structures that support generic element types, because they’ve been special-cased into the language. + +In a language that doesn’t allow you to write your own generic containers, _anything_ that allows you to better manage collections of things is valuable. Here, channels are a thread-safe datastructure that supports arbitrary value types. + +So that’s useful! That can save some boilerplate I suppose. + +I’m having trouble counting this as a win for channels. + +#### Select + +The main thing you can do with channels is the `select` statement. Here you can wait on a fixed number of inputs for events. It’s kind of like epoll, but you have to know upfront how many sockets you’re going to be waiting on. + +This is truly a useful language feature. Channels would be a complete wash if not for `select`. But holy smokes, let me tell you about the first time you decide you might need to select on multiple things but you don’t know how many and you have to use `reflect.Select`. + +### How could channels be better? + +It’s really tough to say what the most tactical thing the Go language team could do for Go 2.0 is (the Go 1.0 compatibility guarantee is good but hand-tying), but that won’t stop me from making some suggestions. + +#### Select on condition variables! + +We could just obviate the need for channels! This is where I propose we get rid of some sacred cows, but let me ask you this, how great would it be if you could select on any custom synchronization primitive? (A: So great.) If we had that, we wouldn’t need channels at all. + +#### GC could help us? + +In the very first example, we could easily solve the high score server cleanup with channels if we were able to use directionally-typed channel garbage collection to help us clean up. + +![][31] + +As you know, Go has directionally-typed channels. You can have a channel type that only supports reading (`<-chan`) and a channel type that only supports writing (`chan<-`). Great! + +Go also has garbage collection. It’s clear that certain kinds of book keeping are just too onerous and we shouldn’t make the programmer deal with them. We clean up unused memory! Garbage collection is useful and neat. + +So why not help clean up unused or deadlocked channel reads? Instead of having `make(chan Whatever)` return one bidirectional channel, have it return two single-direction channels (`chanReader, chanWriter := make(chan Type)`). + +Let’s reconsider the original example: + +``` +type Game struct { + bestScore int + scores chan<- int +} + +func run(bestScore *int, scores <-chan int) { + // we don't keep a reference to a *Game directly because then we'd be holding + // onto the send side of the channel. + for score := range scores { + if *bestScore < score { + *bestScore = score + } + } +} + +func NewGame() (g *Game) { + // this make(chan) return style is a proposal! + scoreReader, scoreWriter := make(chan int) + g = &Game{ + bestScore: 0, + scores: scoreWriter, + } + go run(&g.bestScore, scoreReader) + return g +} + +func (g *Game) HandlePlayer(p Player) error { + for { + score, err := p.NextScore() + if err != nil { + return err + } + g.scores <- score + } +} +``` + +If garbage collection closed a channel when we could prove no more values are ever coming down it, this solution is completely fixed. Yes yes, the comment in `run` is indicative of the existence of a rather large gun aimed at your foot, but at least the problem is easily solveable now, whereas it really wasn’t before. Furthermore, a smart compiler could probably make appropriate proofs to reduce the damage from said foot-gun. + +#### Other smaller issues + + * **Dup channels?** \- If we could use an equivalent of the `dup` syscall on channels, then we could also solve the multiple producer problem quite easily. Each producer could close their own `dup`-ed channel without ruining the other producers. + * **Fix the channel API!** \- Close isn’t idempotent? Send on closed channel panics with no way to avoid it? Ugh! + * **Arbitrarily buffered channels** \- If we could make buffered channels with no fixed buffer size limit, then we could make channels that don’t block. + + + +### What do we tell people about Go then? + +If you haven’t yet, please go take a look at my current favorite programming post: [What Color is Your Function][32]. Without being about Go specifically, this blog post much more eloquently than I could lays out exactly why goroutines are Go’s best feature (and incidentally one of the ways Go is better than Rust for some applications). + +If you’re still writing code in a programming language that forces keywords like `yield` on you to get high performance, concurrency, or an event-driven model, you are living in the past, whether or not you or anyone else knows it. Go is so far one of the best entrants I’ve seen of languages that implement an M:N threading model that’s not 1:1, and dang that’s powerful. + +So, tell folks about goroutines. + +If I had to pick one other leading feature of Go, it’s interfaces. Statically-typed [duck typing][33] makes extending and working with your own or someone else’s project so fun and amazing it’s probably worth me writing an entirely different set of words about it some other time. + +### So… + +I keep seeing people charge in to Go, eager to use channels to their full potential. Here’s my advice to you. + +**JUST STAHP IT** + +When you’re writing APIs and interfaces, as bad as the advice “never” can be, I’m pretty sure there’s never a time where channels are better, and every Go API I’ve used that used channels I’ve ended up having to fight. I’ve never thought “oh good, there’s a channel here;” it’s always instead been some variant of _**WHAT FRESH HELL IS THIS?**_ + +So, _please, please use channels where appropriate and only where appropriate._ + +In all of my Go code I work with, I can count on one hand the number of times channels were really the best choice. Sometimes they are. That’s great! Use them then. But otherwise just stop. + +![][34] + +_Special thanks for the valuable feedback provided by my proof readers Jeff Wendling, [Andrew Harding][35], [George Shank][36], and [Tyler Treat][37]._ + +If you want to work on Go with us at Space Monkey, please [hit me up][38]! + +-------------------------------------------------------------------------------- + +via: https://www.jtolio.com/2016/03/go-channels-are-bad-and-you-should-feel-bad + +作者:[jtolio.com][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.jtolio.com/ +[b]: https://github.com/lujun9972 +[1]: https://blog.codinghorror.com/content/images/uploads/2012/06/6a0120a85dcdae970b017742d249d5970d-800wi.jpg +[2]: https://songlh.github.io/paper/go-study.pdf +[3]: https://golang.org/ +[4]: http://www.spacemonkey.com/ +[5]: https://en.wikipedia.org/wiki/Communicating_sequential_processes +[6]: https://en.wikipedia.org/wiki/%CE%A0-calculus +[7]: http://matt.might.net +[8]: http://www.ucombinator.org/ +[9]: https://www.jtolio.com/writing/2015/11/research-log-cell-states-and-microarrays/ +[10]: https://www.jtolio.com/writing/2014/04/go-space-monkey/ +[11]: https://godoc.org/github.com/spacemonkeygo/openssl +[12]: https://golang.org/pkg/crypto/tls/ +[13]: https://godoc.org/github.com/spacemonkeygo/errors +[14]: https://godoc.org/github.com/spacemonkeygo/spacelog +[15]: https://godoc.org/gopkg.in/spacemonkeygo/monitor.v1 +[16]: https://github.com/jtolds/gls +[17]: https://www.jtolio.com/images/wat/darth-helmet.jpg +[18]: https://en.wikipedia.org/wiki/Newsqueak +[19]: https://en.wikipedia.org/wiki/Alef_%28programming_language%29 +[20]: https://en.wikipedia.org/wiki/Limbo_%28programming_language%29 +[21]: https://lesswrong.com/lw/k5/cached_thoughts/ +[22]: https://blog.golang.org/share-memory-by-communicating +[23]: https://www.jtolio.com/images/wat/jon-stewart.jpg +[24]: https://twitter.com/HiattDustin +[25]: http://bravenewgeek.com/go-is-unapologetically-flawed-heres-why-we-use-it/ +[26]: https://www.jtolio.com/images/wat/obama.jpg +[27]: https://www.jtolio.com/images/wat/yael-grobglas.jpg +[28]: http://www.informit.com/articles/article.aspx?p=2359758#comment-2061767464 +[29]: https://godoc.org/golang.org/x/net/context +[30]: https://www.jtolio.com/images/wat/zooey-deschanel.jpg +[31]: https://www.jtolio.com/images/wat/joel-mchale.jpg +[32]: http://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/ +[33]: https://en.wikipedia.org/wiki/Duck_typing +[34]: https://www.jtolio.com/images/wat/michael-cera.jpg +[35]: https://github.com/azdagron +[36]: https://twitter.com/taterbase +[37]: http://bravenewgeek.com +[38]: https://www.jtolio.com/contact/ From 39ba921cc8748fe8018338e0b1faf3e03636a4c8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:39:55 +0800 Subject: [PATCH 0825/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020151127=20Rese?= =?UTF-8?q?arch=20log:=20gene=20signatures=20and=20connectivity=20map?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20151127 Research log- gene signatures and connectivity map.md --- ...g- gene signatures and connectivity map.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20151127 Research log- gene signatures and connectivity map.md diff --git a/sources/tech/20151127 Research log- gene signatures and connectivity map.md b/sources/tech/20151127 Research log- gene signatures and connectivity map.md new file mode 100644 index 0000000000..f4e7faa4bc --- /dev/null +++ b/sources/tech/20151127 Research log- gene signatures and connectivity map.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Research log: gene signatures and connectivity map) +[#]: via: (https://www.jtolio.com/2015/11/research-log-gene-signatures-and-connectivity-map) +[#]: author: (jtolio.com https://www.jtolio.com/) + +Research log: gene signatures and connectivity map +====== + +Happy Thanksgiving everyone! + +### Context + +This is the third post in my continuing series on my attempts at research. Previously we talked about: + + * [what I’m doing, cell states, and microarrays][1] + * and then [more about microarrays and R][2]. + + + +By the end of last week we had discussed how to get a table of normalized gene expression intensities that looks like this: + +``` +ENSG00000280099_at 0.15484421 +ENSG00000280109_at 0.16881395 +ENSG00000280178_at -0.19621641 +ENSG00000280316_at 0.08622216 +ENSG00000280401_at 0.15966256 +ENSG00000281205_at -0.02085352 +... +``` + +The reason for doing this is to figure out which genes are related, and perhaps more importantly, what a cell is even doing. + +_Summary:_ new post, also, I’m bringing back the short section summaries. + +### Cell lines + +The first thing to do when trying to figure out what cells are doing is to choose a cell. There’s all sorts of cells. Healthy brain cells, cancerous blood cells, bruised skin cells, etc. + +For any experiment, you’ll need a control to eliminate noise and apply statistical tests for validity. If you don’t use a control, the effect you’re seeing may not even exist, and so for any experiment with cells, you will need a control cell. + +Cells often divide, which means that a cell, once chosen, will duplicate itself for you in the presence of the appropriate resources. Not all cells divide ad nauseam which provides some challenges, but many cells under study luckily do. + +So, a _cell line_ is simply a set of cells that have all replicated from a specific chosen initial cell. Any set of cells from a cell line will be as identical as possible (unless you screwed up! geez). They will be the same type of cell with the same traits and behaviors, at least, as much as possible. + +_Summary:_ a cell line is a large amount of cells that are as close to being the same as possible. + +### Perturbagens + +There are many things that might affect what a cell is doing. Drugs, agitation, temperature, disease, cancer, gene splicing, small molecules (maybe you give a cell more iron or calcium or something), hormones, light, Jello, ennui, etc. Given any particular cell line, giving a cell from that cell line one of these _perturbagens_, or, perturbing the cell in a specific way, when compared to a control will say what that cell does differently in the face of that perturbagen. + +If you’d like to find out what exactly a certain type of cell does when you give it lemon lime soda, then you choose the right cell line, leave out some control cells and give the rest of the cells soda. + +Then, you measure gene expression intensities for both the control cells and the perturbed cells. The _differential expression_ of genes between the perturbed cells and the controls cells is likely due to the introduction of the lemon lime soda. + +Genes that end up getting expressed _more_ in the presence of the soda are considered _up-regulated_, whereas genes that end up getting expressed _less_ are considered _down-regulated_. The degree to which a gene is up or down regulated constitutes how much of an effect the soda may have had on that gene. + +Of course, all of this has such a significant amount of experimental noise that you could find pretty much anything. You’ll need to replicate your experiment independently a few times before you publish that lemon lime soda causes increased expression in the [Sonic hedgehog gene][3]. + +_Summary:_ A perturbagen is something you introduce/do to a cell to change its behavior, such as drugs or throwing it at a wall or something. The wall perturbagen. + +### Gene signature + +For a given change or perturbagen to a cell, we now have enough to compute lists of up-regulated and down-regulated genes and the magnitude change in expression for each gene. + +This gene expression pattern for some subset of important genes (perhaps the most changed in expression) is called a _gene signature_, and gene signatures are very useful. By comparing signatures, you can: + + * identify or compare cell states + * find sets of positively or negatively correlated genes + * find similar disease signatures + * find similar drug signatures + * find drug signatures that might counteract opposite disease signatures. + + + +(That last bullet point is essentially where I’m headed with my research.) + +_Summary:_ a gene signature is a short summary of the most important gene expression differences a perturbagen causes in a cell. + +### Drugs! + +The pharmaceutical industry is constantly on the lookout for new breakthrough drugs that might represent huge windfalls in cash, and drugs don’t always work as planned. Many drugs spend years in research and development, only to ultimately find poor efficacy or adoption. Sometimes drugs even become known [much more for their side-effects than their originally intended therapy][4]. + +The practical upshot is that there’s countless FDA-approved drugs that represent decades of work that are simply underused or even unused entirely. These drugs have already cleared many challenging regulatory hurdles, but are simply and quite literally cures looking for a disease. + +If even just one of these drugs can be given a new lease on life for some yet-to-be-cured disease, then perhaps we can give some people new leases on life! + +_Summary:_ instead of developing new drugs, there’s already lots of drugs that aren’t being used. Maybe we can find matching diseases! + +### The Connectivity Map project + +The [Broad Institute’s Connectivity Map project][5] isn’t particularly new anymore, but it represents a ground breaking and promising idea - we can dump a bunch of signatures into a database and construct all sorts of new hypotheses we might not even have thought to check before. + +To prove out the usefulness of this idea, the Connectivity Map (or cmap) project chose 5 different cell lines (all cancer cells, which are easy to get to replicate!) and a library of FDA approved drugs, and then gave some cells these drugs. + +They then constructed a database of all of the signatures they computed for each possible perturbagen they measured. Finally, they constructed a web interface where a user can upload a gene signature and get a result list back of all of the signatures they collected, ordered by the most to least similar. You can totally go sign up and [try it out][5]. + +This simple tool is surprisingly powerful. It allows you to find similar drugs to a drug you know, but it also allows you to find drugs that might counteract a disease you’ve created a signature for. + +Ultimately, the project led to [a number of successful applications][6]. So useful was it that the Broad Institute has doubled down and created the much larger and more comprehensive [LINCS Project][7] that targets an order of magnitude more cell lines (77) and more perturbagens (42,532, compared to cmap’s 6100). You can sign up and use that one too! + +_Summary_: building a system that supports querying signature connections has already proved to be super useful. + +### Whew + +Alright, I wrote most of this on a plane yesterday but since I should now be spending time with family I’m going to cut it short here. + +Stay tuned for next week! + +-------------------------------------------------------------------------------- + +via: https://www.jtolio.com/2015/11/research-log-gene-signatures-and-connectivity-map + +作者:[jtolio.com][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.jtolio.com/ +[b]: https://github.com/lujun9972 +[1]: https://www.jtolio.com/writing/2015/11/research-log-cell-states-and-microarrays/ +[2]: https://www.jtolio.com/writing/2015/11/research-log-r-and-more-microarrays/ +[3]: https://en.wikipedia.org/wiki/Sonic_hedgehog +[4]: https://en.wikipedia.org/wiki/Sildenafil#History +[5]: https://www.broadinstitute.org/cmap/ +[6]: https://www.broadinstitute.org/cmap/publications.jsp +[7]: http://www.lincscloud.org/ From 6d25c49ab978db7131288c0cefb1d2f377540c09 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:44:52 +0800 Subject: [PATCH 0826/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200519=20How?= =?UTF-8?q?=20to=20use=20Windows=20Subsystem=20for=20Linux=20to=20open=20L?= =?UTF-8?q?inux=20on=20Windows=2010=20machines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200519 How to use Windows Subsystem for Linux to open Linux on Windows 10 machines.md --- ...ux to open Linux on Windows 10 machines.md | 153 ++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 sources/tech/20200519 How to use Windows Subsystem for Linux to open Linux on Windows 10 machines.md diff --git a/sources/tech/20200519 How to use Windows Subsystem for Linux to open Linux on Windows 10 machines.md b/sources/tech/20200519 How to use Windows Subsystem for Linux to open Linux on Windows 10 machines.md new file mode 100644 index 0000000000..e610f7eb2f --- /dev/null +++ b/sources/tech/20200519 How to use Windows Subsystem for Linux to open Linux on Windows 10 machines.md @@ -0,0 +1,153 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use Windows Subsystem for Linux to open Linux on Windows 10 machines) +[#]: via: (https://www.networkworld.com/article/3543845/how-to-use-windows-subsystem-for-linux-to-open-linux-on-windows-10-machines.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +How to use Windows Subsystem for Linux to open Linux on Windows 10 machines +====== +Opening a Linux terminal on a Windows 10 desktop can help you practice your Linux skills and explore Windows from an entirely different point of view. In this post, we look at Ubuntu 18.04 running through Windows Subsystem for Linux (WSL). +[Nicolas Solerieu modified by IDG Comm. / Linux][1] [(CC0)][2] + +Believe it or not, it's possible to open a Linux terminal on a Windows 10 system and you might be surprised how much Linux functionality you’ll be able to get by doing so. + +You can run Linux commands, traipse around the provided Linux file system and even take a novel look at Windows files. The experience isn’t altogether different than opening a terminal window on a Linux desktop, with a few interesting exceptions. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +What is needed to make this happen is something called the Windows Subsystem for Linux (WSL) and a Windows 10 x86 PC. + +### Linux versions for WSL + +There are a number of options for running Linux on top of Windows. The Linux OS choices include: + + * [Ubuntu 16.04 LTS][4] + * [Ubuntu 18.04 LTS][5] + * [openSUSE Leap 15.1][6] + * [SUSE Linux Enterprise Server 12 SP5][7] + * [SUSE Linux Enterprise Server 15 SP1][8] + * [Kali Linux][9] + * [Debian GNU/Linux][10] + * [Fedora Remix for WSL][11] + * [Pengwin][12] + * [Pengwin Enterprise][13] + * [Alpine WSL][14] + + + +Ubuntu 18.04 LTS is just one option and, in this post, we’ll take a look at how the terminal runs on Windows using this particular distribution and how much it feels like working on a Linux system directly. + +If you want to look into the process of putting an Ubuntu distribution on your Windows system, you can start with this page: + + + +As part of the initial setup of installing your Linux on Windows terminal, you’ll be asked to create your user account. Once you do that and open the terminal, you can start to explore. One of the most noticeable differences between your Linux-on-Windows terminal and a terminal window on a Linux system is that examining processes isn’t going to show you much. After all, Windows will be providing the bulk of the required OS support. You’re likely to see something like this: + +``` +myacct@hostname:~$ ps -ef +UID PID PPID C STIME TTY TIME CMD +root 1 0 0 12:45 ? 00:00:00 /init +root 7 1 0 12:45 tty1 00:00:00 /init +shs 8 7 0 12:45 tty1 00:00:00 -bash +shs 166 8 0 13:32 tty1 00:00:00 ps -ef +``` + +Yes, that's it. + +If you’re anything like me, one of your next moves might be to get a handle on the available commands. If you just count the files in the **/bin** and **/usr/bin** directories, you should see that there are a lot of commands: + +``` +myacct@hostname:~$ ls /bin | wc -l +171 +myacct@hostname:~$ ls /usr/bin | wc -l +707 +``` + +You can list available commands with commands like these (output truncated for this post): + +``` +myacct@hostname:~$ ls /bin | head -25 | column +bash btrfs-map-logical bunzip2 bzegrep bzip2recover +btrfs btrfs-select-super busybox bzexe bzless +btrfs-debug-tree btrfs-zero-log bzcat bzfgrep bzmore +btrfs-find-root btrfsck bzcmp bzgrep cat +btrfs-image btrfstune bzdiff bzip2 chacl + +myacct@hostname:~$ ls /usr/bin | head -25 | column +NF aa-exec apport-cli apt apt-extracttempl* +VGAuthService acpi_listen apport-collect apt-add-repository apt-ftparchive +X11 add-apt-repository apport-unpack apt-cache apt-get +[ addpart appres apt-cdrom apt-key +aa-enabled apport-bug apropos apt-config apt-mark +``` + +You can update the system with **apt** commands (sudo apt update, sudo apt upgrade). You can even use Linux commands to move to the Windows disk partitions as you like and . Notice the last three entries in the output below. These represent several drives on the system. + +``` +myacct@hostname:~$ df -k +Filesystem 1K-blocks Used Available Use% Mounted on +rootfs 973067784 326920584 646147200 34% / +none 973067784 326920584 646147200 34% /dev +none 973067784 326920584 646147200 34% /run +none 973067784 326920584 646147200 34% /run/lock +none 973067784 326920584 646147200 34% /run/shm +none 973067784 326920584 646147200 34% /run/user +cgroup 973067784 326920584 646147200 34% /sys/fs/cgroup +C:\ 973067784 326920584 646147200 34% /mnt/c <== C drive +I:\ 976760000 231268208 745491792 24% /mnt/I <== external drive +L:\ 409599996 159240 409440756 1% /mnt/l <== USB thumb drive +``` + +If you’re interested in moving out of the Linux space and into the Windows portion of the file system within your **WSL** session, you can do that easily. Replace “myname” with your Windows account name and a **cd /mnt/c/Users/_myname_/Desktop** will take you to your Windows desktop. From there, don’t be surprised if in listing your files you see **WRL####.tmp** files that don’t seem to exist when you look at your desktop and don’t show up if you look at your files by opening a command prompt. These appear to be temporary files used by Windows for document management. You might also see files listed that look like **‘~$nux notes.docx’** – perhaps ghosts of files that were once located on your desktop. You won’t see those files when you look at your desktop on Windows – even using a **cmd** window. + +Note that you’ll also see Windows directories such as **‘Program Files’** in single quotes when listed in your Linux terminal as you would any file with blanks included in their names. You can even start a Windows executable from your Linux terminal. For example: + +``` +myacct@hostname: $ cd /mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0 +myacct@hostname: $ powershell.exe +``` + +If you do this, type **exit** when you want to end the **powershell** session. + +Linux commands all seem to work as expected, though I don’t get any output when I run the **who** command. + +Windows **.txt** files will display with **cat** commands, but the last line in a file will likely be displayed on the same line as the following shell prompt. This is because these files won’t end with a linefeed as Linux text files do. + +You can create other accounts and switch user to them (e.g., **su – nemo**) if you like, but not log into them directly. + +You can also update the system with apt commands (**sudo apt update**, **sudo apt upgrade**). + +Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3543845/how-to-use-windows-subsystem-for-linux-to-open-linux-on-windows-10-machines.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://unsplash.com/photos/4gRNmhGzYZE +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.microsoft.com/store/apps/9pjn388hp8c9 +[5]: https://www.microsoft.com/store/apps/9N9TNGVNDL3Q +[6]: https://www.microsoft.com/store/apps/9NJFZK00FGKV +[7]: https://www.microsoft.com/store/apps/9MZ3D1TRP8T1 +[8]: https://www.microsoft.com/store/apps/9PN498VPMF3Z +[9]: https://www.microsoft.com/store/apps/9PKR34TNCV07 +[10]: https://www.microsoft.com/store/apps/9MSVKQC78PK6 +[11]: https://www.microsoft.com/store/apps/9n6gdm4k2hnc +[12]: https://www.microsoft.com/store/apps/9NV1GV1PXZ6P +[13]: https://www.microsoft.com/store/apps/9N8LP0X93VCP +[14]: https://www.microsoft.com/store/apps/9p804crf0395 +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world From 70325ef88dc85d76131aa8ef7e1d332abea9d4a5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:46:05 +0800 Subject: [PATCH 0827/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200515=20How?= =?UTF-8?q?=20to=20examine=20processes=20running=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200515 How to examine processes running on Linux.md --- ...w to examine processes running on Linux.md | 232 ++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 sources/tech/20200515 How to examine processes running on Linux.md diff --git a/sources/tech/20200515 How to examine processes running on Linux.md b/sources/tech/20200515 How to examine processes running on Linux.md new file mode 100644 index 0000000000..0659ab04f9 --- /dev/null +++ b/sources/tech/20200515 How to examine processes running on Linux.md @@ -0,0 +1,232 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to examine processes running on Linux) +[#]: via: (https://www.networkworld.com/article/3543232/how-to-examine-processes-running-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +How to examine processes running on Linux +====== + +Thinkstock + +There are quite a number of ways to look at running processes on Linux systems – to see what’s running, the resources that processes are using, how the system is affected by the load and how memory is being used. Each command gives you a different view, and the range of details is considerable. In this post, we’ll run through a series of commands that can help you view process details in a number of different ways. + +### ps + +While the **ps** command is the most obvious command for examining processes, the arguments that you use when running **ps** will make a big difference in how much information will be provided. With no arguments, **ps** will only show processes associated with your current login session. Add a **-u** and you'll see extended details. + +Here is a comparison: + +``` +nemo$ ps + PID TTY TIME CMD + 45867 pts/1 00:00:00 bash + 46140 pts/1 00:00:00 ps +nemo$ ps -u +USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND +nemo 45867 0.0 0.0 11232 5636 pts/1 Ss 19:04 0:00 -bash +nemo 46141 0.0 0.0 11700 3648 pts/1 R+ 19:16 0:00 ps -u +``` + +Using **ps -ef** will display details on all of the processes running on the system but **ps -eF** will add some additional details. + +``` +$ ps -ef | head -2 +UID PID PPID C STIME TTY TIME CMD +root 1 0 0 May10 ? 00:00:06 /sbin/init splash +$ ps -eF | head -2 +UID PID PPID C SZ RSS PSR STIME TTY TIME CMD +root 1 0 0 42108 12524 0 May10 ? 00:00:06 /sbin/init splash +``` + +Both commands show who is running the process, the process and parent process IDs, process start time, accumulated run time and the task being run. The additional fields shown when you use **F** instead of **f** include: + + * SZ: the process **size** in physical pages for the core image of the process + * RSS: the **resident set size** which shows how much memory is allocated to those parts of the process in RAM. It does not include memory that is swapped out, but does include memory from shared libraries as long as the pages from those libraries are currently in memory. It also includes stack and heap memory. + * PSR: the **processor** the process is using + + + +##### ps -fU + +You can list processes for some particular user with a command like "ps -ef | grep USERNAME", but with **ps -fU** command, you’re going to see considerably more data. This is because details of processes that are being run on the user's behalf are also included. In fact, nearly all these processes shown have been kicked off by system simply to support this user’s online session. Nemo has only just logged in and is not yet running any commands or scripts. + +``` +$ ps -fU nemo +UID PID PPID C STIME TTY TIME CMD +nemo 45726 1 0 19:04 ? 00:00:00 /lib/systemd/systemd --user +nemo 45732 45726 0 19:04 ? 00:00:00 (sd-pam) +nemo 45738 45726 0 19:04 ? 00:00:00 /usr/bin/pulseaudio --daemon +nemo 45740 45726 0 19:04 ? 00:00:00 /usr/libexec/tracker-miner-f +nemo 45754 45726 0 19:04 ? 00:00:00 /usr/bin/dbus-daemon --sessi +nemo 45829 45726 0 19:04 ? 00:00:00 /usr/libexec/gvfsd +nemo 45856 45726 0 19:04 ? 00:00:00 /usr/libexec/gvfsd-fuse /run +nemo 45862 45706 0 19:04 ? 00:00:00 sshd: nemo@pts/1 +nemo 45864 45726 0 19:04 ? 00:00:00 /usr/libexec/gvfs-udisks2-vo +nemo 45867 45862 0 19:04 pts/1 00:00:00 -bash +nemo 45878 45726 0 19:04 ? 00:00:00 /usr/libexec/gvfs-afc-volume +nemo 45883 45726 0 19:04 ? 00:00:00 /usr/libexec/gvfs-goa-volume +nemo 45887 45726 0 19:04 ? 00:00:00 /usr/libexec/goa-daemon +nemo 45895 45726 0 19:04 ? 00:00:00 /usr/libexec/gvfs-mtp-volume +nemo 45896 45726 0 19:04 ? 00:00:00 /usr/libexec/goa-identity-se +nemo 45903 45726 0 19:04 ? 00:00:00 /usr/libexec/gvfs-gphoto2-vo +nemo 45946 45726 0 19:04 ? 00:00:00 /usr/libexec/gvfsd-metadata +``` + +Note that the only process with an assigned TTY is Nemo's shell and that the parent of all of the other processes is **systemd**. + +You can supply a comma-separated list of usernames instead of a single name. Just be prepared to be looking at quite a bit more data. + +#### top and ntop + +The **top** and **ntop** commands will help when you want to get an idea which processes are using the most resources and allow you to reorder your view depending on what criteria you want to use to rank the processes (e.g., highest CPU or memory use). + +``` +top - 11:51:27 up 1 day, 21:40, 1 user, load average: 0.08, 0.02, 0.01 +Tasks: 211 total, 1 running, 210 sleeping, 0 stopped, 0 zombie +%Cpu(s): 5.0 us, 0.5 sy, 0.0 ni, 94.3 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st +MiB Mem : 5944.4 total, 3527.4 free, 565.1 used, 1851.9 buff/cache +MiB Swap: 2048.0 total, 2048.0 free, 0.0 used. 5084.3 avail Mem + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 999 root 20 0 394660 14380 10912 S 8.0 0.2 0:46.54 udisksd + 65224 shs 20 0 314268 9824 8084 S 1.7 0.2 0:00.34 gvfs-ud+ + 2034 gdm 20 0 314264 9820 7992 S 1.3 0.2 0:06.25 gvfs-ud+ + 67909 root 20 0 0 0 0 I 0.3 0.0 0:00.09 kworker+ + 1 root 20 0 168432 12532 8564 S 0.0 0.2 0:09.93 systemd + 2 root 20 0 0 0 0 S 0.0 0.0 0:00.02 kthreadd +``` + +Use **shift+m** to sort by memory use and **shift+p** to go back to sorting by CPU usage (the default). + +#### /proc + +A tremendous amount of information is available on running processes in the **/proc** directory. In fact, if you haven't visited **/proc** quite a few times, you might be astounded by the amount of details available. Just keep in mind that **/proc** is a very different kind of file system. As an interface to kernel data, it provides a view of process details that are currently being used by the system. + +Some of the more useful **/proc** files for viewing include **cmdline**, **environ**, **fd**, **limits** and **status**. The following views provide some samples of what you might see. + +The **status** file shows the process that is running (bash), its status, the user and group ID for the person running bash, a full list of the groups the user is a member of and the process ID and parent process ID. + +``` +$ head -11 /proc/65333/status +Name: bash +Umask: 0002 +State: S (sleeping) +Tgid: 65333 +Ngid: 0 +Pid: 65333 +PPid: 65320 +TracerPid: 0 +Uid: 1000 1000 1000 1000 +Gid: 1000 1000 1000 1000 +FDSize: 256 +Groups: 4 11 24 27 30 46 118 128 500 1000 +... +``` + +The **cmdline** file shows the command line used to start the process. + +``` +$ cat /proc/65333/cmdline +-bash +``` + +The **environ** file shows the environment variables that are in effect. + +``` +$ cat environ +USER=shsLOGNAME=shsHOME=/home/shsPATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/gamesSHELL=/bin/bashTERM=xtermXDG_SESSION_ID=626XDG_RUNTIME_DIR=/run/user/1000DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/busXDG_SESSION_TYPE=ttyXDG_SESSION_CLASS=userMOTD_SHOWN=pamLANG=en_US.UTF-8SSH_CLIENT=192.168.0.19 9385 22SSH_CONNECTION=192.168.0.19 9385 192.168.0.11 22SSH_TTY=/dev/pts/0$ +``` + +The **fd** file shows the file descriptors. Note how they reflect the pseudo-tty that is being used (pts/0). + +``` +$ ls -l /proc/65333/fd +total 0 +lrwx------ 1 shs shs 64 May 12 09:45 0 -> /dev/pts/0 +lrwx------ 1 shs shs 64 May 12 09:45 1 -> /dev/pts/0 +lrwx------ 1 shs shs 64 May 12 09:45 2 -> /dev/pts/0 +lrwx------ 1 shs shs 64 May 12 09:56 255 -> /dev/pts/0 +$ who +shs pts/0 2020-05-12 09:45 (192.168.0.19) +``` + +The **limits** file contains information about the limits imposed on the process. + +``` +$ cat limits +Limit Soft Limit Hard Limit Units +Max cpu time unlimited unlimited seconds +Max file size unlimited unlimited bytes +Max data size unlimited unlimited bytes +Max stack size 8388608 unlimited bytes +Max core file size 0 unlimited bytes +Max resident set unlimited unlimited bytes +Max processes 23554 23554 processes +Max open files 1024 1048576 files +Max locked memory 67108864 67108864 bytes +Max address space unlimited unlimited bytes +Max file locks unlimited unlimited locks +Max pending signals 23554 23554 signals +Max msgqueue size 819200 819200 bytes +Max nice priority 0 0 +Max realtime priority 0 0 +Max realtime timeout unlimited unlimited us +``` + +#### pmap + +The **pmap** command takes you in an entirely different direction when it comes to memory use. It provides a detailed map of a process’s memory usage. To make sense of this, you need to keep in mind that processes do not run entirely on their own. Instead, they make use of a wide range of system resources. The truncated **pmap** output below shows a portion of the memory map for a single user’s bash login along with some memory usage totals at the bottom. + +``` +$ pmap -x 43120 +43120: -bash +Address Kbytes RSS Dirty Mode Mapping +000055887655b000 180 180 0 r---- bash +0000558876588000 708 708 0 r-x-- bash +0000558876639000 220 148 0 r---- bash +0000558876670000 16 16 16 r---- bash +0000558876674000 36 36 36 rw--- bash +000055887667d000 40 28 28 rw--- [ anon ] +0000558876b96000 1328 1312 1312 rw--- [ anon ] +00007f0bd9a7e000 28 28 0 r---- libpthread-2.31.so +00007f0bd9a85000 68 68 0 r-x-- libpthread-2.31.so +00007f0bd9a96000 20 0 0 r---- libpthread-2.31.so +00007f0bd9a9b000 4 4 4 r---- libpthread-2.31.so +00007f0bd9a9c000 4 4 4 rw--- libpthread-2.31.so +00007f0bd9a9d000 16 4 4 rw--- [ anon ] +00007f0bd9aa1000 20 20 0 r---- libnss_systemd.so.2 +00007f0bd9aa6000 148 148 0 r-x-- libnss_systemd.so.2 +... +ffffffffff600000 4 0 0 --x-- [ anon ] +---------------- ------- ------- ------- +total kB 11368 5664 1656 + +Kbytes: size of map in kilobytes +RSS: resident set size in kilobytes +Dirty: dirty pages (both shared and private) in kilobytes +``` +``` + +``` + +Join the Network World communities on [Facebook][1] and [LinkedIn][2] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3543232/how-to-examine-processes-running-on-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.facebook.com/NetworkWorld/ +[2]: https://www.linkedin.com/company/network-world From 9b199190171789c69144973eba35515ecb3cee59 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:47:12 +0800 Subject: [PATCH 0828/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200514=20What?= =?UTF-8?q?=20is=20IoT=3F=20The=20internet=20of=20things=20explained?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200514 What is IoT- The internet of things explained.md --- ...s IoT- The internet of things explained.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 sources/talk/20200514 What is IoT- The internet of things explained.md diff --git a/sources/talk/20200514 What is IoT- The internet of things explained.md b/sources/talk/20200514 What is IoT- The internet of things explained.md new file mode 100644 index 0000000000..fdbbfcea93 --- /dev/null +++ b/sources/talk/20200514 What is IoT- The internet of things explained.md @@ -0,0 +1,157 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is IoT? The internet of things explained) +[#]: via: (https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html) +[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) + +What is IoT? The internet of things explained +====== +The internet of things (IoT) is a network of connected smart devices providing rich data, but it can also be a security nightmare. +Thinkstock + +The internet of things (IoT) is a catch-all term for the growing number of electronics that aren't traditional computing devices, but are connected to the internet to send data, receive instructions or both. + +There's an incredibly broad range of things that fall under that umbrella: Internet-connected "smart" versions of traditional appliances like refrigerators and light bulbs; gadgets that could only exist in an internet-enabled world like Alexa-style digital assistants; internet-enabled sensors that are transforming factories, healthcare, transportation, distribution centers and farms. + +### What is the internet of things? + +The IoT brings the power of the internet, data processing and analytics to the real world of physical objects. For consumers, this means interacting with the global information network without the intermediary of a keyboard and screen; many of their everyday objects and appliances can take instructions from that network with minimal human intervention. + +**[ [More IoT coverage of Network World][1] ]** + +In enterprise settings, IoT can bring the same efficiencies to physical manufacturing and distribution that the internet has long delivered for knowledge work. Millions if not billions of embedded internet-enabled sensors worldwide are providing an incredibly rich set of data that companies can use to gather data about their safety of their operations, track assets and reduce manual processes. Researchers can also use the IoT to gather data about people's preferences and behavior, though that can have serious implications for privacy and security. + +### How big is it? + +In a word: enormous. [Priceonomics breaks it down][2]: There are more than 50 billion IoT devices as of 2020, and those devices will generate 4.4 zettabytes of data this year. (A zettabyte is a trillion gigabytes.) By comparison, in 2013 IoT devices generated a mere 100 billion gigabytes. The amount of money to be made in the IoT market is similarly staggering; estimates on the value of the market in 2025 range from $1.6 trillion to $14.4 trillion. + +### History of IoT + +A world of omnipresent connected devices and sensors is one of the oldest tropes of science fiction. IoT lore has dubbed a [vending machine at Carnegie Mellon][3] that was connected to APRANET in 1970 as the first Internet of Things device, and many technologies have been touted as enabling "smart" IoT-style characteristics to give them a futuristic sheen. But the term Internet of Things was coined in 1999 by British technologist [ Kevin Ashton][4]. + +At first, the technology lagged behind the vision. Every internet-connected thing needed a processor and a means to communicate with other things, preferably wirelessly, and those factors imposed costs and power requirements that made widespread IoT rollouts impractical, at least until Moore's Law caught up in the mid '00s. + +One important milestone was [widespread adoption of RFID tags][5], cheap minimalist transponders that could be stuck on any object to connect it to the larger internet world. Omnipresent Wi-Fi and 4G made it possible to for designers to simply assume wireless connectivity anywhere. And the rollout of IPv6 means that connecting billions of gadgets to the internet won't exhaust the store of IP addresses, which was a real concern. (Related story: [Can IoT networking drive adoption of IPv6?][6]) + +### How does the IoT work? + +The basic elements of the IoT are devices that gather data. Broadly speaking, they are internet-connected devices, so they each have an IP address. They range in complexity from autonomous vehicles that haul products around factory floors to simple sensors that monitor the temperature in buildings. They also include personal devices like fitness trackers that monitor the number of steps individuals take each day. To make that data useful it needs to be collected, processed, filtered and analyzed, each of which can be handled in a variety of ways. + +Collecting the data is done by transmitting it from the devices to a gathering point. Moving the data can be done wirelessly using a range of technologies or on wired networks. The data can be sent over the internet to a data center or a cloud that has storage and compute power or the transfer can be staged, with intermediary devices aggregating the data before sending it along. + +Processing the data can take place in data centers or cloud, but sometimes that’s not an option. In the case of critical devices such as shutoffs in industrial settings, the delay of sending data from the device to a remote data center is too great. The round-trip time for sending data, processing it, analyzing it and returning instructions (close that valve before the pipes burst) can take too long. In such cases edge-computing can come into play, where a smart edge device can aggregate data, analyze it and fashion responses if necessary, all within relatively close physical distance, thereby reducing delay. Edge devices also have upstream connectivity for sending data to be further processed and stored. + +[][7] Network World / IDG + +How the internet of things works.  + +### **Examples of IoT devices** + +Essentially, anything that's capable of gathering some information about the physical world and sending it back home can participate in the IoT ecosystem. Smart home appliances, RFID tags, and industrial sensors are a few examples. These sensors can monitor a range of factors including temperature and pressure in industrial systems, status of critical parts in machinery, patient vital signs, and use of water and electricity, among many, many other possibilities. + +Entire factory robots can be considered IoT devices, as can autonomous vehicles that move products around industrial settings and warehouses. + +Other examples include fitness wearables and home security systems. There are also more generic devices, like the [Raspberry Pi][8] or [Arduino][9], that let you build your own IoT end points. Even though you might think of your smartphone as a pocket-sized computer, it may well also be beaming data about your location and behavior to back-end services in very IoT-like ways. + +#### **Device management** + +In order to work together, all those devices need to be authenticated, provisioned, configured, and monitored, as well as patched and updated as necessary. Too often, all this happens within the context of a single vendor's proprietary systems – or, it doesn't happen at all, which is even more risky. But the industry is starting to transition to a [standards-based device management model][10], which allows IoT devices to interoperate and will ensure that devices aren't orphaned. + +#### **IoT communication standards and protocols** + +When IoT gadgets talk to other devices, they can use a wide variety of communications standards and protocols, many tailored to devices with limited processing capabilities or not much electrical power. Some of these you've definitely heard of — some devices use Wi-Fi or Bluetooth, for instance — but many more are specialized for the world of IoT. ZigBee, for instance, is a wireless protocol for low-power, short-distance communication, while message queuing telemetry transport (MQTT) is a publish/subscribe messaging protocol for devices connected by unreliable or delay-prone networks. (See Network World’s glossary of [IoT standards and protocols][11].) + +The increased speeds and bandwidth of the coming 5G standard for cellular networks will also benefit IoT, though that usage will [lag behind ordinary cell phones][12]. + +### IoT, edge computing and the cloud + +[][13] Network World / IDG + +How edge computing enables IoT. + +For many IoT systems, there's a lot of data coming in fast and furious, which has given rise to a new technology category, [edge computing][14]_,_ consisting of appliances placed relatively close to IoT devices, fielding the flow of data from them. These machines process that data and send only relevant material back to a more centralized system for analysis. For instance, imagine a network of dozens of IoT security cameras. Instead of bombarding the building's security operations center (SoC) with simultaneous live-streams, edge-computing systems can analyze the incoming video and only alert the SoC when one of the cameras detects movement. + +And where does that data go once it’s been processed? Well, it might go to your centralized data center, but more often than not it will end up in the cloud. + +The elastic nature of cloud computing is great for IoT scenarios where data might come in intermittently or asynchronously. And many of the big cloud heavy hitters — including [Google][15], [Microsoft][16], and [Amazon][17] — have IoT offerings.  + +### IoT platforms + +The cloud giants are trying to sell more than just a place to stash the data your sensors have collected. They're offering full IoT platforms*,* which bundle together much of the functionality to coordinate the elements that make up IoT systems. In essence, an IoT platform serves as middleware that connects the IoT devices and edge gateways with the applications you use to deal with the IoT data. That said, every platform vendor seems to have a slightly different definition of what an IoT platform is, the better to [distance themselves from the competition][18]. + +### IoT and data + +As mentioned, there are zettabytes of data being collected by all those IoT devices, funneled through edge gateways, and sent to a platform for processing. In many scenarios, this data is the reason IoT has been deployed in the first place. By collecting information from sensors in the real world, organizations can make nimble decisions in real time. + +Oracle, for instance, [imagines a scenario][19] where people at a theme park are encouraged to download an app that offers information about the park. At the same time, the app sends GPS pings back to the park's management to help predict wait times in lines. With that information, the park can take action in the short term (by adding more staff to increase the capacity of some attractions, for instance) and the long term (by learning which rides are the most and least popular at the park). + +These decisions can be made without human intervention. For example, data gathered from pressure sensors in a chemical-factory pipeline could be analyzed by software in an edge device that spots the threat of a pipeline rupture, and that information can trigger a signal to shut valves to avert a spill.  + +### IoT and big data analytics + +The theme park example is easy to get your head around, but is small potatoes compared to many real-world IoT data-harvesting operations. Many big data operations use information harvested from IoT devices, correlated with other data points, to get insight into human behavior. _Software Advice_ gives [a few examples][20], including a service from Birst that matches coffee brewing information collected from internet-connected coffeemakers with social media posts to see if customers are talking about coffee brands online. + +Another dramatic example came recently when X-Mode released a map based on tracking location data of people who partied at spring break in Ft. Lauderdale in March of 2020, even as the coronavirus pandemic was gaining speed in the United States, showing [where all those people ended up across the country][21]. The map was shocking not only because it showed the potential spread of the virus, but also because it illustrated just how closely IoT devices can track us. (For more on IoT and analytics, click [here][22]. + +### IoT data and AI + +The volume of data IoT devices can gather is far larger than any human can deal with in a useful way, and certainly not in real time. We've already seen that edge computing devices are needed just to make sense of the raw data coming in from the IoT endpoints. There's also the need to detect and deal with data that might [be just plain wrong][23]. + +Many IoT providers are offering machine learning and artificial intelligence capabilities to make sense of the collected data. IBM's Jeopardy!-winning Watson platform, for instance, can be [trained on IoT data sets][24] to produce useful results in the field of predicative maintenance — analyzing data from drones to distinguish between trivial damage to a bridge and cracks that need attention, for instance. Meanwhile, Arm is working on [low-power chips][25] that can provide AI capabilities on the IoT endpoints themselves.    ** **  + +### IoT and business + +Business uses for IoT include keeping track of customers, inventory, and the status of important components. [IoT for All][26] flags four industries that have been transformed by IoT: + + * **Oil and gas**: Isolated drilling sites can be better monitored with IoT sensors than by human intervention + * A**griculture**: Granular data about crops growing in fields derived from IoT sensors can be used to increase yields + * **HVAC**: Climate control systems across the country can be monitored by manufacturers + * **Brick-and-mortar retail**: Customers can be microtargeted with offers on their phones as they linger in certain parts of a store + + + +More generally, enterprises are looking for IoT solutions that can help in [four areas][27]: energy use, asset tracking, security, and the customer experience. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html + +作者:[Josh Fruhlinger][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Josh-Fruhlinger/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/category/internet-of-things/ +[2]: https://priceonomics.com/the-iot-data-explosion-how-big-is-the-iot-data/ +[3]: https://www.machinedesign.com/automation-iiot/article/21836968/iot-started-with-a-vending-machine +[4]: https://www.visioncritical.com/blog/kevin-ashton-internet-of-things +[5]: https://www.networkworld.com/article/2319384/rfid-readers-route-tag-traffic.html +[6]: https://www.networkworld.com/article/3338106/can-iot-networking-drive-adoption-of-ipv6.html +[7]: https://images.idgesg.net/images/article/2020/05/nw_how_iot_works_diagram-100840757-orig.jpg +[8]: https://www.networkworld.com/article/3176091/10-killer-raspberry-pi-projects-collection-1.html +[9]: https://www.networkworld.com/article/3075360/arduino-targets-the-internet-of-things-with-primo-board.html +[10]: https://www.networkworld.com/article/3258812/the-future-of-iot-device-management.html +[11]: https://www.networkworld.com/article/3235124/internet-of-things-definitions-a-handy-guide-to-essential-iot-terms.html +[12]: https://www.networkworld.com/article/3291778/what-s-so-special-about-5g-and-iot.html +[13]: https://images.idgesg.net/images/article/2017/09/nw_how_edge_computing_works_diagram_1400x1717-100736111-orig.jpg +[14]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[15]: https://cloud.google.com/solutions/iot +[16]: https://azure.microsoft.com/en-us/overview/iot/ +[17]: https://aws.amazon.com/iot/ +[18]: https://www.networkworld.com/article/3336166/why-are-iot-platforms-so-darn-confusing.html +[19]: https://blogs.oracle.com/bigdata/how-big-data-powers-the-internet-of-things +[20]: https://www.softwareadvice.com/resources/iot-data-analytics-use-cases/ +[21]: https://www.cnn.com/2020/04/04/tech/location-tracking-florida-coronavirus/index.html +[22]: https://www.networkworld.com/article/3311919/iot-analytics-guide-what-to-expect-from-internet-of-things-data.html +[23]: https://www.networkworld.com/article/3396230/when-iot-systems-fail-the-risk-of-having-bad-iot-data.html +[24]: https://www.networkworld.com/article/3449243/watson-iot-chief-ai-can-broaden-iot-services.html +[25]: https://www.networkworld.com/article/3532094/ai-everywhere-iot-chips-coming-from-arm.html +[26]: https://www.iotforall.com/4-unlikely-industries-iot-changing/ +[27]: https://www.networkworld.com/article/3396128/the-state-of-enterprise-iot-companies-want-solutions-for-these-4-areas.html From 5cf9b279af8e1193026c092957167aa197021ff7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:47:41 +0800 Subject: [PATCH 0829/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200514=20How?= =?UTF-8?q?=20IoT=20will=20rescue=20aviation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200514 How IoT will rescue aviation.md --- .../20200514 How IoT will rescue aviation.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/talk/20200514 How IoT will rescue aviation.md diff --git a/sources/talk/20200514 How IoT will rescue aviation.md b/sources/talk/20200514 How IoT will rescue aviation.md new file mode 100644 index 0000000000..3dc9570dff --- /dev/null +++ b/sources/talk/20200514 How IoT will rescue aviation.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How IoT will rescue aviation) +[#]: via: (https://www.networkworld.com/article/3543318/how-iot-will-rescue-aviation.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +How IoT will rescue aviation +====== +European airplane maker Airbus is one company exploring virus-spotting IoT sensors in an attempt to keep COVID-19-infected passengers off planes. +[Stéphan Valentin][1] [(CC0)][2] + +A biotech company that develops sensors to detect explosives and other chemicals on planes and in airports is teaming up with Airbus to create a sensor that could detect passengers who are positive for COVID-19. + +California-based Koniku and Airbus, which have been working since 2017 on contactless equipment that sniffs out chemicals, are trying to adapt that technology to sniff out pathogens, says Osh Agabi, founder and CEO of Koniku, [in a blog post][3]. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][4] + +They hope to identify odors in breath or sweat that are chemical markers indicating the presence of COVID-19 infection. "Most infections and diseases cause slight changes to the composition of our breath and sweat, which then produce distinct odors," Agabi writes. "If we can detect those odors, we can detect the presence of those infections." + +The companies hope to identify markers specific to the novel coronavirus and an IOT sensor equipped with genetically engineered odoroant receptors that can detect them. "Those receptors screen molecules in the air and produce a signal when they come into contact with the molecular compounds of the hazard or threat that they have been programmed to detect," he writes. + +He says that passengers would be screened by walking through an enclosed corridor where the sensors are deployed. "By programming the DNA of the cells that make up these receptors to react to the compounds that appear in infected people’s breath or sweat, we believe we will be able to quickly and reliably screen for COVID-19 and determine whether a person is infected," he writes. + +Other types of contactless detectors are already in use, including elevated-skin-temperature (EST) cameras. + +Italy's main airport, Leonardo da Vinci, acquired three thermal-imaging helmets with the intent to use them to spot persons with fevers. The airport already had fixed thermal scanners and has ordered more. Passengers detected with potentially high temperatures are made to take a further medical exam, [according to regional publication Fiumicino Online][5]. + +KC Wearable, the Shenzhen, China, company that makes the helmets, says they can be worn by staff and used at a distance from passengers. + +FLIR Systems, which makes thermal cameras, says there’s been increased demand for them to be used in EST screening, the company says in this month in its [financial results][6]. + +"Although these thermal cameras cannot detect or diagnose any type of medical condition, the cameras do serve as an effective tool to identify elevated skin temperatures," it says. + +"Many companies are looking to install this technology in their facilities in anticipation of lifting the shelter-in-place orders," FLIR CEO Jim Cannon [said in an earnings call][7] this month. General Motors is one of them, [according to Reuters][8]. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3543318/how-iot-will-rescue-aviation.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://unsplash.com/photos/s7NGQU2Nt8k +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.linkedin.com/pulse/what-happens-when-airports-open-back-up-osh-agabi/?src=aff-lilpar&veh=aff_src.aff-lilpar_c.partners_pkw.10078_plc.Skimbit%20Ltd._pcrid.449670_learning&trk=aff_src.aff-lilpar_c.partners_pkw.10078_plc.Skimbit%20Ltd._pcrid.449670_learning&clickid=WNmzMlyalxyOUI7wUx0Mo34HUkiwwpy%3APQ3X1Y0&irgwc=1 +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.fiumicino-online.it/articoli/cronaca-2/fase-2-all-aeroporto-di-fiumicino-lo-smart-helmet-per-controllare-la-febbre-a-distanza +[6]: https://flir.gcs-web.com/news-releases/news-release-details/flir-systems-announces-first-quarter-2020-financial-results +[7]: https://www.fool.com/earnings/call-transcripts/2020/05/06/flir-systems-inc-flir-q1-2020-earnings-call-transc.aspx +[8]: https://uk.reuters.com/article/us-flir-systems-gm/general-motors-taps-flir-systems-for-fever-check-cameras-at-factories-idUKKBN22J02B +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 055509370cbeeb236eb94b544780ab6bfc110e49 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:47:53 +0800 Subject: [PATCH 0830/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200514=20Ethe?= =?UTF-8?q?rnet=20Alliance=20study=20finds=20Power=20over=20Ethernet=20iss?= =?UTF-8?q?ues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200514 Ethernet Alliance study finds Power over Ethernet issues.md --- ... study finds Power over Ethernet issues.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/talk/20200514 Ethernet Alliance study finds Power over Ethernet issues.md diff --git a/sources/talk/20200514 Ethernet Alliance study finds Power over Ethernet issues.md b/sources/talk/20200514 Ethernet Alliance study finds Power over Ethernet issues.md new file mode 100644 index 0000000000..983c11dac6 --- /dev/null +++ b/sources/talk/20200514 Ethernet Alliance study finds Power over Ethernet issues.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ethernet Alliance study finds Power over Ethernet issues) +[#]: via: (https://www.networkworld.com/article/3543258/ethernet-alliance-study-finds-power-over-ethernet-issues.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Ethernet Alliance study finds Power over Ethernet issues +====== +Reliability, connection issues, failure to deliver power traced to interoperability issues with Power over Ethernet. +Martyn Williams/IDGNS + +Four out five users experience challenges with power over Ethernet (PoE) deployments, according to a new survey of nearly 800 Ethernet designers, manufacturers, resellers, system integrators, network operators and others. + +Conducted by the Ethernet Alliance in January, the study  found a number of key PoE insights, including: + + * Four out of five users experienced issues, including support, reliability, or connection challenges. + * The top three PoE installations are cameras and phones, as well as computing and storage devices; + * Of customers planning to implement PoE 63% said they would need 30w; 47% would need between 30-60w and 27% need greater than 60w. + + + +**[ Now see [7 free network tools you must have][1]. ]** + +With the global market projected to grow to $2 billion by 2025, PoE remains a wellspring of lucrative opportunities for designers, systems integrators, and solutions providers, David Tremblay, chair of the alliance's PoE Subcommittee, and system architect for Aruba, said in a statement. “Despite this good news, there are significant challenges that could threaten PoE’s growing adoption.” + +According to the survey those chief PoE challenges include, vendor support, unreliable power or operation, long repair times, and first-time connection issues. + +The Alliance reported that while 78% of respondents experienced difficulties with PoE deployments, 72% expect improvement with products certified through the Ethernet Alliance’s [PoE Certification Program][2]. The study found 84% said they expect certified PoE devices would be more likely to work the first time, and 85% expect those devices to be more reliable. + +“Lacking a registered trademark, the use of the term ‘PoE’ is not formally regulated, allowing any vendor to freely describe products and solutions as PoE-enabled. Additionally, terminologies such as ‘PoE+’, as well as non-standard PoE implementations are causing confusion with device interoperability among technicians, designers, and end users,” the Alliance stated. + +[Experts say][3] the single greatest challenge for PoE  is assuring interoperability.  Multivendor interoperability is Ethernet’s hallmark and it's an important consideration for consumers who want to know the gear will just work, while industry players need a way to find new partnership opportunities with companies offering certified equipment, the Dell’Oro Group said. + +“With the diversity of application, come interoperability problems which dictate the need for testing and certification,” said Sameh Boujelbene, Senior Research Director for Ethernet Switch market research at Dell’Oro. + +Certified Ethernet Alliance products range from component level Ethernet evaluation boards, to power-sourcing equipment, enterprise switches, and adapters. + +Ultimately the Ethernet Alliance’s Power over Ethernet (PoE) Certification Program is the place customers should look to enable faster PoE installations with zero interoperability issues, Tremblay said. + +A number of key Ethernet vendors including Cisco, Hewlett Packard Enterprise, Huawei, Analog Devices, Texas Instruments, Microsemi and others are part of the certification program. + +Details about certified products are available via the [program’s public registry][4]. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3543258/ethernet-alliance-study-finds-power-over-ethernet-issues.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/2825879/7-free-open-source-network-monitoring-tools.html +[2]: https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbit.ly%2FEA_PoECertification&data=02%7C01%7C%7Ca67fc55074c748affa8408d7f74fc98e%7C3aedb78fc8e04326888a74230d1978ff%7C0%7C0%7C637249794373724526&sdata=2QDd6oO2Yu6EiCj6m7i%2BtbVJD1wHxmNwtDr2oMe9TgQ%3D&reserved=0 +[3]: https://www.networkworld.com/article/2328615/the-power-over-ethernet.html +[4]: https://ea-poe-cert.iol.unh.edu/?utm_source=General%20Distribution&utm_medium=Press%20Release&utm_campaign=October%20PoE%20Certification%20Press%20Release +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 5f65b5dc3c03bad96a357cfd6980b96b18ca5de4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:51:55 +0800 Subject: [PATCH 0831/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190331=20Code?= =?UTF-8?q?cademy=20vs.=20The=20BBC=20Micro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20190331 Codecademy vs. The BBC Micro.md --- .../20190331 Codecademy vs. The BBC Micro.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/talk/20190331 Codecademy vs. The BBC Micro.md diff --git a/sources/talk/20190331 Codecademy vs. The BBC Micro.md b/sources/talk/20190331 Codecademy vs. The BBC Micro.md new file mode 100644 index 0000000000..a85aadad46 --- /dev/null +++ b/sources/talk/20190331 Codecademy vs. The BBC Micro.md @@ -0,0 +1,145 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Codecademy vs. The BBC Micro) +[#]: via: (https://twobithistory.org/2019/03/31/bbc-micro.html) +[#]: author: (Two-Bit History https://twobithistory.org) + +Codecademy vs. The BBC Micro +====== + +In the late 1970s, the computer, which for decades had been a mysterious, hulking machine that only did the bidding of corporate overlords, suddenly became something the average person could buy and take home. An enthusiastic minority saw how great this was and rushed to get a computer of their own. For many more people, the arrival of the microcomputer triggered helpless anxiety about the future. An ad from a magazine at the time promised that a home computer would “give your child an unfair advantage in school.” It showed a boy in a smart blazer and tie eagerly raising his hand to answer a question, while behind him his dim-witted classmates look on sullenly. The ad and others like it implied that the world was changing quickly and, if you did not immediately learn how to use one of these intimidating new devices, you and your family would be left behind. + +In the UK, this anxiety metastasized into concern at the highest levels of government about the competitiveness of the nation. The 1970s had been, on the whole, an underwhelming decade for Great Britain. Both inflation and unemployment had been high. Meanwhile, a series of strikes put London through blackout after blackout. A government report from 1979 fretted that a failure to keep up with trends in computing technology would “add another factor to our poor industrial performance.”[1][1] The country already seemed to be behind in the computing arena—all the great computer companies were American, while integrated circuits were being assembled in Japan and Taiwan. + +In an audacious move, the BBC, a public service broadcaster funded by the government, decided that it would solve Britain’s national competitiveness problems by helping Britons everywhere overcome their aversion to computers. It launched the _Computer Literacy Project_, a multi-pronged educational effort that involved several TV series, a few books, a network of support groups, and a specially built microcomputer known as the BBC Micro. The project was so successful that, by 1983, an editor for BYTE Magazine wrote, “compared to the US, proportionally more of Britain’s population is interested in microcomputers.”[2][2] The editor marveled that there were more people at the Fifth Personal Computer World Show in the UK than had been to that year’s West Coast Computer Faire. Over a sixth of Great Britain watched an episode in the first series produced for the _Computer Literacy Project_ and 1.5 million BBC Micros were ultimately sold.[3][3] + +[An archive][4] containing every TV series produced and all the materials published for the _Computer Literacy Project_ was put on the web last year. I’ve had a huge amount of fun watching the TV series and trying to imagine what it would have been like to learn about computing in the early 1980s. But what’s turned out to be more interesting is how computing was _taught_. Today, we still worry about technology leaving people behind. Wealthy tech entrepreneurs and governments spend lots of money trying to teach kids “to code.” We have websites like Codecademy that make use of new technologies to teach coding interactively. One would assume that this approach is more effective than a goofy ’80s TV series. But is it? + +### The Computer Literacy Project + +The microcomputer revolution began in 1975 with the release of [the Altair 8800][5]. Only two years later, the Apple II, TRS-80, and Commodore PET had all been released. Sales of the new computers exploded. In 1978, the BBC explored the dramatic societal changes these new machines were sure to bring in a documentary called “Now the Chips Are Down.” + +The documentary was alarming. Within the first five minutes, the narrator explains that microelectronics will “totally revolutionize our way of life.” As eerie synthesizer music plays, and green pulses of electricity dance around a magnified microprocessor on screen, the narrator argues that the new chips are why “Japan is abandoning its ship building, and why our children will grow up without jobs to go to.” The documentary goes on to explore how robots are being used to automate car assembly and how the European watch industry has lost out to digital watch manufacturers in the United States. It castigates the British government for not doing more to prepare the country for a future of mass unemployment. + +The documentary was supposedly shown to the British Cabinet.[4][6] Several government agencies, including the Department of Industry and the Manpower Services Commission, became interested in trying to raise awareness about computers among the British public. The Manpower Services Commission provided funds for a team from the BBC’s education division to travel to Japan, the United States, and other countries on a fact-finding trip. This research team produced a report that cataloged the ways in which microelectronics would indeed mean major changes for industrial manufacturing, labor relations, and office work. In late 1979, it was decided that the BBC should make a ten-part TV series that would help regular Britons “learn how to use and control computers and not feel dominated by them.”[5][7] The project eventually became a multimedia endeavor similar to the _Adult Literacy Project_, an earlier BBC undertaking involving both a TV series and supplemental courses that helped two million people improve their reading. + +The producers behind the _Computer Literacy Project_ were keen for the TV series to feature “hands-on” examples that viewers could try on their own if they had a microcomputer at home. These examples would have to be in BASIC, since that was the language (really the entire shell) used on almost all microcomputers. But the producers faced a thorny problem: Microcomputer manufacturers all had their own dialects of BASIC, so no matter which dialect they picked, they would inevitably alienate some large fraction of their audience. The only real solution was to create a new BASIC—BBC BASIC—and a microcomputer to go along with it. Members of the British public would be able to buy the new microcomputer and follow along without worrying about differences in software or hardware. + +The TV producers and presenters at the BBC were not capable of building a microcomputer on their own. So they put together a specification for the computer they had in mind and invited British microcomputer companies to propose a new machine that met the requirements. The specification called for a relatively powerful computer because the BBC producers felt that the machine should be able to run real, useful applications. Technical consultants for the _Computer Literacy Project_ also suggested that, if it had to be a BASIC dialect that was going to be taught to the entire nation, then it had better be a good one. (They may not have phrased it exactly that way, but I bet that’s what they were thinking.) BBC BASIC would make up for some of BASIC’s usual shortcomings by allowing for recursion and local variables.[6][8] + +The BBC eventually decided that a Cambridge-based company called Acorn Computers would make the BBC Micro. In choosing Acorn, the BBC passed over a proposal from Clive Sinclair, who ran a company called Sinclair Research. Sinclair Research had brought mass-market microcomputing to the UK in 1980 with the Sinclair ZX80. Sinclair’s new computer, the ZX81, was cheap but not powerful enough for the BBC’s purposes. Acorn’s new prototype computer, known internally as the Proton, would be more expensive but more powerful and expandable. The BBC was impressed. The Proton was never marketed or sold as the Proton because it was instead released in December 1981 as the BBC Micro, also affectionately called “The Beeb.” You could get a 16k version for £235 and a 32k version for £335. + +In 1980, Acorn was an underdog in the British computing industry. But the BBC Micro helped establish the company’s legacy. Today, the world’s most popular microprocessor instruction set is the ARM architecture. “ARM” now stands for “Advanced RISC Machine,” but originally it stood for “Acorn RISC Machine.” ARM Holdings, the company behind the architecture, was spun out from Acorn in 1990. + +![Picture of the BBC Micro.][9] _A bad picture of a BBC Micro, taken by me at the Computer History Museum +in Mountain View, California._ + +### The Computer Programme + +A dozen different TV series were eventually produced as part of the _Computer Literacy Project_, but the first of them was a ten-part series known as _The Computer Programme_. The series was broadcast over ten weeks at the beginning of 1982. A million people watched each week-night broadcast of the show; a quarter million watched the reruns on Sunday and Monday afternoon. + +The show was hosted by two presenters, Chris Serle and Ian McNaught-Davis. Serle plays the neophyte while McNaught-Davis, who had professional experience programming mainframe computers, plays the expert. This was an inspired setup. It made for [awkward transitions][10]—Serle often goes directly from a conversation with McNaught-Davis to a bit of walk-and-talk narration delivered to the camera, and you can’t help but wonder whether McNaught-Davis is still standing there out of frame or what. But it meant that Serle could voice the concerns that the audience would surely have. He can look intimidated by a screenful of BASIC and can ask questions like, “What do all these dollar signs mean?” At several points during the show, Serle and McNaught-Davis sit down in front of a computer and essentially pair program, with McNaught-Davis providing hints here and there while Serle tries to figure it out. It would have been much less relatable if the show had been presented by a single, all-knowing narrator. + +The show also made an effort to demonstrate the many practical applications of computing in the lives of regular people. By the early 1980s, the home computer had already begun to be associated with young boys and video games. The producers behind _The Computer Programme_ sought to avoid interviewing “impressively competent youngsters,” as that was likely “to increase the anxieties of older viewers,” a demographic that the show was trying to attract to computing.[7][11] In the first episode of the series, Gill Nevill, the show’s “on location” reporter, interviews a woman that has bought a Commodore PET to help manage her sweet shop. The woman (her name is Phyllis) looks to be 60-something years old, yet she has no trouble using the computer to do her accounting and has even started using her PET to do computer work for other businesses, which sounds like the beginning of a promising freelance career. Phyllis says that she wouldn’t mind if the computer work grew to replace her sweet shop business since she enjoys the computer work more. This interview could instead have been an interview with a teenager about how he had modified _Breakout_ to be faster and more challenging. But that would have been encouraging to almost nobody. On the other hand, if Phyllis, of all people, can use a computer, then surely you can too. + +While the show features lots of BASIC programming, what it really wants to teach its audience is how computing works in general. The show explains these general principles with analogies. In the second episode, there is an extended discussion of the Jacquard loom, which accomplishes two things. First, it illustrates that computers are not based only on magical technology invented yesterday—some of the foundational principles of computing go back two hundred years and are about as simple as the idea that you can punch holes in card to control a weaving machine. Second, the interlacing of warp and weft threads is used to demonstrate how a binary choice (does the weft thread go above or below the warp thread?) is enough, when repeated over and over, to produce enormous variation. This segues, of course, into a discussion of how information can be stored using binary digits. + +Later in the show there is a section about a steam organ that plays music encoded in a long, segmented roll of punched card. This time the analogy is used to explain subroutines in BASIC. Serle and McNaught-Davis lay out the whole roll of punched card on the floor in the studio, then point out the segments where it looks like a refrain is being repeated. McNaught-Davis explains that a subroutine is what you would get if you cut out those repeated segments of card and somehow added an instruction to go back to the original segment that played the refrain for the first time. This is a brilliant explanation and probably one that stuck around in people’s minds for a long time afterward. + +I’ve picked out only a few examples, but I think in general the show excels at demystifying computers by explaining the principles that computers rely on to function. The show could instead have focused on teaching BASIC, but it did not. This, it turns out, was very much a conscious choice. In a retrospective written in 1983, John Radcliffe, the executive producer of the _Computer Literacy Project_, wrote the following: + +> If computers were going to be as important as we believed, some genuine understanding of this new subject would be important for everyone, almost as important perhaps as the capacity to read and write. Early ideas, both here and in America, had concentrated on programming as the main route to computer literacy. However, as our thinking progressed, although we recognized the value of “hands-on” experience on personal micros, we began to place less emphasis on programming and more on wider understanding, on relating micros to larger machines, encouraging people to gain experience with a range of applications programs and high-level languages, and relating these to experience in the real world of industry and commerce…. Our belief was that once people had grasped these principles, at their simplest, they would be able to move further forward into the subject. + +Later, Radcliffe writes, in a similar vein: + +> There had been much debate about the main explanatory thrust of the series. One school of thought had argued that it was particularly important for the programmes to give advice on the practical details of learning to use a micro. But we had concluded that if the series was to have any sustained educational value, it had to be a way into the real world of computing, through an explanation of computing principles. This would need to be achieved by a combination of studio demonstration on micros, explanation of principles by analogy, and illustration on film of real-life examples of practical applications. Not only micros, but mini computers and mainframes would be shown. + +I love this, particularly the part about mini-computers and mainframes. The producers behind _The Computer Programme_ aimed to help Britons get situated: Where had computing been, and where was it going? What can computers do now, and what might they do in the future? Learning some BASIC was part of answering those questions, but knowing BASIC alone was not seen as enough to make someone computer literate. + +### Computer Literacy Today + +If you google “learn to code,” the first result you see is a link to Codecademy’s website. If there is a modern equivalent to the _Computer Literacy Project_, something with the same reach and similar aims, then it is Codecademy. + +“Learn to code” is Codecademy’s tagline. I don’t think I’m the first person to point this out—in fact, I probably read this somewhere and I’m now ripping it off—but there’s something revealing about using the word “code” instead of “program.” It suggests that the important thing you are learning is how to decode the code, how to look at a screen’s worth of Python and not have your eyes glaze over. I can understand why to the average person this seems like the main hurdle to becoming a professional programmer. Professional programmers spend all day looking at computer monitors covered in gobbledygook, so, if I want to become a professional programmer, I better make sure I can decipher the gobbledygook. But dealing with syntax is not the most challenging part of being a programmer, and it quickly becomes almost irrelevant in the face of much bigger obstacles. Also, armed only with knowledge of a programming language’s syntax, you may be able to _read_ code but you won’t be able to _write_ code to solve a novel problem. + +I recently went through Codecademy’s “Code Foundations” course, which is the course that the site recommends you take if you are interested in programming (as opposed to web development or data science) and have never done any programming before. There are a few lessons in there about the history of computer science, but they are perfunctory and poorly researched. (Thank heavens for [this noble internet vigilante][12], who pointed out a particularly egregious error.) The main focus of the course is teaching you about the common structural elements of programming languages: variables, functions, control flow, loops. In other words, the course focuses on what you would need to know to start seeing patterns in the gobbledygook. + +To be fair to Codecademy, they offer other courses that look meatier. But even courses such as their “Computer Science Path” course focus almost exclusively on programming and concepts that can be represented in programs. One might argue that this is the whole point—Codecademy’s main feature is that it gives you little interactive programming lessons with automated feedback. There also just isn’t enough room to cover more because there is only so much you can stuff into somebody’s brain in a little automated lesson. But the producers at the BBC tasked with kicking off the _Computer Literacy Project_ also had this problem; they recognized that they were limited by their medium and that “the amount of learning that would take place as a result of the television programmes themselves would be limited.”[8][13] With similar constraints on the volume of information they could convey, they chose to emphasize general principles over learning BASIC. Couldn’t Codecademy replace a lesson or two with an interactive visualization of a Jacquard loom weaving together warp and weft threads? + +I’m banging the drum for “general principles” loudly now, so let me just explain what I think they are and why they are important. There’s a book by J. Clark Scott about computers called _But How Do It Know?_ The title comes from the anecdote that opens the book. A salesman is explaining to a group of people that a thermos can keep hot food hot and cold food cold. A member of the audience, astounded by this new invention, asks, “But how do it know?” The joke of course is that the thermos is not perceiving the temperature of the food and then making a decision—the thermos is just constructed so that cold food inevitably stays cold and hot food inevitably stays hot. People anthropomorphize computers in the same way, believing that computers are digital brains that somehow “choose” to do one thing or another based on the code they are fed. But learning a few things about how computers work, even at a rudimentary level, takes the homunculus out of the machine. That’s why the Jacquard loom is such a good go-to illustration. It may at first seem like an incredible device. It reads punch cards and somehow “knows” to weave the right pattern! The reality is mundane: Each row of holes corresponds to a thread, and where there is a hole in that row the corresponding thread gets lifted. Understanding this may not help you do anything new with computers, but it will give you the confidence that you are not dealing with something magical. We should impart this sense of confidence to beginners as soon as we can. + +Alas, it’s possible that the real problem is that nobody wants to learn about the Jacquard loom. Judging by how Codecademy emphasizes the professional applications of what it teaches, many people probably start using Codecademy because they believe it will help them “level up” their careers. They believe, not unreasonably, that the primary challenge will be understanding the gobbledygook, so they want to “learn to code.” And they want to do it as quickly as possible, in the hour or two they have each night between dinner and collapsing into bed. Codecademy, which after all is a business, gives these people what they are looking for—not some roundabout explanation involving a machine invented in the 18th century. + +The _Computer Literacy Project_, on the other hand, is what a bunch of producers and civil servants at the BBC thought would be the best way to educate the nation about computing. I admit that it is a bit elitist to suggest we should laud this group of people for teaching the masses what they were incapable of seeking out on their own. But I can’t help but think they got it right. Lots of people first learned about computing using a BBC Micro, and many of these people went on to become successful software developers or game designers. [As I’ve written before][14], I suspect learning about computing at a time when computers were relatively simple was a huge advantage. But perhaps another advantage these people had is shows like _The Computer Programme_, which strove to teach not just programming but also how and why computers can run programs at all. After watching _The Computer Programme_, you may not understand all the gobbledygook on a computer screen, but you don’t really need to because you know that, whatever the “code” looks like, the computer is always doing the same basic thing. After a course or two on Codecademy, you understand some flavors of gobbledygook, but to you a computer is just a magical machine that somehow turns gobbledygook into running software. That isn’t computer literacy. + +_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][15] on Twitter or subscribe to the [RSS feed][16] to make sure you know when a new post is out._ + +_Previously on TwoBitHistory…_ + +> FINALLY some new damn content, amirite? +> +> Wanted to write an article about how Simula bought us object-oriented programming. It did that, but early Simula also flirted with a different vision for how OOP would work. Wrote about that instead! +> +> — TwoBitHistory (@TwoBitHistory) [February 1, 2019][17] + + 1. Robert Albury and David Allen, Microelectronics, report (1979). [↩︎][18] + + 2. Gregg Williams, “Microcomputing, British Style”, Byte Magazine, 40, January 1983, accessed on March 31, 2019, . [↩︎][19] + + 3. John Radcliffe, “Toward Computer Literacy,” Computer Literacy Project Achive, 42, accessed March 31, 2019, [https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards Computer Literacy.pdf][20]. [↩︎][21] + + 4. David Allen, “About the Computer Literacy Project,” Computer Literacy Project Archive, accessed March 31, 2019, . [↩︎][22] + + 5. ibid. [↩︎][23] + + 6. Williams, 51. [↩︎][24] + + 7. Radcliffe, 11. [↩︎][25] + + 8. Radcliffe, 5. [↩︎][26] + + + + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2019/03/31/bbc-micro.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: tmp.05mfBL4kP8#fn:1 +[2]: tmp.05mfBL4kP8#fn:2 +[3]: tmp.05mfBL4kP8#fn:3 +[4]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/ +[5]: https://twobithistory.org/2018/07/22/dawn-of-the-microcomputer.html +[6]: tmp.05mfBL4kP8#fn:4 +[7]: tmp.05mfBL4kP8#fn:5 +[8]: tmp.05mfBL4kP8#fn:6 +[9]: https://twobithistory.org/images/beeb.jpg +[10]: https://twitter.com/TwoBitHistory/status/1112372000742404098 +[11]: tmp.05mfBL4kP8#fn:7 +[12]: https://twitter.com/TwoBitHistory/status/1111305774939234304 +[13]: tmp.05mfBL4kP8#fn:8 +[14]: https://twobithistory.org/2018/09/02/learning-basic.html +[15]: https://twitter.com/TwoBitHistory +[16]: https://twobithistory.org/feed.xml +[17]: https://twitter.com/TwoBitHistory/status/1091148050221944832?ref_src=twsrc%5Etfw +[18]: tmp.05mfBL4kP8#fnref:1 +[19]: tmp.05mfBL4kP8#fnref:2 +[20]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards%20Computer%20Literacy.pdf +[21]: tmp.05mfBL4kP8#fnref:3 +[22]: tmp.05mfBL4kP8#fnref:4 +[23]: tmp.05mfBL4kP8#fnref:5 +[24]: tmp.05mfBL4kP8#fnref:6 +[25]: tmp.05mfBL4kP8#fnref:7 +[26]: tmp.05mfBL4kP8#fnref:8 From 3c52822b21e10a39f37ae25fb7cc4a902cfc9a70 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 May 2020 19:52:22 +0800 Subject: [PATCH 0832/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200421=20What?= =?UTF-8?q?=20is=20a=20High=20Traffic=20Website=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200421 What is a High Traffic Website.md --- ...20200421 What is a High Traffic Website.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/talk/20200421 What is a High Traffic Website.md diff --git a/sources/talk/20200421 What is a High Traffic Website.md b/sources/talk/20200421 What is a High Traffic Website.md new file mode 100644 index 0000000000..d9207af7dd --- /dev/null +++ b/sources/talk/20200421 What is a High Traffic Website.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is a High Traffic Website?) +[#]: via: (https://theartofmachinery.com/2020/04/21/what_is_high_traffic.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +What is a High Traffic Website? +====== + +Terms like “high traffic” are hazardous when designing online services because salespeople, business analysts and engineers all have different perspectives about what they mean. If we’re talking about, say, a high-stakes online poker room, then “high traffic” for the business side will be very low compared to what it is for the technical side. However, all these people will be in a meeting room together making decisions, using the same words to mean different things. It’s obvious how that can lead to bad (and sometimes expensive) choices. + +A lot of my day job is talking to business stakeholders and figuring out the technical solutions they need, so this is a problem I have to deal with. So I’ve got my own purely technical way to think about traffic levels for online services. + +### Scalability vs performance + +First, let’s be clear about two concepts that come up a lot in online service design. + +For online services, performance is all about how well (usually how fast) the system can handle a single request or unit of work. Scalability is about the volume or size of work that can be handled. For online services, scalability is usually about the number of user requests that can be handled within a timeframe, while for batch jobs we typically care about the size of the dataset we can process. Sometimes we want the system capacity to grow and shrink based on demand, but sometimes we don’t care as long as we can handle the full range of workloads we expect. + +Scalability and performance often get confused because they commonly work together. For example, suppose you have some online service using a slow algorithm and you improve perfomance by replacing the algorithm with another that does the same job with less work. Primarily that’s a performance gain, but as long as the new algorithm doesn’t use more memory or something, you’ll be able to handle more requests in the same time. + +There’s a counterexample I’ve discussed before: [internal caches versus external cache servers][1]. Using an external cache server like Redis means your app has to make network calls to do cache lookups, so it has performance overhead. On the other hand, if your app is replicated across multiple machines, a shared, external cache is more effective than a per-app, in-memory cache. The external cache is more scalable. + +### Response time + +When designing systems, it’s helpful to start by thinking about latency or response time requirements, even if we have to make some up and revise them later. Adding more RAM, more caches, more machines or more disk can solve a lot of problems, but latency problems tend to be fundamental to the system design. For example, suppose you’re designing an online game, and you want latencies of under 100ms for all users. Straight away, the speed of light limit means you can’t have one central server supporting a global game, regardless of whatever algorithms or hardware you throw at the problem. + +There’s another reason it’s useful to focus on server response time in practice. If you have a simple, single-function website, such as a mortgage calculator, then the response time can be estimated based on technical things like the hardware specs and code quality. But that’s not how typical online services are built. The online service industry tends to emphasise adding more and more features for less development cost. That means [webpages tend to expand in complexity][2] using the easiest code possible, and only get optimised when they become too slow and users churn. Even the typical mortgage calculator site will end up bloated with advertising and tracking functionality. So the response time of a website in my day job depends mostly on the client’s budget and priorities, not on technical factors, regardless of whether it’s an ecommerce site or a cutting-edge data application. + +### Looking at a single worker + +Okay, so now imagine a simple web app that gets about one request an hour that takes about 5s to process (ignoring static assets because they’re not the bottleneck). That app has an obvious performance problem because many users will give up before 5s. But there’s no scaling problem because the server will practically never hit capacity limits and drop requests. Even if traffic rises, the performance problem is the bottleneck that takes priority over any hypothetical scalability problems. + +That’s a simple insight that we can take further. Lets say we target 100ms per request, and our simple web app processes requests one at a time serially (i.e., no scaling). With 86,400 seconds in a day, a naïve calculation says we can handle 86,400 / 0.1 = 864,000 requests per day before we have scaling problems. + +Of course, the real world isn’t that simple. + +First, there will be slower and faster requests, and [requests that arrive at random won’t balance themselves nicely][3]. They’ll come in clusters that fill up queues, and the backlog will cause large spikes in response time. (There’s a handy rule that says [if you want to keep response time under control, you should target about 80% usage of theoretical total capacity][4].) + +Then there’s diurnal variation. Some local websites get nearly all of their traffic during business hours, or about a third of the day. Even a very global website can easily have 2-3 times more traffic at peak than at trough because populations aren’t distributed evenly around the world (a lot of internet users live in East Asia and North/South America, but not in the huge Pacific ocean). The actual ratio depends on many factors that are hard to predict. + +But even if we can’t easily get exact capacity estimates, this simple model is the justification for splitting websites into three traffic levels. + +### The three traffic levels + +The first level is for sites that get well under 100k dynamic requests a day. Most websites are at this level, and a lot will stay that way while being totally useful and successful. They can also pose complex technical challenges, both for performance and functionality, and a lot of my work is on sites this size. But they don’t have true scalability problems (as opposed to problems that can be solved purely by improving performance). + +If a website gets bigger, it can get into the “growing pains” level, which is roughly around 100k-1M dynamic requests a day. This is where scalability problems start to appear. Often the site is at least a bit scalable (thanks to, e.g., async or multithreaded programming), but Web developers scaling a site through this level keep discovering new surprise pain points. Things that a smaller site can get away with start turning into real problems in this level. Some of the biggest challenges are actually sociotechnical, with the team that builds and manages the site needing to learn to think about it in new ways. + +The next level is after leaving the 1M dynamic requests a day boundary behind. I think of sites at this level as being high traffic. Let me stress that that’s a technical line, not a value judgment or ego statement. The world’s biggest websites are orders of magnitude bigger than that, while most of the world’s useful websites are smaller. But the line matters because you simply can’t run a site at that scale without treating it like a high traffic site. You can get away with it at low traffic levels, you can fumble through it at the growing pains level, but at high traffic levels you just have to work differently. Coincidentally, it’s around this traffic level where it makes more sense to talk about requests per second than requests per day. + +By the way, don’t focus too much on the exact traffic levels above. They’re very rough and honestly I picked them because they’re convenient round numbers that happen to be reasonable for typical websites. The real values depend on the target response time and all the other factors, of course. What I’m trying to explain is 1) that these levels exist, 2) why they exist and 3) what to expect if you’re trying to grow an online service. + +### Going to more levels + +What happens with sites that get even bigger? Once the problems at one set of bottlenecks are fixed, the site should just scale until it hits a new set of bottlenecks, either because the application has changed significantly, or just because of a very large increase in traffic. For example, once the application servers are scalable, the next scaling bottleneck could be database reads, followed by database writes. However, the basic ideas are the same, just applied to a different part of the system. + +Working on a very high-traffic site can be a lot less “exciting” than working on a plain high-traffic site, simply because most major problems need to be solved to get to very high traffic levels in the first place. + +### Scaling when you don’t have scaling problems + +Some developers try to make online services scalable long before they have any scalability problems on the horizon, usually by adding exotic databases or broker servers or something. In particular, startup founders are often especially concerned that their technical assets might not scale to meet their business ambitions. It’s understandable, but it’s a dangerous trap for a couple of reasons. + +One is that Paul Graham’s classic [Do Things That Don’t Scale][5] essay applies to your technology stack, too. You can’t beat bigger companies with scale, but your competitive advantage is that you can choose to _not_ solve the scalability problems that bigger companies are forced to with every step they take. That’s what makes smaller companies agile, and a startup that worries too much about scalability is just a big enterprise without the big to back it up. + +The other problem is that premature scalability solutions can easily backfire. If you don’t have real scalability problems to test your solutions against, it’s hard to be sure you’re correctly solving a real problem. In fact, rapidly growing services tend to change requirements rapidly, too, so the risk of a scalability “solution” turning into technical debt is high. If you keep trying to add scalability to a part of the system that’s already scalable enough, chances are the next scaling bottleneck will appear somewhere else, anyway. + +Architectures that err on the side of too simple are easier to scale in the long run than architectures that are too complex. + +To be more concrete, I personally can’t think of a low-traffic online service I’ve worked on that couldn’t have been implemented cleanly enough using a simple, monolithic web app (in whatever popular language) in front of [a boring relational database][6], maybe with a search index like Xapian or Elasticsearch. [Many major websites aren’t much different from that.][7] It’s not the only valid architecture, but it’s a tried-and-tested one. + +Having said all that, sometimes low-traffic sites need things that are sometimes sold as scalability solutions. For example, replicating an app behind a load balancer can help you deploy whenever you want without downtime. One fintech service I worked on split credit card code into its own service, making PCI DSS compliance simpler. In all these cases there’s a clear problem other than scalability that’s being solved, and that’s what avoids overengineering. + +I often wish I had a systematic way to just figure out all the technical requirements for an online service in my head. But the real world is complicated and messy, and sometimes the only practical way to be sure is to experiment. However, every piece of software starts with ideas, and this is how I think about scalability for online service ideas during the early design phase. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2020/04/21/what_is_high_traffic.html + +作者:[Simon Arneaud][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://theartofmachinery.com/2016/07/30/server_caching_architectures.html +[2]: https://mobiforge.com/research-analysis/the-web-is-doom +[3]: https://theartofmachinery.com/2020/01/27/systems_programming_probability.html +[4]: https://www.johndcook.com/blog/2009/01/30/server-utilization-joel-on-queuing/ +[5]: http://www.paulgraham.com/ds.html +[6]: https://theartofmachinery.com/2017/10/28/rdbs_considered_useful.html +[7]: https://nickcraver.com/blog/2016/02/17/stack-overflow-the-architecture-2016-edition/ From 7cf8e428ddf974846be3582184e567c36930ea59 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 25 May 2020 22:35:01 +0800 Subject: [PATCH 0833/1809] PRF @geekpi --- ...t 5- Here-s How to Install it on Ubuntu.md | 57 +++++++++---------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/translated/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md b/translated/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md index 8493ff968c..aa75824e7c 100644 --- a/translated/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md +++ b/translated/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md @@ -1,20 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Audacious 4.0 Released With Qt 5: Here’s How to Install it on Ubuntu) [#]: via: (https://itsfoss.com/audacious-4-release/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -使用 Qt 5 的 Audacious 4.0 发布:以下是在 Ubuntu 上安装它的方法 +如何安装使用 Qt 5 的音频播放器 Audacious 4.0 ====== -[Audacious][1]是用于包括 Linux 在内的多个平台的开源音频播放器。继上次发布主版本将近 2 年后,Audacious 4.0 带来了一些重大变化。 +[Audacious][1] 是一个开源音频播放器,可用于包括 Linux 在内的多个平台。继上次发布主版本将近 2 年后,Audacious 4.0 带来了一些重大变化。 -最新版本的 Audacious 4.0 默认带 [Qt 5][2] UI。你仍然可以从源中使用旧的 GTK2 UI,但是,新功能仅会添加到 Qt UI 中。 +最新版本的 Audacious 4.0 默认带 [Qt 5][2] 用户界面。你仍然可以和以前一样使用旧的 GTK2 UI,但是,新功能仅会添加到 Qt UI 中。 -让我们看下发生了什么变化以及如何在 Linux 系统上安装最新的 Audacious。 +让我们看下发生了什么变化,以及如何在 Linux 系统上安装最新的 Audacious。 ### Audacious 4.0 关键变化和功能 @@ -22,25 +22,24 @@ 当然,主要的变化是默认使用 Qt 5 UI。除此之外,他们的[官方公告][4]中提到了许多改进和功能补充,它们是: - * 单击播放列表列头可对播放列表进行排序 -  * 拖动播放列表列头会更改列顺序 -  * 应用中的音量和时间步长设置 -  * 隐藏播放列表标签的新选项 -  * 按路径对播放列表排序现在将文件夹排序在文件后面 -  * 实现了额外的 MPRIS 调用,以与 KDE 5.16+ 兼容 -  * 新的基于 OpenMPT 的跟踪器模块插件 -  * 新的 VU Meter 可视化插件 -  * 添加了使用 SOCKS 网络代理的选项 -  * Song Change 插件现在可在 Windows 上使用 -  * 新的“下一张专辑”和“上一张专辑”命令 -  * Qt UI 中的标签编辑器现在可以一次编辑多个文件 -  * 为 Qt UI 实现均衡器预设窗口 -  * 歌词插件获得了在本地保存和加载歌词的功能 -  * 模糊范围和频谱分析器可视化已移植到 Qt -  * MIDI 插件 SoundFont 选择已移植到 Qt -  * JACK 输出插件获得了一些新选项 -  * 添加了无限循环 PSF 文件的选项 - +* 单击播放列表列头可对播放列表进行排序 +* 拖动播放列表列头会更改列顺序 +* 应用中的音量和时间步长设置 +* 隐藏播放列表标签的新选项 +* 按路径对播放列表排序,现在将文件夹排序在文件后面 +* 实现了额外的 MPRIS 调用,以与 KDE 5.16+ 兼容 +* 新的基于 OpenMPT 的跟踪器模块插件 +* 新的 VU Meter 可视化插件 +* 添加了使用 SOCKS 网络代理的选项 +* 换歌插件现在可在 Windows 上使用 +* 新的“下一张专辑”和“上一张专辑”命令 +* Qt UI 中的标签编辑器现在可以一次编辑多个文件 +* 为 Qt UI 实现均衡器预设窗口 +* 歌词插件获得了在本地保存和加载歌词的能力 +* 模糊范围和频谱分析器可视化已移植到 Qt +* MIDI 插件 “SoundFont 选择”已移植到 Qt +* JACK 输出插件获得了一些新选项 +* 添加了无限循环 PSF 文件的选项 如果你以前不了解它,你可以轻松安装它,并使用均衡器和 [LADSP][5] 效果器来调整音乐体验。 @@ -48,15 +47,15 @@ ### 如何在 Ubuntu 上安装 Audacious 4.0 -值得注意的是,[UbuntuHandbook][8] 提供了[非官方 PPA][7]。你可以按照以下说明在 Ubuntu 16.04、18.04、19.10 和 20.04 上进行安装。 +值得注意的是,[非官方 PPA][7] 是由 [UbuntuHandbook][8] 提供的。你可以按照以下说明在 Ubuntu 16.04、18.04、19.10 和 20.04 上进行安装。 -1\. 首先,你必须在终端中输入以下命令将 PPA 添加到系统中: +1、首先,你必须在终端中输入以下命令将 PPA 添加到系统中: ``` sudo add-apt-repository ppa:ubuntuhandbook1/apps ``` -2\. 接下来,你需要从仓库/源码中更新/刷新软件包信息,然后继续安装该应用。方法如下: +2、接下来,你需要从仓库中更新(刷新)软件包信息,然后继续安装该应用。方法如下: ``` sudo apt update @@ -72,7 +71,7 @@ sudo apt remove --autoremove audacious audacious-plugins 你也可以在它的 GitHub 页面上查看有关源码的更多信息,并根据需要在其他 Linux 发行版上进行安装。 -[Audacious Source Code][10] +- [Audacious 源代码][10] ### 总结 @@ -87,7 +86,7 @@ via: https://itsfoss.com/audacious-4-release/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From af5c9374aa7c5d837699d051177d6a25ca44d5eb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 25 May 2020 22:35:33 +0800 Subject: [PATCH 0834/1809] PUB @geekpi https://linux.cn/article-12250-1.html --- ... Released With Qt 5- Here-s How to Install it on Ubuntu.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md (98%) diff --git a/translated/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md b/published/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md similarity index 98% rename from translated/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md rename to published/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md index aa75824e7c..8b46842802 100644 --- a/translated/tech/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md +++ b/published/20200324 Audacious 4.0 Released With Qt 5- Here-s How to Install it on Ubuntu.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12250-1.html) [#]: subject: (Audacious 4.0 Released With Qt 5: Here’s How to Install it on Ubuntu) [#]: via: (https://itsfoss.com/audacious-4-release/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 19461ecc009ae4cb371f3150926d0638bef32984 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 26 May 2020 01:05:24 +0800 Subject: [PATCH 0835/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200526=20Free?= =?UTF-8?q?FileSync:=20Open=20Source=20File=20Synchronization=20Tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200526 FreeFileSync- Open Source File Synchronization Tool.md --- ...- Open Source File Synchronization Tool.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20200526 FreeFileSync- Open Source File Synchronization Tool.md diff --git a/sources/tech/20200526 FreeFileSync- Open Source File Synchronization Tool.md b/sources/tech/20200526 FreeFileSync- Open Source File Synchronization Tool.md new file mode 100644 index 0000000000..549751e002 --- /dev/null +++ b/sources/tech/20200526 FreeFileSync- Open Source File Synchronization Tool.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (FreeFileSync: Open Source File Synchronization Tool) +[#]: via: (https://itsfoss.com/freefilesync/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +FreeFileSync: Open Source File Synchronization Tool +====== + +_**Brief: FreeFileSync is an open-source folder comparison and sync tool with which you can back up your data to an external disk, a cloud service like Google Drive or any other storage path.**_ + +### FreeFileSync: A Free & Open-Source Tool To Sync Files + +![][1] + +[FreeFileSync][2] is an impressive open-source tool that can help you back up your data to a different location. + +This different location can be an external USB disk, Google Drive or to any of your cloud storage locations using **SFTP or FTP** connections. + +You might have read our tutorial on [how to use Google Drive on Linux][3] before. Unfortunately, there’s no proper FOSS solution to use Google Drive natively on Linux. There is [Insync][4] but it is a premium, non open source software. + +FreeFileSync can be used to sync files with your Google Drive account. In fact, I’m using it to sync my files to Google Drive and to a separate hard drive. + +### Features of FreeFileSync + +![][5] + +Even though the UI of FreeFileSync might look old school — it offers a ton of useful features for average users and advanced users as well. + +I’ll highlight all the features I can here: + + * Cross-platform support (Windows, macOS & Linux) + * Compare folders before synchronizing + * Supports Google Drive, [SFTP][6], and FTP connections + * Offers the ability to sync your files on a different storage path (or an external storage device) + * Multiple synchronization options available (Update files to the target from source or Mirror the files between target and source) + * Two-way synchronization supported (changes will be synced if there’s any modification on the target folder or the source folder) + * Version control available for advanced users + * Real-Time Sync option available + * Ability to schedule batch jobs + * Get notified via email when sync completes (paid) + * Portable edition (paid) + * Parallel file copy (paid) + + + +So, if you take a look at the features it offers, it’s not just any ordinary sync tool but offers so much more for free. + +Also, to give you an idea, you can also tweak how to compare the files before syncing them. For instance, you can compare the file content / file time or simply compare the file size of both source and target folder. + +![][7] + +You also get numerous synchronization options to mirror or update your data. Here’s how it looks like: + +![][8] + +However, it does give you the option to opt for a donation key which unlocks some special features like the ability to notify you via email when the sync completes and so on. + +Here’s what different between the free and paid version: + +![][9] + +So, most of the essential features is available for free. The premium features are mostly for advanced users and of course, if you want to support them (please do if you find it useful). + +Also, do note that the donation edition can be used by a single user on up to 3 devices. So, that is definitely not bad! + +### Installing FreeFileSync on Linux + +You can simply head on to its [official download page][10] and grab the **tar.gz** file for Linux. If you like you can download the source as well. + +![][11] + +Next, you just need to extract the archive and run the executable file to get started (as shown in the image above) + +[Download FreeFileSync][2] + +### How To Get Started With FreeFileSync? + +While I haven’t tried successfully creating an automatic sync job, it is pretty easy to use. + +The [official documentation][12] should be more than enough to get what you want using the software. + +But, just to give you a head start, here are a few things that you should keep in mind. + +![][13] + +As you can see in the screenshot above, you just have to select a source folder and the target folder to sync. You can choose a local folder or a cloud storage location. + +Once you do that, you need to tweak the type of folder comparison you want to do (usually the file time & size) for the synchronization process and on the right-side, you get to tweak the type of sync that you want to perform. + +#### Types of synchronization in FreeFileSync + +When you select **“Update” method for sync**, it simply copies your new data from the source folder to the target folder. So, even if you delete something from your source folder, it won’t get deleted on your target folder. + +In case you want the target folder to have the same file copies of your same folder, you can choose the **“Mirror”** **synchronization method**. So, here, if you delete something from your source, it gets deleted from your target folder as well. + +There’s also a **“Two-way” sync method** which detects changes on both source and target folder (instead of monitoring just the source folder). So, if you make any changes on the source/target folder, the modification will be synchronized. + +For more advanced usage, I suggest you to refer the [documentation][12] available. + +### Wrapping Up + +Another [open source file synchronization tool is Syncthing][14] that you might want to look at. + +FreeFileSync is a pretty underrated folder comparison and sync tool available for Linux users who utilize Google Drive, SFTP, or FTP connections along with separate storage locations for backup. + +And, all of that — with cross-platform support for Windows, macOS, and Linux available for free. + +Isn’t that exciting? Let me know your thoughts on FreeFileSync in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/freefilesync/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/free-file-sync.jpg?ssl=1 +[2]: https://freefilesync.org/ +[3]: https://itsfoss.com/use-google-drive-linux/ +[4]: https://itsfoss.com/recommends/insync/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/FreeFileSync.jpg?ssl=1 +[6]: https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/freefilesync-comparison.png?ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/freefilesync-synchronization.png?ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/free-file-sync-donation-edition.jpg?ssl=1 +[10]: https://freefilesync.org/download.php +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/freefilesync-run.jpg?ssl=1 +[12]: https://freefilesync.org/manual.php +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/freefilesync-tips.jpg?ssl=1 +[14]: https://itsfoss.com/syncthing/ From 82b5ac6c3d17fa81ced49ff0dde7bd13578a957e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 26 May 2020 03:50:17 +0800 Subject: [PATCH 0836/1809] Revert "translating" This reverts commit afec8c0d69883d1c4e836eb4e7df909e31c8c5c6. --- sources/tech/20180710 Building a Messenger App- Messages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20180710 Building a Messenger App- Messages.md b/sources/tech/20180710 Building a Messenger App- Messages.md index 577d7324a3..55e596df64 100644 --- a/sources/tech/20180710 Building a Messenger App- Messages.md +++ b/sources/tech/20180710 Building a Messenger App- Messages.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (Zioyi) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c65fb8680e78f9d72c2fa8fcd170543c816aafe6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 26 May 2020 08:41:57 +0800 Subject: [PATCH 0837/1809] translated --- ...nguages you should (probably) never use.md | 180 ------------------ ...nguages you should (probably) never use.md | 179 +++++++++++++++++ 2 files changed, 179 insertions(+), 180 deletions(-) delete mode 100644 sources/tech/20200401 3 Python templating languages you should (probably) never use.md create mode 100644 translated/tech/20200401 3 Python templating languages you should (probably) never use.md diff --git a/sources/tech/20200401 3 Python templating languages you should (probably) never use.md b/sources/tech/20200401 3 Python templating languages you should (probably) never use.md deleted file mode 100644 index 7d73216ea5..0000000000 --- a/sources/tech/20200401 3 Python templating languages you should (probably) never use.md +++ /dev/null @@ -1,180 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 Python templating languages you should (probably) never use) -[#]: via: (https://opensource.com/article/20/4/python-templating-languages) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -3 Python templating languages you should (probably) never use -====== -Python has accumulated a lot of templating languages, including these -three that are perfect for April Fools' Day. -![Hands on a keyboard with a Python book ][1] - -When reaching for a templating language for writing a [Python][2] web application, there are an abundance of robust solutions.  - -There are [Jinja2][3], [Genshi, and Mako][4]. There are even solutions like [Chameleon][5], which are a bit older, but still recommended by the [Pyramid][6] framework. - -Python has been around for a long time. In that time, deep in the corners of its system, it has accumulated some almost forgotten templating languages that are well worth poking at. - -Like cute koalas on top of a eucalyptus tree, happy in their ecological niche, and sometimes as dangerous to work with, these are the templating languages few have heard of—and even fewer should use. - -### 3\. string.Template - -Have you ever wondered, "How can I get a templating language with no features, but also without needing to **pip install** anything?" The Python standard library has you covered. While it does no looping or conditionals, the **string.Template** class is a minimal templating language. - -Using it is simplicity itself. - - -``` ->>> import string ->>> greeting = string.Template("Hello, $name, good $time!") ->>> greeting.substitute(name="OpenSource.com", time="afternoon") -'Hello, OpenSource.com, good afternoon!' -``` - -### 2\. twisted.web.template - -What gift do you give the library that has everything? - -Not a templating language, certainly, because it already has one. Nestled in **twisted.web.template** are two templating languages. One is XML-based and has a [great tutorial][7]. - -But there is another one, one that is based on using Python as a domain-specific language to produce HTML documents. - -It is based on two primitives: **twisted.web.template.tags**, which contains tag objects, and **twisted.web.template.flattenString**, which will render them. Because it is part of Twisted, it has built-in support for rendering async results efficiently. - -This example will render a silly little page: - - -``` -async def render(reactor): -    my_title = "A Fun page" -    things = ["one", "two", "red", "blue"] -    template = tags.html( -            tags.head( -                tags.title(my_title), -            ), -            tags.body( -                tags.h1(my_title), -                tags.ul( -                    [tags.li(thing) for thing in things], -                ), -                tags.p( -                    task.deferLater(reactor, 3, lambda: "Hello "), -                    task.deferLater(reactor, 3, lambda: "world!"), -                ) -            ) -    ) -    res = await flattenString(None, template) -    res = res.decode('utf-8') -    with open("hello.html", 'w') as fpout: -        fpout.write(res) -``` - -The template is regular Python code that uses the **tags.<TAGNAME>** to indicate the hierarchy. It natively supports strings as renderables, so any string is fine. - -To render it, the only things you need to do are to add a preamble: - - -``` -from twisted.internet import task, defer -from twisted.web.template import tags, flattenString - -def main(reactor): -    return defer.ensureDeferred(render(reactor)) -``` - -and an epilogue to run the whole thing: - - -``` -`task.react(main)` -``` - -In just _three_ seconds (and not _six_), it will render a nice HTML page. In real-life, those **deferLater**s can be, for example, calls to an HTTP API: they will be sent and processed in parallel, without having to put in any effort. I recommend you instead read about a [far better use for Twisted][8]. But still, this works. - -### 1\. Quixote - -You will say, "But Python is not _optimized_ for being an HTML-spouting domain-specific language." What if, instead of settling for Python-as-is, there was a language that [transpiles][9] to Python, but is better at defining templates? A "Python template language" (PTL), if you will. - -Writing your own language is sometimes said to be a dreamer's project for someone who tilts at windmills. Irony was not lost on the creators of Quixote (available on [PyPI][10]) when they decided to do exactly that. - -The following will render an equivalent template to the one done with Twisted above. _Warning: the following is not valid Python_: - - -``` -import time - -def render [html] (): -    my_title = "A Fun page" -    things = ["one", "two", "red", "blue"] -    "<html><head><title>" -    my_title -    "</head></title><body><h1>" -    my_title -    "</h1>" -    "<ul>" -    for thing in things: -        "<li>" -        thing -        "</li>" -    "<p>" -    time.sleep(3) -    (lambda: "Hello ")() -    time.sleep(3) -    (lambda: "world!")() -    "</p>" -    "</body></html>" - -def write(): -    result = render() -    with open("hello.html", 'w') as fpout: -        fpout.write(str(result)) -``` - -However, if you put it in a file called **template.ptl**, you can make it importable to Quixote and write out the rendered version of the template: - - -``` ->>> from quixote import enable_ptl ->>> enable_ptl() ->>> import template ->>> template.write() -``` - -Quixote installs an import hook that will cause PTL files to transpile into Python. Note that this render takes _six_ seconds, not _three_; you no longer gain free asynchronicity. - -### So many templates in Python - -Python has a long and winding history of libraries, some of which can achieve the same outcomes in more or less similar ways (for example, Python [package management][11]). - -On this April Fools' Day, I hope you enjoyed exploring three ways you _can_ create templates in Python. Instead, I recommend starting with [one of these libraries][4] for ways you _should_ template. - -Do you have another esoteric way to template? Share it in the comments below! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/python-templating-languages - -作者:[Moshe Zadka][a] -选题:[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/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) -[2]: https://opensource.com/resources/python -[3]: https://opensource.com/article/20/2/jinja2-cheat-sheet -[4]: https://opensource.com/resources/python/template-libraries -[5]: https://chameleon.readthedocs.io/en/latest/ -[6]: https://opensource.com/article/18/5/pyramid-framework -[7]: https://twistedmatrix.com/documents/13.1.0/web/howto/twisted-templates.html -[8]: https://opensource.com/article/20/3/treq-python -[9]: https://en.wikipedia.org/wiki/Source-to-source_compiler -[10]: https://pypi.org/project/Quixote/ -[11]: https://opensource.com/article/19/4/managing-python-packages diff --git a/translated/tech/20200401 3 Python templating languages you should (probably) never use.md b/translated/tech/20200401 3 Python templating languages you should (probably) never use.md new file mode 100644 index 0000000000..b28d03f589 --- /dev/null +++ b/translated/tech/20200401 3 Python templating languages you should (probably) never use.md @@ -0,0 +1,179 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 Python templating languages you should (probably) never use) +[#]: via: (https://opensource.com/article/20/4/python-templating-languages) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +你应该(或许)没使用过的 3 种 Python 模板语言 +====== +Python 积累了许多模板语言,包括这 3 个适合在愚人节介绍的模板语言 +![Hands on a keyboard with a Python book ][1] + +当使用一种模板语言来编写 [Python][2] Web 应用时,它有很多健壮的解决方案。 + +有 [Jinja2][3]、[Genshi 和 Mako][4]。甚至还有 [Chameleon][5] 之类的解决方案,虽然有些陈旧,但仍被 [Pyramid][6] 框架推荐。 + +Python 已经存在了很长时间。此时,在系统的深处,它积累了一些几乎被遗忘的模板语言,它们都是值得一试的。 + +就像桉树顶上的可爱考拉一样,在它们的生态位中不错,有时用它们工作会危险,这些都是很少有人听说过的模板语言,使用过的应该更少。 + +### 3\. string.Template + +你是否曾经想过:“如何获得一种没有任何特性但同时也不需要 **pip install** 的模板语言?” Python 标准库已经涵盖。虽然没有循环和条件,但 **string.Template** 类是一种最小的模板语言。 + +使用它很简单。 + + +``` +>>> import string +>>> greeting = string.Template("Hello, $name, good $time!") +>>> greeting.substitute(name="OpenSource.com", time="afternoon") +'Hello, OpenSource.com, good afternoon!' +``` + +### 2\. twisted.web.template + +你会给一个有所有东西的库什么礼物? + +当然,它不是一种模板语言,因为已经有一种。 嵌套在 twisted.web.template 中的是两种模板语言。 一种是基于 XML 的,并有一个[很棒的文档][7]。 + +但是还有另一种,一种基于使用 Python 作为领域特定语言来生成 HTML 文档。 + +它基于两个原语:包含标签对象的 **twisted.web.template.tags** 和渲染它们的 **twisted.web.template.flattenString**。由于它是 Twisted 的一部分,因此它内置支持高效异步渲染。 + +此例将渲染一个小页面: + + +``` +async def render(reactor): +    my_title = "A Fun page" +    things = ["one", "two", "red", "blue"] +    template = tags.html( +            tags.head( +                tags.title(my_title), +            ), +            tags.body( +                tags.h1(my_title), +                tags.ul( +                    [tags.li(thing) for thing in things], +                ), +                tags.p( +                    task.deferLater(reactor, 3, lambda: "Hello "), +                    task.deferLater(reactor, 3, lambda: "world!"), +                ) +            ) +    ) +    res = await flattenString(None, template) +    res = res.decode('utf-8') +    with open("hello.html", 'w') as fpout: +        fpout.write(res) +``` + +该模板是使用 **tags.<TAGNAME>** 来指示层次结构的常规 Python 代码。原生支持渲染字符串,因此任何字符串都正常。 + +要渲染它,你需要做的是添加调用: + + +``` +from twisted.internet import task, defer +from twisted.web.template import tags, flattenString + +def main(reactor): +    return defer.ensureDeferred(render(reactor)) +``` + +最后写上: + + +``` +`task.react(main)` +``` + +只需 _3_ 秒(而不是 _6_ 秒),它将渲染一个不错的 HTML 页面。在实际中,这些 **deferLater** 可以是对 HTTP API 的调用:它们将并行发送和处理,而无需花费精力。我建议你阅读关于[更好地使用 Twisted][8]。但是,这仍可以工作。 + +### 1\. Quixote + +你会说:“但是 Python 并不是针对 HTML 输入而优化的领域特定语言。” 如果有一种语言可以[转化][9]到 Python,但是更适合定义模板,而不是像 Python 那样按原样解决呢? 如果可以的话,请使用“Python 模板语言”(PTL)。 + +对于攻击假想敌的人来说,写自己的语言有时被认为是梦想家的项目。当 Quixote (可用于 [PyPI][10])的创造者决定这样做时,并没有受此影响。 + +以下将渲染与上面 Twisted 相同的模板。 _警告:以下是无效的 Python_: + + +``` +import time + +def render [html] (): +    my_title = "A Fun page" +    things = ["one", "two", "red", "blue"] +    "<html><head><title>" +    my_title +    "</head></title><body><h1>" +    my_title +    "</h1>" +    "<ul>" +    for thing in things: +        "<li>" +        thing +        "</li>" +    "<p>" +    time.sleep(3) +    (lambda: "Hello ")() +    time.sleep(3) +    (lambda: "world!")() +    "</p>" +    "</body></html>" + +def write(): +    result = render() +    with open("hello.html", 'w') as fpout: +        fpout.write(str(result)) +``` + +但是,如果将它放到 **template.ptl** 文件中,那么可以将其导入到 Quixote 并写出可以渲染模板的版本: + + +``` +>>> from quixote import enable_ptl +>>> enable_ptl() +>>> import template +>>> template.write() +``` + +Quixote 安装一个导入钩子,它会将 PTL 文件转换为 Python。请注意,此渲染需要 _6_ 秒,而不是 _3_ 秒。你不再能自由异步。 + +### Python 中的模板太多 + +Python 的库历史悠久且曲折,其中一些库可以或多或少以类似的方式实现相同的结果(例如,Python [包管理][11])。 + +在这个愚人节,我希望你喜欢探索这三种_可以_用 Python 创建模板的方式。另外,我建议从[这三个库之一][4]开始了解。 + +你是否有另一种深奥的模板方法?请在下面的评论中分享! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/python-templating-languages + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) +[2]: https://opensource.com/resources/python +[3]: https://opensource.com/article/20/2/jinja2-cheat-sheet +[4]: https://opensource.com/resources/python/template-libraries +[5]: https://chameleon.readthedocs.io/en/latest/ +[6]: https://opensource.com/article/18/5/pyramid-framework +[7]: https://twistedmatrix.com/documents/13.1.0/web/howto/twisted-templates.html +[8]: https://opensource.com/article/20/3/treq-python +[9]: https://en.wikipedia.org/wiki/Source-to-source_compiler +[10]: https://pypi.org/project/Quixote/ +[11]: https://opensource.com/article/19/4/managing-python-packages From be40624291dd6d121f37a0ad503a3eeb43aad3b3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 26 May 2020 08:46:49 +0800 Subject: [PATCH 0838/1809] translating --- .../20200520 How to configure your router using VTY shell.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200520 How to configure your router using VTY shell.md b/sources/tech/20200520 How to configure your router using VTY shell.md index 29a427583a..36e9f951b8 100644 --- a/sources/tech/20200520 How to configure your router using VTY shell.md +++ b/sources/tech/20200520 How to configure your router using VTY shell.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From eaf17ac0bf333797469a322cb0e86b856fc359a0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 May 2020 10:19:40 +0800 Subject: [PATCH 0839/1809] PUB @wxy https://linux.cn/article-12251-1.html --- ...20200429 Why strace doesn-t work in Docker.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename {translated/tech => published}/20200429 Why strace doesn-t work in Docker.md (86%) diff --git a/translated/tech/20200429 Why strace doesn-t work in Docker.md b/published/20200429 Why strace doesn-t work in Docker.md similarity index 86% rename from translated/tech/20200429 Why strace doesn-t work in Docker.md rename to published/20200429 Why strace doesn-t work in Docker.md index dfd17d0fca..57e5a5b42e 100644 --- a/translated/tech/20200429 Why strace doesn-t work in Docker.md +++ b/published/20200429 Why strace doesn-t work in Docker.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12251-1.html) [#]: subject: (Why strace doesn't work in Docker) [#]: via: (https://jvns.ca/blog/2020/04/29/why-strace-doesnt-work-in-docker/) [#]: author: (Julia Evans https://jvns.ca/) @@ -10,7 +10,7 @@ 为什么 strace 在 Docker 中不起作用? ====== -在编辑“容器如何工作”杂志的能力页面时,我想试着解释一下为什么 `strace` 在 Docker 容器中无法工作。 +在编辑“容器如何工作”爱好者杂志的能力页面时,我想试着解释一下为什么 `strace` 在 Docker 容器中无法工作。 这里的问题是 —— 如果我在笔记本上的 Docker 容器中运行 `strace`,就会出现这种情况: @@ -27,7 +27,7 @@ strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash ``` -但我对如何修复它不感兴趣,我想知道为什么会出现这种情况。那么,为什么 `strace` 不能工作,为什么`--cap-add=SYS_PTRACE` 可以解决这个问题? +但我对如何修复它不感兴趣,我想知道为什么会出现这种情况。为什么 `strace` 不能工作,为什么`--cap-add=SYS_PTRACE` 可以解决这个问题? ### 假设 1:容器进程缺少 `CAP_SYS_PTRACE` 能力。 @@ -49,13 +49,13 @@ CAP_SYS_PTRACE * Trace arbitrary processes using ptrace(2); ``` -所以,`CAP_SYS_PTRACE` 的作用是让你像 root 一样,可以对任何用户拥有的**任意**进程进行 `ptrace` 。你不需要用它来只是对一个由你的用户拥有的普通进程进行 `ptrace ` 。 +所以,`CAP_SYS_PTRACE` 的作用是让你像 root 一样,可以对任何用户拥有的**任意**进程进行 `ptrace`。你不需要用它来对一个只是由你的用户拥有的普通进程进行 `ptrace` 。 -我用第三种方法测试了一下 —— 我用 `docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash` 运行了一个 Docker 容器,去掉了 `CAP_SYS_PTRACE` 能力,但我仍然可以跟踪进程,虽然我已经没有这个能力了。什么?为什么? +我用第三种方法测试了一下(LCTT 译注:此处可能原文有误) —— 我用 `docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash` 运行了一个 Docker 容器,去掉了 `CAP_SYS_PTRACE` 能力,但我仍然可以跟踪进程,虽然我已经没有这个能力了。什么?为什么?! ### 假设 2:关于用户命名空间的事情? -我的下一个(没有那么充分的依据的)假设是“嗯,也许这个过程是在不同的用户命名空间里,而 `strace` 不能工作,因为某种原因而行不通?”这个问题其实并不连贯,但这是我观察时想到的。 +我的下一个(没有那么充分的依据的)假设是“嗯,也许这个过程是在不同的用户命名空间里,而 `strace` 不能工作,因为某种原因而行不通?”这个问题其实并不相关,但这是我观察时想到的。 容器进程是否在不同的用户命名空间中?嗯,在容器中: @@ -111,7 +111,7 @@ execve("/bin/ls", ["ls"], 0x7ffc69a65580 /* 8 vars */) = 0 Go 语言的好处是,因为依赖关系通常是在一个 Go 仓库里,你可以通过 `grep` 来找出做某件事的代码在哪里。所以我克隆了 `github.com/moby/moby`,然后对一些东西进行 `grep`,比如 `rg CAP_SYS_PTRACE`。 -我认为是这样的。在 `containerd` 的 seccomp 实现中,在 [contrib/seccomp/seccomp/seccomp_default.go][3] 中,有一堆代码确保如果一个进程有一个能力,那么它也会(通过 seccomp 规则)获得访问权限,以使用与该能力相关的系统调用。 +我认为是这样的。在 `containerd` 的 seccomp 实现中,在 [contrib/seccomp/seccomp/seccomp_default.go][3] 中,有一堆代码来确保如果一个进程有一个能力,那么它也会(通过 seccomp 规则)获得访问权限,以使用与该能力相关的系统调用。 ``` case "CAP_SYS_PTRACE": From 8e8d27079d588e349b3966d207c2ef0a02a18922 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 May 2020 11:02:36 +0800 Subject: [PATCH 0840/1809] PRF @geekpi --- ...nguages you should (probably) never use.md | 154 +++++++++--------- 1 file changed, 76 insertions(+), 78 deletions(-) diff --git a/translated/tech/20200401 3 Python templating languages you should (probably) never use.md b/translated/tech/20200401 3 Python templating languages you should (probably) never use.md index b28d03f589..9e9cfd2485 100644 --- a/translated/tech/20200401 3 Python templating languages you should (probably) never use.md +++ b/translated/tech/20200401 3 Python templating languages you should (probably) never use.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (3 Python templating languages you should (probably) never use) @@ -9,74 +9,73 @@ 你应该(或许)没使用过的 3 种 Python 模板语言 ====== -Python 积累了许多模板语言,包括这 3 个适合在愚人节介绍的模板语言 -![Hands on a keyboard with a Python book ][1] -当使用一种模板语言来编写 [Python][2] Web 应用时,它有很多健壮的解决方案。 +> 包括这 3 个模板语言在内,Python 积累了许多模板语言。 + +![](https://img.linux.net.cn/data/attachment/album/202005/26/110220lxie9osmd592m5ee.jpg) + +当需要使用模板语言来编写 [Python][2] Web 应用时,有很多健壮的解决方案。 有 [Jinja2][3]、[Genshi 和 Mako][4]。甚至还有 [Chameleon][5] 之类的解决方案,虽然有些陈旧,但仍被 [Pyramid][6] 框架推荐。 Python 已经存在了很长时间。此时,在系统的深处,它积累了一些几乎被遗忘的模板语言,它们都是值得一试的。 -就像桉树顶上的可爱考拉一样,在它们的生态位中不错,有时用它们工作会危险,这些都是很少有人听说过的模板语言,使用过的应该更少。 +这些语言就像桉树上可爱的考拉一样,在自己的生态圈里快乐地生活着,有时也会有危险的工作,这些都是很少有人听说过的模板语言,使用过的应该更少。 -### 3\. string.Template +### 3、string.Template -你是否曾经想过:“如何获得一种没有任何特性但同时也不需要 **pip install** 的模板语言?” Python 标准库已经涵盖。虽然没有循环和条件,但 **string.Template** 类是一种最小的模板语言。 +你是否曾经想过:“如何获得一种没有任何特性的模板语言,而且同时也不需要 `pip install` 安装任何东西?” Python 标准库已经为你提供了答案。虽然没有循环和条件,但 `string.Template` 类是一种最小的模板语言。 使用它很简单。 - ``` ->>> import string ->>> greeting = string.Template("Hello, $name, good $time!") ->>> greeting.substitute(name="OpenSource.com", time="afternoon") +>>> import string +>>> greeting = string.Template("Hello, $name, good $time!") +>>> greeting.substitute(name="OpenSource.com", time="afternoon") 'Hello, OpenSource.com, good afternoon!' ``` -### 2\. twisted.web.template +### 2、twisted.web.template -你会给一个有所有东西的库什么礼物? +你会给一个包罗万象的库送什么礼物? -当然,它不是一种模板语言,因为已经有一种。 嵌套在 twisted.web.template 中的是两种模板语言。 一种是基于 XML 的,并有一个[很棒的文档][7]。 +当然,不是模板语言,因为它已经有了。twisted.web.template 中嵌套了两种模板语言。一种是基于 XML 的,并有一个[很棒的文档][7]。 -但是还有另一种,一种基于使用 Python 作为领域特定语言来生成 HTML 文档。 +但是它还有另一种,一种基于使用 Python 作为领域特定语言(DSL)来生成 HTML 文档。 -它基于两个原语:包含标签对象的 **twisted.web.template.tags** 和渲染它们的 **twisted.web.template.flattenString**。由于它是 Twisted 的一部分,因此它内置支持高效异步渲染。 +它基于两个原语:包含标签对象的 `twisted.web.template.tags` 和渲染它们的 `twisted.web.template.flattenString`。由于它是 Twisted 的一部分,因此它内置支持高效异步渲染。 此例将渲染一个小页面: - ``` async def render(reactor): -    my_title = "A Fun page" -    things = ["one", "two", "red", "blue"] -    template = tags.html( -            tags.head( -                tags.title(my_title), -            ), -            tags.body( -                tags.h1(my_title), -                tags.ul( -                    [tags.li(thing) for thing in things], -                ), -                tags.p( -                    task.deferLater(reactor, 3, lambda: "Hello "), -                    task.deferLater(reactor, 3, lambda: "world!"), -                ) -            ) -    ) -    res = await flattenString(None, template) -    res = res.decode('utf-8') -    with open("hello.html", 'w') as fpout: -        fpout.write(res) + my_title = "A Fun page" + things = ["one", "two", "red", "blue"] + template = tags.html( + tags.head( + tags.title(my_title), + ), + tags.body( + tags.h1(my_title), + tags.ul( + [tags.li(thing) for thing in things], + ), + tags.p( + task.deferLater(reactor, 3, lambda: "Hello "), + task.deferLater(reactor, 3, lambda: "world!"), + ) + ) + ) + res = await flattenString(None, template) + res = res.decode('utf-8') + with open("hello.html", 'w') as fpout: + fpout.write(res) ``` -该模板是使用 **tags.<TAGNAME>** 来指示层次结构的常规 Python 代码。原生支持渲染字符串,因此任何字符串都正常。 +该模板是使用 `tags.` 来指示层次结构的常规 Python 代码。原生支持渲染字符串,因此任何字符串都正常。 要渲染它,你需要做的是添加调用: - ``` from twisted.internet import task, defer from twisted.web.template import tags, flattenString @@ -89,67 +88,66 @@ def main(reactor): ``` -`task.react(main)` +task.react(main) ``` -只需 _3_ 秒(而不是 _6_ 秒),它将渲染一个不错的 HTML 页面。在实际中,这些 **deferLater** 可以是对 HTTP API 的调用:它们将并行发送和处理,而无需花费精力。我建议你阅读关于[更好地使用 Twisted][8]。但是,这仍可以工作。 +只需 3 秒(而不是 6 秒),它将渲染一个不错的 HTML 页面。在实际中,这些 `deferLater` 可以是对 HTTP API 的调用:它们将并行发送和处理,而无需付出任何努力。我建议你阅读关于[更好地使用 Twisted][8]。不过,这已经可以工作了。 -### 1\. Quixote +### 1、Quixote -你会说:“但是 Python 并不是针对 HTML 输入而优化的领域特定语言。” 如果有一种语言可以[转化][9]到 Python,但是更适合定义模板,而不是像 Python 那样按原样解决呢? 如果可以的话,请使用“Python 模板语言”(PTL)。 +你会说:“但是 Python 并不是针对 HTML 领域而优化的领域特定语言。” 如果有一种语言可以[转化][9]到 Python,但是更适合定义模板,而不是像 Python 那样按原样解决呢?如果可以的话,请使用“Python 模板语言”(PTL)。 -对于攻击假想敌的人来说,写自己的语言有时被认为是梦想家的项目。当 Quixote (可用于 [PyPI][10])的创造者决定这样做时,并没有受此影响。 - -以下将渲染与上面 Twisted 相同的模板。 _警告:以下是无效的 Python_: +编写自己的语言,有时被说成是一个攻击假想敌人的唐吉坷德项目。当 Quixote(可在 [PyPI][10] 中找到)的创造者决定这样做时,并没有受此影响。 +以下将渲染与上面 Twisted 相同的模板。*警告:以下不是有效的 Python 代码*: ``` import time def render [html] (): -    my_title = "A Fun page" -    things = ["one", "two", "red", "blue"] -    "<html><head><title>" -    my_title -    "</head></title><body><h1>" -    my_title -    "</h1>" -    "<ul>" -    for thing in things: -        "<li>" -        thing -        "</li>" -    "<p>" -    time.sleep(3) -    (lambda: "Hello ")() -    time.sleep(3) -    (lambda: "world!")() -    "</p>" -    "</body></html>" + my_title = "A Fun page" + things = ["one", "two", "red", "blue"] + "" + my_title + "</head>

" + my_title + "

" + "
    " + for thing in things: + "
  • " + thing + "
  • " + "

    " + time.sleep(3) + (lambda: "Hello ")() + time.sleep(3) + (lambda: "world!")() + "

    " + "" def write(): -    result = render() -    with open("hello.html", 'w') as fpout: -        fpout.write(str(result)) + result = render() + with open("hello.html", 'w') as fpout: + fpout.write(str(result)) ``` -但是,如果将它放到 **template.ptl** 文件中,那么可以将其导入到 Quixote 并写出可以渲染模板的版本: +但是,如果将它放到 `template.ptl` 文件中,那么可以将其导入到 Quixote 中,并写出可以渲染模板的版本: ``` ->>> from quixote import enable_ptl ->>> enable_ptl() ->>> import template ->>> template.write() +>>> from quixote import enable_ptl +>>> enable_ptl() +>>> import template +>>> template.write() ``` -Quixote 安装一个导入钩子,它会将 PTL 文件转换为 Python。请注意,此渲染需要 _6_ 秒,而不是 _3_ 秒。你不再能自由异步。 +Quixote 安装了一个导入钩子,它会将 PTL 文件转换为 Python。请注意,此渲染需要 6 秒,而不是 3 秒。你不再获得自由的异步性。 ### Python 中的模板太多 -Python 的库历史悠久且曲折,其中一些库可以或多或少以类似的方式实现相同的结果(例如,Python [包管理][11])。 +Python 库的历史悠久且曲折,其中一些库可以或多或少都能达到类似结果(例如,Python [包管理][11])。 -在这个愚人节,我希望你喜欢探索这三种_可以_用 Python 创建模板的方式。另外,我建议从[这三个库之一][4]开始了解。 +我希望你喜欢探索这三种*可以*用 Python 创建模板的方式。另外,我建议从[这三个库之一][4]开始了解。 你是否有另一种深奥的模板方法?请在下面的评论中分享! @@ -160,7 +158,7 @@ via: https://opensource.com/article/20/4/python-templating-languages 作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 94530587164ef48d14b732d40e668337f1b86bf9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 May 2020 11:03:11 +0800 Subject: [PATCH 0841/1809] PUB @geekpi https://linux.cn/article-12252-1.html --- ...on templating languages you should (probably) never use.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200401 3 Python templating languages you should (probably) never use.md (98%) diff --git a/translated/tech/20200401 3 Python templating languages you should (probably) never use.md b/published/20200401 3 Python templating languages you should (probably) never use.md similarity index 98% rename from translated/tech/20200401 3 Python templating languages you should (probably) never use.md rename to published/20200401 3 Python templating languages you should (probably) never use.md index 9e9cfd2485..a5a7502767 100644 --- a/translated/tech/20200401 3 Python templating languages you should (probably) never use.md +++ b/published/20200401 3 Python templating languages you should (probably) never use.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12252-1.html) [#]: subject: (3 Python templating languages you should (probably) never use) [#]: via: (https://opensource.com/article/20/4/python-templating-languages) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From 8c15fcdbf698dd2d0a3ad643c7ece908ecdf84f9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 26 May 2020 16:52:49 +0800 Subject: [PATCH 0842/1809] Rename sources/tech/20200525 In Free Software, the Community is the Most Important Ingredient- Jerry Bezencon of Linux Lite -Interview.md to sources/talk/20200525 In Free Software, the Community is the Most Important Ingredient- Jerry Bezencon of Linux Lite -Interview.md --- ...portant Ingredient- Jerry Bezencon of Linux Lite -Interview.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200525 In Free Software, the Community is the Most Important Ingredient- Jerry Bezencon of Linux Lite -Interview.md (100%) diff --git a/sources/tech/20200525 In Free Software, the Community is the Most Important Ingredient- Jerry Bezencon of Linux Lite -Interview.md b/sources/talk/20200525 In Free Software, the Community is the Most Important Ingredient- Jerry Bezencon of Linux Lite -Interview.md similarity index 100% rename from sources/tech/20200525 In Free Software, the Community is the Most Important Ingredient- Jerry Bezencon of Linux Lite -Interview.md rename to sources/talk/20200525 In Free Software, the Community is the Most Important Ingredient- Jerry Bezencon of Linux Lite -Interview.md From b9f686ca250a1fb5cd337acfa7f6d40329f59738 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 26 May 2020 17:00:33 +0800 Subject: [PATCH 0843/1809] Rename sources/tech/20200525 David vs Goliath- Microsoft and an Obscure KDE Project Fight Over -MAUI.md to sources/news/20200525 David vs Goliath- Microsoft and an Obscure KDE Project Fight Over -MAUI.md --- ...iath- Microsoft and an Obscure KDE Project Fight Over -MAUI.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200525 David vs Goliath- Microsoft and an Obscure KDE Project Fight Over -MAUI.md (100%) diff --git a/sources/tech/20200525 David vs Goliath- Microsoft and an Obscure KDE Project Fight Over -MAUI.md b/sources/news/20200525 David vs Goliath- Microsoft and an Obscure KDE Project Fight Over -MAUI.md similarity index 100% rename from sources/tech/20200525 David vs Goliath- Microsoft and an Obscure KDE Project Fight Over -MAUI.md rename to sources/news/20200525 David vs Goliath- Microsoft and an Obscure KDE Project Fight Over -MAUI.md From 85a3575adf52ccd023fc0f13e9ab664ca265d98f Mon Sep 17 00:00:00 2001 From: lnrCoder Date: Tue, 26 May 2020 17:09:42 +0800 Subject: [PATCH 0844/1809] translated --- ...n Linux Apps in Windows (Thanks to WSL).md | 103 ----------------- ...n Linux Apps in Windows (Thanks to WSL).md | 104 ++++++++++++++++++ 2 files changed, 104 insertions(+), 103 deletions(-) delete mode 100644 sources/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md create mode 100644 translated/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md diff --git a/sources/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md b/sources/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md deleted file mode 100644 index 77e3ba785a..0000000000 --- a/sources/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md +++ /dev/null @@ -1,103 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lnrCoder) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Now You Can Run Linux Apps in Windows (Thanks to WSL)) -[#]: via: (https://itsfoss.com/run-linux-apps-windows-wsl/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Now You Can Run Linux Apps in Windows (Thanks to WSL) -====== - -Microsoft’s recent “[Build 2020][1]” developer conference involved some interesting announcements. I’m not sure if it’s something to be excited about or skeptical about — but Microsoft you have our attention now more than ever. - -And, among all the announcements, the ability to run GUI apps on WSL (Windows Subsystem for Linux) gained the spotlight. - -Not to forget the [fiasco with Xamrin.Forms rebranding as MAUI][2] which conflicts with an existing open-source project ([Maui Project][3]) by Uri Herrera of [Nitrux Linux.][4] - -In case you didn’t know, WSL is an environment that lets you have a console-only Linux experience from within Windows 10. It is also one of the [best ways to run Linux commands in Windows.][5] - -While the announcement through a blog post ([DirectX ❤ Linux][6]) may have been a PR bait as [Liam Dawe thinks][7]. But, it’s still something worth talking about. - -### Support for Linux GUI Apps On WSL - -![][8] - -Recently, Microsoft announced a bunch of new features coming to WSL (a.k.a. WSL 2) during the online developer conference. - -The introduction of [Windows Package Manager][9], [Windows Terminal 1.0][10], and a couple others were some its highlights. - -But, the support for GPU hardware acceleration to **Windows Subsystem for Linux 2** was something significant. - -So, does this mean that you can run Linux apps on Windows using WSL? Looks like it… - -Microsoft plans to make it happen using a brand-new Linux kernel driver **dxgkrnl**. To give you a technical brief, I’d quote the description from their announcement here: - -![Linux Kernel Driver Wsl][11] - -> Dxgkrnl is a brand-new kernel driver for Linux that exposes the **/dev/dxg** device to user mode Linux. **/dev/dxg** exposes a set of IOCTL that closely mimic the native WDDM D3DKMT kernel service layer on Windows. Dxgkrnl inside the Linux kernel connects over the VM Bus to its big brother on the Windows host and uses this VM bus connection to communicate with the physical GPU. - -I’m no expert here but it means that the **Linux applications on WSL will have the same access to the GPU as native Windows applications do**. - -The support for GUI apps will be coming later this fall (not with May 2020 update) — so we’ll have to see when that happens. - -Microsoft is specifically targeting the developers who want the comfort of using their Linux IDE on Windows. Google is also targeting the same user base by [bringing GUI Linux apps to Chromebook][12]. - -Well, that’s good news for users who want to stick with Windows. But, is it really? - -### Microsoft Loves Linux — Do They Really? - -![Microsoft Loves Linux][13] - -It is definitely a good thing that they are embracing Linux and its benefits through their efforts of incorporating a Linux environment on Windows. - -But, how is it really going to help the **desktop Linux users**? I don’t see any real-word benefits from it as of now. - -You’re free to have a different opinion here. But, I think there’s no real value to the desktop users of Linux through the development of WSL. At least, none so far. - -It was interesting to notice that someone on [Linux Unplugged podcast][14] highlighted Microsoft’s move as something in the line of EEE (Embrace, extend, and extinguish) for which they’re known for. - -Maybe, who knows? Of course, the effort they’ve put to pull this off is worth appreciating — but it’s exciting and mystifying at the same time. - -### Does this mean Windows users will no longer switch to Linux? - -The reason why Microsoft is embracing Linux on its platform is that they know what it’s capable of and why developers (or users) prefer using. - -But, with the updates to WSL 2, I tend to agree to what Abhishek thinks if this continues: - -> Eventually, desktop Linux will be confined to become a desktop application under Windows… - -Well, of course, the native experience is still superior for the time being. And, it’ll be rare to see that the existing Linux desktop users will use Windows over it. But, that’s still something to worry about. - -What do you think about all this? I’m not ruling the advantages of WSL for users forced to use Windows — but do you think Microsoft’s progress with WSL is going to be something hostile in nature or something that will help Linux in the long run? - -Let me know your thoughts in the comments! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/run-linux-apps-windows-wsl/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[lnrCoder](https://github.com/lnrCoder) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://news.microsoft.com/build2020/ -[2]: https://itsfoss.com/microsoft-maui-kde-row/ -[3]: https://mauikit.org/ -[4]: https://itsfoss.com/nitrux-linux/ -[5]: https://itsfoss.com/run-linux-commands-in-windows/ -[6]: https://devblogs.microsoft.com/directx/directx-heart-linux/ -[7]: https://www.gamingonlinux.com/2020/05/microsoft-build-directx-and-linux-plus-more -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/Linux-GUI-app-Windows-WSL.png?ssl=1 -[9]: https://devblogs.microsoft.com/commandline/windows-package-manager-preview/ -[10]: https://devblogs.microsoft.com/commandline/windows-terminal-1-0/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/linux-kernel-driver-wsl.png?ssl=1 -[12]: https://itsfoss.com/linux-apps-chromebook/ -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/microsoft-loves-linux.jpg?ssl=1 -[14]: https://linuxunplugged.com/354 diff --git a/translated/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md b/translated/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md new file mode 100644 index 0000000000..61334d55c0 --- /dev/null +++ b/translated/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: (lnrCoder) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Now You Can Run Linux Apps in Windows (Thanks to WSL)) +[#]: via: (https://itsfoss.com/run-linux-apps-windows-wsl/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +现在您可以在 Windows 中运行 Linux 应用(多亏了 WSL) +====== + +微软最近的 “[Build 2020][1]” 开发者大会公布了一些有趣的公告。 我不确定这该令人兴奋还是该令人怀疑 — 但是微软,你现在比以往任何时候都受到我们的关注。 + +同时,在所有公告中,能够在 WSL(Windows Subsystem for Linux)上运行 GUI 应用程序的功能备受关注。 + +别忘了 [Xamrin.Forms 更名为 MAUI 的尴尬结局][2],它与 [Nitrux Linux.][4] 的 Uri Herrera 的现有开源项目([Maui Project][3])相冲突。 + +以为防止你不不清楚,WSL 是一种环境,可让你在 Windows 10 中获得纯控制台 Linux 的体验。它也是在 [Windows 中运行 Linux 命令的最佳方法][5]之一。 + +正如 [Liam Dawe][7] 认为的那样,通过博客文章([DirectX ❤ Linux][6])发布的公告可能是只是个诱饵。但是,仍然值得一提。 + +### WSL 上对 Linux GUI 应用程序的支持 + +![][8] + +最近,Microsoft 在在线开发者大会上宣布了 WSL(又名 WSL 2)的一系列新功能。 + +[Windows Package Manager][9],[Windows Terminal 1.0][10],以及其他一些功能的引入是其亮点。 + +但是,支持 GPU 硬件加速的 Windows 的 Linux 2 子系统非常重要。 + +那么,是否意味着你可以使用 WSL 在 Windows 上运行 Linux 应用程序呢?看起来像是。 + +微软计划通过使用全新的 Linux 内核驱动程序 **dxgkrnl** 来实现。 +Microsoft plans to make it happen using a brand-new Linux kernel driver **dxgkrnl**。 为了给你一个技术简报, 我在这里引用他们的公告中的描述: + +![Linux Kernel Driver Wsl][11] + +> Dxgkrnl 是 Linux 的全新内核驱动程序,它将 **/dev/dxg** 设备暴露给用户模式的 Linux。 **/dev/dxg** 暴露了一组 IOCTL,他们与 Winodws 上的原生 WDDM D3DKMT 内核服务层非常相似。Linux 内核中的 Dxgkrnl 通过 VM 总线连接到 Windows 主机上,并使用此 VM 总线连接与物理 GPU 进行通讯。 + +我不是这方面的专家,但这以为蛇 WSL 上的 Linux 应用程序将具有与本机 Windows 应用程序相同的 GPU 访问权限。 + +针对 GUI 应用程序的支持将在今年秋季的晚些时候提供 (而不是 2020 年 5 月的更新) — 所以我们跌看看什么时候提供。 + +微软专门针对的是那些系统在 Windows 上轻松使用 Linux IDE 的开发人员。Google 还通过 [将 GUI Linux 应用程序引入 Chromebook ][12] 来针对相同的用户群。 + +好吧,对于想要使用 Windows 的用户来说,这是个好消息。但是,这是真的吗? + +### 微软爱上了 Linux — 真的吗? + +![Microsoft Loves Linux][13] + +他们通过努力在 Windows 上整合 Linux 环境来拥抱 Linux 及其优势,绝对是一件好事。 + +但是,如何真正帮助 **Linux 桌面用户**呢?到目前为止,我还没有看到任何实际的好处。 + +你可以在这里随意发表不同意见。但是,我认为 WSL 的开发对于 Linux 桌面用户来说没有实际的价值。至少目前为止没有。 + +有趣的是,[Linux Unplugged podcast][14] 上有人强调了微软的举动,以其闻名的 EEE (Embrace, extend, and extinguish) 为代表。 + +可能,谁知道呢?当然,他们为实现这一目标而付出的努力值得赞赏 — 同时又令人感到兴奋和神秘。 + +### 这是否以为着 Windows 用户将不必再切换到 Linux? + +微软之所以在其平台上集成 Linux,是因为他们知道 Liunx 的功能以及开发人员(或用户)喜欢使用的原因。 + +但是,随着 WSL 2 的更新,如果这种情况持续下去,我倾向于同意 Abhishek 的看法: + +> 最终,桌面 Linux 将被限制为 Windows 下的桌面应用程序。 + +好吧,当然,原生的体验暂时还是比较好的。而且,很难看到现有的 Linux 桌面用户会使用 Windows 来将其替代。但是,这仍然是值得担心的。 + +你如何看待这一切? 我不认为 WSL 对于被迫使用 Windows 的用户有什么好处 — 但是,从长远来看,你认为微软在 WSL 方面的进展本质上是敌意还是对 Linux 有帮助? + +在评论中让我知道你的想法! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/run-linux-apps-windows-wsl/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[lnrCoder](https://github.com/lnrCoder) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.microsoft.com/build2020/ +[2]: https://itsfoss.com/microsoft-maui-kde-row/ +[3]: https://mauikit.org/ +[4]: https://itsfoss.com/nitrux-linux/ +[5]: https://itsfoss.com/run-linux-commands-in-windows/ +[6]: https://devblogs.microsoft.com/directx/directx-heart-linux/ +[7]: https://www.gamingonlinux.com/2020/05/microsoft-build-directx-and-linux-plus-more +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/Linux-GUI-app-Windows-WSL.png?ssl=1 +[9]: https://devblogs.microsoft.com/commandline/windows-package-manager-preview/ +[10]: https://devblogs.microsoft.com/commandline/windows-terminal-1-0/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/linux-kernel-driver-wsl.png?ssl=1 +[12]: https://itsfoss.com/linux-apps-chromebook/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/microsoft-loves-linux.jpg?ssl=1 +[14]: https://linuxunplugged.com/354 From 90d88566ca4c6ade091ae191e74d3d7c559ce2e0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 May 2020 17:22:57 +0800 Subject: [PATCH 0845/1809] APL --- ...ow to Properly Install and Setup KDE Plasma on Arch Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md b/sources/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md index afccc10512..5643d483e8 100644 --- a/sources/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md +++ b/sources/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 25bb894f1d57b6e51c1b76f128376553aa0e36cb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 May 2020 18:19:00 +0800 Subject: [PATCH 0846/1809] TSL&PRF --- ...tall and Setup KDE Plasma on Arch Linux.md | 139 ------------------ ...tall and Setup KDE Plasma on Arch Linux.md | 137 +++++++++++++++++ 2 files changed, 137 insertions(+), 139 deletions(-) delete mode 100644 sources/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md create mode 100644 translated/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md diff --git a/sources/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md b/sources/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md deleted file mode 100644 index 5643d483e8..0000000000 --- a/sources/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md +++ /dev/null @@ -1,139 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Properly Install and Setup KDE Plasma on Arch Linux) -[#]: via: (https://itsfoss.com/install-kde-arch-linux/) -[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) - -How to Properly Install and Setup KDE Plasma on Arch Linux -====== - -I believe you followed the [fantastic It’s FOSS guide on installing Arch Linux][1]. The guide ends with steps mentioning the installation procedure for [GNOME desktop][2]. - -Now, not everyone is a GNOME fan and several readers requested that we show them how to configure the [KDE desktop][3] on [Arch Linux][4]. - -And thus I created this guide to demonstrate the steps for properly installing and configuring KDE desktop (also known as KDE Plasma desktop) on Arch Linux. - -### How to install and setup KDE desktop environment on Arch Linux - -![][5] - -Please keep in mind that KDE doesn’t allow login as root directly. If you have installed Arch Linux and using it as root, you should create a new user and give it sudo rights for running commands as root. - -If you just have a bare minimum installation of Arch Linux, you probably are logging into a TTY terminal. If you are using some other desktop environment, steps remain the same. - -Let’s go! - -#### Step 1: Create a sudo user (if you have only root user) - -You can use the [useradd command][6] for creating a new user. I am creating user named dimitrios (that’s my name). You can use something that matches your name. - -The option -m creates a home directory for the newly created user. - -``` -useradd -m dimitrios -``` - -You should also set a password for this user. Use this command: - -``` -passwd dimitrios -``` - -Now that you have created the user, give it sudo access. First, install sudo and a [command line text editor][7] like [nano][8]: - -``` -pacman -S sudo nano -``` - -The configuration file for sudo is /etc/sudoers. It should always be edited with the visudo command. visudo locks the sudoers file, saves edits to a temporary file, and checks that file’s grammar before copying it to /etc/sudoers. - -To use nano as the visudo editor, use: - -``` -EDITOR=nano visudo -``` - -Add the following line like I do in the example, then save and exit. - -``` -dimitrios ALL=(ALL) ALL -``` - -![Adding Sudoer in Arch Linux][9] - -Save your changes and exit the editor. You now have a sudo user on Arch Linux. - -#### Step 2: Installing KDE Plasma desktop - -To run KDE desktop, you need the following packages: - - * [Xorg][10] group - * [KDE Plasma][3] Desktop Environment - * [Wayland][11] session for KDE Plasma - * [KDE applications][12] group (consists of KDE specific applications including the Dolphin manager and other useful apps) - - - -You can install of the above using the following command: - -``` -pacman -S xorg plasma plasma-wayland-session kde-applications -``` - -Once installed, enable the Display Manager and Network Manager services: - -``` -systemctl enable sddm.service -systemctl enable NetworkManager.service -``` - -Almost there. Shutdown your system: - -``` -shutdown now -``` - -Power on your system and you should see the KDE login. Do you remember the password you set up for your sudo user? Use it to login. - -![Arch KDE Plasma Desktop][13] - -#### What next? - -You may want to explore the [essential pacman commands][14], to know what’s going on with the [Arch User Repository][15] and learn more about [AUR helpers][16]. - -I hope you found this tutorial helpful in installing KDE desktop on Arch Linux. Please let us know in the comments below, if you encountered any obstacle or difficulty during the installation. - -What’s your favourite Desktop environment or Window Manager? Let us know and don’t forget to subscribe on our social media. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-kde-arch-linux/ - -作者:[Dimitrios Savvopoulos][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/dimitrios/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/install-arch-linux/ -[2]: https://www.gnome.org/ -[3]: https://kde.org/plasma-desktop -[4]: https://www.archlinux.org/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/install-kde-arch-linux.png?ssl=1 -[6]: https://linuxhandbook.com/useradd-command/ -[7]: https://itsfoss.com/command-line-text-editors-linux/ -[8]: https://www.nano-editor.org/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/adding-sudoer-arch-linux.png?ssl=1 -[10]: https://wiki.archlinux.org/index.php/Xorg -[11]: https://wiki.archlinux.org/index.php/Wayland -[12]: https://www.archlinux.org/groups/x86_64/kde-applications/ -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/Arch-Plasma-desktop.jpg?fit=800%2C450&ssl=1 -[14]: https://itsfoss.com/pacman-command/ -[15]: https://itsfoss.com/aur-arch-linux/ -[16]: https://itsfoss.com/best-aur-helpers/ diff --git a/translated/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md b/translated/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md new file mode 100644 index 0000000000..0139cf7a26 --- /dev/null +++ b/translated/tech/20200525 How to Properly Install and Setup KDE Plasma on Arch Linux.md @@ -0,0 +1,137 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Properly Install and Setup KDE Plasma on Arch Linux) +[#]: via: (https://itsfoss.com/install-kde-arch-linux/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +如何在 Arch Linux 上正确安装和设置 KDE Plasma? +====== + +我相信你是按照[这份很棒的指南安装来 Arch Linux][1] 的,这篇指南最后提到了 [GNOME 桌面][2]的安装步骤。 + +但现在,不是每个人都是 GNOME 的粉丝,有几个读者要求我们向他们展示如何在 [Arch Linux][4] 上配置 [KDE 桌面][3]。 + +因此,我创建了这个指南来演示如何在 Arch Linux 上正确安装和配置 KDE 桌面(也被称为 KDE Plasma桌面)的步骤。 + +### 如何在 Arch Linux 上安装和设置 KDE 桌面环境? + +![][5] + +请记住,KDE 不允许直接以 root 身份登录。如果你已经安装了 Arch Linux 并以 root 身份使用,你应该创建一个新的用户,并给它以 root 身份运行命令的 sudo 权限。 + +如果你只是最小化安装了 Arch Linux,那么你可能是以 TTY 终端方式登录的。如果你使用的是其他桌面环境,步骤也是一样的。 + +让我们开始吧! + +#### 步骤 1:创建一个 sudo 用户(如果你只有 root 用户) + +你可以使用 [useradd 命令][6]来创建一个新用户。我创建的用户名为 `dimitrios`(这是我的名字)。你可以使用与你的名字匹配的东西。 + +选项 `-m` 为新创建的用户创建一个主目录。 + +``` +useradd -m dimitrios +``` + +你还应该为这个用户设置一个密码。使用此命令: + +``` +passwd dimitrios +``` + +现在你已经创建了用户,给它 sudo 权限。首先,安装 sudo 和一个像 [nano][8] 这样的[命令行文本编辑器][7]。 + +``` +pacman -S sudo nano +``` + +sudo 的配置文件是 `/etc/sudoers`。该文件应该使用 `visudo` 来编辑,它会锁定 `sudoers` 文件,将编辑的内容保存到一个临时文件中,并在复制到 `/etc/sudoers` 之前检查该文件的语法。 + +要使用 `nano` 作为 `visudo` 编辑器,请这样设置: + +``` +EDITOR=nano visudo +``` + +像我的示例那样添加下面这一行,然后保存并退出。 + +``` +dimitrios ALL=(ALL) ALL +``` + +![Adding Sudoer in Arch Linux][9] + +保存你的更改,然后退出编辑器。你现在在 Arch Linux 上有了一个 sudo 用户。 + +#### 步骤 2 :安装 KDE Plasma 桌面 + +要运行 KDE 桌面,你需要以下软件包。 + + * [Xorg][10] 组 + * [KDE Plasma][3] 桌面环境 + * [Wayland][11] KDE Plasma 的会话 + * [KDE 应用程序][12]组(包括 KDE 特有的应用程序:Dolphin 管理器和其他有用的应用程序)。 + +你可以用下面的命令安装上述部分。 + +``` +pacman -S xorg plasma plasma-wayland-session kde-applications +``` + +安装后,启用显示管理器和网络管理器服务。 + +``` +systemctl enable sddm.service +systemctl enable NetworkManager.service +``` + +快完成了。关闭你的系统。 + +``` +shutdown now +``` + +重新打开系统电源,你应该会看到 KDE 的登录界面。你还记得为你的 sudo 用户设置的密码吗?用它来登录。 + +![Arch KDE Plasma Desktop][13] + +#### 接下来? + +你可能会想探索一下[基本的 pacman 命令][14],了解一下 [Arch 用户资源库][15],了解一下 [AUR 助手][16]。 + +希望这篇教程对你在 Arch Linux 上安装 KDE 桌面有所帮助。如果你在安装过程中遇到任何障碍或困难,请在下面的评论中告诉我们。 + +你最喜欢的桌面环境或窗口管理器是什么?请告诉我们,别忘了在我们的社交媒体上订阅。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-kde-arch-linux/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-arch-linux/ +[2]: https://www.gnome.org/ +[3]: https://kde.org/plasma-desktop +[4]: https://www.archlinux.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/install-kde-arch-linux.png?ssl=1 +[6]: https://linuxhandbook.com/useradd-command/ +[7]: https://itsfoss.com/command-line-text-editors-linux/ +[8]: https://www.nano-editor.org/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/adding-sudoer-arch-linux.png?ssl=1 +[10]: https://wiki.archlinux.org/index.php/Xorg +[11]: https://wiki.archlinux.org/index.php/Wayland +[12]: https://www.archlinux.org/groups/x86_64/kde-applications/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/Arch-Plasma-desktop.jpg?fit=800%2C450&ssl=1 +[14]: https://itsfoss.com/pacman-command/ +[15]: https://itsfoss.com/aur-arch-linux/ +[16]: https://itsfoss.com/best-aur-helpers/ From 2e3f7f0e828dec9393f97805573d4086c1757172 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 27 May 2020 01:07:02 +0800 Subject: [PATCH 0847/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200527=20How?= =?UTF-8?q?=20to=20Format=20a=20USB=20Disk=20as=20exFAT=20on=20Linux=20[Gr?= =?UTF-8?q?aphically=20and=20Command=20Line]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200527 How to Format a USB Disk as exFAT on Linux -Graphically and Command Line.md --- ... on Linux -Graphically and Command Line.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20200527 How to Format a USB Disk as exFAT on Linux -Graphically and Command Line.md diff --git a/sources/tech/20200527 How to Format a USB Disk as exFAT on Linux -Graphically and Command Line.md b/sources/tech/20200527 How to Format a USB Disk as exFAT on Linux -Graphically and Command Line.md new file mode 100644 index 0000000000..76fd1159e4 --- /dev/null +++ b/sources/tech/20200527 How to Format a USB Disk as exFAT on Linux -Graphically and Command Line.md @@ -0,0 +1,126 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Format a USB Disk as exFAT on Linux [Graphically and Command Line]) +[#]: via: (https://itsfoss.com/format-exfat-linux/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +How to Format a USB Disk as exFAT on Linux [Graphically and Command Line] +====== + +_**Brief: This tutorial teaches you how to format a USB disk in exFAT format on Linux systems. Both GUI and command line methods have been discussed.**_ + +For a long time [FAT][1] has been the default choice of filesystem for formatting disks. It is compatible with pretty much all the major operating systems. + +The one major problem with FAT filesystem is that you cannot transfer a file larger than 4 GB. This means even if your USB disk has 32 GB of free space, if you try to transfer a ISO image or some other file greater than 4 GB in size, the transfer will fail. + +This creates a problem in situation like when you are [creating a bootable USB of Windows in Linux][2]. You cannot use [NTFS][3] and FAT filesystem has that 4 GB size restrictions. + +To overcome the limitations of FAT filesystem, Microsoft came up with [exFAT filesystem][4]. And in this tutorial, I’ll show you how to format a USB disk in exFAT filesystem. + + * [Format disk as exFAT using graphical tool][5] + * [Format disk as exFAT using command line][6] + + + +P**rerequisite** + +Starting [Linux kernel 5.4][7], exFAT filesystem support is enabled in Linux kernel itself. [Check which Linux kernel version you are running][8]. If it is kernel 5.4 or higher, you should be fine. + +Otherwise, you’ll have to [enable exFAT support][9] explicitly. In Ubuntu-based distributions, you can use these packages for this purpose: + +**sudo apt install exfat-fuse exfat-utils** + +### Method 1: Format disk as exFAT using GNOME Disks tool + +![][10] + +Formatting a drive using [GNOME Disks][11] is a straightforward job. It comes preinstalled in a number of Linux distributions. + +Plug in your external USB disk. Now, look for Disks in menu and open the GNOME Disks application. As a first step choose the drive that you want to format and follow the steps with me. + +_**Warning: Pay attention to the disk you are selecting to format. Don’t format your main disk accidentally.**_ + +![][12] + +The commonly used file systems like Ext4, NTFS, FAT will appear first. To use exFAT, choose “**Other**” and then click on “**Next**“. + +![][13] + +Final step: choose exFAT file system on this screen and then click **Create**. Job done! + +![][14] + +See how easy it was to create a exFAT disk in Linux graphically? Now, let me show you the terminal method as well. + +### Method 2: Format disk as exFAT in Linux command line (for advanced users) + +[fdisk][15] is a dialogue-driven command-line utility that creates and manipulates partition tables and partitions on a hard disk. In fact, it is considered one of the [best partitioning tools for Linux][16]. + +Plug in your external hard disk then type the following command in the terminal: + +``` +sudo fdisk -l +``` + +![][17] + +This will list down all the hard disks and partitions in your computer. Identify the partition that you want to format in your external hard disk. Size of the disks should give you a hint. For me, the USB disk was labelled as /dev/sdb1. + +Once you have identified your USB disk, format it as exfat using the command below. Replace /dev/sdXn with your disk’s device ID. LABEL is basically the name you want to give to your disk like Data, MyUSB etc. + +``` +sudo mkfs.exfat -n LABEL /dev/sdXn +``` + +![][18] + +Optionally, run fsck check to make sure the formatting has been done properly. + +``` +sudo fsck.exfat /dev/sdXn +``` + +That’s it. Enjoy the exFAT disk. + +### Did you succeed to create exFAT disk? + +I hope you find this tutorial simple enough, and a step forward to build a solid partitioning knowledge foundation. + +Sometimes easy and simple tips and tricks will make you a better Linux in the long term. Our frequent readers know that first hand but if you discovered It’s FOSS recently, you may take the opportunity to explore our handy tutorials. + +Don’t forget to subscribe and let me know your questions and suggestions in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/format-exfat-linux/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/File_Allocation_Table +[2]: https://itsfoss.com/bootable-windows-usb-linux/ +[3]: https://en.wikipedia.org/wiki/NTFS +[4]: https://en.wikipedia.org/wiki/ExFAT +[5]: tmp.YPwoWNgq9W#graphical-method +[6]: tmp.YPwoWNgq9W#command-line +[7]: https://itsfoss.com/linux-kernel-5-4/ +[8]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/ +[9]: https://itsfoss.com/mount-exfat/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/format-exfat-linux.jpg?ssl=1 +[11]: https://wiki.gnome.org/Apps/Disks +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/1.-gnome-disks-2.png?ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/2.-gnome-disks.jpg?ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/3.-gnome-disks.jpg?ssl=1 +[15]: https://www.tldp.org/HOWTO/Partition/fdisk_partitioning.html +[16]: https://itsfoss.com/partition-managers-linux/ +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/sudo-fdisk-l-1.jpg?ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/sdXn.jpg?ssl=1 From ae0ebc8687385b97256b6334abfd5194b6431800 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 27 May 2020 01:07:56 +0800 Subject: [PATCH 0848/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200526=20Crea?= =?UTF-8?q?te=20interactive=20content=20in=20WordPress=20with=20the=20H5P?= =?UTF-8?q?=20plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200526 Create interactive content in WordPress with the H5P plugin.md --- ...ontent in WordPress with the H5P plugin.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/tech/20200526 Create interactive content in WordPress with the H5P plugin.md diff --git a/sources/tech/20200526 Create interactive content in WordPress with the H5P plugin.md b/sources/tech/20200526 Create interactive content in WordPress with the H5P plugin.md new file mode 100644 index 0000000000..871439e73a --- /dev/null +++ b/sources/tech/20200526 Create interactive content in WordPress with the H5P plugin.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create interactive content in WordPress with the H5P plugin) +[#]: via: (https://opensource.com/article/20/5/h5p-wordpress) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +Create interactive content in WordPress with the H5P plugin +====== +Turn your WordPress site into an interactive learning management system +with this open source plugin. +![Family learning and reading together at night in a room][1] + +WordPress is best known as a website content management system, but it also a great [learning management system][2] (LMS) for delivering online courses. If that is what you are looking for out of WordPress, then [H5P][3] should be the top plugin on your list. + +H5P is a way to create and share interactive HTML5 content, including presentations, games, quizzes, forms, and more, in a browser. You can download a wide variety of content types from H5P's [Examples and Downloads][4] page, or you can create unique content to embed in your WordPress site. + +H5P provides plugins and integrations for WordPress, Moodle, Drupal, Canvas, Brightspace, Blackboard, and more. In this article, I will show how to use H5P in WordPress to create a reading comprehension quiz for students. + +### Install the H5P plugin + +The first step is to install the plugin. Log into your WordPress admin panel, go to **Plugins**, select **Add New**, and search for **H5P** in the Plugins field. When you find it, select **Install Now**. + +![Adding the H5P plugin][5] + +(Don Watkins, [CC BY-SA 4.0][6]) + +H5P should now appear in the list of installed plugins. Be sure to **Activate** the plugin by going to the H5P menu at the bottom of your WordPress admin panel and clicking the button. You will see the following display—be sure to consent so you can connect to the H5P Hub. + +![H5P consent option][7] + +(Don Watkins, [CC BY-SA 4.0][6]) + +Now you can begin adding H5P content to your WordPress installation. + +### Create a quiz + +One of my favorite poems is Robert Frost's "The Road Not Taken." Suppose you are teaching a class that is studying this poem, and one of your objectives is for your students to remember the poem's author. First, create a new WordPress post on your site that contains the poem's text and its author. + +![Creating a WordPress post][8] + +(Don Watkins, [CC BY-SA 4.0][6]) + +Now you want to test your students' comprehension with an HTML5 interactive content embedded below the poem. + +In the WordPress admin panel, look near the bottom for the **H5P Content** menu and select it. In the menu that appears, click **Add New**. + +![H5P Content menu][9] + +(Don Watkins, [CC BY-SA 4.0][6]) + +You will see an array of content options that are available. Since you want to create a multiple-choice quiz, look for the **Multiple Choice** option and click **Get** to its right. + +![H5P content types][10] + +(Don Watkins, [CC BY-SA 4.0][6]) + +A form will open for you to start creating the quiz. Fill in the required fields (marked with a red asterisk)—give your quiz a title (e.g., "Road Not Taken Quiz"), enter a question (e.g., "Who wrote, 'The Road Not Taken'?") and correct and incorrect answers, and select the correct answer in the dialog box. When you finish creating the quiz, save the content. + +![H5P quiz][11] + +(Don Watkins, [CC BY-SA 4.0][6]) + +### Embed the quiz in a post + +Now you're ready to insert the quiz exactly where you want it to appear in your post. Open the post where you want to put the quiz (e.g., "The Road Not Taken" post) in your WordPress editor, and you should see an **Add H5P** button near the top of the interface. Place your cursor wherever you want the quiz to appear in the post, and click **Add H5P**. Your H5P content will appear in a dialog box like this: + +![H5P list of interactive content][12] + +(Don Watkins, [CC BY-SA 4.0][6]) + +Select the content you want, and H5P will insert an embed code (e.g., `[h5p id="1"]`) in the post, like this: + +![H5P embed code in a post][13] + +(Don Watkins, [CC BY-SA 4.0][6]) + +Save your post, then open it in your browser. The quiz is exactly where you wanted it to appear in the post: + +![H5P quiz shown in the post][14] + +(Don Watkins, [CC BY-SA 4.0][6]) + +When a student answers this question correctly, they get pleasant visual feedback: + +![Correct answer selection][15] + +(Don Watkins, [CC BY-SA 4.0][6]) + +### The possibilities are endless + +H5P offers a wide range of options to add interactivity to WordPress posts. In this example, you could have created a more complex set of multiple-choice questions. H5P also has lots of other content types, including interactive video, arithmetic quizzes, an audio recorder, image hotspots, fill-in-the-blank quizzes, and [many more][4]. + +H5P also provides [excellent documentation][16] and [great tutorials][17] to help anyone who wants to use the plugin on their WordPress site. H5P software is open source under the [MIT License][18] with the code available on [GitHub][19]. H5P also welcomes contributions to the community; check out the [developer guide][20] for more information. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/h5p-wordpress + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/family_learning_kids_night_reading.png?itok=6K7sJVb1 (Family learning and reading together at night in a room) +[2]: https://en.wikipedia.org/wiki/Learning_management_system +[3]: https://h5p.org/ +[4]: https://h5p.org/content-types-and-applications +[5]: https://opensource.com/sites/default/files/uploads/addplugins-h5p.png (Adding the H5P plugin) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://opensource.com/sites/default/files/uploads/h5p-consent.png (H5P consent option) +[8]: https://opensource.com/sites/default/files/uploads/wordpress-post.png (WordPress post) +[9]: https://opensource.com/sites/default/files/uploads/h5p-content-menu.png (H5P Content menu) +[10]: https://opensource.com/sites/default/files/uploads/h5p-content-types.png (H5P content types) +[11]: https://opensource.com/sites/default/files/uploads/h5p-multiple-choice-quiz.png (H5P quiz) +[12]: https://opensource.com/sites/default/files/uploads/h5p-insert-interactive-content.png (H5P list of interactive content) +[13]: https://opensource.com/sites/default/files/uploads/h5p-embedded-content.png (H5P embed code in a post) +[14]: https://opensource.com/sites/default/files/uploads/h5p-quiz.png (H5P quiz shown in the post) +[15]: https://opensource.com/sites/default/files/uploads/h5p-correct-answer.png (Correct answer selection) +[16]: https://h5p.org/documentation/setup/wordpress +[17]: https://h5p.org/documentation/for-authors/tutorials +[18]: https://h5p.org/MIT-licensed +[19]: https://github.com/h5p +[20]: https://h5p.org/developers From 8ddce545840e523c48af8bc89112d1bf50ee5157 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 27 May 2020 01:08:20 +0800 Subject: [PATCH 0849/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200526=20How?= =?UTF-8?q?=20to=20write=20about=20open=20source=20software?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200526 How to write about open source software.md --- ...How to write about open source software.md | 191 ++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 sources/tech/20200526 How to write about open source software.md diff --git a/sources/tech/20200526 How to write about open source software.md b/sources/tech/20200526 How to write about open source software.md new file mode 100644 index 0000000000..f45215fd0b --- /dev/null +++ b/sources/tech/20200526 How to write about open source software.md @@ -0,0 +1,191 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to write about open source software) +[#]: via: (https://opensource.com/article/20/5/write-about-open-source-software) +[#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych) + +How to write about open source software +====== +Become a better writer by following these tips. +![Typewriter in the grass][1] + +One way to get started with an open source community is to write about it. You can contribute to technical documentation, share how you use the software, or write an article for Opensource.com. But getting started writing is easier said than done. The two most common excuses I hear for not writing are: "I have nothing new to say" and "I'm not a good writer." I'm here to dispel both of those myths. + +### What should you write about? + +> "Hunt for the stories that often get left out." +> —Erik Larson + +For some people, the biggest hurdle to writing is generating an idea or topic to write about. It's common to fall into the trap of thinking, "This topic has been written about, so why bother." + +I'm not the first person to write an article on writing, and I won't be the last. What I bring is my unique perspective and things I've learned over the years. I've had people ask me for tips on getting started or how to get better at writing. I decided to turn those suggestions into an article. + +Your writing is a reflection of you. Nobody will tell the story the way you do. Your experiences and perspective may be just what somebody else needs. + +Here are some prompts to help you come up with a topic: + + * What is something you've recently learned? Write about how you learned, what you learned, or what surprised you. + * What questions are you frequently asked? Write up the answer. + * Did you recently search for a how-to article and weren't satisfied with any of the top search results? Write the article you were looking for. + * Did you attend a conference or workshop? Write a post-event summary of what you learned. + * Did you start using a new tool? Write up a how-to or getting-started guide. + + + +### What type of article are you writing? + +There are different types of writing, including: + + * Technical documentation + * How-to guide + * Blog + * White paper or eBook + * Retrospective + + + +The type of content will influence your writing style and tone of voice. A blog is more informal and conversational. Technical documentation is more formal and instructional. + +### Who are you writing for? + +Each piece of writing should have a single audience. The audience is the type of person you are writing for. Before you begin writing, it helps to jot down a few characteristics of your reader. It's important to consider who you are writing for, as well as who you _aren't_ writing for—identifying your target audience will shape what to include and what not to include. + +For example, this is who I envisioned when writing this article: + + * Has basic knowledge of writing and grammar + * Is interested in improving writing skills + * Works in technology as a developer, sales engineer, customer success manager, or similar role + * Is not an experienced or advanced writer, may have a couple of published articles on a personal or work blog, and wants to write more + * Is writing non-fiction + + + +If you have content for multiple audiences, consider breaking it down into different pieces for the different audiences. Some areas to consider in your audience: + + * Level of expertise: novice, intermediate, advanced + * Role: manager, individual contributor + * Goals: why are they reading? + + + +### Words matter + +The words you choose will have an impact on the reader. Difficult words can make an article harder to understand. Unfamiliar words can make the reader feel stupid. Certain words can accidentally offend a reader. Your goal as a writer is to avoid all of these. Here's how. + +#### Use everyday language + +Don't write as a way to show off your vocabulary or the words you've learned from your "Word of the Day" calendar. Write so a reader can understand. There is a reading level associated with every piece of writing. If you're writing technical documentation, aim for about an eighth-grade reading level. This doesn't imply your audience has only an eighth-grade education. It means your writing will be more easily understood. Do you want people to get hung up on the language, or do you want them to walk away feeling like they learned something? Just because you can use big, complicated words doesn't mean you should. Using simple language does not necessarily mean your article will be boring. + +Use tools like [Hemingway App][2] to check the readability of your writing (it's not open source, but it's excellent). For example, after the first draft, this article was assessed at a fifth-grade reading level. Hemingway also provides suggestions on how to improve your writing—identifying hard-to-read sentences or places to alter word choice. + +If you're struggling with coming up with alternative words, check out the suggestions at the [Plain English Campaign][3] or the crowdsourced suggestions at [Power Thesaurus][4]. + +#### Know which words to avoid + +> "Substitute 'damn' every time you're inclined to write 'very'; your editor will delete it and the writing will be just as it should be." +> —Mark Twain + +When writing a tutorial or how-to guide, here are some words to avoid, including "simple," "easy," and "just." You, an expert on the topic you're writing about, may find things easy after years of practice. A beginner may not find things simple or easy. Your readers may get frustrated because they don't find the process or explanation simple. + +Have you ever had to reread a sentence or paragraph multiple times because you couldn't figure out what the writer was saying? Have you ever given up on an article because it wasn't making sense to you? I have. + +As a writer, do you want your readers to feel confused or unintelligent? I hope not. + +Other words to avoid in your writing: + + * That + * Really + * Very + * So + * In order to + + + +Generally, these words can be deleted without changing the meaning of a sentence. + +After I finish writing, I search a document for instances of those words. When I searched through this document, I found the following sentence: + +> "This doesn't imply that your audience only has an eighth-grade education, it means that your writing will be more easily understood." + +Two instances of "that" appear in this sentence. They're not adding value to the sentence. They can be deleted without changing its meaning. Removing those instances shortens the sentence, and shorter sentences are easier to understand. And speaking of shorter sentences, I also re-wrote it as two sentences. + +> "This doesn't imply your audience has only an eighth-grade education. It means your writing will be more easily understood." + +#### Use inclusive language + +The historical context of words and phrases can lead to people feeling excluded or offended. When writing, you want to make the reader feel included. When you use inclusive language, it makes your reader feel understood, respected, and like they belong. I refer to this [guide on using inclusive language][5] from Buffer. + +### Revising and editing + +> "Almost all good writing begins with terrible first efforts. You need to start somewhere." +> —Anne Lamott + +Writing is an iterative process. If you think writers sit down at their desk and, within an hour, have a completed article ready to be published, think again. Some articles take me weeks to complete. Here's a standard process for me: + + * Write a rough first draft. By rough, I mean _rough_. I write without worrying about grammar. The idea is to get words out of my head and onto paper. This step can take anywhere from an hour to a couple of weeks. + * Put the draft away for some time. This can be anywhere from a couple of hours to a couple of days, depending on the publishing timeline. + * Review the draft. Make tweaks and edits. + * Ask for feedback, either from a coworker or a friend. During this phase of feedback, I focus on clarity. Does everything make sense? Is anything confusing, any missing sections? + * Incorporate feedback. No matter how experienced you are at writing, other writers reviewing your work will make it better. + + + +At this stage, I have a pretty solid draft. Now comes my least favorite part of writing—editing. The Hemingway App I mentioned earlier not only tells you the reading level but also provides suggestions to improve your writing. I also use Grammarly to help with grammar edits. For open source alternatives to Grammarly, check out [Language Tool][6] or this article on [open source writing tools][7]. + +One of my writing challenges is using commas appropriately. Grammarly helps me figure out where I miss or misuse a comma. Grammarly identified 43 issues related to the correctness of this article's final draft. The majority were comma errors. + +![Errors identified by Grammarly][8] + +(Dawn Parzych, [CC BY-SA 4.0][9]) + +In addition to grammatical errors, the app also provides suggestions to help with clarity, engagement, and delivery (some of these features may not be available in the free version). This includes things like word choice and using active vs. passive voice. Some suggestions I accept; others I reject. After reviewing all the alerts and suggestions, Grammarly reports back across all dimensions. + +![Grammarly results][10] + +(Dawn Parzych, [CC BY-SA 4.0][9]) + +Don't be afraid to ask for help with your writing. Behind every good writer is a good editor or a good editing app. + +### Style guides + +Style guides provide standards for improving communication in writing. They include aspects such as punctuation, grammar, and word usage. If writing a document for your company, check to see if it uses a style guide. If it doesn't have a style guide, or if you're writing for yourself, here are some common style guides to follow: + + * [Chicago Manual of Style][11] + * [Google Developer Documentation Guide][12] + * [Microsoft Writing Style Guide][13] + * [AP Stylebook][14] + + + +Writing is a way to share your thoughts and knowledge with the community. The only way to get started writing is to start typing. Use these suggestions to fine-tune your writing. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/write-about-open-source-software + +作者:[Dawn Parzych][a] +选题:[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/dawnparzych +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/doc-dish-lead.png?itok=h3fCkVmU (Typewriter in the grass) +[2]: http://www.hemingwayapp.com/ +[3]: http://www.plainenglish.co.uk/the-a-z-of-alternative-words.html +[4]: https://www.powerthesaurus.org/ +[5]: https://open.buffer.com/inclusive-language-tech/ +[6]: https://languagetool.org/ +[7]: https://opensource.com/article/20/3/open-source-writing-tools +[8]: https://opensource.com/sites/default/files/uploads/grammarlyerrors.png (Errors identified by Grammarly) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/uploads/grammarlyresults.png (Grammarly results) +[11]: https://www.chicagomanualofstyle.org/home.html +[12]: https://developers.google.com/style +[13]: https://docs.microsoft.com/en-us/style-guide/welcome/ +[14]: https://www.apstylebook.com/ From 58fd261dcea0bc567ddc588d0cc16314981d5d33 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 May 2020 07:59:49 +0800 Subject: [PATCH 0850/1809] APL --- .../tech/20200526 How to write about open source software.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200526 How to write about open source software.md b/sources/tech/20200526 How to write about open source software.md index f45215fd0b..280e442c6e 100644 --- a/sources/tech/20200526 How to write about open source software.md +++ b/sources/tech/20200526 How to write about open source software.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6987eb8fbc7b5dcf85c5bd94eb2a80aa6d48a8b2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 May 2020 08:46:09 +0800 Subject: [PATCH 0851/1809] translated --- ...ted with the Gutenberg editor in Drupal.md | 122 ------------------ ...ted with the Gutenberg editor in Drupal.md | 120 +++++++++++++++++ 2 files changed, 120 insertions(+), 122 deletions(-) delete mode 100644 sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md create mode 100644 translated/tech/20200304 Getting started with the Gutenberg editor in Drupal.md diff --git a/sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md b/sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md deleted file mode 100644 index 84c177f4de..0000000000 --- a/sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md +++ /dev/null @@ -1,122 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with the Gutenberg editor in Drupal) -[#]: via: (https://opensource.com/article/20/3/gutenberg-editor-drupal) -[#]: author: (MaciejLukianski https://opensource.com/users/maciejlukianski) - -Getting started with the Gutenberg editor in Drupal -====== -Learn how to use the WYSIWYG editor, made popular in WordPress, with -Drupal. -![Text editor on a browser, in blue][1] - -Since 2017, WordPress has had a really great WYSIWYG editor in the [Gutenberg][2] plugin. But the Drupal community hasn't yet reached consensus on the best approach to the content management system's (CMS) editorial experience. But a strong new option appeared when, with a lot of community effort, [Gutenberg was integrated with Drupal][3]. - -Previously, there were two main approaches to content creation in Drupal 8: - - * In the [**Paragraph-based approach**][4], content is assembled out of entities called paragraphs. Currently, approximately 100,000 websites use the Paragraphs module (according to Drupal). - * The [**Layout-Builder approach**][5] uses an editorial tool shipped with Drupal 8.5. It is still undergoing improvements, but it is the next strong contender because it is really well integrated with the Drupal core. Stats on usage are not available since Layout Builder is part of Drupal. - - - -At the end of 2018, the Drupal community, lead by Fronkom (a Norwegian digital agency strongly focused on open source solutions), ported the WordPress Gutenberg project as a contributed module into Drupal. Let's take a look at how Gutenberg works in Drupal (including some cool Drupal-specific integrations). - -### Installation - -Installing the [Gutenberg module][6] is as straightforward as installing any Drupal module, and it has good [installation documentation][7]. - -### Configuration - -Gutenberg is integrated into Drupal's default content-entity creation workflow. You can use it on any of the content types you choose, provided that the content type has at least one text area field, which is where the Gutenberg editor's output will be saved. - -To enable the Gutenberg project on a content type in Drupal, you have to navigate to its settings: **Structure > Content types** and, from the dropdown next to the content type where you want to use Gutenberg, click **Edit**. - -![Drupal settings][8] - -In the form that appears, scroll down and select the **Gutenberg experience** tab on the left, where you can find the settings described below. Select the **Enable Gutenberg experience** box. - -![Drupal Gutenberg settings][9] - -#### Template - -This is one of the cool features that is not available in WordPress out of the box. It enables you to define a template for a new page in a JSON structure. This will pre-populate all newly created articles with dummy placeholder content, which will help editors structure content correctly. In the screenshot above, I added a heading and a paragraph. Note that any double-quotes have to be escaped. - -#### Template lock - -This setting allows you to define whether users are allowed to delete the placeholder content, add new blocks, or just edit the existing, pre-populated content. - -#### Allowed Gutenberg and Drupal blocks - -This is another super-cool feature on the Drupal side of Gutenberg. Drupal allows users to create various types of blocks to design a page. For example, you could create a block with a list of the five latest blog posts, the most recent comments, or a form to collect users' emails. - -Gutenberg's deep integration with Drupal allows users to select which Drupal blocks are available to users while they are editing (e.g., limit embeds to YouTube) and use blocks as inline content. This is a very handy feature that allows granular control of the user experience. - -There's not much to choose from in a blank Drupal installation, but a live site usually has many blocks that provide various functionalities. In the screenshot below, the **Search form** Drupal block is selected. - -![Drupal Gutenberg blocks][10] - -After you finish the configuration, hit **Save content type**. - -### Publishing content with Drupal Gutenberg - -When Gutenberg is enabled for a content type, it takes over most of the editorial experience. - -![Drupal Gutenberg content screen][11] - -In the main window, you can see the dummy placeholder content I added in the Template configuration above. - -#### Drupal-specific options - -On the right-hand side, there are a few fields and settings that Drupal provides. For example, the **Title** field is a required separate field in Drupal, and therefore it is not on the main Gutenberg screen. - -Underneath the **Title**, there are additional settings that can vary, depending on the modules installed and options set up in Drupal. You can see **Revision log messages**, **Menu settings**, **Comment settings**, and a place to add a **URL alias**. - -Typically, Drupal content types are composed of several text fields, such as tags, categories, checkboxes, image fields for teasers, etc. When you enable Gutenberg for a content type, these additional fields are available in the **More settings** tab. - -You can now add your content—it works the same as it does in WordPress Gutenberg, with the additional option to add Drupal blocks. - -In the screenshot below, you can see what happens when I add some text to replace the placeholder text, a search block from Drupal, a title, tags, and a custom URL alias. - -![Drupal Gutenberg entering text][12] - -After you hit **Save**, your content will be published. - -![Drupal Gutenberg output][13] - -And that is it. It works like a charm! - -### Working together for better software experiences - -Gutenberg in Drupal works well. It is an alternative option that allows editors to control the look and feel of their websites down to the tiniest details. Adoption is growing well, with over 1,000 installations as of this writing and 50 new ones every month. The Drupal integration adds other cool features like fine-grained permissions, placeholder content, and the ability to include Drupal blocks inline, which aren't available in the WordPress plugin. - -It is great to see the communities of two separate projects working together to achieve the common goal of giving people better software. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/gutenberg-editor-drupal - -作者:[MaciejLukianski][a] -选题:[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/maciejlukianski -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) -[2]: https://wordpress.org/plugins/gutenberg/ -[3]: https://drupalgutenberg.org/ -[4]: https://www.droptica.com/blog/flexible-and-easy-content-creation-drupal-paragraphs-module/ -[5]: https://www.droptica.com/blog/layout-builder-building-drupal-8-layouts/ -[6]: https://www.drupal.org/project/gutenberg -[7]: https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-modules -[8]: https://opensource.com/sites/default/files/uploads/gutenberg_edit.png (Drupal settings) -[9]: https://opensource.com/sites/default/files/uploads/gutenberg_settings.png (Drupal Gutenberg settings) -[10]: https://opensource.com/sites/default/files/uploads/gutenberg_blocks.png (Drupal Gutenberg blocks) -[11]: https://opensource.com/sites/default/files/uploads/gutenberg_contentwindow.png (Drupal Gutenberg content screen) -[12]: https://opensource.com/sites/default/files/uploads/gutenberg_entry.png (Drupal Gutenberg entering text) -[13]: https://opensource.com/sites/default/files/uploads/gutenberg-demo.png (Drupal Gutenberg output) diff --git a/translated/tech/20200304 Getting started with the Gutenberg editor in Drupal.md b/translated/tech/20200304 Getting started with the Gutenberg editor in Drupal.md new file mode 100644 index 0000000000..2b3abe8bc5 --- /dev/null +++ b/translated/tech/20200304 Getting started with the Gutenberg editor in Drupal.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with the Gutenberg editor in Drupal) +[#]: via: (https://opensource.com/article/20/3/gutenberg-editor-drupal) +[#]: author: (MaciejLukianski https://opensource.com/users/maciejlukianski) + +Drupal 中的 Gutenberg 编辑器入门 +====== +了解如何与 Drupal 一起使用 WordPress 中流行的 WYSIWYG 编辑器。 +![Text editor on a browser, in blue][1] + +自 2017 年以来,WordPress 的 [Gutenberg][2] 插件中就有非常出色的 WYSIWYG 编辑器。但是,Drupal 社区尚未就内容管理系统 (CMS) 编辑体验的最佳方法达成共识。 但是,在社区的大量努力下,出现了一个强有力的新选择,将 [Gutenberg 与 Drupal 集成在一起][3]。 + +以前,Drupal 8 中有两种主要的内容创建方法: + + * 在[**基于段落的方法**][4]中,内容是由称为段落的实体组合而成。 目前,大约有 100,000 个网站使用“段落” (Paragraphs)模块(根据 Drupal)。 + * [**Layout-Builder 方法**][5]使用 Drupal 8.5 附带的编辑工具。 它仍然在改进,但是它是下一个强有力的竞争者,因为它确实与 Drupal 内核很好地集成在一起。由于 Layout Builder 是 Drupal 的一部分,因此无法获得使用情况的统计信息。 + + +在 2018 年底,由 Fronkom(一家专注于开源解决方案的挪威数字机构)领导的 Drupal 社区将 WordPress Gutenberg 项目作为贡献模块移植到了 Drupal 中。让我们看一下 Gutenberg 在 Drupal 中的工作方式(包括一些很酷的 Drupal 特定集成)。 + +### 安装 + +安装 [Gutenberg 模块][6]与安装任何 Drupal 模块一样简单,并且有良好的[安装文档][7]。 + +### 配置 + +Gutenberg 已集成到 Drupal 的默认内容实体创建工作流中。你可以将其用于你选择的任何内容类型,前提是内容类型至少有一个文本区域字段,它是 Gutenberg 编辑器输出的位置。 + +要在 Drupal 中的内容类型启用 Gutenberg 项目,你必须进入设置:**Structure > Content types**,并且,从要你想使用 Gutenberg 的内容类型旁边的下拉框中单击 **Edit**。 + +![Drupal settings][8] + +在出现的窗口中,向下滚动并选择左侧的 **Gutenberg experience** 选项卡,你可以在其中找到下面描述的设置。选择 **Enable Gutenberg experience**。 + +![Drupal Gutenberg settings][9] + +#### 模板 + +这是 WordPress 开箱即用的很酷的功能之一。它能让你用 JSON 结构定义新页面模板。它将使用虚拟占位符内容预填充所有新创建的文章,这将有助于编辑者正确地构造内容。在上面的截图中,我添加了一个标题和一个段落。请注意,必须转义任何双引号。 + +#### 模板锁 + +此设置允许你定义是否允许用户删除占位符内容,添加新块或仅编辑现有的预填充内容。 + +#### 允许的 Gutenberg 和 Drupal 块 + +这是 Gutenberg Drupal 侧的另一个超酷功能。Drupal 允许用户创建各种类型的块来设计页面。例如,你可以创建一个块,其中包含五个最新博客的列表、最新评论或用于收集用户电子邮件的表单。 + +Gutenberg 与 Drupal 的深度集成允许用户在编辑时选择哪些 Drupal 块可供用户使用(例如,有限嵌入 YouTube),并将块用作内联内容。这是一个非常方便的功能,允许对用户体验进行精细控制。 + +在全新安装的 Drupal 中,没有太多的选择,但站点通常有许多提供各种功能的块。在下面的截图中,选择了 **Search form** 的 Drupal 块。 + +![Drupal Gutenberg blocks][10] + +完成配置后,点击 **Save content type**。 + +### 使用 Drupal Gutenberg 发布内容 + +启用 Gutenberg 内容类型后,它将接管大部分编辑体验。 + +![Drupal Gutenberg content screen][11] + +在主窗口中,你可以看到我在上面的模板配置中添加的虚拟占位符内容。 + +#### 特定于 Drupal 的选项 + +在右侧,Drupal 提供了一些字段和设置。例如,“Title” 字段是 Drupal 中所需的单独字段,因此它不在主页面上。 + +在 **Title** 下面,根据在 Drupal 中安装的模块和设置的选项,其他设置可能有所不同。你可以看到 **Revision log messages**、**Menu settings**、**Comment settings** 以及添加 **URL alias**。 + +通常,Drupal 内容类型由多个文本字段组成,如标记、类别、复选框、图像字段等。当你启用 Gutenberg 内容类型时,这些附加字段可在 **More settings** 选项卡中提供。 + +你现在可以添加内容 — 它的工作方式与 WordPress Gutenberg 中的相同,并有额外的添加 Drupal 块的选项。 + +在下面的截图中,你可以看到当我添加一些文本替换占位符文本、来自 Drupal 的搜索块、标题、标记和自定义 URL 别名后发生的情况。 + +![Drupal Gutenberg entering text][12] + +点击 **Save** 后,你的内容将发布。 + +![Drupal Gutenberg output][13] + +就是这样,它工作良好 + +### 共同工作以获得更好的软件体验 + +Drupal 中的 Gutenberg 工作良好。这是一个可供选择的选项,允许编辑者控制网站的外观,直至最细微的细节。采用率正在增长,截至本文撰写时,已有 1,000 多个安装,每月有 50 个新安装。Drupal 集成添加了其他很酷的功能,如细粒度权限、占位符内容,以及内联包含 Drupal 块的功能,这些功能在 WordPress 插件中没有。 + +很高兴看到两个独立项目的社区共同努力实现为人们提供更好的软件的共同目标。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/gutenberg-editor-drupal + +作者:[MaciejLukianski][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/maciejlukianski +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) +[2]: https://wordpress.org/plugins/gutenberg/ +[3]: https://drupalgutenberg.org/ +[4]: https://www.droptica.com/blog/flexible-and-easy-content-creation-drupal-paragraphs-module/ +[5]: https://www.droptica.com/blog/layout-builder-building-drupal-8-layouts/ +[6]: https://www.drupal.org/project/gutenberg +[7]: https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-modules +[8]: https://opensource.com/sites/default/files/uploads/gutenberg_edit.png (Drupal settings) +[9]: https://opensource.com/sites/default/files/uploads/gutenberg_settings.png (Drupal Gutenberg settings) +[10]: https://opensource.com/sites/default/files/uploads/gutenberg_blocks.png (Drupal Gutenberg blocks) +[11]: https://opensource.com/sites/default/files/uploads/gutenberg_contentwindow.png (Drupal Gutenberg content screen) +[12]: https://opensource.com/sites/default/files/uploads/gutenberg_entry.png (Drupal Gutenberg entering text) +[13]: https://opensource.com/sites/default/files/uploads/gutenberg-demo.png (Drupal Gutenberg output) From aac72a8fa6b3ef0038d977430bfe2b2c7efe179a Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 May 2020 08:53:06 +0800 Subject: [PATCH 0852/1809] translating --- ...5 How to Execute a Command or Script at Reboot or Startup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200525 How to Execute a Command or Script at Reboot or Startup.md b/sources/tech/20200525 How to Execute a Command or Script at Reboot or Startup.md index 5d81b593de..91e97dbbaf 100644 --- a/sources/tech/20200525 How to Execute a Command or Script at Reboot or Startup.md +++ b/sources/tech/20200525 How to Execute a Command or Script at Reboot or Startup.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b9c8ce5df3412d0f4d73c297f0d4a3faf68169d0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 May 2020 09:49:00 +0800 Subject: [PATCH 0853/1809] TSL --- ...How to write about open source software.md | 191 ------------------ ...How to write about open source software.md | 175 ++++++++++++++++ 2 files changed, 175 insertions(+), 191 deletions(-) delete mode 100644 sources/tech/20200526 How to write about open source software.md create mode 100644 translated/tech/20200526 How to write about open source software.md diff --git a/sources/tech/20200526 How to write about open source software.md b/sources/tech/20200526 How to write about open source software.md deleted file mode 100644 index 280e442c6e..0000000000 --- a/sources/tech/20200526 How to write about open source software.md +++ /dev/null @@ -1,191 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to write about open source software) -[#]: via: (https://opensource.com/article/20/5/write-about-open-source-software) -[#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych) - -How to write about open source software -====== -Become a better writer by following these tips. -![Typewriter in the grass][1] - -One way to get started with an open source community is to write about it. You can contribute to technical documentation, share how you use the software, or write an article for Opensource.com. But getting started writing is easier said than done. The two most common excuses I hear for not writing are: "I have nothing new to say" and "I'm not a good writer." I'm here to dispel both of those myths. - -### What should you write about? - -> "Hunt for the stories that often get left out." -> —Erik Larson - -For some people, the biggest hurdle to writing is generating an idea or topic to write about. It's common to fall into the trap of thinking, "This topic has been written about, so why bother." - -I'm not the first person to write an article on writing, and I won't be the last. What I bring is my unique perspective and things I've learned over the years. I've had people ask me for tips on getting started or how to get better at writing. I decided to turn those suggestions into an article. - -Your writing is a reflection of you. Nobody will tell the story the way you do. Your experiences and perspective may be just what somebody else needs. - -Here are some prompts to help you come up with a topic: - - * What is something you've recently learned? Write about how you learned, what you learned, or what surprised you. - * What questions are you frequently asked? Write up the answer. - * Did you recently search for a how-to article and weren't satisfied with any of the top search results? Write the article you were looking for. - * Did you attend a conference or workshop? Write a post-event summary of what you learned. - * Did you start using a new tool? Write up a how-to or getting-started guide. - - - -### What type of article are you writing? - -There are different types of writing, including: - - * Technical documentation - * How-to guide - * Blog - * White paper or eBook - * Retrospective - - - -The type of content will influence your writing style and tone of voice. A blog is more informal and conversational. Technical documentation is more formal and instructional. - -### Who are you writing for? - -Each piece of writing should have a single audience. The audience is the type of person you are writing for. Before you begin writing, it helps to jot down a few characteristics of your reader. It's important to consider who you are writing for, as well as who you _aren't_ writing for—identifying your target audience will shape what to include and what not to include. - -For example, this is who I envisioned when writing this article: - - * Has basic knowledge of writing and grammar - * Is interested in improving writing skills - * Works in technology as a developer, sales engineer, customer success manager, or similar role - * Is not an experienced or advanced writer, may have a couple of published articles on a personal or work blog, and wants to write more - * Is writing non-fiction - - - -If you have content for multiple audiences, consider breaking it down into different pieces for the different audiences. Some areas to consider in your audience: - - * Level of expertise: novice, intermediate, advanced - * Role: manager, individual contributor - * Goals: why are they reading? - - - -### Words matter - -The words you choose will have an impact on the reader. Difficult words can make an article harder to understand. Unfamiliar words can make the reader feel stupid. Certain words can accidentally offend a reader. Your goal as a writer is to avoid all of these. Here's how. - -#### Use everyday language - -Don't write as a way to show off your vocabulary or the words you've learned from your "Word of the Day" calendar. Write so a reader can understand. There is a reading level associated with every piece of writing. If you're writing technical documentation, aim for about an eighth-grade reading level. This doesn't imply your audience has only an eighth-grade education. It means your writing will be more easily understood. Do you want people to get hung up on the language, or do you want them to walk away feeling like they learned something? Just because you can use big, complicated words doesn't mean you should. Using simple language does not necessarily mean your article will be boring. - -Use tools like [Hemingway App][2] to check the readability of your writing (it's not open source, but it's excellent). For example, after the first draft, this article was assessed at a fifth-grade reading level. Hemingway also provides suggestions on how to improve your writing—identifying hard-to-read sentences or places to alter word choice. - -If you're struggling with coming up with alternative words, check out the suggestions at the [Plain English Campaign][3] or the crowdsourced suggestions at [Power Thesaurus][4]. - -#### Know which words to avoid - -> "Substitute 'damn' every time you're inclined to write 'very'; your editor will delete it and the writing will be just as it should be." -> —Mark Twain - -When writing a tutorial or how-to guide, here are some words to avoid, including "simple," "easy," and "just." You, an expert on the topic you're writing about, may find things easy after years of practice. A beginner may not find things simple or easy. Your readers may get frustrated because they don't find the process or explanation simple. - -Have you ever had to reread a sentence or paragraph multiple times because you couldn't figure out what the writer was saying? Have you ever given up on an article because it wasn't making sense to you? I have. - -As a writer, do you want your readers to feel confused or unintelligent? I hope not. - -Other words to avoid in your writing: - - * That - * Really - * Very - * So - * In order to - - - -Generally, these words can be deleted without changing the meaning of a sentence. - -After I finish writing, I search a document for instances of those words. When I searched through this document, I found the following sentence: - -> "This doesn't imply that your audience only has an eighth-grade education, it means that your writing will be more easily understood." - -Two instances of "that" appear in this sentence. They're not adding value to the sentence. They can be deleted without changing its meaning. Removing those instances shortens the sentence, and shorter sentences are easier to understand. And speaking of shorter sentences, I also re-wrote it as two sentences. - -> "This doesn't imply your audience has only an eighth-grade education. It means your writing will be more easily understood." - -#### Use inclusive language - -The historical context of words and phrases can lead to people feeling excluded or offended. When writing, you want to make the reader feel included. When you use inclusive language, it makes your reader feel understood, respected, and like they belong. I refer to this [guide on using inclusive language][5] from Buffer. - -### Revising and editing - -> "Almost all good writing begins with terrible first efforts. You need to start somewhere." -> —Anne Lamott - -Writing is an iterative process. If you think writers sit down at their desk and, within an hour, have a completed article ready to be published, think again. Some articles take me weeks to complete. Here's a standard process for me: - - * Write a rough first draft. By rough, I mean _rough_. I write without worrying about grammar. The idea is to get words out of my head and onto paper. This step can take anywhere from an hour to a couple of weeks. - * Put the draft away for some time. This can be anywhere from a couple of hours to a couple of days, depending on the publishing timeline. - * Review the draft. Make tweaks and edits. - * Ask for feedback, either from a coworker or a friend. During this phase of feedback, I focus on clarity. Does everything make sense? Is anything confusing, any missing sections? - * Incorporate feedback. No matter how experienced you are at writing, other writers reviewing your work will make it better. - - - -At this stage, I have a pretty solid draft. Now comes my least favorite part of writing—editing. The Hemingway App I mentioned earlier not only tells you the reading level but also provides suggestions to improve your writing. I also use Grammarly to help with grammar edits. For open source alternatives to Grammarly, check out [Language Tool][6] or this article on [open source writing tools][7]. - -One of my writing challenges is using commas appropriately. Grammarly helps me figure out where I miss or misuse a comma. Grammarly identified 43 issues related to the correctness of this article's final draft. The majority were comma errors. - -![Errors identified by Grammarly][8] - -(Dawn Parzych, [CC BY-SA 4.0][9]) - -In addition to grammatical errors, the app also provides suggestions to help with clarity, engagement, and delivery (some of these features may not be available in the free version). This includes things like word choice and using active vs. passive voice. Some suggestions I accept; others I reject. After reviewing all the alerts and suggestions, Grammarly reports back across all dimensions. - -![Grammarly results][10] - -(Dawn Parzych, [CC BY-SA 4.0][9]) - -Don't be afraid to ask for help with your writing. Behind every good writer is a good editor or a good editing app. - -### Style guides - -Style guides provide standards for improving communication in writing. They include aspects such as punctuation, grammar, and word usage. If writing a document for your company, check to see if it uses a style guide. If it doesn't have a style guide, or if you're writing for yourself, here are some common style guides to follow: - - * [Chicago Manual of Style][11] - * [Google Developer Documentation Guide][12] - * [Microsoft Writing Style Guide][13] - * [AP Stylebook][14] - - - -Writing is a way to share your thoughts and knowledge with the community. The only way to get started writing is to start typing. Use these suggestions to fine-tune your writing. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/5/write-about-open-source-software - -作者:[Dawn Parzych][a] -选题:[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/dawnparzych -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/doc-dish-lead.png?itok=h3fCkVmU (Typewriter in the grass) -[2]: http://www.hemingwayapp.com/ -[3]: http://www.plainenglish.co.uk/the-a-z-of-alternative-words.html -[4]: https://www.powerthesaurus.org/ -[5]: https://open.buffer.com/inclusive-language-tech/ -[6]: https://languagetool.org/ -[7]: https://opensource.com/article/20/3/open-source-writing-tools -[8]: https://opensource.com/sites/default/files/uploads/grammarlyerrors.png (Errors identified by Grammarly) -[9]: https://creativecommons.org/licenses/by-sa/4.0/ -[10]: https://opensource.com/sites/default/files/uploads/grammarlyresults.png (Grammarly results) -[11]: https://www.chicagomanualofstyle.org/home.html -[12]: https://developers.google.com/style -[13]: https://docs.microsoft.com/en-us/style-guide/welcome/ -[14]: https://www.apstylebook.com/ diff --git a/translated/tech/20200526 How to write about open source software.md b/translated/tech/20200526 How to write about open source software.md new file mode 100644 index 0000000000..c0b0decd3c --- /dev/null +++ b/translated/tech/20200526 How to write about open source software.md @@ -0,0 +1,175 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to write about open source software) +[#]: via: (https://opensource.com/article/20/5/write-about-open-source-software) +[#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych) + +如何写好关于开源软件的文章 +====== + +> 通过以下提示,成为一个更好的作家。 + +![Typewriter in the grass][1] + +开始接触开源社区的一个方法就是写关于它的文章。你可以贡献技术文档,分享你如何使用软件,或者为我们写一篇文章。但是开始写作是说起来容易做起来难。我听到的最常见的两个不写文章的借口是:“我没有什么新东西可说”和“我不是一个好的作家”。我在这里是为了打破这两个误区。 + +### 你应该写什么? + +> “寻找那些经常被遗漏的故事。” +> 埃里克·拉尔森 + +对于一些人来说,写作的最大障碍是产生一个想法或话题,以写出一个想法或话题。很容易就落入了这样的陷阱:“这个话题已经写过了,何必再麻烦。” + +我不是第一个写文章的人,也不会是最后一个。我带来的是我独特的视角和这些年来所学到的东西。曾经有人向我请教过一些关于写作入门的建议,或者是如何让自己的写作更上一层楼。我决定把这些建议变成一篇文章。 + +文如其人,没有人会以你的方式来述事,你的经历和视角可能正是别人所需要的。 + +这里有一些提示,可以帮助你想出一个主题: + +* 你最近学到了什么东西?写出你是如何学习的,你学到了什么,或者是什么事情让你感到惊讶。 +* 你经常被问到的问题是什么?把答案写出来。 +* 你最近是否在搜索一篇怎么做的文章,但在搜索结果中,你对排名靠前的文章不满意?请写出你要找的文章。 +* 你是否参加过一次会议或研讨会?写一篇会后总结,说明你所学到的东西。 +* 你开始使用新工具了吗?写一份操作指南或入门指南。 + +### 你写的是什么类型的文章? + +有不同类型的文章,包括: + +* 技术文档 +* 操作指南 +* 博客 +* 白皮书或电子书 +* 回顾性的文章 + +内容的类型会影响你的写作风格和语气。博客更多的是非正式和对话式的。技术文档更正式,更具有指导性。 + +### 你是为谁而写的? + +每一篇文章都应该有一个受众。受众是指你所写的对象是什么类型的人。在你开始写作之前,写下你的读者的一些特征,这对你的读者有帮助。重要的是要考虑到你要为谁写,以及你**不是为**谁写的 —— 确定你的目标受众将决定你的目标受众,要包括哪些内容和不包括哪些内容。 + +例如,我在写这篇文章的时候,我设想的目标受众是这样的。 + +* 有基本的写作和语法知识 +* 有兴趣提高写作能力 +* 在技术领域担任开发人员、销售工程师、客户经理或类似职位的工作 +* 不是有经验或高级作家,可能在个人或工作博客上发表过几篇文章,想写更多的文章。 +* 非虚构写作 + +如果你有针对多个受众的内容,可以考虑针对不同的受众将其分解成不同的内容。在你的受众中需要考虑的一些部分。 + +* 专业水平:新手、中级、高级 +* 作用:管理人员、个人贡献者 +* 目标:他们为什么要阅读这些? + +### 言语很重要 + +你选择的词语会对读者产生影响。晦涩难懂的词会使文章更难理解,不常见的词会让读者觉得自己很笨,某些词可能会不小心冒犯读者。作为一个作家,你的目标是避免所有这些。下面是怎么做的。 + +#### 使用日常用语 + +不要把写作作为炫耀你的词汇量或你从“每日一字”台历上学到的单词的方式。写作是为了让读者能够理解。每一篇文章都有一个关联的阅读水平。如果你写的是技术文档,那么你的目标大约是初中的阅读水平。这并不意味着你的受众只有初中的教育水平。它意味着你的写作会更容易被人理解。你想让人们对这些言语过目不忘,还是想让他们觉得自己学到了什么?虽然你可以使用长而复杂的词汇,但并不意味着你应该这样做。使用简单的语言不一定意味着你的文章会很无聊。 + +使用 [Hemingway 应用][2]等工具来检查你的作文的可读性(它不是开源的,但很优秀)。比如说,这篇文章经过初稿后,被评定为五级阅读水平。Hemingway 还提供了如何改进写作的建议 —— 找出难读的句子或需要改变选词的地方。 + +如果你正在纠结于想出替代词,可以查看 [Plain English Campaign][3] 的建议或 [Power Thesaurus][4] 的众包建议。 + +#### 知道应该规避哪些词 + +> “每次你想写‘非常’的时候,就用‘该死的’代替;你的编辑会把它删掉,写出来的东西就会像它应该写的那样。” +> 马克·吐温 + +在写教程或指南的时候,这里有一些要避免的词,包括“简单simple”、“容易easy”和“就这样just”。你是你所写的主题的专家,经过多年的实践,可能会觉得事情很简单。而初学者可能会觉得事情不简单,也不容易。你的读者可能会感到沮丧,因为他们觉得过程或解释并不简单。 + +你是否曾经因为无法理解作者的意思而不得不多次重读一个句子或段落?你有没有因为一篇文章对你来说没有意义而放弃过?我有过。 + +作为一个作家,你希望你的读者感到困惑或不理解吗?我希望不会。 + +在你的写作中要避免的其他词语 + +* 这件事That +* 真的Really +* 非常Very +* 所以So +* 为了In order to + +一般来说,这些词可以在不改变句子意思的情况下删除。 + +在我写完之后,我会在一个文档中搜索这些词的实例。当我在这个文档中搜索时,我发现了以下这句话。 + +> “这并不意味着你的受众只有初中的教育水平*这件事*,而意味着你的写作会更容易被理解*这件事*。” + +这句话中出现了两个“这件事That”的例子。它们并没有给句子增加价值。它们可以被删除而不改变其意义。删除这些实例可以缩短句子,而更短的句子更容易理解。而说到短句,我还把它改写成了两句话。 + +> “这并不意味着你的受众只有初中的教育水平。它意味着你的写作会更容易被人理解。” + +#### 使用包容性语言 + +词语和短语的历史背景会让人感到被排斥或反感。在写作时,你要让读者感到被包容。当你使用包容性的语言时,会让读者感到被理解、被尊重,感觉自己是属于他们的。我参考了 Buffer 中的这篇[关于使用包容性语言的指南][5]。 + +### 修订和编辑 + +> “几乎所有好的写作都是从可怕的第一次努力开始的。你需要从某个地方开始。” +> 安妮·拉莫特 + +写作是一个迭代的过程。如果你认为作家们坐在办公桌前,在一个小时内就能完成一篇文章发表,那么请你再想一想。有些文章需要我花几个星期的时间来完成。以下是我的一个标准流程: + +* 写一个粗略的初稿。我说的粗略,我的意思是*草稿*。我写的时候不用担心语法问题。我的想法是让文字从我的脑海中浮现出来,写在纸上。这一步可能需要一个小时到几周的时间。 +* 将草稿放一段时间。这可能需要几个小时到几天的时间,这取决于出版时间线。 +* 审阅草稿。进行调整和编辑。 +* 征求反馈意见,可以是同事或朋友的反馈意见。在这个阶段的反馈中,我的重点是明确性。是否有意义?是否有什么令人困惑的地方,有什么缺失的部分? +* 纳入反馈意见。无论你的写作经验有多丰富,其他作者审阅你的作品,都会让你的作品变得更好。 + +在这个阶段,我有了一个相当扎实的草稿。现在到了我最不喜欢的写作部分 —— 编辑。我之前提到的 Hemingway 应用不仅能告诉你阅读水平,还能提供改进写作的建议。我还使用 Grammarly 来帮助编辑语法。关于 Grammarly 的开源替代工具,请查看[语言工具][6]或这篇文章中的[开源写作工具][7]。 + +我的写作挑战之一就是适当地使用逗号。Grammarly 可以帮助我找出我错过或误用逗号的地方。Grammarly 发现了 43 个与这篇文章的最终草稿的正确性有关的问题。其中大部分是逗号错误。 + +![Errors identified by Grammarly][8] + +除了语法错误之外,该应用程序还提供了一些建议,以帮助提高清晰度、参与度和表达能力(其中一些功能可能在免费版中没有)。这包括单词选择和使用主动语气与被动语气等。有些建议我接受,有些则拒绝。在审查了所有的警报和建议后,Grammarly 会在所有的维度上进行反馈。 + +![Grammarly results][10] + +不要害怕寻求写作上的帮助。每一个好的作家背后都有一个好的编辑或好的编辑应用。 + +### 风格指南 + +文体指南为改进写作中的交流提供了标准。它们包括标点符号、语法和用词等方面。如果是为你的公司撰写文档,请检查一下是否使用了文体指南。如果没有文体指南,或者你是为自己写的,下面是一些常用的文体指南。 + +* [芝加哥文体手册][11] +* [谷歌开发者文档指南][12] +* [微软写作风格指南][13] +* [AP 风格手册] [14] + +写作是一种与社会分享自己的思想和知识的方式。开始写作的唯一方法就是开始打字。用这些建议来微调你的写作。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/write-about-open-source-software + +作者:[Dawn Parzych][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dawnparzych +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/doc-dish-lead.png?itok=h3fCkVmU (Typewriter in the grass) +[2]: http://www.hemingwayapp.com/ +[3]: http://www.plainenglish.co.uk/the-a-z-of-alternative-words.html +[4]: https://www.powerthesaurus.org/ +[5]: https://open.buffer.com/inclusive-language-tech/ +[6]: https://languagetool.org/ +[7]: https://opensource.com/article/20/3/open-source-writing-tools +[8]: https://opensource.com/sites/default/files/uploads/grammarlyerrors.png (Errors identified by Grammarly) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/uploads/grammarlyresults.png (Grammarly results) +[11]: https://www.chicagomanualofstyle.org/home.html +[12]: https://developers.google.com/style +[13]: https://docs.microsoft.com/en-us/style-guide/welcome/ +[14]: https://www.apstylebook.com/ From 4f1a7f39e5233eb85171d7d324adbe7e04cf90ac Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 May 2020 11:15:05 +0800 Subject: [PATCH 0854/1809] PRF @lnrCoder --- ...n Linux Apps in Windows (Thanks to WSL).md | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/translated/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md b/translated/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md index 61334d55c0..5511bc55ac 100644 --- a/translated/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md +++ b/translated/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md @@ -1,77 +1,78 @@ [#]: collector: (lujun9972) [#]: translator: (lnrCoder) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Now You Can Run Linux Apps in Windows (Thanks to WSL)) [#]: via: (https://itsfoss.com/run-linux-apps-windows-wsl/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -现在您可以在 Windows 中运行 Linux 应用(多亏了 WSL) +现在你可以在 Windows 中运行 Linux 应用了 ====== -微软最近的 “[Build 2020][1]” 开发者大会公布了一些有趣的公告。 我不确定这该令人兴奋还是该令人怀疑 — 但是微软,你现在比以往任何时候都受到我们的关注。 +![](https://img.linux.net.cn/data/attachment/album/202005/27/111439z64u19z6ct6r46kb.jpg) -同时,在所有公告中,能够在 WSL(Windows Subsystem for Linux)上运行 GUI 应用程序的功能备受关注。 +微软最近的 “[Build 2020][1]” 开发者大会公布了一些有趣的公告。我不确定这该令人兴奋还是该令人怀疑 —— 但是微软,你现在比以往任何时候都受到我们的关注。 -别忘了 [Xamrin.Forms 更名为 MAUI 的尴尬结局][2],它与 [Nitrux Linux.][4] 的 Uri Herrera 的现有开源项目([Maui Project][3])相冲突。 +同时,在所有的这些公告中,能够在 WSL(Windows Subsystem for Linux)上运行 GUI 应用程序的功能备受关注。 -以为防止你不不清楚,WSL 是一种环境,可让你在 Windows 10 中获得纯控制台 Linux 的体验。它也是在 [Windows 中运行 Linux 命令的最佳方法][5]之一。 +更不要忘了 [Xamrin.Forms 更名为 MAUI 的尴尬结局][2],它与 [Nitrux Linux][4] 的 Uri Herrera 的现有开源项目([Maui Project][3])名字冲突。 -正如 [Liam Dawe][7] 认为的那样,通过博客文章([DirectX ❤ Linux][6])发布的公告可能是只是个诱饵。但是,仍然值得一提。 +以防你不清楚,WSL 是一种环境,可让你在 Windows 10 中获得 Linux 控制台的体验。它也是在 [Windows 中运行 Linux 命令的最佳方法][5]之一。 + +正如 [Liam Dawe][7] 认为的那样,通过博客文章([DirectX ❤ Linux][6])发布的公告可能是只是个公关诱饵。但是,仍然值得一提。 ### WSL 上对 Linux GUI 应用程序的支持 ![][8] -最近,Microsoft 在在线开发者大会上宣布了 WSL(又名 WSL 2)的一系列新功能。 +最近,Microsoft 在在线开发者大会上宣布了 WSL(即 WSL 2)的一系列新功能。 -[Windows Package Manager][9],[Windows Terminal 1.0][10],以及其他一些功能的引入是其亮点。 +[Windows 包管理器][9]、[Windows 终端 1.0][10],以及其他一些功能的引入是其亮点。 -但是,支持 GPU 硬件加速的 Windows 的 Linux 2 子系统非常重要。 +但是, WSL 2 对 GPU 硬件加速的支持非常重要。 那么,是否意味着你可以使用 WSL 在 Windows 上运行 Linux 应用程序呢?看起来像是。 -微软计划通过使用全新的 Linux 内核驱动程序 **dxgkrnl** 来实现。 -Microsoft plans to make it happen using a brand-new Linux kernel driver **dxgkrnl**。 为了给你一个技术简报, 我在这里引用他们的公告中的描述: +微软计划通过使用全新的 Linux 内核驱动程序 `dxgkrnl` 来实现它。为了给你一个技术性的简报, 我在这里引用他们的公告中的描述: ![Linux Kernel Driver Wsl][11] -> Dxgkrnl 是 Linux 的全新内核驱动程序,它将 **/dev/dxg** 设备暴露给用户模式的 Linux。 **/dev/dxg** 暴露了一组 IOCTL,他们与 Winodws 上的原生 WDDM D3DKMT 内核服务层非常相似。Linux 内核中的 Dxgkrnl 通过 VM 总线连接到 Windows 主机上,并使用此 VM 总线连接与物理 GPU 进行通讯。 +> dxgkrnl 是一个全新的 Linux 内核驱动程序,它将 `/dev/dxg` 设备提供给用户模式的 Linux。 `/dev/dxg` 提供了一组 IOCTL,它们与 Winodws 上的原生 WDDM D3DKMT 内核服务层非常相似。Linux 内核中的 dxgkrnl 通过 VM 总线连接到 Windows 主机上,并使用此 VM 总线连接与物理 GPU 进行通讯。 -我不是这方面的专家,但这以为蛇 WSL 上的 Linux 应用程序将具有与本机 Windows 应用程序相同的 GPU 访问权限。 +我不是这方面的专家,但这意味着 WSL 上的 Linux 应用程序将与原生的 Windows 应用程序一样可以访问 GPU。 -针对 GUI 应用程序的支持将在今年秋季的晚些时候提供 (而不是 2020 年 5 月的更新) — 所以我们跌看看什么时候提供。 +针对 GUI 应用程序的支持将在今年秋季的晚些时候提供(而不是 2020 年 5 月的更新) —— 所以我们要看看什么时候提供。 -微软专门针对的是那些系统在 Windows 上轻松使用 Linux IDE 的开发人员。Google 还通过 [将 GUI Linux 应用程序引入 Chromebook ][12] 来针对相同的用户群。 +微软专门针对的是那些希望在 Windows 上轻松使用 Linux IDE 的开发人员。谷歌也在瞄准同样的用户群,[将 GUI Linux 应用程序引入到 Chromebook][12]。 -好吧,对于想要使用 Windows 的用户来说,这是个好消息。但是,这是真的吗? +那么,对于那些坚持使用 Windows 的用户来说,这是个好消息。但是,这是真的吗? -### 微软爱上了 Linux — 真的吗? +### 微软爱上了 Linux —— 真的吗? ![Microsoft Loves Linux][13] -他们通过努力在 Windows 上整合 Linux 环境来拥抱 Linux 及其优势,绝对是一件好事。 +他们在 Windows 上整合 Linux 环境来拥抱 Linux 及其优势的努力,绝对是一件好事。 -但是,如何真正帮助 **Linux 桌面用户**呢?到目前为止,我还没有看到任何实际的好处。 +但是,它真的能给**桌面 Linux 用户**带来什么好处呢?到目前为止,我还没有看到任何实际的好处。 -你可以在这里随意发表不同意见。但是,我认为 WSL 的开发对于 Linux 桌面用户来说没有实际的价值。至少目前为止没有。 +在这里,你可以有不同的看法。但是,我认为 WSL 的开发对于 Linux 桌面用户来说没有真正的价值。至少,到目前为止没有。 -有趣的是,[Linux Unplugged podcast][14] 上有人强调了微软的举动,以其闻名的 EEE (Embrace, extend, and extinguish) 为代表。 +有趣的是,[Linux Unplugged podcast][14] 上有人强调了微软的举动,认为这与他们的 EEE(拥抱、延伸和扑灭Embrace, extend, and extinguish)的思路是一致的。 -可能,谁知道呢?当然,他们为实现这一目标而付出的努力值得赞赏 — 同时又令人感到兴奋和神秘。 +可能吧,谁知道呢?当然,他们为实现这一目标而付出的努力值得赞赏 —— 同时又令人感到兴奋和神秘。 -### 这是否以为着 Windows 用户将不必再切换到 Linux? +### 这是否以为着 Windows 用户将不必再转到 Linux? -微软之所以在其平台上集成 Linux,是因为他们知道 Liunx 的功能以及开发人员(或用户)喜欢使用的原因。 +微软之所以在其平台上集成 Linux,是因为他们知道 Liunx 的能力,也知道开发人员(或用户)喜欢使用它的原因。 但是,随着 WSL 2 的更新,如果这种情况持续下去,我倾向于同意 Abhishek 的看法: -> 最终,桌面 Linux 将被限制为 Windows 下的桌面应用程序。 +> 最终,桌面 Linux 将被限制在 Windows 下,成为桌面应用程序…… -好吧,当然,原生的体验暂时还是比较好的。而且,很难看到现有的 Linux 桌面用户会使用 Windows 来将其替代。但是,这仍然是值得担心的。 +好吧,当然,原生的体验暂时还是比较好的。而且,很难看到现有的 Linux 桌面用户会使用 Windows 来将其替代。但是,这仍然值得担心。 -你如何看待这一切? 我不认为 WSL 对于被迫使用 Windows 的用户有什么好处 — 但是,从长远来看,你认为微软在 WSL 方面的进展本质上是敌意还是对 Linux 有帮助? +你如何看待这一切?我不认为 WSL 对于被迫使用 Windows 的用户有什么好处 —— 但是,从长远来看,你认为微软在 WSL 方面的进展本质上是敌意还是对 Linux 有帮助? 在评论中让我知道你的想法! @@ -82,7 +83,7 @@ via: https://itsfoss.com/run-linux-apps-windows-wsl/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[lnrCoder](https://github.com/lnrCoder) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 574202532de153b96d4684d99b8acba17df7505a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 May 2020 11:21:06 +0800 Subject: [PATCH 0855/1809] PUB @lnrCoder https://linux.cn/article-12254-1.html --- ...5 Now You Can Run Linux Apps in Windows (Thanks to WSL).md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md (98%) diff --git a/translated/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md b/published/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md similarity index 98% rename from translated/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md rename to published/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md index 5511bc55ac..21173f87f8 100644 --- a/translated/tech/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md +++ b/published/20200525 Now You Can Run Linux Apps in Windows (Thanks to WSL).md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lnrCoder) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12254-1.html) [#]: subject: (Now You Can Run Linux Apps in Windows (Thanks to WSL)) [#]: via: (https://itsfoss.com/run-linux-apps-windows-wsl/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 2327b530afc33b19214462a4dd9400887311ead8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 May 2020 12:03:50 +0800 Subject: [PATCH 0856/1809] PRF @lxbwolf --- ... personal file server with SSH on Linux.md | 72 +++++++++---------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/translated/tech/20200323 How to create a personal file server with SSH on Linux.md b/translated/tech/20200323 How to create a personal file server with SSH on Linux.md index 82049848e6..b495ebb3b2 100644 --- a/translated/tech/20200323 How to create a personal file server with SSH on Linux.md +++ b/translated/tech/20200323 How to create a personal file server with SSH on Linux.md @@ -1,46 +1,48 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to create a personal file server with SSH on Linux) [#]: via: (https://opensource.com/article/20/3/personal-file-server-ssh) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) -怎样在 Linux 下用 SSH 搭建私人文件服务器 +怎样在 Linux 下用 SSH 搭建个人文件服务器 ====== -通过 SSH 连接远程 Linux 系统很简单。下面是教程。 -![Hand putting a Linux file folder into a drawer][1] -使用树莓派可以搭建对很多事物有用的廉价家庭服务器。我的树莓派最常用来做[打印服务器][2],可以在我的家庭网络中共享激光打印机,或作为私人文件服务器保存项目副本和其他数据。 +> 通过 SSH 连接远程 Linux 系统很简单。下面是教程。 -我的文件服务器有很多用途。假设我现在有一个项目,比如一本新书,我想备份我的工作的快照和所有关联的文件。这种场景下,我只需要把 **BookProject** 文件夹复制到文件服务器的 **BookBackup** 文件夹。 +![](https://img.linux.net.cn/data/attachment/album/202005/27/120338v62cakrqnccpjckk.jpg) -或者我现在正在清理我的本地文件,我发现有些文件现在不需要,但是我不确定是否要删除,我会把它们复制到文件服务器的 **KeepForLater** 文件夹。对于清理我日常用的 Linux 系统上杂乱的文件,以及把不常用的文件备份到私人文件服务器,这是一种很方便的方法。 +树莓派是一个有用且价格低廉的家庭服务器,可用于很多事情。我的树莓派最常用来做[打印服务器][2],可以在我的家庭网络中共享激光打印机,或作为个人文件服务器保存项目副本和其他数据。 -用树莓派或其他 Linux 系统搭建私人文件服务器不需要配置 NFS(网络文件系统Network File System>)或 CIFS(通用互联网文件系统Common Internet File System)或改造其他的文件共享系统如 WebDAV。你可以很轻松的使用 SSH 来搭建远程文件服务器。下面是教程。 +我的文件服务器有很多用途。假设说我现在有一个项目,比如一本新书,我想把我的工作和所有相关的文件都复制一份快照。这种场景下,我只需要把 `BookProject` 文件夹复制到文件服务器的 `BookBackup` 文件夹。 + +或者我现在正在清理我的本地文件时,发现一些我不需要的文件,但是我不确定是否要删除,我会把它们复制到文件服务器的 `KeepForLater` 文件夹。这是我日常 Linux 系统中清除杂乱的文件,并将不常用的文件卸载到个人文件服务器上的方便方法。 + +用树莓派或其他 Linux 系统搭建个人文件服务器不需要配置 NFS(网络文件系统Network File System>)或 CIFS(通用互联网文件系统Common Internet File System)或改造其他的文件共享系统如 WebDAV。你可以很轻松的使用 SSH 来搭建远程文件服务器。下面是教程。 ### 在远程服务器上配置 SSHD -你的 Linux 系统可能已经安装了 SSH daemon(sshd),甚至它是默认执行的。如果没有运行,你可以使用你 Linux 发行版本上你想要的任何控制面板来轻松配置 SSH。我在树莓派上运行了 [Fedora ARM][3],通过把树莓派的 web 浏览器指向 9090 端口,我可以远程访问控制面板。(在我的家庭网络中,树莓派的 IP 地址是 **10.0.0.11**,因此我连接的是 **10.0.0.11:9090**。)如果 SSH daemon 默认没有运行,你可以在控制面板的 Services 里把它设置为开机启动。 +你的 Linux 系统可能已经安装了 SSH 守护进程(`sshd`),甚至它已经默认运行了。如果没有,你可以使用你 Linux 发行版本上的任何控制面板来轻松配置 SSH。我在树莓派上运行了 [Fedora ARM][3],通过 Web 浏览器访问树莓派的 9090 端口,我可以远程访问控制面板。(在我的家庭网络中,树莓派的 IP 地址是 `10.0.0.11`,因此我连接的是 `10.0.0.11:9090`。)如果 SSH 守护进程没有默认运行,你可以在控制面板的“服务”里把它设置为开机启动。 ![sshd in the list of system services][4] -你可以在系统服务列表里找到 sshd。 +你可以在系统服务列表里找到 `sshd`。 ![slider to activate sshd][5] -如果 **sshd** 没有开启,点击切换按钮打开它。 +如果 `sshd` 没有开启,点击切换按钮打开它。 ### 你有账号吗? 你需要有个远程系统的账号。它可以与你本地系统的账号相同,也可以不同。 -在流行的 Raspbian 发行版本上,默认的账号名是 **pi**。但是其他的 Linux 发行版本可能需要你在安装系统时就设置一个独一无二的新用户。如果你不知道你的用户名,你可以用系统的控制面板创建一个。在我的树莓派上,我创建了一个 **jhall** 账号,与我日常用的 Linux 桌面机器的用户名相同。 +在流行的 Raspbian 发行版本上,默认的账号名是 `pi`。但是其他的 Linux 发行版本可能需要你在安装系统时就设置一个唯一的新用户。如果你不知道你的用户名,你可以用系统的控制面板创建一个。在我的树莓派上,我创建了一个 `jhall` 账号,与我日常用的 Linux 桌面机器的用户名相同。 ![Set up a new account on Fedora Server][6] -如果你用的是 Fedora 服务器,你可以点击 **Create New Account** 按钮来创建新账号。 +如果你用的是 Fedora 服务器,你可以点击“创建新账号”按钮。 ![Set password or SSH key][7] @@ -50,41 +52,37 @@ 如果你把公钥添加到远程 Linux 系统上,你就可以不使用密码登录。这一步是可选的;如果你愿意,你仍可以用密码登录。 -你可以在下面 Opensource.com 的文章中学到更多关于 SSH key 的信息: +你可以在下面的文章中学到更多关于 SSH 密钥的信息: - * [SSH key 管理工具][8] - * [用 Seahorse 对 SSH key 进行图形化管理][9] - * [如何管理多个 SSH key][10] - * [使用 GPG key 作为鉴权依据开启 SSH 访问][11] +* [SSH 密钥管理工具][8] +* [用 Seahorse 对 SSH 密钥进行图形化管理][9] +* [如何管理多个 SSH 密钥][10] +* [使用 GPG 密钥作为鉴权依据开启 SSH 访问][11] +### 创建文件管理器的快捷方式 - -### 创建文件管理器快捷方式 - -现在你已经在远程系统上启动 SSH daemon 了,也设置了用户名和密码,最后一步就是在你本地的文件管理器中创建一个快捷方式,地址映射到远程 Linux 系统。我的桌面是 GNOME,但是在其他的 Linux 桌面上的基本操作步骤都是一样的。 +现在你已经在远程系统上启动 SSH 守护进程了,也设置了用户名和密码,最后一步就是在你本地的文件管理器中创建一个快捷方式,地址映射到远程 Linux 系统。我的桌面是 GNOME,但是在其他的 Linux 桌面上的基本操作步骤都是一样的。 #### 建立初始连接 -在 GNOME 的文件管理器中,在左边导航栏找到 **+Other Locations** 按钮。点击它会出现一个 **Connect to Server** 提示框。在框中输入远程 Linux 服务器的地址,地址以 SSH 连接协议开头。 +在 GNOME 的文件管理器中,在左边导航栏找到 “+其它位置” 按钮。点击它会出现一个 “连接到服务器” 提示框。在框中输入远程 Linux 服务器的地址,地址以 SSH 连接协议开头。 ![Creating a shortcut in GNOME file manager][12] -GNOME 文件管理器支持多种连接协议。以 **sftp://** 或 **ssh://** 开头的服务器地址,会创建 SSH 连接。 - -如果你远程 Linux 系统的用户名与本地的相同,那么你只需要输入服务器的地址和文件夹路径就可以了。比如要连接到我的树莓派的 **/home/jhall** 目录,我输入: +GNOME 文件管理器支持多种连接协议。要通过 SSH 进行连接,服务器地址请以 `sftp://` 或 `ssh://` 开头。 +如果你远程 Linux 系统的用户名与本地的相同,那么你只需要输入服务器的地址和文件夹路径就可以了。比如要连接到我的树莓派的 `/home/jhall` 目录,我输入: ``` -`sftp://10.0.0.11/home/jhall` +sftp://10.0.0.11/home/jhall ``` ![GNOME file manager Connect to Server][13] -如果你远程 Linux 系统的用户名与本地的不同,你可以在远程系统地址前加 **@** 符号来指定远程系统的用户名。要连接到远程的 Raspbian 系统,你可能要输入: - +如果你远程 Linux 系统的用户名与本地的不同,你可以在远程系统地址前加 `@` 符号来指定远程系统的用户名。要连接到远程的 Raspbian 系统,你可能要输入: ``` -`sftp://pi@10.0.0.11/home/pi` +sftp://pi@10.0.0.11/home/pi ``` ![GNOME file manager Connect to Server][14] @@ -95,15 +93,15 @@ GNOME 文件管理器支持多种连接协议。以 **sftp://** 或 **ssh://** #### 创建一个快捷方式,之后就可以轻松连接服务器 -在 GNOME 文件管理器中,这很简单。右击导航栏中远程系统的名字,选择 **Add Bookmark** 。这一步操作就创建了连接到远程路径的快捷方式。 +在 GNOME 文件管理器中,这很简单。右击导航栏中远程系统的名字,选择“添加书签”。这一步操作就创建了连接到远程路径的快捷方式。 ![GNOME file manager - adding bookmark][16] -如果你想把标签中的快捷方式改成一个更容易记的名字,你可以右击快捷方式选择 **Rename**。 +如果你想把标签中的快捷方式改成一个更容易记的名字,你可以右击快捷方式选择“重命名”。 -### 总结! +### 总结 -通过 SSH 连接到远程 Linux 系统是很简单的事。你可以用相同的方式连接到家庭文件服务器以外的其他系统。我还创建了一个能让我立即访问我的提供商的 web 服务器上的文件的快捷方式和另一个能迅速打开我的项目服务器的文件夹的快捷方式。SSH 保证了它们是安全的连接;所有的传输都是加密的。当我通过 SSH 打开远程的文件时,我可以像在本地操作一样使用 GNOME 文件管理器轻松打开远程文件。 +通过 SSH 连接到远程 Linux 系统是很简单的事。你可以用相同的方式连接到家庭文件服务器以外的其他系统。我还创建了一个能让我立即访问我的提供商 Web 服务器上的文件的快捷方式,和另一个能迅速打开我的项目服务器的文件夹的快捷方式。SSH 使它成为一个安全的连接;所有的传输都是加密的。当我通过 SSH 打开远程的文件时,我可以像在本地操作一样使用 GNOME 文件管理器轻松打开远程文件。 -------------------------------------------------------------------------------- @@ -112,7 +110,7 @@ via: https://opensource.com/article/20/3/personal-file-server-ssh 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -125,8 +123,8 @@ via: https://opensource.com/article/20/3/personal-file-server-ssh [5]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-sshd-service.png (slider to activate sshd) [6]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-accounts_create-user.png (Set up a new account on Fedora Server) [7]: https://opensource.com/sites/default/files/uploads/fedora-server-control-panel-accounts.png (Set password or SSH key) -[8]: https://opensource.com/article/20/2/ssh-tools -[9]: https://opensource.com/article/19/4/ssh-keys-seahorse +[8]: https://linux.cn/article-11947-1.html +[9]: https://linux.cn/article-9451-1.html [10]: https://opensource.com/article/19/4/gpg-subkeys-ssh-manage [11]: https://opensource.com/article/19/4/gpg-subkeys-ssh [12]: https://opensource.com/sites/default/files/uploads/gnome-file-manager-other-locations.png (Creating a shortcut in GNOME file manager) From 39a523ef5c0302bcf28f9570067706f61ff725be Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 May 2020 12:04:56 +0800 Subject: [PATCH 0857/1809] PUB @lxbwolf https://linux.cn/article-12255-1.html --- ... How to create a personal file server with SSH on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200323 How to create a personal file server with SSH on Linux.md (99%) diff --git a/translated/tech/20200323 How to create a personal file server with SSH on Linux.md b/published/20200323 How to create a personal file server with SSH on Linux.md similarity index 99% rename from translated/tech/20200323 How to create a personal file server with SSH on Linux.md rename to published/20200323 How to create a personal file server with SSH on Linux.md index b495ebb3b2..14abf4cc64 100644 --- a/translated/tech/20200323 How to create a personal file server with SSH on Linux.md +++ b/published/20200323 How to create a personal file server with SSH on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12255-1.html) [#]: subject: (How to create a personal file server with SSH on Linux) [#]: via: (https://opensource.com/article/20/3/personal-file-server-ssh) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) From 2890262c95ae4d609974376a74541ac3ebf06ac2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 May 2020 23:40:47 +0800 Subject: [PATCH 0858/1809] PRF @geekpi --- ...w to Handle Automatic Updates in Ubuntu.md | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/translated/tech/20200501 How to Handle Automatic Updates in Ubuntu.md b/translated/tech/20200501 How to Handle Automatic Updates in Ubuntu.md index f86886d82c..5339f1df60 100644 --- a/translated/tech/20200501 How to Handle Automatic Updates in Ubuntu.md +++ b/translated/tech/20200501 How to Handle Automatic Updates in Ubuntu.md @@ -1,44 +1,48 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Handle Automatic Updates in Ubuntu) [#]: via: (https://itsfoss.com/auto-updates-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -如何在 Ubuntu 中处理自动更新 +如何在 Ubuntu 中处理自动的无人值守升级 ====== -_**简介:本教程教你如何处理无人值守的升级,即 Ubuntu Linux 的自动系统更新。**_ +> 本教程教你如何处理无人值守的升级,即 Ubuntu Linux 的自动系统更新。 + +![](https://img.linux.net.cn/data/attachment/album/202005/27/234040fxb0nkc53pk0nxvx.jpg) 有时,当你尝试[关闭 Ubuntu 系统][1]时,可能看到这个阻止你关闭的页面: -**关机正在进行无人值守升级,请不要关闭计算机。** +> 关机过程中正在进行无人值守升级,请不要关闭计算机。 ![Unattended Upgrade In Progress In Ubuntu][2] -你可能想知道什么是“无人值守的升级”,以及它是如何在你不知情的情况下运行的。 +你可能会问这个“无人值守升级”是什么,怎么会在你不知情的情况下运行呢? -因为 [Ubuntu][3] 非常重视系统的安全性。默认情况下,它会每天自动检查系统更新,如果发现任何安全更新,那么会下载这些更新并自行安装。对于正常的系统和应用更新,它会通过软件更新程序通知你。 +原因是 [Ubuntu][3] 非常重视系统的安全性。默认情况下,它会每天自动检查系统更新,如果发现安全更新,它会下载这些更新并自行安装。对于正常的系统和应用更新,它会通过软件更新程序通知你。 -由于所有这些都是在后台发生的,因此你会直到关机或者尝试自己安装应用时才会意识到。 +由于所有这些都是在后台发生的,所以在你尝试关闭系统或尝试自行安装应用程序之前,你甚至不会意识到这一点。 -在进行这些无人值守的升级时尝试安装新软件会发生[无法获得锁的错误][4]。 +在这些无人值守的升级过程中,尝试安装新软件,会导致著名的[无法获得锁定的错误][4]。 ![][5] 如你所见,自动更新带来了一些小麻烦。你可以选择禁用自动更新,但这意味着你必须一直手动检查并[更新你的 Ubuntu 系统][6]。 -你真的需要禁用自动更新吗? +> **你真的需要禁用自动更新吗?** +> +> 请注意,这是一项安全功能。Linux 实际上允许你禁用系统中的所有功能,甚至禁用这些安全功能。 +> +> 但是我认为,作为普通用户,**你不应该禁用自动更新**。毕竟,它可以确保你的系统安全。 +> +> 为了确保系统的安全性,你可以忍受自动更新所带来的小麻烦。 -请注意,这是一项安全功能。Linux 实际上允许你禁用系统中的所有功能,甚至禁用这些安全功能。 -但是我认为,作为普通用户,_**你不应禁用自动更新**_。毕竟,它可以确保你的系统安全。 -为了确保系统的安全性,你可以忍受自动更新所带来的小麻烦。 +现在,你已经收到警告,还是觉得承担手动更新系统的额外任务更好,那么让我们看看如何处理自动更新。 -现在,你已经收到警告,并认为最好承担手动更新系统的额外任务,让我们看看如何处理自动更新。 - -与往常一样,有两种方法可以做到:GUI 和命令行。 我将向您=你展示两种方法。 +与往常一样,有两种方法可以做到:GUI 和命令行。 我将向你展示两种方法。 我在这里使用 Ubuntu 20.04,但是这些步骤对 Ubuntu 18.04 和任何其他 Ubuntu 版本均有效。 @@ -50,7 +54,7 @@ _**简介:本教程教你如何处理无人值守的升级,即 Ubuntu Linux 在此处,进入“更新”选项卡。查找“自动检查更新”。默认情况下,它设置为“每日”。 -你可以将其更改为“从不”,你的系统将永远不会检查更新。如果不检查更新,它将不会找到要安装的新更新。 +你可以将其更改为“从不”,你的系统将永远不会检查更新。如果不检查更新,它就不会找到要安装的新的更新。 ![Disable Auto Updates in Ubuntu Completely][8] @@ -58,13 +62,13 @@ _**简介:本教程教你如何处理无人值守的升级,即 Ubuntu Linux #### 在 Ubuntu 中处理自动更新的更好方法 -就个人而言,我建议让它自己检查更新。如果你不希望它自动安装更新,那么可以更改该行为以通知有关安全更新的可用性。 +就个人而言,我建议让它自己检查更新。如果你不希望它自动安装更新,那么可以更改该行为,以通知有关安全更新的可用性。 保持“自动检查更新”为“每日”,然后将“有安全更新时”选项更改为“立即显示”,而不是“自动下载并安装”。 ![Get notified for security updates instead of automatically installing them][9] -这样,它会检查是否有更新,而不是在后台自动安装更新,软件更新程序会通知你更新可用于系统。你的系统已经完成正常的系统和软件更新。 +这样,它会检查是否有更新,而不是在后台自动安装更新,软件更新程序会通知你有可用于系统的更新。而你的系统已经完成正常的系统和软件更新。 ![Get notified about security updates][10] @@ -76,13 +80,13 @@ _**简介:本教程教你如何处理无人值守的升级,即 Ubuntu Linux ### 如何在 Ubuntu 中使用命令行禁用自动更新 -你可以在 **/etc/apt/apt.conf.d/20auto-upgrades** 中找到自动升级设置。Ubuntu 终端中的默认文本编辑器是 Nano,因此你可以使用以下命令来编辑此文件: +你可以在 `/etc/apt/apt.conf.d/20auto-upgrades` 中找到自动升级设置。Ubuntu 终端中的默认文本编辑器是 Nano,因此你可以使用以下命令来编辑此文件: ``` sudo nano /etc/apt/apt.conf.d/20auto-upgrades ``` -现在,如果你不希望系统自动检查更新,那么可以将 APT::Periodic::Update-Package-Lists 的值更改为 0。 +现在,如果你不希望系统自动检查更新,那么可以将 `APT::Periodic::Update-Package-Lists` 的值更改为 `"0"`。 ``` APT::Periodic::Update-Package-Lists "0"; @@ -96,9 +100,9 @@ APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Unattended-Upgrade "0"; ``` -**最后** +### 最后 -由于某种原因,启用了自动安全更新,建议你保持这种状态。小的烦恼实际上并不值得冒险损害系统安全性。你怎么看? +由于某种原因,启用了自动安全更新,建议你保持这种状态。这个小烦恼实际上并不值得冒险损害系统安全性。你怎么看? -------------------------------------------------------------------------------- @@ -107,7 +111,7 @@ via: https://itsfoss.com/auto-updates-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5c164d055899445559c2bed98b92b3cd457cfaff Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 May 2020 23:46:20 +0800 Subject: [PATCH 0859/1809] PUB @geekpi https://linux.cn/article-12257-1.html --- .../20200501 How to Handle Automatic Updates in Ubuntu.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200501 How to Handle Automatic Updates in Ubuntu.md (98%) diff --git a/translated/tech/20200501 How to Handle Automatic Updates in Ubuntu.md b/published/20200501 How to Handle Automatic Updates in Ubuntu.md similarity index 98% rename from translated/tech/20200501 How to Handle Automatic Updates in Ubuntu.md rename to published/20200501 How to Handle Automatic Updates in Ubuntu.md index 5339f1df60..4339c22494 100644 --- a/translated/tech/20200501 How to Handle Automatic Updates in Ubuntu.md +++ b/published/20200501 How to Handle Automatic Updates in Ubuntu.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12257-1.html) [#]: subject: (How to Handle Automatic Updates in Ubuntu) [#]: via: (https://itsfoss.com/auto-updates-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 2507e47c89adf94a7865152385be7f3fd19b7dc1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 28 May 2020 01:10:47 +0800 Subject: [PATCH 0860/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200528=20Open?= =?UTF-8?q?=20Source=20YouTube=20Alternative=20PeerTube=20Needs=20Your=20S?= =?UTF-8?q?upport=20to=20Launch=20Version=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200528 Open Source YouTube Alternative PeerTube Needs Your Support to Launch Version 3.md --- ... Needs Your Support to Launch Version 3.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20200528 Open Source YouTube Alternative PeerTube Needs Your Support to Launch Version 3.md diff --git a/sources/tech/20200528 Open Source YouTube Alternative PeerTube Needs Your Support to Launch Version 3.md b/sources/tech/20200528 Open Source YouTube Alternative PeerTube Needs Your Support to Launch Version 3.md new file mode 100644 index 0000000000..ec7ab97e21 --- /dev/null +++ b/sources/tech/20200528 Open Source YouTube Alternative PeerTube Needs Your Support to Launch Version 3.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open Source YouTube Alternative PeerTube Needs Your Support to Launch Version 3) +[#]: via: (https://itsfoss.com/peertube-v3-campaign/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Open Source YouTube Alternative PeerTube Needs Your Support to Launch Version 3 +====== + +[PeerTube][1] (developed by [Framasoft][2]) is a free and open-source decentralized alternative to YouTube somewhat like [LBRY][3]. As the name suggests, it relies on [peer-to-peer connections][4] to operate the video hosting services. + +You can also choose to self-host your instance and also have access to videos from other instances (a federated network, just like [Mastodon][5]). + +It is being actively developed for a few years now. And, to take it up a notch, they have decided to launch a crowdfunding campaign for the next major release. + +The funding campaign will help them develop v3.0 of PeerTube with some amazing key features planned for the release this fall. + +![PeerTube Instance Example][6] + +### PeerTube: Brief Overview + +In addition to what I just mentioned above, PeerTube is a fully-functional peer to peer video platform. The best thing about it is — it’s open-source and free. So, you can check them out on [GitHub][7] if you want. + +You can watch their official video here: + +**Note:** You need to be cautious about your IP address if you have concerns about that on PeerTube (try using one of the [best VPNs available][8]). + +### PeerTube’s Crowdfunding Campaign For v3 Launch + +You’ll be excited to know that the crowdfunding campaign of **€60,000** already managed to **get 10,000 Euros on Day 1** (at the time of writing this). + +Now, coming to the details. The campaign aims to focus on gathering **funds for the next 6 months of development for a v3 release planned for November 2020.** It looks like a lot of work for a single full-time developer — but no matter whether they reach the funding goal, they intend to release the v3 with the existing funds they have. + +In their [announcement post][9], PeerTube team mentioned: + +> We feel like we need to develop it, that we have to. Imposing a condition stating « if we do not get our 60,000€, then there will not be a v3 » here, would be a lie, marketing manipulation : this is not the kind of relation we want to maintain with you. + +Next, let’s talk about the new features they’ve planned to introduced in the next 6 months: + + * Upon reaching the **€10,000 goal,** they plan to work on introducing a globalized video index to make it easier to search for videos across multiple instances. + * With **€**20,000 goal, PeerTube will dedicate one month on improving the moderation tools to make the best out of it. + * With 40,000 goal, they would work on the UX/UI of playlists. So, it will look better when you try to embed a playlist. In addition to this, the plugin system will be improved to make it easier to contribute to PeerTube’s code. + * With the end of the campaign reaching 60,000 goal, PeerTube’s live-streaming feature will be introduced. + + + +You can also find the details of their [roadmap on their site][10]. + +### Wrapping Up + +The ability to have a global inter-connected video index among multiple instances is something that was needed and it will also allow you to configure your own index. + +The content moderation tool improvement is also a huge deal because it’s not that easy to manage a decentralized network of video hosting services. While they aim to prevent censorship, a strict moderation is required to make PeerTube a comfortable place to watch videos. + +Even though I’m not sure about how useful PeerTube’s live-streaming feature will be, at launch. It is going to be something exciting to keep an eye out for. + +We at It’s FOSS made a token donation of 25 Euro. I would also encourage you to donate and help this open source achieve their financial goal for version 3 development. + +[Support PeerTube][11] + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/peertube-v3-campaign/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://joinpeertube.org +[2]: https://framasoft.org/en/ +[3]: https://itsfoss.com/lbry/ +[4]: https://en.wikipedia.org/wiki/Peer-to-peer +[5]: https://itsfoss.com/mastodon-open-source-alternative-twitter/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/peertube-instance-screenshot.jpg?ssl=1 +[7]: https://github.com/Chocobozzz/PeerTube +[8]: https://itsfoss.com/best-vpn-linux/ +[9]: https://framablog.org/2020/05/26/our-plans-for-peertube-v3-progressive-fundraising-live-streaming-coming-next-fall/ +[10]: https://joinpeertube.org/roadmap +[11]: https://joinpeertube.org/roadmap#support From ab227080a1d3e48e9cec3297088864782f4141ef Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 28 May 2020 01:11:04 +0800 Subject: [PATCH 0861/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200528=20Gett?= =?UTF-8?q?ing=20Started=20With=20Nano=20Text=20Editor=20[Beginner?= =?UTF-8?q?=E2=80=99s=20Guide]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200528 Getting Started With Nano Text Editor -Beginner-s Guide.md --- ...With Nano Text Editor -Beginner-s Guide.md | 246 ++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100644 sources/tech/20200528 Getting Started With Nano Text Editor -Beginner-s Guide.md diff --git a/sources/tech/20200528 Getting Started With Nano Text Editor -Beginner-s Guide.md b/sources/tech/20200528 Getting Started With Nano Text Editor -Beginner-s Guide.md new file mode 100644 index 0000000000..90874df3e9 --- /dev/null +++ b/sources/tech/20200528 Getting Started With Nano Text Editor -Beginner-s Guide.md @@ -0,0 +1,246 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting Started With Nano Text Editor [Beginner’s Guide]) +[#]: via: (https://itsfoss.com/nano-editor-guide/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Getting Started With Nano Text Editor [Beginner’s Guide] +====== + +[Nano][1] is the default [terminal-based text editor][2] in Ubuntu and many other Linux distributions. Though it is less complicated to use than the likes of [Vim][3] and [Emacs][4], it doesn’t mean Nano cannot be overwhelming to use. + +In this beginner’s guide, I’ll show you how to use the Nano text editor. I am also going to include a downloadable PDF cheat sheet at the end of the article so that you can refer to it for practicing and mastering Nano editor commands. + +If you are just interested in a quick summary of Nano keyboard shortcuts, please expand the next section. + +Essential Nano keyboard shortcuts (click to expand) + +**Shortcut** | **Description** +---|--- +nano filename | Open file for editing in Nano +Arrow keys | Move cursor up, down, left and right +Ctrl+A, Ctrl+E | Move cursor to start and end of the line +Ctrl+Y/Ctrl+V | Move page up and down +Ctrl+_ | Move cursor to a certain location +Alt+A and then use arrow key | Set a marker and select text +Alt+6 | Copy the selected text +Ctrl+K | Cut the selected text +Ctrl+U | Paste the selected text +Ctrl+6 | Cancel the selection +Ctrl+K | Cut/delete entire line +Alt+U | Undo last action +Alt+E | Redo last action +Ctrl+W, Alt+W | Search for text, move to next match +Ctrl+\ | Search and replace +Ctrl+O | Save the modification +Ctrl+X | Exit the editor + +### How to use Nano text editor + +![][5] + +I presume that you have Nano editor installed on your system already. If not, please your distribution’s package manager to install it. + +#### Getting familiar with the Nano editor interface + +If you’ve ever [used Vim][6] or Emacs, you’ll notice that using Nano is a lot simpler. You can start writing or editing text straightaway. + +Nano editor also shows important keyboard shortcuts you need to use for editing at the bottom of the editor. This way you won’t get stuck at [exiting the editor like Vim][7]. + +The wider your terminal window, the more shortcuts it shows. + +![Nano Editor Interface][8] + +You should get familiar with the symbols in Nano. + + * The caret symbol (^) means Ctrl key + * The M character mean the Alt key + + + +When it says “^X Exit”, it means to use Ctrl+X keys to exit the editor. When it says “M-U Undo”, it means use Alt+U key to undo your last action. + +#### Open or create a file for editing in Nano + +You can open a file for editing in Nano like this: + +``` +nano my_file +``` + +If the file doesn’t exist, it will still open the editor and when you exit, you’ll have the option for saving the text to my_file. + +You may also open a new file without any name (like new document) with Nano like this: + +``` +nano +``` + +#### Basic editing + +You can start writing or modifying the text straightaway in Nano. There are no special insert mode or anything of that sort. It is almost like using a regular text editor, at least for writing and editing. + +As soon as you modify anything in the file, you’ll notice that it reflects this information on the editor. + +![][9] + +Nothing is saved immediately to the file automatically unless you explicitly do so. When you exit the editor using Ctrl+X keyboard shortcut, you’ll be asked whether you want to save your modified text to the file or not. + +#### Moving around in the editor + +Mouse click doesn’t work here. Use the arrow keys to move up and down, left and right. + +You can use the Home key or Ctrl+A to move to the beginning of a line and End key or Ctrl+E to move to the end of a line. Ctrl+Y/Page Up and Ctrl+V/Page Down keys can be used to scroll by pages. + +If you want to go a specific location like last line, first line, to a certain text, use Ctrl+_ key combination. This will show you some options you can use at the bottom of the editor. + +![Jump to a specific line in Nano][10] + +#### Cut, copy and paste in Nano editor + +If you don’t want to spend too much time remembering the shortcuts, use mouse. + +Select a text with mouse and then use the right click menu to copy the text. You may also use the Ctrl+Shift+C [keyboard shortcut in Ubuntu][11] terminal. Similarly, you can use the right click and select paste from the menu or use the Ctrl+Shift+V key combination. + +**Nano specific shortcuts for copy and pasting** + +Nano also provides its own shortcuts for cutting and pasting text but that could become confusing for beginners. + +Move your cursor to the beginning of the text you want to copy. Press Alt+A to set a marker. Now use the arrow keys to highlight the selection. Once you have selected the desired text, you can Alt+6 key to copy the selected text or use Ctrl+K to cut the selected text. Use Ctrl+6 to cancel the selection. + +Once you have copied or cut the selected text, you can use Ctrl+U to paste it. + +![][12] + +#### Delete text or lines in Nano + +There is no dedicated option for deletion in Nano. You may use the Backspace or Delete key to delete one character at a time. Press them repeatedly or hold them to delete multiple characters. + +You can also use the Ctrl+K keys that cuts the entire line. If you don’t paste it anywhere, it’s as good as deleting a line. + +If you want to delete multiple lines, you may use Ctrl+K on all of them one by one. + +Another option is to use the marker (Ctrl+a). Set the marker and move the arrow to select a portion of text. Use Ctrl+K to cut the text. No need to paste it and the selected text will be deleted (in a way). + +#### Undo or redo your last action + +Cut the wrong line? Pasted the wrong text selection? It’s easy to make such silly mistakes and it’s easy to correct those silly mistakes. + +You can undo and redo your last actions using: + + * Alt+U : Undo + * Alt +E : Redo + + + +You can repeat these key combinations to undo or redo multiple times. + +#### Search and replace + +If you want to search for a certain text, use Ctrl+W and then enter the term you want to search and press enter. The cursor will move to the first match. To go to the next match, use Alt+W keys. + +![][13] + +By default, the search is case-insensitive. You can also use regex for the search terms. + +If you want to replace the searched term, use Ctr+\ keys and then enter the search term and press enter key. Next it will ask for the term you want to replace the searched items with. + +![][14] + +The cursor will move to the first match and Nano will ask for your conformation for replacing the matched text. Use Y or N to confirm or deny respectively. Using either of Y or N will move to the next match. You may also use A to replace all matches. + +![][15] + +#### Save your file while editing (without exiting) + +In a graphical editor, you are probable used to of saving your changes from time to time. In Nano, you can use Ctrl+O to save your changes you made to the file. It also works with a new, unnamed file. + +![][16] + +Nano actually shows this keyboard shortcut at the bottom but it’s not obvious. It says “^O Write Out” which actually means to use Ctrl+O (it is letter O, not number zero) to save your current work. Not everyone can figure that out. + +In a graphical text editor, you probably use Ctrl+S to save your changes. Old habits die hard but it could cause trouble. Out of habit, if you accidentally press Ctrl+S to save your file, you’ll notice that the terminal freezes and you can do nothing. + +If you accidentally press Ctrl+S press Ctrl+Q nothing can be more scary than a frozen terminal and losing the work. + +#### Save and exit Nano editor + +To exit the editor, press Ctrl+X keys. When you do that, it will give you the option to save the file, or discard the file or cancel the exit process. + +![][17] + +If you want to save the modified file as a new file (save as function in usual editors), you can do that as well. When you press Ctrl+X to exit and then Y to save the changes, it gives the option to which file it should save the changes. You can change the file name at this point. + +You’ll need to have ‘write permission’ on the file you are editing if you want to save the modifications to the file. + +#### Forgot keyboard shortcut? Use help + +Like any other terminal based text editor, Nano relies heavily on keyboard shortcuts. Though it displays several useful shortcuts on the bottom of the editor, you cannot see all of them. + +It is not possible to remember all the shortcuts, specially in the beginning. What you can do is to use the Ctrl+G keys to bring up the detailed help menu. The help menu lists all the keyboard shortcuts. + +![][18] + +#### Always look at the bottom of the Nano editor + +If you are using Nano, you’ll notice that it displays important information at the bottom. This includes the keyboard shortcuts that will be used in the scenario. It also shows the last action you performed. + +![][19] + +If you get too comfortable with Nano, you can get more screen for editing the text by disabling the shortcuts displayed at the bottom. You can use Alt+X keys for that. I don’t recommend doing it, to be honest. Pressing Alt+X brings the shortcut display back. + +### Download Nano cheatsheet [PDF] + +There are a lot more shortcuts and editing options in Nano. I am not going to overwhelm you by mentioning them all. + +Here’s a quick summary of the important Nano keyboard shortcuts you should rememeber. Download link is under the image. + +![][20] + +[Download Nano Cheat Sheet (free PDF)][21] + +You can download the cheatsheet, print it and keep at your desk. It will help you in remembering and mastering the shortcuts. + +I hope you find this beginner’s guide to Nano text editor helpful. If you liked it, please share it on Reddit, [Hacker News][22] or in various [Linux forums][23] you frequently visit. + +I welcome your questions and suggestions. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nano-editor-guide/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.nano-editor.org/ +[2]: https://itsfoss.com/command-line-text-editors-linux/ +[3]: https://www.vim.org/ +[4]: https://www.gnu.org/software/emacs/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-guide.png?ssl=1 +[6]: https://itsfoss.com/pro-vim-tips/ +[7]: https://itsfoss.com/how-to-exit-vim/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-interface.png?ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-modified-text.png?ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-jump-to-line.png?ssl=1 +[11]: https://itsfoss.com/ubuntu-shortcuts/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-set-mark.png?ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-search-text.png?ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-search-replace.png?ssl=1 +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-search-replace-confirm.png?ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-save-while-writing.png?ssl=1 +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-save-and-exit.png?ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-help-menu.png?ssl=1 +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-hints.png?ssl=1 +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-cheatsheet.png?ssl=1 +[21]: https://itsfoss.com/wp-content/uploads/2020/05/Nano-Cheat-Sheet.pdf +[22]: https://news.ycombinator.com/ +[23]: https://itsfoss.community/ From fe5a14ebd3a403c09d07253fab4dc03cde5ff64a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 28 May 2020 01:11:33 +0800 Subject: [PATCH 0862/1809] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200527=20Mana?= =?UTF-8?q?ge=20startup=20using=20systemd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200527 Manage startup using systemd.md --- .../20200527 Manage startup using systemd.md | 567 ++++++++++++++++++ 1 file changed, 567 insertions(+) create mode 100644 sources/tech/20200527 Manage startup using systemd.md diff --git a/sources/tech/20200527 Manage startup using systemd.md b/sources/tech/20200527 Manage startup using systemd.md new file mode 100644 index 0000000000..c0ff18a13d --- /dev/null +++ b/sources/tech/20200527 Manage startup using systemd.md @@ -0,0 +1,567 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage startup using systemd) +[#]: via: (https://opensource.com/article/20/5/manage-startup-systemd) +[#]: author: (David Both https://opensource.com/users/dboth) + +Manage startup using systemd +====== +Learn how systemd determines the order services start, even though it is +essentially a parallel system. +![Penguin with green background][1] + +While setting up a Linux system recently, I wanted to know how to ensure that dependencies for services and other units were up and running before those dependent services and units start. Specifically, I needed more knowledge of how systemd manages the startup sequence, especially in determining the order services are started in what is essentially a parallel system. + +You may know that SystemV (systemd's predecessor, as I explained in the [first article][2] in this series) orders the startup sequence by naming the startup scripts with an SXX prefix, where XX is a number from 00 to 99. SystemV then uses the sort order by name and runs each start script in sequence for the desired runlevel. + +But systemd uses unit files, which can be created or modified by a sysadmin, to define subroutines for not only initialization but also for regular operation. In the [third article][3] in this series, I explained how to create a mount unit file. In this fifth article, I demonstrate how to create a different type of unit file—a service unit file that runs a program at startup. You can also change certain configuration settings in the unit file and use the systemd journal to view the location of your changes in the startup sequence. + +### Preparation + +Make sure you have removed `rhgb` and `quiet` from the `GRUB_CMDLINE_LINUX=` line in the `/etc/default/grub` file, as I showed in the [second article][4] in this series. This enables you to observe the Linux startup message stream, which you'll need for some of the experiments in this article. + +### The program + +In this tutorial, you will create a simple program that enables you to observe a message during startup on the console and later in the systemd journal. + +Create the shell program `/usr/local/bin/hello.sh` and add the following content. You want to ensure that the result is visible during startup and that you can easily find it when looking through the systemd journal. You will use a version of the "Hello world" program with some bars around it, so it stands out. Make sure the file is executable and has user and group ownership by root with [700 permissions][5] for security: + + +``` +#!/usr/bin/bash +# Simple program to use for testing startup configurations +# with systemd. +# By David Both +# Licensed under GPL V2 +# +echo "###############################" +echo "######### Hello World! ########" +echo "###############################" +``` + +Run this program from the command line to verify that it works correctly: + + +``` +[root@testvm1 ~]# hello.sh +############################### +######### Hello World! ######## +############################### +[root@testvm1 ~]# +``` + +This program could be created in any scripting or compiled language. The `hello.sh` program could also be located in other places based on the [Linux filesystem hierarchical structure][6] (FHS). I place it in the `/usr/local/bin` directory so that it can be easily run from the command line without having to prepend a path when I type the command. I find that many of the shell programs I create need to be run from the command line and by other tools such as systemd. + +### The service unit file + +Create the service unit file `/etc/systemd/system/hello.service` with the following content. This file does not need to be executable, but for security, it does need user and group ownership by root and [644][7] or [640][8] permissions: + + +``` +# Simple service unit file to use for testing +# startup configurations with systemd. +# By David Both +# Licensed under GPL V2 +# + +[Unit] +Description=My hello shell script + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/hello.sh + +[Install] +WantedBy=multi-user.target +``` + +Verify that the service unit file performs as expected by viewing the service status. Any syntactical errors will show up here: + + +``` +[root@testvm1 ~]# systemctl status hello.service +● hello.service - My hello shell script +     Loaded: loaded (/etc/systemd/system/hello.service; disabled; vendor preset: disabled) +     Active: inactive (dead) +[root@testvm1 ~]# +``` + +You can run this "oneshot" service type multiple times without problems. The oneshot type is intended for services where the program launched by the service unit file is the main process and must complete before systemd starts any dependent process. + +There are seven service types, and you can find an explanation of each (along with the other parts of a service unit file) in the [systemd.service(5)][9] man page. (You can also find more information in the [resources][10] at the end of this article.) + +As curious as I am, I wanted to see what an error might look like. So, I deleted the "o" from the `Type=oneshot` line, so it looked like `Type=neshot`, and ran the command again: + + +``` +[root@testvm1 ~]# systemctl status hello.service +● hello.service - My hello shell script +     Loaded: loaded (/etc/systemd/system/hello.service; disabled; vendor preset: disabled) +     Active: inactive (dead) + +May 06 08:50:09 testvm1.both.org systemd[1]: /etc/systemd/system/hello.service:12: Failed to parse service type, ignoring: neshot +[root@testvm1 ~]# +``` + +These results told me precisely where the error was and made it very easy to resolve the problem. + +Just be aware that even after you restore the `hello.service` file to its original form, the error will persist. Although a reboot will clear the error, you should not have to do that, so I went looking for a method to clear out persistent errors like this. I have encountered service errors that require the command `systemctl daemon-reload` to reset an error condition, but that did not work in this case. The error messages that can be fixed with this command always seem to have a statement to that effect, so you know to run it. + +It is, however, recommended that you run `systemctl daemon-reload` after changing a unit file or creating a new one. This notifies systemd that the changes have been made, and it can prevent certain types of issues with managing altered services or units. Go ahead and run this command. + +After correcting the misspelling in the service unit file, a simple `systemctl restart hello.service` cleared the error. Experiment a bit by introducing some other errors into the `hello.service` file to see what kinds of results you get. + +### Start the service + +Now you are ready to start the new service and check the status to see the result. Although you probably did a restart in the previous section, you can start or restart a oneshot service as many times as you want since it runs once and then exits. + +Go ahead and start the service (as shown below), and then check the status. Depending upon how much you experimented with errors, your results may differ from mine: + + +``` +[root@testvm1 ~]# systemctl start hello.service +[root@testvm1 ~]# systemctl status hello.service +● hello.service - My hello shell script +     Loaded: loaded (/etc/systemd/system/hello.service; disabled; vendor preset: disabled) +     Active: inactive (dead) + +May 10 10:37:49 testvm1.both.org hello.sh[842]: ######### Hello World! ######## +May 10 10:37:49 testvm1.both.org hello.sh[842]: ############################### +May 10 10:37:49 testvm1.both.org systemd[1]: hello.service: Succeeded. +May 10 10:37:49 testvm1.both.org systemd[1]: Finished My hello shell script. +May 10 10:54:45 testvm1.both.org systemd[1]: Starting My hello shell script... +May 10 10:54:45 testvm1.both.org hello.sh[1380]: ############################### +May 10 10:54:45 testvm1.both.org hello.sh[1380]: ######### Hello World! ######## +May 10 10:54:45 testvm1.both.org hello.sh[1380]: ############################### +May 10 10:54:45 testvm1.both.org systemd[1]: hello.service: Succeeded. +May 10 10:54:45 testvm1.both.org systemd[1]: Finished My hello shell script. +[root@testvm1 ~]# +``` + +Notice in the status command's output that the systemd messages indicate that the `hello.sh` script started and the service completed. You can also see the output from the script. This display is generated from the journal entries of the most recent invocations of the service. Try starting the service several times, and then run the status command again to see what I mean. + +You should also look at the journal contents directly; there are multiple ways to do this. One way is to specify the record type identifier, in this case, the name of the shell script. This shows the journal entries for previous reboots as well as the current session. As you can see, I have been researching and testing for this article for some time now: + + +``` +[root@testvm1 ~]# journalctl -t hello.sh +<snip> +\-- Reboot -- +May 08 15:55:47 testvm1.both.org hello.sh[840]: ############################### +May 08 15:55:47 testvm1.both.org hello.sh[840]: ######### Hello World! ######## +May 08 15:55:47 testvm1.both.org hello.sh[840]: ############################### +\-- Reboot -- +May 08 16:01:51 testvm1.both.org hello.sh[840]: ############################### +May 08 16:01:51 testvm1.both.org hello.sh[840]: ######### Hello World! ######## +May 08 16:01:51 testvm1.both.org hello.sh[840]: ############################### +\-- Reboot -- +May 10 10:37:49 testvm1.both.org hello.sh[842]: ############################### +May 10 10:37:49 testvm1.both.org hello.sh[842]: ######### Hello World! ######## +May 10 10:37:49 testvm1.both.org hello.sh[842]: ############################### +May 10 10:54:45 testvm1.both.org hello.sh[1380]: ############################### +May 10 10:54:45 testvm1.both.org hello.sh[1380]: ######### Hello World! ######## +May 10 10:54:45 testvm1.both.org hello.sh[1380]: ############################### +[root@testvm1 ~]# +``` + +To locate the systemd records for the `hello.service` unit, you can search on systemd. You can use **G+Enter** to page to the end of the journal entries and then scroll back to locate the ones you are interested in. Use the `-b` option to show only the entries for the most recent startup: + + +``` +[root@testvm1 ~]# journalctl -b -t systemd +<snip> +May 10 10:37:49 testvm1.both.org systemd[1]: Starting SYSV: Late init script for live image.... +May 10 10:37:49 testvm1.both.org systemd[1]: Started SYSV: Late init script for live image.. +May 10 10:37:49 testvm1.both.org systemd[1]: hello.service: Succeeded. +May 10 10:37:49 testvm1.both.org systemd[1]: Finished My hello shell script. +May 10 10:37:50 testvm1.both.org systemd[1]: Starting D-Bus System Message Bus... +May 10 10:37:50 testvm1.both.org systemd[1]: Started D-Bus System Message Bus. +``` + +I copied a few other journal entries to give you an idea of what you might find. This command spews all of the journal lines pertaining to systemd—109,183 lines when I wrote this. That is a lot of data to sort through. You can use the pager's search facility, which is usually `less`, or you can use the built-in `grep` feature. The `-g` (or `--grep=`) option uses Perl-compatible regular expressions: + + +``` +[root@testvm1 ~]# journalctl -b -t systemd -g "hello" +[root@testvm1 ~]# journalctl -b -t systemd -g "hello" +\-- Logs begin at Tue 2020-05-05 18:11:49 EDT, end at Sun 2020-05-10 11:01:01 EDT. -- +May 10 10:37:49 testvm1.both.org systemd[1]: Starting My hello shell script... +May 10 10:37:49 testvm1.both.org systemd[1]: hello.service: Succeeded. +May 10 10:37:49 testvm1.both.org systemd[1]: Finished My hello shell script. +May 10 10:54:45 testvm1.both.org systemd[1]: Starting My hello shell script... +May 10 10:54:45 testvm1.both.org systemd[1]: hello.service: Succeeded. +May 10 10:54:45 testvm1.both.org systemd[1]: Finished My hello shell script. +[root@testvm1 ~]# +``` + +You could use the standard GNU `grep` command, but that would not show the log metadata in the first line. + +If you do not want to see just the journal entries pertaining to your `hello` service, you can narrow things down a bit by specifying a time range. For example, I will start with the beginning time of `10:54:00` on my test VM, which was the start of the minute the entries above are from. ****Note that the `--since=` option must be enclosed in quotes and that this option can also be expressed as `-S "