From 71e07e9382f3ea0b24e3e34c87eb22a91bb230c1 Mon Sep 17 00:00:00 2001 From: XYenChi <466530436@qq.com> Date: Mon, 18 Jan 2021 23:11:36 +0800 Subject: [PATCH 001/381] Update 20190312 When the web grew up- A browser story.md --- sources/talk/20190312 When the web grew up- A browser story.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190312 When the web grew up- A browser story.md b/sources/talk/20190312 When the web grew up- A browser story.md index 9f47402ac1..d9bdf87f52 100644 --- a/sources/talk/20190312 When the web grew up- A browser story.md +++ b/sources/talk/20190312 When the web grew up- A browser story.md @@ -15,7 +15,7 @@ web 的诞生:浏览器的故事grew up: A browser story 最近,我Recently, I [分享了shared how][1] 获得英文文学和神学学位离开大学,在一个大家都还不知道 web 服务器是什么的地方,设法找到一份运行 web 服务器的工作。upon leaving university in 1994 with a degree in English literature and theology, I somehow managed to land a job running a web server in a world where people didn't really know what a web server was yet. 那“地方”,我不仅仅指的是我工作的组织,而是泛指所有地方。And by "in a world," I don't just mean within the organisation in which I worked, but the world in general. Web 那时当真是全新的——人们还正尝试理出头绪。The web was new—really new—and people were still trying to get their heads around it. -That's not to suggest that the place where I was working—an academic publisher—particularly "got it" either. This was a world in which a large percentage of the people visiting their website were still running 28k8 modems. I remember my excitement in getting a 33k6 modem. At least we were past the days of asymmetric upload/download speeds,1 where 1200/300 seemed like an eminently sensible bandwidth description. This meant that the high-design, high-colour, high-resolution documents created by the print people (with whom I shared a floor) were completely impossible on the web. I wouldn't allow anything bigger than a 40k GIF on the front page of the website, and that was pushing it for many of our visitors. Anything larger than 60k or so would be explicitly linked as a standalone image from a thumbnail on the referring page. +That's not to suggest that the place where I was working—an academic publisher—particularly "got it" either. 这是个大部分人还在用 28k8 猫访问网页的地方。我记得我拿到 33k6 猫时有多激动。This was a world in which a large percentage of the people visiting their website were still running 28k8 modems. I remember my excitement in getting a 33k6 modem. 至少上下行速率不对称的日子过去了,以前带宽显示 1200/300 特别常见。t least we were past the days of asymmetric upload/download speeds,1 where 1200/300 seemed like an eminently sensible bandwidth description. 这意味着This meant that the high-design设计复杂, high-colour色彩缤纷, high-resolution纤毫毕现 documents created by the print people (端同一家饭碗) were completely impossible on the web. 我不可能让大于 40k 的GIF 出现在网站的首页推送给访问的人。I wouldn't allow anything bigger than a 40k GIF on the front page of the website, and that was pushing it for many of our visitors. 大于大约 60k 的会作为独立的图片,缩略图链接到参照页。Anything larger than 60k or so would be explicitly linked as a standalone image from a thumbnail on the referring page. To say that the marketing department didn't like this was an understatement. Even worse was the question of layout. "Browsers decide how to lay out documents," I explained, time after time, "you can use headers or paragraphs, but how documents appear on the page isn't defined by the document, but by the renderer!" They wanted control. They wanted different coloured backgrounds. After a while, they got that. I went to what I believe was the first W3C meeting at which the idea of Cascading Style Sheets (CSS) was discussed. And argued vehemently against them. The suggestion that document writers should control layout was anathema.2 It took some while for CSS to be adopted, and in the meantime, those who cared about such issues adopted the security trainwreck that was Portable Document Format (PDF). From dc3b42853cd63e684aea6768cb47e99ff17290d6 Mon Sep 17 00:00:00 2001 From: sthwhl <54652351+sthwhl@users.noreply.github.com> Date: Tue, 19 Jan 2021 22:09:43 +0800 Subject: [PATCH 002/381] Update 20191010 The biggest risk to uptime- Your staff.md translated --- ... The biggest risk to uptime- Your staff.md | 55 +++++-------------- 1 file changed, 15 insertions(+), 40 deletions(-) diff --git a/sources/talk/20191010 The biggest risk to uptime- Your staff.md b/sources/talk/20191010 The biggest risk to uptime- Your staff.md index e420e50c29..c53552b0df 100644 --- a/sources/talk/20191010 The biggest risk to uptime- Your staff.md +++ b/sources/talk/20191010 The biggest risk to uptime- Your staff.md @@ -1,48 +1,23 @@ -[#]: collector: (lujun9972) -[#]: translator: (sthwhl) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The biggest risk to uptime? Your staff) -[#]: via: (https://www.networkworld.com/article/3444762/the-biggest-risk-to-uptime-your-staff.html) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) +[#]: collector: "lujun9972" +[#]: translator: "sthwhl" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "The biggest risk to uptime? Your staff" +[#]: via: "https://www.networkworld.com/article/3444762/the-biggest-risk-to-uptime-your-staff.html" +[#]: author: "Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/" -The biggest risk to uptime? Your staff +计算机正常运行最大的威胁是什么?是员工 ====== -Human error is the chief cause of downtime, a new study finds. Imagine that. -Getty Images -There was an old joke: "To err is human, but to really foul up you need a computer." Now it seems the reverse is true. The reliability of [data center][1] equipment is vastly improved but the humans running them have not kept up and it's a threat to uptime. +  想象一下,一项新研究发现,人为失误是引发停机时间的首要原因。之前有一个很老的笑话:“是人都会犯错,但是要真正把事情搞砸,你还缺台计算机。” 现在情况正好相反了,现如今,数据中心设备的可靠性已经得到了极大的提升,反而是使用设备的人员素质没能跟上,从而给计算机正常运行带来了很大的威胁。 -The Uptime Institute has surveyed thousands of IT professionals throughout the year on outages and said the vast majority of data center failures are caused by human error, from 70 percent to 75 percent. +  国际正常运行时间协会对数千名 IT 专业人员一整年发生的故障事件进行了调查,得出结论表示绝大多数的数据中心故障是由于人为错误造成的,人为错误导致的故障率为 70%-75%,而且有些故障是很严重。调查发现,超过 30% 的 IT 服务与数据中心运营商经历了他们称之为是“严重服务退化”的停机事故。2019 年有 10% 的受访者称他们最近的事故造成的损失超过 100 万美元,在 Uptime 2019 年 4 月的调查中,60% 的受访者认为,对于最近发生的重大停机事件,他们本可以通过更好的管理/流程或配置进行防止。而对于损失超过 100 万美元的故障事件,这一数字跃升至 74%。 -[[Get regularly scheduled insights by signing up for Network World newsletters. ]][2] +  Uptime 认为,导致故障事件发生的最终的错误不一定是员工,而是令人失望的管理。这个行业仍然严重依赖于人工去完成一些最基础和最重要的工作,易受人为错误的影响,这一点无法避免,也许可做的防错/防灾措施很有限。“然而,对这些故障问题的快速调查发现,故障持续存在的主要原因不是人为失误,而是由于管理失误导致,如“针对员工培训投资不足,相关政策执行不力,管理程序老旧,低估一名合格员工的重要性”,这一系列的管理问题导致了故障停机。” Heslin 继续说道。 -And some of them are severe. It found more than 30 percent of IT service and data center operators experienced downtime that they called a “severe degradation of service” over the last year, with 10 percent of the 2019 respondents reporting that their most recent incident cost more than $1 million. +  Uptime 指出,公司的 IT 基础设施越复杂,特别是分布式特性基础设施,可能会越容易增加简单错误导致的业务中断风险。同时指出公司需要意识到基础设施越复杂所涉及的风险就越大。并警告说,在人员配备方面,不要以超过公司吸引和应用资源来管理基础设施的速度扩大关键 it 能力,并在影响关键任务操作之前意识到任何人员和技能短缺。 -[][3] - -BrandPost Sponsored by HPE - -[Take the Intelligent Route with Consumption-Based Storage][3] - -Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. - -In Uptime's April 2019 survey, 60 percent of respondents believed that their most recent significant downtime incident could have been prevented with better management/processes or configuration. For outages that cost greater than $1 million, this figure jumped to 74 percent. - -However, the end fault is not necessarily with the staff, Uptime argues, but with management that has failed them. - -Advertisement - -"Perhaps there is simply a limit to what can be achieved in an industry that still relies heavily on people to perform many of the most basic and critical tasks and thus is subject to human error, which can never be completely eliminated," wrote Kevin Heslin, chief editor of the Uptime Institute Journal in a [blog post][4]. - -"However, a quick survey of the issues suggests that management failure — not human error — is the main reason that outages persist. By under-investing in training, failing to enforce policies, allowing procedures to grow outdated, and underestimating the importance of qualified staff, management sets the stage for a cascade of circumstances that leads to downtime," Heslin went on to say. - -Uptime noted that the complexity of a company’s infrastructure, especially the distributed nature of it, can increase the risk that simple errors will cascade into a service outage and said companies need to be aware of the greater risk involved with greater complexity. - -On the staffing side, it cautioned against expanding critical IT capacity faster than the company can attract and apply the resources to manage that infrastructure and to be aware of any staffing and skills shortage before they start to impair mission-critical operations. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. -------------------------------------------------------------------------------- @@ -50,7 +25,7 @@ via: https://www.networkworld.com/article/3444762/the-biggest-risk-to-uptime-you 作者:[Andy Patrizio][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[sthwhl](https://github.com/sthwhl) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -59,7 +34,7 @@ via: https://www.networkworld.com/article/3444762/the-biggest-risk-to-uptime-you [b]: https://github.com/lujun9972 [1]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html [2]: https://www.networkworld.com/newsletters/signup.html -[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar " Take the Intelligent Route with Consumption-Based Storage" [4]: https://journal.uptimeinstitute.com/how-to-avoid-outages-try-harder/ [5]: https://www.facebook.com/NetworkWorld/ [6]: https://www.linkedin.com/company/network-world From e1ce2ee356f975129625695607c55c3b8c1eb1e5 Mon Sep 17 00:00:00 2001 From: sthwhl <54652351+sthwhl@users.noreply.github.com> Date: Tue, 19 Jan 2021 22:24:44 +0800 Subject: [PATCH 003/381] Rename sources/talk/20191010 The biggest risk to uptime- Your staff.md to translated/talk/20191010 The biggest risk to uptime- Your staff.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit source目录 切换到 translated 目录 --- .../talk/20191010 The biggest risk to uptime- Your staff.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20191010 The biggest risk to uptime- Your staff.md (100%) diff --git a/sources/talk/20191010 The biggest risk to uptime- Your staff.md b/translated/talk/20191010 The biggest risk to uptime- Your staff.md similarity index 100% rename from sources/talk/20191010 The biggest risk to uptime- Your staff.md rename to translated/talk/20191010 The biggest risk to uptime- Your staff.md From 751d7cf942ecebe8f9625509ab9f0eed7e5fba0b Mon Sep 17 00:00:00 2001 From: sthwhl <54652351+sthwhl@users.noreply.github.com> Date: Tue, 19 Jan 2021 22:34:13 +0800 Subject: [PATCH 004/381] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申请译文 "20190313 Why is no one signing their emails.md" --- sources/talk/20190313 Why is no one signing their emails.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20190313 Why is no one signing their emails.md b/sources/talk/20190313 Why is no one signing their emails.md index b2b862951a..2df66cf18d 100644 --- a/sources/talk/20190313 Why is no one signing their emails.md +++ b/sources/talk/20190313 Why is no one signing their emails.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (sthwhl) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -92,7 +92,7 @@ via: https://arp242.net/weblog/signing-emails.html 作者:[Martin Tournoij][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[sthwhl](https://github.com/sthwhl) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2eee2b034079ede66dc761b14aa606ab79524052 Mon Sep 17 00:00:00 2001 From: XYenChi <466530436@qq.com> Date: Tue, 19 Jan 2021 23:24:01 +0800 Subject: [PATCH 005/381] Update 20190312 When the web grew up- A browser story.md --- .../talk/20190312 When the web grew up- A browser story.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/talk/20190312 When the web grew up- A browser story.md b/sources/talk/20190312 When the web grew up- A browser story.md index d9bdf87f52..602ffff4e1 100644 --- a/sources/talk/20190312 When the web grew up- A browser story.md +++ b/sources/talk/20190312 When the web grew up- A browser story.md @@ -17,13 +17,13 @@ web 的诞生:浏览器的故事grew up: A browser story That's not to suggest that the place where I was working—an academic publisher—particularly "got it" either. 这是个大部分人还在用 28k8 猫访问网页的地方。我记得我拿到 33k6 猫时有多激动。This was a world in which a large percentage of the people visiting their website were still running 28k8 modems. I remember my excitement in getting a 33k6 modem. 至少上下行速率不对称的日子过去了,以前带宽显示 1200/300 特别常见。t least we were past the days of asymmetric upload/download speeds,1 where 1200/300 seemed like an eminently sensible bandwidth description. 这意味着This meant that the high-design设计复杂, high-colour色彩缤纷, high-resolution纤毫毕现 documents created by the print people (端同一家饭碗) were completely impossible on the web. 我不可能让大于 40k 的GIF 出现在网站的首页推送给访问的人。I wouldn't allow anything bigger than a 40k GIF on the front page of the website, and that was pushing it for many of our visitors. 大于大约 60k 的会作为独立的图片,缩略图链接到参照页。Anything larger than 60k or so would be explicitly linked as a standalone image from a thumbnail on the referring page. -To say that the marketing department didn't like this was an understatement. Even worse was the question of layout. "Browsers decide how to lay out documents," I explained, time after time, "you can use headers or paragraphs, but how documents appear on the page isn't defined by the document, but by the renderer!" They wanted control. They wanted different coloured backgrounds. After a while, they got that. I went to what I believe was the first W3C meeting at which the idea of Cascading Style Sheets (CSS) was discussed. And argued vehemently against them. The suggestion that document writers should control layout was anathema.2 It took some while for CSS to be adopted, and in the meantime, those who cared about such issues adopted the security trainwreck that was Portable Document Format (PDF). +To say that the marketing department didn't like this was an understatement. 更糟的是布局问题。Even worse was the question of layout. "Browsers decide how to lay out documents," I explained, time after time, "你可以使用眉头词或者段落,但是文档在页面上如何显示并不取决于文档,而是you can use headers or paragraphs, but how documents appear on the page isn't defined by the document, but by the renderer!" They wanted control. They wanted different coloured backgrounds. After a while, they got that. I went to what I believe was the first W3C meeting at which the idea of Cascading Style Sheets 层叠样式表(CSS) was discussed. And argued vehemently against them. The suggestion that document writers should control layout was anathema.2 It took some while for CSS to be adopted, and in the meantime, those who cared about such issues adopted the security trainwreck that was Portable Document Format (PDF). How documents were rendered wasn't the only issue. Being a publisher of actual physical books, the whole point of having a web presence, as far as the marketing department was concerned, was to allow customers—or potential customers—to know not only what a book was about, but also how much it was going to cost them to buy. This, however, presented a problem. You see, the internet—in which I include the rapidly growing World Wide Web—was an open, free-for-all libertarian sort of place where nobody was interested in money; in fact, where talk of money was to be shunned and avoided. -I took the mainstream "Netizen" view that there was no place for pricing information online. My boss—and, indeed, pretty much everybody else in the organisation—took a contrary view. They felt that customers should be able to see how much books would cost them. They also felt that my bank manager would like to see how much money was coming into my bank account on a monthly basis, which might be significantly reduced if I didn't come round to their view. +I took the mainstream "Netizen网民" view that there was no place for pricing information online. 我老板,加上组织里相当多的人都持有相反的看法My boss—and, indeed, pretty much everybody else in the organisation—took a contrary view. They felt that customers should be able to see how much books would cost them. They also felt that my bank manager would like to see how much money was coming into my bank account on a monthly basis, which might be significantly reduced if I didn't come round to their view. -Luckily, by the time I'd climbed down from my high horse and got over myself a bit—probably only a few weeks after I'd started digging my heels in—the web had changed, and there were other people putting pricing information up about their products. These newcomers were generally looked down upon by the old schoolers who'd been running web servers since the early days,3 but it was clear which way the wind was blowing. This didn't mean that the battle was won for our website, however. As an academic publisher, we shared an academic IP name ("ac.uk") with the University. The University was less than convinced that publishing pricing information was appropriate until some senior folks at the publisher pointed out that Princeton University Press was doing it, and wouldn't we look a bit silly if…? +Luckily, by the time I'd climbed down from my high horse and got over myself a bit—probably only a few weeks after I'd started digging my heels in—the web had changed, and there were other people putting pricing information up about their products. 新来的人渐渐瞧不起先前运行 web 服务器的老学究们,但风向很清晰。These newcomers were generally looked down upon by the old schoolers who'd been running web servers since the early days,3 but it was clear which way the wind was blowing. This didn't mean that the battle was won for our website, however. As an academic publisher, we shared an academic IP name ("ac.uk") with the University. The University was less than convinced that publishing pricing information was appropriate until some senior folks at the publisher pointed out that Princeton University Press was doing it, and wouldn't we look a bit silly if…? The fun didn't stop there, either. A few months into my tenure as webmaster ("webmaster@…"), we started to see a worrying trend, as did lots of other websites. Certain visitors were single-handedly bringing our webserver to its knees. These visitors were running a new web browser: Netscape. Netscape was badly behaved. Netscape was multi-threaded. From a8ecc57613b30d1d7ae7838987e74ee05a78a119 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 19 Jan 2021 23:53:50 +0800 Subject: [PATCH 006/381] PRF @geekpi Co-Authored-By: geekpi --- ...ity with this lightweight Linux desktop.md | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/translated/tech/20210111 Improve your productivity with this lightweight Linux desktop.md b/translated/tech/20210111 Improve your productivity with this lightweight Linux desktop.md index 7b034759c6..4ab74a7abb 100644 --- a/translated/tech/20210111 Improve your productivity with this lightweight Linux desktop.md +++ b/translated/tech/20210111 Improve your productivity with this lightweight Linux desktop.md @@ -1,48 +1,50 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Improve your productivity with this lightweight Linux desktop) [#]: via: (https://opensource.com/article/21/1/elementary-linux) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) -使用这个轻量级 Linux 桌面提高你的工作效率 +ElementaryOS:使用这个轻量级 Linux 桌面提高你的工作效率 ====== -ElementaryOS 提供了一个快速、轻量、高效的桌面,让你在新的一年里保持工作效率。 -![Business woman on laptop sitting in front of window][1] -在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第一天。 +> ElementaryOS 提供了一个快速、轻量、高效的桌面,让你在新的一年里保持工作效率。 -当寻求提高生产率的工具时,很容易将几乎可以但不能完全很好地发挥作用的应用集合在一起。在过去的几年里,我们已经谈到了单个的电子邮件应用、日历应用、记事本应用等等。不过,总会有些麻烦。要么需要自定义脚本,要么需要复杂的导出/导入步骤来使一个工具工作。 +![](https://img.linux.net.cn/data/attachment/album/202101/19/235403miy29qe6rqvv2vl3.jpg) + +在前几年,这个年度系列报道了各个应用程序。今年,我们将在 2021 年寻求帮助的策略之外,还将关注一站式解决方案。欢迎来到 2021 年 21 天生产力的第一天。 + +当寻求提高生产率的工具时,很容易将几乎能用但不能完全很好地发挥作用的应用集合在一起。在过去的几年里,我们已经谈到了单个的电子邮件应用、日历应用、记事本应用等等。不过,总会有些麻烦。要么需要自定义脚本,要么需要复杂的导出/导入步骤才能使一个工具工作。 [ElementaryOS][2] 是一个完整的桌面,具有美观、实用、高效的环境。 ![Linux ElementaryOS Desktop][3] -ElementaryOS 桌面 (Kevin Sonney, [CC BY-SA 4.0][4]) +*ElementaryOS 桌面 (Kevin Sonney, [CC BY-SA 4.0][4])* -ElementaryOS 是一个基于流行的 Ubuntu Linux 发行版的“按需付费”开源项目。对于过去安装过 Ubuntu 的人来说,最初的设置和安装会非常熟悉。然而,一旦登录,体验就会很不一样。 +ElementaryOS 是一个基于流行的 Ubuntu Linux 发行版的“按需付费”开源项目。对于过去安装过 Ubuntu 的人来说,初始设置和安装会非常熟悉。然而,一旦登录,体验就会很不一样。 -ElementaryOS 使用 [Gala 窗口管理器][5]和 Pantheon shell。这两个都是专门为 Elementary 开发的。安装后,桌面非常简单,它只提供了少量的轻量级应用。这些应用包括网络浏览器、终端、邮件客户端和日历客户端。它还有一个应用中心,允许你安装 Elementary 团队策划的免费和商业应用。 +ElementaryOS 使用 [Gala 窗口管理器][5]和 Pantheon shell。这两个都是专门为 Elementary 开发的。安装后,桌面非常精简,它只提供了少量的轻量级应用。这些应用包括 Web 浏览器、终端、邮件客户端和日历客户端。它还有一个应用中心,允许你安装 Elementary 团队策划的免费和商业应用。 ![Linux ElementaryOS Mail and calendar][6] -ElementaryOS 的邮件和日历应用(Kevin Sonney, [CC BY-SA 4.0][4]) +*ElementaryOS 的邮件和日历应用(Kevin Sonney, [CC BY-SA 4.0][4])* -[邮件][7]和[日历][8]这两个应用看起来很熟悉,因为这两个应用已经被其他发行版使用了一段时间。邮件是作为 [Geary][9] 的分支开始的,而日历在其他地方则被称为 [Maya][10]。两者的设置非常简单。两款应用默认只用用户名/密码认证,所以需要双因素认证的用户需要一些额外的步骤。两者的界面都异常轻巧快速。 +[邮件][7]和[日历][8]这两个应用看起来很熟悉,因为这两个应用已经被其他发行版使用了一段时间。邮件是作为 [Geary][9] 的复刻分支开始的,而日历在其他地方则被称为 [Maya][10]。两者的设置非常简单。两款应用默认仅使用用户名/密码认证,所以需要双因素认证的用户需要一些额外的步骤。两者的界面都异常轻巧快速。 ![Linux ElementaryOS app center][11] -应用中心(Kevin Sonney,[CC BY-SA 4.0][4]) +*应用中心(Kevin Sonney,[CC BY-SA 4.0][4])* -ElementaryOS 默认不包含待办事项或记事本应用。这时,应用中心就可以发挥作用了。在应用中心中,有大量的应用可以填补空白。其中有两款应用真的很突出。第一个是 [Planner][12],一款简洁、轻量级的待办事项管理器。它支持多个列表、计划和重复性任务、项目和子项目。它还可以与流行的在线应用 [Todoist][13] 同步,但这不是必需的。 +ElementaryOS 默认不包含待办事项或记事本应用。这时,应用中心就可以发挥作用了。在应用中心中,有大量的应用可以填补空白。其中有两款应用真的很出色。第一个是 [Planner][12],一款简洁、轻量级的待办事项管理器。它支持多个列表、计划和重复性任务、项目和子项目。它还可以与流行的在线应用 [Todoist][13] 同步,但这不是必需的。 -应用中心的第二款应用是 [Notes-Up][14],这是一款使用 Markdown 写富文本的笔记应用。它允许用户在多个笔记本中创建多个笔记,并且有”查看“和”编辑“选项,这样你就可以预览最终文档的样子。同样,这款应用快速、轻量而且非常简约,与 ElementaryOS 的整体外观和感觉保持一致。 +应用中心的第二款应用是 [Notes-Up][14],这是一款使用 Markdown 写富文本格式的笔记应用。它允许用户在多个笔记本中创建多个笔记,并且有“查看”和“编辑”选项,这样你就可以预览最终文档的样子。同样,这款应用快速、轻量而且非常简约,与 ElementaryOS 的整体外观和感觉保持一致。 ![ElementaryOS Planner and Notes-up][15] -Planner 和 Notes-up (Kevin Sonney,[CC BY-SA 4.0][4]) +*Planner 和 Notes-up (Kevin Sonney,[CC BY-SA 4.0][4])* 如果你不喜欢默认应用,Elementary 基于 Ubuntu LTS,因此如果你需要使用其他应用,整个 Ubuntu 应用生态系统都可以使用。不过总的来说,ElementaryOS 默认提供了一个快速、轻量、高效的桌面,让你在新的一年里保持高效。 @@ -53,7 +55,7 @@ via: https://opensource.com/article/21/1/elementary-linux 作者:[Kevin Sonney][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 5169a7110b0c746b95d49db0ba04e7696311fa03 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 20 Jan 2021 00:34:23 +0800 Subject: [PATCH 007/381] PUB @geekpi https://linux.cn/article-13033-1.html Co-Authored-By: geekpi --- ...e your productivity with this lightweight Linux desktop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210111 Improve your productivity with this lightweight Linux desktop.md (98%) diff --git a/translated/tech/20210111 Improve your productivity with this lightweight Linux desktop.md b/published/20210111 Improve your productivity with this lightweight Linux desktop.md similarity index 98% rename from translated/tech/20210111 Improve your productivity with this lightweight Linux desktop.md rename to published/20210111 Improve your productivity with this lightweight Linux desktop.md index 4ab74a7abb..95e6d5a95a 100644 --- a/translated/tech/20210111 Improve your productivity with this lightweight Linux desktop.md +++ b/published/20210111 Improve your productivity with this lightweight Linux desktop.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13033-1.html) [#]: subject: (Improve your productivity with this lightweight Linux desktop) [#]: via: (https://opensource.com/article/21/1/elementary-linux) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From 9ea93bf4b1852b00cc38472f8fdda745824eacd4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 20 Jan 2021 05:04:57 +0800 Subject: [PATCH 008/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210120=20?= =?UTF-8?q?Highlighted=20Text=20Not=20Visible=20in=20gedit=20in=20Dark=20M?= =?UTF-8?q?ode=3F=20Here=E2=80=99s=20What=20You=20Can=20Do?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210120 Highlighted Text Not Visible in gedit in Dark Mode- Here-s What You Can Do.md --- ...it in Dark Mode- Here-s What You Can Do.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20210120 Highlighted Text Not Visible in gedit in Dark Mode- Here-s What You Can Do.md diff --git a/sources/tech/20210120 Highlighted Text Not Visible in gedit in Dark Mode- Here-s What You Can Do.md b/sources/tech/20210120 Highlighted Text Not Visible in gedit in Dark Mode- Here-s What You Can Do.md new file mode 100644 index 0000000000..a037e8b060 --- /dev/null +++ b/sources/tech/20210120 Highlighted Text Not Visible in gedit in Dark Mode- Here-s What You Can Do.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Highlighted Text Not Visible in gedit in Dark Mode? Here’s What You Can Do) +[#]: via: (https://itsfoss.com/gedit-dark-mode-problem/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Highlighted Text Not Visible in gedit in Dark Mode? Here’s What You Can Do +====== + +I love [using dark mode in Ubuntu][1]. It’s soothing on the eyes and makes the system look aesthetically more pleasing, in my opinion. + +One minor annoyance I noticed is with [gedit][2] text editor and if you use it with the dark mode in your system, you might have encountered it too. + +By default, gedit highlights the line where your cursor is. That’s a useful feature but it becomes a pain if you are using dark mode in your Linux system. Why? Because the highlighted text is not readable anymore. Have a look at it yourself: + +![Text on the highlighted line is hardly visible][3] + +If you select the text, it becomes readable but it’s not really a pleasant reading or editing experience. + +![Selecting the text makes it better but that’s not a convenient thing to do for all lines][4] + +The good thing is that you don’t have to live with it. I’ll show a couple of steps you can take to enjoy dark mode system and gedit together. + +### Making gedit reader-friendly in dark mode + +You basically have two options: + + 1. Disable highlight the current line but then you’ll have to figure out which line you are at. + 2. Change the default color settings but then the colors of the editor will be slightly different, and it won’t switch to light mode automatically if you change the system theme. + + + +It’s a workaround and compromise that you’ll have to make until the gedit or GNOME developers fix the issue. + +#### Option 1: Disable highlighting current line + +When you have gedit opened, click on the hamburger menu and select **Preferences**. + +![Go to Preferences][5] + +In the View tab, you should see the “Highlight current line” option under Highlighting section. Uncheck this. The effects are visible immediately. + +![Disable highlighting current line][6] + +Highlighting current line is a usable feature and if you want to continue using it, opt for the second option. + +#### Option 2: Change the editor color theme + +In the Preferences window, go to Font & Colors tab and change the color scheme to Oblivion, Solarized Dark or Cobalt. + +![Change the color scheme][7] + +As I mentioned earlier, the drawback is that when you switch the system theme to a light theme, the editor theme isn’t switched automatically to the light theme. + +### A bug that should be fixed by devs + +There are [several text editors available for Linux][8] but for quick reading or editing a text file, I prefer using gedit. It’s a minor annoyance but an annoyance nonetheless. The developers should fix it in future version of this awesome text editor so that we don’t have to resort to these worarounds. + +How about you? Do you use dark mode on your system or light mode? Had you noticed this trouble with gedit? Did you take any steps to fix it? Feel free to share your experience. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gedit-dark-mode-problem/ + +作者:[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/dark-mode-ubuntu/ +[2]: https://wiki.gnome.org/Apps/Gedit +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/gedit-dark-mode-problem.png?resize=779%2C367&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/gedit-dark-mode-issue.png?resize=779%2C367&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/gedit-preference.jpg?resize=777%2C527&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/disable-highlight-line-gedit.jpg?resize=781%2C530&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/change-color-scheme-gedit.jpg?resize=785%2C539&ssl=1 +[8]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ From d4d5cf45561606316f713eb528acafd94098ce76 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 20 Jan 2021 05:05:18 +0800 Subject: [PATCH 009/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210119=20?= =?UTF-8?q?Set=20up=20a=20Linux=20cloud=20on=20bare=20metal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210119 Set up a Linux cloud on bare metal.md --- ...0119 Set up a Linux cloud on bare metal.md | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 sources/tech/20210119 Set up a Linux cloud on bare metal.md diff --git a/sources/tech/20210119 Set up a Linux cloud on bare metal.md b/sources/tech/20210119 Set up a Linux cloud on bare metal.md new file mode 100644 index 0000000000..5445ad9141 --- /dev/null +++ b/sources/tech/20210119 Set up a Linux cloud on bare metal.md @@ -0,0 +1,128 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Set up a Linux cloud on bare metal) +[#]: via: (https://opensource.com/article/21/1/cloud-image-virt-install) +[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) + +Set up a Linux cloud on bare metal +====== +Create cloud images with virt-install on Fedora. +![Sky with clouds and grass][1] + +Virtualization is one of the most used technologies. Fedora Linux uses [Cloud Base images][2] to create general-purpose virtual machines (VM), but there are many ways to set up Cloud Base images. Recently, the virt-install command-line tool for provisioning VMs added support for **cloud-init**, so it can now be used to configure and run a cloud image locally. + +This article walks through how to set up a base Fedora cloud instance on bare metal. The same steps can be used with any raw or Qcow2 Cloud Base image. + +### What is --cloud-init? + +The **virt-install** command creates a KVM, Xen, or [LXC][3] guest using **libvirt**. The `--cloud-init` option uses a local file (called a **nocloud datasource**) so you don't need a network connection to create an image. The **nocloud** method derives user data and metadata for the guest from an iso9660 filesystem (an `.iso` file) during the first boot. When you use this option, **virt-install** generates a random (and temporary) password for the root user account, provides a serial console so you can log in and change your password, and then disables the `--cloud-init` option for subsequent boots.  + +### Set up a Fedora Cloud Base image + +First, [download a Fedora Cloud Base (for OpenStack) image][2]. + +![Fedora Cloud website screenshot][4] + +(Sumantro Mukherjee, [CC BY-SA 4.0][5]) + +Then install the **virt-install** command: + + +``` +`$ sudo dnf install virt-install` +``` + +Once **virt-install** is installed and the Fedora Cloud Base image is downloaded, create a small YAML file named `cloudinit-user-data.yaml` to contain a few configuration lines that virt-install will use. + + +``` +#cloud-config +password: 'r00t' +chpasswd: { expire: false } +``` + +This simple cloud-config sets the password for the default **fedora** user. If you want to use a password that expires, you can set it to expire after logging in. + +Create and boot the VM: + + +``` +$ virt-install --name local-cloud18012709 \ +\--memory 2000 --noreboot \ +\--os-variant detect=on,name=fedora-unknown \ +\--cloud-init user-data="/home/r3zr/cloudinit-user-data.yaml" \ +\--disk=size=10,backing_store="/home/r3zr/Downloads/Fedora-Cloud-Base-33-1.2.x86_64.qcow2" +``` + +In this example, `local-cloud18012709` is the name of the virtual machine, RAM is set to 2000MiB, disk size (the virtual hard drive) is set to 10GB, and `--cloud-init` and `backing_store` contain the absolute path to the YAML config file you created and the Qcow2 image you downloaded. + +### Log in + +After the image is created, you can log in with the username **fedora** and the password set in the YAML file (in my example, this is **r00t**, but you may have used something different). Change your password once you've logged in for the first time. + +To power off your virtual machine, execute the `sudo poweroff` command, or press **Ctrl**+**]** on your keyboard. + +### Start, stop, and kill VMs + +The `virsh` command is used to start, stop, and kill VMs. + +To start any VM that is running: + + +``` +`$ virsh start ` +``` + +To stop any running VM: + + +``` +`$ virsh shutdown ` +``` + +To list all VMs that are in a running state: + + +``` +`$ virsh list` +``` + +To destroy the VMs: + + +``` +`$ virsh destroy ` +``` + +![Destroying a VM][6] + +(Sumantro Mukherjee, [CC BY-SA 4.0][5]) + +### Fast and easy + +The **virt-install** command combined with the `--cloud-init` option makes it fast and easy to create cloud-ready images without worrying about whether you have a cloud to run them on yet.  Whether you're preparing for a a major deployment or just learning about containers, give `virt-install --cloud-init` a try. + +Do you have a favourite tool for your work in the cloud? Tell us about them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/cloud-image-virt-install + +作者:[Sumantro Mukherjee][a] +选题:[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/sumantro +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-cloud.png?itok=vz0PIDDS (Sky with clouds and grass) +[2]: https://alt.fedoraproject.org/cloud/ +[3]: https://www.redhat.com/sysadmin/exploring-containers-lxc +[4]: https://opensource.com/sites/default/files/uploads/fedoracloud.png (Fedora Cloud website) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/sites/default/files/uploads/destroyvm.png (Destroying a VM) From 0fc829d7293adabe0ce0fbdf475353d205fb2897 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 20 Jan 2021 05:05:33 +0800 Subject: [PATCH 010/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210119=20?= =?UTF-8?q?10=20ways=20big=20data=20and=20data=20science=20impacted=20the?= =?UTF-8?q?=20world=20in=202020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210119 10 ways big data and data science impacted the world in 2020.md --- ...data science impacted the world in 2020.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20210119 10 ways big data and data science impacted the world in 2020.md diff --git a/sources/tech/20210119 10 ways big data and data science impacted the world in 2020.md b/sources/tech/20210119 10 ways big data and data science impacted the world in 2020.md new file mode 100644 index 0000000000..ffdce5baaf --- /dev/null +++ b/sources/tech/20210119 10 ways big data and data science impacted the world in 2020.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 ways big data and data science impacted the world in 2020) +[#]: via: (https://opensource.com/article/21/1/big-data) +[#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeo) + +10 ways big data and data science impacted the world in 2020 +====== +Learn how open source data science languages, libraries, and tools are +helping us understand our world better by reviewing 2020's top 10 data +science articles on Opensource.com. +![Looking at a map][1] + +Big data’s one of many domains where open source shines. From open source alternatives for Google Analytics to new features in MySQL, 2020 brought several ways for open source enthusiasts to learn big data skills. + +Get up to speed on how open source data science languages, libraries, and tools help us understand our world better by reviewing the top 10 data science articles published on Opensource.com last year.  + +### The 7 most popular ways to plot data in Python + +Once upon a time, Matplotlib was the lone way to make plots in Python. In recent years, Python's status as data science's de facto language changed that. We have a plethora of ways to plot data using Python today. + +In this article, Shaun Taylor-Morgan walks through [seven ways to plot data in Python][2]. Don't worry if you're a Matplotlib user: It's covered, along with Seaborn, Plotly, and Bokeh. You'll find codes and charts per plotting library, plus some newcomers to the Python plotting field: Altair, Pygal, and pandas. + +### Transparent, open source alternative to Google Analytics + +Many websites use Google Analytics to track their activity metrics. Its status as a de facto tool leaves some to wonder if open source options exist. In this [overview of Plausible Analytics][3], Marko Saric proves they do. + +If you want to compare Google Analytics against open source options, you will find Marko's article helpful. It's especially great if you're a website admin trying to comply with new data collection regulations, such as GDPR. + +If you want to learn more about Plausible, you'll find links to Plausible's code and roadmap on GitHub in Marko's article. + +### 5 MySQL features you need to know + +After MySQL 8.0 came out in April 2018, its release cycle for new features updated to four times per year. Despite the more frequent deployments, many users don't know about [new MySQL features][4] that could save them hours of time. + +In this March 2020 article, Dave Stokes shares five features that were new to MySQL. They include dual passwords, new shells, and better SQL support. But keep in mind that these updates are now close to a year old: There's a lot more to discover in MySQL since then! + +### Using C and C++ for data science + +Did you know that C and C++ are both strong options for data science projects? They're especially good choices to [run data science programs on the command line][5]. + +In this article, Cristiano L. Fontana uses [C99][6] and [C++11][7] to write a program that uses [Anscombe's quartet][8] dataset. The step-by-step instructions include reading data from a CSV file, interpolating data, and plotting results to an image file. + +### Using Python to visualize COVID-19 projections + +The COVID-19 pandemic brought an influx of data to the proverbial forefront. In this article, Anurag Gupta shows how to use Python to [project COVID-19 cases and deaths][9] across India. + +Anurag walks through downloading and parsing data, selecting and plotting data for India, and creating an animated horizontal bar graph. If you're interested in the complete script, you'll find a link at the end of this article. + +### How I use Python to map the global spread of COVID-19 + +If you want to [track the spread of COVID-19 globally][10], you can use Python, pandas, and Plotly to do it. In this article, Anurag Gupta explains how you can use them to clean and visualize raw data. + +Using screenshots to help, Anurag shares how to load data into a pandas DataFrame; clean and modify the DataFrame; and visualize the spread in Plotly. The complete code yields a gorgeous graph, and the article ends with a link to download and run it. + +### 3 ways to use PostgreSQL commands + +In this follow-up to his article on getting started with PostgreSQL, Greg Pittman shares how he uses PostgreSQL commands to [keep his grocery shopping list updated][11]. + +Whether you want to do per-item entry or bring order to complex tables, Greg explains how to create the commands you need. He also shows how to output your lists once you're ready to print them. + +No matter how long your shopping list is, PostgreSQL commands—especially the WHERE parameter—can bring ease to your life beyond programming. + +### Using Python and GNU Octave to plot data + +Python is data science's language du jour, but how can you use it for specific tasks? In this article, Cristiano Fontana shares how to [write a program in Python and GNU Octave][12]. + +Cristiano walks through each step to read data from a CSV file, interpolate the data with a straight line, and plot the result to an image file. From printing output and reading data to plotting the outcome, Fontana's step-by-step guidelines explain the whole process in Python and GNU Octave. + +### Fast data modeling with JavaScript + +Want a way to [model data in a few minutes][13]? In this article, Szymon shares how to do it using less than 15 lines of JavaScript code. + +It really is that simple: You merely need to create a class and use the defaultsDeep function in the [Lodash][14] JavaScript library. Szymon shows this process using screenshots and code samples. + +It keeps your data in one place, avoids code repetition, and is fully customizable. If you want to try out the code in this article, Szymon links to it in CodeSandbox at the end. + +### How to process real-time data with Apache tools + +We process so much data today that storing data for analysis later might be impossible soon. Teams that handle failure prediction and other context-sensitive data need to get this information in real time, before it hits a database. Luckily, you can do this with Apache tools. + +In this article, Simon Crosby explains how Apache Spark—a unified analytics engine—can [process large datasets][15] in real time at scale. For instance, "Spark Streaming breaks data into mini-batches that are each independently analyzed by a Spark model or some other system," he writes. + +If Apache's not your thing, Simon presents other open source options. Flink, Beam, and Stanza—along with Apache-licensed SwimOS and Hazelcast—are just a few of your choices. + +### What do you want to know? + +What would you like to know about big data and data science? Please share your suggestions for article topics in the comments. And if you have something interesting to share about data science, please consider [writing an article][16] for Opensource.com. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/big-data + +作者:[Lauren Maffeo][a] +选题:[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/lmaffeo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) +[2]: https://opensource.com/article/20/4/plot-data-python +[3]: https://opensource.com/article/20/5/plausible-analytics +[4]: https://opensource.com/article/20/3/mysql-features +[5]: https://opensource.com/article/20/2/c-data-science +[6]: https://en.wikipedia.org/wiki/C99 +[7]: https://en.wikipedia.org/wiki/C%2B%2B11 +[8]: https://en.wikipedia.org/wiki/Anscombe%27s_quartet +[9]: https://opensource.com/article/20/4/python-data-covid-19 +[10]: https://opensource.com/article/20/4/python-map-covid-19 +[11]: https://opensource.com/article/20/2/postgresql-commands +[12]: https://opensource.com/article/20/2/python-gnu-octave-data-science +[13]: https://opensource.com/article/20/5/data-modeling-javascript +[14]: https://en.wikipedia.org/wiki/Lodash +[15]: https://opensource.com/article/20/2/real-time-data-processing +[16]: https://opensource.com/how-submit-article From 4de65544d637602a203ccec29852af1c6dd476a7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 20 Jan 2021 05:05:50 +0800 Subject: [PATCH 011/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210119=20?= =?UTF-8?q?Organize=20your=20task=20list=20using=20labels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210119 Organize your task list using labels.md --- ...19 Organize your task list using labels.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20210119 Organize your task list using labels.md diff --git a/sources/tech/20210119 Organize your task list using labels.md b/sources/tech/20210119 Organize your task list using labels.md new file mode 100644 index 0000000000..7759768a79 --- /dev/null +++ b/sources/tech/20210119 Organize your task list using labels.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Organize your task list using labels) +[#]: via: (https://opensource.com/article/21/1/labels) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Organize your task list using labels +====== +Use folders for what they're for - storing messages and tasks. Use +labels to help you better organize what's in those folders. +![Kanban-style organization action][1] + +In prior years, this annual series covered open source organization apps like [Notmuch][2] and [Syncthing][3]. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to day 9 of 21 Days of Productivity in 2021. + +I do this thing with my email, my to-do lists, and my notes where I decide one day I am going to "get organized" and re-arrange how and where I store things. Sometimes I have found a new program that I have to configure from scratch (again). Sometimes the current method has just blown up to the point where I am spending more time keeping the storage order up to date than I am using the system. That last one led me to a very important realization when I tested out some to-do list software last year. + +![List of labels][4] + +Everything has its place (Kevin Sonney, [CC BY-SA 4.0][5]) + +Let me start with an analogy. A task (or email or note) is like that cool t-shirt you received at an event. It is black, has an awesome graphic, a label in the back with the size, and a tag in the collar with the washing instructions. When it comes time to put it away, where does it go? Does it go with the black t-shirts? Does it go with the shirts with similar themes? Does it go by size? By how it needs to be washed? Or by material? + +A t-shirt can only go in _one_ place, even though it can have multiple defining qualities. We need to treat tasks, emails, and notes the same way. [A very large email provider][6] has allowed us to treat a label as a folder. An email (or a document or a task) can be in two folders at once! Or three! OR ELEVEN! + +![Guitar volume 11][7] + +It goes up to ELEVEN. (Seth Kenlon, [CC BY-SA 4.0][5]) + +I had to make a conscious decision to just stop doing that. Folders are not tags, and tags are not folders. That led me to my current rules for organizing to-do lists (and notes, and emails): + + 1. A task should only be in one folder. Folders are named for a "big thing," like a place or organization. I currently have three folders for tasks: "Work," "Household," and "Hobbies." When I am focusing on one of these areas, I know what tasks I am looking at. + 2. A task can have as many tags as I need for it. I try to keep that to about three or fewer. + 3. A task should have a clear meaning. Maybe this is the name of the program you are writing. Perhaps it is something generic like "to read" or "bills" - but it does not help you if you cannot remember that "4rg8sn5" is "Bills to Pay." + + + +Using those rules, if I have a task for "Write Day 9 Article," it goes into the "Hobbies" folder, and I tag it "OSDC," "Articles," "2021." If I want to see all my tasks for 2021 in my [Elementary Planner][8], I can search for that tag. The task ends up in searches for "OSDC" - which might also include a to-do to comment on an article, one to start planning the 2022 series, and one to follow up with someone who I think has a good article idea. + +My "Work" folder usually has things tagged by project. "Finish Admin CLI Docs" might be classified as "github," "prod," and "admin." The "docs" tag contains items from the "Work" and "Hobbies" folders since writing docs is something that needs to be done for both. + +![Linux Elementary planner][9] + +Folders and Tags (Kevin Sonney, [CC BY-SA 4.0][5]) + +Making the mental separation between "Tags" and "Folders" has helped me group and sort my tasks without overdoing it. It also means I can find things faster, spend less time maintaining my to-do lists, and more time doing the things on the list. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/labels + +作者:[Kevin Sonney][a] +选题:[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/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kanban_trello_organize_teams_520.png?itok=ObNjCpxt (Kanban-style organization action) +[2]: https://opensource.com/article/20/1/organize-email-notmuch +[3]: https://opensource.com/article/20/1/sync-files-syncthing +[4]: https://opensource.com/sites/default/files/pictures/day9-image1.png (List of labels) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/alternatives/gmail +[7]: https://opensource.com/sites/default/files/pictures/guitar-11.jpg (Guitar volume 11) +[8]: https://opensource.com/article/21/1/elementary-linux +[9]: https://opensource.com/sites/default/files/pictures/elementary-planner.png (Linux Elementary planner) From 40641941d911e0d4d186f39767f3f60a512d80d7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 20 Jan 2021 08:53:25 +0800 Subject: [PATCH 012/381] translated --- ...20210115 3 plain text note-taking tools.md | 78 ------------------- ...20210115 3 plain text note-taking tools.md | 76 ++++++++++++++++++ 2 files changed, 76 insertions(+), 78 deletions(-) delete mode 100644 sources/tech/20210115 3 plain text note-taking tools.md create mode 100644 translated/tech/20210115 3 plain text note-taking tools.md diff --git a/sources/tech/20210115 3 plain text note-taking tools.md b/sources/tech/20210115 3 plain text note-taking tools.md deleted file mode 100644 index df29925cb7..0000000000 --- a/sources/tech/20210115 3 plain text note-taking tools.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 plain text note-taking tools) -[#]: via: (https://opensource.com/article/21/1/plain-text) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -3 plain text note-taking tools -====== -Note-taking is important, and plain text is an easy, neutral way to do -it. Here are three tools you can spice up your notes without losing the -ease and portability of plain text. -![Typewriter with hands][1] - -In prior years, this annual series covered individual apps. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to day 5 of 21 Days of Productivity in 2021. - -Plain text is the most resilient format for documents. Plain text documents are small, transfer quickly between machines, and can be read on _any_ device. Therefore, it makes a lot of sense to take notes in a plain text document. - -However, plain text is also that - plain. We live in a rich text world and still need titles, lists, and ways to demark one section from the other. Fortunately, there are several ways we can add these elements without having to add complex markup to plain text documents. - -### Markdown - -![Markdown][2] - -Markdown (Kevin Sonney, [CC BY-SA 4.0][3]) - -[Markdown][4], created by Aaron Schwartz and John Gruber, is the format I use the most day today. From reading and writing README files, documentation, note-taking, and even source code comments, Markdown allows me to add formatting without sacrificing the ability to read the document easily. - -Additionally, Markdown has several "extended versions" to allow for items that were not part of the original design. In particular, [GitHub Flavored Markdown][5] is exceptionally popular due to its use in the eponymous source control site. - -Many file editors support Markdown highlighting out of the box with no extra add-ons or effort required. - -### AsciiDoc - -![AsciiDoc][6] - -AsciiDoc (Kevin Sonney, [CC BY-SA 4.0][3]) - -[AsciiDoc][7], created by Stuart Rackham, is another way to add rich text elements to plain text documents. AsciiDoc has many features for generating documentation, books, and papers. That does not mean it shouldn't be used for note-taking, however. There are many environments (particularly in the education and research fields) where being able to quickly convert notes to a more "formal" format is helpful. - -AsciiDoc also has many tools for converting text to other formats for collaboration. There are also several add-ons for importing data from different sources and putting it in a final document, or for handling special formatting like MathML or LaTeX. - -### Org Mode - -![ORG-Mode][8] - -ORG-Mode (Kevin Sonney, [CC BY-SA 4.0][3]) - -I cannot leave out [Org][9] when I talk about text formatting. Originally designed for use with [GNU Emacs][10], Org Mode has become one of the go-to plain text formats for notes, to-do lists, documentation, and more. Org can be written and used in a whole host of text editors, including [Vim][11]. Org is simple, easy to learn, and one of my favorite text formats for notes. - -At the end of the day, choosing Markdown, AsciiDoc, or Org for plain text notes is a way to make sure they can be read and updated anywhere. And if you are like me, you'll find yourself using the same syntax when taking paper-based notes as well! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/plain-text - -作者:[Kevin Sonney][a] -选题:[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/ksonney -[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://opensource.com/sites/default/files/pictures/markdown.png (Markdown) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://opensource.com/article/19/9/introduction-markdown -[5]: https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown -[6]: https://opensource.com/sites/default/files/pictures/asciidoc.png (AsciiDoc) -[7]: https://asciidoc.org/ -[8]: https://opensource.com/sites/default/files/pictures/org-mode.png (ORG-Mode) -[9]: https://orgmode.org/ -[10]: https://www.gnu.org/software/emacs/ -[11]: https://opensource.com/article/19/1/productivity-tool-org-mode diff --git a/translated/tech/20210115 3 plain text note-taking tools.md b/translated/tech/20210115 3 plain text note-taking tools.md new file mode 100644 index 0000000000..7295039f0e --- /dev/null +++ b/translated/tech/20210115 3 plain text note-taking tools.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 plain text note-taking tools) +[#]: via: (https://opensource.com/article/21/1/plain-text) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +3 个纯文本记事工具 +====== +记笔记很重要,而纯文本是一种简单、中性的方式。这里有三个工具,你可以在不失去纯文本的简易和便携性的前提下,给你的笔记加点东西。 +![Typewriter with hands][1] + +在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第五天。 + +纯文本是最具弹性的文档格式。纯文本文档体积小,可以在机器之间快速传输,并且可以在_任意_设备上阅读。因此,在纯文本文档中做笔记是很有意义的。 + +然而,纯文本也仅是纯文本。我们生活在一个富文本世界中,我们仍然需要标题、列表以及区分一个部分和另一个部分的方法。幸运的是,我们有几种方法可以添加这些元素,而不需要在纯文本文档中添加复杂的标记。 + +### Markdown + +![Markdown][2] + +Markdown (Kevin Sonney, [CC BY-SA 4.0][3]) + +由 Aaron Schwartz 和 John Gruber 创建的 [Markdown][4],是我如今每天使用最多的格式。从读写 README 文件、文档、记笔记,甚至源代码注释,Markdown 让我可以在不牺牲轻松阅读文档的能力的情况下添加格式。 + +此外,Markdown 还有几个”扩展版本“,以允许那些不属于原始设计的项目。特别是,[GitHub 风格的 Markdown][5] 由于其在同名的源码控制网站中的使用而异常流行。 + +许多文件编辑器都支持 Markdown 高亮显示,不需要额外的附加组件或工作。 + +### AsciiDoc + +![AsciiDoc][6] + +AsciiDoc (Kevin Sonney, [CC BY-SA 4.0][3]) + +由 Stuart Rackham 创建的 [AsciiDoc][7] 是向纯文本文档添加富文本元素的另一种方式。AsciiDoc 有许多生成文档、书籍和论文的功能。然而,这并不意味着它不能被用来做笔记。有很多环境(特别是在教育和研究领域),能够快速将笔记转换为更”正式“的格式是很有帮助的。 + +AsciiDoc 也有很多工具可以将文本转换为其他格式进行协作。还有一些附加组件可以从不同的源导入数据,并将其放入最终的文档中,或者处理特殊的格式,如 MathML 或 LaTeX。 + +### Org Mode + +![ORG-Mode][8] + +ORG-Mode (Kevin Sonney, [CC BY-SA 4.0][3]) + +说到文本格式,我不能不提 [Org][9]。Org Mode 最初是为 [GNU Emacs][10] 设计的,现在已经成为笔记、待办事项、文档等常用的纯文本格式之一。Org 可以在包括 [Vim][11] 在内的众多文本编辑器中编写和使用。Org 简单、易学,是我最喜欢的笔记文本格式之一。 + +最后,选择 Markdown、AsciiDoc 或 Org 作为纯文本笔记,是确保它们可以在任何地方被阅读和更新的一种方式。如果你和我一样,你会发现自己在做纸质笔记的时候,也会使用同样的语法! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/plain-text + +作者:[Kevin Sonney][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/ksonney +[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://opensource.com/sites/default/files/pictures/markdown.png (Markdown) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/article/19/9/introduction-markdown +[5]: https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown +[6]: https://opensource.com/sites/default/files/pictures/asciidoc.png (AsciiDoc) +[7]: https://asciidoc.org/ +[8]: https://opensource.com/sites/default/files/pictures/org-mode.png (ORG-Mode) +[9]: https://orgmode.org/ +[10]: https://www.gnu.org/software/emacs/ +[11]: https://opensource.com/article/19/1/productivity-tool-org-mode From 038cadad770180ffe1ddad1bbe810ec2f52a520f Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 20 Jan 2021 09:01:16 +0800 Subject: [PATCH 013/381] translating --- ...ayer- An Open-Source Qt-based MPV GUI Front-end for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210119 Haruna Video Player- An Open-Source Qt-based MPV GUI Front-end for Linux.md b/sources/tech/20210119 Haruna Video Player- An Open-Source Qt-based MPV GUI Front-end for Linux.md index 9513b5d75c..77bcb49747 100644 --- a/sources/tech/20210119 Haruna Video Player- An Open-Source Qt-based MPV GUI Front-end for Linux.md +++ b/sources/tech/20210119 Haruna Video Player- An Open-Source Qt-based MPV GUI Front-end for Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From cb17643b57ba3380b740a0cee541a000b527a00d Mon Sep 17 00:00:00 2001 From: Hacker <3442417@qq.com> Date: Wed, 20 Jan 2021 10:19:48 +0800 Subject: [PATCH 014/381] Translated 20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS (#20790) Co-authored-by: frstlis <48125063@qq.com> --- ...L, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md | 443 ------------------ ...L, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md | 443 ++++++++++++++++++ 2 files changed, 443 insertions(+), 443 deletions(-) delete mode 100644 sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md create mode 100644 translated/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md diff --git a/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md b/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md deleted file mode 100644 index 8209a7959a..0000000000 --- a/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md +++ /dev/null @@ -1,443 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (stevenzdg988) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS) -[#]: via: (https://www.ostechnix.com/install-apache-mysql-php-lamp-stack-on-ubuntu-18-04-lts/) -[#]: author: (SK https://www.ostechnix.com/author/sk/) - -Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS -====== - -![](https://www.ostechnix.com/wp-content/uploads/2019/02/lamp-720x340.jpg) - -**LAMP** stack is a popular, open source web development platform that can be used to run and deploy dynamic websites and web-based applications. Typically, LAMP stack consists of Apache webserver, MariaDB/MySQL databases, PHP/Python/Perl programming languages. LAMP is the acronym of **L** inux, **M** ariaDB/ **M** YSQL, **P** HP/ **P** ython/ **P** erl. This tutorial describes how to install Apache, MySQL, PHP (LAMP stack) in Ubuntu 18.04 LTS server. - -### Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS - -For the purpose of this tutorial, we will be using the following Ubuntu testbox. - - * **Operating System** : Ubuntu 18.04.1 LTS Server Edition - * **IP address** : 192.168.225.22/24 - - - -#### 1. Install Apache web server - -First of all, update Ubuntu server using commands: - -``` -$ sudo apt update - -$ sudo apt upgrade -``` - -Next, install Apache web server: - -``` -$ sudo apt install apache2 -``` - -Check if Apache web server is running or not: - -``` -$ sudo systemctl status apache2 -``` - -Sample output would be: - -``` -● apache2.service - The Apache HTTP Server - Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: en - Drop-In: /lib/systemd/system/apache2.service.d - └─apache2-systemd.conf - Active: active (running) since Tue 2019-02-05 10:48:03 UTC; 1min 5s ago - Main PID: 2025 (apache2) - Tasks: 55 (limit: 2320) - CGroup: /system.slice/apache2.service - ├─2025 /usr/sbin/apache2 -k start - ├─2027 /usr/sbin/apache2 -k start - └─2028 /usr/sbin/apache2 -k start - -Feb 05 10:48:02 ubuntuserver systemd[1]: Starting The Apache HTTP Server... -Feb 05 10:48:03 ubuntuserver apachectl[2003]: AH00558: apache2: Could not reliably -Feb 05 10:48:03 ubuntuserver systemd[1]: Started The Apache HTTP Server. -``` - -Congratulations! Apache service is up and running!! - -##### 1.1 Adjust firewall to allow Apache web server - -By default, the apache web browser can’t be accessed from remote systems if you have enabled the UFW firewall in Ubuntu 18.04 LTS. You must allow the http and https ports by following the below steps. - -First, list out the application profiles available on your Ubuntu system using command: - -``` -$ sudo ufw app list -``` - -Sample output: - -``` -Available applications: -Apache -Apache Full -Apache Secure -OpenSSH -``` - -As you can see, Apache and OpenSSH applications have installed UFW profiles. You can list out information about each profile and its included rules using “ **ufw app info “Profile Name”** command. - -Let us look into the **“Apache Full”** profile. To do so, run: - -``` -$ sudo ufw app info "Apache Full" -``` - -Sample output: - -``` -Profile: Apache Full -Title: Web Server (HTTP,HTTPS) -Description: Apache v2 is the next generation of the omnipresent Apache web -server. - -Ports: -80,443/tcp -``` - -As you see, “Apache Full” profile has included the rules to enable traffic to the ports **80** and **443** : - -Now, run the following command to allow incoming HTTP and HTTPS traffic for this profile: - -``` -$ sudo ufw allow in "Apache Full" -Rules updated -Rules updated (v6) -``` - -If you don’t want to allow https traffic, but only http (80) traffic, run: - -``` -$ sudo ufw app info "Apache" -``` - -##### 1.2 Test Apache Web server - -Now, open your web browser and access Apache test page by navigating to **** or ****. - -![](https://www.ostechnix.com/wp-content/uploads/2016/06/apache-2.png) - -If you are see a screen something like above, you are good to go. Apache server is working! - -#### 2. Install MySQL - -To install MySQL On Ubuntu, run: - -``` -$ sudo apt install mysql-server -``` - -Verify if MySQL service is running or not using command: - -``` -$ sudo systemctl status mysql -``` - -**Sample output:** - -``` -● mysql.service - MySQL Community Server -Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enab -Active: active (running) since Tue 2019-02-05 11:07:50 UTC; 17s ago -Main PID: 3423 (mysqld) -Tasks: 27 (limit: 2320) -CGroup: /system.slice/mysql.service -└─3423 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid - -Feb 05 11:07:49 ubuntuserver systemd[1]: Starting MySQL Community Server... -Feb 05 11:07:50 ubuntuserver systemd[1]: Started MySQL Community Server. -``` - -Mysql is running! - -##### 2.1 Setup database administrative user (root) password - -By default, MySQL **root** user password is blank. You need to secure your MySQL server by running the following script: - -``` -$ sudo mysql_secure_installation -``` - -You will be asked whether you want to setup **VALIDATE PASSWORD plugin** or not. This plugin allows the users to configure strong password for database credentials. If enabled, It will automatically check the strength of the password and enforces the users to set only those passwords which are secure enough. **It is safe to leave this plugin disabled**. However, you must use a strong and unique password for database credentials. If don’t want to enable this plugin, just press any key to skip the password validation part and continue the rest of the steps. - -If your answer is **Yes** , you will be asked to choose the level of password validation. - -``` -Securing the MySQL server deployment. - -Connecting to MySQL using a blank password. - -VALIDATE PASSWORD PLUGIN can be used to test passwords -and improve security. It checks the strength of password -and allows the users to set only those passwords which are -secure enough. Would you like to setup VALIDATE PASSWORD plugin? - -Press y|Y for Yes, any other key for No y -``` - -The available password validations are **low** , **medium** and **strong**. Just enter the appropriate number (0 for low, 1 for medium and 2 for strong password) and hit ENTER key. - -``` -There are three levels of password validation policy: - -LOW Length >= 8 -MEDIUM Length >= 8, numeric, mixed case, and special characters -STRONG Length >= 8, numeric, mixed case, special characters and dictionary file - -Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: -``` - -Now, enter the password for MySQL root user. Please be mindful that you must use password for mysql root user depending upon the password policy you choose in the previous step. If you didn’t enable the plugin, just use any strong and unique password of your choice. - -``` -Please set the password for root here. - -New password: - -Re-enter new password: - -Estimated strength of the password: 50 -Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y -``` - -Once you entered the password twice, you will see the password strength (In our case it is **50** ). If it is OK for you, press Y to continue with the provided password. If not satisfied with password length, press any other key and set a strong password. I am OK with my current password, so I chose **y**. - -For the rest of questions, just type **y** and hit ENTER. This will remove anonymous user, disallow root user login remotely and remove test database. - -``` -Remove anonymous users? (Press y|Y for Yes, any other key for No) : y -Success. - -Normally, root should only be allowed to connect from -'localhost'. This ensures that someone cannot guess at -the root password from the network. - -Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y -Success. - -By default, MySQL comes with a database named 'test' that -anyone can access. This is also intended only for testing, -and should be removed before moving into a production -environment. - -Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y -- Dropping test database... -Success. - -- Removing privileges on test database... -Success. - -Reloading the privilege tables will ensure that all changes -made so far will take effect immediately. - -Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y -Success. - -All done! -``` - -That’s it. Password for MySQL root user has been set. - -##### 2.2 Change authentication method for MySQL root user - -By default, MySQL root user is set to authenticate using the **auth_socket** plugin in MySQL 5.7 and newer versions on Ubuntu. Even though it enhances the security, it will also complicate things when you access your database server using any external programs, for example phpMyAdmin. To fix this issue, you need to change authentication method from **auth_socket** to **mysql_native_password**. To do so, login to your MySQL prompt using command: - -``` -$ sudo mysql -``` - -Run the following command at the mysql prompt to find the current authentication method for all mysql user accounts: - -``` -SELECT user,authentication_string,plugin,host FROM mysql.user; -``` - -**Sample output:** - -``` -+------------------|-------------------------------------------|-----------------------|-----------+ -| user | authentication_string | plugin | host | -+------------------|-------------------------------------------|-----------------------|-----------+ -| root | | auth_socket | localhost | -| mysql.session | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost | -| mysql.sys | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost | -| debian-sys-maint | *F126737722832701DD3979741508F05FA71E5BA0 | mysql_native_password | localhost | -+------------------|-------------------------------------------|-----------------------|-----------+ -4 rows in set (0.00 sec) -``` - -![][2] - -As you see, mysql root user uses `auth_socket` plugin for authentication. - -To change this authentication to **mysql_native_password** method, run the following command at mysql prompt. Don’t forget to replace **“password”** with a strong and unique password of your choice. If you have enabled VALIDATION plugin, make sure you have used a strong password based on the current policy requirements. - -``` -ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; -``` - -Update the changes using command: - -``` -FLUSH PRIVILEGES; -``` - -Now check again if the authentication method is changed or not using command: - -``` -SELECT user,authentication_string,plugin,host FROM mysql.user; -``` - -Sample output: - -![][3] - -Good! Now the myql root user can authenticate using password to access mysql shell. - -Exit from the mysql prompt: - -``` -exit -``` - -#### 3\. Install PHP - -To install PHP, run: - -``` -$ sudo apt install php libapache2-mod-php php-mysql -``` - -After installing PHP, create **info.php** file in the Apache root document folder. Usually, the apache root document folder will be **/var/www/html/** or **/var/www/** in most Debian based Linux distributions. In Ubuntu 18.04 LTS, it is **/var/www/html/**. - -Let us create **info.php** file in the apache root folder: - -``` -$ sudo vi /var/www/html/info.php -``` - -Add the following lines: - -``` - -``` - -Press ESC key and type **:wq** to save and quit the file. Restart apache service to take effect the changes. - -``` -$ sudo systemctl restart apache2 -``` - -##### 3.1 Test PHP - -Open up your web browser and navigate to **** URL. - -You will see the php test page now. - -![](https://www.ostechnix.com/wp-content/uploads/2019/02/php-test-page.png) - -Usually, when a user requests a directory from the web server, Apache will first look for a file named **index.html**. If you want to change Apache to serve php files rather than others, move **index.php** to first position in the **dir.conf** file as shown below - -``` -$ sudo vi /etc/apache2/mods-enabled/dir.conf -``` - -Here is the contents of the above file. - -``` - -DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm - - -# vim: syntax=apache ts=4 sw=4 sts=4 sr noet -``` - -Move the “index.php” file to first. Once you made the changes, your **dir.conf** file will look like below. - -``` - -DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm - - -# vim: syntax=apache ts=4 sw=4 sts=4 sr noet -``` - -Press **ESC** key and type **:wq** to save and close the file. Restart Apache service to take effect the changes. - -``` -$ sudo systemctl restart apache2 -``` - -##### 3.2 Install PHP modules - -To improve the functionality of PHP, you can install some additional PHP modules. - -To list the available PHP modules, run: - -``` -$ sudo apt-cache search php- | less -``` - -**Sample output:** - -![][4] - -Use the arrow keys to go through the result. To exit, type **q** and hit ENTER key. - -To find the details of any particular php module, for example **php-gd** , run: - -``` -$ sudo apt-cache show php-gd -``` - -To install a php module run: - -``` -$ sudo apt install php-gd -``` - -To install all modules (not necessary though), run: - -``` -$ sudo apt-get install php* -``` - -Do not forget to restart Apache service after installing any php module. To check if the module is loaded or not, open info.php file in your browser and check if it is present. - -Next, you might want to install any database management tools to easily manage databases via a web browser. If so, install phpMyAdmin as described in the following link. - -Congratulations! We have successfully setup LAMP stack in Ubuntu 18.04 LTS server. - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/install-apache-mysql-php-lamp-stack-on-ubuntu-18-04-lts/ - -作者:[SK][a] -选题:[lujun9972][b] -译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.ostechnix.com/author/sk/ -[b]: https://github.com/lujun9972 -[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[2]: http://www.ostechnix.com/wp-content/uploads/2019/02/mysql-1.png -[3]: http://www.ostechnix.com/wp-content/uploads/2019/02/mysql-2.png -[4]: http://www.ostechnix.com/wp-content/uploads/2016/06/php-modules.png diff --git a/translated/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md b/translated/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md new file mode 100644 index 0000000000..02dbb2fbcd --- /dev/null +++ b/translated/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md @@ -0,0 +1,443 @@ +[#]: collector: (lujun9972) +[#]: translator: (stevenzdg988) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS) +[#]: via: (https://www.ostechnix.com/install-apache-mysql-php-lamp-stack-on-ubuntu-18-04-lts/) +[#]: author: (SK https://www.ostechnix.com/author/sk/) + +Ubuntu 18.04 LTS 安装 Apache,MySQL,PHP(LAMP)套件 +====== + +![](https://www.ostechnix.com/wp-content/uploads/2019/02/lamp-720x340.jpg) + +**LAMP** 套件是一种流行的开源 Web 开发平台,可用于运行和部署动态网站和基于 Web 的应用程序。 通常,LAMP 套件由 Apache Web 服务器,MariaDB/MySQL 数据库,PHP/Python/Perl 程序设计(脚本)语言组成。 LAMP 是 **L**inux,**M**ariaDB/**M**YSQL,**P**HP/**P**ython/**P**erl 的缩写。 本教程描述了如何在 Ubuntu 18.04 LTS 服务器中安装 Apache,MySQL,PHP(LAMP套件)。 + +### 在Ubuntu 18.04 LTS 上安装 Apache,MySQL,PHP(LAMP)套件 + +就本教程而言,我们将使用以下 Ubuntu 测试项。 + + * **操作系统**:Ubuntu 18.04.1 LTS Server Edition + * **IP 地址** :192.168.225.22/24 + + + +#### 1. 安装 Apache Web 服务器 + +首先,利用下面命令更新 Ubuntu 服务器: + +``` +$ sudo apt update + +$ sudo apt upgrade +``` + +然后,安装 Apache Web 服务器(命令如下): + +``` +$ sudo apt install apache2 +``` + +检查 Apache Web 服务器是否已经运行: + +``` +$ sudo systemctl status apache2 +``` + +输出结果大概是这样的: + +``` +● apache2.service - The Apache HTTP Server + Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: en + Drop-In: /lib/systemd/system/apache2.service.d + └─apache2-systemd.conf + Active: active (running) since Tue 2019-02-05 10:48:03 UTC; 1min 5s ago + Main PID: 2025 (apache2) + Tasks: 55 (limit: 2320) + CGroup: /system.slice/apache2.service + ├─2025 /usr/sbin/apache2 -k start + ├─2027 /usr/sbin/apache2 -k start + └─2028 /usr/sbin/apache2 -k start + +Feb 05 10:48:02 ubuntuserver systemd[1]: Starting The Apache HTTP Server... +Feb 05 10:48:03 ubuntuserver apachectl[2003]: AH00558: apache2: Could not reliably +Feb 05 10:48:03 ubuntuserver systemd[1]: Started The Apache HTTP Server. +``` + +祝贺你! Apache 服务已经启动并运行了!! + +##### 1.1 调整防火墙允许 Apache Web 服务器 + +默认情况下,如果您已在 Ubuntu 18.04 LTS 中启用 UFW 防火墙,则无法从远程系统访问 Apache Web 服务器。 必须按照以下步骤开启 `http` 和 `https` 端口。 + +首先,使用以下命令列出 Ubuntu 系统上可用的应用程序配置文件: + +``` +$ sudo ufw app list +``` + +输出结果: + +``` +Available applications: +Apache +Apache Full +Apache Secure +OpenSSH +``` + +如你所见,Apache 和 OpenSSH 应用程序已安装 UFW 配置文件。你可以使用 “**ufw app info “Profile Name”**” 命令列出有关每个配置文件及其包含的规则的信息。 + +让我们研究一下 **“Apache Full”** 配置文件。 为此,请运行: + +``` +$ sudo ufw app info "Apache Full" +``` + +输出结果: + +``` +Profile: Apache Full +Title: Web Server (HTTP,HTTPS) +Description: Apache v2 is the next generation of the omnipresent Apache web +server. + +Ports: +80,443/tcp +``` + +如你所见,“Apache Full” 配置文件包含了启用经由端口 **80** 和 **443** 的传输规则: + +现在,运行以下命令配置允许 HTTP 和 HTTPS 传入通信: + +``` +$ sudo ufw allow in "Apache Full" +Rules updated +Rules updated (v6) +``` + +如果您不想允许 `https` 通信,而只允许 `http(80)` 通信,请运行: + +``` +$ sudo ufw app info "Apache" +``` + +##### 1.2 测试 Apache Web 服务器 + +现在,打开 Web 浏览器并导航到 **** 或 **** 来访问 Apache 测试页。 + +![](https://www.ostechnix.com/wp-content/uploads/2016/06/apache-2.png) + +如果看到上面类似的显示内容,那就成功了。 Apache 服务器正在工作! + +#### 2. 安装 MySQL + +在 Ubuntu 安装 MySQL 请运行: + +``` +$ sudo apt install mysql-server +``` + +使用以下命令验证 MySQL 服务是否正在运行: + +``` +$ sudo systemctl status mysql +``` + +**输出结果:** + +``` +● mysql.service - MySQL Community Server +Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enab +Active: active (running) since Tue 2019-02-05 11:07:50 UTC; 17s ago +Main PID: 3423 (mysqld) +Tasks: 27 (limit: 2320) +CGroup: /system.slice/mysql.service +└─3423 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid + +Feb 05 11:07:49 ubuntuserver systemd[1]: Starting MySQL Community Server... +Feb 05 11:07:50 ubuntuserver systemd[1]: Started MySQL Community Server. +``` + +MySQL 正在运行! + +##### 2.1 配置数据库管理用户(root)密码 + +默认情况下,MySQL **root** 用户密码为空。您需要通过运行以下脚本使你的 MySQL 服务器安全: + +``` +$ sudo mysql_secure_installation +``` + +系统将询问你是否要安装 **VALIDATE PASSWORD plugin(密码验证插件)**。该插件允许用户为数据库配置强密码凭据。如果启用,它将自动检查密码的强度并强制用户设置足够安全的密码。 **禁用此插件是安全的**。但是,必须为数据库使用唯一的强密码凭据。如果不想启用此插件,只需按任意键即可跳过密码验证部分,然后继续其余步骤。 + +如果回答是 **是**,则会要求您选择密码验证级别。 + +``` +Securing the MySQL server deployment. + +Connecting to MySQL using a blank password. + +VALIDATE PASSWORD PLUGIN can be used to test passwords +and improve security. It checks the strength of password +and allows the users to set only those passwords which are +secure enough. Would you like to setup VALIDATE PASSWORD plugin? + +Press y|Y for Yes, any other key for No y +``` + +可用的密码验证有 **low(低)** , **medium(中)** and **strong(强)**。只需输入适当的数字(0表示低,1表示中,2表示强密码)并按 ENTER 键。 + +``` +There are three levels of password validation policy: + +LOW Length >= 8 +MEDIUM Length >= 8, numeric, mixed case, and special characters +STRONG Length >= 8, numeric, mixed case, special characters and dictionary file + +Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: +``` + +现在,输入 MySQL root 用户的密码。请注意,必须根据上一步中选择的密码策略,为 Mysql root 用户使用密码。如果你未启用该插件,则只需使用你选择的任意强度且唯一的密码即可。 + +``` +Please set the password for root here. + +New password: + +Re-enter new password: + +Estimated strength of the password: 50 +Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y +``` + +两次输入密码后,您将看到密码强度(在此示例情况下为**50**)。如果您确定可以,请按 Y 继续提供的密码。如果对密码长度不满意,请按其他任意键并设置一个强密码。我现在的密码可以,所以我选择了**y**。 + +对于其余的问题,只需键入**y**并按 Enter。这将删除匿名用户,禁止 root 用户远程登录并删除 `test`(测试)数据库。 + +``` +Remove anonymous users? (Press y|Y for Yes, any other key for No) : y +Success. + +Normally, root should only be allowed to connect from +'localhost'. This ensures that someone cannot guess at +the root password from the network. + +Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y +Success. + +By default, MySQL comes with a database named 'test' that +anyone can access. This is also intended only for testing, +and should be removed before moving into a production +environment. + +Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y +- Dropping test database... +Success. + +- Removing privileges on test database... +Success. + +Reloading the privilege tables will ensure that all changes +made so far will take effect immediately. + +Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y +Success. + +All done! +``` + +以上就是为 MySQL root 用户设置密码。 + +##### 2.2 更改 MySQL 超级用户的身份验证方法 + +默认情况下,Ubuntu 系统的 MySQL root 用户为 MySQL 5.7 版本使用插件 **auth_socket** 和更新版本设置身份验证。 尽管它增强了安全性,但是当您使用任何外部程序(例如 phpMyAdmin)访问数据库服务器时,也会变得更困难。 要解决此问题,您需要将身份验证方法从 **auth_socket** 更改为 **mysql_native_password**。 为此,请使用以下命令登录到您的 MySQL 提示符下: + +``` +$ sudo mysql +``` + +在 MySQL 提示符下运行以下命令,找到所有 MySQL 当前用户帐户的身份验证方法: + +``` +SELECT user,authentication_string,plugin,host FROM mysql.user; +``` + +**输出结果:** + +``` ++------------------|-------------------------------------------|-----------------------|-----------+ +| user | authentication_string | plugin | host | ++------------------|-------------------------------------------|-----------------------|-----------+ +| root | | auth_socket | localhost | +| mysql.session | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost | +| mysql.sys | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost | +| debian-sys-maint | *F126737722832701DD3979741508F05FA71E5BA0 | mysql_native_password | localhost | ++------------------|-------------------------------------------|-----------------------|-----------+ +4 rows in set (0.00 sec) +``` + +![][2] + +如你所见,Mysql root 用户使用 `auth_socket` 插件进行身份验证。 + +要将此身份验证更改为 **mysql_native_password** 方法,请在 Mysql 提示符下运行以下命令。 别忘了用你选择的强大唯一密码替换 **“password”**。 如果已启用 VALIDATION 插件,请确保已根据当前策略要求使用了强密码。 + +``` +ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; +``` + +使用以下命令更新数据库: + +``` +FLUSH PRIVILEGES; +``` + +使用命令再次检查身份验证方法是否已更改: + +``` +SELECT user,authentication_string,plugin,host FROM mysql.user; +``` + +输出结果: + +![][3] + +好!Myql root 用户就可以使用密码进行身份验证来访问 `mysql shell`。 + +从 Mysql 提示符下退出: + +``` +exit +``` + +#### 3\. 安装 PHP + +安装 PHP 请运行: + +``` +$ sudo apt install php libapache2-mod-php php-mysql +``` + +安装 PHP 后,在 Apache 文档根目录中创建 **info.php** 文件。通常,在大多数基于 Debian 的 Linux 发行版中,Apache 文档根目录为 **/var/www/html/** 或 **/var/www/**。Ubuntu 18.04 LTS 系统下,文档根目录是 **/var/www/html/**。 + +在 Apache 根目录中创建 **info.php** 文件: + +``` +$ sudo vi /var/www/html/info.php +``` + +在此文件中编辑如下内容: + +``` + +``` + +然后按下 ESC 键并且输入 **:wq** 保存并退出此文件。重新启动 Apache 服务使更改生效。 + +``` +$ sudo systemctl restart apache2 +``` + +##### 3.1 测试 PHP + +打开 Web 浏览器,然后导航到 URL ****。 + +你就将看到 `php` 测试页面。 + +![](https://www.ostechnix.com/wp-content/uploads/2019/02/php-test-page.png) + +通常,当用户向 Web 服务器发出请求时,Apache 首先会在文档根目录中查找名为 **index.html** 的文件。如果您想将 Apache 更改为 `php` 文件提供服务而不是其他文件,请将 **dir.conf** 配置文件中的 **index.php** 移至第一个位置,如下所示: + +``` +$ sudo vi /etc/apache2/mods-enabled/dir.conf +``` + +上面的配置文件 (**dir.conf**) 内容如下: + +``` + +DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet +``` + +将 **“index.php”** 移动到最前面。更改后,**dir.conf** 文件内容看起来如下所示。 + +``` + +DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet +``` + +然后按下 ESC 键并且输入 **:wq** 保存并关闭此文件。重新启动 Apache 服务使更改生效。 + +``` +$ sudo systemctl restart apache2 +``` + +##### 3.2 安装 PHP 模块 + +为了增加 PHP 的功能,可以安装一些其他的 PHP 模块。 + +要列出可用的 PHP 模块,请运行: + +``` +$ sudo apt-cache search php- | less +``` + +**输出结果:** + +![][4] + +使用方向键浏览结果。要退出,请输入**q** 并按下 ENTER 键。 + +要查找任意 `php` 模块的详细信息,例如 **php-gd**,请运行: + +``` +$ sudo apt-cache show php-gd +``` + +安装 `php` 模块请运行: + +``` +$ sudo apt install php-gd +``` + +安装所有的模块(虽然没有必要),请运行: + +``` +$ sudo apt-get install php* +``` + +安装任何 `php` 模块后,请不要忘记重新启动 Apache 服务。要检查模块是否已加载,请在浏览器中打开 `info.php` 文件并检查是否存在。 + +接下来,您可能需要安装数据库管理工具,以通过 Web 浏览器轻松管理数据库。如果是这样,请按照以下链接中的说明安装 `phpMyAdmin`。 + +祝贺你!我们已经在 Ubuntu 18.04 LTS 服务器中成功配置了 LAMP 套件。 + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/install-apache-mysql-php-lamp-stack-on-ubuntu-18-04-lts/ + +作者:[SK][a] +选题:[lujun9972][b] +译者:[stevenzdg988](https://github.com/stevenzdg988) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[2]: http://www.ostechnix.com/wp-content/uploads/2019/02/mysql-1.png +[3]: http://www.ostechnix.com/wp-content/uploads/2019/02/mysql-2.png +[4]: http://www.ostechnix.com/wp-content/uploads/2016/06/php-modules.png From 6074864bd0d152fe8c36fb54d68b73e4e2487bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Wed, 20 Jan 2021 16:44:43 +0800 Subject: [PATCH 015/381] Translated --- ...1231 Build your own text editor in Java.md | 342 ------------------ ...1231 Build your own text editor in Java.md | 319 ++++++++++++++++ 2 files changed, 319 insertions(+), 342 deletions(-) delete mode 100644 sources/tech/20201231 Build your own text editor in Java.md create mode 100644 translated/tech/20201231 Build your own text editor in Java.md diff --git a/sources/tech/20201231 Build your own text editor in Java.md b/sources/tech/20201231 Build your own text editor in Java.md deleted file mode 100644 index b0cfec8471..0000000000 --- a/sources/tech/20201231 Build your own text editor in Java.md +++ /dev/null @@ -1,342 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Build your own text editor in Java) -[#]: via: (https://opensource.com/article/20/12/write-your-own-text-editor) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Build your own text editor in Java -====== -Sometimes, no one can make your dream tool but you. Here's how to start -building your own text editor. -![Working from home at a laptop][1] - -There are a lot of text editors available. There are those that run in the terminal, in a GUI, in a browser, and in a browser engine. Many are very good, and some are great. But sometimes, the most satisfying answer to any question is the one you build yourself. - -Make no mistake: building a really good text editor is a lot harder than it may seem. But then again, it’s also not as hard as you might fear to build a basic one. In fact, most programming toolkits already have most of the text editor parts ready for you to use. The components around the text editing, such as a menu bar, file chooser dialogues, and so on, are easy to drop into place. As a result, a basic text editor is a surprisingly fun and elucidating, though intermediate, lesson in programming. You might find yourself eager to use a tool of your own construction, and the more you use it, the more you might be inspired to add to it, learning even more about the programming language you’re using. - -To make this exercise realistic, it’s best to choose a language with a good GUI toolkit. There are many to choose from, including Qt, FLTK, or GTK, but be sure to review the documentation first to ensure it has the features you expect. For this article, I use Java with its built-in Swing widget set. If you want to use a different language or a different toolset, this article can still be useful in giving you an idea of how to approach the problem. - -Writing a text editor in any major toolkit is surprisingly similar, no matter which one you choose. If you’re new to Java and need further information on getting started, read my [Guessing Game article][2] first. - -### Project setup - -Normally, I use and recommend an IDE like [Netbeans][3] or Eclipse, but I find that, when practicing a new language, it can be helpful to do some manual labor, so you better understand the things that get hidden from you when using an IDE. In this article, I assume you’re programming using a text editor and a terminal. - -Before getting started, create a project directory for yourself. In the project folder, create one directory called `src` to hold your source files. - - -``` -$ mkdir -p myTextEditor/src -$ cd myTextEditor -``` - -Create an empty file called `TextEdit.java` in your `src` directory: - - -``` -`$ touch src/TextEditor.java` -``` - -Open the file in your favorite text editor (I mean your favorite one that you didn’t write) and get ready to code! - -### Package and imports - -To ensure your Java application has a unique identifier, you must declare a **package** name. The typical format for this is to use a reverse domain name, which is particularly easy should you actually have a domain name. If you don’t, you can use `local` as the top level. As usual for Java and many languages, the line is terminated with a semicolon. - -After naming your Java package, you must tell the Java compiler (`javac`) what libraries to use when building your code. In practice, this is something you usually add to as you code because you rarely know yourself what libraries you need. However, there are some that are obvious beforehand. For instance, you know this text editor is based around the Swing GUI toolkit, so importing `javax.swing.JFrame` and `javax.swing.UIManager` and other related libraries is a given. - - -``` -package com.example.textedit; - -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JTextArea; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.filechooser.FileSystemView; -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.util.Scanner; -import java.util.logging.Level; -import java.util.logging.Logger; -``` - -For the purpose of this exercise, you get prescient knowledge of all the libraries you need in advance. In real life, regardless of what language you favor, you’ll discover libraries as you research how to solve any given problem, and then you’ll import it into your code and use it. And don’t worry—should you forget to include a library, your compiler or interpreter will warn you! - -### Main window - -This is a single-window application, so the primary class of this application is a JFrame with an `ActionListener` attached to catch menu events. In Java, when you’re using an existing widget element, you "extend" it with your code. This main window needs three fields: the window itself (an instance of JFrame), an indicator for the return value of the file chooser, and the text editor itself (JTextArea). - - -``` -public final class TextEdit extends [JFrame][4] implements [ActionListener][5] { -private static [JTextArea][6] area; -private static [JFrame][4] frame; -private static int returnValue = 0; -``` - -Amazingly, these few lines do about 80% of the work toward implementing a basic text editor because JTextArea is Java’s text entry field. Most of the remaining 80 lines take care of helper features, like saving and opening files. - -### Building a menu - -The `JMenuBar` widget is designed to sit at the top of a JFrame, providing as many entries as you want. Java isn’t a drag-and-drop programming language, though, so for every menu you add, you must also program a function. To keep this project manageable, I provide four functions: creating a new file, opening an existing file, saving text to a file, and closing the application. - -The process of creating a menu is basically the same in most popular toolkits. First, you create the menubar itself, then you create a top-level menu (such as "File"), and then you create submenu items (such as "New," "Save," and so on). - - -``` - public TextEdit() { run(); } - -  public void run() { -    frame = new [JFrame][4]("Text Edit"); - -    // Set the look-and-feel (LNF) of the application -        // Try to default to whatever the host system prefers -    try { -      [UIManager][7].setLookAndFeel([UIManager][7].getSystemLookAndFeelClassName()); -    } catch ([ClassNotFoundException][8] | [InstantiationException][9] | [IllegalAccessException][10] | [UnsupportedLookAndFeelException][11] ex) { -      Logger.getLogger(TextEdit.class.getName()).log(Level.SEVERE, null, ex); -    } - -        // Set attributes of the app window -    area = new [JTextArea][6](); -    frame.setDefaultCloseOperation([JFrame][4].EXIT_ON_CLOSE); -    frame.add(area); -    frame.setSize(640, 480); -        frame.setVisible(true); - -        // Build the menu -    [JMenuBar][12] menu_main = new [JMenuBar][12](); - -        [JMenu][13] menu_file = new [JMenu][13]("File"); - -        [JMenuItem][14] menuitem_new = new [JMenuItem][14]("New"); -    [JMenuItem][14] menuitem_open = new [JMenuItem][14]("Open"); -    [JMenuItem][14] menuitem_save = new [JMenuItem][14]("Save"); -    [JMenuItem][14] menuitem_quit = new [JMenuItem][14]("Quit"); - -        menuitem_new.addActionListener(this); -    menuitem_open.addActionListener(this); -    menuitem_save.addActionListener(this); -    menuitem_quit.addActionListener(this); - -        menu_main.add(menu_file); - -        menu_file.add(menuitem_new); -    menu_file.add(menuitem_open); -    menu_file.add(menuitem_save); -    menu_file.add(menuitem_quit); - -        frame.setJMenuBar(menu_main); -    } -``` - -  - -All that’s left to do now is to implement the functions described by the menu items. - -### Programming menu actions - -Your application responds to menu selections because your JFrame has an `ActionListener` attached to it. When you implement an event handler in Java, you must "override" its built-in functions. This sounds more severe than it actually is. You’re not rewriting Java; you’re just implementing functions that have been defined but not implemented by the event handler. - -In this case, you must override the `actionPerformed` method. Because nearly all entries in the **File** menu have something to do with files, my code defines a JFileChooser early. The rest of the code is separated into clauses of an `if` statement, which looks to see what event was received and acts accordingly. Each clause is drastically different from the other because each item suggests something wholly unique. The most similar are **Open** and **Save** because they both use the JFileChooser to select a point in the filesystem to either get or put data. - -The "**New**" selection clears the JTextArea without warning, and **Quit** closes the application without warning. Both of these "features" are dangerous, so should you want to make a small improvement to this code, that’s a good place to start. A friendly warning that the content hasn’t been saved is a vital feature of any good text editor, but for simplicity’s sake, that’s a feature for the future. - - -``` -@Override -public void actionPerformed([ActionEvent][15] e) { -    [String][16] ingest = null; -    [JFileChooser][17] jfc = new [JFileChooser][17]([FileSystemView][18].getFileSystemView().getHomeDirectory()); -    jfc.setDialogTitle("Choose destination."); -    jfc.setFileSelectionMode([JFileChooser][17].FILES_AND_DIRECTORIES); - -    [String][16] ae = e.getActionCommand(); -    if (ae.equals("Open")) { -        returnValue = jfc.showOpenDialog(null); -        if (returnValue == [JFileChooser][17].APPROVE_OPTION) { -        [File][19] f = new [File][19](jfc.getSelectedFile().getAbsolutePath()); -        try{ -            [FileReader][20] read = new [FileReader][20](f); -            Scanner scan = new Scanner(read); -            while(scan.hasNextLine()){ -                [String][16] line = scan.nextLine() + "\n"; -                ingest = ingest + line; -        } -            area.setText(ingest); -        } -    catch ( [FileNotFoundException][21] ex) { ex.printStackTrace(); } -} -    // SAVE -    } else if (ae.equals("Save")) { -        returnValue = jfc.showSaveDialog(null); -        try { -            [File][19] f = new [File][19](jfc.getSelectedFile().getAbsolutePath()); -            [FileWriter][22] out = new [FileWriter][22](f); -            out.write(area.getText()); -            out.close(); -        } catch ([FileNotFoundException][21] ex) { -            [Component][23] f = null; -            [JOptionPane][24].showMessageDialog(f,"File not found."); -        } catch ([IOException][25] ex) { -            [Component][23] f = null; -            [JOptionPane][24].showMessageDialog(f,"Error."); -        } -    } else if (ae.equals("New")) { -        area.setText(""); -    } else if (ae.equals("Quit")) { [System][26].exit(0); } -  } -} -``` - -That’s technically all there is to this text editor. Of course, nothing’s ever truly done, and besides, there’s still the testing and packaging steps, so there’s still plenty of time to discover missing requisites. In case you’re not picking up on the hint: there’s _definitely_ something missing in this code. Do you know what it is yet? (It’s mentioned mainly in the [Guessing Game article][2].) - -### Testing - -You can now test your application. Launch your text editor from a terminal: - - -``` -$ java ./src/TextEdit.java -error: can’t find main(String[]) method in class: com.example.textedit.TextEdit -``` - -It seems that the code hasn’t got a main method. There are a few ways to fix this problem: you could create a main method in `TextEdit.java` and have it run an instance of the `TextEdit` class, or you can create a separate file containing the main method. Both work equally well, but the latter is more realistic in terms of what to expect from large projects, so it’s worth getting used to dealing with separate files that work together to make a complete application. - -Create a `Main.java` file in `src` and open in your favorite editor: - - -``` -package com.example.textedit; - -public class Main { -  public static void main([String][16][] args) { -  TextEdit runner = new TextEdit(); -  } -} -``` - -You can try again, but now there are two files that depend upon one another to run, so you have to compile the code. Java uses the `javac` compiler, and you can set your destination directory with the `-d` option: - - -``` -`$ javac src/*java -d .` -``` - -This creates a new directory structure modeled exactly after your package name: `com/example/textedit`. This new classpath contains the files `Main.class` and `TextEdit.class`, which are the two files that make up your application. You can run them with `java` by referencing the location and _name_ (not the filename) of your Main class: - - -``` -`$ java info/slackermedia/textedit/Main` -``` - -Your text editor opens, and you can type into it, open files, and even save your work. - -![White text editor box with single drop down menu with options File, New, Open, Save, and Quit][27] - -### Sharing your work as a Java package - -While it seems to be acceptable to some programmers to deliver applications as an assortment of source files and hearty encouragement to learn how to run them, Java makes it really easy to package up your application so others can run it. You have most of the structure required, but you do need to add some metadata to a `Manifest.txt` file: - - -``` -`$ echo "Manifest-Version: 1.0" > Manifest.txt` -``` - -The `jar` command, used for packaging, is a lot like the [tar][28] command, so many of the options may look familiar to you. To create a JAR file: - - -``` -$ jar cvfme TextEdit.jar -Manifest.txt -com.example.textedit.Main -com/example/textedit/*.class -``` - -From the syntax of the command, you may surmise that it creates a new JAR file called `TextEdit.jar`, with its required manifest data located in `Manifest.txt`. Its main class is defined as an extension of the package name, and the class itself is `com/example/textedit/Main.class`. - -You can view the contents of the JAR file: - - -``` -$ jar tvf TextEdit.jar -0 Wed Nov 25 META-INF/ -105 Wed Nov 25 META-INF/MANIFEST.MF -338 Wed Nov 25 com/example/textedit/textedit/Main.class -4373 Wed Nov 25 com/example/textedit/textedit/TextEdit.class -``` - -And you can even extract it with the `xvf` options, if you’d like to see how your metadata has been integrated into the `MANIFEST.MF` file. - -Run your JAR file with the `java` command: - - -``` -`$ java -jar TextEdit.jar` -``` - -You can even [create a desktop file][29], so your application launches at the click of an icon in your applications menu. - -### Improve it - -In its current state, this is a very basic text editor, best suited for quick notes or short README documents. Some improvements (such as adding a vertical scrollbar) are quick and easy with a little research, while others (such as implementing an extensive preferences system) require real work. - -But if you’ve been meaning to learn a new language, this could be the perfect practical project for your self-education. Creating a text editor, as you can see, isn’t overwhelming in terms of code, and it’s manageable in scope. If you use text editors frequently, then writing your own can be satisfying and fun. So open your favorite text editor (the one you wrote) and start adding features! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/12/write-your-own-text-editor - -作者:[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/article/20/12/learn-java -[3]: https://opensource.com/article/20/12/netbeans -[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+jframe -[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+actionlistener -[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+jtextarea -[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+uimanager -[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+classnotfoundexception -[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+instantiationexception -[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+illegalaccessexception -[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+unsupportedlookandfeelexception -[12]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+jmenubar -[13]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+jmenu -[14]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+jmenuitem -[15]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+actionevent -[16]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string -[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+jfilechooser -[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filesystemview -[19]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+file -[20]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filereader -[21]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filenotfoundexception -[22]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filewriter -[23]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+component -[24]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+joptionpane -[25]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+ioexception -[26]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system -[27]: https://opensource.com/sites/default/files/uploads/this-time-its-personal-31_days_yourself-opensource.png (White text editor box with single drop down menu with options File, New, Open, Save, and Quit) -[28]: https://opensource.com/article/17/7/how-unzip-targz-file -[29]: https://opensource.com/article/18/1/how-install-apps-linux diff --git a/translated/tech/20201231 Build your own text editor in Java.md b/translated/tech/20201231 Build your own text editor in Java.md new file mode 100644 index 0000000000..c19814bf31 --- /dev/null +++ b/translated/tech/20201231 Build your own text editor in Java.md @@ -0,0 +1,319 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Build your own text editor in Java) +[#]: via: (https://opensource.com/article/20/12/write-your-own-text-editor) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +使用 Java 构建你自己的文本编辑器 +====== +有时候,除你自己外,没有人能制作你所梦想的工具。这里是如何开始构建你自己的文本编辑器。 +![在家中的一台笔记本电脑上工作][1] + +这里有很多可用的文本编辑器。它们大多运行在终端中,运行在一个 GUI 中,运行在一个浏览器中,运行在一个浏览器引擎中。有很多是非常好的,有一些是极好的。但是有时候,毫无疑问,最令人满意的答案就是你自己构建的编辑器。 + +毫无疑问:构建一个真正优秀的文本编辑器比表面上看上去要困难得多。但话说回来,建立一个基本的文本编辑器也不像你所听到的那样苦难。事实上,大多数编程工具包已经为你准备好了可供你使用的文本编辑器的大多数部件。围绕文本编辑的组件,例如一个菜单条,一个文件选择对话框等等,是很容易拖拽到位置的。因此,在编程课中构建一个基本的文本编辑器是出乎意料的有趣和简明。你可能会发现自己渴望使用自己构造的工具,而且你使用得越多,你可能越会将受到启发而添加到该工具中,从而对你正在使用的编程语言有更多地学习。 + +为了使这个练习成为现实,最好选择一种有令人满意的 GUI 工具箱的语言。在这里有很多种选择,包括 Qt ,FLTK ,或 GTK ,但是一定要先评审一下它的文档,以确保它有你所期待的功能。对于这篇文章来说,我使用 Java 以及其内置的 Swing 小部件集。如果你想使用一种不同的语言或者一种不同的工具集,这篇文章在如何帮你解决这个问题的方面也仍然是有用的。 + +不管你选择哪一种,在任何主要的工具箱中编写一个文本编辑器都是惊人的相似。如果你是 Java 新手,需要更多关于开始的信息,请先阅读我的 [猜谜游戏文章][2] 。 + +### 工程设置 + +通常,我使用并推荐一款像 [Netbeans][3] 或 Eclipse 一样的 IDE ,我发现当学习一种新的语言时,它可以帮助做一些体力劳动,因此当你使用一款 IDE 时,你可以更好地理解一些对你隐藏的东西。在这篇文章中,我假设你正在使用一款文本编辑器和终端进行编程。 + +在开始前,为你自己的工程创建一个工程目录。在工程文件夹中,创建一个名称为 `src` 的目录来容纳你的源文件。 + + +``` +$ mkdir -p myTextEditor/src +$ cd myTextEditor +``` + +在你的 `src` 目录中创建一个名称为 `TextEdit.java` 的空白的文件: + + +``` +`$ touch src/TextEditor.java` +``` + +在你最喜欢的文本编辑器中打开这个空白的文件(我的意思事除你自己编写外的最喜欢的一款文本编辑器)。作好编码的准备! + +### Package 和 imports + +为确保你的 Java 应用程序有一个唯一的标识符,你必须声明一个 **package** 名称。典型的格式是使用一个反向的域名,如果你真的有一个域名的话,这就特别容易了。如果你没有域名的话,你可以使用 `local` 作为最顶层。像 Java 和很多语言一样,行以分号结尾。 + +在命名你的 Java 的 package 后,你必须告诉 Java 编译器 (`javac`) 使用那些库来构建你的代码。事实上,这是你在编写代码时所通常添加的内容,因为你很少知道你自己所需要的库。然而,这里有一些库是显而易见的。例如,你知道这个文本编辑器是基于 Swing GUI 工具箱的,因此,导入 `javax.swing.JFrame` 和`javax.swing.UIManager` 和其它相关的特定库。 + + +``` +package com.example.textedit; + +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JTextArea; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.filechooser.FileSystemView; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.util.Scanner; +import java.util.logging.Level; +import java.util.logging.Logger; +``` + +对于这个练习的目标,你可以提前预知你所需要的所有的库。在真实的生活中,不管你喜欢哪一种语言,你都将在研究如何解决一些问题的时候发现库,然后,你将它导入到你的代码中,并使用它。不需要担心 - 如果你忘记包含一个库,你的编译器或解释器将警告你! + +### 主窗口 + +这是一个单窗口应用程序,因此这个应用程序的主类是一个 JFrame ,其附带有一个捕捉菜单事件的 `ActionListener` 。在 Java 中,当那你使用一个现有的小部件元素时,你可以使用你的代码"扩展"它。这个主窗口需要三个字段:窗口本身(一个 JFrame 的实例),一个用于文件选择器返回值的标识符,和文本编辑器本身(JTextArea)。 + + +``` +public final class TextEdit extends JFrame implements ActionListener { +private static JTextArea area; +private static JFrame frame; +private static int returnValue = 0; +``` + +令人惊奇的是,这数行代码完成了实现一个基本文本编辑器的 80% 的工作,因为 JtextArea 是 Java 的文本输入字段。剩下的 80 行代码大部分用于处理助手功能,比如保存和打开文件。 + +### 构建一个菜单 + +`JMenuBar` 小部件被设计到 JFrame 的顶部, +它为你提供你想要的很多条目。Java 不是一种 +拖放式的编程语言,因此,对于你所添加的每一个菜单,你都还必须编写一个函数。为保持这个工程的可操纵性,我提供了四个函数:创建一个新的文件,打开一个现有的文件,保存文本到一个文件,和关闭应用程序。 + +在大多数流行的工具箱中,创建一个菜单的过程基本相同。首先,你创建菜单条本身,然后创建一个顶级菜单(例如 "File" ),再然后创建子菜单项(例如,"New","Save" 等)。 + + +``` + public TextEdit() { run(); } + + public void run() { + frame = new JFrame("Text Edit"); + + // Set the look-and-feel (LNF) of the application + // Try to default to whatever the host system prefers + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { + Logger.getLogger(TextEdit.class.getName()).log(Level.SEVERE, null, ex); + } + + // Set attributes of the app window + area = new JTextArea(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.add(area); + frame.setSize(640, 480); + frame.setVisible(true); + + // Build the menu + JMenuBar menu_main = new JMenuBar(); + + JMenu menu_file = new JMenu("File"); + + JMenuItem menuitem_new = new JMenuItem("New"); + JMenuItem menuitem_open = new JMenuItem("Open"); + JMenuItem menuitem_save = new JMenuItem("Save"); + JMenuItem menuitem_quit = new JMenuItem("Quit"); + + menuitem_new.addActionListener(this); + menuitem_open.addActionListener(this); + menuitem_save.addActionListener(this); + menuitem_quit.addActionListener(this); + + menu_main.add(menu_file); + + menu_file.add(menuitem_new); + menu_file.add(menuitem_open); + menu_file.add(menuitem_save); + menu_file.add(menuitem_quit); + + frame.setJMenuBar(menu_main); + } +``` + + + +现在,所有剩余的工作是实施菜单项所描述的功能。 + +### 编程菜单动作 + +你的应用程序响应菜单选择,是因为你的 JFrame 有一个附属于它的 `ActionListener` 。在 Java 中,当你实施一个事件处理程序时,你必须 "重写" 其内建的函数。这听起来比实际情况更严重。你不是在重写 Java;你只是在实施已经被定义但尚未实施事件处理程序的函数。 + +在这种情况下,你必须重写 `actionPerformed`方法。因为在 **File** 菜单中的所有条目都与处理文件有关,所以在我的代码中很早就定义了一个 JFileChooser 。代码其它部分被划分到一个 `if` 语句的子语句中,这起来像接收到什么事件就相应地执行什么动作。每个字语句都与其它的子语句完全不同,因为每个项目都标示着一些完全唯一的东西。最相似的是 **Open** 和 **Save** ,因为它们都使用 JFileChooser 选择文件系统中的一个点来获取或放置数据。 + +**New** 选项会在没有警告的情况下清理 JTextArea ,**Quit** 选项会在没有警告的情况下关闭应用程序。这两个 "功能" 都是不安全的,因此你应该想对这段代码进行一点改善,这是一个很好的开始。在内容还没有被保存前,一个友好的警告是任何一个好的文本编辑器都必不可少的一个功能,但是在这里为了简单,这件是未来的一个功能。 + + +``` +@Override +public void actionPerformed(ActionEvent e) { + String ingest = null; + JFileChooser jfc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory()); + jfc.setDialogTitle("Choose destination."); + jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); + + String ae = e.getActionCommand(); + if (ae.equals("Open")) { + returnValue = jfc.showOpenDialog(null); + if (returnValue == JFileChooser.APPROVE_OPTION) { + File f = new File(jfc.getSelectedFile().getAbsolutePath()); + try{ + FileReader read = new FileReader(f); + Scanner scan = new Scanner(read); + while(scan.hasNextLine()){ + String line = scan.nextLine() + "\n"; + ingest = ingest + line; + } + area.setText(ingest); + } + catch ( FileNotFoundException ex) { ex.printStackTrace(); } +} + // 保存 + } else if (ae.equals("Save")) { + returnValue = jfc.showSaveDialog(null); + try { + File f = new File(jfc.getSelectedFile().getAbsolutePath()); + FileWriter out = new FileWriter(f); + out.write(area.getText()); + out.close(); + } catch (FileNotFoundException ex) { + Component f = null; + JOptionPane.showMessageDialog(f,"File not found."); + } catch (IOException ex) { + Component f = null; + JOptionPane.showMessageDialog(f,"Error."); + } + } else if (ae.equals("New")) { + area.setText(""); + } else if (ae.equals("Quit")) { System.exit(0); } + } +} +``` + +从技术上来说,这就是这个文本编辑器的全部。当然,并没有真正做什么,除此之外,在这里仍然有测试和打包步骤,因此仍然有很多时间来发现缺少的必需品。假设你没有注意到提示:在这段代码中 _肯定_ 缺少一些东西。你现在知道缺少的是什么吗?(在 [猜谜游戏文章][4] 中被大量的提到.) + +### 测试 + +你现在可以测试你的应用程序。从一个终端中启动你所编写的文本编辑器: + + +``` +$ java ./src/TextEdit.java +error: can’t find main(String[]) method in class: com.example.textedit.TextEdit +``` + +它看起来像在代码中没有获得一个 main 方法。这里有一些方法来修复这个问题:你可以在 `TextEdit.java` 中创建一个 main 方法,并让它运行一个 `TextEdit` 类实例,或者你可以创建一个单独的包含 main 方法的文件。两种方法都工作地同样好,但从大型工程的预期来看,使用后者更为明智,因此,使用单独的文件与其一起工作使之成为一个完整的应用程序的方法是值得使用的。 + +在 `src` 中创建一个 `Main.java` 文件,并在最喜欢的编辑器中打开: + + +``` +package com.example.textedit; + +public class Main { + public static void main(String[] args) { + TextEdit runner = new TextEdit(); + } +} +``` + +你可以再次尝试,但是现在有两个相互依赖的文件要运行,因此你必须编译代码。Java 使用 `javac` 编译器,并且你可以使用 `-d` 选项来设置目标目录: + + +``` +`$ javac src/*java -d .` +``` + +这会在你的软件包名称 `com/example/textedit` 后创建一个准确地模型化的新的目录结构。这个新的类路径包含文件 `Main.class` 和 `TextEdit.class` ,这两个文件构成了你的应用程序。你可以使用 `java` 并通过引用你的 Main 类的位置和 _名称_(非文件名称)来运行它们: + + +``` +`$ java info/slackermedia/textedit/Main` +``` + +你的文本编辑器打开了,你可以在其中输入文字,打开文件,甚至保存你的工作。 + +![带有单个下拉菜单的白色文本编辑器框,有 File, New, Open, Save, 和 Quit 选项][5] + +### 以 Java 软件包的形式分享你的工作 + +虽然一些程序员似乎看起来认可以各种各样的源文件的型式分发软件包,并忠心鼓励其他人来学习如何运行它,但是,Java 让打包应用程序变得真地很容易,以至其他人可以很容易的运行它。你已经有了必备的大部分结构体,但是你仍然需要一些元数据到一个 `Manifest.txt` 文件中: + +``` +`$ echo "Manifest-Version: 1.0" > Manifest.txt` +``` + +用于打包的 `jar` 命令,与 [tar][6] 命令非常相似,因此很多选项对你来说可能会很熟悉。为创建一个 JAR 文件: + + +``` +$ jar cvfme TextEdit.jar +Manifest.txt +com.example.textedit.Main +com/example/textedit/*.class +``` + +根据命令的语法,你可以推测出它会创建一个新的名称为 `TextEdit.jar` 的 JAR 文件,它所需要的清单数据位于 `Manifest.txt` 中。它的主类被定义为软件包名称的一个扩展,并且类自身是 `com/example/textedit/Main.class` 。 + +你可以查看 JAR 文件的内容: + +``` +$ jar tvf TextEdit.jar +0 Wed Nov 25 META-INF/ +105 Wed Nov 25 META-INF/MANIFEST.MF +338 Wed Nov 25 com/example/textedit/textedit/Main.class +4373 Wed Nov 25 com/example/textedit/textedit/TextEdit.class +``` + +如果你想看看你的元数据是如何被集成到 `MANIFEST.MF` 文件中的,你甚至可以使用 `xvf` 选项来提取它。 + +使用 `java` 命令来运行你的 JAR 文件: + + +``` +`$ java -jar TextEdit.jar` +``` + +你甚至可以 [创建一个桌面文件][7] ,这样,在单击应用程序菜单中的图标时,应用程序就会启动。 + +### 改善它 + +在它是当前状态下,这是一个非常基本的文本编辑器,最适合做快速笔记或简短自述文档。在一些研究后,一些改善(例如添加一个垂直滚动条)是很快速和容易的,而其它的一些改善(例如实施一个广泛的首选项系统)就需要真正地好好工作了。 + +但如果你一直在想学一种新的语言,这可能是一个完美的自我学习实用工程。创建一个文本编辑器,如你所见,它在代码方面并不会是压倒你的最后一根稻草,它在一定范围是可控制的。如果你经常使用文本编辑器,那么编写你自己的文本编辑器可能会使你满意和快乐。因此打开你最喜欢的文本编辑器(你编写的那一个),开始添加功能! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/12/write-your-own-text-editor + +作者:[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/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) +[2]: https://opensource.com/article/20/12/learn-java +[3]: https://opensource.com/article/20/12/netbeans +[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+component +[5]: https://opensource.com/sites/default/files/uploads/this-time-its-personal-31_days_yourself-opensource.png (White text editor box with single drop down menu with options File, New, Open, Save, and Quit) +[6]: https://opensource.com/article/17/7/how-unzip-targz-file +[7]: https://opensource.com/article/18/1/how-install-apps-linux From 2e24a219d284b43b1b2adbda3fd8539fc30dbcae Mon Sep 17 00:00:00 2001 From: frstlis <48125063@qq.com> Date: Wed, 20 Jan 2021 22:20:01 +0800 Subject: [PATCH 016/381] Translating --- ...0190215 Make websites more readable with a shell script.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190215 Make websites more readable with a shell script.md b/sources/tech/20190215 Make websites more readable with a shell script.md index 06b748cfb5..2756422855 100644 --- a/sources/tech/20190215 Make websites more readable with a shell script.md +++ b/sources/tech/20190215 Make websites more readable with a shell script.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (stevenzdg988) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -244,7 +244,7 @@ via: https://opensource.com/article/19/2/make-websites-more-readable-shell-scrip 作者:[Jim Hall][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[stevenzdg988](https://github.com/stevenzdg988) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8e24c2153d25934eca5a23190d0db2d16d0e04d6 Mon Sep 17 00:00:00 2001 From: frstlis <48125063@qq.com> Date: Wed, 20 Jan 2021 22:22:57 +0800 Subject: [PATCH 017/381] Translated --- ...sites more readable with a shell script.md | 258 ------------------ ...sites more readable with a shell script.md | 256 +++++++++++++++++ 2 files changed, 256 insertions(+), 258 deletions(-) delete mode 100644 sources/tech/20190215 Make websites more readable with a shell script.md create mode 100644 translated/tech/20190215 Make websites more readable with a shell script.md diff --git a/sources/tech/20190215 Make websites more readable with a shell script.md b/sources/tech/20190215 Make websites more readable with a shell script.md deleted file mode 100644 index 2756422855..0000000000 --- a/sources/tech/20190215 Make websites more readable with a shell script.md +++ /dev/null @@ -1,258 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (stevenzdg988) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Make websites more readable with a shell script) -[#]: via: (https://opensource.com/article/19/2/make-websites-more-readable-shell-script) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) - -Make websites more readable with a shell script -====== -Calculate the contrast ratio between your website's text and background to make sure your site is easy to read. - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ) - -If you want people to find your website useful, they need to be able to read it. The colors you choose for your text can affect the readability of your site. Unfortunately, a popular trend in web design is to use low-contrast colors when printing text, such as gray text on a white background. Maybe that looks really cool to the web designer, but it is really hard for many of us to read. - -The W3C provides Web Content Accessibility Guidelines, which includes guidance to help web designers pick text and background colors that can be easily distinguished from each other. This is called the "contrast ratio." The W3C definition of the contrast ratio requires several calculations: given two colors, you first compute the relative luminance of each, then calculate the contrast ratio. The ratio will fall in the range 1 to 21 (typically written 1:1 to 21:1). The higher the contrast ratio, the more the text will stand out against the background. For example, black text on a white background is highly visible and has a contrast ratio of 21:1. And white text on a white background is unreadable at a contrast ratio of 1:1. - -The [W3C says body text][1] should have a contrast ratio of at least 4.5:1 with headings at least 3:1. But that seems to be the bare minimum. The W3C also recommends at least 7:1 for body text and at least 4.5:1 for headings. - -Calculating the contrast ratio can be a chore, so it's best to automate it. I've done that with this handy Bash script. In general, the script does these things: - - 1. Gets the text color and background color - 2. Computes the relative luminance of each - 3. Calculates the contrast ratio - - - -### Get the colors - -You may know that every color on your monitor can be represented by red, green, and blue (R, G, and B). To calculate the relative luminance of a color, my script will need to know the red, green, and blue components of the color. Ideally, my script would read this information as separate R, G, and B values. Web designers might know the specific RGB code for their favorite colors, but most humans don't know RGB values for the different colors. Instead, most people reference colors by names like "red" or "gold" or "maroon." - -Fortunately, the GNOME [Zenity][2] tool has a color-picker app that lets you use different methods to select a color, then returns the RGB values in a predictable format of "rgb( **R** , **G** , **B** )". Using Zenity makes it easy to get a color value: - -``` -color=$( zenity --title 'Set text color' --color-selection --color='black' ) -``` - -In case the user (accidentally) clicks the Cancel button, the script assumes a color: - -``` -if [ $? -ne 0 ] ; then -        echo '** color canceled .. assume black' -        color='rgb(0,0,0)' -fi -``` - -My script does something similar to set the background color value as **$background**. - -### Compute the relative luminance - -Once you have the foreground color in **$color** and the background color in **$background** , the next step is to compute the relative luminance for each. On its website, the [W3C provides an algorithm][3] to compute the relative luminance of a color. - -> For the sRGB colorspace, the relative luminance of a color is defined as -> **L = 0.2126 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated R + 0.7152 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated G + 0.0722 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated B** where R, G and B are defined as: -> -> if RsRGB <= 0.03928 then R = RsRGB/12.92 -> else R = ((RsRGB+0.055)/1.055) ^ 2.4 -> -> if GsRGB <= 0.03928 then G = GsRGB/12.92 -> else G = ((GsRGB+0.055)/1.055) ^ 2.4 -> -> if BsRGB <= 0.03928 then B = BsRGB/12.92 -> else B = ((BsRGB+0.055)/1.055) ^ 2.4 -> -> and RsRGB, GsRGB, and BsRGB are defined as: -> -> RsRGB = R8bit/255 -> -> GsRGB = G8bit/255 -> -> BsRGB = B8bit/255 - -Since Zenity returns color values in the format "rgb( **R** , **G** , **B** )," the script can easily pull apart the R, B, and G values to compute the relative luminance. AWK makes this a simple task, using the comma as the field separator ( **-F,** ) and using AWK's **substr()** string function to pick just the text we want from the "rgb( **R** , **G** , **B** )" color value: - -``` -R=$( echo $color | awk -F, '{print substr($1,5)}' ) -G=$( echo $color | awk -F, '{print $2}' ) -B=$( echo $color | awk -F, '{n=length($3); print substr($3,1,n-1)}' ) -``` - -**(For more on extracting and displaying data with AWK,[Get our AWK cheat sheet][4].)** - -Calculating the final relative luminance is best done using the BC calculator. BC supports the simple if-then-else needed in the calculation, which makes this part simple. But since BC cannot directly calculate exponentiation using a non-integer exponent, we need to do some extra math using the natural logarithm instead: - -``` -echo "scale=4 -rsrgb=$R/255 -gsrgb=$G/255 -bsrgb=$B/255 -if ( rsrgb <= 0.03928 ) r = rsrgb/12.92 else r = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((rsrgb+0.055)/1.055) ) -if ( gsrgb <= 0.03928 ) g = gsrgb/12.92 else g = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((gsrgb+0.055)/1.055) ) -if ( bsrgb <= 0.03928 ) b = bsrgb/12.92 else b = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((bsrgb+0.055)/1.055) ) -0.2126 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated r + 0.7152 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated g + 0.0722 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated b" | bc -l -``` - -This passes several instructions to BC, including the if-then-else statements that are part of the relative luminance formula. BC then prints the final value. - -### Calculate the contrast ratio - -With the relative luminance of the text color and the background color, now the script can calculate the contrast ratio. The [W3C determines the contrast ratio][5] with this formula: - -> (L1 + 0.05) / (L2 + 0.05), where -> L1 is the relative luminance of the lighter of the colors, and -> L2 is the relative luminance of the darker of the colors - -Given two relative luminance values **$r1** and **$r2** , it's easy to calculate the contrast ratio using the BC calculator: - -``` -echo "scale=2 -if ( $r1 > $r2 ) { l1=$r1; l2=$r2 } else { l1=$r2; l2=$r1 } -(l1 + 0.05) / (l2 + 0.05)" | bc -``` - -This uses an if-then-else statement to determine which value ( **$r1** or **$r2** ) is the lighter or darker color. BC performs the resulting calculation and prints the result, which the script can store in a variable. - -### The final script - -With the above, we can pull everything together into a final script. I use Zenity to display the final result in a text box: - -``` -#!/bin/sh -# script to calculate contrast ratio of colors - -# read color and background color: -# zenity returns values like 'rgb(255,140,0)' and 'rgb(255,255,255)' - -color=$( zenity --title 'Set text color' --color-selection --color='black' ) -if [ $? -ne 0 ] ; then -        echo '** color canceled .. assume black' -        color='rgb(0,0,0)' -fi - -background=$( zenity --title 'Set background color' --color-selection --color='white' ) -if [ $? -ne 0 ] ; then -        echo '** background canceled .. assume white' -        background='rgb(255,255,255)' -fi - -# compute relative luminance: - -function luminance() -{ -        R=$( echo $1 | awk -F, '{print substr($1,5)}' ) -        G=$( echo $1 | awk -F, '{print $2}' ) -        B=$( echo $1 | awk -F, '{n=length($3); print substr($3,1,n-1)}' ) - -        echo "scale=4 -rsrgb=$R/255 -gsrgb=$G/255 -bsrgb=$B/255 -if ( rsrgb <= 0.03928 ) r = rsrgb/12.92 else r = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((rsrgb+0.055)/1.055) ) -if ( gsrgb <= 0.03928 ) g = gsrgb/12.92 else g = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((gsrgb+0.055)/1.055) ) -if ( bsrgb <= 0.03928 ) b = bsrgb/12.92 else b = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((bsrgb+0.055)/1.055) ) -0.2126 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated r + 0.7152 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated g + 0.0722 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated b" | bc -l -} - -lum1=$( luminance $color ) -lum2=$( luminance $background ) - -# compute contrast - -function contrast() -{ -        echo "scale=2 -if ( $1 > $2 ) { l1=$1; l2=$2 } else { l1=$2; l2=$1 } -(l1 + 0.05) / (l2 + 0.05)" | bc -} - -rel=$( contrast $lum1 $lum2 ) - -# print results - -( cat<对于 sRGB 色彩空间,一种颜色的相对亮度定义为 +> +> **L = 0.2126 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated R + 0.7152 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated G + 0.0722 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated B** R,G 和 B 定义为: +> +> if RsRGB <= 0.03928 then R = RsRGB/12.92 +> else R = ((RsRGB+0.055)/1.055) ^ 2.4 +> +> if GsRGB <= 0.03928 then G = GsRGB/12.92 +> else G = ((GsRGB+0.055)/1.055) ^ 2.4 +> +> if BsRGB <= 0.03928 then B = BsRGB/12.92 +> else B = ((BsRGB+0.055)/1.055) ^ 2.4 +> +> RsRGB, GsRGB, 和 BsRGB 定义为: +> +> RsRGB = R8bit/255 +> +> GsRGB = G8bit/255 +> +> BsRGB = B8bit/255 + +由于 Zenity 以 “rgb(**R**,**G**,**B**)”的格式返回颜色值,因此脚本可以轻松拉取分隔开的 R,B 和 G 的值以计算相对亮度。 AWK 使用逗号作为字段分隔符(**-F,**),并使用 **substr()** 字符串函数从 “rgb(**R**,**G**,**B**)中提取所要的颜色值: + +``` +R=$( echo $color | awk -F, '{print substr($1,5)}' ) +G=$( echo $color | awk -F, '{print $2}' ) +B=$( echo $color | awk -F, '{n=length($3); print substr($3,1,n-1)}' ) +``` + +**(有关使用 AWK 提取和显示数据的更多信息,[获取 AWK 备忘表][4].)** + +最好使用 BC 计算器来计算最终的相对亮度。 BC 支持计算中所需的简单 `if-then-else`,这使得这一过程变得简单。 但是由于 BC 无法使用非整数指数直接计算乘幂,因此需要使用自然对数替代它做一些额外的数学运算: + +``` +echo "scale=4 +rsrgb=$R/255 +gsrgb=$G/255 +bsrgb=$B/255 +if ( rsrgb <= 0.03928 ) r = rsrgb/12.92 else r = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((rsrgb+0.055)/1.055) ) +if ( gsrgb <= 0.03928 ) g = gsrgb/12.92 else g = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((gsrgb+0.055)/1.055) ) +if ( bsrgb <= 0.03928 ) b = bsrgb/12.92 else b = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((bsrgb+0.055)/1.055) ) +0.2126 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated r + 0.7152 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated g + 0.0722 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated b" | bc -l +``` + +这会将一些指令传递给 BC,包括作为相对亮度公式一部分的 `if-then-else` 语句。接下来 BC 打印出最终值。 +### 计算对比度 + +利用文本颜色和背景颜色的相对亮度,脚本就可以计算对比度了。 [W3C 确定对比度][5] 使用以下公式: + +> (L1 + 0.05) / (L2 + 0.05), 这里的 +> L1是颜色较浅的相对亮度, +> L2是颜色较深的相对亮度 + +给定两个相对亮度值 **$r1** 和 **$r2**,使用 BC 计算器很容易计算对比度: + +``` +echo "scale=2 +if ( $r1 > $r2 ) { l1=$r1; l2=$r2 } else { l1=$r2; l2=$r1 } +(l1 + 0.05) / (l2 + 0.05)" | bc +``` + +使用 `if-then-else` 语句确定哪个值(**$r1** 或 **$r2**)是较浅还是较深的颜色。 BC 执行结果计算并打印结果,脚本可以将其存储在变量中。 + +### 最终脚本 + +通过以上内容,我们可以将所有内容整合到一个最终脚本。 我使用 Zenity 在文本框中显示最终结果: + +``` +#!/bin/sh +# script to calculate contrast ratio of colors + +# read color and background color: +# zenity returns values like 'rgb(255,140,0)' and 'rgb(255,255,255)' + +color=$( zenity --title 'Set text color' --color-selection --color='black' ) +if [ $? -ne 0 ] ; then +        echo '** color canceled .. assume black' +        color='rgb(0,0,0)' +fi + +background=$( zenity --title 'Set background color' --color-selection --color='white' ) +if [ $? -ne 0 ] ; then +        echo '** background canceled .. assume white' +        background='rgb(255,255,255)' +fi + +# compute relative luminance: + +function luminance() +{ +        R=$( echo $1 | awk -F, '{print substr($1,5)}' ) +        G=$( echo $1 | awk -F, '{print $2}' ) +        B=$( echo $1 | awk -F, '{n=length($3); print substr($3,1,n-1)}' ) + +        echo "scale=4 +rsrgb=$R/255 +gsrgb=$G/255 +bsrgb=$B/255 +if ( rsrgb <= 0.03928 ) r = rsrgb/12.92 else r = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((rsrgb+0.055)/1.055) ) +if ( gsrgb <= 0.03928 ) g = gsrgb/12.92 else g = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((gsrgb+0.055)/1.055) ) +if ( bsrgb <= 0.03928 ) b = bsrgb/12.92 else b = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((bsrgb+0.055)/1.055) ) +0.2126 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated r + 0.7152 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated g + 0.0722 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated b" | bc -l +} + +lum1=$( luminance $color ) +lum2=$( luminance $background ) + +# compute contrast + +function contrast() +{ +        echo "scale=2 +if ( $1 > $2 ) { l1=$1; l2=$2 } else { l1=$2; l2=$1 } +(l1 + 0.05) / (l2 + 0.05)" | bc +} + +rel=$( contrast $lum1 $lum2 ) + +# print results + +( cat< Date: Wed, 20 Jan 2021 23:14:15 +0800 Subject: [PATCH 018/381] PRF @geekpi Co-Authored-By: geekpi --- ...ification when a battery is full or low.md | 90 ++++++++++--------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/translated/tech/20210113 How to get Battery status notification when a battery is full or low.md b/translated/tech/20210113 How to get Battery status notification when a battery is full or low.md index c2f1b9d1ff..16ecd5f7c3 100644 --- a/translated/tech/20210113 How to get Battery status notification when a battery is full or low.md +++ b/translated/tech/20210113 How to get Battery status notification when a battery is full or low.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to get Battery status notification when a battery is full or low) @@ -10,26 +10,24 @@ 如何在电池充满或低电量时获得电池状态通知 ====== -对于类 Unix 用户来说,Linux 笔记本是不错的选择,但它经常会耗尽电池。 +![](https://img.linux.net.cn/data/attachment/album/202101/20/231310avo3kzv67vkm3tz7.jpg) -我试过很多 Linux 操作系统,但没有像 Windows 那样电池寿命长。 +对于类 Unix 用户来说,Linux 笔记本是不错的选择,但它经常会耗尽电池。我试过很多 Linux 操作系统,但没有像 Windows 那样电池寿命长。 -充电时间长了会对电池造成损害,所以在电池 100% 充满时要拔掉电源线。 +充电时间长了会对电池造成损害,所以在电池 100% 充满时要拔掉电源线。电池充电或放电时没有默认的应用程序来通知,需要安装第三方应用来通知你。 -电池充电或放电时没有默认的应用程序来通知,需要安装第三方应用来通知你。 - -为此,我通常会安装 **[Battery Monitor][1]**,但它已经被废弃,所以我创建了一个 shell 脚本来获取通知。 +为此,我通常会安装 [Battery Monitor][1],但它已经被废弃,所以我创建了一个 shell 脚本来获取通知。 笔记本电池充放电状态可以通过以下两个命令来识别。 -使用 acpi 命令。 +使用 `acpi` 命令。 ``` $ acpi -b Battery 0: Discharging, 71%, 00:58:39 remaining ``` -使用 upower 命令。 +使用 `upower` 命令。 ``` $ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -w 'state|percentage' | awk '{print $2}' @@ -39,35 +37,37 @@ discharging ### 方法 1:当电池电量高于 95% 或低于 20% 时,用 Shell 脚本发送警报 -这个脚本在启动时在后台运行,每分钟检查一次电池状态,然后在电池电量超过 95% 或放电低于 20% 时发送通知。 +这个脚本在启动时在后台运行,每分钟检查一次电池状态,然后在电池电量超过 95% 或放电时电量低于 20% 时发送通知。 警报会直到你的电池电量超过 20% 或低于 95% 时才会停止。 ``` $ sudo vi /opt/scripts/battery-status.sh +``` +``` #!/bin/bash while true do -battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)'` -if [ $battery_level -ge 95 ]; then -notify-send "Battery Full" "Level: ${battery_level}%" -paplay /usr/share/sounds/freedesktop/stereo/suspend-error.oga -elif [ $battery_level -le 20 ]; then -notify-send --urgency=CRITICAL "Battery Low" "Level: ${battery_level}%" -paplay /usr/share/sounds/freedesktop/stereo/suspend-error.oga -fi -sleep 60 + battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)'` + if [ $battery_level -ge 95 ]; then + notify-send "Battery Full" "Level: ${battery_level}%" + paplay /usr/share/sounds/freedesktop/stereo/suspend-error.oga + elif [ $battery_level -le 20 ]; then + notify-send --urgency=CRITICAL "Battery Low" "Level: ${battery_level}%" + paplay /usr/share/sounds/freedesktop/stereo/suspend-error.oga + fi + sleep 60 done ``` -脚本完成后,设置可执行权限。 +脚本完成后,设置可执行权限: ``` $ sudo chmod +x /opt/scripts/battery-status.sh ``` -最后,将该脚本添加到用户配置文件的底部。对于全局范围来说,你需要在 /etc/profile 文件中添加该脚本。 +最后,将该脚本添加到用户配置文件的底部。对于全局范围来说,你需要在 `/etc/profile` 文件中添加该脚本。 ``` $ vi /home/magi/.profile @@ -75,17 +75,17 @@ $ vi /home/magi/.profile /opt/scripts/battery-status.sh & ``` -**[重启你的 Linux 系统][2]**来检查这点。 +[重启你的 Linux 系统][2]来检查这点。 ``` $ sudo reboot ``` -### 方法 2:当电池充电(高于 95%)或放电(低于 20%)时发送通知的 Shell 脚本。 +### 方法 2:当电池充电(高于 95%)或放电(低于 20%)时发送通知的 Shell 脚本 这个脚本与上面的脚本类似,但它是由交流适配器负责。 -如果你的交流适配器插上了,而且电池的电量超过 95%,它就会发出一个带有声音的通知,但是这个通知不会停止,直到你拔掉交流适配器。 +如果你插上了交流适配器,而且电池的电量超过 95%,它就会发出一个带有声音的通知,但是这个通知不会停止,直到你拔掉交流适配器。 ![][3] @@ -95,34 +95,36 @@ $ sudo reboot ``` $ sudo vi /opt/scripts/battery-status-1.sh +``` +``` #!/bin/bash -while true -do -export DISPLAY=:0.0 -battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)'` -if on_ac_power; then -if [ $battery_level -ge 95 ]; then -notify-send "Battery Full" "Level: ${battery_level}% " -paplay /usr/share/sounds/freedesktop/stereo/suspend-error.oga -fi -else -if [ $battery_level -le 20 ]; then -notify-send --urgency=CRITICAL "Battery Low" "Level: ${battery_level}%" -paplay /usr/share/sounds/freedesktop/stereo/suspend-error.oga -fi -fi -sleep 60 + while true + do + export DISPLAY=:0.0 + battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)'` + if on_ac_power; then + if [ $battery_level -ge 95 ]; then + notify-send "Battery Full" "Level: ${battery_level}% " + paplay /usr/share/sounds/freedesktop/stereo/suspend-error.oga + fi + else + if [ $battery_level -le 20 ]; then + notify-send --urgency=CRITICAL "Battery Low" "Level: ${battery_level}%" + paplay /usr/share/sounds/freedesktop/stereo/suspend-error.oga + fi + fi + sleep 60 done ``` -脚本完成后,设置执行权限。 +脚本完成后,设置执行权限: ``` $ sudo chmod +x /opt/scripts/battery-status-1.sh ``` -最后将脚本添加到用户 **profile** 文件的底部。对于全局范围来说,你需要在 /etc/profile 文件中添加该脚本。 +最后将脚本添加到用户配置文件的底部。对于全局范围来说,你需要在 `/etc/profile` 文件中添加该脚本。 ``` $ vi /home/magi/.profile @@ -130,13 +132,13 @@ $ vi /home/magi/.profile /opt/scripts/battery-status-1.sh & ``` -重启系统来检查。 +重启系统来检查: ``` $ sudo reboot ``` -**参考:** [stackexchange][4] +参考: [stackexchange][4] -------------------------------------------------------------------------------- From ce9dfa467c0bddc062371a8e441c80477728ade8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 20 Jan 2021 23:14:52 +0800 Subject: [PATCH 019/381] PUB @geekpi https://linux.cn/article-13036-1.html Co-Authored-By: geekpi --- ...ttery status notification when a battery is full or low.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210113 How to get Battery status notification when a battery is full or low.md (98%) diff --git a/translated/tech/20210113 How to get Battery status notification when a battery is full or low.md b/published/20210113 How to get Battery status notification when a battery is full or low.md similarity index 98% rename from translated/tech/20210113 How to get Battery status notification when a battery is full or low.md rename to published/20210113 How to get Battery status notification when a battery is full or low.md index 16ecd5f7c3..ca562b13de 100644 --- a/translated/tech/20210113 How to get Battery status notification when a battery is full or low.md +++ b/published/20210113 How to get Battery status notification when a battery is full or low.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13036-1.html) [#]: subject: (How to get Battery status notification when a battery is full or low) [#]: via: (https://www.2daygeek.com/linux-low-full-charge-discharge-battery-notification/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From d6ee8dacbbed287e48217cbcf238de0e3b218d7e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 20 Jan 2021 23:21:12 +0800 Subject: [PATCH 020/381] PRF Co-Authored-By: geekpi --- ...ry status notification when a battery is full or low.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/published/20210113 How to get Battery status notification when a battery is full or low.md b/published/20210113 How to get Battery status notification when a battery is full or low.md index ca562b13de..80cfea80c8 100644 --- a/published/20210113 How to get Battery status notification when a battery is full or low.md +++ b/published/20210113 How to get Battery status notification when a battery is full or low.md @@ -91,7 +91,7 @@ $ sudo reboot 如果你拔掉交流适配器,你将永远不会再看到通知,直到你的电池电量下降到 20%。 -![][3] +![][5] ``` $ sudo vi /opt/scripts/battery-status-1.sh @@ -155,5 +155,6 @@ via: https://www.2daygeek.com/linux-low-full-charge-discharge-battery-notificati [b]: https://github.com/lujun9972 [1]: https://www.2daygeek.com/category/battery-monitor/ [2]: https://www.2daygeek.com/6-commands-to-shutdown-halt-poweroff-reboot-the-linux-system/ -[3]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[4]: https://unix.stackexchange.com/questions/60778/how-can-i-get-an-alert-when-my-battery-is-about-to-die-in-linux-mint \ No newline at end of file +[3]: https://i0.wp.com/www.2daygeek.com/wp-content/uploads/2021/01/linux-low-full-battery-notification-2.png?w=1046&ssl=1 +[4]: https://unix.stackexchange.com/questions/60778/how-can-i-get-an-alert-when-my-battery-is-about-to-die-in-linux-mint +[5]: https://i1.wp.com/www.2daygeek.com/wp-content/uploads/2021/01/linux-low-full-battery-notification-3.png?w=1029&ssl=1 \ No newline at end of file From 6197a63d700eaa9c80b827e870f3b5647dcf8778 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 21 Jan 2021 05:04:13 +0800 Subject: [PATCH 021/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210121=20?= =?UTF-8?q?How=20to=20Uninstall=20Applications=20from=20Ubuntu=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210121 How to Uninstall Applications from Ubuntu Linux.md --- ...ninstall Applications from Ubuntu Linux.md | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 sources/tech/20210121 How to Uninstall Applications from Ubuntu Linux.md diff --git a/sources/tech/20210121 How to Uninstall Applications from Ubuntu Linux.md b/sources/tech/20210121 How to Uninstall Applications from Ubuntu Linux.md new file mode 100644 index 0000000000..4a32dec9b7 --- /dev/null +++ b/sources/tech/20210121 How to Uninstall Applications from Ubuntu Linux.md @@ -0,0 +1,167 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Uninstall Applications from Ubuntu Linux) +[#]: via: (https://itsfoss.com/uninstall-programs-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Uninstall Applications from Ubuntu Linux +====== + +Don’t use a certain application anymore? Remove it. + +In fact, removing programs is one of the [easiest ways to free up disk space on Ubuntu][1] and keep your system clean. + +In this beginner’s tutorial, I’ll show you various ways of uninstalling software from Ubuntu. + +Did I say various ways? Yes, because there are [various ways of installing applications in Ubuntu][2] and hence various ways of removing them. You’ll learn to: + + * Remove applications from Ubuntu Software Center (for desktop users) + * Remove applications using apt remove command + * Remove snap applications in command line (intermediate to advanced users) + + + +Let’s see these steps one by one. + +### Method 1: Remove applications using Ubuntu Software Center + +Start the Software Center application. You should find it in the dock on the left side or search for it in the menu. + +![][3] + +You can see the installed applications in the Installed tab. + +![List installed applications][4] + +If you don’t see a program here, try to use the search feature. + +![Search for installed applications][5] + +When you open an installed application, you should see the option to remove it. Click on it. + +![Removing installed applications][6] + +It will ask for your account password. Enter it and the applications will be removed in seconds. + +This method works pretty well except in the case when Software Center is misbehaving (it does that a lot) or if the program is a software library or some other command line utility. You can always resort to the terminal in such cases. + +### Method 2: Remove programs from Ubuntu using command line + +You know that you can use `apt-get install` or `apt install` for installing applications. For uninstalling, you don’t use the apt-get uninstall command but `apt-get remove` or `apt remove`. + +All you need to do is to use the command in the following fashion: + +``` +sudo apt remove program_name +``` + +You’ll be asked to enter your account password. When you enter it, nothing is visible on the screen. That’s normal. Just type it blindly and press enter. + +The program won’t be removed immediately. You need to confirm it. When it asks for your conformation, press the enter key or Y key: + +![][7] + +Keep in mind that you’ll have to use the exact package name in the apt remove command otherwise it will throw ‘[unable to locate package error][8]‘. + +Don’t worry if you don’t remember the exact program name. You can utilize the super useful tab completion. It’s one of the [most useful Linux command line tips][9] that you must know. + +What you can do is to type the first few letters of the program you want to uninstall. And then hit the tab key. It will show all the installed packages that match those letters at the beginning of their names. + +When you see the desired package, you can type its complete name and remove it. + +![][10] + +What if you do not know the exact package name or even the starting letters? Well, you can [list all the installed packages in Ubuntu][11] and grep with whatever your memory serves. + +For example, the command below will show all the installed packages that have the string ‘my’ in its name anywhere, not just the beginning. + +``` +apt list --installed | grep -i my +``` + +![][12] + +That’s cool, isn’t it? Just be careful with the package name when using the remove command in Ubuntu. + +#### Tip: Using apt purge for removing package (advanced users) + +When you remove a package in Ubuntu, the packaged data is removed, but it may leave small, modified user configuration files. This is intentional because if you install the same program again, it would use those configuration files. + +If you want to remove it completely, you can use apt purge command. You can use it instead of apt remove command or after running the apt remove command. + +``` +sudo apt purge program_name +``` + +Keep in mind that the purge command won’t remove any data or configuration file stored in the home directory of a user. + +### Method 3: Uninstall Snap applications in Ubuntu + +The previous method works with the DEB packages that you installed using apt command, software center or directly from the deb file. + +Ubuntu also has a new packaging system called [Snap][13]. Most of the software you find in the Ubuntu Software Center are in this Snap package format. + +You can remove these applications from the Ubuntu Software Center easily but if you want to use the command line, here’s what you should do. + +List all the snap applications installed to get the package name. + +``` +snap list +``` + +![][14] + +Now use the package name to remove the application from Ubuntu. You won’t be asked for confirmation before removal. + +``` +sudo snap remove package_name +``` + +### Bonus Tip: Clean up your system with one magical command + +Alright! You learned to remove the applications. Now let me tell you about a simple command that cleans up leftover package traces like dependencies that are no longer used, old Linux kernel headers that won’t be used anymore. + +In the terminal, just run this command: + +``` +sudo apt autoremove +``` + +This is a safe command, and it will easily free up a few hundred MB’s of disk space. + +### Conclusion + +You learned three ways of removing applications from Ubuntu Linux. I covered both GUI and command line methods so that you are aware of all the options. + +I hope you find this simple tutorial helpful as an Ubuntu beginner. Questions and suggestions are always welcome. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/uninstall-programs-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/free-up-space-ubuntu-linux/ +[2]: https://itsfoss.com/remove-install-software-ubuntu/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/ubuntu_software_applications_menu.jpg?resize=800%2C390&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/installed-apps-ubuntu.png?resize=800%2C455&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/search-installed-apps-ubuntu.png?resize=800%2C455&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/remove-applications-ubuntu.png?resize=800%2C487&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/apt-remove-program-ubuntu.png?resize=768%2C424&ssl=1 +[8]: https://itsfoss.com/unable-to-locate-package-error-ubuntu/ +[9]: https://itsfoss.com/linux-command-tricks/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/remove-package-ubuntu-linux.png?resize=768%2C424&ssl=1 +[11]: https://itsfoss.com/list-installed-packages-ubuntu/ +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/search-list-installed-apps-ubuntu.png?resize=768%2C424&ssl=1 +[13]: https://itsfoss.com/install-snap-linux/ +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/list-snap-remove.png?resize=800%2C407&ssl=1 From 1b6951ddc911a659123e0c07484c90e31013f574 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 21 Jan 2021 05:04:27 +0800 Subject: [PATCH 022/381] add done: 20210121 How to Uninstall Applications from Ubuntu Linux.md --- sources/tech/20210121 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210121 .md diff --git a/sources/tech/20210121 .md b/sources/tech/20210121 .md new file mode 100644 index 0000000000..a414f0939e --- /dev/null +++ b/sources/tech/20210121 .md @@ -0,0 +1,25 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: () +[#]: via: (https://www.2daygeek.com/comparison-between-apt-vs-apt-get-difference/) +[#]: author: ( ) + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/comparison-between-apt-vs-apt-get-difference/ + +作者:[][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 From f8e2c85a045756afeb81c57b9a5cd0f1823dc2c9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 21 Jan 2021 05:05:16 +0800 Subject: [PATCH 023/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210120=20?= =?UTF-8?q?Learn=20JavaScript=20by=20writing=20a=20guessing=20game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210120 Learn JavaScript by writing a guessing game.md --- ...n JavaScript by writing a guessing game.md | 300 ++++++++++++++++++ 1 file changed, 300 insertions(+) create mode 100644 sources/tech/20210120 Learn JavaScript by writing a guessing game.md diff --git a/sources/tech/20210120 Learn JavaScript by writing a guessing game.md b/sources/tech/20210120 Learn JavaScript by writing a guessing game.md new file mode 100644 index 0000000000..c7ed63e81e --- /dev/null +++ b/sources/tech/20210120 Learn JavaScript by writing a guessing game.md @@ -0,0 +1,300 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learn JavaScript by writing a guessing game) +[#]: via: (https://opensource.com/article/21/1/learn-javascript) +[#]: author: (Mandy Kendall https://opensource.com/users/mkendall) + +Learn JavaScript by writing a guessing game +====== +Take the first steps toward creating interactive, dynamic web content by +practicing some basic JavaScript concepts with a simple game. +![Javascript code close-up with neon graphic overlay][1] + +It's pretty safe to say that most of the modern web would not exist without [JavaScript][2]. It's one of the three standard web technologies (along with HTML and CSS) and allows anyone to create much of the interactive, dynamic content we have come to expect in our experiences with the World Wide Web. From frameworks like [React][3] to data visualization libraries like [D3][4], it's hard to imagine the web without it. + +There's a lot to learn, and a great way to begin learning this popular language is by writing a simple application to become familiar with some concepts. Recently, some Opensource.com correspondents have written about how to learn their favorite language by writing a simple guessing game, so that's a great place to start! + +### Getting started + +JavaScript comes in many flavors, but I'll start with the basic version, commonly called "Vanilla JavaScript." JavaScript is primarily a client-side scripting language, so it can run in any standard browser without installing anything. All you need is a code editor ([Brackets][5] is a great one to try) and the web browser of your choice. + +### HTML user interface + +JavaScript runs in a web browser and interacts with the other standard web technologies, HTML and CSS. To create this game, you'll first use HTML (Hypertext Markup Language) to create a simple interface for your players to use. In case you aren't familiar, HTML is a markup language used to provide structure to content on the web. + +To start, create an HTML file for your code. The file should have the `.html` extension to let the browser know that it is an HTML document. You can call your file `guessingGame.html`. + +Use a few basic HTML tags in this file to display the game's title, instructions for how to play, interactive elements for the player to use to enter and submit their guesses, and a placeholder for providing feedback to the player: + + +``` +<!DOCTYPE> +  <[html][6]> +    <[head][7]> +      <[meta][8] charset="UTF-8" /> +      <[title][9]> JavaScript Guessing Game </[title][9]> +    </[head][7]> +    <[body][10]> +      <[h1][11]>Guess the Number!</[h1][11]> +      <[p][12]>I am thinking of a number between 1 and 100. Can you guess what it is?</[p][12]> +    +      <[label][13] for="guess">My Guess</[label][13]> +      <[input][14] type="number" id="guess"> +      <[input][14] type="submit" id="submitGuess" value="Check My Guess"> +    +      <[p][12] id="feedback"></[p][12]> +    </[body][10]> +  </[html][6]> +``` + +The `

` and `

` elements let the browser know what type of text to display on the page. The set of `

` tags signifies that the text between those two tags (`Guess the Number!`) is a heading. The set of `

` tags that follow signify that the short block of text with the instructions is a paragraph. The empty set of `

` tags at the end of this code block serve as a placeholder for the feedback the game will give the player based on their guess. + +### The <script> tag + +There are many ways to include JavaScript in a web page, but for a short script like this one, you can use a set of ` ``` -_editor_url_ 是文档编辑器的链接接口。 +`editor_url` 是文档编辑器的链接接口。 + 打开每个文件以供查看的按钮: ``` ``` -现在我们需要添加带有 _id_ 的 `div` 标签,打开文档编辑器: +现在我们需要添加带有 `id` 的 `div` 标签,打开文档编辑器: ```

@@ -143,207 +158,218 @@ _editor_url_ 是文档编辑器的链接接口。 ``` ``` DocEditor 函数有两个参数:将在其中打开编辑器的元素 `id` 和带有编辑器设置的 `JSON`。 在此示例中,使用了以下必需参数: - * _documentType_ 由其格式标识(`.docx,.xlsx,.pptx` 用于相应的文本,电子表格和演示文稿) - * _document.url_ 是您要打开的文件链接。 - * _editorConfig.mode_。 + * `documentType` 由其格式标识(`.docx`、`.xlsx`、`.pptx` 用于相应的文本、电子表格和演示文稿) + * `document.url` 是你要打开的文件链接。 + * `editorConfig.mode`。 + +我们还可以添加将在编辑器中显示的 `title`。 -我们还可以添加将在编辑器中显示的 _title_。 接下来,我们可以在 Python 应用程序中查看文档。 -**3\. 如何在 Python 应用中利用 ONLYOFFICE 编辑文档** -首先,添加 “Edit”(编辑) 按钮: +### 3、编辑文档 + +首先,添加 “Edit”(编辑)按钮: ``` ``` 然后创建一个新功能,打开文件进行编辑。类似于查看功能。 -现在创建3个函数: + +现在创建 3 个函数: ``` ``` -_destroyEditor_ 被调用以关闭一个打开的编辑器。 -您可能会注意到,_edit()_ 函数中缺少 _editorConfig_ 参数,因为默认情况下它的值是 **{"mode":"edit"}.* +`destroyEditor` 被调用以关闭一个打开的编辑器。 + +你可能会注意到,`edit()` 函数中缺少 `editorConfig` 参数,因为默认情况下它的值是:`{"mode":"edit"}`。 现在,我们拥有了打开文档以在 Python 应用程序中进行协同编辑的所有功能。 -**4\. 如何在 Python 应用中利用 ONLYOFFICE 协同编辑文档** -通过在编辑器中设置对同一文档使用相同的 `document.key` 来实现协同编辑。 如果没有此键,则每次打开文件时,编辑器都会创建编辑会话。 +### 4、如何在 Python 应用中利用 ONLYOFFICE 协同编辑文档 -为每个文档设置唯一键,以使用户连接到同一编辑会话时进行协同编辑。 密钥格式应为以下格式:_filename +"_key"_。下一步是将其添加到当前文档的所有配置中。 +通过在编辑器中设置对同一文档使用相同的 `document.key` 来实现协同编辑。 如果没有此键值,则每次打开文件时,编辑器都会创建编辑会话。 + +为每个文档设置唯一键,以使用户连接到同一编辑会话时进行协同编辑。 密钥格式应为以下格式:`filename +"_key"`。下一步是将其添加到当前文档的所有配置中。 ``` document: { -url: "host_url" + '/' + filepath, -title: filename, -key: filename + '_key' + url: "host_url" + '/' + filepath, + title: filename, + key: filename + '_key' }, ``` -**5\. 如何在 Python 应用中利用 ONLYOFFICE 保存文档** +### 5、如何在 Python 应用中利用 ONLYOFFICE 保存文档 + 每次我们更改并保存文件时,ONLYOFFICE 都会存储其所有版本。 让我们仔细看看它是如何工作的。 关闭编辑器后,文档服务器将构建要保存的文件版本并将请求发送到 `callbackUrl` 地址。 该请求包含 `document.key`和指向刚刚构建的文件的链接。 + `document.key` 用于查找文件的旧版本并将其替换为新版本。 由于这里没有任何数据库,因此仅使用 `callbackUrl` 发送文件名。 -在 _editorConfig.callbackUrl_ 的设置中指定 _callbackUrl_ 参数并将其添加到 _edit()method_ 中: + +在 `editorConfig.callbackUrl` 的设置中指定 `callbackUrl` 参数并将其添加到 `edit()` 方法中: ``` -function edit(filename) { -const filepath = 'files/' + filename; -if (editor) { -editor.destroyEditor() -} -editor = new DocsAPI.DocEditor("editor", -{ -documentType: get_file_type(filepath), -document: { -url: "host_url" + '/' + filepath, -title: filename, -key: filename + '_key' -} -, -editorConfig: { -mode: 'edit', -callbackUrl: "host_url" + '/callback' + '&filename=' + filename // add file name as a request parameter -} -}); -} + function edit(filename) { + const filepath = 'files/' + filename; + if (editor) { + editor.destroyEditor() + } + editor = new DocsAPI.DocEditor("editor", + { + documentType: get_file_type(filepath), + document: { + url: "host_url" + '/' + filepath, + title: filename, + key: filename + '_key' + } + , + editorConfig: { + mode: 'edit', + callbackUrl: "host_url" + '/callback' + '&filename=' + filename // add file name as a request parameter + } + }); + } ``` -编写一种方法,在获取到 POST 请求发送到 */callback* 地址后将保存文件: +编写一种方法,在获取到 POST 请求发送到 `/callback` 地址后将保存文件: ``` @post("/callback") # processing post requests for /callback def callback(): -if request.json['status'] == 2: -file = requests.get(request.json['url']).content -with open('files/' + request.query['filename'], 'wb') as f: -f.write(file) -return "{\"error\":0}" + if request.json['status'] == 2: + file = requests.get(request.json['url']).content + with open('files/' + request.query['filename'], 'wb') as f: + f.write(file) + return "{\"error\":0}" +​ ``` -*# status 2* 是已生成的文件 -当我们关闭编辑器时,新版本的文件将保存到存储器中。 +`# status 2` 是已生成的文件,当我们关闭编辑器时,新版本的文件将保存到存储器中。 + +### 6、管理用户 + +如果应用中有用户,并且你需要查看谁在编辑文档,请在编辑器的配置中输入其标识符(`id`和`name`)。 -**6\. 如何在 Python 应用中利用 ONLYOFFICE 管理用户** -如果应用中有用户,并且您需要查看谁在编辑文档,请在编辑器的配置中输入其标识符(`id`和`name`)。 在界面中添加选择用户的功能: ``` ``` -如果在标记 _&lt;script&gt;_ 的开头添加对函数 *pick_user()* 的调用,负责初始化函数自身 `id`和`name`变量。 +如果在标记 ` -</[body][10]> + -</[html][6]> + ``` -要在浏览器中运行此文件,请双击文件或打开您喜欢的浏览器,点击菜单,然后选择**文件->打开文件**。 (如果使用 Brackets 软件,也可以使用角落处的闪电图标在浏览器中打开文件)。 +要在浏览器中运行此文件,请双击文件或打开你喜欢的浏览器,点击菜单,然后选择**文件->打开文件**。(如果使用 Brackets 软件,也可以使用角落处的闪电图标在浏览器中打开文件)。 + ### 生成伪随机数 -猜谜游戏的第一步是为玩家生成一个数字供玩家猜测。 JavaScript 包含几个内置的全局对象,可帮助您编写代码。 要生成随机数,请使用 Math 对象。 +猜谜游戏的第一步是为玩家生成一个数字供玩家猜测。JavaScript 包含几个内置的全局对象,可帮助你编写代码。要生成随机数,请使用 `Math` 对象。 -JavaScript中的 [Math][17] 具有处理和数学相关的属性和功能。 您将使用两个数学函数来生成随机数,供您的玩家猜测。 +JavaScript中的 [Math][17] 具有处理和数学相关的属性和功能。你将使用两个数学函数来生成随机数,供你的玩家猜测。 -[Math.random()][18],会将生成一个介于 0 和 1 之间的伪随机数。( Math.random 包含 0 但不包含 1。这意味着该函数可以生成 0 ,永远不会产生 1.) +[Math.random()][18],会将生成一个介于 0 和 1 之间的伪随机数。(`Math.random` 包含 0 但不包含 1。这意味着该函数可以生成 0 ,永远不会产生 1) -对于此游戏,请将随机数设置在 1 到 100 之间以缩小玩家的选择范围。 取刚刚生成的小数,然后乘以 100,以产生一个介于 0 到......甚至不是 100 之间的小数。至此,您将需要其他步骤来解决这个问题。 +对于此游戏,请将随机数设置在 1 到 100 之间以缩小玩家的选择范围。取刚刚生成的小数,然后乘以 100,以产生一个介于 0 到……甚至不是 100 之间的小数。至此,你将需要其他步骤来解决这个问题。 -现在,您的数字仍然是小数,但您希望它是一个整数。 为此,您可以使用属于 Math 对象的另一个函数 [Math.floor()][19]。 Math.floor() 的目的是返回小于或等于您作为参数指定的数字的最大整数,这意味着它会四舍五入为最接近的整数: +现在,你的数字仍然是小数,但你希望它是一个整数。为此,你可以使用属于 `Math` 对象的另一个函数 [Math.floor()][19]。`Math.floor()` 的目的是返回小于或等于你作为参数指定的数字的最大整数,这意味着它会四舍五入为最接近的整数: - -```javascript -`Math.floor(Math.random() * 100)` +``` +Math.floor(Math.random() * 100) ``` -这样您将得到 0 到 99 之间的整数,这不是您想要的范围。 您可以在最后一步修复该问题,即在结果中加 1。 瞧! 现在,您有一个(有点)随机生成的数字,介于 1 到 100 之间: +这样你将得到 0 到 99 之间的整数,这不是你想要的范围。你可以在最后一步修复该问题,即在结果中加 1。瞧!现在,你有一个(有点)随机生成的数字,介于 1 到 100 之间: - -```javascript -`Math.floor(Math.random() * 100) + 1` +``` +Math.floor(Math.random() * 100) + 1 ``` ### 变量 -现在,您需要存储随机生成的数字,以便可以将其与玩家的猜测进行比较。 为此,您可以将其存储到一个 **变量**。 +现在,你需要存储随机生成的数字,以便可以将其与玩家的猜测进行比较。为此,你可以将其存储到一个 **变量**。 -JavaScript 具有不同类型的变量,您可以选择这些类型,具体取决于您要如何使用该变量。 对于此游戏,请使用 const 和 let 。 +JavaScript 具有不同类型的变量,你可以选择这些类型,具体取决于你要如何使用该变量。对于此游戏,请使用 `const` 和 `let`。 - * **let** 用于指示变量在整个程序中可以改变 - * **const** 用于指示变量不应该被修改. + * `let` 用于指示变量在整个程序中可以改变。 + * `const` 用于指示变量不应该被修改。 -const 和 let 还有很多要说的,但现在知道这些就足够了。 +`const` 和 `let` 还有很多要说的,但现在知道这些就足够了。 -随机数在游戏中仅生成一次,因此您将使用 const 变量来保存该值。 您想给变量起一个清楚地表明要存储什么值的名称,因此将其命名为 `randomNumber`: +随机数在游戏中仅生成一次,因此你将使用 `const` 变量来保存该值。你想给变量起一个清楚地表明要存储什么值的名称,因此将其命名为 `randomNumber`: - -```javascript -`const randomNumber` +``` +const randomNumber ``` -有关命名的注意事项:JavaScript 中的变量和函数名称以驼峰形式编写。 如果只有一个单词,则全部以小写形式书写。 如果有多个单词,则第一个单词均为小写,其他任何单词均以大写字母开头,且单词之间没有空格。 +有关命名的注意事项:JavaScript 中的变量和函数名称以驼峰形式编写。如果只有一个单词,则全部以小写形式书写。如果有多个单词,则第一个单词均为小写,其他任何单词均以大写字母开头,且单词之间没有空格。 ### 打印到控制台 -通常,您不想向任何人显示随机数,但是开发人员可能想知道生成的数字以使用它来帮助调试代码。 使用 JavaScript,您可以使用另一个内置函数 [console.log()][20] 将数字输出到浏览器的控制台。 +通常,你不想向任何人显示随机数,但是开发人员可能想知道生成的数字以使用它来帮助调试代码。 使用 JavaScript,你可以使用另一个内置函数 [console.log()][20] 将数字输出到浏览器的控制台。 -大多数浏览器都包含开发人员工具,您可以通过按键盘上的 **F12** 键来打开它们。 从那里,您应该看到一个标签为 **控制台** 的标签。 打印到控制台的所有信息都将显示在此处。 由于到目前为止编写的代码将在浏览器加载后立即运行,因此,如果您查看控制台,您应该会看到刚刚生成的随机数! 万岁! +大多数浏览器都包含开发人员工具,你可以通过按键盘上的 `F12` 键来打开它们。从那里,你应该看到一个 **控制台** 标签。打印到控制台的所有信息都将显示在此处。由于到目前为止编写的代码将在浏览器加载后立即运行,因此,如果你查看控制台,你应该会看到刚刚生成的随机数! ![Javascript game with console][21] -### 函数 +### 函数 -接下来,您需要一种方法来从数字输入字段中获得玩家的猜测,将其与您刚刚生成的随机数进行比较,并向玩家提供反馈,让他们知道他们是否正确猜到了。 为此,编写一个函数。 **函数** 是执行一定任务的代码块。 函数是可以重用的,这意味着如果您需要多次运行相同的代码,则可以调用函数,而不必重写执行任务所需的所有步骤。 +接下来,你需要一种方法来从数字输入字段中获得玩家的猜测,将其与你刚刚生成的随机数进行比较,并向玩家提供反馈,让他们知道他们是否正确猜到了。为此,编写一个函数。 **函数** 是执行一定任务的代码块。函数是可以重用的,这意味着如果你需要多次运行相同的代码,则可以调用函数,而不必重写执行任务所需的所有步骤。 -根据您使用的 JavaScript 版本,有许多不同的方法来编写或声明函数。 由于这是该语言的基础入门,因此请使用基本函数语法声明函数。 - -以关键字 `function` 开头,然后起一个函数名。 好的做法是使用一个描述该函数的功能的名称。 在这个例子中,您正在检查玩家的猜测的数,因此此函数的名字可以是 `checkGuess`。 在函数名称之后,写上一组括号,然后写上一组花括号。 您将在以下花括号之间编写函数的主体: +根据你使用的 JavaScript 版本,有许多不同的方法来编写或声明函数。由于这是该语言的基础入门,因此请使用基本函数语法声明函数。 +以关键字 `function` 开头,然后起一个函数名。好的做法是使用一个描述该函数的功能的名称。在这个例子中,你正在检查玩家的猜测的数,因此此函数的名字可以是 `checkGuess`。在函数名称之后,写上一组小括号,然后写上一组花括号。 你将在以下花括号之间编写函数的主体: ``` -`function checkGuess() {}` +function checkGuess() {} ``` ### 使用 DOM -JavaScript 的目的之一是与网页上的 HTML 交互。 它通过文档对象模型(DOM)进行此操作,DOM 是 JavaScript 用于访问和更改网页信息的对象。 现在,您需要从 HTML 中获取数字输入字段中玩家的猜测。 您可以使用分配给 HTML 元素的 `id` 属性(在这种情况下为 `guess`)来做到这一点: - +JavaScript 的目的之一是与网页上的 HTML 交互。它通过文档对象模型(DOM)进行此操作,DOM 是 JavaScript 用于访问和更改网页信息的对象。现在,你需要从 HTML 中获取数字输入字段中玩家的猜测。你可以使用分配给 HTML 元素的 `id` 属性(在这种情况下为 `guess`)来做到这一点: ``` -`` + ``` -JavaScript 可以通过访问玩家输入到数字输入字段中的数来获取其值。 您可以通过引用元素的 ID 并在末尾添加 `.value` 来实现。 这次,使用 `let` 定义的变量来保存用户的猜测值: +JavaScript 可以通过访问玩家输入到数字输入字段中的数来获取其值。你可以通过引用元素的 ID 并在末尾添加 `.value` 来实现。这次,使用 `let` 定义的变量来保存用户的猜测值: ``` -`let myGuess = guess.value` +let myGuess = guess.value ``` 玩家在数字输入字段中输入的任何数字都将被分配给 `checkGuess` 函数中的 `myGuess` 变量。 ### 条件语句 -下一步是将玩家的猜测与游戏产生的随机数进行比较。 您还想给玩家反馈,让他们知道他们的猜测是太高,太低还是正确。 -您可以使用一系列条件语句来决定玩家将收到的反馈。 **条件语句** 在运行代码块之前检查是否满足条件。 如果不满足条件,则代码停止,继续检查下一个条件,或者继续执行其余代码,而无需执行条件块中的代码: +下一步是将玩家的猜测与游戏产生的随机数进行比较。你还想给玩家反馈,让他们知道他们的猜测是太高,太低还是正确。 + +你可以使用一系列条件语句来决定玩家将收到的反馈。**条件语句** 在运行代码块之前检查是否满足条件。如果不满足条件,则代码停止,继续检查下一个条件,或者继续执行其余代码,而无需执行条件块中的代码: ``` if (myGuess === randomNumber){   feedback.textContent = "You got it right!" } -else if(myGuess > randomNumber) { +else if(myGuess > randomNumber) {   feedback.textContent = "Your guess was " + myGuess + ". That's too high. Try Again!" } -else if(myGuess < randomNumber) { +else if(myGuess < randomNumber) {   feedback.textContent = "Your guess was " + myGuess + ". That's too low. Try Again!" } ``` -第一个条件块使用比较运算符 `===` 将玩家的猜测与游戏生成的随机数进行比较。 比较运算符检查右侧的值,将其与左侧的值进行比较,如果匹配则返回布尔值 `true` ,否则返回布尔值 `false`。 - -如果数字匹配(猜对了!),为了让玩家知道。 通过将文本添加到具有 id 属性 "feedback" 的 `

` 标记中来操作 DOM。 就像上面的 `guess.value` 一样工作,除了不是从 DOM 获取信息,而是更改其中的信息。 `

` 元素没有像 `` 元素那样的值,而是具有文本,因此请使用 `.textContent` 访问元素并设置要显示的文本: +第一个条件块使用比较运算符 `===` 将玩家的猜测与游戏生成的随机数进行比较。比较运算符检查右侧的值,将其与左侧的值进行比较,如果匹配则返回布尔值 `true`,否则返回布尔值 `false`。 +如果数字匹配(猜对了!),为了让玩家知道。通过将文本添加到具有 `id` 属性 `feedback` 的 `

` 标记中来操作 DOM。就像上面的 `guess.value` 一样,除了不是从 DOM 获取信息,而是更改其中的信息。`

` 元素没有像 `` 元素那样的值,而是具有文本,因此请使用 `.textContent` 访问元素并设置要显示的文本: ``` -`feedback.textContent = "You got it right!"` +feedback.textContent = "You got it right!" ``` -当然,玩家很有可能在第一次尝试时就猜错了,因此,如果 `myGuess` 和 `randomNumber` 不匹配,请给玩家一个线索,以帮助他们缩小猜测范围。 如果第一个条件失败,则代码将跳过该 if 语句中的代码块,并检查下一个条件是否为 true。 这使您进入 `else if` 块: +当然,玩家很有可能在第一次尝试时就猜错了,因此,如果 `myGuess` 和 `randomNumber` 不匹配,请给玩家一个线索,以帮助他们缩小猜测范围。如果第一个条件失败,则代码将跳过该 `if` 语句中的代码块,并检查下一个条件是否为 `true`。 这使你进入 `else if` 块: ``` -else if(myGuess > randomNumber) { +else if(myGuess > randomNumber) {   feedback.textContent = "Your guess was " + myGuess + ". That's too high. Try Again!" } ``` -如果您将其作为句子阅读,则可能是这样的:“如果玩家的猜测等于随机数,请让他们知道他们猜对了。否则,请检查玩家的猜测是否大于 `randomNumber`,如果是,则显示玩家的猜测并告诉他们太高了。” +如果你将其作为句子阅读,则可能是这样的:“如果玩家的猜测等于随机数,请让他们知道他们猜对了。否则,请检查玩家的猜测是否大于 `randomNumber`,如果是,则显示玩家的猜测并告诉他们太高了。” 最后一种可能性是玩家的猜测低于随机数。 要检查这一点,再添加一个 `else if` 块: ``` -else if(myGuess < randomNumber) { +else if(myGuess < randomNumber) {   feedback.textContent = "Your guess was " + myGuess + ". That's too low. Try Again!" } ``` ### 用户事件和事件监听器 -如果您看上面的代码,则会看到某些代码在页面加载时自动运行,但有些则不会。 您想在玩游戏之前生成随机数,但是您不想在玩家将数字输入到数字输入字段并准备检查它之前检查其猜测。 +如果你看上面的代码,则会看到某些代码在页面加载时自动运行,但有些则不会。你想在玩游戏之前生成随机数,但是你不想在玩家将数字输入到数字输入字段并准备检查它之前检查其猜测。 -生成随机数并将其打印到控制台的代码不在函数的范围内,因此它将在浏览器加载脚本时自动运行。 但是,要使函数内部的代码运行,您必须对其进行调用。 +生成随机数并将其打印到控制台的代码不在函数的范围内,因此它将在浏览器加载脚本时自动运行。 但是,要使函数内部的代码运行,你必须对其进行调用。 -调用函数有几种方法。 在此,您希望该函数在用户单击“检查我的猜测”按钮时运行。 单击按钮将创建一个用户事件,然后 JavaScript 可以 “监听” 这个事件,以便知道何时需要运行函数。 - -代码的最后一行将事件侦听器添加到按钮上,以在单击按钮时调用函数。 当它“听到”该事件时,它将运行分配给事件侦听器的函数: +调用函数有几种方法。在此,你希望该函数在用户单击 “Check My Guess” 按钮时运行。单击按钮将创建一个用户事件,然后 JavaScript 可以 “监听” 这个事件,以便知道何时需要运行函数。 +代码的最后一行将事件侦听器添加到按钮上,以在单击按钮时调用函数。当它“听到”该事件时,它将运行分配给事件侦听器的函数: ``` -`submitGuess.addEventListener('click', checkGuess)` +submitGuess.addEventListener('click', checkGuess) ``` -就像访问 DOM 元素的其他实例一样,您可以使用按钮的 ID 告诉 JavaScript 与哪个元素进行交互。 然后,您可以使用内置的 `addEventListener` 函数来告诉 JavaScript 要监听的事件。 +就像访问 DOM 元素的其他实例一样,你可以使用按钮的 ID 告诉 JavaScript 与哪个元素进行交互。 然后,你可以使用内置的 `addEventListener` 函数来告诉 JavaScript 要监听的事件。 -您已经看到了带有参数的函数,但花点时间看一下它是如何工作的。 参数是函数执行其任务所需的信息。 并非所有函数都需要参数,但是 `addEventListener` 函数需要两个参数。 它采用的第一个参数是将为其侦听的用户事件的名称。 用户可以通过多种方式与 DOM 交互,例如键入,移动鼠标,键盘上的 TAB 键和粘贴文本。 在这种情况下,您正在监听的用户事件是单击按钮,因此第一个参数将是 ` click`。 +你已经看到了带有参数的函数,但花点时间看一下它是如何工作的。参数是函数执行其任务所需的信息。并非所有函数都需要参数,但是 `addEventListener` 函数需要两个参数。它采用的第一个参数是将为其监听的用户事件的名称。用户可以通过多种方式与 DOM 交互,例如键入、移动鼠标,键盘上的 `TAB` 键和粘贴文本。在这种情况下,你正在监听的用户事件是单击按钮,因此第一个参数将是 `click`。 `addEventListener`的第二个所需的信息是用户单击按钮时要运行的函数的名称。 这里我们需要 `checkGuess` 函数。 -现在,当玩家按下“检查我的猜测”按钮时,`checkGuess` 函数将获得他们在数字输入字段中输入的值,将其与随机数进行比较,并在浏览器中显示反馈,以使玩家知道他们猜的怎么样。 太棒了! 您的游戏已准备就绪。 +现在,当玩家按下 “Check My Guess” 按钮时,`checkGuess` 函数将获得他们在数字输入字段中输入的值,将其与随机数进行比较,并在浏览器中显示反馈,以使玩家知道他们猜的怎么样。 太棒了!你的游戏已准备就绪。 ### 学习 JavaScript 以获取乐趣和收益 -一点点的 Vanilla JavaScript 只是这个庞大的生态系统所提供功能的一小部分。 这是一种值得花时间投入学习的语言,我鼓励您继续挖掘并学习更多。 + +这一点点的平凡无奇的 JavaScript 只是这个庞大的生态系统所提供功能的一小部分。这是一种值得花时间投入学习的语言,我鼓励你继续挖掘并学习更多。 -------------------------------------------------------------------------------- @@ -262,7 +257,7 @@ via: https://opensource.com/article/21/1/learn-javascript 作者:[Mandy Kendall][a] 选题:[lujun9972][b] 译者:[amwps290](https://github.com/amwps290) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8505b07da6450f4e339d218b9b132c8039990504 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 5 Feb 2021 15:16:29 +0800 Subject: [PATCH 199/381] PUB @amwps290 https://linux.cn/article-13087-1.html --- .../20210120 Learn JavaScript by writing a guessing game.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210120 Learn JavaScript by writing a guessing game.md (99%) diff --git a/translated/tech/20210120 Learn JavaScript by writing a guessing game.md b/published/20210120 Learn JavaScript by writing a guessing game.md similarity index 99% rename from translated/tech/20210120 Learn JavaScript by writing a guessing game.md rename to published/20210120 Learn JavaScript by writing a guessing game.md index 64e91e358c..e457842c51 100644 --- a/translated/tech/20210120 Learn JavaScript by writing a guessing game.md +++ b/published/20210120 Learn JavaScript by writing a guessing game.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "amwps290" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13087-1.html" [#]: subject: "Learn JavaScript by writing a guessing game" [#]: via: "https://opensource.com/article/21/1/learn-javascript" [#]: author: "Mandy Kendall https://opensource.com/users/mkendall" From 2a651392d23a030de3746cf909916821623cd568 Mon Sep 17 00:00:00 2001 From: amwps290 Date: Fri, 5 Feb 2021 17:17:52 +0800 Subject: [PATCH 200/381] Update 20210204 A hands-on tutorial of SQLite3.md --- sources/tech/20210204 A hands-on tutorial of SQLite3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210204 A hands-on tutorial of SQLite3.md b/sources/tech/20210204 A hands-on tutorial of SQLite3.md index a2c73e3461..b5427ff9b7 100644 --- a/sources/tech/20210204 A hands-on tutorial of SQLite3.md +++ b/sources/tech/20210204 A hands-on tutorial of SQLite3.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (amwps290) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 705966b1967e88bceb960a717b9f0e2f4bec1bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Fri, 5 Feb 2021 17:49:52 +0800 Subject: [PATCH 201/381] translating by Chao-zhi --- ... With Pacman Commands in Arch-based Linux Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 index f2fd06793f..1e9567a2f7 100644 --- 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 @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -221,7 +221,7 @@ via: https://itsfoss.com/pacman-command/ 作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b45cb59afc92818ad42c38d70de7602e127b6a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Fri, 5 Feb 2021 21:22:34 +0800 Subject: [PATCH 202/381] translate done: 20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md --- ...mands in Arch-based Linux Distributions.md | 250 ------------------ ...mands in Arch-based Linux Distributions.md | 250 ++++++++++++++++++ 2 files changed, 250 insertions(+), 250 deletions(-) delete mode 100644 sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md create mode 100644 translated/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 deleted file mode 100644 index 1e9567a2f7..0000000000 --- a/sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md +++ /dev/null @@ -1,250 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Chao-zhi) -[#]: 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] -译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者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 diff --git a/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md b/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md new file mode 100644 index 0000000000..d33bb59f36 --- /dev/null +++ b/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md @@ -0,0 +1,250 @@ +[#]: collector: (lujun9972) +[#]: translator: (Chao-zhi) +[#]: 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/) + +基于 Arch 的 Linux 发行版中 Pacman 命令入门 +====== + +_**简介:这本初学者指南向您展示了在 Linux 中可以使用 pacman 命令做什么,如何使用它们来查找新的软件包,安装和升级新的软件包,以及清理您的系统。**_ + +[pacman][1] 包管理器是 [Arch Linux][2] 和其他主要发行版如 Red Hat 和 Ubuntu/Debian 之间的主要区别之一。它结合了简单的二进制包格式和易于使用的[构建系统 ][3]。pacman 的目标是方便地管理软件包,无论它是来自[官方库 ][4] 还是用户自己的构建软件库。 + +如果您曾经使用过 Ubuntu 或基于 debian 的 发行版,那么您可能使用过 apt-get 或 apt 命令。pacman 在 Arch Linux 中是同样的。如果你[刚刚安装了 Arch Linux][5],在安装 Arch Linux 后,首先要做的[几件事 ][6] 之一就是学习使用 pacman 命令。 + +在这个初学者指南中,我将解释一些基本的 pacman 命令的用法,你应该知道如何用这些命令来管理你的基于 Archlinux 的系统。 + +### Arch Linux 用户应该知道的几个重要的 pacman 命令 + +![][7] + +与其他包管理器一样,pacman 可以将包列表与软件库同步,它能够自动解决所有所需的依赖项,以使得用户可以通过一个简单的命令下载和安装软件。 + +#### 通过 pacman 安装软件 + +你可以用一下形式的代码来安装一个或者多个软件包: + +``` +pacman -S _package_name1_ _package_name2_ ... +``` + +![安装一个包 ][8] + +-S 选项的意思是同步 (synchronization),它的意思是 pacman 在安装之前先与软件库进行同步。 + +pacman 数据库根据安装的原因将安装的包分为两组: + + * **显式安装**:由 pacman -S 或 -U 命令直接安装的包 + * **依赖安装**:由于被其他显式安装的包所[依赖 ][9],而被自动安装的包。 + + + +#### 卸载已安装的软件包 + +卸载一个包,并且删除它的所有依赖。 + +``` +pacman -R package_name_ +``` + +![移除一个包 ][10] + +删除一个包,以及其不被其他包所需要的依赖项: + +``` +pacman -Rs _package_name_ +``` + +删除所有不再需要的依赖项。比如,需要这个依赖的包已经被删除了。 + +``` +pacman -Qdtq | pacman -Rs - +``` + +#### 升级软件包 + +Pacman 提供了一个简单的办法来[升级 Arch Linux][11]。你只需要一条命令就可以升级所有已安装的软件包。这可能需要一段时间,这取决于系统的新旧程度。 + +以下命令可以同步存储库数据库 _并且_ 更新系统的所有软件包,但不包括不在软件库中的“本地安装的”包: + +``` +pacman -Syu +``` + + * S 代表同步 + * y 代表更新本地存储库 + * u 代表系统更新 + + + +也就是说,同步到中央存储库(主程序包数据库),刷新主程序包数据库的本地副本,然后执行系统更新(通过更新所有有更新版本可用的程序包)。 + +![系统更新 ][12] + +注意! + +Arch Linux 用户在系统升级前,建议您访问 [Arch-Linux 主页 ][2] 查看最新消息,以了解异常更新的情况。如果系统更新需要人工干预,主页上将发布相关的新闻。您也可以订阅 [RSS feed][13] 或 [Arch 的声明邮件 ][14]。 + +在升级基础软件(如 kernel、xorg、systemd 或 glibc) 之前,请注意查看相应的 [论坛 ][15],以了解大家报告的各种问题。 + +**在 Arch 和 Manjaro 等滚动发行版中不支持仅部分升级**。这意味着,当新的库版本被推送到存储库时,存储库中的所有包都需要根据库进行升级。例如,如果两个包依赖于同一个库,则仅升级一个包可能会破坏依赖于库的旧版本的另一个包。 + +#### 用 Pacman 查找包 + +Pacman 使用 -Q 选项查询本地包数据库,使用 -S 选项查询同步数据库,使用 -F 选项查询文件数据库。 + +Pacman 可以在数据库中搜索包,包括包的名称和描述: + +``` +pacman -Ss _string1_ _string2_ ... +``` + +![查找一个包 ][16] + +查找已经被安装的包: + +``` +pacman -Qs _string1_ _string2_ ... +``` + +根据文件名在远程数据库中查找它所属的包: + +``` +pacman -F _string1_ _string2_ ... +``` + +查看一个包的依赖树: + +``` +pactree _package_naenter code hereme_ +``` + +#### 清除包缓存 + +Pacman 将其下载的包存储在 /var/cache/Pacman/pkg/ 中,并且不会自动删除旧版本或卸载的版本。这有一些优点: + + 1。它允许[降级 ][17] 一个包,而不需要通过其他来源检索以前的版本。 + 2。已卸载的软件包可以轻松地直接从缓存文件夹重新安装。 + + + +但是,有必要定期清理缓存以防止文件夹增大。 + +[pacman contrib][19] 包中提供的 [paccache(8)][18] 脚本默认情况下会删除已安装和未安装包的所有缓存版本,但最近 3 个版本除外: + +``` +paccache -r +``` + +![清除缓存 ][20] + +要删除当前未安装的所有缓存包和未使用的同步数据库,请执行: + +``` +pacman -Sc +``` + +要从缓存中删除所有文件,请使用 clean 选项两次,这是最激进的方法,不会在缓存文件夹中留下任何内容: + +``` +pacman -Scc +``` + +#### 安装本地或者第三方的包 + +安装不是来自远程存储库的“本地”包: + +``` +pacman -U _/path/to/package/package_name-version.pkg.tar.xz_ +``` + +安装官方存储库中未包含的“远程”软件包: + +``` +pacman -U http://www.example.com/repo/example.pkg.tar.xz +``` + +### 额外内容:用 pacman 排除常见错误 + +下面是使用 pacman 管理包时可能遇到的一些常见错误。 + +#### 提交事务失败(文件冲突) + +如果你看到以下报错: + +``` +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. +``` + +这是因为 pacman 检测到文件冲突,不会为您覆盖文件。 + +解决这个问题的一个安全方法是首先检查另一个包是否拥有这个文件 (pacman-Qo\path/to/file)。如果该文件属于另一个包,请提交错误报告。如果文件不属于另一个包,请重命名“存在于文件系统中”的文件,然后重新发出 update 命令。如果一切顺利,文件可能会被删除。 + +您可以显式地运行 **pacman -S –overwrite glob package**,强制 pacman 覆盖与 _glob_ 匹配的文件,而不是手动重命名并在以后删除属于所讨论的包的所有文件。 + +#### 提交事务失败(包无效或损坏) + +在 /var/cache/pacman/pkg/ 中查找 .part 文件(部分下载的包),并将其删除。这通常是由在 pacman.conf 文件中使用自定义 XferCommand 引起的。 + +#### 初始化事务失败(无法锁定数据库) + +当 pacman 要修改包数据库时,例如安装包时,它会在 /var/lib/pacman/db.lck 处创建一个锁文件。这可以防止 pacman 的另一个实例同时尝试更改包数据库。 + +如果 pacman 在更改数据库时被中断,这个过时的锁文件可能仍然保留。如果您确定没有 pacman 实例正在运行,那么请删除锁文件。 + +检查进程是否持有锁定文件: + +``` +lsof /var/lib/pacman/db.lck +``` + +如果上述命令未返回任何内容,则可以删除锁文件: + +``` +rm /var/lib/pacman/db.lck +``` + +如果您发现 lsof 命令输出了使用锁文件的进程的 PID,请先杀死这个进程,然后删除锁文件。 + +我希望你喜欢我对 Pacman 基础命令的解释。请在下面留言,不要忘记订阅我们的社交媒体。注意安全! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/pacman-command/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://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 fbefc4774b80dc87ca2b480e5faec08ece15dd13 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 5 Feb 2021 23:39:24 +0800 Subject: [PATCH 203/381] PRF @MjSeven --- ...25 Why you need to drop ifconfig for ip.md | 152 ++++++++---------- 1 file changed, 69 insertions(+), 83 deletions(-) diff --git a/translated/tech/20210125 Why you need to drop ifconfig for ip.md b/translated/tech/20210125 Why you need to drop ifconfig for ip.md index a9ed73b4e0..c7c431c22f 100644 --- a/translated/tech/20210125 Why you need to drop ifconfig for ip.md +++ b/translated/tech/20210125 Why you need to drop ifconfig for ip.md @@ -1,21 +1,22 @@ [#]: collector: "lujun9972" [#]: translator: "MjSeven" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "Why you need to drop ifconfig for ip" [#]: via: "https://opensource.com/article/21/1/ifconfig-ip-linux" [#]: author: "Rajan Bhardwaj https://opensource.com/users/rajabhar" - -放弃 ifconfig,拥抱 ip +放弃 ifconfig,拥抱 ip 命令 ====== -开始使用现代方法配置 Linux 网络接口。 -![Tips and gears turning][1] + +> 开始使用现代方法配置 Linux 网络接口。 + +![](https://img.linux.net.cn/data/attachment/album/202102/05/233847lpg1lnz7kl2czgfj.jpg) 在很长一段时间内,`ifconfig` 命令是配置网络接口的默认方法。它为 Linux 用户提供了很好的服务,但是网络很复杂,所以配置网络的命令必须健壮。`ip` 命令是现代系统中新的默认网络命令,在本文中,我将向你展示如何使用它。 -`ip` 命令工作在 [OSI 网络栈][2] 上:数据链路层和网络(IP)层。它做了之前 `net-tools` 包的所有工作。 +`ip` 命令工作在 [OSI 网络栈][2] 的两个层上:第二层(数据链路层)和第三层(网络 或 IP)层。它做了之前 `net-tools` 包的所有工作。 ### 安装 ip @@ -23,94 +24,88 @@ ### ifconfig 和 ip 使用对比 -`ip` 和 `ifconfig` 命令可以用来配置网络接口,但它们做事方法不同。接下来,作为对比,我将用它们来执行一些常见的任务。 +`ip` 和 `ifconfig` 命令都可以用来配置网络接口,但它们做事方法不同。接下来,作为对比,我将用它们来执行一些常见的任务。 #### 查看网口和 IP 地址 如果你想查看主机的 IP 地址或网络接口信息,`ifconfig` (不带任何参数)命令提供了一个很好的总结。 - ``` $ ifconfig -                                                                        -eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500                                                                  -       ether bc:ee:7b:5e:7d:d8  txqueuelen 1000  (Ethernet)                                                        -       RX packets 0  bytes 0 (0.0 B) -       RX errors 0  dropped 0  overruns 0  frame 0 -       TX packets 0  bytes 0 (0.0 B) -       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 + +eth0: flags=4099 mtu 1500 + ether bc:ee:7b:5e:7d:d8 txqueuelen 1000 (Ethernet) + RX packets 0 bytes 0 (0.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 0 bytes 0 (0.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 -lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536 -       inet 127.0.0.1  netmask 255.0.0.0 -       inet6 ::1  prefixlen 128  scopeid 0x10<host> -       loop  txqueuelen 1000  (Local Loopback) -       RX packets 41  bytes 5551 (5.4 KiB) -       RX errors 0  dropped 0  overruns 0  frame 0 -       TX packets 41  bytes 5551 (5.4 KiB) -       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 +lo: flags=73 mtu 65536 + inet 127.0.0.1 netmask 255.0.0.0 + inet6 ::1 prefixlen 128 scopeid 0x10 + loop txqueuelen 1000 (Local Loopback) + RX packets 41 bytes 5551 (5.4 KiB) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 41 bytes 5551 (5.4 KiB) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 -wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500 -       inet 10.1.1.6  netmask 255.255.255.224  broadcast 10.1.1.31 -       inet6 fdb4:f58e:49f:4900:d46d:146b:b16:7212  prefixlen 64  scopeid 0x0<global> -       inet6 fe80::8eb3:4bc0:7cbb:59e8  prefixlen 64  scopeid 0x20<link> -       ether 08:71:90:81:1e:b5  txqueuelen 1000  (Ethernet) -       RX packets 569459  bytes 779147444 (743.0 MiB) -       RX errors 0  dropped 0  overruns 0  frame 0 -       TX packets 302882  bytes 38131213 (36.3 MiB) -       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 +wlan0: flags=4163 mtu 1500 + inet 10.1.1.6 netmask 255.255.255.224 broadcast 10.1.1.31 + inet6 fdb4:f58e:49f:4900:d46d:146b:b16:7212 prefixlen 64 scopeid 0x0 + inet6 fe80::8eb3:4bc0:7cbb:59e8 prefixlen 64 scopeid 0x20 + ether 08:71:90:81:1e:b5 txqueuelen 1000 (Ethernet) + RX packets 569459 bytes 779147444 (743.0 MiB) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 302882 bytes 38131213 (36.3 MiB) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ``` 新的 `ip` 命令提供了类似的结果,但命令是 `ip address show`,或者简写为 `ip a`: - ``` $ ip a -1: lo: <LOOPBACK,UP,LOWER_UP> 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 -   inet6 ::1/128 scope host   -      valid_lft forever preferred_lft forever -2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000 -   link/ether bc:ee:7b:5e:7d:d8 brd ff:ff:ff:ff:ff:ff -3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 -   link/ether 08:71:90:81:1e:b5 brd ff:ff:ff:ff:ff:ff -   inet 10.1.1.6/27 brd 10.1.1.31 scope global dynamic wlan0 -      valid_lft 83490sec preferred_lft 83490sec -   inet6 fdb4:f58e:49f:4900:d46d:146b:b16:7212/64 scope global noprefixroute dynamic   -      valid_lft 6909sec preferred_lft 3309sec -   inet6 fe80::8eb3:4bc0:7cbb:59e8/64 scope link   -      valid_lft forever preferred_lft forever +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 + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever +2: eth0: mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000 + link/ether bc:ee:7b:5e:7d:d8 brd ff:ff:ff:ff:ff:ff +3: wlan0: mtu 1500 qdisc noqueue state UP group default qlen 1000 + link/ether 08:71:90:81:1e:b5 brd ff:ff:ff:ff:ff:ff + inet 10.1.1.6/27 brd 10.1.1.31 scope global dynamic wlan0 + valid_lft 83490sec preferred_lft 83490sec + inet6 fdb4:f58e:49f:4900:d46d:146b:b16:7212/64 scope global noprefixroute dynamic + valid_lft 6909sec preferred_lft 3309sec + inet6 fe80::8eb3:4bc0:7cbb:59e8/64 scope link + valid_lft forever preferred_lft forever ``` #### 添加 IP 地址 使用 `ifconfig` 命令添加 IP 地址命令为: - -```bash +``` $ ifconfig eth0 add 192.9.203.21 ``` -`ip` 类似: +`ip` 类似: - -```bash +``` $ ip address add 192.9.203.21 dev eth0 ``` `ip` 中的子命令可以缩短,所以下面这个命令同样有效: - -```bash +``` $ ip addr add 192.9.203.21 dev eth0 ``` 你甚至可以更短些: - -```bash +``` $ ip a add 192.9.203.21 dev eth0 ``` @@ -118,74 +113,65 @@ $ ip a add 192.9.203.21 dev eth0 添加 IP 地址与删除 IP 地址正好相反。 -使用 `ifconfig`,命令是: +使用 `ifconfig`,命令是: - -```bash +``` $ ifconfig eth0 del 192.9.203.21 ``` `ip` 命令的语法是: - -```bash +``` $ ip a del 192.9.203.21 dev eth0 ``` #### 启用或禁用组播 -使用 `ifconfig` 接口来启用或禁用[组播][3]: +使用 `ifconfig` 接口来启用或禁用 [组播][3]multicast: - -```bash +``` # ifconfig eth0 multicast ``` 对于 `ip`,使用 `set` 子命令与设备(`dev`)以及一个布尔值和 `multicast` 选项: - -```bash +``` # ip link set dev eth0 multicast on ``` #### 启用或禁用网络 -每个系统管理员都熟悉“先关闭,然后打开”这个技巧来解决问题。在网络接口上,即打开或关闭网络。 +每个系统管理员都熟悉“先关闭,然后打开”这个技巧来解决问题。对于网络接口来说,即打开或关闭网络。 `ifconfig` 命令使用 `up` 或 `down` 关键字来实现: - -```bash +``` # ifconfig eth0 up ``` 或者你可以使用一个专用命令: - -```bash +``` # ifup eth0 ``` `ip` 命令使用 `set` 子命令将网络设置为 `up` 或 `down` 状态: - -```bash +``` # ip link set eth0 up ``` #### 开启或关闭地址解析功能(ARP) -使用 `ifconfig`,你可以通过声明来启用: +使用 `ifconfig`,你可以通过声明它来启用: - -```bash +``` # ifconfig eth0 arp ``` 使用 `ip`,你可以将 `arp` 属性设置为 `on` 或 `off`: - -```bash +``` # ip link set dev eth0 arp on ``` @@ -193,9 +179,9 @@ $ ip a del 192.9.203.21 dev eth0 `ip` 命令比 `ifconfig` 更通用,技术上也更有效,因为它使用的是 `Netlink` 套接字,而不是 `ioctl` 系统调用。 -`ip` 命令可能看起来比 `ifconfig` 更详细、更复杂,但这是它拥有更多功能的一个原因。一旦你开始使用它,你会了解它的内部逻辑(例如,使用 `set` 而不是看起来随意叠加的声明或设置)。 +`ip` 命令可能看起来比 `ifconfig` 更详细、更复杂,但这是它拥有更多功能的一个原因。一旦你开始使用它,你会了解它的内部逻辑(例如,使用 `set` 而不是看起来随意混合的声明或设置)。 -最后,`ifconfig` 已经过时了(例如,它缺乏对网络名称空间的支持),而 `ip` 是为现代网络而生的。尝试并学习它,使用它,你会很感激你使用它的! +最后,`ifconfig` 已经过时了(例如,它缺乏对网络命名空间的支持),而 `ip` 是为现代网络而生的。尝试并学习它,使用它,你会由衷高兴的! -------------------------------------------------------------------------------- @@ -204,7 +190,7 @@ via: https://opensource.com/article/21/1/ifconfig-ip-linux 作者:[Rajan Bhardwaj][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 5962d43647837a6bcb9c2f8619ac688022cb951d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 5 Feb 2021 23:40:02 +0800 Subject: [PATCH 204/381] PUB @MjSeven https://linux.cn/article-13089-1.html --- .../20210125 Why you need to drop ifconfig for ip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210125 Why you need to drop ifconfig for ip.md (98%) diff --git a/translated/tech/20210125 Why you need to drop ifconfig for ip.md b/published/20210125 Why you need to drop ifconfig for ip.md similarity index 98% rename from translated/tech/20210125 Why you need to drop ifconfig for ip.md rename to published/20210125 Why you need to drop ifconfig for ip.md index c7c431c22f..c4370c6f6d 100644 --- a/translated/tech/20210125 Why you need to drop ifconfig for ip.md +++ b/published/20210125 Why you need to drop ifconfig for ip.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "MjSeven" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13089-1.html" [#]: subject: "Why you need to drop ifconfig for ip" [#]: via: "https://opensource.com/article/21/1/ifconfig-ip-linux" [#]: author: "Rajan Bhardwaj https://opensource.com/users/rajabhar" From 32c83db6d5e1b3568f4d90d9cd75286e74abca35 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 6 Feb 2021 00:19:00 +0800 Subject: [PATCH 205/381] PRF @Chao-zhi --- ...nhance your command line skills in 2021.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md b/translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md index c72e61228c..8f07344db8 100644 --- a/translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md +++ b/translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md @@ -1,48 +1,48 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (7 Bash tutorials to enhance your command line skills in 2021) [#]: via: (https://opensource.com/article/21/1/bash) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) -7 个 Bash 教程,提高你的命令行技能,2021 年版 +7 个 Bash 教程,提高你的命令行技能(2021 版) ====== -Bash 是大多数 Linux 系统上的默认命令行 shell。所以你为什么不试着学习如何最大限度地利用它呢? +> Bash 是大多数 Linux 系统上的默认命令行 shell。所以你为什么不试着学习如何最大限度地利用它呢? -![Terminal command prompt on orange background][1] +![](https://img.linux.net.cn/data/attachment/album/202102/06/001837cujo0ql3utfobrrj.jpg) -Bash 是大多数 Linux 系统上的默认命令行 shell。所以你为什么不试着学习如何最大限度地利用它呢?今年,Opensource.com 推荐了许多很棒的文章来帮助您充分利用 Bash shell 的强大功能。以下是一些关于 Bash 阅读次数最多的文章: +Bash 是大多数 Linux 系统上的默认命令行 shell。所以你为什么不试着学习如何最大限度地利用它呢?今年,我们推荐了许多很棒的文章来帮助你充分利用 Bash shell 的强大功能。以下是一些关于 Bash 阅读次数最多的文章: -## [在 Linux 终端中通过重定向从任何地方读取和写入数据 ][2] +### 《通过重定向在 Linux 终端任意读写数据》 -输入和输出重定向是任何编程或脚本语言的基础功能。从技术上讲,只要你与电脑互动,它就会自然而然地发生。输入从 stdin( 标准输入,通常是您的键盘或鼠标)读取,输出到 stdout (标准输出,一般是文本或数据流),而错误被发送到 stderr。了解这些数据流的存在,使您能够在使用 Bash 等 shell 时控制信息的去向。Seth Kenlon 分享了这些很棒的技巧,可以让你在不需要大量鼠标移动和按键的情况下从一个地方获取数据。您可能不经常使用重定向,但学习使用它可以为您节省大量不必要的打开文件和复制粘贴数据的时间。 +输入和输出重定向是任何编程或脚本语言的基础功能。从技术上讲,只要你与电脑互动,它就会自然而然地发生。输入从 stdin(标准输入,通常是你的键盘或鼠标)读取,输出到 stdout(标准输出,一般是文本或数据流),而错误被发送到 stderr(标准错误,一般和标准输出是一个位置)。了解这些数据流的存在,使你能够在使用 Bash 等 shell 时控制信息的去向。Seth Kenlon [分享][2]了这些很棒的技巧,可以让你在不需要大量鼠标移动和按键的情况下从一个地方获取数据。你可能不经常使用重定向,但学习使用它可以为你节省大量不必要的打开文件和复制粘贴数据的时间。 -## [系统管理员 Bash 脚本入门 ][3] +### 《系统管理员 Bash 脚本入门》 -Bash 是免费的开源软件,所以任何人都可以安装它,不管他们运行的是 Linux、BSD、OpenIndiana、Windows 还是 macOS。Seth Kenlon 帮助您学习如何使用 Bash 的命令和特性,使其成为最强大的 shell 之一。 +Bash 是自由开源软件,所以任何人都可以安装它,不管他们运行的是 Linux、BSD、OpenIndiana、Windows 还是 macOS。Seth Kenlon [帮助][3]你学习如何使用 Bash 的命令和特性,使其成为最强大的 shell 之一。 -## [试试这个针对大型文件系统的 Bash 脚本 ][4] +### 《针对大型文件系统可以试试此 Bash 脚本》 -您是否曾经想列出一个目录中的所有文件,只显示其中的文件,不包括其他内容?或者只显示目录?如果你有,那么 Nick Clifton 的文章可能正是你正在寻找的。Nick 分享了一个漂亮的 Bash 脚本,它可以列出目录、文件、链接或可执行文件。该脚本使用 **find** 命令进行搜索,然后运行 **ls** 显示详细信息。对于管理大型 Linux 系统的人来说,这是一个漂亮的解决方案。 +你是否曾经想列出一个目录中的所有文件,只显示其中的文件,不包括其他内容?或者只显示目录?如果你有,那么 Nick Clifton 的[文章][4]可能正是你正在寻找的。Nick 分享了一个漂亮的 Bash 脚本,它可以列出目录、文件、链接或可执行文件。该脚本使用 `find` 命令进行搜索,然后运行 `ls` 显示详细信息。对于管理大型 Linux 系统的人来说,这是一个漂亮的解决方案。 -## [用 Bash 工具对你的 Linux 系统配置进行快照 ][5] +### 《用 Bash 工具对你的 Linux 系统配置进行快照》 -您可能想与他人分享您的 Linux 配置,原因有很多。您可能需要帮助排除系统上的一个问题,或者您对自己创建的环境非常自豪,想向其他开源爱好者展示它。Don Watkins 向我们展示了 screenFetch 和 Neofetch 来捕获和分享您的系统配置。 +你可能想与他人分享你的 Linux 配置,原因有很多。你可能需要帮助排除系统上的一个问题,或者你对自己创建的环境非常自豪,想向其他开源爱好者展示它。Don Watkins 向我们[展示][5]了 screenFetch 和 Neofetch 来捕获和分享你的系统配置。 -## [Git 的 6 个好用的 Bash 脚本 ][6] +### 《6 个方便的 Git 脚本》 -Git 已经成为一个无处不在的代码管理系统。了解如何管理 Git 存储库可以简化您的开发体验。Bob Peterson 分享了 6 个 Bash 脚本,它们将使您在使用 Git 存储库时更加轻松。**gitlog** 打印当前 patch 和 主版本的缩写列表。另一种脚本可以显示 patch 的 SHA1 id 或在一组 patch 中搜索字符串。 +Git 已经成为一个无处不在的代码管理系统。了解如何管理 Git 存储库可以简化你的开发体验。Bob Peterson [分享][6]了 6 个 Bash 脚本,它们将使你在使用 Git 存储库时更加轻松。`gitlog` 打印当前补丁的简略列表,并与主版本相对照。这个脚本的不同版本可以显示补丁的 SHA1 id 或在一组补丁中搜索字符串。 -## [改进你 Bash 脚本的 5 种方法 ][7] +### 《改进你 Bash 脚本的 5 种方法》 -系统管理员通常编写各种或长或短的 Bash 脚本,以完成各种任务。Alan Formy-Duval 解释了如何使 Bash 脚本更简单、更健壮、更易于阅读和调试。我们可能会考虑到我们需要使用诸如 Python、C 或 Java 之类的语言来实现更高的功能,但其实也不一定需要。因为 Bash 脚本语言就已经非常强大。要最大限度地发挥它的效用,还有很多东西要学。 +系统管理员通常编写各种或长或短的 Bash 脚本,以完成各种任务。Alan Formy-Duval [解释][7]了如何使 Bash 脚本更简单、更健壮、更易于阅读和调试。我们可能会考虑到我们需要使用诸如 Python、C 或 Java 之类的语言来实现更高的功能,但其实也不一定需要。因为 Bash 脚本语言就已经非常强大。要最大限度地发挥它的效用,还有很多东西要学。 -## [我最喜欢的 Bash 技巧 ][8] +### 《我珍藏的 Bash 秘籍》 -Katie McLaughlin 帮助你提高你的工作效率,用别名和其他快捷方式解决你经常忘记的事情。当你整天与计算机打交道时,找到可重复的命令并标记它们以方便以后使用是非常美妙的。Katie 总结了一些有用的 Bash 特性和帮助命令,可以节省您的时间。 +Katie McLaughlin 帮助你提高你的工作效率,用别名和其他快捷方式解决你经常忘记的事情。当你整天与计算机打交道时,找到可重复的命令并标记它们以方便以后使用是非常美妙的。Katie [总结][8]了一些有用的 Bash 特性和帮助命令,可以节省你的时间。 这些 Bash 小技巧将一个已经很强大的 shell 提升到一个全新的级别。也欢迎分享你自己的建议。 @@ -53,17 +53,17 @@ via: https://opensource.com/article/21/1/bash 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [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/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) -[2]: https://opensource.com/article/20/6/redirection-bash +[2]: https://linux.cn/article-12385-1.html [3]: https://opensource.com/article/20/4/bash-sysadmins-ebook -[4]: https://opensource.com/article/20/2/script-large-files +[4]: https://linux.cn/article-12025-1.html [5]: https://opensource.com/article/20/1/screenfetch-neofetch -[6]: https://opensource.com/article/20/1/bash-scripts-git +[6]: https://linux.cn/article-11797-1.html [7]: https://opensource.com/article/20/1/improve-bash-scripts -[8]: https://opensource.com/article/20/1/bash-scripts-aliases +[8]: https://linux.cn/article-11841-1.html From c0d782f11f3b64f9afe1f80190e42c31767363f1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 6 Feb 2021 00:19:37 +0800 Subject: [PATCH 206/381] PUB @Chao-zhi https://linux.cn/article-13090-1.html --- ...h tutorials to enhance your command line skills in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210111 7 Bash tutorials to enhance your command line skills in 2021.md (98%) diff --git a/translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md b/published/20210111 7 Bash tutorials to enhance your command line skills in 2021.md similarity index 98% rename from translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md rename to published/20210111 7 Bash tutorials to enhance your command line skills in 2021.md index 8f07344db8..ce0f61adc5 100644 --- a/translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md +++ b/published/20210111 7 Bash tutorials to enhance your command line skills in 2021.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13090-1.html) [#]: subject: (7 Bash tutorials to enhance your command line skills in 2021) [#]: via: (https://opensource.com/article/21/1/bash) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) From 4f7b4eb14c4b44a186638f270be09a2c1568d276 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 6 Feb 2021 05:03:22 +0800 Subject: [PATCH 207/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210205=20?= =?UTF-8?q?Astrophotography=20with=20Fedora=20Astronomy=20Lab:=20setting?= =?UTF-8?q?=20up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210205 Astrophotography with Fedora Astronomy Lab- setting up.md --- ...y with Fedora Astronomy Lab- setting up.md | 243 ++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 sources/tech/20210205 Astrophotography with Fedora Astronomy Lab- setting up.md diff --git a/sources/tech/20210205 Astrophotography with Fedora Astronomy Lab- setting up.md b/sources/tech/20210205 Astrophotography with Fedora Astronomy Lab- setting up.md new file mode 100644 index 0000000000..7077d9544b --- /dev/null +++ b/sources/tech/20210205 Astrophotography with Fedora Astronomy Lab- setting up.md @@ -0,0 +1,243 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Astrophotography with Fedora Astronomy Lab: setting up) +[#]: via: (https://fedoramagazine.org/astrophotography-with-fedora-astronomy-lab-setting-up/) +[#]: author: (Geoffrey Marr https://fedoramagazine.org/author/coremodule/) + +Astrophotography with Fedora Astronomy Lab: setting up +====== + +![][1] + +Photo by Geoffrey Marr + +You love astrophotography. You love Fedora Linux. What if you could do the former using the latter? Capturing stunning and awe-inspiring astrophotographs, processing them, and editing them for printing or sharing online using Fedora is absolutely possible! This tutorial guides you through the process of setting up a computer-guided telescope mount, guide cameras, imaging cameras, and other pieces of equipment. A future article will cover capturing and processing data into pleasing images. Please note that while this article is written with certain aspects of the astrophotography process included or omitted based off my own equipment, you can custom-tailor it to fit your own equipment and experience. Let’s capture some photons! + +![][2] + +### Installing Fedora Astronomy Lab + +This tutorial focuses on [Fedora Astronomy Lab][3], so it only makes sense that the first thing we should do is get it installed. But first, a quick introduction: based on the KDE Plasma desktop, Fedora Astronomy Lab includes many pieces of open source software to aid astronomers in planning observations, capturing data, processing images, and controlling astronomical equipment. + +Download Fedora Astronomy Lab from the [Fedora Labs website][4]. You will need a USB flash-drive with at least eight GB of storage. Once you have downloaded the ISO image, use [Fedora Media Writer][5] to [write the image to your USB flash-drive.][6] After this is done, [boot from the USB drive][7] you just flashed and [install Fedora Astronomy Lab to your hard drive.][8] While you can use Fedora Astronomy Lab in a live-environment right from the flash drive, you should install to the hard drive to prevent bottlenecks when processing large amounts of astronomical data. + +### Configuring your installation + +Before you can go capturing the heavens, you need to do some minor setup in Fedora Astronomy Lab. + +First of all, you need to add your user to the _dialout_ group so that you can access certain pieces of astronomical equipment from within the guiding software. Do that by opening the terminal (Konsole) and running this command (replacing _user_ with your username): + +sudo usermod -a -G dialout user + +My personal setup includes a guide camera (QHY5 series, also known as Orion Starshoot) that does not have a driver in the mainline Fedora repositories. To enable it, ypu need to install the [qhyccd SDK][9]. (_Note that this package is not officially supported by Fedora. Use it at your own risk.)_ At the time of writing, I chose to use the latest stable release, 20.08.26. Once you download the Linux 64-bit version of the SDK, to extract it: +``` + +``` + +tar zxvf sdk_linux64_20.08.26.tgz +``` + +``` + +Now change into the directory you just extracted, change the permissions of the _install.sh_ file to give you execute privileges, and run the _install.sh_: + +``` +cd sdk_linux64_20.08.26 +chmod +x install.sh +sudo ./install.sh +``` + +Now it’s time to install the qhyccd INDI driver. INDI is an open source software library used to control astronomical equipment. Unfortunately, the driver is unavailable in the mainline Fedora repositories, but it is in a Copr repository. (_Note: Copr is not officially supported by Fedora infrastructure. Use packages at your own risk.)_ If you prefer to have the newest (and perhaps unstable!) pieces of astronomy software, you can also enable the “bleeding” repositories at this time by following [this guide][10]. For this tutorial, you are only going to enable one repo: +``` + +``` + +sudo dnf copr enable xsnrg/indi-3rdparty-bleeding +``` + +``` + +Install the driver by running the following command: +``` + +``` + +sudo dnf install indi-qhy +``` + +``` + +Finally, update all of your system packages: + +sudo dnf update -y + +To recap what you accomplished in this sectio: you added your user to the _dialout_ group, downloaded and installed the qhyccd driver, enabled the _indi-3rdparty-bleeding_ copr, installed the qhyccd-INDI driver with dnf, and updated your system. + +### Connecting your equipment + +This is the time to connect all your equipment to your computer. Most astronomical equipment will connect via USB, and it’s really as easy as plugging each device into your computer’s USB ports. If you have a lot of equipment (mount, imaging camera, guide camera, focuser, filter wheel, etc), you should use an external powered-USB hub to make sure that all connected devices have adequate power. Once you have everything plugged in, run the following command to ensure that the system recognizes your equipment: +``` + +``` + +lsusb +``` + +``` + +You should see output similar to (but not the same as) the output here: + +![][11] + +You see in the output that the system recognizes the telescope mount (a SkyWatcher EQM-35 Pro) as _Prolific Technology, Inc. PL2303 Serial Port_, the imaging camera (a Sony a6000) as _Sony Corp. ILCE-6000_, and the guide camera (an Orion Starshoot, aka QHY5) as _Van Ouijen Technische Informatica_. Now that you have made sure your system recognizes your equipment, it’s time to open your desktop planetarium and telescope controller, KStars! + +### Setting up KStars + +It’s time to open [KStars][12], which is a desktop planetarium and also includes the Ekos telescope control software. The first time you open KStars, you will see the KStars Startup Wizard. + +![][13] + +Follow the prompts to choose your home location (where you will be imaging from) and _Download Extra Data…_ + +![Setting your location][14] + +![“Download Extra Data”][15] + +![Choosing which catalogs to download][16] + +This will allow you to install additional star, nebula, and galaxy catalogs. You don’t need them, but they don’t take up too much space and add to the experience of using KStars. Once you’ve completed this, hit _Done_ in the bottom right corner to continue. + +### Getting familiar with KStars + +Now is a good time to play around with the KStars interface. You are greeted with a spherical image with a coordinate plane and stars in the sky. + +![][17] + +This is the desktop planetarium which allows you to view the placement of objects in the night sky. Double-clicking an object selects it, and right clicking on an object gives you options like _Center & Track_ which will follow the object in the planetarium, compensating for [sidereal time][18]. _Show DSS Image_ shows a real [digitized sky survey][19] image of the selected object. + +![][20] + +Another essential feature is the _Set Time_ option in the toolbar. Clicking this will allow you to input a future (or past) time and then simulate the night sky as if that were the current date. + +![The Set Time button][21] + +### Configuring capture equipment with Ekos + +You’re familiar with the KStars layout and some basic functions, so it’s time to move on configuring your equipment using the [Ekos][22] observatory controller and automation tool. To open Ekos, click the observatory button in the toolbar or go to _Tools_ > _Ekos_. + +![The Ekos button on the toolbar][23] + +You will see another setup wizard: the _Ekos Profile Wizard_. Click _Next_ to start the wizard. + +![][24] + +In this tutorial, you have all of our equipment connected directly to your computer. A future article we will cover using an INDI server installed on a remote computer to control our equipment, allowing you to connect over a network and not have to be in the same physical space as your gear. For now though, select _Equipment is attached to this device_. + +![][25] + +You are now asked to name your equipment profile. I usually name mine something like “Local Gear” to differentiate between profiles that are for remote gear, but name your profile what you wish. We will leave the button marked _Internal Guide_ checked and won’t select any additional services. Now click the _Create Profile & Select Devices_ button. + +![][26] + +This next screen is where we can select your particular driver to use for each individual piece of equipment. This part will be specific to your setup depending on what gear you use. For this tutorial, I will select the drivers for my setup. + +My mount, a [SkyWatcher EQM-35 Pro][27], uses the _EQMod Mount_ under _SkyWatcher_ in the menu (this driver is also compatible with all SkyWatcher equatorial mounts, including the [EQ6-R Pro][28] and the [EQ8-R Pro][29]). For my Sony a6000 imaging camera, I choose the _Sony DSLR_ under _DSLRs_ under the CCD category. Under _Guider_, I choose the _QHY CCD_ under _QHY_ for my Orion Starshoot (and any QHY5 series camera). That last driver we want to select will be under the Aux 1 category. We want to select _Astrometry_ from the drop-down window. This will enable the Astrometry plate-solver from within Ekos that will allow our telescope to automatically figure out where in the night sky it is pointed, saving us the time and hassle of doing a one, two, or three star calibration after setting up our mount. + +You selected your drivers. Now it’s time to configure your telescope. Add new telescope profiles by clicking on the + button in the lower right. This is essential for computing field-of-view measurements so you can tell what your images will look like when you open the shutter. Once you click the + button, you will be presented with a form where you can enter the specifications of your telescope and guide scope. For my imaging telescope, I will enter Celestron into the _Vendor_ field, SS-80 into the _Model_ field, I will leave the _Driver_ field as None, _Type_ field as Refractor, _Aperture_ as 80mm, and _Focal Length_ as 400mm. + +![][30] + +After you enter the data, hit the _Save_ button. You will see the data you just entered appear in the left window with an index number of 1 next to it. Now you can go about entering the specs for your guide scope following the steps above. Once you hit save here, the guide scope will also appear in the left window with an index number of 2. Once all of your scopes are entered, close this window. Now select your _Primary_ and _Guide_ telescopes from the drop-down window. + +![][31] + +After all that work, everything should be correctly configured! Click the _Close_ button and complete the final bit of setup. + +### Starting your capture equipment + +This last step before you can start taking images should be easy enough. Click the _Play_ button under Start & Stop Ekos to connect to your equipment. + +![][32] + +You will be greeted with a screen that looks similar to this: + +![][33] + +When you click on the tabs at the top of the screen, they should all show a green dot next to _Connection_, indicating that they are connected to your system. On my setup, the baud rate for my mount (the EQMod Mount tab) is set incorrectly, and so the mount is not connected. + +![][34] + +This is an easy fix; click on the _EQMod Mount_ tab, then the _Connection_ sub-tab, and then change the baud rate from 9600 to 115200. Now is a good time to ensure the serial port under _Ports_ is the correct serial port for your mount. You can check which port the system has mounted your device on by running the command: +``` + +``` + +ls /dev + +``` +| grep USB +``` + +You should see _ttyUSB0_. If there is more than one USB-serial device plugged in at a time, you will see more than one ttyUSB port, with an incrementing following number. To figure out which port is correct. unplug your mount and run the command again. + +Now click on the _Main Control_ sub-tab, click _Connect_ again, and wait for the mount to connect. It might take a few seconds, be patient and it should connect. + +The last thing to do is set the sensor and pixel size parameters for my camera. Under the _Sony DSLR Alpha-A6000 (Control)_ tab, select the _Image Info_ sub-tab. This is where you can enter your sensor specifications; if you don’t know them, a quick search on the internet will bring you your sensor’s maximum resolution as well as pixel pitch. Enter this data into the right-side boxes, then press the _Set_ button to load them into the left boxes and save them into memory. Hit the _Close_ button when you are done. + +![][35] + +### Conclusion + +Your equipment is ready to use. In the next article, you will learn how to capture and process the images. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/astrophotography-with-fedora-astronomy-lab-setting-up/ + +作者:[Geoffrey Marr][a] +选题:[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/coremodule/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/02/astrophotography-setup-2-816x345.jpg +[2]: https://fedoramagazine.org/wp-content/uploads/2020/11/IMG_4151-768x1024.jpg +[3]: https://labs.fedoraproject.org/en/astronomy/ +[4]: https://labs.fedoraproject.org/astronomy/download/index.html +[5]: https://github.com/FedoraQt/MediaWriter +[6]: https://docs.fedoraproject.org/en-US/fedora/f33/install-guide/install/Preparing_for_Installation/#_fedora_media_writer +[7]: https://docs.fedoraproject.org/en-US/fedora/f33/install-guide/install/Booting_the_Installation/ +[8]: https://docs.fedoraproject.org/en-US/fedora/f33/install-guide/install/Installing_Using_Anaconda/#sect-installation-graphical-mode +[9]: https://www.qhyccd.com/html/prepub/log_en.html#!log_en.md +[10]: https://www.indilib.org/download/fedora/category/8-fedora.html +[11]: https://fedoramagazine.org/wp-content/uploads/2020/11/lsusb_output_rpi.png +[12]: https://edu.kde.org/kstars/ +[13]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars_setuo_wizard-2.png +[14]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars_location_select-2.png +[15]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars-download-extra-data-1.png +[16]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars_install_extra_Data-1.png +[17]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars_planetarium-1024x549.png +[18]: https://en.wikipedia.org/wiki/Sidereal_time +[19]: https://en.wikipedia.org/wiki/Digitized_Sky_Survey +[20]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars_right_click_object-1024x576.png +[21]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars_planetarium_clock_icon.png +[22]: https://www.indilib.org/about/ekos.html +[23]: https://fedoramagazine.org/wp-content/uploads/2020/11/open_ekos_icon.png +[24]: https://fedoramagazine.org/wp-content/uploads/2020/11/ekos-profile-wizard.png +[25]: https://fedoramagazine.org/wp-content/uploads/2020/11/ekos_equipment_attached_to_this_device.png +[26]: https://fedoramagazine.org/wp-content/uploads/2020/11/ekos_wizard_local_gear.png +[27]: https://www.skywatcherusa.com/products/eqm-35-mount +[28]: https://www.skywatcherusa.com/products/eq6-r-pro +[29]: https://www.skywatcherusa.com/collections/eq8-r-series-mounts/products/eq8-r-mount-with-pier-tripod +[30]: https://fedoramagazine.org/wp-content/uploads/2020/11/setup_telescope_profiles.png +[31]: https://fedoramagazine.org/wp-content/uploads/2020/11/ekos_setup_aux_1_astrometry-1024x616.png +[32]: https://fedoramagazine.org/wp-content/uploads/2020/11/ekos_start_equip_connect.png +[33]: https://fedoramagazine.org/wp-content/uploads/2020/11/ekos_startup_equipment.png +[34]: https://fedoramagazine.org/wp-content/uploads/2020/11/set_baud_rate_to_115200.png +[35]: https://fedoramagazine.org/wp-content/uploads/2020/11/set_camera_sensor_settings.png From a24e4380a9cb60f1eaa275475712d0f5b1120514 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 6 Feb 2021 05:04:38 +0800 Subject: [PATCH 208/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210205=20?= =?UTF-8?q?Integrate=20devices=20and=20add-ons=20into=20your=20home=20auto?= =?UTF-8?q?mation=20setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210205 Integrate devices and add-ons into your home automation setup.md --- ...add-ons into your home automation setup.md | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 sources/tech/20210205 Integrate devices and add-ons into your home automation setup.md diff --git a/sources/tech/20210205 Integrate devices and add-ons into your home automation setup.md b/sources/tech/20210205 Integrate devices and add-ons into your home automation setup.md new file mode 100644 index 0000000000..d82dcc262e --- /dev/null +++ b/sources/tech/20210205 Integrate devices and add-ons into your home automation setup.md @@ -0,0 +1,190 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Integrate devices and add-ons into your home automation setup) +[#]: via: (https://opensource.com/article/21/2/home-automation-addons) +[#]: author: (Steve Ovens https://opensource.com/users/stratusss) + +Integrate devices and add-ons into your home automation setup +====== +Learn how to set up initial integrations and install add-ons in Home +Assistant in the fifth article in this series. +![Looking at a map][1] + +In the four previous articles in this series about home automation, I have discussed [what Home Assistant is][2], why you may want [local control][3], some of the [communication protocols][4] for smart home components, and how to [install Home Assistant][5] in a virtual machine (VM) using libvirt. In this fifth article, I will talk about configuring some initial integrations and installing some add-ons. + +### Set up initial integrations + +It's time to start getting into some of the fun stuff. The whole reason Home Assistant (HA) exists is to pull together various "smart" devices from different manufacturers. To do so, you have to make Home Assistant aware of which devices it should coordinate. I'll demonstrate by adding a [Sonoff Zigbee Bridge][6]. + +I followed [DigiBlur's Sonoff Guide][7] to replace the stock firmware with the open source firmware [Tasmota][8] to decouple my sensors from the cloud. My [second article][3] in this series explains why you might wish to replace the stock firmware. (I won't go into the device's setup with either the stock or custom firmware, as that is outside of the scope of this tutorial.) + +First, navigate to the **Configuration** menu on the left side of the HA interface, and make sure **Integrations** is selected: + +![Home Assistant integration configuration][9] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +From there, click the **Add Integration** button in the bottom-right corner and search for Zigbee: + +![Add Zigbee integration in Home Assistant][11] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Enter the device manually. If the Zigbee Bridge was physically connected to the Home Assistant interface, you could select the device path. For instance, I have a ZigBee CC2531 USB stick that I use for some Zigbee devices that do not communicate correctly with the Sonoff Bridge. It attaches directly to the Home Assistant host and shows up as a Serial Device. See my [third article][12] for details on wireless standards. However, in this tutorial, we will continue to configure and use the Sonoff Bridge. + +![Enter device manually][13] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +The next step is to choose the radio type, using the information in the DigiBlur tutorial. In this case, the radio is an EZSP radio: + +![Choose the radio type][14] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Finally, you need to know the IP address of the Sonoff Bridge, the port it is listening on, and the speed of the connection. Once I found the Sonoff Bridge's MAC address, I used my DHCP server to ensure that the device always uses the same IP on my network. DigiBlur's guide provides the port and speed numbers. + +![IP, port, and speed numbers][15] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Once you've added the Bridge, you can begin pairing devices to it. Ensure that your devices are in pairing mode. The Bridge will eventually find your device(s). + +![Device pairing][16] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +You can name the device(s) and assign an area (if you set them up). + +![Name device][17] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +The areas displayed will vary based on whether or not you have any configured. Bedroom, Kitchen, and Living Room exist by default. As you add a device, HA will add a new Card to the **Integrations** tab. A Card is a user interface (UI) element that groups information related to a specific entity. The Zigbee card looks like this: + +![Integration card][18] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Later, I'll come back to using this integration. I'll also get into how to use this device in automation flows. But now, I will show you how to add functionality to Home Assistant to make your life easier. + +### Add functionality with add-ons + +Out of the box, HA has some pretty great features for home automation. If you are buying commercial-off-the-shelf (CoTS) products, there is a good chance you can accomplish everything you need without the help of add-ons. However, you may want to investigate some of the add-ons, especially if (like me) you want to make your own sensors. + +There are all kinds of HA add-ons, ranging from Android debugging (ADB) tools to MQTT brokers to the Visual Studio Code editor. With each release, the number of add-ons grows. Some people make HA the center of their local system, encompassing DHCP, Plex, databases, and other useful programs. In fact, HA now ships with a built-in media browser for playing any media that you expose to it. + +I won't go too crazy in this article; I'll show you some of the basics and let you decide how you want to proceed. + +#### Install official add-ons + +Some of the many HA add-ons are available for installation right from the web UI, and others can be installed from alternative sources, such as Git. + +To see what's available, click on the **Supervisor** menu on the left panel. Near the top, you will see a tab called **Add-on store**. + +![Home Assistant add-on store][19] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Below are three of the more useful add-ons that I think should be standard for any HA deployment: + +![Home Assistant official add-ons][20] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +The **File Editor** allows you to manage Home Assistant configuration files directly from your browser. I find this far more convenient for quick edits than obtaining a copy of the file, editing it, and pushing it back to HA. If you use add-ons like the Visual Studio Code editor, you can edit the same files. + +The **Samba share** add-on is an excellent way to extract HA backups from the system or push configuration files or assets to the **web** directory. You should _never_ leave your backups sitting on the machine being backed up. + +Finally, **Mosquitto broker** is my preferred method for managing an [MQTT][21] client. While you can install a broker that's external to the HA machine, I find low value in doing this. Since I am using MQTT just to communicate with my IoT devices, and HA is the primary method of coordinating that communication, there is a low risk in having these components vertically integrated. If HA is offline, the MQTT broker is almost useless in my arrangement. + +#### Install community add-ons + +Home Assistant has a prolific community and passionate developers. In fact, many of the "community" add-ons are developed and maintained by the HA developers themselves. For my needs, I install: + +![Home Assistant community add-ons][22] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +**Grafana** (graphing program) and **InfluxDB** (a time-series database) are largely optional and relate to the ability to customize how you visualize the data HA collects. I like to have historical data handy and enjoy looking at the graphs from time to time. While not exactly HA-related, I have my pfSense firewall/router forward metrics to InfluxDB so that I can make some nice graphs over time. + +![Home Assistant Grafana add-on][23] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +**ESPHome** is definitely an optional add-on that's warranted only if you plan on making your own sensors. + +**NodeRED** is my preferred automation flow-handling solution. Although HA has some built-in automation, I find a visual flow editor is preferable for some of the logic I use in my system. + +#### Configure add-ons + +Some add-ons (such as File Editor) require no configuration to start them. However, most—such as Node-RED—require at least a small amount of configuration. Before you can start Node-RED, you will need to set a password: + +![Home Assistant Node-RED add-on][24] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +**IMPORTANT:** Many people will abstract passwords through the `secrets.yaml` file. This does not provide any additional security other than not having passwords in the add-on configuration's YAML. See [the official documentation][25] for more information. + +In addition to the password requirement, most of the add-ons that have a web UI default to having the `ssl: true` option set. A self-signed cert on my local LAN is not a requirement, so I usually set this to false. There is an add-on for Let's Encrypt, but dealing with certificates is outside the scope of this series. + +After you have looked through the **Configuration** tab, save your changes, and enable Node-RED on the add-on's main screen. + +![Home Assistant Node-RED add-on][26] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Don't forget to start the plugin. + +Most add-ons follow a similar procedure, so you can use this approach to set up other add-ons. + +### Wrapping up + +Whew, that was a lot of screenshots! Fortunately, when you are doing the configuration, the UI makes these steps relatively painless. + +At this point, your HA instance should be installed with some basic configurations and a few essential add-ons. + +In the next article, I will discuss integrating custom Internet of Things (IoT) devices into Home Assistant. Don't worry; the fun is just beginning! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/home-automation-addons + +作者:[Steve Ovens][a] +选题:[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/stratusss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) +[2]: https://opensource.com/article/20/11/home-assistant +[3]: https://opensource.com/article/20/11/cloud-vs-local-home-automation +[4]: https://opensource.com/article/20/11/home-automation-part-3 +[5]: https://opensource.com/article/20/12/home-assistant +[6]: https://sonoff.tech/product/smart-home-security/zbbridge +[7]: https://www.digiblur.com/2020/07/how-to-use-sonoff-zigbee-bridge-with.html +[8]: https://tasmota.github.io/docs/ +[9]: https://opensource.com/sites/default/files/uploads/ha-setup20-configuration-integration.png (Home Assistant integration configuration) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ +[11]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee.png (Add Zigbee integration in Home Assistant) +[12]: https://opensource.com/article/20/11/wireless-protocol-home-automation +[13]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee-2.png (Enter device manually) +[14]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee-3.png (Choose the radio type) +[15]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee-4.png (IP, port, and speed numbers) +[16]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee-5.png (Device pairing) +[17]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee-6.png (Name device) +[18]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee-7_0.png (Integration card) +[19]: https://opensource.com/sites/default/files/uploads/ha-setup7-addons.png (Home Assistant add-on store) +[20]: https://opensource.com/sites/default/files/uploads/ha-setup8-official-addons.png (Home Assistant official add-ons) +[21]: https://en.wikipedia.org/wiki/MQTT +[22]: https://opensource.com/sites/default/files/uploads/ha-setup9-community-addons.png (Home Assistant community add-ons) +[23]: https://opensource.com/sites/default/files/uploads/ha-setup9-community-grafana-pfsense.png (Home Assistant Grafana add-on) +[24]: https://opensource.com/sites/default/files/uploads/ha-setup27-nodered2.png (Home Assistant Node-RED add-on) +[25]: https://www.home-assistant.io/docs/configuration/secrets/ +[26]: https://opensource.com/sites/default/files/uploads/ha-setup26-nodered1.png (Home Assistant Node-RED add-on) From bd1f1bb2590bb276c0fa253cfd27c6e04d9dcf2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sat, 6 Feb 2021 14:37:41 +0800 Subject: [PATCH 209/381] translating by Chao-zhi --- ...at are Easier to Install and Use Than Arch Linux Itself.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md b/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md index 9231d75240..f332898f20 100644 --- a/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md +++ b/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -146,7 +146,7 @@ via: https://itsfoss.com/arch-based-linux-distros/ 作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cf0afbbadf01eb573eaad46781a4904217d4ea03 Mon Sep 17 00:00:00 2001 From: Hilton Chain <26847027+rakino@users.noreply.github.com> Date: Sat, 6 Feb 2021 16:27:54 +0800 Subject: [PATCH 210/381] translating --- sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md b/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md index ac60a02d17..662a093a57 100644 --- a/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md +++ b/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (rakino) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -241,7 +241,7 @@ via: https://fedoramagazine.org/latex-typesetting-part-1/ 作者:[Earl Ramirez][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[rakino](https://github.com/rakino) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c91bb6d7d1124de868042369587d027ef05ee258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sat, 6 Feb 2021 16:38:35 +0800 Subject: [PATCH 211/381] translate done: 20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md --- ... Install and Use Than Arch Linux Itself.md | 201 ------------------ ... Install and Use Than Arch Linux Itself.md | 201 ++++++++++++++++++ 2 files changed, 201 insertions(+), 201 deletions(-) delete mode 100644 sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md create mode 100644 translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md diff --git a/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md b/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md deleted file mode 100644 index f332898f20..0000000000 --- a/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md +++ /dev/null @@ -1,201 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Chao-zhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself) -[#]: via: (https://itsfoss.com/arch-based-linux-distros/) -[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) - -Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself -====== - -In the Linux community, [Arch Linux][1] has a cult following. This lightweight distribution provides the bleeding edge updates with a DIY (do it yourself) attitude. - -However, Arch is also aimed at more experienced users. As such, it is generally considered to be beyond the reach of those who lack the technical expertise (or persistence) required to use it. - -In fact, the very first steps, [installing Arch Linux itself is enough to scare many people off][2]. Unlike most other distributions, Arch Linux doesn’t have an easy to use graphical installer. You have to do disk partitions, connect to internet, mount drives and create file system etc using command line tools only. - -For those who want to experience Arch without the hassle of the complicated installation and set up, there exists a number of user-friendly Arch-based distributions. - -In this article, I’ll show you some of these Arch alternative distributions. These distributions come with graphical installer, graphical package manager and other tools that are easier to use than their command line alternatives. - -### Arch-based Linux distributions that are easier to set up and use - -![][3] - -Please note that this is not a ranking list. The numbers are just for counting purpose. Distribution at number two should not be considered better than distribution at number seven. - -#### 1\. Manjaro Linux - -![][4] - -[Manjaro][5] doesn’t need any introduction. It is one of the most popular Linux distributions for several years and it deserves it. - -Manjaro provides all the benefits of the Arch Linux combined with a focus on user-friendliness and accessibility. Manjaro is suitable for both newcomers and experienced Linux users alike. - -**For newcomers**, a user-friendly installer is provided, and the system itself is designed to work fully ‘straight out of the box’ with your [favourite desktop environment][6] (DE) or window manager. - -**For more experienced users,** Manjaro also offers versatility to suit every personal taste and preference. [Manjaro Architect][7] is giving the option to install any Manjaro flavour and offers unflavoured DE installation, filesystem ([recently introduced ZFS][8]) and bootloader choice for those who wants complete freedom to shape their system. - -Manjaro is also a rolling release cutting-edge distribution. However, unlike Arch, Manjaro tests the updates first and then provides it to its users. Stability also gets importance here. - -#### 2\. ArcoLinux - -![][9] - -[ArcoLinux][10] (previously known as ArchMerge) is a distribution based on Arch Linux. The development team offers three variations. ArcoLinux, ArcoLinuxD and ArcoLinuxB. - -ArcoLinux ****is a full-featured distribution that ships with the [Xfce desktop][11], [Openbox][12] and [i3 window managers][13]. - -**ArcoLinuxD** is a minimal distribution that includes scripts that enable power users to install any desktop and application. - -**ArcoLinuxB** is a project that gives users the power to build custom distributions, while also developing several community editions with pre-configured desktops, such as Awesome, bspwm, Budgie, Cinnamon, Deepin, GNOME, MATE and KDE Plasma. - -ArcoLinux also provides various video tutorials as it places strong focus on learning and acquiring Linux skills. - -#### Archlabs Linux - -![][14] - -[ArchLabs Linux][15] is a lightweight rolling release Linux distribution based on a minimal Arch Linux base with the [Openbox][16] window manager. [ArchLabs][17] is influenced and inspired by the look and feel of [BunsenLabs][18] with the intermediate to advanced user in mind. - -#### Archman Linux - -![][19] - -[Archman][20] is an independent project. Arch Linux distros in general are not ideal operating systems for users with little Linux experience. Considerable background reading is necessary for things to make sense with minimal frustration. Developers of Archman Linux are trying to change that reputation. - -Archman’s development is based on an understanding of development that includes user feedback and experience components. With the past experience of our team, the feedbacks and requests from the users are blended together and the road maps are determined and the build works are done. - -#### EndeavourOS - -![][21] - -When the popular Arch-based distribution [Antergos was discontinued in 2019][22], it left a friendly and extremely helpful community behind. The Antergos project ended because the system was too hard to maintain for the developers. - -Within a matter of days after the announcement, a few experienced users palnned on maintaining the former community by creating a new distribution to fill the void left by Antergos. That’s how [EndeavourOS][23] was born. - -[EndeavourOS][24] is lightweight and ships with a minimum amount of preinstalled apps. An almost blank canvas ready to personalise. - -#### RebornOS - -![][25] - -[RebornOS][26] developers’ goal is to bring the true power of Linux to everyone, with one ISO for 15 desktop environments and full of unlimited opportunities for customization. - -RebornOS also claims to have support for [Anbox][27] for running Android applications on desktop Linux. It also offers a simple kernel manager GUI tool. - -Coupled with [Pacman][28], the [AUR][29], and a customized version of Cnchi graphical installer, Arch Linux is finally available for even the least inexperienced users. - -#### Chakra Linux - -![][30] - -A community-developed GNU/Linux distribution with an emphasis on KDE and Qt technologies. [Chakra Linux][31] does not schedule releases for specific dates but uses a “Half-Rolling release” system. - -This means that the core packages of Chakra Linux are frozen and only updated to fix any security problems. These packages are updated after the latest versions have been thoroughly tested before being moved to permanent repository (about every six months). - -In addition to the official repositories, users can install packages from the Chakra Community Repository (CCR), which provides user made PKGINFOs and [PKGBUILD][32] scripts for software which is not included in the official repositories and is inspired by the Arch User Repository. - -#### Artix Linux - -![Artix Mate Edition][33] - -[Artix Linux][34] is a rolling-release distribution based on Arch Linux that uses [OpenRC][35], [runit][36] or [s6][37] init instead of [systemd][38]. - -Artix Linux has its own package repositories but as a pacman-based distribution, it can use packages from Arch Linux repositories or any other derivative distribution, even packages explicitly depending on systemd. The [Arch User Repository][29] (AUR) can also be used. - -#### BlackArch Linux - -![][39] - -BlackArch is a [penetration testing distribution][40] based on Arch Linux that provides a large amount of cyber security tools. It is specially created for penetration testers and security researchers. The repository contains more than 2400 [hacking and pen-testing tools][41] that can be installed individually or in groups. BlackArch Linux is compatible with existing Arch Linux packages. - -### Want real Arch Linux? Simplify the installation with graphical Arch installer - -If you want to use the actual Arch Linux but you are not comfortable with the difficult installation, fortunately you can download an Arch Linux iso baked with a graphical installer. - -An Arch installer is basically Arch Linux ISO with a relatively easy to use text-based installer. It is much easier than bare-bone Arch installation. - -#### Anarchy Installer - -![][42] - -The [Anarchy installer][43] intends to provide both novice and experienced Linux users a simple and pain free way to install Arch Linux. Install when you want it, where you want it, and however you want it. That is the Anarchy philosophy. - -Once you boot up the installer, you’ll be shown a simple [TUI menu][44], listing all the available installer options. - -#### Zen Installer - -![][45] - -The [Zen Installer][46] provides a full graphical (point and click) environment for installing Arch Linux. It provides support for installing multiple desktop environments, AUR, and all of the power and flexiblity of Arch Linux with the ease of a graphical installer. - -The ISO will boot the live environment, and then download the most current stable version of the installer after you connect to the internet. So, you will always get the newest installer with updated features. - -### Conclusion - -An Arch-based distribution is always an excellent hassle-free choice for the many users, but a graphical installer like Anarchy is at least a step closer to how Arch Linux truly tastes. - -In my opinion the [real beauty of Arch Linux is its installation process][2] and for a Linux enthusiast is an opportunity to learn rather than a hassle. Arch Linux and its derivatives has a lot for you mess up with, but It’s FOSS will unravel the mystery behind the scenes. See you at my next tutorial! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/arch-based-linux-distros/ - -作者:[Dimitrios Savvopoulos][a] -选题:[lujun9972][b] -译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/dimitrios/ -[b]: https://github.com/lujun9972 -[1]: https://www.archlinux.org/ -[2]: https://itsfoss.com/install-arch-linux/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/arch-based-linux-distributions.png?ssl=1 -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/manjaro-20.jpg?ssl=1 -[5]: https://manjaro.org/ -[6]: https://itsfoss.com/best-linux-desktop-environments/ -[7]: https://itsfoss.com/manjaro-architect-review/ -[8]: https://itsfoss.com/manjaro-20-release/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/arcolinux.png?ssl=1 -[10]: https://arcolinux.com/ -[11]: https://www.xfce.org/ -[12]: http://openbox.org/wiki/Main_Page -[13]: https://i3wm.org/ -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/Archlabs.jpg?ssl=1 -[15]: https://itsfoss.com/archlabs-review/ -[16]: https://en.wikipedia.org/wiki/Openbox -[17]: https://archlabslinux.com/ -[18]: https://www.bunsenlabs.org/ -[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/Archman.png?ssl=1 -[20]: https://archman.org/en/ -[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/04_endeavouros_slide.jpg?ssl=1 -[22]: https://itsfoss.com/antergos-linux-discontinued/ -[23]: https://itsfoss.com/endeavouros/ -[24]: https://endeavouros.com/ -[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/RebornOS.png?ssl=1 -[26]: https://rebornos.org/ -[27]: https://anbox.io/ -[28]: https://itsfoss.com/pacman-command/ -[29]: https://itsfoss.com/aur-arch-linux/ -[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/Chakra_Goedel_Screenshot.png?ssl=1 -[31]: https://www.chakralinux.org/ -[32]: https://wiki.archlinux.org/index.php/PKGBUILD -[33]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/Artix_MATE_edition.png?ssl=1 -[34]: https://artixlinux.org/ -[35]: https://en.wikipedia.org/wiki/OpenRC -[36]: https://en.wikipedia.org/wiki/Runit -[37]: https://en.wikipedia.org/wiki/S6_(software) -[38]: https://en.wikipedia.org/wiki/Systemd -[39]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/BlackArch.png?ssl=1 -[40]: https://itsfoss.com/linux-hacking-penetration-testing/ -[41]: https://itsfoss.com/best-kali-linux-tools/ -[42]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/anarchy.jpg?ssl=1 -[43]: https://anarchyinstaller.org/ -[44]: https://en.wikipedia.org/wiki/Text-based_user_interface -[45]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/zen.jpg?ssl=1 -[46]: https://sourceforge.net/projects/revenge-installer/ diff --git a/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md b/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md new file mode 100644 index 0000000000..d8d06a1e79 --- /dev/null +++ b/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md @@ -0,0 +1,201 @@ +[#]: collector: (lujun9972) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself) +[#]: via: (https://itsfoss.com/arch-based-linux-distros/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +最好用的几个基于 Arch 的用户友好型 Linux 发行版,它们比 Arch Linux 更容易安装和使用 +====== + +在 Linux 社区中,[Arch Linux][1] 有一群狂热的追随者。这个轻量级的发行版以 DIY 的态度提供了最前沿的更新。 + +但是,Arch 的目标用户是那些更有经验的用户。因此,它通常被认为是那些技术不够(或耐心不够)的人所无法触及的。 + +事实上,第一步,[安装 Arch Linux 就足以把很多人吓跑 ][2]。与大多数其他发行版不同,Arch Linux 没有一个易于使用的图形安装程序。安装过程中涉及到的磁盘分区,连接到互联网,挂载驱动器和创建文件系统等只用命令行工具来操作。 + +对于那些不想经历复杂的安装和设置的人来说,有许多用户友好的基于 Arch 的发行版。 + +在本文中,我将向您展示一些 Arch 替代发行版。这些发行版附带了图形安装程序、图形包管理器和其他工具,它们比命令行工具更容易使用。 + +### 更容易设置和使用的基于 Arch 的 Linux 发行版 + +![][3] + +请注意,这不是一个排名列表。这些数字只是为了计数的目的。排第二的发行版不应该被认为比排第七的发行版好。 + +#### 1\。Manjaro Linux + +![][4] + +[Manjaro][5] 不需要任何介绍。它是几年来最流行的 Linux 发行版之一,它值得拥有。 + +Manjaro 提供了 Arch Linux 的所有优点,同时注重用户友好性和可访问性。Manjaro 既适合新手,也适合有经验的 Linux 用户。 + +**对于新手**,我们提供了一个用户友好的安装程序,系统本身的设计可以完全“开箱即用”地工作在您[最喜爱的桌面环境 ][6](DE) 或窗口管理器中。 + +**对于更有经验的用户,** Manjaro 还提供多种功能,以满足每个个人的口味和喜好。[Manjaro Architect][7] 提供了安装各种 Manjaro 风格的选项,并为那些想要完全自由地塑造系统的人提供了各种桌面环境、文件系统([最近推出的 ZFS][8]) 和引导程序选择。 + +Manjaro 也是一个滚动发行的前沿发行版。然而,与 Arch 不同的是,Manjaro 首先测试更新,然后将其提供给用户。稳定在这里也很重要。 + +#### 2\。ArcoLinux + +![][9] + +[ArcoLinux][10]( 以前称为 ArchMerge) 是一个基于 Arch Linux 的发行版。开发团队提供了三种变体。ArcoLinux、ArcoLinuxD 和 ArcoLinuxB。 + +ArcoLinux 是一个功能齐全的发行版,附带有 [Xfce desktop][11]、[Openbox][12] 和 [i3 window managers][13]。 + +**ArcoLinuxD** 是一个最小的发行版,包含允许高级用户安装任何桌面和应用程序的脚本。 + +**ArcoLinuxB** 是一个让用户能够构建自定义发行版的项目,同时还开发了几个带有预配置桌面的社区版本,如 Awesome、bspwm、Budgie、Cinnamon、Deepin、GNOME、MATE 和 KDE Plasma。 + +ArcoLinux 还提供了各种视频教程,因为它非常注重学习和获取 Linux 技能。 + +#### 3\。Archlabs Linux + +![][14] + +[ArchLabs Linux][15] 是一个轻量级的滚动版 Linux 发行版,基于最基础的 Arch Linux,带有 [Openbox][16] 窗口管理器。[ArchLabs][17] 在观感设计中受到 [BunsenLabs][18] 的影响和启发,主要考虑到中级到高级用户的需求。 + +#### 4\。Archman Linux + +![][19] + +[Archman][20] 是一个独立的项目。Arch Linux 发行版对于没有多少 Linux 经验的用户来说通常不是理想的操作系统。大量的背景阅读是必要的事情,以尽可能减少挫折感的意义。Archman Linux 的开发人员正试图改变这种评价。 + +Archman 的开发基于对开发的理解,包括用户反馈和体验组件。根据我们团队过去的经验,将用户的反馈和要求融合在一起,确定路线图并完成构建工作。 + +#### 5\。EndeavourOS + +![][21] + +当流行的基于 Arch 的发行版 [Antergos 在 2019 停止 ][22] 时,它留下了一个友好且非常有用的社区。Antergos 项目结束了,因为系统对于开发人员来说太难维护了。 + +在发布后的几天内,一些有经验的用户通过创建一个新的发行版来填补 Antergos 留下的空白,从而维护了以前的社区。这就是 [EndeavourOS][23] 的诞生。 + +[EndeavourOS][24] 是轻量级的,并且附带了最少数量的预装应用程序。一块近乎空白的画布,随时可以个性化。 + +#### 6\。RebornOS + +![][25] + +[RebornOS][26] 开发人员的目标是将 Linux 的真正威力带给每个人,一个 ISO 提供了 15 个桌面环境可供选择,并提供无限的定制机会。 + +RebornOS 还声称支持 [Anbox][27],它可以在桌面 Linux 上运行 Android 应用程序。它还提供了一个简单的内核管理器 GUI 工具。 + +再加上 [Pacman][28],[AUR][29],以及定制版本的 Cnchi 图形安装程序,Arch Linux 终于可以让最没有经验的用户也能够使用了。 + +#### 7\。Chakra Linux + +![][30] + +一个社区开发的 GNU/Linux 发行版,它的亮点在 KDE 和 Qt 技术。[Chakra Linux][31] 不在特定日期安排发布,而是使用“半滚动发布”系统。 + +这意味着 Chakra Linux 的核心包被冻结,只更新以修复任何安全问题。这些软件包是在最新版本经过彻底测试后更新的,然后再转移到永久存储库(大约每六个月更新一次)。 + +除官方存储库外,用户还可以安装 Chakra 社区存储库 (CCR) 的软件包,该库为官方存储库中未包含的软件提供用户制作的 PKGINFOs 和 [PKGBUILD][32] 脚本,这是受 Arch 用户存储库的启发而出现的。 + +#### 8\。Artix Linux + +![Artix Mate Edition][33] + +[Artix Linux][34] 也是一个基于 Arch Linux 的滚动发行版,它使用 [OpenRC][35]、[runit][36] 或 [s6][37] 作为初始化工具而不是 [systemd][38]。 + +Artix Linux 有自己的软件包存储库,但作为一个基于 pacman 的发行版,它可以使用 Arch Linux 存储库或任何其他衍生发行版的软件包,甚至可以使用显式依赖于 systemd 的软件包。也可以使用 [Arch User Repository][29](AUR)。 + +#### 10\。BlackArch Linux + +![][39] + +BlackArch 是一个基于 Arch Linux 的[渗透测试发行版 ][40],它提供了大量的网络安全工具。它是专门为渗透测试人员和安全研究人员创建的。该存储库包含 2400 多个[黑客和渗透测试工具 ][41],可以单独安装,也可以分组安装。BlackArch Linux 兼容现有的 Arch Linux 包。 + +### 想要真正的原版 Arch Linux 吗?可以使用图形化 Arch 安装程序简化安装 + +如果您想使用原版的 Arch Linux,但又被它困难的安装所难倒。幸运的是,您可以下载一个带有图形安装程序的 Arch Linux ISO。 + +Arch 安装程序基本上是 Arch Linux ISO 的一个相对容易使用的基于文本的安装程序。它比原版的 Arch 安装容易得多。 + +#### Anarchy Installer + +![][42] + +[Anarchy installer][43] 打算为新手和有经验的 Linux 用户提供一种简单而无痛苦的方式来安装 ArchLinux。在需要的时候安装,在需要的地方安装,并且以您想要的方式安装。这就是 Anarchy 的哲学。 + +启动安装程序后,将显示一个简单的 [TUI menu][44],列出所有可用的安装程序选项。 + +#### Zen Installer + +![][45] + +[Zen Installer][46] 为安装 Arch Linux 提供了一个完整的图形(点击式)环境。它支持安装多个桌面环境 、AUR 以及 Arch Linux 的所有功能和灵活性,并且易于图形化安装。 + +ISO 将引导实时环境,然后在您连接到 internet 后下载最新稳定版本的安装程序。因此,您将始终获得最新的安装程序和更新的功能。 + +### 总结 + +对于许多用户来说,基于 Arch 的发行版会是一个很好的无障碍选择,但是像 Anarchy 这样的图形化安装程序至少离原版的 Arch Linux 更近了一步。 + +在我看来,[Arch Linux 的真正魅力在于它的安装过程 ][2] 对于 Linux 爱好者来说,这是一个学习的机会,而不是麻烦。Arch Linux 及其衍生产品有很多东西需要你去折腾,但是在折腾的过程中你就会进入到开源软件的世界,这里是神奇的新世界。下次上课见! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/arch-based-linux-distros/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://www.archlinux.org/ +[2]: https://itsfoss.com/install-arch-linux/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/arch-based-linux-distributions.png?ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/manjaro-20.jpg?ssl=1 +[5]: https://manjaro.org/ +[6]: https://itsfoss.com/best-linux-desktop-environments/ +[7]: https://itsfoss.com/manjaro-architect-review/ +[8]: https://itsfoss.com/manjaro-20-release/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/arcolinux.png?ssl=1 +[10]: https://arcolinux.com/ +[11]: https://www.xfce.org/ +[12]: http://openbox.org/wiki/Main_Page +[13]: https://i3wm.org/ +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/Archlabs.jpg?ssl=1 +[15]: https://itsfoss.com/archlabs-review/ +[16]: https://en.wikipedia.org/wiki/Openbox +[17]: https://archlabslinux.com/ +[18]: https://www.bunsenlabs.org/ +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/Archman.png?ssl=1 +[20]: https://archman.org/en/ +[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/04_endeavouros_slide.jpg?ssl=1 +[22]: https://itsfoss.com/antergos-linux-discontinued/ +[23]: https://itsfoss.com/endeavouros/ +[24]: https://endeavouros.com/ +[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/RebornOS.png?ssl=1 +[26]: https://rebornos.org/ +[27]: https://anbox.io/ +[28]: https://itsfoss.com/pacman-command/ +[29]: https://itsfoss.com/aur-arch-linux/ +[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/Chakra_Goedel_Screenshot.png?ssl=1 +[31]: https://www.chakralinux.org/ +[32]: https://wiki.archlinux.org/index.php/PKGBUILD +[33]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/Artix_MATE_edition.png?ssl=1 +[34]: https://artixlinux.org/ +[35]: https://en.wikipedia.org/wiki/OpenRC +[36]: https://en.wikipedia.org/wiki/Runit +[37]: https://en.wikipedia.org/wiki/S6_(software) +[38]: https://en.wikipedia.org/wiki/Systemd +[39]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/BlackArch.png?ssl=1 +[40]: https://itsfoss.com/linux-hacking-penetration-testing/ +[41]: https://itsfoss.com/best-kali-linux-tools/ +[42]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/anarchy.jpg?ssl=1 +[43]: https://anarchyinstaller.org/ +[44]: https://en.wikipedia.org/wiki/Text-based_user_interface +[45]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/zen.jpg?ssl=1 +[46]: https://sourceforge.net/projects/revenge-installer/ From ddf71cb14e34a53232255e20ab5342117b1b5af2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 6 Feb 2021 23:10:47 +0800 Subject: [PATCH 212/381] PRF @amwps290 --- ...scripts to make image processing faster.md | 139 +++++++----------- 1 file changed, 51 insertions(+), 88 deletions(-) diff --git a/translated/tech/20210126 Write GIMP scripts to make image processing faster.md b/translated/tech/20210126 Write GIMP scripts to make image processing faster.md index 72007740eb..995ad6f5de 100644 --- a/translated/tech/20210126 Write GIMP scripts to make image processing faster.md +++ b/translated/tech/20210126 Write GIMP scripts to make image processing faster.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (amwps290) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Write GIMP scripts to make image processing faster) @@ -9,116 +9,104 @@ 编写 GIMP 脚本使图像处理更快 ====== -通过向一批图像添加效果来学习 GIMP 的脚本语言 Script-Fu。 -![Painting art on a computer screen][1] +> 通过向一批图像添加效果来学习 GIMP 的脚本语言 Script-Fu。 -前一段时间,我想给方程图片加一个黑板式的外观。 我开始使用 [GNU Image Manipulation Program (GIMP)][2] 来处理,并对结果感到满意。 问题是我必须对图像执行几个操作,当我想再次使用此样式,不想对所有图像重复这些步骤。 此外,我确信我会很快忘记他们。 +![](https://img.linux.net.cn/data/attachment/album/202102/06/231011c0xhvxitxjv899qv.jpg) + +前一段时间,我想给方程图片加一个黑板式的外观。我开始是使用 [GIMP][2] 来处理的,我对结果很满意。问题是我必须对图像执行几个操作,当我想再次使用此样式,不想对所有图像重复这些步骤。此外,我确信我会很快忘记这些步骤。 ![Fourier transform equations][3] -傅立叶变换方程式(Cristiano Fontana,[CC BY-SA 4.0] [4]) +*傅立叶变换方程式(Cristiano Fontana,[CC BY-SA 4.0] [4])* -GIMP 是一个很棒的开源图像编辑器。 尽管我已经使用了多年,但从未研究过其批处理功能或 [Script-Fu][5] 菜单。 这是探索它们的绝好机会。 +GIMP 是一个很棒的开源图像编辑器。尽管我已经使用了多年,但从未研究过其批处理功能或 [Script-Fu][5] 菜单。这是探索它们的绝好机会。 ### 什么是 Script-Fu? -[Script-Fu][6] 是 GIMP 内置的脚本语言。 是一种基于 [Scheme ][7]的编程语言。 如果您从未使用过 Scheme,请尝试一下,因为它可能非常有用。 我认为 Script-Fu 是一个很好的入门方法,因为它对图像处理具有立竿见影的效果,因此您可以非常快速地提高工作效率。 您也可以使用 [Python][8] 编写脚本,但是 Script-Fu 是默认选项。 - -为了帮助您熟悉 Scheme,GIMP 的文档提供了深入的[教程][9]。 Scheme 是一种类似于 [Lisp][10] 的语言,因此主要特征是它使用[前缀][11]表示法和[许多括号][12]。 通过为操作数和操作符添加前缀来将它们应用到操作数列表: +[Script-Fu][6] 是 GIMP 内置的脚本语言。是一种基于 [Scheme][7] 的编程语言。如果你从未使用过 Scheme,请尝试一下,因为它可能非常有用。我认为 Script-Fu 是一个很好的入门方法,因为它对图像处理具有立竿见影的效果,所以你可以很快感觉到自己的工作效率的提高。你也可以使用 [Python][8] 编写脚本,但是 Script-Fu 是默认选项。 +为了帮助你熟悉 Scheme,GIMP 的文档提供了深入的 [教程][9]。Scheme 是一种类似于 [Lisp][10] 的语言,因此它的主要特征是使用 [前缀][11] 表示法和 [许多括号][12]。函数和运算符通过前缀应用到操作数列表中: ``` -(function-name operand operand ...) +(函数名 操作数 操作数 ...) (+ 2 3) -↳ Returns 5 +↳ 返回 5 (list 1 2 3 5) -↳ Returns a list containing 1, 2, 3, and 5 +↳ 返回一个列表,包含 1、 2、 3 和 5 ``` -我花了一些时间才能找到 GIMP 功能完整列表的文档,但实际上很简单。 在 **Help** 菜单中,有一个 **Procedure Browser**,其中包含有关所有可能功能的非常详尽的文档。 +我花了一些时间才找到完整的 GIMP 函数列表文档,但实际上很简单。在 **Help** 菜单中,有一个 **Procedure Browser**,其中包含所有可用的函数的丰富详尽文档。 ![GIMP Procedure Browser][13] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - ### 使用 GIMP 的批处理模式 -您可以使用 `-b` 选项以批处理的方式启动 GIMP. `-b` 选项的参数可以是你想要运行的脚本,或者用一个 `-` 来让 GIMP 进入交互模式而不是命令行模式。正常情况下,当你启动 GIMP 的时候,它会启动图形界面,但是你可以使用 `-i` 选项来禁用它。 +你可以使用 `-b` 选项以批处理的方式启动 GIMP。`-b` 选项的参数可以是你想要运行的脚本,或者用一个 `-` 来让 GIMP 进入交互模式而不是命令行模式。正常情况下,当你启动 GIMP 的时候,它会启动图形界面,但是你可以使用 `-i` 选项来禁用它。 ### 开始编写你的第一个脚本 -创建一个名为 `chalk.scm` 的文件,并把它保存在 **Preferences** 窗口中 **Folders** 选项下的 **Script** 中指定的 `script` 文件夹下。就我而言,是在 `$HOME/.config/GIMP/2.10/scripts`. +创建一个名为 `chalk.scm` 的文件,并把它保存在 **Preferences** 窗口中 **Folders** 选项下的 **Script** 中指定的 `script` 文件夹下。就我而言,是在 `$HOME/.config/GIMP/2.10/scripts`。 在 `chalk.scm` 文件中,写入下面的内容: - ``` (define (chalk filename grow-pixels spread-amount percentage) -   (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) -          (drawable (car (gimp-image-get-active-layer image))) -          (new-filename (string-append "modified_" filename))) -     (gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0)) -     (gimp-selection-grow image grow-pixels) -     (gimp-context-set- '(0 0 0)) -     (gimp-edit-bucket-fill drawable BUCKET-FILL-FG LAYER-MODE-NORMAL 100 255 TRUE 0 0) -     (gimp-selection-none image) -     (plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount) -     (gimp-drawable-invert drawable TRUE) -     (plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0) -     (gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename) -     (gimp-image-delete image))) + (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) + (drawable (car (gimp-image-get-active-layer image))) + (new-filename (string-append "modified_" filename))) + (gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0)) + (gimp-selection-grow image grow-pixels) + (gimp-context-set-foreground '(0 0 0)) + (gimp-edit-bucket-fill drawable BUCKET-FILL-FG LAYER-MODE-NORMAL 100 255 TRUE 0 0) + (gimp-selection-none image) + (plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount) + (gimp-drawable-invert drawable TRUE) + (plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0) + (gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename) + (gimp-image-delete image))) ``` ### 定义脚本变量 -在脚本中, `(define (chalk filename grow-pixels spread-amound percentage) ...)` 函数定义了一个名叫 `chalk` 的新函数。它的函数参数是 `filename`, `grow-pixels`, `spread-amound` 和 `percentage`. 在 `define` 中的所有内容都是 `chalk` 函数的主体。你可能已经注意到,那些名字比较长的变量中间都有一个破折号来分割。这是类 Lisp 语言的惯用风格。 +在脚本中, `(define (chalk filename grow-pixels spread-amound percentage) ...)` 函数定义了一个名叫 `chalk` 的新函数。它的函数参数是 `filename`、`grow-pixels`、`spread-amound` 和 `percentage`。在 `define` 中的所有内容都是 `chalk` 函数的主体。你可能已经注意到,那些名字比较长的变量中间都有一个破折号来分割。这是类 Lisp 语言的惯用风格。 -`(let* ...)` 函数是一个特殊的函数可以让你定义一些只有在这个函数体中才有效的临时变量。临时变量有 `image`, `drawable`, 以及 `new-filename`. 它使用 `gimp-file-load` 来载入图片,这会返回它所包含的图片的一个列表。并通过 `car` 函数来选取第一项。 然后,它选择第一个活动层并将其引用存储在 `drawable` 变量中。 最后,它定义了包含图像新文件名的字符串。 - -为了帮助您更好地了解该过程,我将对其进行分解。 首先,启动带 GUI 的 GIMP,然后你可以通过依次点击 **Filters → Script-Fu → Console** 来打开 Script-Fu 控制台。 在这种情况下,不能使用 `let *`,因为变量必须是持久的。 使用 `define` 函数定义 `image` 变量,并为其提供查找图像的正确路径: +`(let* ...)` 函数是一个特殊过程procedure,可以让你定义一些只有在这个函数体中才有效的临时变量。临时变量有 `image`、`drawable` 以及 `new-filename`。它使用 `gimp-file-load` 来载入图片,这会返回它所包含的图片的一个列表。并通过 `car` 函数来选取第一项。然后,它选择第一个活动层并将其引用存储在 `drawable` 变量中。最后,它定义了包含图像新文件名的字符串。 +为了帮助你更好地了解该过程,我将对其进行分解。首先,启动带 GUI 的 GIMP,然后你可以通过依次点击 **Filters → Script-Fu → Console** 来打开 Script-Fu 控制台。 在这种情况下,不能使用 `let *`,因为变量必须是持久的。使用 `define` 函数定义 `image` 变量,并为其提供查找图像的正确路径: ``` -`(define image (car (gimp-file-load RUN-NONINTERACTIVE "Fourier.png" "Fourier.png")))` +(define image (car (gimp-file-load RUN-NONINTERACTIVE "Fourier.png" "Fourier.png"))) ``` -似乎在 GUI 中什么也没有发生,但是图像已加载。 您需要通过以下方式来让图像显示: - +似乎在 GUI 中什么也没有发生,但是图像已加载。 你需要通过以下方式来让图像显示: ``` -`(gimp-display-new image)` +(gimp-display-new image) ``` ![GUI with the displayed image][14] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 现在,获取活动层并将其存储在 `drawable` 变量中: - ``` -`(define drawable (car (gimp-image-get-active-layer image)))` +(define drawable (car (gimp-image-get-active-layer image))) ``` 最后,定义图像的新文件名: - ``` -`(define new-filename "modified_Fourier.png")` +(define new-filename "modified_Fourier.png") ``` -运行命令后,您将在 Script-Fu 控制台中看到以下内容: +运行命令后,你将在 Script-Fu 控制台中看到以下内容: ![Script-Fu console][15] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 在对图像执行操作之前,需要定义将在脚本中作为函数参数的变量: - ``` (define grow-pixels 2) (define spread-amount 4) @@ -127,31 +115,24 @@ GIMP 是一个很棒的开源图像编辑器。 尽管我已经使用了多年 ### 处理图片 -现在,所有相关变量都已定义,您可以对图像进行操作了。 脚本的操作可以直接在控制台上执行。第一步是在活动层上选择黑色。 颜色被写成一个由三个数字组成的列表,即 `(list 0 0 0)` 或者是 `'(0 0 0)`: - +现在,所有相关变量都已定义,你可以对图像进行操作了。 脚本的操作可以直接在控制台上执行。第一步是在活动层上选择黑色。颜色被写成一个由三个数字组成的列表,即 `(list 0 0 0)` 或者是 `'(0 0 0)`: ``` -`(gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0))` +(gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0)) ``` ![Image with the selected color][16] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 扩大选取两个像素: - ``` -`(gimp-selection-grow image grow-pixels)` +(gimp-selection-grow image grow-pixels) ``` ![Image with the selected color][17] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 将前景色设置为黑色,并用它填充选区: - ``` (gimp-context-set-foreground '(0 0 0)) (gimp-edit-bucket-fill drawable BUCKET-FILL-FG LAYER-MODE-NORMAL 100 255 TRUE 0 0) @@ -159,79 +140,61 @@ GIMP 是一个很棒的开源图像编辑器。 尽管我已经使用了多年 ![Image with the selection filled with black][18] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 删除选区: - ``` -`(gimp-selection-none image)` +(gimp-selection-none image) ``` ![Image with no selection][19] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 随机移动像素: - ``` -`(plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount)` +(plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount) ``` ![Image with pixels moved around][20] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 反转图像颜色: - ``` -`(gimp-drawable-invert drawable TRUE)` +(gimp-drawable-invert drawable TRUE) ``` ![Image with pixels moved around][21] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 随机化像素: - ``` -`(plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0)` +(plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0) ``` ![Image with pixels moved around][22] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 将图像保存到新文件: - ``` -`(gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename)` +(gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename) ``` ![Equations of the Fourier transform and its inverse][23] -傅立叶变换方程 (Cristiano Fontana, [CC BY-SA 4.0][4]) +*傅立叶变换方程 (Cristiano Fontana, [CC BY-SA 4.0][4])* ### 以批处理模式运行脚本 -现在您知道了脚本的功能,可以在批处理模式下运行它: - +现在你知道了脚本的功能,可以在批处理模式下运行它: ``` -`gimp -i -b '(chalk "Fourier.png" 2 4 3)' -b '(gimp-quit 0)'` +gimp -i -b '(chalk "Fourier.png" 2 4 3)' -b '(gimp-quit 0)' ``` -在运行 `chalk` 函数之后,它将使用 `-b` 选项调用第二个函数 `gimp-quit` 来告诉 GIMP 退出。 +在运行 `chalk` 函数之后,它将使用 `-b` 选项调用第二个函数 `gimp-quit` 来告诉 GIMP 退出。 ### 了解更多 -本教程向您展示了如何开始使用 GIMP 的内置脚本功能,并介绍了 GIMP 的 Scheme 实现的 Script-Fu。 如果您想继续前进,建议您查看官方文档及其[入门教程][9]。 如果您不熟悉 Scheme 或 Lisp,那么一开始的语法可能有点吓人,但我还是建议您尝试一下。 这可能是一个不错的惊喜。 - -Photoshop 之类的专业设计软件非常棒,但价格也很昂贵。 你会怎么做... +本教程向你展示了如何开始使用 GIMP 的内置脚本功能,并介绍了 GIMP 的 Scheme 实现:Script-Fu。如果你想继续前进,建议你查看官方文档及其[入门教程][9]。如果你不熟悉 Scheme 或 Lisp,那么一开始的语法可能有点吓人,但我还是建议你尝试一下。这可能是一个不错的惊喜。 -------------------------------------------------------------------------------- @@ -240,7 +203,7 @@ via: https://opensource.com/article/21/1/gimp-scripting 作者:[Cristiano L. Fontana][a] 选题:[lujun9972][b] 译者:[amwps290](https://github.com/amwps290) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ba6c90b36961736f6c65855ef24fac8fce5d9eb7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 6 Feb 2021 23:11:43 +0800 Subject: [PATCH 213/381] PUB @amwps290 https://linux.cn/article-13093-1.html --- ...0126 Write GIMP scripts to make image processing faster.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210126 Write GIMP scripts to make image processing faster.md (99%) diff --git a/translated/tech/20210126 Write GIMP scripts to make image processing faster.md b/published/20210126 Write GIMP scripts to make image processing faster.md similarity index 99% rename from translated/tech/20210126 Write GIMP scripts to make image processing faster.md rename to published/20210126 Write GIMP scripts to make image processing faster.md index 995ad6f5de..4caa8357ff 100644 --- a/translated/tech/20210126 Write GIMP scripts to make image processing faster.md +++ b/published/20210126 Write GIMP scripts to make image processing faster.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (amwps290) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13093-1.html) [#]: subject: (Write GIMP scripts to make image processing faster) [#]: via: (https://opensource.com/article/21/1/gimp-scripting) [#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) From f0d7796c6f6d22b4104a68d55574ecb0e19c338f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 6 Feb 2021 23:59:06 +0800 Subject: [PATCH 214/381] PRF&PUB @geekpi https://linux.cn/article-13094-1.html --- ...ips for preventing notification fatigue.md | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) rename {translated/tech => published}/20210128 4 tips for preventing notification fatigue.md (69%) diff --git a/translated/tech/20210128 4 tips for preventing notification fatigue.md b/published/20210128 4 tips for preventing notification fatigue.md similarity index 69% rename from translated/tech/20210128 4 tips for preventing notification fatigue.md rename to published/20210128 4 tips for preventing notification fatigue.md index e63eeda8d2..843364bb91 100644 --- a/translated/tech/20210128 4 tips for preventing notification fatigue.md +++ b/published/20210128 4 tips for preventing notification fatigue.md @@ -1,16 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13094-1.html) [#]: subject: (4 tips for preventing notification fatigue) [#]: via: (https://opensource.com/article/21/1/alert-fatigue) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) 防止通知疲劳的 4 个技巧 ====== -不要让提醒淹没自己:设置重要的提醒,让其他提醒消失。 你会感觉更好,工作效率更高。 -![Working on a team, busy worklife][1] + +> 不要让提醒淹没自己:设置重要的提醒,让其它提醒消失。你会感觉更好,工作效率更高。 + +![W】(https://img.linux.net.cn/data/attachment/album/202102/06/234924mo3okotjlv7lo3yo.jpg) 在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第十八天。 @@ -18,9 +20,9 @@ ![Text box offering to send notifications][2] -NOPE(Kevin Sonney, [CC BY-SA 4.0][3]) +*NOPE(Kevin Sonney, [CC BY-SA 4.0][3])* -如此多的应用、网站和服务想要提醒我们每一件小事,以至于我们很容易就把它们全部调出来。而且,如果我们不这样做,我们将开始遭受**提醒疲劳**的困扰,这时我们处于边缘的状态,只是等待下一个提醒,并生活在恐惧之中。 +如此多的应用、网站和服务想要提醒我们每一件小事,我们很容易就把它们全部调出来。而且,如果我们不这样做,我们将开始遭受**提醒疲劳**的困扰 —— 这时我们处于边缘的状态,只是等待下一个提醒,并生活在恐惧之中。 提醒疲劳在那些因工作而被随叫随到的人中非常常见。它也发生在那些 **FOMO** (错失恐惧症)的人身上,从而对每一个关键词、标签或在社交媒体上提到他们感兴趣的事情都会设置提醒。 @@ -28,31 +30,28 @@ NOPE(Kevin Sonney, [CC BY-SA 4.0][3]) ![Alert for a task][4] -我可以忽略这个,对吧?(Kevin Sonney, [CC BY-SA 4.0][3]) +*我可以忽略这个,对吧?(Kevin Sonney, [CC BY-SA 4.0][3])* 1. 弄清楚什么更适合你:视觉提醒或声音提醒。我使用视觉弹出和声音的组合,但这对我是有效的。有些人需要触觉提醒。比如手机或手表的震动。找到适合你的那一种。 - 2. 为重要的提醒指定独特的音调或视觉效果。我有一个朋友,他的工作页面有最响亮、最讨厌的铃声。这个_设计_是为了吸引他的注意力,让他看到提醒。我的显示器上有一盏灯,当我在待命时收到工作提醒时,它就会闪烁红灯,以及发送通知到我手机上。 - 3. 关掉那些其实不重要的警报。社交网络、网站和应用都希望得到你的关注。他们不会在意你是否错过会议、约会迟到,或者熬夜到凌晨4点厄运滚动。关掉那些不重要的,让那些重要的可以被看到。 + 2. 为重要的提醒指定独特的音调或视觉效果。我有一个朋友,他的工作页面的铃声最响亮、最讨厌。这旨在吸引他的注意力,让他看到提醒。我的显示器上有一盏灯,当我在待命时收到工作提醒时,它就会闪烁红灯,以及发送通知到我手机上。 + 3. 关掉那些实际上无关紧要的警报。社交网络、网站和应用都希望得到你的关注。它们不会在意你是否错过会议、约会迟到,或者熬夜到凌晨 4 点。关掉那些不重要的,让那些重要的可以被看到。 4. 每隔一段时间就改变一下。上个月有效的东西,下个月可能就不行了。我们会适应、习惯一些东西,然后我们会忽略。如果有些东西不奏效,就换个东西试试吧!它不会伤害你,即使无法解决问题,也许你也会学到一些新知识。 - ![Blue alert indicators light][5] -蓝色是没问题。红色是有问题。(Kevin Sonney, [CC BY-SA 4.0][3]) +*蓝色是没问题。红色是有问题。(Kevin Sonney, [CC BY-SA 4.0][3])* ### 开源和选择 -一个好的应用为通知提供了很多选择。我最喜欢的一个是 Android 的 Etar 日历应用。[Etar 可以从开源 F-droid 仓库中获得][6]。 +一个好的应用可以通知提供很多选择。我最喜欢的一个是 Android 的 Etar 日历应用。[Etar 可以从开源 F-droid 仓库中获得][6]。 -Etar 和许多开源应用一样,为你提供了所有的选项,尤其是通知设置。 +Etar 和许多开源应用一样,为你提供了很多选项,尤其是通知设置。 ![Etar][7] -(Seth Kenlon, [CC BY-SA 4.0][3]) - 通过 Etar,你可以激活或停用弹出式通知,设置打盹时间、打盹延迟、是否提醒你已拒绝的事件等。结合有计划的日程安排策略,你可以通过控制数字助手对你需要做的事情进行提示的频率来改变你一天的进程。 -提醒和警报真的很有用,只要我们收到重要的提醒并予以注意即可。这可能需要一些实验,但最终,少一些噪音是好事,而且更容易注意到真正需要我们注意的提醒。 +提醒和警报真的很有用,只要我们收到重要的提醒并予以注意即可。这可能需要做一些实验,但最终,少一些噪音是好事,而且更容易注意到真正需要我们注意的提醒。 -------------------------------------------------------------------------------- @@ -61,7 +60,7 @@ via: https://opensource.com/article/21/1/alert-fatigue 作者:[Kevin Sonney][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 576e508aff7d452bcc82955b989a27d5a12d6e63 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 7 Feb 2021 09:38:03 +0800 Subject: [PATCH 215/381] translated --- ...rce, Raw Image Editor for Linux Desktop.md | 83 ------------------- ...rce, Raw Image Editor for Linux Desktop.md | 83 +++++++++++++++++++ 2 files changed, 83 insertions(+), 83 deletions(-) delete mode 100644 sources/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md create mode 100644 translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md diff --git a/sources/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md b/sources/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md deleted file mode 100644 index 808b68e214..0000000000 --- a/sources/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md +++ /dev/null @@ -1,83 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop) -[#]: via: (https://itsfoss.com/filmulator/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop -====== - -_**Brief: Filmulator is an open source raw photo editing application with library management focusing on simplicity, ease of use and streamlined workflow.**_ - -### Filmulator: Raw Image Editor for Linux (and Windows) - -There are a [bunch of raw photo editors for Linux][1]. [Filmulator][2] is one of them. Filmulator aims to make raw image editing simple by giving only the essential elements. It also adds the feature of library handling which is a plus if you are looking for a decent application for your camera images. - -For those unaware, [raw image file][3] is a minimally processed, uncompressed file. In other words, it is untouched digital file with no compression and minimal processing applied to it. Professional photographers prefer to capture photos in raw file and process it themselves. Normal people take photos from their smartphones and it is usually compressed in JPEG format or filtered. - -Let’s see what features you get in the Filmulator editor. - -### Features of Filmulator - -![Filmulator interface][4] - -Filmulator claims that it is not the typical “film effect filter” that merely copies the outward characteristics of film. Instead, Filmulator gets to the root of what makes film so appealing: the development process. - -It simulates film development process: from “exposure” of film, to the growth of “silver crystals” within each pixel, to the diffusion of “developer” both between neighboring pixels and with the bulk developer in the tank. - -Fimulator developer says that the simulation brings about the following benefits: - - * Large bright regions become darker, compressing the output dynamic range. - * Small bright regions make their surroundings darker, enhancing local contrast. - * In bright regions, saturation is enhanced, helping retain color in blue skies, brighter skin tones, and sunsets. - * In extremely saturated regions, the brightness is attenuated, helping retain detail e.g. in flowers. - - - -Here’s a comparison of a raw image processed by Filmulator to enhance colors in a natural manner without inducing color clipping. - -![][5] - -### Installing Filmulator on Ubuntu/Linux - -There is an AppImage available for Filmulator so that you can use it easily on Linux. [Using AppImage files][6] is really simple. You download it, make it executable and make it run by double-clicking on it. - -[Download Filmulator for Linux][7] - -There is also a Windows version available for Windows users. Apart from that, you can always head over to [its GitHub repository][8] and peek into its source code. - -There is a [little documentation][9] to help you get started with Fimulator. - -### Conclusion - -Fimulator’s design ideology is to have the best tool for any job, and only that one tool. This means compromising flexibility, but gaining a greatly simplified and streamlined user interface. - -I am not even an amateur photographer, let alone be a professional one. I do not own a DSLR or other high-end photography equipments. For this reason, I cannot test and share my experience on the usefulness of Filmulator. - -If you have more experience dealing with raw images, I let you try Filmulator and share your opinion on it. There is an AppImage available so you can quickly test it and see if it fits your needs or not. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/filmulator/ - -作者:[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/raw-image-tools-linux/ -[2]: https://filmulator.org/ -[3]: https://www.findingtheuniverse.com/what-is-raw-in-photography/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/Filmulate.jpg?resize=799%2C463&ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/image-without-filmulator.jpeg?ssl=1 -[6]: https://itsfoss.com/use-appimage-linux/ -[7]: https://filmulator.org/download/ -[8]: https://github.com/CarVac/filmulator-gui -[9]: https://github.com/CarVac/filmulator-gui/wiki diff --git a/translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md b/translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md new file mode 100644 index 0000000000..6eb5f0f6e4 --- /dev/null +++ b/translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop) +[#]: via: (https://itsfoss.com/filmulator/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Filmulator 是一个简单的、开源的用于 Linux 桌面的 Raw 图像编辑器 +====== + +_**简介:Filmulator 是一个开源的具有库管理功能的 Raw 照片编辑应用,侧重于简单、易用和简化的工作流程。**_ + +### Filmulator:适用于 Linux(和 Windows)的 Raw 图像编辑器 + +[Linux 中有一堆 raw 照片编辑器][1]。[Filmulator][2] 就是其中之一。Filmulator 的目标是仅提供基本要素,从而使原始图像编辑变得简单。它还增加了库处理的功能,如果你正在为你的相机图像寻找一个不错的应用,这是一个加分项。 + +对于那些不知道 raw 的人来说,[raw 图像文件][3]是一个最小化处理,未压缩的文件。换句话说,它是未经压缩的数字文件,且有最小化的处理。专业摄影师更喜欢用 raw 文件拍摄照片,并自行处理。普通人从智能手机拍摄照片,它通常被压缩为 JPEG 格式或被过滤。 + +让我们来看看在 Filmulator 编辑器中会有什么功能。 + +### Filmulator 的功能 + +![Filmulator interface][4] + +Filmulator 宣称,它不是典型的“胶片效果滤镜”,这只是复制了胶片的外在特征。相反,Filmulator 从根本上解决了胶片的魅力所在:显影过程。 + +它模拟了胶片的显影过程:从胶片的“曝光”,到每个像素内“银晶”的生长,再到“显影剂”在相邻像素之间与储槽中大量显影剂的扩散。 + +Fimulator 开发者表示,这种模拟带来了以下好处: + + * 大的明亮区域变得更暗,压缩了输出动态范围。 + * 小的明亮区域使周围环境变暗,增强局部对比度。 + * 在明亮区域,饱和度得到增强,有助于保留蓝天、明亮肤色和日落的色彩。 + * 在极度饱和的区域,亮度会被减弱,有助于保留细节,例如花朵。 + + + +以下是经 Filmulator 处理后的 raw 图像的对比,以自然的方式增强色彩,而不会引起色彩剪切。 + +![][5] + +### 在 Ubuntu/Linux 上安装 Filmulator + +Filmulator 有一个 AppImage 可用,这样你就可以在 Linux 上轻松使用它。使用 [AppImage 文件][6]真的很简单。下载后,使它可执行,然后双击运行。 + +[Download Filmulator for Linux][7] + +对 Windows 用户也有一个 Windows 版本。除此之外,你还可以随时前往[它的 GitHub 仓库][8]查看它的源代码。 + +有一份[小文档][9]来帮助你开始使用 Fimulator。 + +### 总结 + +Fimulator 的设计理念是为任何工作提供最好的工具,而且只有这一个工具。这意味着牺牲了灵活性,但获得了一个大大简化和精简的用户界面。 + +我甚至不是一个业余的摄影师,更别说是一个专业的摄影师了。我没有单反或其他高端摄影设备。因此,我无法测试和分享我对 Filmulator 的实用性的经验。 + +如果你有更多处理 raw 图像的经验,请尝试下 Filmulator,并分享你的意见。有一个 AppImage 可以让你快速测试它,看看它是否适合你的需求。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/filmulator/ + +作者:[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/raw-image-tools-linux/ +[2]: https://filmulator.org/ +[3]: https://www.findingtheuniverse.com/what-is-raw-in-photography/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/Filmulate.jpg?resize=799%2C463&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/image-without-filmulator.jpeg?ssl=1 +[6]: https://itsfoss.com/use-appimage-linux/ +[7]: https://filmulator.org/download/ +[8]: https://github.com/CarVac/filmulator-gui +[9]: https://github.com/CarVac/filmulator-gui/wiki \ No newline at end of file From d3978ac4fdbb5582f0a2893d8dfeda3f8a4de2e1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 7 Feb 2021 09:47:31 +0800 Subject: [PATCH 216/381] translating --- ...210127 Why I use the D programming language for scripting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210127 Why I use the D programming language for scripting.md b/sources/tech/20210127 Why I use the D programming language for scripting.md index ab63de404e..b3728050fa 100644 --- a/sources/tech/20210127 Why I use the D programming language for scripting.md +++ b/sources/tech/20210127 Why I use the D programming language for scripting.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 59c857953a1a44a4b0f80f1bd62914907e2a4768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sun, 7 Feb 2021 10:38:43 +0800 Subject: [PATCH 217/381] translating by Chao-zhi --- ...s to Fill the Void Left by Antergos in Arch Linux World.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md b/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md index b993c4d1dc..24482ad026 100644 --- a/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md +++ b/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -76,7 +76,7 @@ via: https://itsfoss.com/endeavouros/ 作者:[John Paul][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 937133405b955f7ca20a22c6d9eaff016d5eae11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sun, 7 Feb 2021 11:44:17 +0800 Subject: [PATCH 218/381] translate done: 20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md --- ...id Left by Antergos in Arch Linux World.md | 106 ------------------ ...id Left by Antergos in Arch Linux World.md | 106 ++++++++++++++++++ 2 files changed, 106 insertions(+), 106 deletions(-) delete mode 100644 sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md create mode 100644 translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md diff --git a/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md b/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md deleted file mode 100644 index 24482ad026..0000000000 --- a/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md +++ /dev/null @@ -1,106 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Chao-zhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World) -[#]: via: (https://itsfoss.com/endeavouros/) -[#]: author: (John Paul https://itsfoss.com/author/john/) - -EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World -====== - -![][1] - -I’m sure that most of our readers are aware of the [end of the Antergos project][2]. In the wake of the announcement, the members of the Antergos community created several successors. Today, we will be looking at one of the ‘spiritual successors’ of Antergos: [EndeavourOS][3]. - -### EndeavourOS is not a fork of Antergos - -Before we start, I would like to make it very clear that EndeavourOS is not a fork of Antergos. The developers used Antergos as their inspiration to create a light Arch-based distro. - -![Endeavouros First Boot][4] - -According to the [project’s site][5], EndeavourOS came into existence because people in the Antergos community wanted to keep the spirit of Antergos alive. Their goal was simply to “have Arch installed with an easy to use installer and a friendly, helpful community to fall back on during the journey to master the system”. - -Unlike many Arch-based distros, EndeavourOS is intending to work [like vanilla Arch][5], “so no one-click solutions to install your favorite app or a bunch of preinstalled apps you’ll eventually don’t need”. For most people, especially those new to Linux and Arch, there will be a learning curve, but EndeavourOS aims to have a large friendly community where people are encouraged to ask questions and learn about their systems. - -![Endeavouros Installing][6] - -### A Work in Progress - -EndeavourOS was [first released on July 15th][7] of this year after the project was first announced on [May 23rd][8]. Unfortunately, this means that the developers were unable to incorporate all of the features that they have planned. - -For example, they want to have an online install similar to the one used by Antergos but ran into [issues with the current options][9]. “Cnchi has caused serious problems to be working outside the Antergos eco system and it needs a complete rewrite to work. The Fenix installer by RebornOS is getting more into shape, but needs more time to properly function.” For now, EndeavourOS will ship with the [Calamares installer][10]. - -[][11] - -Suggested read  Velt/OS: A Material Design-Themed Desktop Environment - -EndeavourOS will also offer [less stuff than Antergos][9]: It’s repo is smaller than Antergos though they ship with some AUR packages. Their goal is to deliver a system that’s close to Arch an not vanilla Arch. - -![Endeavouros Updating With Kalu][12] - -The developers [stated further][13]: - -> “Linux and specifically Arch are all about freedom of choice, we provide a basic install that lets you explore those choices with a small layer of convenience. We will never judge you by installing GUI apps like Pamac or even work with sandbox solutions like Flatpak or Snaps. It’s up to you what you are installing to make EndeavourOS work in your circumstances, that’s the main difference we have with Antergos or Manjaro, but like Antergos we will try to help you if you run into a problem with one of your installed packages.” - -### Experiencing EndeavourOS - -I installed EndeavourOS in [VirtualBox][14] and took a look around. When I first booted from the image, I was greeted by a little box with links to the EndeavourOS site about installing. It also has a button to install and one to manually partition the drive. The Calamares installer worked very smoothly for me. - -After I rebooted into a fresh install of EndeavourOS, I was greeted by a colorful themed XFCE desktop. I was also treated to a bunch of notification balloons. Most Arch-based distros I’ve used come with a GUI tool like [pamac][15] or [octopi][16] to keep the system up-to-date. EndeavourOS comes with [kalu][17]. (kalu stands for “Keeping Arch Linux Up-to-date”.) It checks for updated packages, Arch Linux News, updated AUR packages and more. Once it sees an update for any of those areas, it will create a notification balloon. - -I took a look through the menu to see what was installed by default. The answer is not much, not even an office suite. If they intend for EndeavourOS to be a blank canvas for anyone to create the system they want. they are headed in the right direction. - -![Endeavouros Desktop][18] - -### Final Thoughts - -EndeavourOS is still very young. The first stable release was issued only 3 weeks ago. It is missing some stuff, most importantly an online installer. That being said, it is possible to gauge where EndeavourOS will be heading. - -[][19] - -Suggested read  An Overview of Intel's Clear Linux, its Features and Installation Procedure - -While it is not an exact clone of Antergos, EndeavourOS wants to replicate the most important part of Antergos the welcoming, friendly community. All to often, the Linux community can seem to be unwelcoming and downright hostile to the beginner. I’ve seen more and more people trying to combat that negativity and bring more people into Linux. With the EndeavourOS team making that their main focus, a great distro can be the only result. - -If you are currently using Antergos, there is a way for you to [switch to EndeavourOS without performing a clean install.][20] - -If you want an exact clone of Antergos, I would recommend checking out [RebornOS][21]. They are currently working on a replacement of the Cnchi installer named Fenix. - -Have you tried EndeavourOS already? How’s your experience with it? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/endeavouros/ - -作者:[John Paul][a] -选题:[lujun9972][b] -译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/john/ -[b]: https://github.com/lujun9972 -[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-logo.png?ssl=1 -[2]: https://itsfoss.com/antergos-linux-discontinued/ -[3]: https://endeavouros.com/ -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-first-boot.png?resize=800%2C600&ssl=1 -[5]: https://endeavouros.com/info-2/ -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-installing.png?resize=800%2C600&ssl=1 -[7]: https://endeavouros.com/endeavouros-first-stable-release-has-arrived/ -[8]: https://forum.antergos.com/topic/11780/endeavour-antergos-community-s-next-stage -[9]: https://endeavouros.com/what-to-expect-on-the-first-release/ -[10]: https://calamares.io/ -[11]: https://itsfoss.com/veltos-linux/ -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-updating-with-kalu.png?resize=800%2C600&ssl=1 -[13]: https://endeavouros.com/second-week-after-the-stable-release/ -[14]: https://itsfoss.com/install-virtualbox-ubuntu/ -[15]: https://aur.archlinux.org/packages/pamac-aur/ -[16]: https://octopiproject.wordpress.com/ -[17]: https://github.com/jjk-jacky/kalu -[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-desktop.png?resize=800%2C600&ssl=1 -[19]: https://itsfoss.com/clear-linux/ -[20]: https://forum.endeavouros.com/t/how-to-switch-from-antergos-to-endevouros/105/2 -[21]: https://rebornos.org/ diff --git a/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md b/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md new file mode 100644 index 0000000000..b7966b40cf --- /dev/null +++ b/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World) +[#]: via: (https://itsfoss.com/endeavouros/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +EndeavourOS 的目标是填补 Antergos 在 ArchLinux 世界留下的空白 +====== + +![][1] + +我相信我们的大多数读者都知道 [Antergos 项目的终结 ][2]。在这一消息宣布之后,Antergos 社区的成员创建了几个发行版来继承 Antergos。今天,我们将着眼于 Antergos 的“精神继承人”之一:[EndeavourOS][3]。 + +### EndeavourOS 不是 Antergos 的分支 + +在我们开始之前,我想非常明确地指出,EndeavourOS 并不是一个 Antergos 的分支版本。开发者们以 Antergos 为灵感,创建了一个基于 Arch 的轻量级发行版。 + +![Endeavouros First Boot][4] + +根据[这个项目网站 ][5] 的说法,EndeavourOS 的诞生是因为 Antergos 社区的人们想要保持 Antergos 的精神。他们的目标很简单:“让 Arch 拥有一个易于使用的安装程序和一个友好、有帮助的社区,在掌握系统的过程中能够有一个社区可以依靠。” + +与许多基于 Arch 的发行版不同,EndeavourOS 打算像 [原生 Arch][5] 那样使用,“所以没有一键式安装你喜欢的应用程序或一堆你最终不需要的预装应用程序的解决方案。”对于大多数人来说,尤其是那些刚接触 Linux 和 Arch 的人,会有一个学习曲线,但 EndeavourOS 的目标是建立一个大型友好的社区,鼓励人们提出问题并了解他们的系统。 + +![Endeavouros Installing][6] + +### 正在进行的工作 + +EndeavourOS 在 [2019 年 5 月 23 日首次宣布陈立 ][8] 随后[在 7 月 15 日发布第一个版本 ][7]。不幸的是,这意味着开发人员无法将他们计划的所有功能全部整合进来。 + +例如,他们想要一个类似于 Antergos 的在线安装,但却遇到了[当前选项的问题 ][9]。“Cnchi 运行在 Antergos 生态系统之外会造成严重的问题,需要彻底重写才能发挥作用。RebornOS 的 Fenix 安装程序还没有完全成型,需要更多时间才能正常运行。”于是现在,EndeavourOS 将会和 [Calamares 安装程序 ][10] 一起发布。 + +[][11] + +推荐阅读 Velt/OS:Material Design 主题的桌面环境 + +EndeavourOS 会提供[比 Antergos 少的东西 ][9]:它的 repo 比 Antergos 小,尽管他们会附带一些 AUR 包。他们的目标是提供一个接近 Arch 却不是原生 Arch 的系统。 + +![Endeavouros Updating With Kalu][12] + +开发者[进一步声明 ][13]: + +>“Linux,特别是 Arch,核心精神是自由选择,我们提供了一个基本的安装,让你在一个精细的层面上方便地探索各项选择。我们永远不会强行为你作决定,比如为你安装 GUI 应用程序,如 Pamac,甚至采用沙盒解决方案,如 Flatpak 或 Snaps。想安装成什么样子完全取决于你,这是我们与 Antergos 或 Manjaro 的主要区别,但与 Antergos 一样,如果你安装的软件包遇到问题,我们会尽力帮助你。” + +### 体验 EndeavourOS + +我在 [VirtualBox][14] 中安装了 EndeavourOS,并且研究了一番。当我第一次启动时,我看到一个窗口,里面有关于安装的 EndeavourOS 网站的链接。它还有一个安装按钮和一个手动分区工具。Calamares 安装程序的安装过程非常顺利。 + +在我重新启动到新安装的 EndeavourOS 之后,迎接我的是一个彩色主题的 XFCE 桌面。我还收到了一堆通知消息。我使用过的大多数基于 Arch 的发行版都带有一个 GUI 包管理器,比如 [pamac][15] 或 [octopi][16],以进行系统更新。EndeavourOS 配有 [kalu][17](kalu 是 “Keeping Arch Linux Up-to-date” 的缩写)。它可以更新软件包、可以看 Archlinux 新闻、可以更新 AUR 包等等。一旦它检查到有更新,它就会显示通知消息。 + +我浏览了一下菜单,看看默认安装了什么。默认的安装并不多,连办公套件都没有。他们想让 EndeavourOS 成为一块空白画布,让任何人都可以创建他们想要的系统。他们正朝着正确的方向前进。 + +![Endeavouros Desktop][18] + +### 总结思考 + +EndeavourOS 还很年轻。第一个稳定版本都没有发布多久。它缺少一些东西,最重要的是一个在线安装程序。这就是说,我们无法估计他能够走到哪一步。 + +[][19] + +建议您阅读英特尔 Clear Linux 的概述、功能和安装过程 + +虽然它不是 Antergos 的复刻,但 EndeavourOS 希望复制 Antergos 最重要的部分——热情友好的社区。很多时候,Linux 社区对初学者似乎是不受欢迎甚至是完全敌对的。我看到越来越多的人试图与这种消极情绪作斗争,并将更多的人引入 Linux。随着 EndeavourOS 团队把焦点放在社区建设上,我相信一个伟大的发行版将会诞生。 + +如果您当前正在使用 Antergos,有一种方法可以让您[不用重装系统就切换到 EndeavourOS][20] + +如果你想要一个 Antergos 的精确复刻,我建议你去看看 [RebornOS][21]。他们目前正在开发一个名为 Fenix 的 Cnchi 安装程序的替代品。 + +你已经试过 EndeavourOS 了吗?你的感受如何? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/endeavouros/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-logo.png?ssl=1 +[2]: https://itsfoss.com/antergos-linux-discontinued/ +[3]: https://endeavouros.com/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-first-boot.png?resize=800%2C600&ssl=1 +[5]: https://endeavouros.com/info-2/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-installing.png?resize=800%2C600&ssl=1 +[7]: https://endeavouros.com/endeavouros-first-stable-release-has-arrived/ +[8]: https://forum.antergos.com/topic/11780/endeavour-antergos-community-s-next-stage +[9]: https://endeavouros.com/what-to-expect-on-the-first-release/ +[10]: https://calamares.io/ +[11]: https://itsfoss.com/veltos-linux/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-updating-with-kalu.png?resize=800%2C600&ssl=1 +[13]: https://endeavouros.com/second-week-after-the-stable-release/ +[14]: https://itsfoss.com/install-virtualbox-ubuntu/ +[15]: https://aur.archlinux.org/packages/pamac-aur/ +[16]: https://octopiproject.wordpress.com/ +[17]: https://github.com/jjk-jacky/kalu +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-desktop.png?resize=800%2C600&ssl=1 +[19]: https://itsfoss.com/clear-linux/ +[20]: https://forum.endeavouros.com/t/how-to-switch-from-antergos-to-endevouros/105/2 +[21]: https://rebornos.org/ From 752c49316ce1f46890add204ca04bd887748a267 Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Sun, 7 Feb 2021 22:24:40 +0800 Subject: [PATCH 219/381] Translating. --- .../tech/20200524 Diamond interface composition in Go 1.14.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 611bb2c39e..34ad6bd5cd 100644 --- a/sources/tech/20200524 Diamond interface composition in Go 1.14.md +++ b/sources/tech/20200524 Diamond interface composition in Go 1.14.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (LazyWolfLin) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d22c6abb537baae5ea3a1b393fc7e09d161cf3e5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 7 Feb 2021 22:56:19 +0800 Subject: [PATCH 220/381] PRF @Chao-zhi --- ...id Left by Antergos in Arch Linux World.md | 40 ++++++++----------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md b/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md index b7966b40cf..185aec4bc9 100644 --- a/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md +++ b/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md @@ -1,48 +1,44 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World) [#]: via: (https://itsfoss.com/endeavouros/) [#]: author: (John Paul https://itsfoss.com/author/john/) -EndeavourOS 的目标是填补 Antergos 在 ArchLinux 世界留下的空白 +EndeavourOS:填补 Antergos 在 ArchLinux 世界留下的空白 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202102/07/225558rdb85bmm6uumro71.jpg) -我相信我们的大多数读者都知道 [Antergos 项目的终结 ][2]。在这一消息宣布之后,Antergos 社区的成员创建了几个发行版来继承 Antergos。今天,我们将着眼于 Antergos 的“精神继承人”之一:[EndeavourOS][3]。 +我相信我们的大多数读者都知道 [Antergos 项目的终结][2]。在这一消息宣布之后,Antergos 社区的成员创建了几个发行版来继承 Antergos。今天,我们将着眼于 Antergos 的“精神继承人”之一:[EndeavourOS][3]。 ### EndeavourOS 不是 Antergos 的分支 -在我们开始之前,我想非常明确地指出,EndeavourOS 并不是一个 Antergos 的分支版本。开发者们以 Antergos 为灵感,创建了一个基于 Arch 的轻量级发行版。 +在我们开始之前,我想非常明确地指出,EndeavourOS 并不是一个 Antergos 的复刻版本。开发者们以 Antergos 为灵感,创建了一个基于 Arch 的轻量级发行版。 ![Endeavouros First Boot][4] -根据[这个项目网站 ][5] 的说法,EndeavourOS 的诞生是因为 Antergos 社区的人们想要保持 Antergos 的精神。他们的目标很简单:“让 Arch 拥有一个易于使用的安装程序和一个友好、有帮助的社区,在掌握系统的过程中能够有一个社区可以依靠。” +根据 [这个项目网站][5] 的说法,EndeavourOS 的诞生是因为 Antergos 社区的人们想要保持 Antergos 的精神。他们的目标很简单:“让 Arch 拥有一个易于使用的安装程序和一个友好、有帮助的社区,在掌握系统的过程中能够有一个社区可以依靠。” -与许多基于 Arch 的发行版不同,EndeavourOS 打算像 [原生 Arch][5] 那样使用,“所以没有一键式安装你喜欢的应用程序或一堆你最终不需要的预装应用程序的解决方案。”对于大多数人来说,尤其是那些刚接触 Linux 和 Arch 的人,会有一个学习曲线,但 EndeavourOS 的目标是建立一个大型友好的社区,鼓励人们提出问题并了解他们的系统。 +与许多基于 Arch 的发行版不同,EndeavourOS 打算像 [原生 Arch][5] 那样使用,“所以没有一键式安装你喜欢的应用程序的解决方案,也没有一堆你最终不需要的预装应用程序。”对于大多数人来说,尤其是那些刚接触 Linux 和 Arch 的人,会有一个学习曲线,但 EndeavourOS 的目标是建立一个大型友好的社区,鼓励人们提出问题并了解他们的系统。 ![Endeavouros Installing][6] ### 正在进行的工作 -EndeavourOS 在 [2019 年 5 月 23 日首次宣布陈立 ][8] 随后[在 7 月 15 日发布第一个版本 ][7]。不幸的是,这意味着开发人员无法将他们计划的所有功能全部整合进来。 +EndeavourOS 在 [2019 年 5 月 23 日首次宣布成立][8] 随后 [在 7 月 15 日发布第一个版本][7]。不幸的是,这意味着开发人员无法将他们计划的所有功能全部整合进来。(LCTT 译注:本文原文发表于 2019 年,而现在,EndeavourOS 还在持续活跃着。) -例如,他们想要一个类似于 Antergos 的在线安装,但却遇到了[当前选项的问题 ][9]。“Cnchi 运行在 Antergos 生态系统之外会造成严重的问题,需要彻底重写才能发挥作用。RebornOS 的 Fenix 安装程序还没有完全成型,需要更多时间才能正常运行。”于是现在,EndeavourOS 将会和 [Calamares 安装程序 ][10] 一起发布。 +例如,他们想要一个类似于 Antergos 的在线安装,但却遇到了[当前选项的问题][9]。“Cnchi 运行在 Antergos 生态系统之外会造成严重的问题,需要彻底重写才能发挥作用。RebornOS 的 Fenix 安装程序还没有完全成型,需要更多时间才能正常运行。”于是现在,EndeavourOS 将会和 [Calamares 安装程序 ][10] 一起发布。 -[][11] - -推荐阅读 Velt/OS:Material Design 主题的桌面环境 - -EndeavourOS 会提供[比 Antergos 少的东西 ][9]:它的 repo 比 Antergos 小,尽管他们会附带一些 AUR 包。他们的目标是提供一个接近 Arch 却不是原生 Arch 的系统。 +EndeavourOS 会提供 [比 Antergos 少的东西][9]:它的存储库比 Antergos 小,尽管他们会附带一些 AUR 包。他们的目标是提供一个接近 Arch 却不是原生 Arch 的系统。 ![Endeavouros Updating With Kalu][12] 开发者[进一步声明 ][13]: ->“Linux,特别是 Arch,核心精神是自由选择,我们提供了一个基本的安装,让你在一个精细的层面上方便地探索各项选择。我们永远不会强行为你作决定,比如为你安装 GUI 应用程序,如 Pamac,甚至采用沙盒解决方案,如 Flatpak 或 Snaps。想安装成什么样子完全取决于你,这是我们与 Antergos 或 Manjaro 的主要区别,但与 Antergos 一样,如果你安装的软件包遇到问题,我们会尽力帮助你。” +> “Linux,特别是 Arch,核心精神是自由选择,我们提供了一个基本的安装,让你在一个精细的层面上方便地探索各项选择。我们永远不会强行为你作决定,比如为你安装 GUI 应用程序,如 Pamac,甚至采用沙盒解决方案,如 Flatpak 或 Snaps。想安装成什么样子完全取决于你,这是我们与 Antergos 或 Manjaro 的主要区别,但与 Antergos 一样,如果你安装的软件包遇到问题,我们会尽力帮助你。” ### 体验 EndeavourOS @@ -56,19 +52,15 @@ EndeavourOS 会提供[比 Antergos 少的东西 ][9]:它的 repo 比 Antergos ### 总结思考 -EndeavourOS 还很年轻。第一个稳定版本都没有发布多久。它缺少一些东西,最重要的是一个在线安装程序。这就是说,我们无法估计他能够走到哪一步。 +EndeavourOS 还很年轻。第一个稳定版本都没有发布多久。它缺少一些东西,最重要的是一个在线安装程序。这就是说,我们无法估计他能够走到哪一步。(LCTT 译注:本文发表于 2019 年) -[][19] +虽然它不是 Antergos 的精确复刻,但 EndeavourOS 希望复制 Antergos 最重要的部分——热情友好的社区。很多时候,Linux 社区对初学者似乎是不受欢迎甚至是完全敌对的。我看到越来越多的人试图与这种消极情绪作斗争,并将更多的人引入 Linux。随着 EndeavourOS 团队把焦点放在社区建设上,我相信一个伟大的发行版将会诞生。 -建议您阅读英特尔 Clear Linux 的概述、功能和安装过程 - -虽然它不是 Antergos 的复刻,但 EndeavourOS 希望复制 Antergos 最重要的部分——热情友好的社区。很多时候,Linux 社区对初学者似乎是不受欢迎甚至是完全敌对的。我看到越来越多的人试图与这种消极情绪作斗争,并将更多的人引入 Linux。随着 EndeavourOS 团队把焦点放在社区建设上,我相信一个伟大的发行版将会诞生。 - -如果您当前正在使用 Antergos,有一种方法可以让您[不用重装系统就切换到 EndeavourOS][20] +如果你当前正在使用 Antergos,有一种方法可以让你[不用重装系统就切换到 EndeavourOS][20] 如果你想要一个 Antergos 的精确复刻,我建议你去看看 [RebornOS][21]。他们目前正在开发一个名为 Fenix 的 Cnchi 安装程序的替代品。 -你已经试过 EndeavourOS 了吗?你的感受如何? +你试过 EndeavourOS 了吗?你的感受如何? -------------------------------------------------------------------------------- @@ -77,7 +69,7 @@ via: https://itsfoss.com/endeavouros/ 作者:[John Paul][a] 选题:[lujun9972][b] 译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5ee4c813a58bc5d16a07ec40a17903afa9e8cc39 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 7 Feb 2021 22:56:56 +0800 Subject: [PATCH 221/381] PUB @Chao-zhi https://linux.cn/article-13096-1.html --- ...s to Fill the Void Left by Antergos in Arch Linux World.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md (99%) diff --git a/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md b/published/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md similarity index 99% rename from translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md rename to published/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md index 185aec4bc9..54c752a913 100644 --- a/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md +++ b/published/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13096-1.html) [#]: subject: (EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World) [#]: via: (https://itsfoss.com/endeavouros/) [#]: author: (John Paul https://itsfoss.com/author/john/) From cc8e6da4302625ad548a9df490cdf000c53b1ec8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 7 Feb 2021 23:19:04 +0800 Subject: [PATCH 222/381] PRF @geekpi --- ...ate QR codes with this open source tool.md | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/translated/tech/20210201 Generate QR codes with this open source tool.md b/translated/tech/20210201 Generate QR codes with this open source tool.md index b378c6bccc..64bacb6c85 100644 --- a/translated/tech/20210201 Generate QR codes with this open source tool.md +++ b/translated/tech/20210201 Generate QR codes with this open source tool.md @@ -1,16 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Generate QR codes with this open source tool) [#]: via: (https://opensource.com/article/21/2/zint-barcode-generator) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) -用这个开源工具生成二维码 +Zint:用这个开源工具生成二维码 ====== -Zint 可以轻松生成 50 多种类型的自定义条码。 -![Working from home at a laptop][1] + +> Zint 可以轻松生成 50 多种类型的自定义条码。 + +![](https://img.linux.net.cn/data/attachment/album/202102/07/231854y8ffstg0m6l2fcmz.jpg) 二维码是一种很好的可以向人们提供信息的方式,且没有打印的麻烦和费用。大多数人的智能手机都支持二维码扫描,无论其操作系统是什么。 @@ -18,24 +20,22 @@ Zint 可以轻松生成 50 多种类型的自定义条码。 在互联网上搜索一个简单的、开源的方法来创建二维码时,我发现了 [Zint][2]。Zint 是一个优秀的开源 (GPLv3.0) 生成条码的解决方案。根据该项目的 [GitHub 仓库][3]:“Zint 是一套可以方便地对任何一种公共领域条形码标准的数据进行编码的程序,并允许你将这种功能集成到你自己的程序中。” -Zint 支持 50 多种类型的条形码,包括二维码码 (ISO 18004),你可以轻松地创建这些条形码,然后复制和粘贴到 word 文档、博客、维基和其他数字媒体中。人们可以用智能手机扫描这些二维码,快速链接到信息。 +Zint 支持 50 多种类型的条形码,包括二维码(ISO 18004),你可以轻松地创建这些条形码,然后复制和粘贴到 word 文档、博客、维基和其他数字媒体中。人们可以用智能手机扫描这些二维码,快速链接到信息。 ### 安装 Zint Zint 适用于 Linux、macOS 和 Windows。 -你可以在基于 Ubuntu 的 Linux 发行版上使用 apt 安装 Zint 命令: - +你可以在基于 Ubuntu 的 Linux 发行版上使用 `apt` 安装 Zint 命令: ``` -`$ sudo apt install zint` +$ sudo apt install zint ``` -我还想要一个图形用户界面 (GUI),所以我安装了 Zint-QT: - +我还想要一个图形用户界面(GUI),所以我安装了 Zint-QT: ``` -`$ sudo apt install zint-qt` +$ sudo apt install zint-qt ``` 请参考手册的[安装部分][4],了解 macOS 和 Windows 的说明。 @@ -46,16 +46,12 @@ Zint 适用于 Linux、macOS 和 Windows。 ![Generating QR code with Zint][5] -(Don Watkins, [CC BY-SA 4.0][6]) - Zint 的 50 多个其他条码选项包括许多国家的邮政编码、DotCode、EAN、EAN-14 和通用产品代码 (UPC)。[项目文档][2]中包含了它可以渲染的所有代码的完整列表。 你可以将任何条形码复制为 BMP 或 SVG,或者将输出保存为你应用中所需要的任何尺寸的图像文件。这是我的 77x77 像素的二维码。 ![QR code][7] -(Don Watkins, [CC BY-SA 4.0][6]) - 该项目维护了一份出色的用户手册,其中包含了在[命令行][8]和 [GUI][9] 中使用 Zint 的说明。你甚至可以[在线][10]试用 Zint。对于功能请求或错误报告,请[访问网站][11]或[发送电子邮件][12]。 -------------------------------------------------------------------------------- @@ -65,7 +61,7 @@ via: https://opensource.com/article/21/2/zint-barcode-generator 作者:[Don Watkins][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 9d480138b8449011ff2a998a7022c478c90b2358 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 7 Feb 2021 23:19:38 +0800 Subject: [PATCH 223/381] PUB @geekpi https://linux.cn/article-13097-1.html --- .../20210201 Generate QR codes with this open source tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210201 Generate QR codes with this open source tool.md (98%) diff --git a/translated/tech/20210201 Generate QR codes with this open source tool.md b/published/20210201 Generate QR codes with this open source tool.md similarity index 98% rename from translated/tech/20210201 Generate QR codes with this open source tool.md rename to published/20210201 Generate QR codes with this open source tool.md index 64bacb6c85..bc554bf5cb 100644 --- a/translated/tech/20210201 Generate QR codes with this open source tool.md +++ b/published/20210201 Generate QR codes with this open source tool.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13097-1.html) [#]: subject: (Generate QR codes with this open source tool) [#]: via: (https://opensource.com/article/21/2/zint-barcode-generator) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) From 10cfc884dd5e49ea35bbf13cd93499c48ab0ab58 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 8 Feb 2021 05:03:20 +0800 Subject: [PATCH 224/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210207=20?= =?UTF-8?q?Why=20the=20success=20of=20open=20source=20depends=20on=20empat?= =?UTF-8?q?hy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210207 Why the success of open source depends on empathy.md --- ...ccess of open source depends on empathy.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 sources/tech/20210207 Why the success of open source depends on empathy.md diff --git a/sources/tech/20210207 Why the success of open source depends on empathy.md b/sources/tech/20210207 Why the success of open source depends on empathy.md new file mode 100644 index 0000000000..cc2219187e --- /dev/null +++ b/sources/tech/20210207 Why the success of open source depends on empathy.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why the success of open source depends on empathy) +[#]: via: (https://opensource.com/article/21/2/open-source-empathy) +[#]: author: (Bronagh Sorota https://opensource.com/users/bsorota) + +Why the success of open source depends on empathy +====== +With heightened awareness about empathy and the inspiration to spread +it, open source productivity will grow, collaborators will lean in, and +the power of open source software development can be fully harnessed. +![Practicing empathy][1] + +Open source development's collaborative innovation and community ethos have changed the world. In [_The Open Organization_][2], Jim Whitehurst explains that success in open source is found by "thinking of people as members of a community, moving from a transactional mindset to one built on commitment." However, there is still a barrier at the core of the open source development model: Frequently, it lacks human empathy. + +Empathy is the ability to understand and share another person's feelings. In open source communities, face-to-face human interaction and collaboration are rare. Any developer experienced with a GitHub pull request (PR) or issue has received comments from people they may never meet, often halfway across the globe—and the communication can be just as distant. Modern open source development is built upon this type of asynchronous, transactional communication. So, it is no surprise that the same types of cyberbullying and other abuses people experience on social media platforms are also seen in open source communities. + +Of course, not all open source communication is counterproductive. Many people develop respect and commit to good behavioral standards in their craft. But all too often, people lack common-sense etiquette in communications and treat people like machines rather than human beings. This behavior is a barrier to realizing the open source innovation model's full potential because it turns off many would-be contributors and kills inspiration. + +### A history of hostile communications + +Hostile rhetoric in code reviews is not new to open source communities; it has been tolerated for years. The godfather of open source, Linus Torvalds, routinely [barraged][3] the Linux community when code did not meet his standards, driving contributors away. Elon University computer science professor Megan Squire used [machine learning][4] to analyze Torvalds' insults and found they numbered in the thousands during a four-year period. In 2018, Linus put himself on a timeout for bad behavior, tasked himself with learning empathy, apologized, and established a code of conduct for the Linux community. + +In 2015, [Sage Sharp][5] stepped down as the Linux kernel coordinator for the FOSS Outreach Program for Women due to a lack of personal respect, despite being technically respected. + +The impact of disparaging comments in PR reviews has a profound effect on developers. It creates trepidation in making PRs and dread at anticipated feedback, and it eats at developers' confidence in their abilities. It slows velocity by forcing engineers to strive for perfection every time, which runs counter to the agile methodology many communities have adopted. + +### How to close the empathy gap in open source + +Often, offensive comments are unintentional, and with some coaching, the author can learn how to express opinions without negative emotion. GitHub does not monitor comments on issues and PRs for abusive content; instead, it provides tools to enable communities to moderate their content. Repo owners can delete comments and lock conversations, and all contributors can report abuse and block users. + +Defining a community code of conduct establishes a safe and inclusive environment for contributors at all levels to participate and defines the process to de-escalate conflict between collaborators. + +We can overcome the empathy challenge in open source. Face-to-face debate is much more conducive to empathy than text, so opt for a video call when possible. Set an example by sharing feedback in an empathetic way. Be a coach instead of a bystander if you witness a scathing review. Speak up if you are the victim. Assess empathy skills when interviewing a candidate. Tie empathy skills to performance reviews and rewards. Define and enforce a community code of conduct, and moderate your community. + +With heightened awareness about empathy and the inspiration to spread it, open source productivity will grow, collaborators will lean in, and the power of open source software development can be fully harnessed. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/open-source-empathy + +作者:[Bronagh Sorota][a] +选题:[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/bsorota +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/practicing-empathy.jpg?itok=-A7fj6NF (Practicing empathy) +[2]: https://www.redhat.com/en/explore/the-open-organization-book +[3]: https://arstechnica.com/information-technology/2013/07/linus-torvalds-defends-his-right-to-shame-linux-kernel-developers/ +[4]: http://flossdata.syr.edu/data/insults/hicssInsultsv2.pdf +[5]: https://en.wikipedia.org/wiki/Sage_Sharp From 80d14307837c8cb750f86b58851fab3ab82248a5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 8 Feb 2021 05:03:42 +0800 Subject: [PATCH 225/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210207=20?= =?UTF-8?q?3=20ways=20to=20play=20video=20games=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210207 3 ways to play video games on Linux.md --- ...207 3 ways to play video games on Linux.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20210207 3 ways to play video games on Linux.md diff --git a/sources/tech/20210207 3 ways to play video games on Linux.md b/sources/tech/20210207 3 ways to play video games on Linux.md new file mode 100644 index 0000000000..1c132ab588 --- /dev/null +++ b/sources/tech/20210207 3 ways to play video games on Linux.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 ways to play video games on Linux) +[#]: via: (https://opensource.com/article/21/2/linux-gaming) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +3 ways to play video games on Linux +====== +If you're ready to put down the popcorn and experience games from all +angles, start gaming on Linux. +![Gaming with penguin pawns][1] + +In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Today, I'll start with gaming. + +I used to think a "gamer" was a very specific kind of creature, carefully cataloged and classified by scientists after years of study and testing. I never classified myself as a gamer because most of the games I played were either on a tabletop (board games and pen-and-paper roleplaying games), NetHack, or Tetris. Now that games are available on everything from mobile devices, consoles, computers, and televisions, it feels like it's a good time to acknowledge that "gamers" come in all different shapes and sizes. If you want to call yourself a gamer, you can! There's no qualification exam. You don't have to know the Konami Code by heart (or even what that reference means); you don't have to buy and play "triple-A" games. If you enjoy a game from time to time, you can rightfully call yourself a gamer. And if you want to be a gamer, there's never been a better time to use Linux. + +### Welcome to the underground + +Peel back the glossy billboard ads, and underneath, you're sure to find a thriving gaming underground. It's a movement that began with the nascent gaming market before anyone believed money could be made off software that wasn't either a spreadsheet or typing tutor. Indie games have carved out a place in pop culture (believe it or not, [Minecraft, while not open source][2], started out as an indie game) in several ways, proving that in the eyes of players, gameplay comes before production value. + +There's a lot of cross-over in the indie and open source developer space. There's nothing quite like kicking back with your Linux laptop and browsing [itch.io][3] or your distribution's software repository for a little-known but precious gem of an open source game. + +There are all kinds of open source games available, including plenty of [first person shooters][4], puzzle games like [Nodulus][5], systems management games like [OpenTTD][6], racing games like [Jethook][7], tense escape campaigns like [Sauerbraten][8], and too many more to mention (with more arriving each year, thanks to great initiatives like [Open Jam][9]). + +![Jethook game screenshot][10] + +Jethook + +Overall, the experience of delving into the world of open source games is different than the immediate satisfaction of buying whatever a major game studio releases next. Games by the big studios provide plenty of visual and sonic stimuli, big-name actors, and upwards of 60 hours of gameplay. Independent and open source games aren't likely to match that, but then again, major studios can't match the sense of discovery and personal connection you get when you find a game that you just know nobody else _has ever heard of_. And they can't hope to match the sense of urgency you get when you realize that everybody in the world really, really needs to hear about the great game you've just played. + +Take some time to identify the kinds of games you enjoy the most, and then have a browse through your distribution's software repository, [Flathub][11], and open game jams. See what you can uncover and, if you like the game enough, help to promote it! + +### Proton and WINE + +Gaming on Linux doesn't stop with open source, but it is enabled by it. When Valve Software famously brought Linux back into the gaming market a few years ago by releasing their Steam client for Linux, the hope was that it would compel game studios to write code native to Linux systems. Some did, but Valve failed to push Linux as the primary platform even on their own Valve-branded gaming computers, and it seems that most studios have reverted to their old ways of Windows-only games. + +Interestingly, though, the end result has produced more open source code than probably intended. Valve's solution for Linux compatibility has been to create the [Proton][12] project, a compatibility layer to translate Windows games to Linux. At its core, Proton uses [WINE (Wine Is Not an Emulator)][13], the too-good-to-be-true reimplementation of major Windows libraries as open source. + +The game market's spoils have turned out to be a treasure trove for the open source world, and today, most games from major studios can be run on Linux as if they were native. + +Of course, if you're the type of gamer who has to have the latest title on the day of release, you can certainly expect unpleasant surprises. That's not surprising, though, because few major games are released without bugs requiring large patches a week later. Those bugs can be even worse when a game runs on Proton and WINE, so Linux gamers often benefit by refraining from early adoption. The trade-off may be worth it, though. I've played a few games that run perfectly on Proton, only to discover later from angry forum posts that it's apparently riddled with fatal errors when played on the latest version of Windows. In short, it seems that games from major studios aren't perfect, and so you can expect similar-but-different problems when playing them on Linux as you would on Windows. + +### Flatpak + +One of the most exciting developments of recent Linux history is [Flatpak][14], a cross between local containers and packaging. It's got nothing to do with gaming (or doesn't it?), but it enables Linux applications to essentially be distributed universally to any Linux distribution. This applies to gaming because there are often lots of fringe technologies used in games, and it can be pretty demanding on distribution maintainers to keep up with all the latest versions required by any given game. + +Flatpak abstracts that away from the distribution by establishing a common Flatpak-specific layer for application libraries. Distributors of flatpaks know that if a library isn't in a Flatpak SDK, then it must be included in the flatpak. It's simple and straightforward. + +Thanks to Flatpak, the Steam client runs on something obvious like Fedora and on distributions not traditionally geared toward the gaming market, like [RHEL][15] and Slackware! + +### Lutris + +If you're not eager to sign up on Steam, though, there's my preferred gaming client, [Lutris][16]. On the surface, Lutris is a simple game launcher for your system, a place you can go when you know you want to play a game but just can't decide what to launch yet. With Lutris, you can add [all the games you have on your system][17] to create your own gaming library, and then launch and play them right from the Lutris interface. Better still, Lutris contributors (like me!) regularly publish installer scripts to make it easy for you to install games you own. It's not always necessary, but it can be a nice shortcut to bypass some tedious configuration. + +Lutris can also enlist the help of _runners_, or subsystems that run games that wouldn't normally launch straight from your application menu. For instance, if you want to play console games like the open source [Warcraft Tower Defense][18], you must run an emulator, and Lutris can handle that for you (provided you have the emulator installed). Additionally, should you have a GOG.com (Good Old Games) account, Lutris can access it and import games from your library. + +There's no easier way to manage your games. + +### Play games + +Linux gaming is a fulfilling and empowering experience. I used to avoid computer gaming because I didn't feel I had much of a choice. It seemed that there were always expensive games being released, which inevitably got extreme reactions from happy and unhappy gamers alike, and then the focus shifted quickly to the next big thing. On the other hand, open source gaming has introduced me to the _people_ of the gaming world. I've met other players and developers, I've met artists and musicians, fans and promoters, and I've played an assortment of games that I never even realized existed. Some of them were barely long enough to distract me for just one afternoon, while others have provided me hours and hours of obsessive gameplay, modding, level design, and fun. + +If you're ready to put down the popcorn and experience games from all angles, start gaming on Linux. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-gaming + +作者:[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/gaming_grid_penguin.png?itok=7Fv83mHR (Gaming with penguin pawns) +[2]: https://opensource.com/alternatives/minecraft +[3]: https://itch.io/jam/open-jam-2020 +[4]: https://opensource.com/article/20/5/open-source-fps-games +[5]: https://hyperparticle.itch.io/nodulus +[6]: https://www.openttd.org/ +[7]: https://rcorre.itch.io/jethook +[8]: http://sauerbraten.org/ +[9]: https://opensource.com/article/18/9/open-jam-announcement +[10]: https://opensource.com/sites/default/files/game_0.png +[11]: http://flathub.org +[12]: https://github.com/ValveSoftware/Proton +[13]: http://winehq.org +[14]: https://opensource.com/business/16/8/flatpak +[15]: https://www.redhat.com/en/enterprise-linux-8 +[16]: http://lutris.net +[17]: https://opensource.com/article/18/10/lutris-open-gaming-platform +[18]: https://ndswtd.wordpress.com/download From 2ee752dfc933c4c595e971609a0065de79e8bbb9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 8 Feb 2021 05:04:05 +0800 Subject: [PATCH 226/381] =?UTF-8?q?=E9=80=89=E9=A2=98[talk]:=2020210207=20?= =?UTF-8?q?The=20Real=20Novelty=20of=20the=20ARPANET?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20210207 The Real Novelty of the ARPANET.md --- ...0210207 The Real Novelty of the ARPANET.md | 263 ++++++++++++++++++ 1 file changed, 263 insertions(+) create mode 100644 sources/talk/20210207 The Real Novelty of the ARPANET.md diff --git a/sources/talk/20210207 The Real Novelty of the ARPANET.md b/sources/talk/20210207 The Real Novelty of the ARPANET.md new file mode 100644 index 0000000000..5e60919871 --- /dev/null +++ b/sources/talk/20210207 The Real Novelty of the ARPANET.md @@ -0,0 +1,263 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Real Novelty of the ARPANET) +[#]: via: (https://twobithistory.org/2021/02/07/arpanet.html) +[#]: author: (Two-Bit History https://twobithistory.org) + +The Real Novelty of the ARPANET +====== + +If you run an image search for the word “ARPANET,” you will find lots of maps showing how the [government research network][1] expanded steadily across the country throughout the late ’60s and early ’70s. I’m guessing that most people reading or hearing about the ARPANET for the first time encounter one of these maps. + +Obviously, the maps are interesting—it’s hard to believe that there were once so few networked computers that their locations could all be conveyed with what is really pretty lo-fi cartography. (We’re talking 1960s overhead projector diagrams here. You know the vibe.) But the problem with the maps, drawn as they are with bold lines stretching across the continent, is that they reinforce the idea that the ARPANET’s paramount achievement was connecting computers across the vast distances of the United States for the first time. + +Today, the internet is a lifeline that keeps us tethered to each other even as an airborne virus has us all locked up indoors. So it’s easy to imagine that, if the ARPANET was the first draft of the internet, then surely the world that existed before it was entirely disconnected, since that’s where we’d be without the internet today, right? The ARPANET must have been a big deal because it connected people via computers when that hadn’t before been possible. + +That view doesn’t get the history quite right. It also undersells what made the ARPANET such a breakthrough. + +### The Debut + +The Washington Hilton stands near the top of a small rise about a mile and a half northeast of the National Mall. Its two white-painted modern facades sweep out in broad semicircles like the wings of a bird. The New York Times, reporting on the hotel’s completion in 1965, remarked that the building looks “like a sea gull perched on a hilltop nest.”[1][2] + +The hotel hides its most famous feature below ground. Underneath the driveway roundabout is an enormous ovoid event space known as the International Ballroom, which was for many years the largest pillar-less ballroom in DC. In 1967, the Doors played a concert there. In 1968, Jimi Hendrix also played a concert there. In 1972, a somewhat more sedate act took over the ballroom to put on the inaugural International Conference on Computing Communication, where a promising research project known as the ARPANET was demonstrated publicly for the first time. + +The 1972 ICCC, which took place from October 24th to 26th, was attended by about 800 people.[2][3] It brought together all of the leading researchers in the nascent field of computer networking. According to internet pioneer Bob Kahn, “if somebody had dropped a bomb on the Washington Hilton, it would have destroyed almost all of the networking community in the US at that point.”[3][4] + +Not all of the attendees were computer scientists, however. An advertisement for the conference claimed it would be “user-focused” and geared toward “lawyers, medical men, economists, and government men as well as engineers and communicators.”[4][5] Some of the conference’s sessions were highly technical, such as the session titled “Data Network Design Problems I” and its sequel session, “Data Network Design Problems II.” But most of the sessions were, as promised, focused on the potential social and economic impacts of computer networking. One session, eerily prescient today, sought to foster a discussion about how the legal system could act proactively “to safeguard the right of privacy in the computer data bank.”[5][6] + +The ARPANET demonstration was intended as a side attraction of sorts for the attendees. Between sessions, which were held either in the International Ballroom or elsewhere on the lower level of the hotel, attendees were free to wander into the Georgetown Ballroom (a smaller ballroom/conference room down the hall from the big one),[6][7] where there were 40 terminals from a variety of manufacturers set up to access the ARPANET.[7][8] These terminals were dumb terminals—they only handled input and output and could do no computation on their own. (In fact, in 1972, it’s likely that all of these terminals were hardcopy terminals, i.e. teletype machines.) The terminals were all hooked up to a computer known as a Terminal Interface Message Processor or TIP, which sat on a raised platform in the middle of the room. The TIP was a kind of archaic router specially designed to connect dumb terminals to the ARPANET. Using the terminals and the TIP, the ICCC attendees could experiment with logging on and accessing some of the computers at the 29 host sites then comprising the ARPANET.[8][9] + +To exhibit the network’s capabilities, researchers at the host sites across the country had collaborated to prepare 19 simple “scenarios” for users to experiment with. These scenarios were compiled into [a booklet][10] that was handed to conference attendees as they tentatively approached the maze of wiring and terminals.[9][11] The scenarios were meant to prove that the new technology worked but also that it was useful, because so far the ARPANET was “a highway system without cars,” and its Pentagon funders hoped that a public demonstration would excite more interest in the network.[10][12] + +The scenarios thus showed off a diverse selection of the software that could be accessed over the ARPANET: There were programming language interpreters, one for a Lisp-based language at MIT and another for a numerical computing environment called Speakeasy hosted at UCLA; there were games, including a chess program and an implementation of Conway’s Game of Life; and—perhaps most popular among the conference attendees—there were several AI chat programs, including the famous ELIZA chat program developed at MIT by Joseph Weizenbaum. + +The researchers who had prepared the scenarios were careful to list each command that users were expected to enter at their terminals. This was especially important because the sequence of commands used to connect to any given ARPANET host could vary depending on the host in question. To experiment with the AI chess program hosted on the MIT Artificial Intelligence Laboratory’s PDP-10 minicomputer, for instance, conference attendees were instructed to enter the following: + +_`[LF]`, `[SP]`, and `[CR]` below stand for the line feed, space, and carriage return keys respectively. I’ve explained each command after `//`, but this syntax was not used for the annotations in the original._ + +``` +@r [LF] // Reset the TIP +@e [SP] r [LF] // "Echo remote" setting, host echoes characters rather than TIP +@L [SP] 134 [LF] // Connect to host number 134 +:login [SP] iccXXX [CR] // Login to the MIT AI Lab's system, where "XXX" should be user's initials +:chess [CR] // Start chess program +``` + +If conference attendees were successfully able to enter those commands, their reward was the opportunity to play around with some of the most cutting-edge chess software available at the time, where the layout of the board was represented like this: + +``` +BR BN BB BQ BK BB BN BR +BP BP BP BP ** BP BP BP +-- ** -- ** -- ** -- ** +** -- ** -- BP -- ** -- +-- ** -- ** WP ** -- ** +** -- ** -- ** -- ** -- +WP WP WP WP -- WP WP WP +WR WN WB WQ WK WB WN WR +``` + +In contrast, to connect to UCLA’s IBM System/360 and run the Speakeasy numerical computing environment, conference attendees had to enter the following: + +``` +@r [LF] // Reset the TIP +@t [SP] o [SP] L [LF] // "Transmit on line feed" setting +@i [SP] L [LF] // "Insert line feed" setting, i.e. send line feed with each carriage return +@L [SP] 65 [LF] // Connect to host number 65 +tso // Connect to IBM Time-Sharing Option system +logon [SP] icX [CR] // Log in with username, where "X" should be a freely chosen digit +iccc [CR] // This is the password (so secure!) +speakez [CR] // Start Speakeasy +``` + +Successfully running that gauntlet gave attendees the power to multiply and transpose and do other operations on matrices as quickly as they could input them at their terminal: + +``` +:+! a=m*transpose(m);a [CR] +:+! eigenvals(a) [CR] +``` + +Many of the attendees were impressed by the demonstration, but not for the reasons that we, from our present-day vantage point, might assume. The key piece of context hard to keep in mind today is that, in 1972, being able to use a computer remotely, even from a different city, was not new. Teletype devices had been used to talk to distant computers for decades already. Almost a full five years before the ICCC, Bill Gates was in a Seattle high school using a teletype to run his first BASIC programs on a General Electric computer housed elsewhere in the city. Merely logging in to a host computer and running a few commands or playing a text-based game was routine. The software on display here was pretty neat, but the two scenarios I’ve told you about so far could ostensibly have been experienced without going over the ARPANET. + +Of course, something new was happening under the hood. The lawyers, policy-makers, and economists at the ICCC might have been enamored with the clever chess program and the chat bots, but the networking experts would have been more interested in two other scenarios that did a better job of demonstrating what the ARPANET project had achieved. + +The first of these scenarios involved a program called `NETWRK` running on MIT’s ITS operating system. The `NETWRK` command was the entrypoint for several subcommands that could report various aspects of the ARPANET’s operating status. The `SURVEY` subcommand reported which hosts on the network were functioning and available (they all fit on a single list), while the `SUMMARY.OF.SURVEY` subcommand aggregated the results of past `SURVEY` runs to report an “up percentage” for each host as well as how long, on average, it took for each host to respond to messages. The output of the `SUMMARY.OF.SURVEY` subcommand was a table that looked like this: + +``` +--HOST-- -#- -%-UP- -RESP- +UCLA-NMC 001 097% 00.80 +SRI-ARC 002 068% 01.23 +UCSB-75 003 059% 00.63 +... +``` + +The host number field, as you can see, has room for no more than three digits (ha!). Other `NETWRK` subcommands allowed users to look at summary of survey results over a longer historical period or to examine the log of survey results for a single host. + +The second of these scenarios featured a piece of software called the SRI-ARC Online System being developed at Stanford. This was a fancy piece of software with lots of functionality (it was the software system that Douglas Engelbart demoed in the “Mother of All Demos”), but one of the many things it could do was make use of what was essentially a file hosting service run on the host at UC Santa Barbara. From a terminal at the Washington Hilton, conference attendees could copy a file created at Stanford onto the host at UCSB simply by running a `copy` command and answering a few of the computer’s questions: + +_`[ESC]`, `[SP]`, and `[CR]` below stand for the escape, space, and carriage return keys respectively. The words in parentheses are prompts printed by the computer. The escape key is used to autocomplete the filename on the third line. The file being copied here is called `sample.txt;1`, where the trailing one indicates the file’s version number and `` indicates the directory. This was a convention for filenames used by the TENEX operating system._[11][13] + +``` +@copy +(TO/FROM UCSB) to +(FILE) sample [ESC] .TXT;1 [CR] +(CREATE/REPLACE) create +``` + +These two scenarios might not look all that different from the first two, but they were remarkable. They were remarkable because they made it clear that, on the ARPANET, humans could talk to computers but computers could also talk to _each other._ The `SURVEY` results collected at MIT weren’t collected by a human regularly logging in to each machine to check if it was up—they were collected by a program that knew how to talk to the other machines on the network. Likewise, the file transfer from Stanford to UCSB didn’t involve any humans sitting at terminals at either Stanford or UCSB—the user at a terminal in Washington DC was able to get the two computers to talk each other merely by invoking a piece of software. Even more, it didn’t matter which of the 40 terminals in the Ballroom you were sitting at, because you could view the MIT network monitoring statistics or store files at UCSB using any of the terminals with almost the same sequence of commands. + +This is what was totally new about the ARPANET. The ICCC demonstration didn’t just involve a human communicating with a distant computer. It wasn’t just a demonstration of remote I/O. It was a demonstration of software remotely communicating with other software, something nobody had seen before. + +To really appreciate why it was this aspect of the ARPANET project that was important and not the wires-across-the-country, physical connection thing that the host maps suggest (the wires were leased phone lines anyhow and were already there!), consider that, before the ARPANET project began in 1966, the ARPA offices in the Pentagon had a terminal room. Inside it were three terminals. Each connected to a different computer; one computer was at MIT, one was at UC Berkeley, and another was in Santa Monica.[12][14] It was convenient for the ARPA staff that they could use these three computers even from Washington DC. But what was inconvenient for them was that they had to buy and maintain terminals from three different manufacturers, remember three different login procedures, and familiarize themselves with three different computing environments in order to use the computers. The terminals might have been right next to each other, but they were merely extensions of the host computing systems on the other end of the wire and operated as differently as the computers did. Communicating with a distant computer was possible before the ARPANET; the problem was that the heterogeneity of computing systems limited how sophisticated the communication could be. + +### Come Together, Right Now + +So what I’m trying to drive home here is that there is an important distinction between statement A, “the ARPANET connected people in different locations via computers for the first time,” and statement B, “the ARPANET connected computer systems to each other for the first time.” That might seem like splitting hairs, but statement A elides some illuminating history in a way that statement B does not. + +To begin with, the historian Joy Lisi Rankin has shown that people were socializing in cyberspace well before the ARPANET came along. In _A People’s History of Computing in the United States_, she describes several different digital communities that existed across the country on time-sharing networks prior to or apart from the ARPANET. These time-sharing networks were not, technically speaking, computer networks, since they consisted of a single mainframe computer running computations in a basement somewhere for many dumb terminals, like some portly chthonic creature with tentacles sprawling across the country. But they nevertheless enabled most of the social behavior now connoted by the word “network” in a post-Facebook world. For example, on the Kiewit Network, which was an extension of the Dartmouth Time-Sharing System to colleges and high schools across the Northeast, high school students collaboratively maintained a “gossip file” that allowed them to keep track of the exciting goings-on at other schools, “creating social connections from Connecticut to Maine.”[13][15] Meanwhile, women at Mount Holyoke College corresponded with men at Dartmouth over the network, perhaps to arrange dates or keep in touch with boyfriends.[14][16] This was all happening in the 1960s. Rankin argues that by ignoring these early time-sharing networks we impoverish our understanding of how American digital culture developed over the last 50 years, leaving room for a “Silicon Valley mythology” that credits everything to the individual genius of a select few founding fathers. + +As for the ARPANET itself, if we recognize that the key challenge was connecting the computer _systems_ and not just the physical computers, then that might change what we choose to emphasize when we tell the story of the innovations that made the ARPANET possible. The ARPANET was the first ever packet-switched network, and lots of impressive engineering went into making that happen. I think it’s a mistake, though, to say that the ARPANET was a breakthrough because it was the first packet-switched network and then leave it at that. The ARPANET was meant to make it easier for computer scientists across the country to collaborate; that project was as much about figuring out how different operating systems and programs written in different languages would interface with each other than it was about figuring out how to efficiently ferry data back and forth between Massachusetts and California. So the ARPANET was the first packet-switched network, but it was also an amazing standards success story—something I find especially interesting given [how][17] [many][18] [times][19] I’ve written about failed standards on this blog. + +Inventing the protocols for the ARPANET was an afterthought even at the time, so naturally the job fell to a group made up largely of graduate students. This group, later known as the Network Working Group, met for the first time at UC Santa Barbara in August of 1968.[15][20] There were 12 people present at that first meeting, most of whom were representatives from the four universities that were to be the first host sites on the ARPANET when the equipment was ready.[16][21] Steve Crocker, then a graduate student at UCLA, attended; he told me over a Zoom call that it was all young guys at that first meeting, and that Elmer Shapiro, who chaired the meeting, was probably the oldest one there at around 38. ARPA had not put anyone in charge of figuring out how the computers would communicate once they were connected, but it was obvious that some coordination was necessary. As the group continued to meet, Crocker kept expecting some “legitimate adult” with more experience and authority to fly out from the East Coast to take over, but that never happened. The Network Working Group had ARPA’s tacit approval—all those meetings involved lots of long road trips, and ARPA money covered the travel expenses—so they were it.[17][22] + +The Network Working Group faced a huge challenge. Nobody had ever sat down to connect computer systems together in a general-purpose way; that flew against all of the assumptions that prevailed in computing in the late 1960s: + +> The typical mainframe of the period behaved as if it were the only computer in the universe. There was no obvious or easy way to engage two diverse machines in even the minimal communication needed to move bits back and forth. You could connect machines, but once connected, what would they say to each other? In those days a computer interacted with devices that were attached to it, like a monarch communicating with his subjects. Everything connected to the main computer performed a specific task, and each peripheral device was presumed to be ready at all times for a fetch-my-slippers type command…. Computers were strictly designed for this kind of interaction; they send instructions to subordinate card readers, terminals, and tape units, and they initiate all dialogues. But if another device in effect tapped the computer on the shoulder with a signal and said, “Hi, I’m a computer too,” the receiving machine would be stumped.[18][23] + +As a result, the Network Working Group’s progress was initially slow.[19][24] The group did not settle on an “official” specification for any protocol until June, 1970, nearly two years after the group’s first meeting.[20][25] + +But by the time the ARPANET was to be shown off at the 1972 ICCC, all the key protocols were in place. A scenario like the chess scenario exercised many of them. When a user ran the command `@e r`, short for `@echo remote`, that instructed the TIP to make use of a facility in the new TELNET virtual teletype protocol to inform the remote host that it should echo the user’s input. When a user then ran the command `@L 134`, short for `@login 134`, that caused the TIP to invoke the Initial Connection Protocol with host 134, which in turn would cause the remote host to allocate all the necessary resources for the connection and drop the user into a TELNET session. (The file transfer scenario I described may well have made use of the File Transfer Protocol, though that protocol was only ready shortly before the conference.[21][26]) All of these protocols were known as “level three” protocols, and below them were the host-to-host protocol at level two (which defined the basic format for the messages the hosts should expect from each other), and the host-to-IMP protocol at level one (which defined how hosts communicated with the routing equipment they were linked to). Incredibly, the protocols all worked. + +In my view, the Network Working Group was able to get everything together in time and just generally excel at its task because it adopted an open and informal approach to standardization, as exemplified by the famous Request for Comments (RFC) series of documents. These documents, originally circulated among the members of the Network Working Group by snail mail, were a way of keeping in touch between meetings and soliciting feedback to ideas. The “Request for Comments” framing was suggested by Steve Crocker, who authored the first RFC and supervised the RFC mailing list in the early years, in an attempt to emphasize the open-ended and collaborative nature of what the group was trying to do. That framing, and the availability of the documents themselves, made the protocol design process into a melting pot of contributions and riffs on other people’s contributions where the best ideas could emerge without anyone losing face. The RFC process was a smashing success and is still used to specify internet standards today, half a century later. + +It’s this legacy of the Network Working Group that I think we should highlight when we talk about ARPANET’s impact. Though today one of the most magical things about the internet is that it can connect us with people on the other side of the planet, it’s only slightly facetious to say that that technology has been with us since the 19th century. Physical distance was conquered well before the ARPANET by the telegraph. The kind of distance conquered by the ARPANET was instead the logical distance between the operating systems, character codes, programming languages, and organizational policies employed at each host site. Implementing the first packet-switched network was of course a major feat of engineering that should also be mentioned, but the problem of agreeing on standards to connect computers that had never been designed to play nice with each other was the harder of the two big problems involved in building the ARPANET—and its solution was the most miraculous part of the ARPANET story. + +In 1981, ARPA issued a “Completion Report” reviewing the first decade of the ARPANET’s history. In a section with the belabored title, “Technical Aspects of the Effort Which Were Successful and Aspects of the Effort Which Did Not Materialize as Originally Envisaged,” the authors wrote: + +> Possibly the most difficult task undertaken in the development of the ARPANET was the attempt—which proved successful—to make a number of independent host computer systems of varying manufacture, and varying operating systems within a single manufactured type, communicate with each other despite their diverse characteristics.[22][27] + +There you have it from no less a source than the federal government of the United States. + +_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][28] on Twitter or subscribe to the [RSS feed][29] to make sure you know when a new post is out._ + +_Previously on TwoBitHistory…_ + +> It's been too long, I know, but I finally got around to writing a new post. This one is about how REST APIs should really be known as FIOH APIs instead (Fuck It, Overload HTTP): +> +> — TwoBitHistory (@TwoBitHistory) [June 28, 2020][30] + + 1. “Hilton Hotel Opens in Capital Today.” _The New York Times_, 20 March 1965, . Accessed 7 Feb. 2021. [↩︎][31] + + 2. James Pelkey. _Entrepreneurial Capitalism and Innovation: A History of Computer Communications 1968-1988,_ Chapter 4, Section 12, 2007, . Accessed 7 Feb. 2021. [↩︎][32] + + 3. Katie Hafner and Matthew Lyon. _Where Wizards Stay Up Late: The Origins of the Internet_. New York, Simon & Schuster, 1996, p. 178. [↩︎][33] + + 4. “International Conference on Computer Communication.” _Computer_, vol. 5, no. 4, 1972, p. c2, . Accessed 7 Feb. 2021. [↩︎][34] + + 5. “Program for the International Conference on Computer Communication.” _The Papers of Clay T. Whitehead_, Box 42, . Accessed 7 Feb. 2021. [↩︎][35] + + 6. It’s actually not clear to me which room was used for the ARPANET demonstration. Lots of sources talk about a “ballroom,” but the Washington Hilton seems to consider the room with the name “Georgetown” more of a meeting room. So perhaps the demonstration was in the International Ballroom instead. But RFC 372 alludes to a booking of the “Georgetown Ballroom” for the demonstration. A floorplan of the Washington Hilton can be found [here][36]. [↩︎][37] + + 7. Hafner, p. 179. [↩︎][38] + + 8. ibid., p. 178. [↩︎][39] + + 9. Bob Metcalfe. “Scenarios for Using the ARPANET.” _Collections-Computer History Museum_, . Accessed 7 Feb. 2021. [↩︎][40] + + 10. Hafner, p. 176. [↩︎][41] + + 11. Robert H. Thomas. “Planning for ACCAT Remote Site Operations.” BBN Report No. 3677, October 1977, . Accessed 7 Feb. 2021. [↩︎][42] + + 12. Hafner, p. 12. [↩︎][43] + + 13. Joy Lisi Rankin. _A People’s History of Computing in the United States_. Cambridge, MA, Harvard University Press, 2018, p. 84. [↩︎][44] + + 14. Rankin, p. 93. [↩︎][45] + + 15. Steve Crocker. Personal interview. 17 Dec. 2020. [↩︎][46] + + 16. Crocker sent me the minutes for this meeting. The document lists everyone who attended. [↩︎][47] + + 17. Steve Crocker. Personal interview. [↩︎][48] + + 18. Hafner, p. 146. [↩︎][49] + + 19. “Completion Report / A History of the ARPANET: The First Decade.” BBN Report No. 4799, April 1981, , p. II-13. [↩︎][50] + + 20. I’m referring here to RFC 54, “Official Protocol Proffering.” [↩︎][51] + + 21. Hafner, p. 175. [↩︎][52] + + 22. “Completion Report / A History of the ARPANET: The First Decade,” p. II-29. [↩︎][53] + + + + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2021/02/07/arpanet.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]: https://en.wikipedia.org/wiki/ARPANET +[2]: tmp.pnPpRrCI3S#fn:1 +[3]: tmp.pnPpRrCI3S#fn:2 +[4]: tmp.pnPpRrCI3S#fn:3 +[5]: tmp.pnPpRrCI3S#fn:4 +[6]: tmp.pnPpRrCI3S#fn:5 +[7]: tmp.pnPpRrCI3S#fn:6 +[8]: tmp.pnPpRrCI3S#fn:7 +[9]: tmp.pnPpRrCI3S#fn:8 +[10]: https://archive.computerhistory.org/resources/access/text/2019/07/102784024-05-001-acc.pdf +[11]: tmp.pnPpRrCI3S#fn:9 +[12]: tmp.pnPpRrCI3S#fn:10 +[13]: tmp.pnPpRrCI3S#fn:11 +[14]: tmp.pnPpRrCI3S#fn:12 +[15]: tmp.pnPpRrCI3S#fn:13 +[16]: tmp.pnPpRrCI3S#fn:14 +[17]: https://twobithistory.org/2018/05/27/semantic-web.html +[18]: https://twobithistory.org/2018/12/18/rss.html +[19]: https://twobithistory.org/2020/01/05/foaf.html +[20]: tmp.pnPpRrCI3S#fn:15 +[21]: tmp.pnPpRrCI3S#fn:16 +[22]: tmp.pnPpRrCI3S#fn:17 +[23]: tmp.pnPpRrCI3S#fn:18 +[24]: tmp.pnPpRrCI3S#fn:19 +[25]: tmp.pnPpRrCI3S#fn:20 +[26]: tmp.pnPpRrCI3S#fn:21 +[27]: tmp.pnPpRrCI3S#fn:22 +[28]: https://twitter.com/TwoBitHistory +[29]: https://twobithistory.org/feed.xml +[30]: https://twitter.com/TwoBitHistory/status/1277259930555363329?ref_src=twsrc%5Etfw +[31]: tmp.pnPpRrCI3S#fnref:1 +[32]: tmp.pnPpRrCI3S#fnref:2 +[33]: tmp.pnPpRrCI3S#fnref:3 +[34]: tmp.pnPpRrCI3S#fnref:4 +[35]: tmp.pnPpRrCI3S#fnref:5 +[36]: https://www3.hilton.com/resources/media/hi/DCAWHHH/en_US/pdf/DCAWH.Floorplans.Apr25.pdf +[37]: tmp.pnPpRrCI3S#fnref:6 +[38]: tmp.pnPpRrCI3S#fnref:7 +[39]: tmp.pnPpRrCI3S#fnref:8 +[40]: tmp.pnPpRrCI3S#fnref:9 +[41]: tmp.pnPpRrCI3S#fnref:10 +[42]: tmp.pnPpRrCI3S#fnref:11 +[43]: tmp.pnPpRrCI3S#fnref:12 +[44]: tmp.pnPpRrCI3S#fnref:13 +[45]: tmp.pnPpRrCI3S#fnref:14 +[46]: tmp.pnPpRrCI3S#fnref:15 +[47]: tmp.pnPpRrCI3S#fnref:16 +[48]: tmp.pnPpRrCI3S#fnref:17 +[49]: tmp.pnPpRrCI3S#fnref:18 +[50]: tmp.pnPpRrCI3S#fnref:19 +[51]: tmp.pnPpRrCI3S#fnref:20 +[52]: tmp.pnPpRrCI3S#fnref:21 +[53]: tmp.pnPpRrCI3S#fnref:22 From fa63a254d38db40d785fd985fb8be9f8d437cf9d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 8 Feb 2021 09:33:58 +0800 Subject: [PATCH 227/381] Rename sources/tech/20210207 Why the success of open source depends on empathy.md to sources/talk/20210207 Why the success of open source depends on empathy.md --- .../20210207 Why the success of open source depends on empathy.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210207 Why the success of open source depends on empathy.md (100%) diff --git a/sources/tech/20210207 Why the success of open source depends on empathy.md b/sources/talk/20210207 Why the success of open source depends on empathy.md similarity index 100% rename from sources/tech/20210207 Why the success of open source depends on empathy.md rename to sources/talk/20210207 Why the success of open source depends on empathy.md From 3781082e38b8792bf1dd7b7548be1a07626e367c Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 8 Feb 2021 10:01:17 +0800 Subject: [PATCH 228/381] translated --- ... Helper and Pacman Wrapper Based on Yay.md | 155 ------------------ ... Helper and Pacman Wrapper Based on Yay.md | 155 ++++++++++++++++++ 2 files changed, 155 insertions(+), 155 deletions(-) delete mode 100644 sources/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md create mode 100644 translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md diff --git a/sources/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md b/sources/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md deleted file mode 100644 index 7be70e4de5..0000000000 --- a/sources/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md +++ /dev/null @@ -1,155 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Paru – A New AUR Helper and Pacman Wrapper Based on Yay) -[#]: via: (https://itsfoss.com/paru-aur-helper/) -[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) - -Paru – A New AUR Helper and Pacman Wrapper Based on Yay -====== - -One of the [main reasons that a user chooses Arch Linux][1] or an [Arch based Linux distribution][2] is the [Arch User repository (AUR)][3]. - -Unfortunately, [pacman][4], the package manager of Arch, can’t access the AUR in a similar way to the official repositories. The packages in AUR are in the form of [PKGBUILD][5] and require a manual process to be built. - -An AUR helper can automate this process. Without any doubt [yay][6] is one of the most popular and highly favoured AUR helper. - -Recently [Morganamilo][7], one of the two developers of yay, [announced][8] that is stepping away from maintaining yay and starting his own AUR helper called [paru][9]. Paru is written in [Rust][10] compared to yay that is written in [Go][11] and its design is based on yay. - -Please note that yay hasn’t reach the end of life and is still being actively maintained by [Jguer][12]. He also [commented][13] that paru may be suitable for users that looking for a feature rich AUR helper; thus I would recommend giving it a try. - -### Installing Paru AUR helper - -To install paru, open your terminal and type the following commands one by one. - -``` -sudo pacman -S --needed base-devel -git clone https://aur.archlinux.org/paru.git -cd paru -makepkg -si -``` - -Now that you have it installed, let’s see how to use it. - -### Essential commands to use Paru AUR helper - -In my opinion these are the most essential commands of paru. You can explore more on the official repository on [GitHub][9]. - - * **paru <userinput>** : Search and install <userinput>. - * **paru —** : Alias for paru -Syu - * **paru -Sua** : Upgrade AUR packages only - * **paru -Qua** : Print available AUR updates - * **paru -Gc <userinput>** : Print the AUR comments of <userinput> - - - -### Using Paru AUR helper to its full extent - -You can access the [changelog][14] of paru on GitHub for the full changelog history or you can see the changes from yay at the [first release][15]. - -#### Enable colour in Paru - -To enable colour in paru, you have to enable it first in pacman. All the [configuration files][16] are in /etc directory. In this example, I [use Nano text editor][17] but, you may use any [terminal-based text editor][18] of your choice. - -``` -sudo nano /etc/pacman.conf -``` - -Once you open the pacman configuration file, uncomment the “Color” to enable this feature. - -![][19] - -#### **Flip search order** - -The most relevant package according to your search term is normally displayed on the top of the search result. In paru, you can flip the search order to make your search easier. - -Similar to the previous example, open the paru configuration file: - -``` -sudo nano /etc/paru.conf -``` - -Uncomment the “BottomUp” term and save the file. - -![][20] - -As you can see the order is flipped and the first package appears on the bottom. - -![][21] - -#### **Edit PKGBUILDs** (For advanced user) - -If you are an experienced Linux user, you can edit AUR packages through paru. To do so, you need to enable the feature from the paru configuration file and set the file manager of your choice. - -In this example I will use the default in the configuration file i.e. the vifm file manager. If you haven’t used it you may need to install it. - -``` -sudo pacman -S vifm -sudo nano /etc/paru.conf -``` - -Open the configuration file and uncomment as shown below. - -![][22] - -Let’s go back to the [Google Calendar][23] AUR package and try to install it. You will be prompted to review the package. Type yes and click enter. - -![][24] - -Choose the PKGBUILD from the file manager and hit enter to view the package. - -![][25] - -Any change that you make will be permanent and the next time you upgrade the package, your changes will be merged with the upstream package. - -![][26] - -### Conclusion - -Paru is another interesting addition to the [AUR helpers family][27] with a promising future. At this point I wouldn’t suggest replacing yay as it is still maintained but definitely give paru a try. You can have both of them installed to your system and come to your own conclusions. - -To get the latest [Linux news][28], subscribe to our social media to be among the first to get them whilst they are fresh! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/paru-aur-helper/ - -作者:[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/why-arch-linux/ -[2]: https://itsfoss.com/arch-based-linux-distros/ -[3]: https://itsfoss.com/aur-arch-linux/ -[4]: https://itsfoss.com/pacman-command/ -[5]: https://wiki.archlinux.org/index.php/PKGBUILD -[6]: https://news.itsfoss.com/qt-6-released/ -[7]: https://github.com/Morganamilo -[8]: https://www.reddit.com/r/archlinux/comments/jjn1c1/paru_v100_and_stepping_away_from_yay/ -[9]: https://github.com/Morganamilo/paru -[10]: https://www.rust-lang.org/ -[11]: https://golang.org/ -[12]: https://github.com/Jguer -[13]: https://aur.archlinux.org/packages/yay/#pinned-788241 -[14]: https://github.com/Morganamilo/paru/releases -[15]: https://github.com/Morganamilo/paru/releases/tag/v1.0.0 -[16]: https://linuxhandbook.com/linux-directory-structure/#-etc-configuration-files -[17]: https://itsfoss.com/nano-editor-guide/ -[18]: https://itsfoss.com/command-line-text-editors-linux/ -[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/pacman.conf-color.png?resize=800%2C480&ssl=1 -[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-bottomup.png?resize=800%2C480&ssl=1 -[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-bottomup-2.png?resize=800%2C480&ssl=1 -[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-vifm.png?resize=732%2C439&ssl=1 -[23]: https://aur.archlinux.org/packages/gcalcli/ -[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review.png?resize=800%2C480&ssl=1 -[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review-2.png?resize=800%2C480&ssl=1 -[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review-3.png?resize=800%2C480&ssl=1 -[27]: https://itsfoss.com/best-aur-helpers/ -[28]: https://news.itsfoss.com/ diff --git a/translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md b/translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md new file mode 100644 index 0000000000..5ad643b667 --- /dev/null +++ b/translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md @@ -0,0 +1,155 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Paru – A New AUR Helper and Pacman Wrapper Based on Yay) +[#]: via: (https://itsfoss.com/paru-aur-helper/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +Paru – 基于 Yay 的新 AUR 助手及 Pacman 包装器 +====== + +[用户选择 Arch Linux][1] 或 [基于 Arch 的 Linux 发行版][2]的主要原因之一就是 [Arch 用户仓库(AUR)][3]。 + +遗憾的是,[pacman][4],也就是 Arch 的包管理器,不能以类似官方仓库的方式访问 AUR。AUR 中的包是以 [PKGBUILD][5] 的形式存在的,需要手动过程来构建。 + +AUR 助手可以自动完成这个过程。毫无疑问,[yay][6] 是最受欢迎和备受青睐的 AUR 助手之一。 + +最近,yay 的两位开发者之一的 [Morganamilo][7] [宣布][8]将退出 yay 的维护工作,以开始自己的 AUR 助手 [paru][9]。Paru 是用 [Rust][10] 编写的,而 yay 是用 [Go][11] 编写的,它的设计是基于 yay 的。 + +请注意,yay 还没有结束支持,它仍然由 [Jguer][12] 积极维护。他还[评论][13]说,paru 可能适合那些寻找丰富功能的 AUR 助手的用户。因此我推荐大家尝试一下。 + +### 安装 Paru AUR 助手 + +要安装 paru,打开你的终端,逐一输入以下命令。 + +``` +sudo pacman -S --needed base-devel +git clone https://aur.archlinux.org/paru.git +cd paru +makepkg -si +``` + +现在已经安装好了,让我们来看看如何使用它。 + +### 使用 Paru AUR 助手的基本命令 + +在我看来,这些都是 paru 最基本的命令。你可以在 [GitHub][9] 的官方仓库中探索更多。 + + * **paru <用户输入>**:搜索并安装<用户输入> + * **paru -**:paru -Syu 的别名 + * **paru -Sua** :仅升级 AUR 包。 + * **paru -Qua**:打印可用的 AUR 更新 + * **paru -Gc <用户输入>**:打印<用户输入>的 AUR 评论 + + + +### 充分使用 Paru AUR 助手 + +你可以在 GitHub 上访问 paru 的[更新日志][14]来查看完整的变更日志历史,或者你可以在[首次发布][15]中查看来自 yay 的更改。 + +#### 在 Paru 中启用颜色 + +要在 paru 中启用颜色,你必须先在 pacman 中启用它。所有的[配置文件][16]都在 /etc 目录下。在此例中,我[使用 Nano 文本编辑器][17],但是,你可以选择使用任何[基于终端的文本编辑器][18]。 + +``` +sudo nano /etc/pacman.conf +``` + +打开 pacman 配置文件后,取消 “Color” 的注释,即可启用此功能。 + +![][19] + +#### **反转搜索顺序** + +根据你的搜索条件,最相关的包通常会显示在搜索结果的顶部。在 paru 中,你可以反转搜索顺序,使你的搜索更容易。 + +与前面的例子类似,打开 paru 配置文件: + +``` +sudo nano /etc/paru.conf +``` + +取消注释 “BottomUp” 项,然后保存文件。 + +![][20] + +如你所见,顺序是反转的,第一个包出现在了底部。 + +![][21] + +#### **编辑 PKGBUILD** (对于高级用户) + +如果你是一个有经验的 Linux 用户,你可以通过 paru 编辑 AUR 包。要做到这一点,你需要在 paru 配置文件中启用该功能,并设置你所选择的文件管理器。 + +在此例中,我将使用配置文件中的默认值,即 vifm 文件管理器。如果你还没有使用过它,你可能需要安装它。 + +``` +sudo pacman -S vifm +sudo nano /etc/paru.conf +``` + +打开配置文件,如下所示取消注释。 + +![][22] + +让我们回到 [Google Calendar][23] 的 AUR 包,并尝试安装它。系统会提示你审查该软件包。输入 Y 并按下回车。 + +![][24] + +从文件管理器中选择 PKGBUILD,然后按下回车查看软件包。 + +![][25] + +你所做的任何改变都将是永久性的,下次升级软件包时,你的改变将与上游软件包合并。 + +![][26] + +### 总结 + +Paru 是 [AUR 助手家族][27]的又一个有趣的新成员,前途光明。此时,我不建议更换 yay,因为它还在维护,但一定要试试 paru。你可以把它们两个都安装到你的系统中,然后得出自己的结论。 + +要获得最新的 [Linux 新闻][28],请订阅我们的社交媒体,以便在第一时间获取新闻! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/paru-aur-helper/ + +作者:[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://itsfoss.com/why-arch-linux/ +[2]: https://itsfoss.com/arch-based-linux-distros/ +[3]: https://itsfoss.com/aur-arch-linux/ +[4]: https://itsfoss.com/pacman-command/ +[5]: https://wiki.archlinux.org/index.php/PKGBUILD +[6]: https://news.itsfoss.com/qt-6-released/ +[7]: https://github.com/Morganamilo +[8]: https://www.reddit.com/r/archlinux/comments/jjn1c1/paru_v100_and_stepping_away_from_yay/ +[9]: https://github.com/Morganamilo/paru +[10]: https://www.rust-lang.org/ +[11]: https://golang.org/ +[12]: https://github.com/Jguer +[13]: https://aur.archlinux.org/packages/yay/#pinned-788241 +[14]: https://github.com/Morganamilo/paru/releases +[15]: https://github.com/Morganamilo/paru/releases/tag/v1.0.0 +[16]: https://linuxhandbook.com/linux-directory-structure/#-etc-configuration-files +[17]: https://itsfoss.com/nano-editor-guide/ +[18]: https://itsfoss.com/command-line-text-editors-linux/ +[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/pacman.conf-color.png?resize=800%2C480&ssl=1 +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-bottomup.png?resize=800%2C480&ssl=1 +[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-bottomup-2.png?resize=800%2C480&ssl=1 +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-vifm.png?resize=732%2C439&ssl=1 +[23]: https://aur.archlinux.org/packages/gcalcli/ +[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review.png?resize=800%2C480&ssl=1 +[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review-2.png?resize=800%2C480&ssl=1 +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review-3.png?resize=800%2C480&ssl=1 +[27]: https://itsfoss.com/best-aur-helpers/ +[28]: https://news.itsfoss.com/ \ No newline at end of file From 68aa5983a3fb14d7bed57b63cbc0d0ee14e0dc75 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 8 Feb 2021 10:05:31 +0800 Subject: [PATCH 229/381] translating --- sources/tech/20210129 Manage containers with Podman Compose.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210129 Manage containers with Podman Compose.md b/sources/tech/20210129 Manage containers with Podman Compose.md index ff652c2c2d..5a4c7f1449 100644 --- a/sources/tech/20210129 Manage containers with Podman Compose.md +++ b/sources/tech/20210129 Manage containers with Podman Compose.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ecce4841aed5a8ccfc65ce9d3707c97197ff5426 Mon Sep 17 00:00:00 2001 From: Hilton Chain <26847027+rakino@users.noreply.github.com> Date: Mon, 8 Feb 2021 19:11:04 +0800 Subject: [PATCH 230/381] translated --- ...0615 LaTeX Typesetting - Part 1 (Lists).md | 128 +++++++++--------- 1 file changed, 65 insertions(+), 63 deletions(-) rename {sources => translated}/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md (50%) diff --git a/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md b/translated/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md similarity index 50% rename from sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md rename to translated/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md index 662a093a57..450c83807e 100644 --- a/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md +++ b/translated/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md @@ -1,34 +1,36 @@ -[#]: collector: (lujun9972) -[#]: translator: (rakino) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (LaTeX Typesetting – Part 1 (Lists)) -[#]: via: (https://fedoramagazine.org/latex-typesetting-part-1/) -[#]: author: (Earl Ramirez https://fedoramagazine.org/author/earlramirez/) +[#]: collector: "lujun9972" +[#]: translator: "rakino" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "LaTeX Typesetting – Part 1 (Lists)" +[#]: via: "https://fedoramagazine.org/latex-typesetting-part-1/" +[#]: author: "Earl Ramirez https://fedoramagazine.org/author/earlramirez/" -LaTeX Typesetting – Part 1 (Lists) +LaTeX 排版——第 1 部分:列表 ====== ![][1] -This series builds on the previous articles: [Typeset your docs with LaTex and TeXstudio on Fedora][2] and [LaTeX 101 for beginners][3]. This first part of the series is about LaTeX lists. - -### Types of lists - -LaTeX lists are enclosed environments, and each item in the list can take a line of text to a full paragraph. There are three types of lists available in LaTeX. They are: - - * **Itemized**: unordered or bullet - * **Enumerated**: ordered - * **Description**: descriptive +本系列基于前文 [Typeset your docs with LaTex and TeXstudio on Fedora][2] 和 [LaTeX 101 for beginners][3],本文即系列的第一部分是关于 LaTeX 列表的。 -### Creating lists +### 列表类型 -To create a list, prefix each list item with the \_item_ command. Precede and follow the list of items with the \_begin_{<type>} and \_end_{<type>} commands respectively where <type> is substituted with the type of the list as illustrated in the following examples. +LaTeX 中的列表是封闭的环境,列表中的每个项目可以取一行文字到一个完整的段落。在 LaTeX 中有三种列表类型: -#### Itemized list + * **itemize**: 无序列表unordered list/项目符号列表bullet list + * **enumerate**: 有序列表ordered list + * **description**: 描述列表descriptive list + + + +### 创建列表 + +要创建一个列表,需要在每个项目前加上控制序列 \\_item_,并在项目清单前后分别加上控制序列 \\_begin_{<类型>} 和 \\_end_{<类型>}(将其中的 <类型> 替换为将要使用的列表类型),如下例: + +#### itemize(无序列表) ``` \begin{itemize} @@ -40,7 +42,7 @@ To create a list, prefix each list item with the \_item_ command. Precede and fo ![][4] -#### Enumerated list +#### enumerate(有序列表) ``` \begin{enumerate} @@ -52,7 +54,7 @@ To create a list, prefix each list item with the \_item_ command. Precede and fo ![][5] -#### Descriptive list +#### description(描述列表) ``` \begin{description} @@ -63,13 +65,13 @@ To create a list, prefix each list item with the \_item_ command. Precede and fo ![][6] -### Spacing list items +### 列表项目间距 -The default spacing can be customized by adding \_usepackage{enumitem}_ to the preamble. The _enumitem_ package enables the _noitemsep_ option and the \_itemsep_ command which you can use on your lists as illustrated below. +可以通过在导言区加入 \\_usepackage{enumitem}_ 来自定义默认的间距,宏包 _enumitem_ 启用了选项 _noitemsep_ 和控制序列 \\_itemsep_ ,可以在列表中使用他们,如下例所示: -#### Using the noitemsep option +#### 使用选项 noitemsep -Enclose the _noitemsep_ option in square brackets and place it on the \_begin_ command as shown below. This option removes the default spacing. +将选项 _noitemsep_ 封闭在方括号内,并同下文所示放在控制序列 \\_begin_ 之后,该选项将移除默认的间距。 ``` \begin{itemize}[noitemsep] @@ -81,9 +83,9 @@ Enclose the _noitemsep_ option in square brackets and place it on the \_begin_ c ![][7] -#### Using the \itemsep command +#### 使用控制序列 \itemsep -The \_itemsep_ command must be suffixed with a number to indicate how much space there should be between the list items. +控制序列 \\_itemsep_ 必须以一个数字作为后缀,用以表示列表项目之间应该有多少空间。 ``` \begin{itemize} \itemsep0.75pt @@ -94,11 +96,11 @@ The \_itemsep_ command must be suffixed with a number to indicate how much space ![][8] -### Nesting lists +### 嵌套列表 -LaTeX supports nested lists up to four levels deep as illustrated below. +LaTeX 最多最多支持四层嵌套列表,如下例: -#### Nested itemized lists +#### 嵌套无序列表 ``` \begin{itemize}[noitemsep] @@ -122,7 +124,7 @@ LaTeX supports nested lists up to four levels deep as illustrated below. ![][9] -#### Nested enumerated lists +#### 嵌套有序列表 ``` \begin{enumerate}[noitemsep] @@ -146,32 +148,32 @@ LaTeX supports nested lists up to four levels deep as illustrated below. ![][10] -### List style names for each list type +### 每种列表类型的列表样式名称 -**Enumerated** | **Itemized** +**enumerate(有序列表)** | **itemize(无序列表)** ---|--- -\alph* | $\bullet$ -\Alph* | $\cdot$ -\arabic* | $\diamond$ -\roman* | $\ast$ -\Roman* | $\circ$ -| $-$ +\alph* (小写字母) | $\bullet$ (Bullet) +\Alph* (大写字母) | $\cdot$ (Period) +\arabic* (阿拉伯数字) | $\diamond$ (Diamond) +\roman* (小写罗马数字) | $\ast$ (Asterisk) +\Roman* (大写罗马数字) | $\circ$ (Circle) +| $-$ (Dash) -### Default style by list depth +### 按嵌套深度划分的默认样式 -**Level** | **Enumerated** | **Itemized** +**嵌套深度** | **enumerate(有序列表)** | **itemize(无序列表)** ---|---|--- -1 | Number | Bullet -2 | Lowercase alphabet | Dash -3 | Roman numerals | Asterisk -4 | Uppercase alphabet | Period +1 | 阿拉伯数字 | Bullet +2 | 小写字母 | Dash +3 | 小写罗马数字 | Asterisk +4 | 大写字母 | Period -### Setting list styles +### 设置列表样式 -The below example illustrates each of the different itemiszed list styles. +下面的例子列举了无序列表的不同样式。 ``` -% Itemize style +% 无序列表样式 \begin{itemize} \item[$\ast$] Asterisk \item[$\diamond$] Diamond @@ -185,14 +187,14 @@ The below example illustrates each of the different itemiszed list styles. ![][11] -There are three methods of setting list styles. They are illustrated below. These methods are listed by priority; highest priority first. A higher priority will override a lower priority if more than one is defined for a list item. +有三种设置列表样式的方式,下面将按照优先级从高到低的顺序分别举例。 -#### List styling method 1 – per item +#### 方式一:为各项目单独设置 -Enclose the name of the desired style in square brackets and place it on the \_item_ command as demonstrated below. +将需要的样式名称封闭在方括号内,并放在控制序列 \\_item_ 之后,如下例: ``` -% First method +% 方式一 \begin{itemize} \item[$\ast$] Asterisk \item[$\diamond$] Diamond @@ -204,12 +206,12 @@ Enclose the name of the desired style in square brackets and place it on the \_i \end{itemize} ``` -#### List styling method 2 – on the list +#### 方式二:为整个列表设置 -Prefix the name of the desired style with _label=_. Place the parameter, including the _label=_ prefix, in square brackets on the \_begin_ command as demonstrated below. +将需要的样式名称以 _label=_ 前缀并封闭在方括号内,放在控制序列 _\begin_ 之后,如下例: ``` -% Second method +% 方式二 \begin{enumerate}[label=\Alph*.] \item Fedora 32 \item Fedora 31 @@ -217,23 +219,23 @@ Prefix the name of the desired style with _label=_. Place the parameter, includi \end{enumerate} ``` -#### List styling method 3 – on the document +#### 方式三:为整个文档设置 -This method changes the default style for the entire document. Use the \_renewcommand_ to set the values for the labelitems. There is a different labelitem for each of the four label depths as demonstrated below. +该方式将改变整个文档的默认样式。使用 \\_renewcommand_ 来设置项目标签的值,下例分别为四个嵌套深度的项目标签设置了不同的样式。 ``` -% Third method +% 方式三 \renewcommand{\labelitemi}{$\ast$} \renewcommand{\labelitemii}{$\diamond$} \renewcommand{\labelitemiii}{$\bullet$} \renewcommand{\labelitemiv}{$-$} ``` -### Summary +### 总结 -LaTeX supports three types of lists. The style and spacing of each of the list types can be customized. More LaTeX elements will be explained in future posts. +LaTeX 支持三种列表,而每种列表的风格和间距都是可以自定义的。在以后的文章中,我们将解释更多的 LaTeX 元素。 -Additional reading about LaTeX lists can be found here: [LaTeX List Structures][12] +关于 LaTeX 列表的延伸阅读可以在这里找到:[LaTeX List Structures][12] -------------------------------------------------------------------------------- From 51ccb29b5cd76f2b0c34dfd883dcd23c75dac7b5 Mon Sep 17 00:00:00 2001 From: LazyWolfLin Date: Mon, 8 Feb 2021 22:21:27 +0800 Subject: [PATCH 231/381] Revert. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 查找资料时发现该文章已有[翻译](https://studygolang.com/articles/28992),因此取消申请。 --- .../tech/20200524 Diamond interface composition in Go 1.14.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 34ad6bd5cd..611bb2c39e 100644 --- a/sources/tech/20200524 Diamond interface composition in Go 1.14.md +++ b/sources/tech/20200524 Diamond interface composition in Go 1.14.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (LazyWolfLin) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9e0bc965cacb8ff54e3d780cc8d3af15ff2d973c Mon Sep 17 00:00:00 2001 From: Percy Date: Tue, 9 Feb 2021 00:58:35 +0800 Subject: [PATCH 232/381] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8E=9F=E6=96=87:?= =?UTF-8?q?=20Why=20the=20success=20of=20open=20source=20depends=20on=20em?= =?UTF-8?q?pathy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0210207 Why the success of open source depends on empathy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210207 Why the success of open source depends on empathy.md b/sources/talk/20210207 Why the success of open source depends on empathy.md index cc2219187e..8ad1d941b2 100644 --- a/sources/talk/20210207 Why the success of open source depends on empathy.md +++ b/sources/talk/20210207 Why the success of open source depends on empathy.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (scvoet) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c4fb5ef50baf84536d441ef6b97d898a9c669674 Mon Sep 17 00:00:00 2001 From: Percy Date: Tue, 9 Feb 2021 02:09:07 +0800 Subject: [PATCH 233/381] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87:?= =?UTF-8?q?=2020210207=20Why=20the=20success=20of=20open=20source=20depend?= =?UTF-8?q?s=20on=20empathy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ccess of open source depends on empathy.md | 58 ------------------- ...ccess of open source depends on empathy.md | 58 +++++++++++++++++++ 2 files changed, 58 insertions(+), 58 deletions(-) delete mode 100644 sources/talk/20210207 Why the success of open source depends on empathy.md create mode 100644 translated/talk/20210207 Why the success of open source depends on empathy.md diff --git a/sources/talk/20210207 Why the success of open source depends on empathy.md b/sources/talk/20210207 Why the success of open source depends on empathy.md deleted file mode 100644 index 8ad1d941b2..0000000000 --- a/sources/talk/20210207 Why the success of open source depends on empathy.md +++ /dev/null @@ -1,58 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (scvoet) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why the success of open source depends on empathy) -[#]: via: (https://opensource.com/article/21/2/open-source-empathy) -[#]: author: (Bronagh Sorota https://opensource.com/users/bsorota) - -Why the success of open source depends on empathy -====== -With heightened awareness about empathy and the inspiration to spread -it, open source productivity will grow, collaborators will lean in, and -the power of open source software development can be fully harnessed. -![Practicing empathy][1] - -Open source development's collaborative innovation and community ethos have changed the world. In [_The Open Organization_][2], Jim Whitehurst explains that success in open source is found by "thinking of people as members of a community, moving from a transactional mindset to one built on commitment." However, there is still a barrier at the core of the open source development model: Frequently, it lacks human empathy. - -Empathy is the ability to understand and share another person's feelings. In open source communities, face-to-face human interaction and collaboration are rare. Any developer experienced with a GitHub pull request (PR) or issue has received comments from people they may never meet, often halfway across the globe—and the communication can be just as distant. Modern open source development is built upon this type of asynchronous, transactional communication. So, it is no surprise that the same types of cyberbullying and other abuses people experience on social media platforms are also seen in open source communities. - -Of course, not all open source communication is counterproductive. Many people develop respect and commit to good behavioral standards in their craft. But all too often, people lack common-sense etiquette in communications and treat people like machines rather than human beings. This behavior is a barrier to realizing the open source innovation model's full potential because it turns off many would-be contributors and kills inspiration. - -### A history of hostile communications - -Hostile rhetoric in code reviews is not new to open source communities; it has been tolerated for years. The godfather of open source, Linus Torvalds, routinely [barraged][3] the Linux community when code did not meet his standards, driving contributors away. Elon University computer science professor Megan Squire used [machine learning][4] to analyze Torvalds' insults and found they numbered in the thousands during a four-year period. In 2018, Linus put himself on a timeout for bad behavior, tasked himself with learning empathy, apologized, and established a code of conduct for the Linux community. - -In 2015, [Sage Sharp][5] stepped down as the Linux kernel coordinator for the FOSS Outreach Program for Women due to a lack of personal respect, despite being technically respected. - -The impact of disparaging comments in PR reviews has a profound effect on developers. It creates trepidation in making PRs and dread at anticipated feedback, and it eats at developers' confidence in their abilities. It slows velocity by forcing engineers to strive for perfection every time, which runs counter to the agile methodology many communities have adopted. - -### How to close the empathy gap in open source - -Often, offensive comments are unintentional, and with some coaching, the author can learn how to express opinions without negative emotion. GitHub does not monitor comments on issues and PRs for abusive content; instead, it provides tools to enable communities to moderate their content. Repo owners can delete comments and lock conversations, and all contributors can report abuse and block users. - -Defining a community code of conduct establishes a safe and inclusive environment for contributors at all levels to participate and defines the process to de-escalate conflict between collaborators. - -We can overcome the empathy challenge in open source. Face-to-face debate is much more conducive to empathy than text, so opt for a video call when possible. Set an example by sharing feedback in an empathetic way. Be a coach instead of a bystander if you witness a scathing review. Speak up if you are the victim. Assess empathy skills when interviewing a candidate. Tie empathy skills to performance reviews and rewards. Define and enforce a community code of conduct, and moderate your community. - -With heightened awareness about empathy and the inspiration to spread it, open source productivity will grow, collaborators will lean in, and the power of open source software development can be fully harnessed. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/open-source-empathy - -作者:[Bronagh Sorota][a] -选题:[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/bsorota -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/practicing-empathy.jpg?itok=-A7fj6NF (Practicing empathy) -[2]: https://www.redhat.com/en/explore/the-open-organization-book -[3]: https://arstechnica.com/information-technology/2013/07/linus-torvalds-defends-his-right-to-shame-linux-kernel-developers/ -[4]: http://flossdata.syr.edu/data/insults/hicssInsultsv2.pdf -[5]: https://en.wikipedia.org/wiki/Sage_Sharp diff --git a/translated/talk/20210207 Why the success of open source depends on empathy.md b/translated/talk/20210207 Why the success of open source depends on empathy.md new file mode 100644 index 0000000000..db24502474 --- /dev/null +++ b/translated/talk/20210207 Why the success of open source depends on empathy.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: (scvoet) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why the success of open source depends on empathy) +[#]: via: (https://opensource.com/article/21/2/open-source-empathy) +[#]: author: (Bronagh Sorota https://opensource.com/users/bsorota) + +为何开源的成功取决于同理心? +====== +随着人们对同理心认识的提高和传播的启发。 +它——开源的生产力会增长,合作者们会靠拢。 +而且,可以充分利用开源软件开发的力量。 +![践行共情][1] + +开源开发的协调创新精神和社区精神改变了世界。吉姆·怀特赫斯特(Jim Whitehurst)在[《开放式组织》][2]中解释说,开源的成功源于“将人们视为社区的一份子,从交易思维转变为基于承诺基础的思维方式”。 但是,开源开发模型的核心仍然存在障碍:它经常性地缺乏人们的同理心。 + +同理心是理解或感受他人感受的能力。在开源社区中,面对面的人际互动和协作是否罕见。任何在 GitHub 提交过请求 (Pull request) 或问题 (Issues) 的开发者都曾收到过可能来自他们可能从未见过的人的评论,这些人往往身处地球的另一端,而他们的交流也可能同样遥远。现代开源开发就是建立在这种异步、事务性的沟通基础之上。因此,人们在社交媒体平台上所经历的同类型的网络欺凌和其他虐待行为在开源社区中也不足为奇。 + +当然,并非所有开源交流都会事与愿违。许多人在工作中发展出了尊重并秉持着良好的行为标准。但是很多时候,人们的沟通也常常缺失了常识性的礼节,他们将人们像机器而非人类一般对待。这种行为是激发开源创新模型全部潜力的障碍,因为它让许多潜在的贡献者望而却步,并扼杀了灵感。 + +### 恶意交流的历史 + +代码审查中存在的敌意言论对开源社区来说并不新鲜,它多年来一直被社区所容忍。开源教父莱纳斯·托瓦尔兹 (Linus Torvalds) 经常在代码不符合他的标准时[抨击][3] Linux 社区,并将贡献者赶走。埃隆大学计算机科学教授梅根·斯奎尔(Megan Squire)借助[机器学习][4]分析了托瓦尔兹的侮辱行为,发现它们在四年内的数量高达数千次。2018 年,莱纳斯因自己的不良行为而将自己搁置,责成自己学习同理心,道歉并为 Linux 社区制定了行为准则。 + +2015 年,[赛格·夏普][5]虽然在技术上受人尊重,但因其缺乏对个人的尊重,被辞去了 FOSS 女性外展计划中的 Linux 内核协调员一职。 + +PR 审核中存在的贬低性评论对开发者会造成深远的影响。它导致开发者在提交 PR 时产生畏惧感,让他们对预期中的反馈感到恐惧。这吞噬了开发者对自己能力的信心。它逼迫工程师每次都只能追求完美,从而减缓了开发速度,这与许多社区采用的敏捷方法论背道而驰。 + +### 如何拉近开源中的共情缺口? + +通常情况下,冒犯的评论常是无意间的,而通过一些指导,作者则可以学会如何在不带负面情绪的情况下表达意见。GitHub 不会监控问题和 PR 的评论是否有滥用内容,相反,它提供了一些工具,使得社区能够对其内容进行审查。所有者可以删除评论和锁定对话,所有贡献者可以报告滥用和阻止用户。 + +制定社区行为准则可为所有级别的贡献者提供一个安全且包容的环境,并且能让所有级别的贡献者参与并定义降低协作者之间冲突的过程。 + +我们能够克服开源中存在的共情问题。面对面的辩论比文字更有利于产生共鸣,所以尽可能选择视频通话。通过共情分享反馈来树立榜样。如果你目睹了一个尖锐的评论,请做一个指导员而非旁观者。如果你是受害者,请大声说出来。在面试候选人时,评估共情能力,并将共情能力与绩效评估和奖励挂钩。界定并执行社区行为准则,并管理好你的社区。 + +随着人们对移情意识的了解的加深和灵感的传播,开源生产力将得到提升,协作者将有所作为,并且可以充分激发开源软件开发的活力。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/open-source-empathy + +作者:[Bronagh Sorota][a] +选题:[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/bsorota +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/practicing-empathy.jpg?itok=-A7fj6NF (Practicing empathy) +[2]: https://www.redhat.com/en/explore/the-open-organization-book +[3]: https://arstechnica.com/information-technology/2013/07/linus-torvalds-defends-his-right-to-shame-linux-kernel-developers/ +[4]: http://flossdata.syr.edu/data/insults/hicssInsultsv2.pdf +[5]: https://en.wikipedia.org/wiki/Sage_Sharp From cfd2739601055a3f2e6de04f353f4fb208ac741e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 9 Feb 2021 05:03:34 +0800 Subject: [PATCH 234/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210208=20?= =?UTF-8?q?Fedora=20Aarch64=20on=20the=20SolidRun=20HoneyComb=20LX2K?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210208 Fedora Aarch64 on the SolidRun HoneyComb LX2K.md --- ... Aarch64 on the SolidRun HoneyComb LX2K.md | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 sources/tech/20210208 Fedora Aarch64 on the SolidRun HoneyComb LX2K.md diff --git a/sources/tech/20210208 Fedora Aarch64 on the SolidRun HoneyComb LX2K.md b/sources/tech/20210208 Fedora Aarch64 on the SolidRun HoneyComb LX2K.md new file mode 100644 index 0000000000..e060ca66fa --- /dev/null +++ b/sources/tech/20210208 Fedora Aarch64 on the SolidRun HoneyComb LX2K.md @@ -0,0 +1,219 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora Aarch64 on the SolidRun HoneyComb LX2K) +[#]: via: (https://fedoramagazine.org/fedora-aarch64-on-the-solidrun-honeycomb-lx2k/) +[#]: author: (John Boero https://fedoramagazine.org/author/boeroboy/) + +Fedora Aarch64 on the SolidRun HoneyComb LX2K +====== + +![][1] + +Photo by [Tim Mossholder][2] on [Unsplash][3] + +Almost a year has passed since the [HoneyComb][4] development kit was released by SolidRun. I remember reading about this Mini-ITX Arm workstation board being released and thinking “what a great idea.” Then I saw the price and realized this isn’t just another Raspberry Pi killer. Currently that price is $750 USD plus shipping and duty. Niche devices like the HoneyComb aren’t mass produced like the simpler Pi is, and they pack in quite a bit of high end tech. Eventually COVID lockdown boredom got the best of me and I put a build together. Adding a case and RAM, the build ended up costing about $1100 shipped to London. This is a recount of my experiences and the current state of using Fedora on this fun bit of hardware. + +First and foremost, the tech packed into this board is impressive. It’s not about to kill a Xeon workstation in raw performance but it’s going to wallop it in performance/watt efficiency. Essentially this is a powerful server in the energy footprint of a small laptop. It’s also a powerful hybrid of compute and network functionality, combining powerful network features in a carrier board with modular daughter card sporting a 16-core A72 with 2 ECC-capable DDR4 SO-DIMM slots. The carrier board comes in a few editions, giving flexibility to swap or upgrade your RAM + CPU options. I purchased the edition pictured below with 16 cores, 32GB (non-ECC), 512GB NVMe, and 4x10Gbe. For an extra $250 you can add the 100Gbe option if you’re building a 5G deployment or an ISP for a small country (bottom right of board). Imagine this jacked into a 100Gb uplink port acting as proxy, tls inspector, router, or storage for a large 10gb TOR switch. + +![][5] + +When I ordered it I didn’t fully understand the network co processor included from NXP. NXP is the company that makes the unique [LX2160A][6] CPU/SOC for this as well as configurable ports and offload engine that enable handling up to 150Gb/s of network traffic without the CPU breaking a sweat. Here is a list of options from NXP’s Layerscape user manual. + +![Configure ports in switch, LAG, MUX mode, or straight NICs.][7] + +I have a 10gb network in my home attic via a Ubiquiti ES-16-XG so I was eager to see how much this board could push. I also have a QNAP connected via 10gb which rarely manages to saturate the line, so could this also be a NAS replacement? It turned out I needed to sort out drivers and get a stable install first. Since the board has been out for a year, I had some catching up to do. SolidRun keeps an active Discord on [Developer-Ecosystem][8] which was immensely helpful as install wasn’t as straightforward as previous blogs have mentioned. I’ve always been cursed. If you’ve ever seen Pure Luck, I’m bound to hit every hardware glitch. + +![][9] + +For starters, you can add a GPU and install graphically or install via USB console. I started with a spare GPU (Radeon Pro WX2100) intending to build a headless box which in the end over-complicated things. If you need to swap parts or re-flash a BIOS via the microSD card, you’ll need to swap display, keyboard + mouse. Chaos. Much simpler just to plug into the micro USB console port and access it via /dev/ttyUSB0 for that picture-in-picture experience. It’s really great to have the open ended PCIe3-x8 slot but I’ll keep it open for now. Note that the board does not support PCIe Atomics so some devices may have compatibility issues. + +Now comes the fun part. BIOS is not built-in here. You’ll need to [build][10] from source for to your RAM speed and install via microSDHC. At first this seems annoying but then you realize that with removable BIOS installer it’s pretty hard to brick this thing. Not bad. The good news is the latest UEFI builds have worked well for me. Just remember that every time you re-flash your BIOS you’ll need to set everything up again. This was enough to boot Fedora aarch64 from USB. The board offers 64GB of eMMC flash which you can install to if you like. I immediately benched it to find it reads about 165MB/s and writes 55MB/s which is practical speed for embedded usage but I’ll definitely be installing to NVMe instead. I had an older Samsung 950 Pro in my spares from a previous Linux box but I encountered major issues with it even with the widely documented kernel param workaround: +``` + +``` + +nvme_core.default_ps_max_latency_us=0 +``` + +``` + +In the end I upgraded my main workstation so I could repurpose its existing Samsung EVO 960 for the HoneyComb which worked much better. + +After some fidgeting I was able to install Fedora but it became apparent that the integrated network ports still don’t work with the mainline kernel. The NXP tech is great but requires a custom kernel build and tooling. Some earlier blogs got around this with a USB->RJ45 Ethernet adapter which works fine. Hopefully network support will be mainlined soon, but for now I snagged a kernel SRPM from the helpful engineers on Discord. With the custom kernel the 1Gbe NIC worked fine, but it turns out the SFP+ ports need more configuration. They won’t be recognized as interfaces until you use NXP’s _restool_ utility to map ports to their usage. In this case just a runtime mapping of _dmap -> dni_ was required. This is NXP’s way of mapping a MAC to a network interface via IOCTL commands. The restool binary isn’t provided either and must be built from source. It then layers on management scripts which use cheeky $arg0 references for redirection to call the restool binary with complex arguments. + +Since I was starting to accumulate quite a few custom packages it was apparent that a COPR repo was needed to simplify this for Fedora. If you’re not familiar with COPR I think it’s one of Fedora’s finest resources. This repo contains the uefi build (currently failing build), 5.10.5 kernel built with network support, and the restool binary with supporting scripts. I also added a oneshot systemd unit to enable the SFP+ ports on boot: +``` + +``` + +systemd enable --now [dpmac@7.service][11] +systemd enable --now [dpmac@8.service][12] +systemd enable --now [dpmac@9.service][13] +systemd enable --now [dpmac@10.service][14] +``` + +``` + +Now each SPF+ port will boot configured as eth1-4, with eth0 being the 1Gb. NetworkManager will struggle unless these are consistent, and if you change the service start order the eth devices will re-order. I actually put a sleep $@ in each activation so they are consistent and don’t have locking issues. Unfortunately it adds 10 seconds to boot time. This has been fixed in the latest kernel and won’t be an issue once mainlined. + +![][15] + +I’d love to explore the built-in LAG features but this still needs to be coded into the + +restool + +options. I’ll save it for later. In the meantime I managed a single 10gb link as primary, and a 3×10 LACP Team for kicks. Eventually I changed to 4×10 LACP via copper SFP+ cables mounted in the attic. + +### Energy Efficiency + +Now with a stable environment it’s time to raise some hell. It’s really nice to see PWM support was recently added for the CPU fan, which sounds like a mini jet engine without it. Now the sound level is perfectly manageable and thermal control is automatic. Time to test drive with a power meter. Total power usage is consistently between 20-40 watts (usually in the low 20s) which is really impressive. I tried a few _tuned_ profiles which didn’t seem to have much effect on energy. If you add a power-hungry GPU or device that can obviously increase but for a dev server it’s perfect and well below the Z600 workstations I have next to it which consume 160-250 watts each when fired up. + +### Remote Access + +I’m an old soul so I still prefer KDE with Xorg and NX via X2go server. I can access SSH or a full GUI at native performance without a GPU. This lets me get a feel for performance, thermal stats, and also helps to evaluate the device as a workstation or potential VDI. The version of KDE shipped with the aarch64 server spin doesn’t seem to recognize some sensors but that seems to be because of KDE’s latest widget changes which I’d have to dig into. + +![X2go KDE session over SSH][16] + +Cockpit support is also outstanding out of the box. If SSH and X2go remote access aren’t your thing, Cockpit provides a great remote management platform with a growing list of plugins. Everything works great in my experience. + +![Cockpit behaves as expected.][17] + +All I needed to do now is shift into high gear with jumbo frames. MTU 1500 yields me an iperf of about 2-4Gbps bottlenecked at CPU0. Ain’t nobody got time for that. Set MTU 9000 and suddenly it gets the full 10Gbps both ways with time to spare on the CPU. Again, it would be nice to use the hardware assisted LAG since the device is supposed to handle up to 150Gbps duplex no sweat (with the 100Gbe QSFP option), which is nice given the Ubiquiti ES-16-XG tops out at 160Gbps full duplex (10gb/16 ports). + +### Storage + +As a storage solution this hardware provides great value in a small thermal window and energy saving footprint. I could accomplish similar performance with an old x86 box for cheap but the energy usage alone would eclipse any savings in short order. By comparison I’ve seen some consumer NAS devices offer 10Gbe and NVMe cache sharing an inadequate number of PCIe2 lanes and bottlenecked at the bus. This is fully customizable and since the energy footprint is similar to a small laptop a small UPS backup should allow full writeback cache mode for maximum performance. This would make a great oVirt NFS or iSCSI storage pool if needed. I would pair it with a nice NAS case or rack mount case with bays. Some vendors such as [Bamboo][18] are actually building server options around this platform as we speak. + +The board has 4 SATA3 ports but if I were truly going to build a NAS with this I would probably add a RAID card that makes best use of the PCIe8x slot, which thankfully is open ended. Why some hardware vendors choose to include close-ended PCIe 8x,4x slots is beyond me. Future models will ship with a physical x16 slot but only 8x electrically. Some users on the SolidRun Discord talk about bifurcation and splitting out the 8 PCIe lanes which is an option as well. Note that some of those lanes are also reserved for NVMe, SATA, and network. The CEX7 form factor and interchangeable carrier board presents interesting possibilities later as the NXP LX2160A docs claim to support up to 24 lanes. For a dev board it’s perfectly fine as-is. + +### Network Perf + +For now I’ve managed to rig up a 4×10 LACP Team with NetworkManager for full load balancing. This same setup can be done with a QSFP+ breakout cable. KDE nm Network widget still doesn’t support Teams but I can set them up via nm-connection-editor or Cockpit. Automation could be achieved with _nmcli_ and _teamdctl_. An iperf3 test shows the connection maxing out at about 13Gbps to/from the 2×10 LACP team on my workstation. I know that iperf isn’t a true indication of real-world usage but it’s fun for benchmarks and tuning nonetheless. This did in fact require a lot of tuning and at this point I feel like I could fill a book just with iperf stats. + +``` +$ iperf3 -c honeycomb -P 4 --cport 5000 -R +Connecting to host honeycomb, port 5201 +Reverse mode, remote host honeycomb is sending +[ 5] local 192.168.2.10 port 5000 connected to 192.168.2.4 port 5201 +[ 7] local 192.168.2.10 port 5001 connected to 192.168.2.4 port 5201 +[ 9] local 192.168.2.10 port 5002 connected to 192.168.2.4 port 5201 +[ 11] local 192.168.2.10 port 5003 connected to 192.168.2.4 port 5201 +[ ID] Interval Transfer Bitrate +[ 5] 1.00-2.00 sec 383 MBytes 3.21 Gbits/sec +[ 7] 1.00-2.00 sec 382 MBytes 3.21 Gbits/sec +[ 9] 1.00-2.00 sec 383 MBytes 3.21 Gbits/sec +[ 11] 1.00-2.00 sec 383 MBytes 3.21 Gbits/sec +[SUM] 1.00-2.00 sec 1.49 GBytes 12.8 Gbits/sec +- - - - - - - - - - - - - - - - - - - - - - - - - +(TRUNCATED) +- - - - - - - - - - - - - - - - - - - - - - - - - +[ 5] 2.00-3.00 sec 380 MBytes 3.18 Gbits/sec +[ 7] 2.00-3.00 sec 380 MBytes 3.19 Gbits/sec +[ 9] 2.00-3.00 sec 380 MBytes 3.18 Gbits/sec +[ 11] 2.00-3.00 sec 380 MBytes 3.19 Gbits/sec +[SUM] 2.00-3.00 sec 1.48 GBytes 12.7 Gbits/sec +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Retr +[ 5] 0.00-10.00 sec 3.67 GBytes 3.16 Gbits/sec 1 sender +[ 5] 0.00-10.00 sec 3.67 GBytes 3.15 Gbits/sec receiver +[ 7] 0.00-10.00 sec 3.68 GBytes 3.16 Gbits/sec 7 sender +[ 7] 0.00-10.00 sec 3.67 GBytes 3.15 Gbits/sec receiver +[ 9] 0.00-10.00 sec 3.68 GBytes 3.16 Gbits/sec 36 sender +[ 9] 0.00-10.00 sec 3.68 GBytes 3.16 Gbits/sec receiver +[ 11] 0.00-10.00 sec 3.69 GBytes 3.17 Gbits/sec 1 sender +[ 11] 0.00-10.00 sec 3.68 GBytes 3.16 Gbits/sec receiver +[SUM] 0.00-10.00 sec 14.7 GBytes 12.6 Gbits/sec 45 sender +[SUM] 0.00-10.00 sec 14.7 GBytes 12.6 Gbits/sec receiver + +iperf Done +``` + +### Notes on iperf3 + +I struggled with LACP Team configuration for hours, having done this before with an HP cluster on the same switch. I’d heard stories about bonds being old news with team support adding better load balancing to single TCP flows. This still seems bogus as you still can’t load balance a single flow with a team in my experience. Also LACP claims to be fully automated and easier to set up than traditional load balanced trunks but I find the opposite to be true. For all it claims to automate you still need to have hashing algorithms configured correctly at switches and host. With a few quirks along the way I once accidentally left a team in broadcast mode (not LACP) which registered duplicate packets on the iperf server and made it look like a single connection was getting double bandwidth. That mistake caused confusion as I tried to reproduce it with LACP. + +Then I finally found the LACP hash settings in Ubiquiti’s new firmware GUI. It’s hidden behind a tiny pencil icon on each LAG. I managed to set my LAGs to hash on Src+Dest IP+port when they were defaulting to MAC/port. Still I was only seeing traffic on one slave of my 2×10 team even with parallel clients. Eventually I tried parallel clients with -V and it all made sense. By default iperf3 client ports are ephemeral but they follow an even sequence: 42174, 42176, 42178, 42180, etc… If your lb hash across a pair of sequential MACs includes src+dst port but those ports are always even, you’ll never hit the other interface with an odd MAC. How crazy is that for iperf to do? I tried looking at the source for iperf3 and I don’t even see how that could be happening. Instead if you specify a client port as well as parallel clients, they use a straight sequence: 50000, 50001, 50002, 50003, etc.. With odd+even numbers in client ports, I’m finally able to LB across all interfaces in all LAG groups. This setup would scale out well with more clients on the network. + +![Proper LACP load balancing.][19] + +Everything could probably be tuned a bit better but for now it is excellent performance and it puts my QNAP to shame. I’ll continue experimenting with the network co-processor and seeing if I can enable the native LAG support for even better performance. Across the network I would expect a practical peak of about 40 Gbps raw which is great. + +![][20] + +### Virtualization + +What about virt? One of the best parts about having a 16 A72 cores is support for Aarch64 VMs at full speed using KVM, which you won’t be able to do on x86. I can use this single box to spin up a dozen or so VMs at a time for CI automation and testing, or just to test our latest HashiCorp builds with aarch64 builds on COPR. Qemu on x86 without KVM can emulate aarch64 but crawls by comparison. I’ve not yet tried to add it to an oVirt cluster yet but it’s really snappy actually and proves more cost effective than spinning up Arm VMs in a cloud. One of the use cases for this environment is NFV, and I think it fits it perfectly so long as you pair it with ECC RAM which I skipped as I’m not running anything critical. If anybody wants to test drive a VM DM me and I’ll try to get you some temp access. + +![Virtual Machines in Cockpit][21] + +### Benchmarks + +[Phoronix][22] has already done quite a few benchmarks on [OpenBenchmarking.org][23] but I wanted to rerun them with the latest versions on my own Fedora 33 build for consistency. I also wanted to compare them to my Xeons which is not really a fair comparison. Both use DDR4 with similar clock speeds – around 2Ghz but different architectures and caches obviously yield different results. Also the Xeons are dual socket which is a huge cooling advantage for single threaded workloads. You can watch one process bounce between the coolest CPU sockets. The Honeycomb doesn’t have this luxury and has a smaller fan but the clock speed is playing it safe and slow at 2Ghz so I would bet the SoC has room to run faster if cooling were adjusted. I also haven’t played with the PWM settings to adjust the fan speed up just in case. Benchmarks performed using the tuned profile network-throughput. + +Strangely some single core operations seem to actually perform better on the Honeycomb than they do on my Xeons. I tried single-threaded zstd compression with default level 3 on a a few files and found it actually performs consistently better on the Honeycomb. However using the actual pts/compress-zstd benchmark with multithreaded option turns the tables. The 16 cores still manage an impressive **2073** MB/s: +``` + +``` + +Zstd Compression 1.4.5: +   pts/compress-zstd-1.2.1 &#91;Compression Level: 3] +   Test 1 of 1 +   Estimated Trial Run Count:    3                       +   Estimated Time To Completion: 9 Minutes &#91;22:41 UTC]   +       Started Run 1 @ 22:33:02 +       Started Run 2 @ 22:33:53 +       Started Run 3 @ 22:34:37 +   Compression Level: 3: +2079.3 +2067.5 +       2073.9 +   Average: 2073.57 MB/s +``` + +``` + +For apples to oranges comparison my 2×10 core Xeon E5-2660 v3 box does **2790** MB/s, so 2073 seems perfectly respectable as a potential workstation. Paired with a midrange GPU this device would also make a great video transcoder or media server. Some users have asked about mining but I wouldn’t use one of these for mining crypto currency. The lack of PCIe atomics means certain OpenCL and CUDA features might not be supported and with only 8 PCIe lanes exposed you’re fairly limited. That said it could potentially make a great mobile ML, VR, IoT, or vision development platform. The possibilities are pretty open as the whole package is very well balanced and flexible. + +### Conclusion + +I wasn’t organized enough this year to arrange a FOSDEM visit but this is something I would have loved to talk about. I’m definitely glad I tried out. Special thanks to Jon Nettleton and the folks on SolidRun’s Discord for the help and troubleshooting. The kit is powerful and potentially replaces a lot of energy waste in my home lab. It provides a great Arm platform for development and it’s great to see how solid Fedora’s alternative architecture support is. I got my Linux start on Gentoo back in the day, but Fedora really has upped it’s arch game. I’m really glad I didn’t have to sit waiting for compilation on a proprietary platform. I look forward to the remaining patches to be mainlined into the Fedora kernel and I hope to see a few more generations use this package, especially as Apple goes all in on Arm. It will also be interesting to see what features emerge if Nvidia’s Arm acquisition goes through. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-aarch64-on-the-solidrun-honeycomb-lx2k/ + +作者:[John Boero][a] +选题:[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/boeroboy/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/02/honeycomb-fed-aarch64-816x346.jpg +[2]: https://unsplash.com/@timmossholder?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/honeycombs?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: http://solid-run.com/arm-servers-networking-platforms/honeycomb-workstation/#overview +[5]: https://www.solid-run.com/wp-content/uploads/2020/11/HoneyComb-layout-front.png +[6]: https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/layerscape-processors/layerscape-lx2160a-processor:LX2160A +[7]: https://communityblog.fedoraproject.org/wp-content/uploads/2021/02/image-894x1024.png +[8]: https://discord.com/channels/620838168794497044 +[9]: https://i.imgflip.com/11c7o.gif +[10]: https://github.com/SolidRun/lx2160a_uefi +[11]: mailto:dpmac@7.service +[12]: mailto:dpmac@8.service +[13]: mailto:dpmac@9.service +[14]: mailto:dpmac@10.service +[15]: https://communityblog.fedoraproject.org/wp-content/uploads/2021/02/image-2-1024x403.png +[16]: https://communityblog.fedoraproject.org/wp-content/uploads/2021/02/Screenshot_20210202_112051-1024x713.jpg +[17]: https://fedoramagazine.org/wp-content/uploads/2021/02/image-2-1024x722.png +[18]: https://www.bamboosystems.io/b1000n/ +[19]: https://fedoramagazine.org/wp-content/uploads/2021/02/image-4-1024x245.png +[20]: http://systems.cs.columbia.edu/files/kvm-arm-logo.png +[21]: https://fedoramagazine.org/wp-content/uploads/2021/02/image-1024x717.png +[22]: https://www.phoronix.com/scan.php?page=news_item&px=SolidRun-ClearFog-ARM-ITX +[23]: https://openbenchmarking.org/result/1905313-JONA-190527343&obr_sor=y&obr_rro=y&obr_hgv=ClearFog-ITX From 7d315d3d01a692e90ae552c8b7284c82c7f116ce Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 9 Feb 2021 05:04:50 +0800 Subject: [PATCH 235/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210209=20?= =?UTF-8?q?Viper=20Browser:=20A=20Lightweight=20Qt5-based=20Web=20Browser?= =?UTF-8?q?=20With=20A=20Focus=20on=20Privacy=20and=20Minimalism?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md --- ... With A Focus on Privacy and Minimalism.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md diff --git a/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md b/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md new file mode 100644 index 0000000000..02751230d0 --- /dev/null +++ b/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Viper Browser: A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism) +[#]: via: (https://itsfoss.com/viper-browser/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Viper Browser: A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism +====== + +_**Brief: Viper Browser is a Qt-based browser that offers a simple user experience keeping privacy in mind.**_ + +While the majority of the popular browsers run on top of Chromium, unique alternatives like [Firefox][1], [Beaker Browser][2], and some other [chrome alternatives][3] should not cease to exist. + +Especially, considering Google’s recent potential thought of stripping [Google Chrome-specific features from Chromium][4] giving an excuse of abuse. + +In the look-out for more Chrome alternatives, I came across an interesting project “[Viper Browser][5]” as per our reader’s suggestion on [Mastodon][6]. + +### Viper Browser: An Open-Source Qt5-based Browser + +_**Note**: Viper Browser is fairly a new project with a couple of contributors. It lacks certain features which I’ll be mentioning as you read on._ + +![][7] + +Viper is an interesting web browser that focuses on being a powerful yet lightweight option while utilizing [QtWebEngine][8]. + +QtWebEngine borrows the code from Chromium but it does not include the binaries and services that connect to the Google platform. + +I spent some time using it and performing some daily browsing activities and I must say that I’m quite interested. Not just because it is something simple to use (how complicated a browser can be), but it also focuses on enhancing your privacy by giving you the option to add different Ad blocking options along with some useful options. + +![][9] + +Even though I think it is not meant for everyone, it is still worth taking a look. Let me highlight the features briefly before you can proceed trying it out. + +### Features of Viper Browser + +![][10] + +I’ll list some of the key features that you can find useful: + + * Ability to manage cookies + * Multiple preset options to choose different Adblocker networks + * Simple and easy to use + * Privacy-friendly default search engine – [Startpage][11] (you can change this) + * Ability to add user scripts + * Ability to add new user agents + * Option to disable JavaScript + * Ability to prevent images from loading up + + + +In addition to all these highlights, you can easily tweak the privacy settings to remove your history, clean cookies when existing, and some more options. + +![][12] + +### Installing Viper Browser on Linux + +It just offers an AppImage file on its [releases section][13] that you can utilize to test on any Linux distribution. + +In case you need help, you may refer to our guide on [using AppImage file on Linux][14] as well. If you’re curious, you can explore more about it on [GitHub][5]. + +[Viper Browser][5] + +### My Thoughts on Using Viper Browser + +I don’t think it is something that could replace your current browser immediately but if you are interested to test out new projects that are trying to offer Chrome alternatives, this is surely one of them. + +When I tried logging in my Google account, it prevented me by mentioning that it is potentially an insecure browser or unsupported browser. So, if you rely on your Google account, it is a disappointing news. + +However, other social media platforms work just fine along with YouTube (without signing in). Netflix is not something supported but overall the browsing experience is quite fast and usable. + +You can install user scripts, but Chrome extensions aren’t supported yet. Of course, it is either intentional or something to be looked after as the development progresses considering it as a privacy-friendly web browser. + +### Wrapping Up + +Considering that this is a less-known yet something interesting for some, do you have any suggestions for us to take a look at? An open-source project that deserves coverage? + +Let me know in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/viper-browser/ + +作者:[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.mozilla.org/en-US/firefox/new/ +[2]: https://itsfoss.com/beaker-browser-1-release/ +[3]: https://itsfoss.com/open-source-browsers-linux/ +[4]: https://www.bleepingcomputer.com/news/google/google-to-kill-chrome-sync-feature-in-third-party-browsers/ +[5]: https://github.com/LeFroid/Viper-Browser +[6]: https://mastodon.social/web/accounts/199851 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-browser.png?resize=800%2C583&ssl=1 +[8]: https://wiki.qt.io/QtWebEngine +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-browser-setup.jpg?resize=793%2C600&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-preferences.jpg?resize=800%2C660&ssl=1 +[11]: https://www.startpage.com +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-browser-tools.jpg?resize=800%2C262&ssl=1 +[13]: https://github.com/LeFroid/Viper-Browser/releases +[14]: https://itsfoss.com/use-appimage-linux/ From 03d94b7f4603091b1d28e7d6f9a0671223f711d9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 9 Feb 2021 05:05:10 +0800 Subject: [PATCH 236/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210208=20?= =?UTF-8?q?How=20to=20set=20up=20custom=20sensors=20in=20Home=20Assistant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210208 How to set up custom sensors in Home Assistant.md --- ...set up custom sensors in Home Assistant.md | 290 ++++++++++++++++++ 1 file changed, 290 insertions(+) create mode 100644 sources/tech/20210208 How to set up custom sensors in Home Assistant.md diff --git a/sources/tech/20210208 How to set up custom sensors in Home Assistant.md b/sources/tech/20210208 How to set up custom sensors in Home Assistant.md new file mode 100644 index 0000000000..074f898a93 --- /dev/null +++ b/sources/tech/20210208 How to set up custom sensors in Home Assistant.md @@ -0,0 +1,290 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to set up custom sensors in Home Assistant) +[#]: via: (https://opensource.com/article/21/2/home-assistant-custom-sensors) +[#]: author: (Steve Ovens https://opensource.com/users/stratusss) + +How to set up custom sensors in Home Assistant +====== +Dive into the YAML files to set up custom sensors in the sixth article +in this home automation series. +![Computer screen with files or windows open][1] + +In the last article in this series about home automation, I started digging into Home Assistant. I [set up a Zigbee integration][2] with a Sonoff Zigbee Bridge and installed a few add-ons, including Node-RED, File Editor, Mosquitto broker, and Samba. I wrapped up by walking through Node-RED's configuration, which I will use heavily later on in this series. The four articles before that one discussed [what Home Assistant is][3], why you may want [local control][4], some of the [communication protocols][5] for smart home components, and how to [install Home Assistant][6] in a virtual machine (VM) using libvirt. + +In this sixth article, I'll walk through the YAML configuration files. This is largely unnecessary if you are just using the integrations supported in the user interface (UI). However, there are times, particularly if you are pulling in custom sensor data, where you have to get your hands dirty with the configuration files. + +Let's dive in. + +### Examine the configuration files + +There are several potential configuration files you will want to investigate. Although everything I am about to show you _can_ be done in the main configuration.yaml file, it can help to split your configuration into dedicated files, especially with large installations. + +Below I will walk through how I configure my system. For my custom sensors, I use the ESP8266 chipset, which is very maker-friendly. I primarily use [Tasmota][7] for my custom firmware, but I also have some components running [ESPHome][8]. Configuring firmware is outside the scope of this article. For now, I will assume you set up your devices with some custom firmware (or you wrote your own with [Arduino IDE][9] ). + +#### The /config/configuration.yaml file + +Configuration.yaml is the main file Home Assistant reads. For the following, use the File Editor you installed in the previous article. If you do not see File Editor in the left sidebar, enable it by going back into the **Supervisor** settings and clicking on **File Editor**. You should see a screen like this: + +![Install File Editor][10] + +(Steve Ovens, [CC BY-SA 4.0][11]) + +Make sure **Show in sidebar** is toggled on. I also always toggle on the **Watchdog** setting for any add-ons I use frequently. + +Once that is completed, launch File Editor. There is a folder icon in the top-left header bar. This is the navigation icon. The `/config` folder is where the configuration files you are concerned with are stored. If you click on the folder icon, you will see a few important files: + +![Configuration split files][12] + +The following is a default configuration.yaml: + +![Default Home Assistant configuration.yaml][13] + +(Steve Ovens, [CC BY-SA 4.0][11]) + +The notation `script: !include scripts.yaml` indicates that Home Assistant should reference the contents of scripts.yaml anytime it needs the definition of a script object. You'll notice that each of these files correlates to files observed when the folder icon is clicked. + +I added three lines to my configuration.yaml: + + +``` +input_boolean: !include input_boolean.yaml +binary_sensor: !include binary_sensor.yaml +sensor: !include sensor.yaml +``` + +As a quick aside, I configured my MQTT settings (see Home Assistant's [MQTT documentation][14] for more details) in the configuration.yaml file: + + +``` +mqtt: +  discovery: true +  discovery_prefix: homeassistant +  broker: 192.168.11.11 +  username: mqtt +  password: superpassword +``` + +If you make an edit, don't forget to click on the Disk icon to save your work. + +![Save icon in Home Assistant config][15] + +(Steve Ovens, [CC BY-SA 4.0][11]) + +#### The /config/binary_sensor.yaml file + +After you name your file in configuration.yaml, you'll have to create it. In the File Editor, click on the folder icon again. There is a small icon of a piece of paper with a **+** sign in its center. Click on it to bring up this dialog: + +![Create config file][16] + +(Steve Ovens, [CC BY-SA 4.0][11]) + +I have three main types of [binary sensors][17]: door, motion, and power. A binary sensor has only two states: on or off. All my binary sensors send their data to MQTT. See my article on [cloud vs. local control][4] for more information about MQTT. + +My binary_sensor.yaml file looks like this: + + +``` + - platform: mqtt +    state_topic: "BRMotion/state/PIR1" +    name: "BRMotion" +    qos: 1 +    payload_on: "ON" +    payload_off: "OFF" +    device_class: motion +    +  - platform: mqtt +    state_topic: "IRBlaster/state/PROJECTOR" +    name: "ProjectorStatus" +    qos: 1 +    payload_on: "ON" +    payload_off: "OFF" +    device_class: power +    +  - platform: mqtt +    state_topic: "MainHallway/state/DOOR" +    name: "FrontDoor" +    qos: 1 +    payload_on: "open" +    payload_off: "closed" +    device_class: door +``` + +Take a look at the definitions. Since `platform` is self-explanatory, start with `state_topic`. + + * `state_topic`, as the name implies, is the topic where the device's state is published. This means anyone subscribed to the topic will be notified any time the state changes. This path is completely arbitrary, so you can name it anything you like. I tend to use the convention `location/state/object`, as this makes sense for me. I want to be able to reference all devices in a location, and for me, this layout is the easiest to remember. Grouping by device type is also a valid organizational layout. + + * `name` is the string used to reference the device inside Home Assistant. It is normally referenced by `type.name`, as seen in this card in the Home Assistant [Lovelace][18] interface: + +![Binary sensor card][19] + +(Steve Ovens, [CC BY-SA 4.0][11]) + + * `qos`, short for quality of service, refers to how an MQTT client communicates with the broker when posting to a topic. + + * `payload_on` and `payload_off` are determined by the firmware. These sections tell Home Assistant what text the device will send to indicate its current state. + + * `device_class:` There are multiple possibilities for a device class. Refer to the [Home Assistant documentation][17] for more information and a description of each type available. + + + + +#### The /config/sensor.yaml file + +This file differs from binary_sensor.yaml in one very important way: The sensors within this configuration file can have vastly different data inside their payloads. Take a look at one of the more tricky bits of sensor data, temperature. + +Here is the definition for my DHT temperature sensor: + + +``` + - platform: mqtt +    state_topic: "Steve_Desk_Sensor/tele/SENSOR" +    name: "Steve Desk Temperature" +    value_template: '{{ value_json.DHT11.Temperature }}' +    +  - platform: mqtt +    state_topic: "Steve_Desk_Sensor/tele/SENSOR" +    name: "Steve Desk Humidity" +    value_template: '{{ value_json.DHT11.Humidity }}' +``` + +You'll notice two things right from the start. First, there are two definitions for the same `state_topic`. This is because this sensor publishes three different statistics. + +Second, there is a new definition of `value_template`. Most sensors, whether custom or not, send their data inside a JSON payload. The template tells Home Assistant where the important information is in the JSON file. The following shows the raw JSON coming from my homemade sensor. (I used the program `jq` to make the JSON more readable.) + + +``` +{ +  "Time": "2020-12-23T16:59:11", +  "DHT11": { +    "Temperature": 24.8, +    "Humidity": 32.4, +    "DewPoint": 7.1 +  }, +  "BH1750": { +    "Illuminance": 24 +  }, +  "TempUnit": "C" +} +``` + +There are a few things to note here. First, as the sensor data is stored in a time-based data store, every reading has a `Time` entry. Second, there are two different sensors attached to this output. This is because I have both a DHT11 temperature sensor and a BH1750 light sensor attached to the same ESP8266 chip. Finally, my temperature is reported in Celsius. + +Hopefully, the Home Assistant definitions will make a little more sense now. `value_json` is just a standard name given to any JSON object ingested by Home Assistant. The format of the `value_template` is `value_json..`. + +For example, to retrieve the dewpoint: + + +``` +`value_template: '{{ value_json.DHT11.DewPoint}}'` +``` + +While you can dump this information to a file from within Home Assistant, I use Tasmota's `Console` to see the data it is publishing. (If you want me to do an article on Tasmota, please let me know in the comments below.) + +As a side note, I also keep tabs on my local Home Assistant resource usage. To do so, I put this in my sensor.yaml file: + + +``` + - platform: systemmonitor +    resources: +      - type: disk_use_percent +        arg: / +      - type: memory_free +      - type: memory_use +      - type: processor_use +``` + +While this is technically not a sensor, I put it here, as I think of it as a data sensor. For more information, see the Home Assistant's [system monitoring][20] documentation. + +#### The /config/input_boolean file + +This last section is pretty easy to set up, and I use it for a wide variety of applications. An input boolean is used to track the status of something. It's either on or off, home or away, etc. I use these quite extensively in my automations. + +My definitions are: + + +``` +   steve_home: +        name: steve +    steve_in_bed: +        name: 'steve in bed' +    guest_home: +    +    kitchen_override: +        name: kitchen +    kitchen_fan_override: +        name: kitchen_fan +    laundryroom_override: +        name: laundryroom +    bathroom_override: +        name: bathroom +    hallway_override:   +        name: hallway +    livingroom_override:   +        name: livingroom +    ensuite_bathroom_override: +        name: ensuite_bathroom +    steve_desk_light_override: +        name: steve_desk_light +    projector_led_override: +        name: projector_led +        +    project_power_status: +        name: 'Projector Power Status' +    tv_power_status: +        name: 'TV Power Status' +    bed_time: +        name: "It's Bedtime" +``` + +I use some of these directly in the Lovelace UI. I create little badges that I put at the top of each of the pages I have in the UI: + +![Home Assistant options in Lovelace UI][21] + +(Steve Ovens, [CC BY-SA 4.0][11]) + +These can be used to determine whether I am home, if a guest is in my house, and so on. Clicking on one of these badges allows me to toggle the boolean, and this object can be read by automations to make decisions about how the “smart devices” react to a person's presence (if at all). I'll revisit the booleans in a future article when I examine Node-RED in more detail. + +### Wrapping up + +In this article, I looked at the YAML configuration files and added a few custom sensors into the mix. You are well on the way to getting some functioning automation with Home Assistant and Node-RED. In the next article, I'll dive into some basic Node-RED flows and introduce some basic automations. + +Stick around; I've got plenty more to cover, and as always, leave a comment below if you would like me to examine something specific. If I can, I'll be sure to incorporate the answers to your questions into future articles. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/home-assistant-custom-sensors + +作者:[Steve Ovens][a] +选题:[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/stratusss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) +[2]: https://opensource.com/article/21/1/home-automation-5-homeassistant-addons +[3]: https://opensource.com/article/20/11/home-assistant +[4]: https://opensource.com/article/20/11/cloud-vs-local-home-automation +[5]: https://opensource.com/article/20/11/home-automation-part-3 +[6]: https://opensource.com/article/20/12/home-assistant +[7]: https://tasmota.github.io/docs/ +[8]: https://esphome.io/ +[9]: https://create.arduino.cc/projecthub/Niv_the_anonymous/esp8266-beginner-tutorial-project-6414c8 +[10]: https://opensource.com/sites/default/files/uploads/ha-setup22-file-editor-settings.png (Install File Editor) +[11]: https://creativecommons.org/licenses/by-sa/4.0/ +[12]: https://opensource.com/sites/default/files/uploads/ha-setup29-configuration-split-files1.png (Configuration split files) +[13]: https://opensource.com/sites/default/files/uploads/ha-setup28-configuration-yaml.png (Default Home Assistant configuration.yaml) +[14]: https://www.home-assistant.io/docs/mqtt/broker +[15]: https://opensource.com/sites/default/files/uploads/ha-setup23-configuration-yaml2.png (Save icon in Home Assistant config) +[16]: https://opensource.com/sites/default/files/uploads/ha-setup24-new-config-file.png (Create config file) +[17]: https://www.home-assistant.io/integrations/binary_sensor/ +[18]: https://www.home-assistant.io/lovelace/ +[19]: https://opensource.com/sites/default/files/uploads/ha-setup25-bindary_sensor_card.png (Binary sensor card) +[20]: https://www.home-assistant.io/integrations/systemmonitor +[21]: https://opensource.com/sites/default/files/uploads/ha-setup25-input-booleans.png (Home Assistant options in Lovelace UI) From 0cd861b5cc757cccbbf5dc7eac0088338be10bcd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 9 Feb 2021 05:05:26 +0800 Subject: [PATCH 237/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210208=20?= =?UTF-8?q?3=20open=20source=20tools=20that=20make=20Linux=20the=20ideal?= =?UTF-8?q?=20workstation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md --- ...s that make Linux the ideal workstation.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md diff --git a/sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md b/sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md new file mode 100644 index 0000000000..2fb770fa83 --- /dev/null +++ b/sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 open source tools that make Linux the ideal workstation) +[#]: via: (https://opensource.com/article/21/2/linux-workday) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +3 open source tools that make Linux the ideal workstation +====== +Linux has everything you think you need and more for you to have a +productive workday. +![Person using a laptop][1] + +In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Today, I'll share with you why Linux is a great choice for your workday. + +Everyone wants to be productive during the workday. If your workday generally involves working on documents, presentations, and spreadsheets, then you might be accustomed to a specific routine. The problem is that _usual routine_ is usually dictated by one or two specific applications, whether it's a certain office suite or a desktop OS. Of course, just because something's a habit doesn't mean it's ideal, and yet it tends to persist unquestioned, even to the point of influencing the very structure of how a business is run. + +### Working smarter + +Many office applications these days run in the cloud, so you can work with the same constraints on Linux if you really want to. However, because many of the typical big-name office applications aren't cultural expectations on Linux, you might find yourself inspired to explore other options. As anyone eager to get out of their "comfort zone" knows, this kind of subtle disruption can be surprisingly useful. All too often, you don't know what you're doing inefficiently because you haven't actually tried doing things differently. Force yourself to explore other options, and you never know what you'll find. You don't even have to know exactly what you're looking for. + +### LibreOffice + +One of the most obvious open source office stalwarts on Linux (or any other platform) is [LibreOffice][2]. It features several components, including a word processor, presentation software, a spreadsheet, relational database interface, vector drawing, and more. It can import many document formats from other popular office applications, so transitioning to LibreOffice from another tool is usually easy. + +There's more to LibreOffice than just being a great office suite, however. LibreOffice has macro support, so resourceful users can automate repetitive tasks. It also features terminal commands so you can perform many tasks without ever launching the LibreOffice interface. + +Imagine, for instance, opening 21 documents, navigating to the **File** menu, to the **Export** or **Print** menu item, and exporting the file to PDF or EPUB. That's over 84 clicks, at the very least, and probably an hour of work. Compare that to opening a folder of documents and converting all of them to PDF or EPUB with just one swift command or menu action. The conversion would run in the background while you work on other things. You'd be finished in a quarter of the time, possibly less. + + +``` +`$ libreoffice --headless --convert-to epub *.docx` +``` + +It's the little improvements that Linux encourages, not explicitly but implicitly, through its toolset and the ease with which you can customize your environment and workflow. + +### Abiword and Gnumeric + +Sometimes, a big office suite is exactly what you _don't_ need. If you prefer to keep your office work simple, you might do better with a lightweight and task-specific application. For instance, I mostly write articles in a text editor because I know all styles are discarded during conversion to HTML. But there are times when a word processor is useful, either to open a document someone has sent to me or because I want a quick and easy way to generate some nicely styled text. + +[Abiword][3] is a simple word processor with basic support for popular document formats and all the essential features you'd expect from a word processor. It isn't meant as a full office suite, and that's its best feature. While there's no such a thing as too many options, there definitely is such a thing as information overload, and that's exactly what a full office suite or word processor is sometimes guilty of. If you're looking to avoid that, then use something simple instead. + +Similarly, the [Gnumeric][4] project provides a simple spreadsheet application. Gnumeric avoids any features that aren't strictly necessary for a spreadsheet, so you still get a robust formula syntax, plenty of functions, and all the options you need for styling and manipulating cells. I don't do much with spreadsheets, so I find myself quite happy with Gnumeric on the rare occasions I need to review or process data in a ledger. + +### Pandoc + +It's possible to get even more minimal with specialized commands and document processors. The `pandoc` command specializes in document conversion. It's like the `libreoffice --headless` command, except with ten times the number of document formats to work with. You can even generate presentations with it! If part of your work is taking source text from one document and formatting it for several modes of delivery, then Pandoc is a necessity, and so you should [download our cheat sheet][5]. + +Broadly, Pandoc is representative of a completely different way of working. It gets you away from the confines of office applications. It separates you from trying to get your thoughts down into typed words and deciding what font those words ought to use, all at the same time. Working in plain text and then converting to all of your delivery targets afterward lets you work with any application you want, whether it's a notepad on your mobile device, a simple text editor on whatever computer you happen to be sitting in front of, or a text editor in the cloud. + +### Look for the alternatives + +There are lots of unexpected alternatives available for Linux. You can find them by taking a step back from what you're doing, analyzing your work process, assessing your required results, and investigating new applications that claim to do just the things you rely upon. + +Changing the tools you use, your workflow, and your daily routine can be disorienting, especially when you don't know exactly where it is you're looking to go. But the advantage to Linux is that you're afforded the opportunity to re-evaluate the assumptions you've subconsciously developed over years of computer usage. If you look hard enough for an answer, you'll eventually realize what the question was in the first place. And oftentimes, you'll end up appreciating what you learn. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-workday + +作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: http://libreoffice.org +[3]: https://www.abisource.com +[4]: http://www.gnumeric.org +[5]: https://opensource.com/article/20/5/pandoc-cheat-sheet From c43b9a2103953cda6baa55853346637cf3724033 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 9 Feb 2021 05:05:43 +0800 Subject: [PATCH 238/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210208=20?= =?UTF-8?q?Why=20choose=20Plausible=20for=20an=20open=20source=20alternati?= =?UTF-8?q?ve=20to=20Google=20Analytics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md --- ... source alternative to Google Analytics.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md diff --git a/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md b/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md new file mode 100644 index 0000000000..74252f60a8 --- /dev/null +++ b/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why choose Plausible for an open source alternative to Google Analytics) +[#]: via: (https://opensource.com/article/21/2/plausible) +[#]: author: (Ben Rometsch https://opensource.com/users/flagsmith) + +Why choose Plausible for an open source alternative to Google Analytics +====== +Plausible is gaining attention and users as a viable, effective +alternative to Google Analytics. +![Analytics: Charts and Graphs][1] + +Taking on the might of Google Analytics may seem like a big challenge. In fact, you could say it doesn't sound plausible… But that's exactly what [Plausible.io][2] has done with great success, signing up thousands of new users since 2018. + +Plausible's co-founders Uku Taht and Marko Saric recently appeared on [The Craft of Open Source][3] podcast to talk about the project and how they: + + * Created a viable alternative to Google Analytics + * Gained so much momentum in less than two years + * Achieved their goals by open sourcing the project + + + +Read on for a summary of their conversation with podcast host and Flagsmith founder Ben Rometsch. + +### How Plausible got started + +In winter 2018, Uku started coding a project that he thought was desperately needed—a viable, effective alternative to Google Analytics—after becoming disillusioned with the direction Google products were heading and the fact that all other data solutions seemed to use Google as a "data-handling middleman." + +Uku's first instinct was to focus on the analytics side of things using existing database solutions. Right away, he faced some challenges. The first attempt, using PostgreSQL, was technically naïve, as it became overwhelmed and inefficient pretty quickly. Therefore, his goal morphed into making an analytics product that can handle large quantities of data points with no discernable decline in performance. To cut a long story short, Uku succeeded, and Plausible can now ingest more than 80 million records per month. + +The first version of Plausible was released in summer 2019. In March 2020, Marko came on board to head up the project's communications and marketing side. Since then, its popularity has grown with considerable momentum. + +### Why open source? + +Uku was keen to follow the "indie hacker" route of software development: create a product, put it out there, and see how it grows. Open source makes sense in this respect because you can quickly grow a community and gain popularity. + +But Plausible didn't start out as open source. Uku was initially concerned about the software's sensitive code, such as billing codes, but he soon released that this was of no use to people without the API token. + +Now, Plausible is fully open source under [AGPL][4], which they chose instead of the MIT License. Uku explains that under an MIT License, anyone can do anything to the code without restriction. Under AGPL, if someone changes the code, they must open source their changes and contribute the code back to the community. This means that large corporations cannot take the original code, build from it, then reap all the rewards. They must share it, making for a more level playing field. For instance, if a company wanted to plug in their billing or login system, they would be legally obliged to publish the code. + +During the podcast, Uku asked me about Flagsmith's license which is currently under a BSD 3-Clause license, which is highly permissive, but I am about to move some features behind a more restrictive license. So far, the Flagsmith community has been understanding of the change as they realize this will lead to more and better features. + +### Plausible vs. Google Analytics + +Uku says, in his opinion, the spirit of open source is that the code should be open for commercial use by anyone and shared with the community, but you can keep back a closed-source API module as a proprietary add-on. In this way, Plausible and other companies can cater to different use-cases by creating and selling bespoke API add-on licenses. + +Marko is a developer by trade, but from the marketing side of things, he worked to get the project covered on sites such as Hacker News and Lobster and build a Twitter presence to help generate momentum. The buzz created by this publicity also meant that the project took off on GitHub, going from 500 to 4,300 stars. As traffic grew, Plausible appeared on GitHub's trending list, which helped its popularity snowball. + +Marko also focused heavily on publishing and promoting blog posts. This strategy paid off, as four or five posts went viral within the first six months, and he used those spikes to amplify the marketing message and accelerate growth. + +The biggest challenge in Plausible's growth was getting people to switch from Google Analytics. The project's main goal was to create a web analytics product that is useful, efficient, and accurate. It also needed to be compliant with regulations and offer a high degree of privacy for both the business and website visitors. + +Plausible is now running on more than 8,000 websites. From talking to customers, Uku estimates that around 90% of them would have run Google Analytics. + +Plausible runs on a standard software-as-a-service (SaaS) subscription model. To make things fairer, it charges per page view on a monthly basis, rather than charging per website. This can prove tricky with seasonal websites, say e-commerce sites that spike at the holidays or US election sites that spike once every four years. These can cause pricing problems under the monthly subscription model, but it generally works well for most sites. + +### Check out the podcast + +To discover more about how Uku and Marko grew the open source Plausible project at a phenomenal rate and made it into a commercial success, [listen to the podcast][3] and check out [other episodes][5] to learn more about "the ins-and-outs of the open source software community." + +Sandstorm's Jade Wang shares some of her favorite open source web apps that are self-hosted... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/plausible + +作者:[Ben Rometsch][a] +选题:[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/flagsmith +[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://plausible.io/ +[3]: https://www.flagsmith.com/podcast/02-plausible +[4]: https://www.gnu.org/licenses/agpl-3.0.en.html +[5]: https://www.flagsmith.com/podcast From b1747f58223c5da887b05ecae9bda0db2e6be141 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 9 Feb 2021 10:39:56 +0800 Subject: [PATCH 239/381] translated --- ...he D programming language for scripting.md | 51 +++-- ...he D programming language for scripting.md | 183 ++++++++++++++++++ 2 files changed, 208 insertions(+), 26 deletions(-) create mode 100644 translated/tech/20210127 Why I use the D programming language for scripting.md diff --git a/sources/tech/20210127 Why I use the D programming language for scripting.md b/sources/tech/20210127 Why I use the D programming language for scripting.md index b3728050fa..94cd6db038 100644 --- a/sources/tech/20210127 Why I use the D programming language for scripting.md +++ b/sources/tech/20210127 Why I use the D programming language for scripting.md @@ -7,25 +7,24 @@ [#]: via: (https://opensource.com/article/21/1/d-scripting) [#]: author: (Lawrence Aberba https://opensource.com/users/aberba) -Why I use the D programming language for scripting +我为什么要用 D 语言写脚本? ====== -The D programming language is best known as a system programming -language, but it's also a great option for scripting. +D 语言是以系统编程语言而闻名,但它也是编写脚本的一个很好的选择。 ![Business woman on laptop sitting in front of window][1] -The D programming language is often advertised as a system programming language due to its static typing and metaprogramming capabilities. However, it's also a very productive scripting language. +D 语言由于其静态类型和元编程能力,经常被宣传为系统编程语言。然而,它也是一种非常高效的脚本语言。 -Python is commonly chosen for scripting due to its flexibility for automating tasks and quickly prototyping ideas. This makes Python very appealing to sysadmins, [managers][2], and developers in general for automating recurring tasks that they might otherwise have to do manually. +由于 Python 在自动化任务和快速实现原型想法方面的灵活性,它通常被选为脚本语言。这使得 Python 对系统管理员、[管理者][2]和一般的开发人员非常有吸引力,因为它可以自动完成他们可能不得不手动完成的重复性任务。 -It is reasonable to expect any other script-writing language to have these Python traits and capabilities. Here are two reasons why I believe D is a good option. +我们有理由期待任何其他的脚本编写语言具有 Python 的这些特性和能力。以下是我认为 D 是一个不错的选择的两个原因。 -### 1\. D is easy to read and write +### 1\. D 很容易读和写 -As a C-like language, D should be familiar to most programmers. Anyone who uses JavaScript, Java, PHP, or Python will know their way around D. +作为一种类似于 C 的语言,D 应该是大多数程序员所熟悉的。任何使用 JavaScript、Java、PHP 或 Python 的人对 D 语言都很容易上手。 -If you don't already have D installed, [install a D compiler][3] so that you can [run the D code][4] in this article. You may also use the [online D editor][5]. +如果你还没有安装 D,请[安装 D 编译器][3],这样你就可以[运行本文中的 D 代码][4]。你也可以使用[在线 D 编辑器][5]。 -Here is an example of D code that reads words from a file named `words.txt` and prints them on the command line: +下面是一个 D 代码的例子,它从一个名为 `words.txt` 的文件中读取单词,并在命令行中打印出来: ``` @@ -35,7 +34,7 @@ is cool ``` -Write the script in D: +用 D 语言写脚本: ``` @@ -58,21 +57,20 @@ void main(){ } ``` -This code is prefixed with a [shebang][6] that will run the code using [rdmd][7], a tool that comes with the D compiler to compile and run code. Assuming you are running Unix or Linux, before you can run this script, you must make it executable by using the `chmod` command: - +这段代码的前缀是 [shebang][6],它将使用 [rdmd][7] 来运行这段代码,rdmd 是 D 编译器自带的编译和运行代码的工具。假设你运行的是 Unix 或 Linux,在运行这个脚本之前,你必须使用` chmod` 命令使其可执行: ``` `chmod u+x print_words.d` ``` -Now that the script is executable, you can run it: +现在脚本是可执行的,你可以运行它: ``` `./print_words.d` ``` -This should print the following on your command line: +这将在你的命令行中打印以下内容: ``` @@ -82,9 +80,9 @@ is cool ``` -Congratulations! You've written your first D script. You can see how D enables you to chain functions in sequence to make reading the code feel natural, similar to how you think about problems in your mind. This [feature makes D my favorite programming language][8]. +恭喜你,你写了第一个 D 语言脚本。你可以看到 D 是如何让你按顺序链式调用函数,这让阅读代码的感觉很自然,类似于你在头脑中思考问题的方式。这个[功能让 D 成为我最喜欢的编程语言][8]。 -Try writing another script: A nonprofit manager has a text file of donations with each amount on separate lines. The manager wants to sum the first 10 donations and print the amounts: +试着再写一个脚本:一个非营利组织的管理员有一个捐款的文本文件,每笔金额都是单独的一行。管理员想把前 10 笔捐款相加,然后打印出金额: ``` @@ -124,13 +122,14 @@ void main() } ``` -The `!` operator used with `each` is the syntax of a [template argument][9]. +与 `each` 一起使用的 `!` 操作符是[模板参数][9]的语法。 -### 2\. D is great for quick prototyping +### 2\. D 是快速原型设计的好帮手 -D is flexible for hammering code together really quickly and making it work. Its standard library is rich with utility functions for performing common tasks, such as manipulating data (JSON, CSV, text, etc.). It also comes with a rich set of generic algorithms for iterating, searching, comparing, and mutating data. These cleverly crafted algorithms are oriented towards processing sequences by defining generic [range-based interfaces][10]. +D 是灵活的,它可以快速地将代码敲打在一起,并使其发挥作用。它的标准库中包含了丰富的实用函数,用于执行常见的任务,如操作数据(JSON、CSV、文本等)。它还带有一套丰富的通用算法,用于迭代、搜索、比较和 mutate 数据。这些巧妙的算法通过定义通用的[基于范围的接口][10]面向处理序列。 -The script above shows how chaining functions in D provides a gist of sequential processing and manipulating data. Another appeal of D is its growing ecosystem of third-party packages for performing common tasks. An example is how easy it is to build a simple web server using the [Vibe.d][11] web framework. Here's an example: + +上面的脚本显示了 D 中的链式调用函数如何提供顺序处理和操作数据的要领。D 的另一个吸引人的地方是它不断增长的第三方包的生态系统,用于执行普通任务。一个例子是,使用 [Vibe.d][11] web 框架构建一个简单的 web 服务器很容易。下面是一个例子: ``` @@ -148,13 +147,13 @@ void main() } ``` -This uses the official D package manager, [Dub][12], to fetch the vibe.d web framework from the [D package repository][13]. Dub takes care of downloading the Vibe.d package, then compiling and spinning up a web server on localhost port 8080. +它使用官方的 D 软件包管理器 [Dub][12],从 [D 软件包仓库][13]中获取 vibe.d web 框架。Dub 负责下载 Vibe.d 包,然后在本地主机 8080 端口上编译并启动一个 web 服务器。 -### Give D a try +### 尝试一下 D 语言 -These are only a couple of reasons why you might want to use D for writing scripts. +这些只是你可能想用 D 来写脚本的几个原因。 -D is a great language for development. It's easy to install from the D download page, so download the compiler, take a look at the examples, and experience D for yourself. +D 是一种非常适合开发的语言。你可以很容易从 D 下载页面安装,因此下载编译器,看看例子,并亲自体验 D 语言。 -------------------------------------------------------------------------------- @@ -162,7 +161,7 @@ via: https://opensource.com/article/21/1/d-scripting 作者:[Lawrence Aberba][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/) 荣誉推出 diff --git a/translated/tech/20210127 Why I use the D programming language for scripting.md b/translated/tech/20210127 Why I use the D programming language for scripting.md new file mode 100644 index 0000000000..94cd6db038 --- /dev/null +++ b/translated/tech/20210127 Why I use the D programming language for scripting.md @@ -0,0 +1,183 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why I use the D programming language for scripting) +[#]: via: (https://opensource.com/article/21/1/d-scripting) +[#]: author: (Lawrence Aberba https://opensource.com/users/aberba) + +我为什么要用 D 语言写脚本? +====== +D 语言是以系统编程语言而闻名,但它也是编写脚本的一个很好的选择。 +![Business woman on laptop sitting in front of window][1] + +D 语言由于其静态类型和元编程能力,经常被宣传为系统编程语言。然而,它也是一种非常高效的脚本语言。 + +由于 Python 在自动化任务和快速实现原型想法方面的灵活性,它通常被选为脚本语言。这使得 Python 对系统管理员、[管理者][2]和一般的开发人员非常有吸引力,因为它可以自动完成他们可能不得不手动完成的重复性任务。 + +我们有理由期待任何其他的脚本编写语言具有 Python 的这些特性和能力。以下是我认为 D 是一个不错的选择的两个原因。 + +### 1\. D 很容易读和写 + +作为一种类似于 C 的语言,D 应该是大多数程序员所熟悉的。任何使用 JavaScript、Java、PHP 或 Python 的人对 D 语言都很容易上手。 + +如果你还没有安装 D,请[安装 D 编译器][3],这样你就可以[运行本文中的 D 代码][4]。你也可以使用[在线 D 编辑器][5]。 + +下面是一个 D 代码的例子,它从一个名为 `words.txt` 的文件中读取单词,并在命令行中打印出来: + + +``` +open +source +is +cool +``` + +用 D 语言写脚本: + + +``` +// file print_words.d + +#!/usr/bin/env rdmd + +// import the D standard library +import std; + +void main(){ +    // open the file +     File("./words.txt") + +         //iterate by line +        .byLine + +        // print each number +        .each!writeln; +} +``` + +这段代码的前缀是 [shebang][6],它将使用 [rdmd][7] 来运行这段代码,rdmd 是 D 编译器自带的编译和运行代码的工具。假设你运行的是 Unix 或 Linux,在运行这个脚本之前,你必须使用` chmod` 命令使其可执行: + +``` +`chmod u+x print_words.d` +``` + +现在脚本是可执行的,你可以运行它: + + +``` +`./print_words.d` +``` + +这将在你的命令行中打印以下内容: + + +``` +open +source +is +cool +``` + +恭喜你,你写了第一个 D 语言脚本。你可以看到 D 是如何让你按顺序链式调用函数,这让阅读代码的感觉很自然,类似于你在头脑中思考问题的方式。这个[功能让 D 成为我最喜欢的编程语言][8]。 + +试着再写一个脚本:一个非营利组织的管理员有一个捐款的文本文件,每笔金额都是单独的一行。管理员想把前 10 笔捐款相加,然后打印出金额: + + +``` +// file sum_donations.d + +#!/usr/bin/env rdmd + +import std; + +void main() +{ +    double total = 0; + +    // open the file +    File("monies.txt") + +         // iterate by line +        .byLine + +         // pick first 10 lines +        .take(10) + +        // remove new line characters (\n) +        .map!(strip) + +         // convert each to double +        .map!(to!double) + +        // add element to total +        .tee!((x) { total += x; }) + +        // print each number +        .each!writeln; + +    // print total +    writeln("total: ", total); +} +``` + +与 `each` 一起使用的 `!` 操作符是[模板参数][9]的语法。 + +### 2\. D 是快速原型设计的好帮手 + +D 是灵活的,它可以快速地将代码敲打在一起,并使其发挥作用。它的标准库中包含了丰富的实用函数,用于执行常见的任务,如操作数据(JSON、CSV、文本等)。它还带有一套丰富的通用算法,用于迭代、搜索、比较和 mutate 数据。这些巧妙的算法通过定义通用的[基于范围的接口][10]面向处理序列。 + + +上面的脚本显示了 D 中的链式调用函数如何提供顺序处理和操作数据的要领。D 的另一个吸引人的地方是它不断增长的第三方包的生态系统,用于执行普通任务。一个例子是,使用 [Vibe.d][11] web 框架构建一个简单的 web 服务器很容易。下面是一个例子: + + +``` +#!/usr/bin/env dub +/+ dub.sdl: +dependency "vibe-d" version="~>0.8.0" ++/ +void main() +{ +    import vibe.d; +    listenHTTP(":8080", (req, res) { +        res.writeBody("Hello, World: " ~ req.path); +    }); +    runApplication(); +} +``` + +它使用官方的 D 软件包管理器 [Dub][12],从 [D 软件包仓库][13]中获取 vibe.d web 框架。Dub 负责下载 Vibe.d 包,然后在本地主机 8080 端口上编译并启动一个 web 服务器。 + +### 尝试一下 D 语言 + +这些只是你可能想用 D 来写脚本的几个原因。 + +D 是一种非常适合开发的语言。你可以很容易从 D 下载页面安装,因此下载编译器,看看例子,并亲自体验 D 语言。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/d-scripting + +作者:[Lawrence Aberba][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/aberba +[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://opensource.com/article/20/3/automating-community-management-python +[3]: https://tour.dlang.org/tour/en/welcome/install-d-locally +[4]: https://tour.dlang.org/tour/en/welcome/run-d-program-locally +[5]: https://run.dlang.io/ +[6]: https://en.wikipedia.org/wiki/Shebang_(Unix) +[7]: https://dlang.org/rdmd.html +[8]: https://opensource.com/article/20/7/d-programming +[9]: http://ddili.org/ders/d.en/templates.html +[10]: http://ddili.org/ders/d.en/ranges.html +[11]: https://vibed.org +[12]: https://dub.pm/getting_started +[13]: https://code.dlang.org From 09e5b2b9e32fce4046a672ec39856c01ec23b662 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 9 Feb 2021 10:42:09 +0800 Subject: [PATCH 240/381] translated --- ...he D programming language for scripting.md | 183 ------------------ 1 file changed, 183 deletions(-) delete mode 100644 sources/tech/20210127 Why I use the D programming language for scripting.md diff --git a/sources/tech/20210127 Why I use the D programming language for scripting.md b/sources/tech/20210127 Why I use the D programming language for scripting.md deleted file mode 100644 index 94cd6db038..0000000000 --- a/sources/tech/20210127 Why I use the D programming language for scripting.md +++ /dev/null @@ -1,183 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why I use the D programming language for scripting) -[#]: via: (https://opensource.com/article/21/1/d-scripting) -[#]: author: (Lawrence Aberba https://opensource.com/users/aberba) - -我为什么要用 D 语言写脚本? -====== -D 语言是以系统编程语言而闻名,但它也是编写脚本的一个很好的选择。 -![Business woman on laptop sitting in front of window][1] - -D 语言由于其静态类型和元编程能力,经常被宣传为系统编程语言。然而,它也是一种非常高效的脚本语言。 - -由于 Python 在自动化任务和快速实现原型想法方面的灵活性,它通常被选为脚本语言。这使得 Python 对系统管理员、[管理者][2]和一般的开发人员非常有吸引力,因为它可以自动完成他们可能不得不手动完成的重复性任务。 - -我们有理由期待任何其他的脚本编写语言具有 Python 的这些特性和能力。以下是我认为 D 是一个不错的选择的两个原因。 - -### 1\. D 很容易读和写 - -作为一种类似于 C 的语言,D 应该是大多数程序员所熟悉的。任何使用 JavaScript、Java、PHP 或 Python 的人对 D 语言都很容易上手。 - -如果你还没有安装 D,请[安装 D 编译器][3],这样你就可以[运行本文中的 D 代码][4]。你也可以使用[在线 D 编辑器][5]。 - -下面是一个 D 代码的例子,它从一个名为 `words.txt` 的文件中读取单词,并在命令行中打印出来: - - -``` -open -source -is -cool -``` - -用 D 语言写脚本: - - -``` -// file print_words.d - -#!/usr/bin/env rdmd - -// import the D standard library -import std; - -void main(){ -    // open the file -     File("./words.txt") - -         //iterate by line -        .byLine - -        // print each number -        .each!writeln; -} -``` - -这段代码的前缀是 [shebang][6],它将使用 [rdmd][7] 来运行这段代码,rdmd 是 D 编译器自带的编译和运行代码的工具。假设你运行的是 Unix 或 Linux,在运行这个脚本之前,你必须使用` chmod` 命令使其可执行: - -``` -`chmod u+x print_words.d` -``` - -现在脚本是可执行的,你可以运行它: - - -``` -`./print_words.d` -``` - -这将在你的命令行中打印以下内容: - - -``` -open -source -is -cool -``` - -恭喜你,你写了第一个 D 语言脚本。你可以看到 D 是如何让你按顺序链式调用函数,这让阅读代码的感觉很自然,类似于你在头脑中思考问题的方式。这个[功能让 D 成为我最喜欢的编程语言][8]。 - -试着再写一个脚本:一个非营利组织的管理员有一个捐款的文本文件,每笔金额都是单独的一行。管理员想把前 10 笔捐款相加,然后打印出金额: - - -``` -// file sum_donations.d - -#!/usr/bin/env rdmd - -import std; - -void main() -{ -    double total = 0; - -    // open the file -    File("monies.txt") - -         // iterate by line -        .byLine - -         // pick first 10 lines -        .take(10) - -        // remove new line characters (\n) -        .map!(strip) - -         // convert each to double -        .map!(to!double) - -        // add element to total -        .tee!((x) { total += x; }) - -        // print each number -        .each!writeln; - -    // print total -    writeln("total: ", total); -} -``` - -与 `each` 一起使用的 `!` 操作符是[模板参数][9]的语法。 - -### 2\. D 是快速原型设计的好帮手 - -D 是灵活的,它可以快速地将代码敲打在一起,并使其发挥作用。它的标准库中包含了丰富的实用函数,用于执行常见的任务,如操作数据(JSON、CSV、文本等)。它还带有一套丰富的通用算法,用于迭代、搜索、比较和 mutate 数据。这些巧妙的算法通过定义通用的[基于范围的接口][10]面向处理序列。 - - -上面的脚本显示了 D 中的链式调用函数如何提供顺序处理和操作数据的要领。D 的另一个吸引人的地方是它不断增长的第三方包的生态系统,用于执行普通任务。一个例子是,使用 [Vibe.d][11] web 框架构建一个简单的 web 服务器很容易。下面是一个例子: - - -``` -#!/usr/bin/env dub -/+ dub.sdl: -dependency "vibe-d" version="~>0.8.0" -+/ -void main() -{ -    import vibe.d; -    listenHTTP(":8080", (req, res) { -        res.writeBody("Hello, World: " ~ req.path); -    }); -    runApplication(); -} -``` - -它使用官方的 D 软件包管理器 [Dub][12],从 [D 软件包仓库][13]中获取 vibe.d web 框架。Dub 负责下载 Vibe.d 包,然后在本地主机 8080 端口上编译并启动一个 web 服务器。 - -### 尝试一下 D 语言 - -这些只是你可能想用 D 来写脚本的几个原因。 - -D 是一种非常适合开发的语言。你可以很容易从 D 下载页面安装,因此下载编译器,看看例子,并亲自体验 D 语言。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/d-scripting - -作者:[Lawrence Aberba][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/aberba -[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://opensource.com/article/20/3/automating-community-management-python -[3]: https://tour.dlang.org/tour/en/welcome/install-d-locally -[4]: https://tour.dlang.org/tour/en/welcome/run-d-program-locally -[5]: https://run.dlang.io/ -[6]: https://en.wikipedia.org/wiki/Shebang_(Unix) -[7]: https://dlang.org/rdmd.html -[8]: https://opensource.com/article/20/7/d-programming -[9]: http://ddili.org/ders/d.en/templates.html -[10]: http://ddili.org/ders/d.en/ranges.html -[11]: https://vibed.org -[12]: https://dub.pm/getting_started -[13]: https://code.dlang.org From 833c8b7c6c1267010a419325147e805164a57fbd Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 9 Feb 2021 10:44:19 +0800 Subject: [PATCH 241/381] translating --- ...-based Web Browser With A Focus on Privacy and Minimalism.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md b/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md index 02751230d0..9fbc97ed85 100644 --- a/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md +++ b/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 177f81d1eac6b1d59d125b7fd4dbfd2678520400 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 11:14:36 +0800 Subject: [PATCH 242/381] PRF @Chao-zhi --- ...mands in Arch-based Linux Distributions.md | 122 +++++++++--------- 1 file changed, 58 insertions(+), 64 deletions(-) diff --git a/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md b/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md index d33bb59f36..f40785007d 100644 --- a/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md +++ b/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md @@ -1,65 +1,63 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: 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/) -基于 Arch 的 Linux 发行版中 Pacman 命令入门 +Arch Linux 的 pacman 命令入门 ====== -_**简介:这本初学者指南向您展示了在 Linux 中可以使用 pacman 命令做什么,如何使用它们来查找新的软件包,安装和升级新的软件包,以及清理您的系统。**_ +> 这本初学者指南向你展示了在 Linux 中可以使用 pacman 命令做什么,如何使用它们来查找新的软件包,安装和升级新的软件包,以及清理你的系统。 -[pacman][1] 包管理器是 [Arch Linux][2] 和其他主要发行版如 Red Hat 和 Ubuntu/Debian 之间的主要区别之一。它结合了简单的二进制包格式和易于使用的[构建系统 ][3]。pacman 的目标是方便地管理软件包,无论它是来自[官方库 ][4] 还是用户自己的构建软件库。 +[pacman][1] 包管理器是 [Arch Linux][2] 和其他主要发行版如 Red Hat 和 Ubuntu/Debian 之间的主要区别之一。它结合了简单的二进制包格式和易于使用的 [构建系统][3]。`pacman` 的目标是方便地管理软件包,无论它是来自 [官方库][4] 还是用户自己构建的软件库。 -如果您曾经使用过 Ubuntu 或基于 debian 的 发行版,那么您可能使用过 apt-get 或 apt 命令。pacman 在 Arch Linux 中是同样的。如果你[刚刚安装了 Arch Linux][5],在安装 Arch Linux 后,首先要做的[几件事 ][6] 之一就是学习使用 pacman 命令。 +如果你曾经使用过 Ubuntu 或基于 debian 的发行版,那么你可能使用过 `apt-get` 或 `apt` 命令。`pacman` 在 Arch Linux 中是同样的命令。如果你 [刚刚安装了 Arch Linux][5],在安装 Arch Linux 后,首先要做的 [几件事][6] 之一就是学习使用 `pacman` 命令。 -在这个初学者指南中,我将解释一些基本的 pacman 命令的用法,你应该知道如何用这些命令来管理你的基于 Archlinux 的系统。 +在这个初学者指南中,我将解释一些基本的 `pacman` 命令的用法,你应该知道如何用这些命令来管理你的基于 Archlinux 的系统。 ### Arch Linux 用户应该知道的几个重要的 pacman 命令 -![][7] +![](https://img.linux.net.cn/data/attachment/album/202102/09/111411uqadijqdd8afgk56.jpg) -与其他包管理器一样,pacman 可以将包列表与软件库同步,它能够自动解决所有所需的依赖项,以使得用户可以通过一个简单的命令下载和安装软件。 +与其他包管理器一样,`pacman` 可以将包列表与软件库同步,它能够自动解决所有所需的依赖项,以使得用户可以通过一个简单的命令下载和安装软件。 #### 通过 pacman 安装软件 -你可以用一下形式的代码来安装一个或者多个软件包: +你可以用以下形式的代码来安装一个或者多个软件包: ``` -pacman -S _package_name1_ _package_name2_ ... +pacman -S 软件包名1 软件包名2 ... ``` -![安装一个包 ][8] +![安装一个包][8] --S 选项的意思是同步 (synchronization),它的意思是 pacman 在安装之前先与软件库进行同步。 - -pacman 数据库根据安装的原因将安装的包分为两组: - - * **显式安装**:由 pacman -S 或 -U 命令直接安装的包 - * **依赖安装**:由于被其他显式安装的包所[依赖 ][9],而被自动安装的包。 +`-S` 选项的意思是同步synchronization,它的意思是 `pacman` 在安装之前先与软件库进行同步。 +`pacman` 数据库根据安装的原因将安装的包分为两组: + * **显式安装**:由 `pacman -S` 或 `-U` 命令直接安装的包 + * **依赖安装**:由于被其他显式安装的包所 [依赖][9],而被自动安装的包。 #### 卸载已安装的软件包 卸载一个包,并且删除它的所有依赖。 ``` -pacman -R package_name_ +pacman -R 软件包名 ``` -![移除一个包 ][10] +![移除一个包][10] 删除一个包,以及其不被其他包所需要的依赖项: ``` -pacman -Rs _package_name_ +pacman -Rs 软件包名 ``` -删除所有不再需要的依赖项。比如,需要这个依赖的包已经被删除了。 +如果需要这个依赖的包已经被删除了,这条命令可以删除所有不再需要的依赖项: ``` pacman -Qdtq | pacman -Rs - @@ -67,80 +65,76 @@ pacman -Qdtq | pacman -Rs - #### 升级软件包 -Pacman 提供了一个简单的办法来[升级 Arch Linux][11]。你只需要一条命令就可以升级所有已安装的软件包。这可能需要一段时间,这取决于系统的新旧程度。 +`pacman` 提供了一个简单的办法来 [升级 Arch Linux][11]。你只需要一条命令就可以升级所有已安装的软件包。这可能需要一段时间,这取决于系统的新旧程度。 -以下命令可以同步存储库数据库 _并且_ 更新系统的所有软件包,但不包括不在软件库中的“本地安装的”包: +以下命令可以同步存储库数据库,*并且* 更新系统的所有软件包,但不包括不在软件库中的“本地安装的”包: ``` pacman -Syu ``` - * S 代表同步 - * y 代表更新本地存储库 - * u 代表系统更新 + * `S` 代表同步 + * `y` 代表更新本地存储库 + * `u` 代表系统更新 +也就是说,同步到中央软件库(主程序包数据库),刷新主程序包数据库的本地副本,然后执行系统更新(通过更新所有有更新版本可用的程序包)。 +![系统更新][12] -也就是说,同步到中央存储库(主程序包数据库),刷新主程序包数据库的本地副本,然后执行系统更新(通过更新所有有更新版本可用的程序包)。 - -![系统更新 ][12] - -注意! - -Arch Linux 用户在系统升级前,建议您访问 [Arch-Linux 主页 ][2] 查看最新消息,以了解异常更新的情况。如果系统更新需要人工干预,主页上将发布相关的新闻。您也可以订阅 [RSS feed][13] 或 [Arch 的声明邮件 ][14]。 - -在升级基础软件(如 kernel、xorg、systemd 或 glibc) 之前,请注意查看相应的 [论坛 ][15],以了解大家报告的各种问题。 - -**在 Arch 和 Manjaro 等滚动发行版中不支持仅部分升级**。这意味着,当新的库版本被推送到存储库时,存储库中的所有包都需要根据库进行升级。例如,如果两个包依赖于同一个库,则仅升级一个包可能会破坏依赖于库的旧版本的另一个包。 +> 注意! +> +> 对于 Arch Linux 用户,在系统升级前,建议你访问 [Arch-Linux 主页][2] 查看最新消息,以了解异常更新的情况。如果系统更新需要人工干预,主页上将发布相关的新闻。你也可以订阅 [RSS 源][13] 或 [Arch 的声明邮件][14]。 +> +> 在升级基础软件(如 kernel、xorg、systemd 或 glibc) 之前,请注意查看相应的 [论坛][15],以了解大家报告的各种问题。 +> +> 在 Arch 和 Manjaro 等滚动发行版中不支持**部分升级**。这意味着,当新的库版本被推送到软件库时,软件库中的所有包都需要根据库版本进行升级。例如,如果两个包依赖于同一个库,则仅升级一个包可能会破坏依赖于该库的旧版本的另一个包。 #### 用 Pacman 查找包 -Pacman 使用 -Q 选项查询本地包数据库,使用 -S 选项查询同步数据库,使用 -F 选项查询文件数据库。 +`pacman` 使用 `-Q` 选项查询本地包数据库,使用 `-S` 选项查询同步数据库,使用 `-F` 选项查询文件数据库。 -Pacman 可以在数据库中搜索包,包括包的名称和描述: +`pacman` 可以在数据库中搜索包,包括包的名称和描述: ``` -pacman -Ss _string1_ _string2_ ... +pacman -Ss 字符串1 字符串2 ... ``` -![查找一个包 ][16] +![查找一个包][16] 查找已经被安装的包: ``` -pacman -Qs _string1_ _string2_ ... +pacman -Qs 字符串1 字符串2 ... ``` -根据文件名在远程数据库中查找它所属的包: +根据文件名在远程软包中查找它所属的包: ``` -pacman -F _string1_ _string2_ ... +pacman -F 字符串1 字符串2 ... ``` 查看一个包的依赖树: ``` -pactree _package_naenter code hereme_ +pactree 软件包名 ``` #### 清除包缓存 -Pacman 将其下载的包存储在 /var/cache/Pacman/pkg/ 中,并且不会自动删除旧版本或卸载的版本。这有一些优点: - - 1。它允许[降级 ][17] 一个包,而不需要通过其他来源检索以前的版本。 - 2。已卸载的软件包可以轻松地直接从缓存文件夹重新安装。 - +`pacman` 将其下载的包存储在 `/var/cache/Pacman/pkg/` 中,并且不会自动删除旧版本或卸载的版本。这有一些优点: + 1. 它允许 [降级][17] 一个包,而不需要通过其他来源检索以前的版本。 + 2. 已卸载的软件包可以轻松地直接从缓存文件夹重新安装。 但是,有必要定期清理缓存以防止文件夹增大。 -[pacman contrib][19] 包中提供的 [paccache(8)][18] 脚本默认情况下会删除已安装和未安装包的所有缓存版本,但最近 3 个版本除外: +[pacman contrib][19] 包中提供的 [paccache(80][18] 脚本默认情况下会删除已安装和未安装包的所有缓存版本,但最近 3 个版本除外: ``` paccache -r ``` -![清除缓存 ][20] +![清除缓存][20] 要删除当前未安装的所有缓存包和未使用的同步数据库,请执行: @@ -148,7 +142,7 @@ paccache -r pacman -Sc ``` -要从缓存中删除所有文件,请使用 clean 选项两次,这是最激进的方法,不会在缓存文件夹中留下任何内容: +要从缓存中删除所有文件,请使用清除选项两次,这是最激进的方法,不会在缓存文件夹中留下任何内容: ``` pacman -Scc @@ -159,7 +153,7 @@ pacman -Scc 安装不是来自远程存储库的“本地”包: ``` -pacman -U _/path/to/package/package_name-version.pkg.tar.xz_ +pacman -U 本地软件包路径.pkg.tar.xz ``` 安装官方存储库中未包含的“远程”软件包: @@ -170,7 +164,7 @@ pacman -U http://www.example.com/repo/example.pkg.tar.xz ### 额外内容:用 pacman 排除常见错误 -下面是使用 pacman 管理包时可能遇到的一些常见错误。 +下面是使用 `pacman` 管理包时可能遇到的一些常见错误。 #### 提交事务失败(文件冲突) @@ -183,21 +177,21 @@ package: /path/to/file exists in filesystem Errors occurred, no packages were upgraded. ``` -这是因为 pacman 检测到文件冲突,不会为您覆盖文件。 +这是因为 `pacman` 检测到文件冲突,不会为你覆盖文件。 -解决这个问题的一个安全方法是首先检查另一个包是否拥有这个文件 (pacman-Qo\path/to/file)。如果该文件属于另一个包,请提交错误报告。如果文件不属于另一个包,请重命名“存在于文件系统中”的文件,然后重新发出 update 命令。如果一切顺利,文件可能会被删除。 +解决这个问题的一个安全方法是首先检查另一个包是否拥有这个文件(`pacman-Qo 文件路径`)。如果该文件属于另一个包,请提交错误报告。如果文件不属于另一个包,请重命名“存在于文件系统中”的文件,然后重新发出更新命令。如果一切顺利,文件可能会被删除。 -您可以显式地运行 **pacman -S –overwrite glob package**,强制 pacman 覆盖与 _glob_ 匹配的文件,而不是手动重命名并在以后删除属于所讨论的包的所有文件。 +你可以显式地运行 `pacman -S –overwrite 要覆盖的文件模式**,强制 `pacman` 覆盖与 给模式匹配的文件,而不是手动重命名并在以后删除属于该包的所有文件。 #### 提交事务失败(包无效或损坏) -在 /var/cache/pacman/pkg/ 中查找 .part 文件(部分下载的包),并将其删除。这通常是由在 pacman.conf 文件中使用自定义 XferCommand 引起的。 +在 `/var/cache/pacman/pkg/` 中查找 `.part` 文件(部分下载的包),并将其删除。这通常是由在 `pacman.conf` 文件中使用自定义 `XferCommand` 引起的。 #### 初始化事务失败(无法锁定数据库) -当 pacman 要修改包数据库时,例如安装包时,它会在 /var/lib/pacman/db.lck 处创建一个锁文件。这可以防止 pacman 的另一个实例同时尝试更改包数据库。 +当 `pacman` 要修改包数据库时,例如安装包时,它会在 `/var/lib/pacman/db.lck` 处创建一个锁文件。这可以防止 `pacman` 的另一个实例同时尝试更改包数据库。 -如果 pacman 在更改数据库时被中断,这个过时的锁文件可能仍然保留。如果您确定没有 pacman 实例正在运行,那么请删除锁文件。 +如果 `pacman` 在更改数据库时被中断,这个过时的锁文件可能仍然保留。如果你确定没有 `pacman` 实例正在运行,那么请删除锁文件。 检查进程是否持有锁定文件: @@ -211,9 +205,9 @@ lsof /var/lib/pacman/db.lck rm /var/lib/pacman/db.lck ``` -如果您发现 lsof 命令输出了使用锁文件的进程的 PID,请先杀死这个进程,然后删除锁文件。 +如果你发现 `lsof` 命令输出了使用锁文件的进程的 PID,请先杀死这个进程,然后删除锁文件。 -我希望你喜欢我对 Pacman 基础命令的解释。请在下面留言,不要忘记订阅我们的社交媒体。注意安全! +我希望你喜欢我对 `pacman` 基础命令的介绍。 -------------------------------------------------------------------------------- @@ -222,7 +216,7 @@ via: https://itsfoss.com/pacman-command/ 作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] 译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 36746c58594919e01f015bb0a1caa58a17c1b9f5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 11:15:15 +0800 Subject: [PATCH 243/381] PUB @Chao-zhi https://linux.cn/article-13099-1.html --- ... With Pacman Commands in Arch-based Linux Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md (99%) diff --git a/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md b/published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md similarity index 99% rename from translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md rename to published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md index f40785007d..ca96c39363 100644 --- a/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md +++ b/published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13099-1.html) [#]: 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/) From 21a0c9bcaddc3755d2721a90fe99b96d5673f2a0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 12:41:18 +0800 Subject: [PATCH 244/381] PRF --- ...ed With Pacman Commands in Arch-based Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md b/published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md index ca96c39363..8171a81ede 100644 --- a/published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md +++ b/published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md @@ -128,7 +128,7 @@ pactree 软件包名 但是,有必要定期清理缓存以防止文件夹增大。 -[pacman contrib][19] 包中提供的 [paccache(80][18] 脚本默认情况下会删除已安装和未安装包的所有缓存版本,但最近 3 个版本除外: +[pacman contrib][19] 包中提供的 [paccache(8)][18] 脚本默认情况下会删除已安装和未安装包的所有缓存版本,但最近 3 个版本除外: ``` paccache -r From 04cc3a2e7ff23fd6723f9f4a9346bbab56463660 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 13:44:16 +0800 Subject: [PATCH 245/381] PRF @geekpi --- ...he D programming language for scripting.md | 101 ++++++++---------- 1 file changed, 47 insertions(+), 54 deletions(-) diff --git a/translated/tech/20210127 Why I use the D programming language for scripting.md b/translated/tech/20210127 Why I use the D programming language for scripting.md index 94cd6db038..d2dc7759e4 100644 --- a/translated/tech/20210127 Why I use the D programming language for scripting.md +++ b/translated/tech/20210127 Why I use the D programming language for scripting.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Why I use the D programming language for scripting) @@ -9,16 +9,18 @@ 我为什么要用 D 语言写脚本? ====== -D 语言是以系统编程语言而闻名,但它也是编写脚本的一个很好的选择。 -![Business woman on laptop sitting in front of window][1] + +> D 语言以系统编程语言而闻名,但它也是编写脚本的一个很好的选择。 + +![](https://img.linux.net.cn/data/attachment/album/202102/09/134351j4m3hrhll0h38plp.jpg) D 语言由于其静态类型和元编程能力,经常被宣传为系统编程语言。然而,它也是一种非常高效的脚本语言。 -由于 Python 在自动化任务和快速实现原型想法方面的灵活性,它通常被选为脚本语言。这使得 Python 对系统管理员、[管理者][2]和一般的开发人员非常有吸引力,因为它可以自动完成他们可能不得不手动完成的重复性任务。 +由于 Python 在自动化任务和快速实现原型想法方面的灵活性,它通常被选为脚本语言。这使得 Python 对系统管理员、[管理者][2]和一般的开发人员非常有吸引力,因为它可以自动完成他们可能需要手动完成的重复性任务。 -我们有理由期待任何其他的脚本编写语言具有 Python 的这些特性和能力。以下是我认为 D 是一个不错的选择的两个原因。 +我们自然也可以期待任何其他的脚本编写语言具有 Python 的这些特性和能力。以下是我认为 D 是一个不错的选择的两个原因。 -### 1\. D 很容易读和写 +### 1、D 很容易读和写 作为一种类似于 C 的语言,D 应该是大多数程序员所熟悉的。任何使用 JavaScript、Java、PHP 或 Python 的人对 D 语言都很容易上手。 @@ -26,7 +28,6 @@ D 语言由于其静态类型和元编程能力,经常被宣传为系统编程 下面是一个 D 代码的例子,它从一个名为 `words.txt` 的文件中读取单词,并在命令行中打印出来: - ``` open source @@ -36,43 +37,39 @@ cool 用 D 语言写脚本: - ``` -// file print_words.d - #!/usr/bin/env rdmd +// file print_words.d // import the D standard library import std; void main(){ -    // open the file -     File("./words.txt") + // open the file + File("./words.txt") -         //iterate by line -        .byLine + //iterate by line + .byLine -        // print each number -        .each!writeln; + // print each number + .each!writeln; } ``` -这段代码的前缀是 [shebang][6],它将使用 [rdmd][7] 来运行这段代码,rdmd 是 D 编译器自带的编译和运行代码的工具。假设你运行的是 Unix 或 Linux,在运行这个脚本之前,你必须使用` chmod` 命令使其可执行: +这段代码以 [释伴][6] 开头,它将使用 [rdmd][7] 来运行这段代码,`rdmd` 是 D 编译器自带的编译和运行代码的工具。假设你运行的是 Unix 或 Linux,在运行这个脚本之前,你必须使用` chmod` 命令使其可执行: ``` -`chmod u+x print_words.d` +chmod u+x print_words.d ``` 现在脚本是可执行的,你可以运行它: - ``` -`./print_words.d` +./print_words.d ``` 这将在你的命令行中打印以下内容: - ``` open source @@ -84,70 +81,66 @@ cool 试着再写一个脚本:一个非营利组织的管理员有一个捐款的文本文件,每笔金额都是单独的一行。管理员想把前 10 笔捐款相加,然后打印出金额: - ``` -// file sum_donations.d - #!/usr/bin/env rdmd +// file sum_donations.d import std; void main() { -    double total = 0; + double total = 0; -    // open the file -    File("monies.txt") + // open the file + File("monies.txt") -         // iterate by line -        .byLine + // iterate by line + .byLine -         // pick first 10 lines -        .take(10) + // pick first 10 lines + .take(10) -        // remove new line characters (\n) -        .map!(strip) + // remove new line characters (\n) + .map!(strip) -         // convert each to double -        .map!(to!double) + // convert each to double + .map!(to!double) -        // add element to total -        .tee!((x) { total += x; }) + // add element to total + .tee!((x) { total += x; }) -        // print each number -        .each!writeln; + // print each number + .each!writeln; -    // print total -    writeln("total: ", total); + // print total + writeln("total: ", total); } ``` 与 `each` 一起使用的 `!` 操作符是[模板参数][9]的语法。 -### 2\. D 是快速原型设计的好帮手 +### 2、D 是快速原型设计的好帮手 -D 是灵活的,它可以快速地将代码敲打在一起,并使其发挥作用。它的标准库中包含了丰富的实用函数,用于执行常见的任务,如操作数据(JSON、CSV、文本等)。它还带有一套丰富的通用算法,用于迭代、搜索、比较和 mutate 数据。这些巧妙的算法通过定义通用的[基于范围的接口][10]面向处理序列。 - - -上面的脚本显示了 D 中的链式调用函数如何提供顺序处理和操作数据的要领。D 的另一个吸引人的地方是它不断增长的第三方包的生态系统,用于执行普通任务。一个例子是,使用 [Vibe.d][11] web 框架构建一个简单的 web 服务器很容易。下面是一个例子: +D 是灵活的,它可以快速地将代码敲打在一起,并使其发挥作用。它的标准库中包含了丰富的实用函数,用于执行常见的任务,如操作数据(JSON、CSV、文本等)。它还带有一套丰富的通用算法,用于迭代、搜索、比较和 mutate 数据。这些巧妙的算法通过定义通用的 [基于范围的接口][10] 而按照序列进行处理。 +上面的脚本显示了 D 中的链式调用函数如何提供顺序处理和操作数据的要领。D 的另一个吸引人的地方是它不断增长的用于执行普通任务的第三方包的生态系统。一个例子是,使用 [Vibe.d][11] web 框架构建一个简单的 web 服务器很容易。下面是一个例子: ``` #!/usr/bin/env dub /+ dub.sdl: -dependency "vibe-d" version="~>0.8.0" +dependency "vibe-d" version="~>0.8.0" +/ void main() { -    import vibe.d; -    listenHTTP(":8080", (req, res) { -        res.writeBody("Hello, World: " ~ req.path); -    }); -    runApplication(); + import vibe.d; + listenHTTP(":8080", (req, res) { + res.writeBody("Hello, World: " ~ req.path); + }); + runApplication(); } ``` -它使用官方的 D 软件包管理器 [Dub][12],从 [D 软件包仓库][13]中获取 vibe.d web 框架。Dub 负责下载 Vibe.d 包,然后在本地主机 8080 端口上编译并启动一个 web 服务器。 +它使用官方的 D 软件包管理器 [Dub][12],从 [D 软件包仓库][13]中获取 vibe.d Web 框架。Dub 负责下载 Vibe.d 包,然后在本地主机 8080 端口上编译并启动一个 web 服务器。 ### 尝试一下 D 语言 @@ -162,7 +155,7 @@ via: https://opensource.com/article/21/1/d-scripting 作者:[Lawrence Aberba][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 73b0b1d08e8152dc63337a751d33be15099ab331 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 13:44:53 +0800 Subject: [PATCH 246/381] PUB @geekpi https://linux.cn/article-13100-1.html --- ...0127 Why I use the D programming language for scripting.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210127 Why I use the D programming language for scripting.md (98%) diff --git a/translated/tech/20210127 Why I use the D programming language for scripting.md b/published/20210127 Why I use the D programming language for scripting.md similarity index 98% rename from translated/tech/20210127 Why I use the D programming language for scripting.md rename to published/20210127 Why I use the D programming language for scripting.md index d2dc7759e4..63618522ea 100644 --- a/translated/tech/20210127 Why I use the D programming language for scripting.md +++ b/published/20210127 Why I use the D programming language for scripting.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13100-1.html) [#]: subject: (Why I use the D programming language for scripting) [#]: via: (https://opensource.com/article/21/1/d-scripting) [#]: author: (Lawrence Aberba https://opensource.com/users/aberba) From b621aec005305e4f3acfbe0a180b0c861474a352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Tue, 9 Feb 2021 18:18:37 +0800 Subject: [PATCH 247/381] translating by Chao-zhi --- ...p a Tiling Makeover With Material Shell GNOME Extension.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md b/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md index b273ef33b3..47097fa9a9 100644 --- a/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md +++ b/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -104,7 +104,7 @@ via: https://itsfoss.com/material-shell/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c875016e322f371ede1f1ac6032c2257da7b022d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Tue, 9 Feb 2021 21:49:00 +0800 Subject: [PATCH 248/381] translate done: 20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md --- ...ver With Material Shell GNOME Extension.md | 128 ----------------- ...ver With Material Shell GNOME Extension.md | 130 ++++++++++++++++++ 2 files changed, 130 insertions(+), 128 deletions(-) delete mode 100644 sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md create mode 100644 translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md diff --git a/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md b/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md deleted file mode 100644 index 47097fa9a9..0000000000 --- a/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md +++ /dev/null @@ -1,128 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Chao-zhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension) -[#]: via: (https://itsfoss.com/material-shell/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension -====== - -There is something about tiling windows that attracts many people. Perhaps it looks good or perhaps it is time-saving if you are a fan of [keyboard shortcuts in Linux][1]. Or maybe it’s the challenge of using the uncommon tiling windows. - -![Tiling Windows in Linux | Image Source][2] - -From i3 to [Sway][3], there are so many tiling window managers available for Linux desktop. Configuring a tiling window manager itself requires a steep learning curve. - -This is why projects like [Regolith desktop][4] exist to give you preconfigured tiling desktop so that you can get started with tiling windows with less effort. - -Let me introduce you to a similar project named Material Shell that makes using tiling feature even easier than [Regolith][5]. - -### Material Shell GNOME Extension: Convert GNOME desktop into a tiling window manager - -[Material Shell][6] is a GNOME extension and that’s the best thing about it. This means that you don’t have to log out and log in to another desktop environment or window manager. You can enable or disable it from within your current session. - -I’ll list the features of Material Shell but it will be easier to see it in action: - -[Subscribe to our YouTube channel for more Linux videos][7] - -The project is called Material Shell because it follows the [Material Design][8] guideline and thus gives the applications an aesthetically pleasing interface. Here are its main features: - -#### Intuitive interface - -Material Shell adds a left panel for quick access. On this panel, you can find the system tray at the bottom and the search and workspaces on the top. - -All the new apps are added to the current workspace. You can create new workspace and switch to it for organizing your running apps into categories. This is the essential concept of workspace anyway. - -In Material Shell, every workspace can be visualized as a row with several apps rather than a box with several apps in it. - -#### Tiling windows - -In a workspace, you can see all your opened applications on the top all the time. By default, the applications are opened to take the entire screen like you do in GNOME desktop. You can change the layout to split it in half or multiple columns or a grid of apps using the layout changer in the top right corner. - -This video shows all the above features at a glance: - -#### Persistent layout and workspaces - -That’s not it. Material Shell also remembers the workspaces and windows you open so that you don’t have to reorganize your layout again. This is a good feature to have as it saves time if you are particular about which application goes where. - -#### Hotkeys/Keyboard shortcut - -Like any tiling windows manager, you can use keyboard shortcuts to navigate between applications and workspaces. - - * `Super+W` Navigate to the upper workspace. - * `Super+S` Navigate to the lower workspace. - * `Super+A` Focus the window at the left of the current window. - * `Super+D` Focus the window at the right of the current window. - * `Super+1`, `Super+2` … `Super+0` Navigate to specific workspace - * `Super+Q` Kill the current window focused. - * `Super+[MouseDrag]` Move window around. - * `Super+Shift+A` Move the current window to the left. - * `Super+Shift+D` Move the current window to the right. - * `Super+Shift+W` Move the current window to the upper workspace. - * `Super+Shift+S` Move the current window to the lower workspace. - - - -### Installing Material Shell - -Warning! - -Tiling windows could be confusing for many users. You should be familiar with GNOME Extensions to use it. Avoid trying it if you are absolutely new to Linux or if you are easily panicked if anything changes in your system. - -Material Shell is a GNOME extension. So, please [check your desktop environment][9] to make sure you are running _**GNOME 3.34 or higher version**_. - -I would also like to add that tiling windows could be confusing for many users. - -Apart from that, I noticed that after disabling Material Shell it removes the top bar from Firefox and the Ubuntu dock. You can get the dock back by disabling/enabling Ubuntu dock extension from the Extensions app in GNOME. I haven’t tried but I guess these problems should also go away after a system reboot. - -I hope you know [how to use GNOME extensions][10]. The easiest way is to just [open this link in the browser][11], install GNOME extension plugin and then enable the Material Shell extension. - -![][12] - -If you don’t like it, you can disable it from the same extension link you used earlier or use the GNOME Extensions app: - -![][13] - -**To tile or not?** - -I use multiple screens and I found that Material Shell doesn’t work well with multiple monitors. This is something the developer(s) can improve in the future. - -Apart from that, it’s a really easy to get started with tiling windows with Material Shell. If you try Material Shell and like it, appreciate the project by [giving it a star or sponsoring it on GitHub][14]. - -For some reasons, tiling windows are getting popular. Recently released [Pop OS 20.04][15] also added tiling window features. - -But as I mentioned previously, tiling layouts are not for everyone and it could confuse many people. - -How about you? Do you prefer tiling windows or you prefer the classic desktop layout? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/material-shell/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/ubuntu-shortcuts/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/linux-ricing-example-800x450.jpg?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/sway-window-manager/ -[4]: https://itsfoss.com/regolith-linux-desktop/ -[5]: https://regolith-linux.org/ -[6]: https://material-shell.com -[7]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[8]: https://material.io/ -[9]: https://itsfoss.com/find-desktop-environment/ -[10]: https://itsfoss.com/gnome-shell-extensions/ -[11]: https://extensions.gnome.org/extension/3357/material-shell/ -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/09/install-material-shell.png?resize=800%2C307&ssl=1 -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/09/material-shell-gnome-extension.png?resize=799%2C497&ssl=1 -[14]: https://github.com/material-shell/material-shell -[15]: https://itsfoss.com/pop-os-20-04-review/ diff --git a/translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md b/translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md new file mode 100644 index 0000000000..cefcca8080 --- /dev/null +++ b/translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension) +[#]: via: (https://itsfoss.com/material-shell/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +使用 Material Shell 扩展将你的 GNOME 桌面打造成平铺式风格 +====== + +平铺式窗口的特性吸引了很多人的追捧。也许是因为他很好看,也许是因为对于 [linux 快捷键 ][1] 玩家他能提高效率。又或者是因为使用不同寻常的平铺式窗口是一种挑战。 + +![Tiling Windows in Linux | Image Source][2] + +从 i3 到 [Sway][3],linux 桌面拥有各种各样的平铺式窗口管理器。配置一个平铺式窗口管理器需要一个陡峭的学习曲线。 + +这就是为什么像 [Regolith desktop][4] 这样的项目会存在,它给你提供一个已经配置好的平铺式桌面。所以你不需要做大多的准备就可以直接开始使用。 + +让我给你介绍一个相似的项目 ——Material Shell。它可以让你用上平铺式桌面,甚至比 [Regolith][5] 还简单。 + +### Material Shell 扩展:将 GNOME 桌面转变成平铺式窗口管理器 + +[Material Shell][6] 是一个 GNOME 扩展,这就是它最好的点。这意味着你不需要注销并登陆其他桌面环境。你只需要启用或关闭这个扩展就可以自如的切换你的工作环境。 + +我会列出 Material Shell 的各种特性,但是也许视频更容易让你理解: + +[Subscribe to our YouTube channel for more Linux videos][7] + +这个项目叫做 Material Shell 是因为他遵循 [Material Design][8] 原则。因此这个应用拥有一个美观的界面。这就是他最重要的一个特性。 + +#### 直观的界面 + +Material Shell 添加了一个左侧面板,可以快速访问。在此面板上,您可以在底部找到系统托盘,在顶部找到搜索和工作区。 + +所有新打开的应用都会添加到当前工作区中。您也可以创建新的工作区并切换到该工作区,以将正在运行的应用分类。其实这就是工作区最初的意义。 + +在 Material Shell 中,每个工作区都可以显示为具有多个应用程序的行列,而不是包含多个应用程序的程序框。 + +#### 平铺式窗口 + +在工作区中,你可以看到所有打开的应用程序都在顶部。默认情况下,应用程序会像在 GNOME desktop 中那样铺满整个屏幕。你可以使用右上角的布局改变器来改变布局,将其分成两半、多列或多个应用网格。 + +这段视频一目了然的显示了以上所有功能: + +<!-- 丢了个视频链接,我不知道怎么添加 --> + +#### 固定布局和工作区 + +Material Shell 会记住你打开的工作区和窗口,这样你就不必重新组织你的布局。这是一个很好的特性,因为如果您对应用程序的位置有要求的话,它可以节省时间。 + +#### 热建/快捷键 + +像任何平铺窗口管理器一样,您可以使用键盘快捷键在应用程序和工作区之间切换。 + + * `Super+W` 切换到上个工作区; + * `Super+S` 切换到下个工作区; + * `Super+A` 切换到左边的窗口; + * `Super+D` 切换到右边的窗口; + * `Super+1`,`Super+2` … `Super+0` 切换到某个指定的工作区; + * `Super+Q` 关闭当前窗口; + * `Super+[MouseDrag]` 移动窗口; + * `Super+Shift+A` 将当前窗口左移; + * `Super+Shift+D` 将当前窗口右移; + * `Super+Shift+W` 将当前窗口上移; + * `Super+Shift+S` 将当前窗口下移。 + + + +### 安装 Material Shell + +警告! + +对于大多数用户来说,平铺式窗口可能会导致混乱。你最好先熟悉如何使用 GNOME 扩展。如果你是 Linux 新手或者你害怕你的系统发生翻天覆地的变化,你应当避免使用这个扩展。 + +Material Shell 是一个 GNOME 扩展。所以,请你[检查你的桌面环境 ][9] 确保它是 _**GNOME 3.34 或者更高的版本**_。 + +我还想补充一点,平铺窗口可能会让许多用户感到困惑。 + +除此之外,我注意到在禁用 Material Shell 之后,它会导致 Firefox 和 Ubuntu dock 的顶栏消失。你可以在 GNOME 的扩展应用程序中禁用/启用 Ubuntu 的 dock 扩展来使其变回原来的样子。我想这些问题也应该在系统重启后消失,虽然我没试过。 + +我希望你知道[如何使用 GNOME 扩展 ][10]。最简单的办法就是[在浏览器中打开这个链接 ][11],安装 GNOME 扩展浏览器插件并且启用 Material Shell 扩展。 + +![][12] + +如果你不喜欢这个扩展,你也可以在同样的链接中禁用它。或者在 GNOME 扩展程序中禁用它。 + +![][13] + +**使不使用平铺式** + +我使用多个电脑屏幕,我发现 Material Shell 不适用于多个屏幕的情况。这是开发者将来可以改进的地方。 + +除了这个毛病以外,Material Shell 是个让你开始使用平铺式窗口的好东西。如果你尝试了 Material Shell 并且喜欢它,请通过[给它一个星或在 GitHub 上赞助它 ][14] 来鼓励这个项目。 + +由于某些原因,平铺窗户越来越受欢迎。最近发布的 [Pop OS 20.04][15] 也增加了平铺窗口的功能。 + +但正如我前面提到的,平铺布局并不适合所有人,它可能会让很多人感到困惑。 + +你呢?你是喜欢平铺窗口还是喜欢经典的桌面布局? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/material-shell/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-shortcuts/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/linux-ricing-example-800x450.jpg?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/sway-window-manager/ +[4]: https://itsfoss.com/regolith-linux-desktop/ +[5]: https://regolith-linux.org/ +[6]: https://material-shell.com +[7]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[8]: https://material.io/ +[9]: https://itsfoss.com/find-desktop-environment/ +[10]: https://itsfoss.com/gnome-shell-extensions/ +[11]: https://extensions.gnome.org/extension/3357/material-shell/ +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/09/install-material-shell.png?resize=800%2C307&ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/09/material-shell-gnome-extension.png?resize=799%2C497&ssl=1 +[14]: https://github.com/material-shell/material-shell +[15]: https://itsfoss.com/pop-os-20-04-review/ From c38e90b64b9a8a2af98278f02d36f43e87eaa6d2 Mon Sep 17 00:00:00 2001 From: sanle <31087327+chensanle@users.noreply.github.com> Date: Tue, 9 Feb 2021 22:11:06 +0800 Subject: [PATCH 249/381] Update 20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md --- ...mux Command Examples To Manage Multiple Terminal Sessions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md index d9ed871a10..2db2b57b40 100644 --- a/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md +++ b/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( chensanle ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1a01aecac5de235b467de4f4bbffc0d667dd06a3 Mon Sep 17 00:00:00 2001 From: Percy Date: Tue, 9 Feb 2021 23:08:05 +0800 Subject: [PATCH 250/381] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8E=9F=E6=96=87:?= =?UTF-8?q?=20Where=20are=20all=20the=20IoT=20experts=20going=20to=20come?= =?UTF-8?q?=20from?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20190626 Where are all the IoT experts going to come from.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190626 Where are all the IoT experts going to come from.md b/sources/talk/20190626 Where are all the IoT experts going to come from.md index 22a303d2f6..638f058a98 100644 --- a/sources/talk/20190626 Where are all the IoT experts going to come from.md +++ b/sources/talk/20190626 Where are all the IoT experts going to come from.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (scvoet) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 91837a20a8a7173fbbbd09dcc26ed20d273aa365 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 23:17:35 +0800 Subject: [PATCH 251/381] PUB @wxy https://linux.cn/article-13103-1.html --- ...1228 The Zen of Python- Why timing is everything.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {translated/tech => published}/20191228 The Zen of Python- Why timing is everything.md (89%) diff --git a/translated/tech/20191228 The Zen of Python- Why timing is everything.md b/published/20191228 The Zen of Python- Why timing is everything.md similarity index 89% rename from translated/tech/20191228 The Zen of Python- Why timing is everything.md rename to published/20191228 The Zen of Python- Why timing is everything.md index 1e00ed28cb..6ebab5320a 100644 --- a/translated/tech/20191228 The Zen of Python- Why timing is everything.md +++ b/published/20191228 The Zen of Python- Why timing is everything.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13103-1.html) [#]: subject: (The Zen of Python: Why timing is everything) [#]: via: (https://opensource.com/article/19/12/zen-python-timeliness) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) -Python 之禅:为什么时间就是一切 +Python 之禅:时机最重要 ====== -> 这是 Python 之禅特别系列的一部分,重点是第十五和第十六条原则:现在与永远。 +> 这是 Python 之禅特别系列的一部分,重点是第十五和第十六条原则:现在与将来。 -!["桌子上的时钟、笔和记事本"][1] +![](https://img.linux.net.cn/data/attachment/album/202102/09/231557dkuzz22ame4ja2jj.jpg) Python 一直在不断发展。Python 社区对特性请求的渴求是无止境的,对现状也总是不满意的。随着 Python 越来越流行,这门语言的变化会影响到更多的人。 From 9b6ecd258b004709b9305b6d4386895c7a40dfb1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 23:29:15 +0800 Subject: [PATCH 252/381] APL --- ...w to tell if implementing your Python code is a good idea.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md b/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md index 4a059faafc..6eb84791b8 100644 --- a/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md +++ b/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 04e44f768971109b3b92b225b3cdda990c80f333 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 23:55:11 +0800 Subject: [PATCH 253/381] TSL&PRF --- ...menting your Python code is a good idea.md | 46 ------------------ ...menting your Python code is a good idea.md | 47 +++++++++++++++++++ 2 files changed, 47 insertions(+), 46 deletions(-) delete mode 100644 sources/tech/20191229 How to tell if implementing your Python code is a good idea.md create mode 100644 translated/tech/20191229 How to tell if implementing your Python code is a good idea.md diff --git a/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md b/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md deleted file mode 100644 index 6eb84791b8..0000000000 --- a/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md +++ /dev/null @@ -1,46 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to tell if implementing your Python code is a good idea) -[#]: via: (https://opensource.com/article/19/12/zen-python-implementation) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -How to tell if implementing your Python code is a good idea -====== -This is part of a special series about the Zen of Python focusing on the -17th and 18th principles: hard vs. easy. -![Brick wall between two people, a developer and an operations manager][1] - -A language does not exist in the abstract. Every single language feature has to be implemented in code. It is easy to promise some features, but the implementation can get hairy. Hairy implementation means more potential for bugs, and, even worse, a maintenance burden for the ages. - -The [Zen of Python][2] has answers for this conundrum. - -### If the implementation is hard to explain, it's a bad idea. - -The most important thing about programming languages is predictability. Sometimes we explain the semantics of a certain construct in terms of abstract programming models, which do not correspond exactly to the implementation. However, the best of all explanations just _explains the implementation_. - -If the implementation is hard to explain, it means the avenue is impossible. - -### If the implementation is easy to explain, it may be a good idea. - -Just because something is easy does not mean it is worthwhile. However, once it is explained, it is much easier to judge whether it is a good idea. - -This is why the second half of this principle intentionally equivocates: nothing is certain to be a good idea, but it always allows people to have that discussion. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/zen-python-implementation - -作者:[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/devops_confusion_wall_questions.png?itok=zLS7K2JG (Brick wall between two people, a developer and an operations manager) -[2]: https://www.python.org/dev/peps/pep-0020/ diff --git a/translated/tech/20191229 How to tell if implementing your Python code is a good idea.md b/translated/tech/20191229 How to tell if implementing your Python code is a good idea.md new file mode 100644 index 0000000000..e468233c23 --- /dev/null +++ b/translated/tech/20191229 How to tell if implementing your Python code is a good idea.md @@ -0,0 +1,47 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to tell if implementing your Python code is a good idea) +[#]: via: (https://opensource.com/article/19/12/zen-python-implementation) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +如何判断实现你的 Python 代码是否是个好主意? +====== + +> 这是 Python 之禅特别系列的一部分,重点介绍第十七和十八条原则:困难和容易。 + +!["开发人员和运营经理两个人之间的砖墙"][1] + +一门语言并不是抽象存在的。每一个语言功能都必须用代码来实现。承诺一些功能是很容易的,但实现起来就会很麻烦。复杂的实现意味着更多潜在的 bug,甚至更糟糕的是,会带来日复一日的维护负担。 + +对于这个难题,[Python 之禅][2] 中有答案。 + +### 如果一个实现难以解释,那就是个坏思路If the implementation is hard to explain, it's a bad idea + +编程语言最重要的是可预测性。有时我们用抽象的编程模型来解释某个结构的语义,而这些模型与实现并不完全对应。然而,最好的解释只是*解释实现*。 + +如果该实现很难解释,那就意味着这个途径是不可能的。 + +### 如果一个实现易于解释,那它可能是一个好思路If the implementation is easy to explain, it may be a good idea + +仅仅因为某事容易,并不意味着它值得。然而,一旦解释清楚,判断它是否是一个好思路就容易得多。 + +这也是为什么这个原则的后半部分故意含糊其辞的原因:没有什么可以肯定一定是好的,但总是可以讨论一下。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/zen-python-implementation + +作者:[Moshe Zadka][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/devops_confusion_wall_questions.png?itok=zLS7K2JG (Brick wall between two people, a developer and an operations manager) +[2]: https://www.python.org/dev/peps/pep-0020/ From 339bbf3fc55e64cc225b88e8a5de49d6981dc0c0 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 10 Feb 2021 00:04:05 +0800 Subject: [PATCH 254/381] =?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 --- ...aybooks Quick Start Guide with Examples.md | 160 +++++++++--------- 1 file changed, 77 insertions(+), 83 deletions(-) rename {sources => translated}/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md (57%) diff --git a/sources/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md b/translated/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md similarity index 57% rename from sources/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md rename to translated/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md index 8d47286681..b2e80cc517 100644 --- a/sources/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md +++ b/translated/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md @@ -1,96 +1,90 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ansible Playbooks Quick Start Guide with Examples) -[#]: via: (https://www.2daygeek.com/ansible-playbooks-quick-start-guide-with-examples/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Ansible Playbooks Quick Start Guide with Examples" +[#]: via: "https://www.2daygeek.com/ansible-playbooks-quick-start-guide-with-examples/" +[#]: author: "Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/" -Ansible Playbooks Quick Start Guide with Examples +Ansible 剧本快速入门指南 ====== -We have already written two articles about Ansible, this is the third article. +我们已经写了两篇关于 Ansible 的文章,这是第三篇。 -If you are new to Ansible, I advise you to read the two topics below, which will teach you the basics of Ansible and what it is. +如果你是 Ansible 新手,我建议你阅读下面这两篇文章,它会教你一些 Ansible 的基础以及它是什么。 - * **Part-1: [How to Install and Configure Ansible on Linux][1]** - * **Part-2: [Ansible ad-hoc Command Quick Start Guide][2]** + * **第一篇: [在 Linux 如何安装和配置 Ansible][1]** + * **第二篇: [Ansible ad-hoc 命令快速入门指南][2]** +如果你已经阅读过了,那么在阅读本文时你才不会感到突兀。 +### 什么是 Ansible 剧本? -If you have finished them, you will feel the continuity as you read this article. +剧本比临时命令模式更强大,而且完全不同。 -### What is the Ansible Playbook? +它使用了 **"/usr/bin/ansible-playbook"** 二进制文件,并且提供丰富的特性使得复杂的任务变得更容易。 -Playbooks are much more powerful and completely different way than ad-hoc command mode. +如果你想经常运行一个任务,剧本是非常有用的。 -It uses the **“/usr/bin/ansible-playbook”** binary. It provides rich features to make complex task easier. +此外,如果你想在服务器组上执行多个任务,它也是非常有用的。 -Playbooks are very useful if you want to run a task often. +剧本由 YAML 语言编写。YAML 代表一种标记语言,它比其它常见的数据格式(如 XML 或 JSON)更容易读写。 -Also, this is useful if you want to perform multiple tasks at the same time on the group of server. - -Playbooks are written in YAML language. YAML stands for Ain’t Markup Language, which is easier for humans to read and write than other common data formats such as XML or JSON. - -The Ansible Playbook Flow Chart below will tell you its detailed structure. +下面这张 Ansible 剧本流程图将告诉你它的详细结构。 ![][3] -### Understanding the Ansible Playbooks Terminology +### 理解 Ansible 剧本的术语 - * **Control Node:** The machine where Ansible is installed. It is responsible for managing client nodes. - * **Managed Nodes:** List of hosts managed by the control node - * **Playbook:** A Playbook file contains a set of procedures used to automate a task. - * **Inventory:** The inventory file contains information about the servers you manage. - * **Task:** Each play has multiple tasks, tasks that are executed one by one against a given machine (it a host or multiple host or a group of host). - * **Module:** Modules are a unit of code that is used to gather information from the client node. - * **Role:** Roles are ways to automatically load some vars_files, tasks, and handlers based on known file structure. - * **Play:** Each playbook has multiple plays, and a play is the implementation of a particular automation from beginning to end. - * **Handlers:** This helps you reduce any service restart in a play. Lists of handler tasks are not really different from regular tasks, and changes are notified by notifiers. If the handler does not receive any notification, it will not work. + * **控制节点:** Ansible 安装的机器,它负责管理客户端节点。 + * **被控节点:** 被控制节点管理的主机列表。 + * **剧本:** 一个剧本文件,包含一组自动化任务。 + * **主机清单:*** 这个文件包含有关管理的服务器的信息。 + * **任务:** 每个剧本都有大量的任务。任务在指定机器上依次执行(一个主机或多个主机)。 + * **模块:** 模块是一个代码单元,用于从客户端节点收集信息。 + * **角色:** 角色是根据已知文件结构自动加载一些变量文件、任务和处理程序的方法。 + * **Play:** 每个剧本含有大量的 play, 一个 play 从头到尾执行一个特定的自动化。 + * **Handlers:** 它可以帮助你减少在剧本中的重启任务。处理程序任务列表实际上与常规任务没有什么不同,更改由通知程序通知。如果处理程序没有收到任何通知,它将不起作用。 +### 基本的剧本是怎样的? +下面是一个剧本的模板: -### How Does the Basic Playbook looks Like? - -Here’s how the basic playbook looks. - -``` ---- [YAML file should begin with a three dash] -- name: [Description about a script] - hosts: group [Add a host or host group] - become: true [It requires if you want to run a task as a root user] - tasks: [What action do you want to perform under task] - - name: [Enter the module options] - module: [Enter a module, which you want to perform] - module_options-1: value [Enter the module options] +```yaml +--- [YAML 文件应该以三个破折号开头] +- name: [脚本描述] + hosts: group [添加主机或主机组] + become: true [如果你想以 root 身份运行任务,则标记它] + tasks: [你想在任务下执行什么动作] + - name: [输入模块选项] + module: [输入要执行的模块] + module_options-1: value [输入模块选项] module_options-2: value . module_options-N: value ``` -### How to Understand Ansible Output +### 如何理解 Ansible 的输出 -The Ansible Playbook output comes with 4 colors, see below for color definitions. +Ansible 剧本的输出有四种颜色,下面是具体含义: - * **Green:** **ok –** If that is correct, the associated task data already exists and configured as needed. - * **Yellow: changed –** Specific data has updated or modified according to the needs of the tasks. - * **Red: FAILED –** If there is any problem while doing a task, it returns a failure message, it may be anything and you need to fix it accordingly. - * **White:** It comes with multiple parameters + * **绿色:** **ok –** 代表成功,关联的任务数据已经存在,并且已经根据需要进行了配置。 + * **黄色: 已更改 –** 指定的数据已经根据任务的需要更新或修改。 + * **红色: 失败–** 如果在执行任务时出现任何问题,它将返回一个失败消息,它可能是任何东西,你需要相应地修复它。 + * **白色:** 表示有多个参数。 +为此,创建一个剧本目录,将它们都放在同一个地方。 - -To do so, create a playbook directory to keep them all in one place. - -``` +```bash $ sudo mkdir /etc/ansible/playbooks ``` -### Playbook-1: Ansible Playbook to Install Apache Web Server on RHEL Based Systems +### 剧本-1:在 RHEL 系统上安装 Apache Web 服务器 -This sample playbook allows you to install the Apache web server on a given target node. +这个示例剧本允许你在指定的目标机器上安装 Apache Web 服务器: -``` +```bash $ sudo nano /etc/ansible/playbooks/apache.yml --- @@ -108,17 +102,17 @@ $ sudo nano /etc/ansible/playbooks/apache.yml state: started ``` -``` +```bash $ ansible-playbook apache1.yml ``` ![][3] -### How to Understand Playbook Execution in Ansible +### 如何理解 Ansible 中剧本的执行 -To check the syntax error, run the following command. If it finds no error, it only shows the given file name. If it detects any error, you will get an error as follows, but the contents may differ based on your input file. +使用以下命令来查看语法错误。如果没有发现错误,它只显示剧本文件名。如果它检测到任何错误,你将得到一个如下所示的错误,但内容可能根据你的输入文件而有所不同。 -``` +```bash $ ansible-playbook apache1.yml --syntax-check ERROR! Syntax Error while loading YAML. @@ -143,11 +137,11 @@ Should be written as: # ^--- all spaces here. ``` -Alternatively, you can check your ansible-playbook content from online using the following url @ [YAML Lint][4] +或者,你可以使用这个 URL [YAML Lint][4] 在线检查 Ansible 剧本内容。 -Run the following command to perform a **“Dry Run”**. When you run a ansible-playbook with the **“–check”** option, it does not make any changes to the remote machine. Instead, it will tell you what changes they have made rather than create them. +执行以下命令进行**“演练”**。当你运行带有 **"-check"** 选项的剧本时,它不会对远程机器进行任何修改。相反,它会告诉你它将要做什么改变但不是真的执行。 -``` +```bash $ ansible-playbook apache.yml --check PLAY [Install and Configure Apache Webserver] ******************************************************************** @@ -169,9 +163,9 @@ node1.2g.lab : ok=3 changed=2 unreachable=0 failed=0 s node2.2g.lab : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 ``` -If you want detailed information about your ansible playbook implementation, use the **“-vv”** verbose option. It shows what it really does to gather this information. +如果你想要知道 ansible 剧本实现的详细信息,使用 **"-vv"** 选项,它会展示如何收集这些信息。 -``` +```bash $ ansible-playbook apache.yml --check -vv ansible-playbook 2.9.2 @@ -212,11 +206,11 @@ node1.2g.lab : ok=3 changed=2 unreachable=0 failed=0 s node2.2g.lab : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 ``` -### Playbook-2: Ansible Playbook to Install Apache Web Server on Ubuntu Based Systems +### 剧本-2:在 Ubuntu 系统上安装 Apache Web 服务器 -This sample playbook allows you to install the Apache web server on a given target node. +这个示例剧本允许你在指定的目标节点上安装 Apache Web 服务器。 -``` +```bash $ sudo nano /etc/ansible/playbooks/apache-ubuntu.yml --- @@ -250,13 +244,13 @@ $ sudo nano /etc/ansible/playbooks/apache-ubuntu.yml enabled: yes ``` -### Playbook-3: Ansible Playbook to Install a List of Packages on Red Hat Based Systems +### 剧本-3:在 Red Hat 系统上安装软件包列表 -This sample playbook allows you to install a list of packages on a given target node. +这个示例剧本允许你在指定的目标节点上安装软件包。 -**Method-1:** +**方法-1:** -``` +```bash $ sudo nano /etc/ansible/playbooks/packages-redhat.yml --- @@ -273,9 +267,9 @@ $ sudo nano /etc/ansible/playbooks/packages-redhat.yml - htop ``` -**Method-2:** +**方法-2:** -``` +```bash $ sudo nano /etc/ansible/playbooks/packages-redhat-1.yml --- @@ -292,9 +286,9 @@ $ sudo nano /etc/ansible/playbooks/packages-redhat-1.yml - htop ``` -**Method-3: Using Array Variable** +**方法-3: 使用数组变量** -``` +```bash $ sudo nano /etc/ansible/playbooks/packages-redhat-2.yml --- @@ -309,11 +303,11 @@ $ sudo nano /etc/ansible/playbooks/packages-redhat-2.yml with_items: "{{ packages }}" ``` -### Playbook-4: Ansible Playbook to Install Updates on Linux Systems +### 剧本-4:在 Linux 系统上安装更新 -This sample playbook allows you to install updates on your Linux systems, running Red Hat and Debian-based client nodes. +这个示例剧本允许你在基于 Red Hat 或 Debian 的 Linux 系统上安装更新。 -``` +```bash $ sudo nano /etc/ansible/playbooks/security-update.yml --- @@ -336,7 +330,7 @@ via: https://www.2daygeek.com/ansible-playbooks-quick-start-guide-with-examples/ 作者:[Magesh Maruthamuthu][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 5ef2f12d609c394cc49d83df44a87e156cb70963 Mon Sep 17 00:00:00 2001 From: Percy Date: Wed, 10 Feb 2021 00:17:13 +0800 Subject: [PATCH 255/381] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87:?= =?UTF-8?q?=2020190626=20Where=20are=20all=20the=20IoT=20experts=20going?= =?UTF-8?q?=20to=20come=20from?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... all the IoT experts going to come from.md | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/sources/talk/20190626 Where are all the IoT experts going to come from.md b/sources/talk/20190626 Where are all the IoT experts going to come from.md index 638f058a98..223001f7ee 100644 --- a/sources/talk/20190626 Where are all the IoT experts going to come from.md +++ b/sources/talk/20190626 Where are all the IoT experts going to come from.md @@ -7,50 +7,50 @@ [#]: via: (https://www.networkworld.com/article/3404489/where-are-all-the-iot-experts-going-to-come-from.html) [#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) -Where are all the IoT experts going to come from? +物联网专家都从何而来? ====== -The fast growth of the internet of things (IoT) is creating a need to train cross-functional experts who can combine traditional networking and infrastructure expertise with database and reporting skills. +物联网 (IoT) 的快速发展催生了对跨职能专家进行培养的需求,这些专家可以将传统的网络和基础设施专业知识与数据库和报告技能相结合。 ![Kevin \(CC0\)][1] -If the internet of things (IoT) is going to fulfill its enormous promise, it’s going to need legions of smart, skilled, _trained_ workers to make everything happen. And right now, it’s not entirely clear where those people are going to come from. +如果物联网 (IoT) 要实现其宏伟的诺言,它将需要大量聪明、熟练、**训练有素**的工人军团来实现这一切。而现在,这些人将从何而来尚不清楚。 -That’s why I was interested in trading emails with Keith Flynn, senior director of product management, R&D at asset-optimization software company [AspenTech][2], who says that when dealing with the slew of new technologies that fall under the IoT umbrella, you need people who can understand how to configure the technology and interpret the data. Flynn sees a growing need for existing educational institutions to house IoT-specific programs, as well as an opportunity for new IoT-focused private colleges, offering a well -ounded curriculum +这就是我为什么有兴趣同资产优化软件公司 [AspenTech][2] 的产品管理、R&D 研发高级总监基思·弗林 (Keith Flynn) 通邮件,他说,当处理大量属于物联网范畴的新技术时,你需要能够理解如何配置技术和解释数据的人。弗林认为,现有的教育机构对物联网特定课程的需求越来越大,这同时也给了以物联网为重点,提供了完善课程的新私立学院机会。 -“In the future,” Flynn told me, “IoT projects will differ tremendously from the general data management and automation projects of today. … The future requires a more holistic set of skills and cross-trading capabilities so that we’re all speaking the same language.” +弗林跟我说,“在未来物联网项目将与如今普遍的数据管理和自动化项目有着巨大的不同......未来需要更全面的技能和交叉交易能力,这样我们才会说同一种语言。” -**[ Also read:  [20 hot jobs ambitious IT pros should shoot for][3] ]** +**[ 参见: [有雄心壮志的I T 专业人才应该争取的 20 个热门职位][3] ]** -With the IoT growing 30% a year, Flynn added, rather than a few specific skills, “everything from traditional deployment skills, like networking and infrastructure, to database and reporting skills and, frankly, even basic data science, need to be understood together and used together.” +弗林补充说,随着物联网每年增长 30%,将不再依赖于几个特定的技能,“从传统的部署技能(如网络和基础设施)到数据库和报告技能,坦白说,甚至是基础数据科学,都将需要一起理解和使用。” -### Calling all IoT consultants +### 召集所有物联网顾问 -“The first big opportunity for IoT-educated people is in the consulting field,” Flynn predicted. “As consulting companies adapt or die to the industry trends … having IoT-trained people on staff will help position them for IoT projects and make a claim in the new line of business: IoT consulting.” +弗林预测,“受过物联网教育的人的第一个大机会将会是在咨询领域,随着咨询公司对行业趋势的适应或淘汰......有受过物联网培训的员工将有助于他们在物联网项目中的定位,并在新的业务线中提出要求——物联网咨询。” -The problem is especially acute for startups and smaller companies. “The bigger the organization, the more likely they have a means to hire different people across different lines of skillsets,” Flynn said. “But for smaller organizations and smaller IoT projects, you need someone who can do both.” +对初创企业和小型公司而言,这个问题尤为严重。“组织越大,他们越有可能雇佣到不同技术类别的人”弗林这样说到,“但对于较小的组织和较小的物联网项目来说,你则需要一个能同时兼顾的人。” -Both? Or _everything?_ The IoT “requires a combination of all knowledge and skillsets,” Flynn said, noting that “many of the skills aren’t new, they’ve just never been grouped together or taught together before.” +两者兼而有之?还是**一应俱全?**物联网“需要将所有知识和技能组合在一起”,弗林说到,“并不是所有技能都是全新的,只是在此之前从来没有被归纳在一起或放在一起教授过。” -**[ [Looking to upgrade your career in tech? This comprehensive online course teaches you how.][4] ]** +**【[想在技术领域提升自己的事业?这个全面的在线课程会教您该怎么做。][4]】** -### The IoT expert of the future +### 未来的物联网专家 -True IoT expertise starts with foundational instrumentation and electrical skills, Flynn said, which can help workers implement new wireless transmitters and boost technology for better battery life and power consumption. +弗林表示,真正的物联网专业技术是从基础的仪器仪表和电气技能开始的,这能帮助工人发明新的无线发射器或提升技术,以提高电池寿命和功耗。 -“IT skills, like networking, IP addressing, subnet masks, cellular and satellite are also pivotal IoT needs,” Flynn said. He also sees a need for database management skills and cloud management and security expertise, “especially as things like [advanced process control] APC and sending sensor data directly to databases and data lakes become the norm.” +“IT 技能,如网络、IP 寻址、子网掩码、蜂窝和卫星也是物联网的关键需求”,弗林说。他还认为物联网需要数据库管理技能和云管理和安全专业知识,“特别是当高级过程控制 (APC) 将传感器数据直接发送到数据库和数据湖等事情成为常态时。” -### Where will IoT experts come from? +### 物联网专家又从何而来? -Flynn said standardized formal education courses would be the best way to make sure that graduates or certificate holders have the right set of skills. He even laid out a sample curriculum: “Start in chronological order with the basics like [Electrical & Instrumentation] E&I and measurement. Then teach networking, and then database administration and cloud courses should follow that. This degree could even be looped into an existing engineering course, and it would probably take two years … to complete the IoT component.” +弗林说,标准化的正规教育课程将是确保毕业生或证书持有者掌握一套正确技能的最佳途径。他甚至还列出了一个样本课程。“按时间顺序开始,从基础知识开始,比如[电气&仪表]E&I和测量。然后讲授网络知识,数据库管理和云计算课程都应在此之后开展。这个学位甚至可以循序渐进至现有的工程课程中,这可能需要两年时间......来完成物联网部分的学业。” -While corporate training could also play role, “that’s easier said than done,” Flynn warned. “Those trainings will need to be organization-specific efforts and pushes.” +虽然企业培训也能发挥作用,但实际上却是“说起来容易做起来难”,弗林这样警告,“这些培训需要针对组织的具体努力而推动。” -Of course, there are already [plenty of online IoT training courses and certificate programs][5]. But, ultimately, the responsibility lies with the workers themselves. +当然,现在市面上已经有了[大量的在线物联网培训课程和证书课程][5]。但追根到底,这一工作全都依赖于工人自身的推断。 -“Upskilling is incredibly important in this world as tech continues to transform industries,” Flynn said. “If that upskilling push doesn’t come from your employer, then online courses and certifications would be an excellent way to do that for yourself. We just need those courses to be created. ... I could even see organizations partnering with higher-education institutions that offer these courses to give their employees better access to it. Of course, the challenge with an IoT program is that it will need to constantly evolve to keep up with new advancements in tech.” +“在这个世界上,随着科技不断改变行业,提升技能是非常重要的”,弗林说,“如果这种提升技能的推动力并不是来源于你的雇主,那么在线课程和认证将会是提升你自己很好的一个方式。我们只需要创建这些课程......我甚至可以预见组织将与提供这些课程的高等教育机构合作,让他们的员工更好地开始。当然,物联网课程的挑战在于它需要不断发展以跟上科技的发展。” -**[ For more on IoT, see [tips for securing IoT on your network][6], our list of [the most powerful internet of things companies][7] and learn about the [industrial internet of things][8]. | Get regularly scheduled insights by [signing up for Network World newsletters][9]. ]** +**【有关物联网的更多信息,请参阅[在网络上确保物联网安全的提醒][6],我们的[最强大的物联网公司][7]列表,并了解[工业物联网][8]。 | 通过[注册网络世界新闻通讯][9]定期获取见解。】** -Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. +参与[脸书][10]和[领英][11]上的网络世界社区,对最重要的话题进行评论。 -------------------------------------------------------------------------------- @@ -58,7 +58,7 @@ via: https://www.networkworld.com/article/3404489/where-are-all-the-iot-experts- 作者:[Fredric Paul][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Percy (@scvoet)](https://github.com/scvoet) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2dad7e9e04d9c230280ac66d2d46ab1390128d98 Mon Sep 17 00:00:00 2001 From: Percy Date: Wed, 10 Feb 2021 00:17:55 +0800 Subject: [PATCH 256/381] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=AC=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20190626 Where are all the IoT experts going to come from.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190626 Where are all the IoT experts going to come from.md b/sources/talk/20190626 Where are all the IoT experts going to come from.md index 223001f7ee..8e50195bd8 100644 --- a/sources/talk/20190626 Where are all the IoT experts going to come from.md +++ b/sources/talk/20190626 Where are all the IoT experts going to come from.md @@ -18,7 +18,7 @@ 弗林跟我说,“在未来物联网项目将与如今普遍的数据管理和自动化项目有着巨大的不同......未来需要更全面的技能和交叉交易能力,这样我们才会说同一种语言。” -**[ 参见: [有雄心壮志的I T 专业人才应该争取的 20 个热门职位][3] ]** +**【参见: [有雄心壮志的I T 专业人才应该争取的 20 个热门职位][3]】** 弗林补充说,随着物联网每年增长 30%,将不再依赖于几个特定的技能,“从传统的部署技能(如网络和基础设施)到数据库和报告技能,坦白说,甚至是基础数据科学,都将需要一起理解和使用。” From b9595d9a15e4bd5b3da4206f0aa91381fb93ee8f Mon Sep 17 00:00:00 2001 From: Percy Date: Wed, 10 Feb 2021 00:37:06 +0800 Subject: [PATCH 257/381] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190626 Where are all the IoT experts going to come from.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20190626 Where are all the IoT experts going to come from.md (100%) diff --git a/sources/talk/20190626 Where are all the IoT experts going to come from.md b/translated/talk/20190626 Where are all the IoT experts going to come from.md similarity index 100% rename from sources/talk/20190626 Where are all the IoT experts going to come from.md rename to translated/talk/20190626 Where are all the IoT experts going to come from.md From f7713ad4074acfe8a08653c34437e1f7debc93f8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 10 Feb 2021 05:04:50 +0800 Subject: [PATCH 258/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210210=20?= =?UTF-8?q?How=20to=20Add=20Fingerprint=20Login=20in=20Ubuntu=20and=20Othe?= =?UTF-8?q?r=20Linux=20Distributions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md --- ...in Ubuntu and Other Linux Distributions.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..c2cea8fdcc --- /dev/null +++ b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add Fingerprint Login in Ubuntu and Other Linux Distributions) +[#]: via: (https://itsfoss.com/fingerprint-login-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Add Fingerprint Login in Ubuntu and Other Linux Distributions +====== + +Many high-end laptops come with fingerprint readers these days. Windows and macOS have been supporting fingerprint login for some time. In desktop Linux, the support for fingerprint login was more of geeky tweaks but [GNOME][1] and [KDE][2] have started supporting it through system settings. + +This means that on newer Linux distribution versions, you can easily use fingerprint reading. I am going to enable fingerprint login in Ubuntu here but you may use the steps on other distributions running GNOME 3.38. + +Prerequisite + +This is obvious, of course. Your computer must have a fingerprint reader. + +This method works for any Linux distribution running GNOME version 3.38 or higher. If you are not certain, you may [check which desktop environment version you are using][3]. + +KDE 5.21 also has a fingerprint manager. The screenshots will look different, of course. + +### Adding fingerprint login in Ubuntu and other Linux distributions + +Go to **Settings** and the click on **Users** from left sidebar. You should see all the user account on your system here. You’ll see several option including **Fingerprint Login**. + +Click on the Fingerprint Login option here. + +![Enable fingerprint login in Ubuntu][4] + +It will immediately ask you to scan a new fingerprint. When you click the + sign to add a fingerprint, it presents a few predefined options so that you can easily identify which finger or thumb it is. + +You may of course scan left thumb by clicking right index finger though I don’t see a good reason why you would want to do that. + +![Adding fingerprint][5] + +While adding the fingerprint, rotate your finger or thumb as directed. + +![Rotate your finger][6] + +Once the system registers the entire finger, it will give you a green signal that the fingerprint has been added. + +![Fingerprint successfully added][7] + +If you want to test it right away, lock the screen by pressing Super+L keyboard shortcut in Ubuntu and then using the fingerprint for login. + +![Login With Fingerprint in Ubuntu][8] + +#### Experience with fingerprint login on Ubuntu + +Fingerprint login is what its name suggests: login using your fingerprint. That’s it. You cannot use your finger when it asks for authentication for programs that need sudo access. It’s not a replacement of your password. + +One more thing. The fingerprint login allows you to log in but you cannot use your finger when your system asks for sudo password. The [keyring in Ubuntu][9] also remains locked. + +Another annoying thing is because of GNOME’s GDM login screen. When you login, you have to click on your account first to get to the password screen. This is where you can use your finger. It would have been nicer to not bothered about clicking the user account ID first. + +I also notice that fingerprint reading is not as smooth and quick as it is in Windows. It works, though. + +If you are somewhat disappointed with the fingerprint login on Linux, you may disable it. Let me show you the steps in the next section. + +### Disable fingerprint login + +Disabling fingerprint login is pretty much the same as enabling it in the first place. + +Go to **Settings→User** and then click on Fingerprint Login option. It will show a screen with options to add more fingerprints or delete the existing ones. You need to delete the existing fingerprints. + +![Disable Fingerprint Login][10] + +Fingerprint login does have some benefits, specially for lazy people like me. I don’t have to type my password every time I lock the screen and I am happy with the limited usage. + +Enabling sudo with fingerprint should not be entirely impossible with [PAM][11]. I remember that when I [set up face unlock in Ubuntu][12], it could be used with sudo as well. Let’s see if future versions add this feature. + +Do you have a laptop with fingerprint reader? Do you use it often or is it just one of things you don’t care about? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fingerprint-login-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://www.gnome.org/ +[2]: https://kde.org/ +[3]: https://itsfoss.com/find-desktop-environment/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/enable-fingerprint-ubuntu.png?resize=800%2C607&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/adding-fingerprint-login-ubuntu.png?resize=800%2C496&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/adding-fingerprint-ubuntu-linux.png?resize=800%2C603&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/fingerprint-added-ubuntu.png?resize=797%2C510&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/login-with-fingerprint-ubuntu.jpg?resize=800%2C320&ssl=1 +[9]: https://itsfoss.com/ubuntu-keyring/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/disable-fingerprint-login.png?resize=798%2C524&ssl=1 +[11]: https://tldp.org/HOWTO/User-Authentication-HOWTO/x115.html +[12]: https://itsfoss.com/face-unlock-ubuntu/ From 30179b7ae26a81dcc4812657b06818e4da5960ff Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 10 Feb 2021 05:05:10 +0800 Subject: [PATCH 259/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210209=20?= =?UTF-8?q?Understanding=20Linus's=20Law=20for=20open=20source=20security?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210209 Understanding Linus-s Law for open source security.md --- ...ng Linus-s Law for open source security.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/tech/20210209 Understanding Linus-s Law for open source security.md diff --git a/sources/tech/20210209 Understanding Linus-s Law for open source security.md b/sources/tech/20210209 Understanding Linus-s Law for open source security.md new file mode 100644 index 0000000000..bbaf38fdb0 --- /dev/null +++ b/sources/tech/20210209 Understanding Linus-s Law for open source security.md @@ -0,0 +1,90 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Understanding Linus's Law for open source security) +[#]: via: (https://opensource.com/article/21/2/open-source-security) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Understanding Linus's Law for open source security +====== +Linus's Law is that given enough eyeballs, all bugs are shallow. How +does this apply to open source software security? +![Hand putting a Linux file folder into a drawer][1] + +In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. This article discusses Linux's influence on the security of open source software. + +An often-praised virtue of open source software is that its code can be reviewed (or "audited," as security professionals like to say) by anyone and everyone. However, if you actually ask many open source users when the last time they reviewed code was, you might get answers ranging from a blank stare to an embarrassed murmur. And besides, there are some really big open source applications out there, so it can be difficult to review every single line of code effectively. + +Extrapolating from these slightly uncomfortable truths, you have to wonder: When nobody looks at the code, does it really matter whether it's open or not? + +### Should you trust open source? + +We tend to make a trite assumption in hobbyist computing that open source is "more secure" than anything else. We don't often talk about what that means, what the basis of comparison is ("more" secure than what?), or how the conclusion has even been reached. It's a dangerous statement to make because it implies that as long as you call something _open source_, it automatically and magically inherits enhanced security. That's not what open source is about, and in fact, it's what open source security is very much against. + +You should never assume an application is secure unless you have personally audited and understood its code. Once you have done this, you can assign _ultimate trust_ to that application. Ultimate trust isn't a thing you do on a computer; it's something you do in your own mind: You trust software because you choose to believe that it is secure, at least until someone finds a way to exploit that software. + +You're the only person who can place ultimate trust in that code, so every user who wants that luxury must audit the code for themselves. Taking someone else's word for it doesn't count! + +So until you have audited and understood a codebase for yourself, the maximum trust level you can give to an application is a spectrum ranging from approximately, _not trustworthy at all_ to _pretty trustworthy_. There's no cheat sheet for this. It's a personal choice you must make for yourself. If you've heard from people you strongly trust that an application is secure, then you might trust that software more than you trust something for which you've gotten no trusted recommendations. + +Because you cannot audit proprietary (non-open source) code, you can never assign it _ultimate trust_. + +### Linus's Law + +The reality is, not everyone is a programmer, and not everyone who is a programmer has the time to dedicate to reviewing hundreds and hundreds of lines of code. So if you're not going to audit code yourself, then you must choose to trust (to some degree) the people who _do_ audit code. + +So exactly who does audit code, anyway? + +Linus's Law asserts that _given enough eyeballs, all bugs are shallow_, but we don't really know how many eyeballs are "enough." However, don't underestimate the number. Software is very often reviewed by more people than you might imagine. The original developer or developers obviously know the code that they've written. However, open source is often a group effort, so the longer code is open, the more software developers end up seeing it. A developer must review major portions of a project's code because they must learn a codebase to write new features for it. + +Open source packagers also get involved with many projects in order to make them available to a Linux distribution. Sometimes an application can be packaged with almost no familiarity with the code, but often a packager gets familiar with a project's code, both because they don't want to sign off on software they don't trust and because they may have to make modifications to get it to compile correctly. Bug reporters and triagers also sometimes get familiar with a codebase as they try to solve anomalies ranging from quirks to major crashes. Of course, some bug reporters inadvertently reveal code vulnerabilities not by reviewing it themselves but by bringing attention to something that obviously doesn't work as intended. Sysadmins frequently get intimately familiar with the code of an important software their users rely upon. Finally, there are security researchers who dig into code exclusively to uncover potential exploits. + +### Trust and transparency + +Some people assume that because major software is composed of hundreds of thousands of lines of code, it's basically impossible to audit. Don't be fooled by how much code it takes to make an application run. You don't actually have to read millions of lines. Code is highly structured, and exploitable flaws are rarely just a single line hidden among the millions of lines; there are usually whole functions involved. + +There are exceptions, of course. Sometimes a serious vulnerability is enabled with just one system call or by linking to one flawed library. Luckily, those kinds of errors are relatively easy to notice, thanks to the active role of security researchers and vulnerability databases. + +Some people point to bug trackers, such as the [Common Vulnerabilities and Exposures (CVE)][2] website, and deduce that it's actually as plain as day that open source isn't secure. After all, hundreds of security risks are filed against lots of open source projects, out in the open for everyone to see. Don't let that fool you, though. Just because you don't get to see the flaws in closed software doesn't mean those flaws don't exist. In fact, we know that they do because exploits are filed against them, too. The difference is that _all_ exploits against open source applications are available for developers (and users) to see so those flaws can be mitigated. That's part of the system that boosts trust in open source, and it's wholly missing from proprietary software. + +There may never be "enough" eyeballs on any code, but the stronger and more diverse the community around the code, the better chance there is to uncover and fix weaknesses. + +### Trust and people + +In open source, the probability that many developers, each working on the same project, have noticed something _not secure_ but have all remained equally silent about that flaw is considered to be low because humans rarely mutually agree to conspire in this way. We've seen how disjointed human behavior can be recently with COVID-19 mitigation: + + * We've all identified a flaw (a virus). + * We know how to prevent it from spreading (stay home). + * Yet the virus continues to spread because one or more people deviate from the mitigation plan. + + + +The same is true for bugs in software. If there's a flaw, someone noticing it will bring it to light (provided, of course, that someone sees it). + +However, with proprietary software, there can be a high probability that many developers working on a project may notice something not secure but remain equally silent because the proprietary model relies on paychecks. If a developer speaks out against a flaw, then that developer may at best hurt the software's reputation, thereby decreasing sales, or at worst, may be fired from their job. Developers being paid to work on software in secret do not tend to talk about its flaws. If you've ever worked as a developer, you've probably signed an NDA, and you've been lectured on the importance of trade secrets, and so on. Proprietary software encourages, and more often enforces, silence even in the face of serious flaws. + +### Trust and software + +Don't trust software you haven't audited. + +If you must trust software you haven't audited, then choose to trust code that's exposed to many developers who independently are likely to speak up about a vulnerability. + +Open source isn't inherently more secure than proprietary software, but the systems in place to fix it are far better planned, implemented, and staffed. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/open-source-security + +作者:[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/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) +[2]: https://cve.mitre.org From 1a98ca1dc7308bd33f60a85ce095e5ae69fc9fd4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 10 Feb 2021 05:05:44 +0800 Subject: [PATCH 260/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210209=20?= =?UTF-8?q?My=20open=20source=20disaster=20recovery=20strategy=20for=20the?= =?UTF-8?q?=20home=20office?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210209 My open source disaster recovery strategy for the home office.md --- ...r recovery strategy for the home office.md | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 sources/tech/20210209 My open source disaster recovery strategy for the home office.md diff --git a/sources/tech/20210209 My open source disaster recovery strategy for the home office.md b/sources/tech/20210209 My open source disaster recovery strategy for the home office.md new file mode 100644 index 0000000000..05f2fce5b5 --- /dev/null +++ b/sources/tech/20210209 My open source disaster recovery strategy for the home office.md @@ -0,0 +1,199 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (My open source disaster recovery strategy for the home office) +[#]: via: (https://opensource.com/article/21/2/high-availability-home-office) +[#]: author: (Howard Fosdick https://opensource.com/users/howtech) + +My open source disaster recovery strategy for the home office +====== +In the remote work era, it's more important than ever to have a disaster +recovery plan for your household infrastructure. +![Person using a laptop][1] + +I've worked from home for years, and with the COVID-19 crisis, millions more have joined me. Teachers, accountants, librarians, stockbrokers… you name it, these workers now operate full or part time from their homes. Even after the coronavirus crisis ends, many will continue working at home, at least part time. But what happens when the home worker's computer fails? Whether the device is a smartphone, tablet, laptop, or desktop—and whether the problem is hardware or software—the result might be missed workdays and lots of frustration. + +This article explores how to ensure high-availability home computing. Open source software is key. It offers device independence so that home workers can easily move between primary and backup devices. Most importantly, it gives users control of their environment, which is the surest route to high availability. This simple high-availability strategy, based on open source, is easy to modify for your needs. + +### Different strategies for different situations + +I need to emphasize one point upfront: different job functions require different solutions. Some at-home workers can use smartphones or tablets, while others rely on laptops, and still others require high-powered desktop workstations. Some can tolerate an outage of hours or even days, while others must be available without interruption. Some use company-supplied devices, and others must provide their own. Lastly, some home workers store their data in their company's cloud, while others self-manage their data. + +Obviously, no single high-availability strategy fits everyone. My strategy probably isn't "the answer" for you, but I hope it prompts you to think about the challenges involved (if you haven't already) and presents some ideas to help you prepare before disaster strikes. + +### Defining high availability + +Whatever computing device a home worker uses, high availability (HA) involves five interoperable components: + + * Device hardware + * System software + * Communications capability + * Applications + * Data + + + +The HA plan must encompass all five components to succeed. Missing any component causes HA failure. + +For example, last night, I worked on a cloud-based spreadsheet. If my communications link had failed and I couldn't access my cloud data, that would stop my work on the project… even if I had all the other HA components available in a backup computer. + +Of course, there are exceptions. Say last night's spreadsheet was stored on my local computer. If that device failed, I could have kept working as long as I had a backup computer with my data on it, even if I lacked internet access. + +To succeed as a high-availability home worker, you must first identify the components you require for your work. Once you've done that, develop a plan to continue working even if one or more components fails. + +#### Duplicate replacement + +One approach is to create a _duplicate replacement_. Having the exact same hardware, software, communications, apps, and data available on a backup device guarantees that you can work if your primary fails. This approach is simple, though it might cost more to keep a complete backup on hand. + +To economize, you might share computers with your family or flatmates. A _shared backup_ is always more cost-effective than a _dedicated backup_, so long as you have top priority on the shared computer when you need it. + +#### Functional replacement + +The alternative to duplicate replacement is a _functional replacement_. You substitute a working equivalent for the failed component. Say I'm working from my home laptop and connecting through home WiFi. My internet connection fails. Perhaps I can tether my computer to my phone and use the cell network instead. I achieve HA by replacing one technology with an equivalent. + +#### Know your requirements + +Beyond the five HA components, be sure to identify any special requirements you have. For example, if mobility is important, you might need to replace a broken laptop with another laptop, not a desktop. + +HA means identifying all the functions you need, then ensuring your HA plan covers them all. + +### Timing, planning, and testing + +You must also define your time frame for recovery. Must you be able to continue your work immediately after a failure? Or do you have the luxury of some downtime during which you can react? + +The longer your allowable downtime, the more options you have. For example, if you could miss work for several days, you could simply trot a broken device into a repair shop. No need for a backup. + +In this article, by "high availability," I mean getting back to work in very short order after a failure, perhaps less than one hour. This typically requires that you have access to a backup device that is immediately available and ready to go. While there might be occasions when you can recover your primary device in a matter of minutes—for example, by working around a failure or by quickly replacing a defective piece of hardware or software—a backup computer is normally part of the HA plan. + +HA requires planning and preparation. "Winging it" doesn't suffice; ensure your backup plan works by testing it beforehand. + +For example, say your data resides in the cloud. That data is accessible from anywhere, from any device. That sounds ideal. But what if you forget that there's a small but vital bit of data stored locally on your failed computer? If you can't access that essential data, your HA plan fails. A dry run surfaces problems like this. + +### Smartphones as backup + +Most of us in software engineering and support use laptops and desktops at home. Smartphones and tablets are useful adjuncts, but they aren't at the core of what we do. + +The main reasons are screen size and keyboard. For software work, you can't achieve the same level of productivity with a small screen and touchscreen keypad as you can with a large monitor and physical keyboard. + +If you normally use a laptop or desktop and opt for a smartphone or tablet as your backup, test it out beforehand to make sure it suffices. Here's an example of the kind of subtlety that might otherwise trip you up. Most videoconferencing platforms run on both smartphones and laptops or desktops, but their mobile apps can differ in small but important ways. And even when the platform does offer an equivalent experience (the way [Jitsi][2] does, for instance), it can be awkward to share charts, slide decks, and documents, to use a chat feature, and so on, just due to the difference in mobile form factors compared to a big computer screen and a variety of input options. + +Smartphones make convenient backup devices because nearly everyone has one. But if you designate yours as your functional replacement, then try using it for work one day to verify that it meets your needs. + +### Data accessibility + +Data access is vital when your primary device fails. Even if you back up your work data, if a device fails, you also may need credentials for VPN or SSH access, specialized software, or forms of data that might not be stored along with your day-to-day documents and directories. You must ensure that when you design a backup scheme for yourself, you include all important data and store encryption keys and other access information securely. + +The best way to keep your work data secure is to use your own service. Running [Nextcloud][3] or [Sparkleshare][4] is easy, and hosting is cheap. Both are automated: files you place in a specially designated directory are synchronized with your server. It's not exactly building your own cloud, but it's a great way to leverage the cloud for your own services. You can make the backup process seamless with tools like [Syncthing, Bacula][5], or [rdiff-backup][6]. + +Cloud storage enables you to access data from any device at any location, but cloud storage will work only if you have a live communications path to it after a failure event. And not all cloud storage meets the privacy and security specifications for all projects. If your workplace has a cloud backup solution, spend some time learning about the cloud vendor's services and find out what level of availability it promises. Check its track record in achieving it. And be sure to devise an alternate way to access your cloud if your primary communications link fails. + +### Local backups + +If you store your data on a local device, you'll be responsible for backing it up and recovering it. In that case, back up your data to an alternate device, and verify that you can restore it within your acceptable time frame. This is your _time-to-recovery_. + +You'll also need to secure that data and meet any privacy requirements your employer specifies. + +#### Acceptable loss + +Consider how much data you can afford to lose in the event of an outage. For example, if you back up your data nightly, you could lose up to a maximum of one day's work (all the work completed during the day prior to the nightly backup). This is your _backup data timeliness_. + +Open source offers many free applications for local data backup and recovery. Generally, the same applications used for remote backups can also apply to local backup plans, so take a look at the [Advanced Rsync][7] or the [Syncthing tutorial][8] articles here on Opensource.com. + +Many prefer a data strategy that combines both cloud and local storage. Store your data locally, and then use the cloud as a backup (rather than working on the cloud). Or do it the other way around (although automating the cloud to push backups to you is more difficult than automating your local machine to push backups to the cloud). Storing your data in two separate locations gives your data _geographical redundancy_, which is useful should either site become unavailable. + +With a little forethought, you can devise a simple plan to access your data regardless of any outage. + +### My high-availability strategy + +As a practical example, I'll describe my own HA approach. My goals are a time to recovery of an hour or less and backup data timeliness within a day. + +![High Availability Strategy][9] + +(Howard Fosdick, [CC BY-SA 4.0][10]) + +#### Hardware + +I use an Android smartphone for phone calls and audioconferences. I can access a backup phone from another family member if my primary fails. + +Unfortunately, my phone's small size and touch keyboard mean I can't use it as my backup computer. Instead, I rely on a few generic desktop computers that have standard, interchangeable parts. You can easily maintain such hardware with this simple [free how-to guide][11]. You don't need any hardware experience. + +Open source software makes my multibox strategy affordable. It runs so efficiently that even [10-year-old computers work fine][12] as backups for typical office work. Mine are dual-core desktops with 4GB of RAM and any disk that cleanly verifies. These are so inexpensive that you can often get them for free from recycling centers. (In my [charity work][13], I find that many people give them away as unsuitable for running current proprietary software, but they're actually in perfect working order given a flexible operating system like Linux.) + +Another way to economize is to designate another family member's computer for your shared backups. + +#### Systems software and apps + +Running open source software on top of this generic hardware enables me to achieve several benefits. First, the flexibility of open source software enables me to address any possible software failure. For example, with simple operating system commands, I can copy, move, back up, and recover the operating system, applications, and data across partitions, disks, or computers. I don't have to worry about software constraints, vendor lock-in, proprietary backup file formats, licensing or activation restrictions, or extra fees. + +Another open source benefit is that you control your operating system. If you don't have control over your own system, you could be subject to forced restarts, unexpected and unwanted updates, and forced upgrades. My relative has run into such problems more than once. Without his knowledge or consent, his computer suddenly launched a forced upgrade from Windows 7 to Windows 10, which cost him three days of lost income (and untold frustration). The lesson: Your vendor's agenda may not coincide with your own. + +All operating systems have bugs. The difference is that open source software doesn't force you to eat them. + +#### Data classification + +I use very simple techniques to make my data highly available. + +I can't use cloud services for my data due to privacy requirements. Instead, my data "master copy" resides on a USB-connected disk. I plug it into any of several computers. After every session, I back up any altered data on the computer I used. + +Of course, this approach is only feasible if your backups run quickly. For most home workers, that's easy. All you have to do is segregate your data by size and how frequently you update it. + +Isolate big files like photos, audio, and video into separate folders or partitions. Make sure you back up only the files that are new or modified, not older items that have already been backed up. + +Much of my work involves office suites. These generate small files, so I isolate each project in its own folder. For example, I stored the two dozen files I used to write this article in a single subdirectory. Backing it up is as simple as copying that folder. + +Giving a little thought to data segregation and backing up only modified files ensures quick, easy backups for most home workers. My approach is simple; it works best if you only work on a couple of projects in a session. And I can tolerate losing up to a day's work. You can easily automate a more refined backup scheme for yourself. + +For software development, I take an entirely different approach. I use software versioning, which transparently handles all software backup issues for me and coordinates with other developers. My HA planning in this area focuses just on ensuring I can access the online tool. + +#### Communications + +Like many home users, I communicate through both a cellphone network and the internet. If my internet goes down, I can use the cell network instead by tethering my laptop to my Android smartphone. + +### Learning from failure + +Using my strategy for 15 years, how have I fared? What failures have I experienced, and how did they turn out? + + 1. **Motherboard burnout:** One day, my computer wouldn't turn on. I simply moved my USB "master data" external disk to another computer and used that. I lost no data. After some investigation, I determined it was a motherboard failure, so I scrapped the computer and used it for parts. + 2. **Drive failure:** An internal disk failed while I was working. I just moved my USB master disk to a backup computer. I lost 10 minutes of data updates. After work, I created a new boot disk by copying one from another computer—flexibility that only open source software offers. I used the affected computer the next day. + 3. **Fatal software update:** An update caused a failure in an important login service. I shifted to a backup computer where I hadn't yet applied the fatal update. I lost no data. After work, I searched for help with this problem and had it solved in an hour. + 4. **Monitor burnout:** My monitor fizzled out. I just swapped in a backup display and kept working. This took 10 minutes. After work, I determined that the problem was a burned-out capacitor, so I recycled the monitor. + 5. **Power outage:** Now, here's a situation I didn't plan for! A tornado took down the electrical power in our entire town for two days. I learned that one should think through _all_ possible contingencies—including alternate work sites. + + + +### Make your plan + +If you work from home, you need to consider what will happen when your home computer fails. If not, you could experience frustrating workdays off while you scramble to fix the problem. + +Open source software is the key. It runs so efficiently on older, cheaper computers that they become affordable backup machines. It offers device independence, and it ensures that you can design solutions that work best for you. + +For most people, ensuring high availability is very simple. The trick is thinking about it in advance. Create a plan _and then test it_. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/high-availability-home-office + +作者:[Howard Fosdick][a] +选题:[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/howtech +[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://jitsi.org/downloads/ +[3]: https://opensource.com/article/20/7/nextcloud +[4]: https://opensource.com/article/19/4/file-sharing-git +[5]: https://opensource.com/article/19/3/backup-solutions +[6]: https://opensource.com/life/16/3/turn-your-old-raspberry-pi-automatic-backup-server +[7]: https://opensource.com/article/19/5/advanced-rsync +[8]: https://opensource.com/article/18/9/take-control-your-data-syncthing +[9]: https://opensource.com/sites/default/files/uploads/my_ha_strategy.png (High Availability Strategy) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ +[11]: http://www.rexxinfo.org/Quick_Guide/Quick_Guide_To_Fixing_Computer_Hardware +[12]: https://opensource.com/article/19/7/how-make-old-computer-useful-again +[13]: https://www.freegeekchicago.org/ From b6bfefbd7b4052f48666890910d562098cdfe3ec Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 10 Feb 2021 05:05:57 +0800 Subject: [PATCH 261/381] add done: 20210209 My open source disaster recovery strategy for the home office.md --- ...20210209 Try Deno as an alternative to Node.js.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 sources/tech/20210209 Try Deno as an alternative to Node.js.md diff --git a/sources/tech/20210209 Try Deno as an alternative to Node.js.md b/sources/tech/20210209 Try Deno as an alternative to Node.js.md new file mode 100644 index 0000000000..efce7c5f93 --- /dev/null +++ b/sources/tech/20210209 Try Deno as an alternative to Node.js.md @@ -0,0 +1,12 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Try Deno as an alternative to Node.js) +[#]: via: (https://opensource.com/article/21/2/deno) +[#]: author: (Bryant Son https://opensource.com/users/brson) + +Try Deno as an alternative to Node.js +====== +Deno is a secure runtime for JavaScript and TypeScript. From b81324743f4b8f5190f9d699cb5294ed2a8e00c5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 10 Feb 2021 09:08:50 +0800 Subject: [PATCH 262/381] translated --- ...9 Manage containers with Podman Compose.md | 180 ----------------- ...9 Manage containers with Podman Compose.md | 184 ++++++++++++++++++ 2 files changed, 184 insertions(+), 180 deletions(-) delete mode 100644 sources/tech/20210129 Manage containers with Podman Compose.md create mode 100644 translated/tech/20210129 Manage containers with Podman Compose.md diff --git a/sources/tech/20210129 Manage containers with Podman Compose.md b/sources/tech/20210129 Manage containers with Podman Compose.md deleted file mode 100644 index 5a4c7f1449..0000000000 --- a/sources/tech/20210129 Manage containers with Podman Compose.md +++ /dev/null @@ -1,180 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Manage containers with Podman Compose) -[#]: via: (https://fedoramagazine.org/manage-containers-with-podman-compose/) -[#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/) - -Manage containers with Podman Compose -====== - -![][1] - -Containers are awesome, allowing you to package your application along with its dependencies and run it anywhere. Starting with Docker in 2013, containers have been making the lives of software developers much easier. - -One of the downsides of Docker is it has a central daemon that runs as the root user, and this has security implications. But this is where Podman comes in handy. Podman is a [daemonless container engine][2] for developing, managing, and running OCI Containers on your Linux system in root or rootless mode. - -There are other articles on Fedora Magazine you can use to learn more about Podman. Two examples follow: - - * [Using Pods with Podman on Fedora][3] - * [Podman with Capabilities on Fedora][4] - - - -If you have worked with Docker, chances are you also know about Docker Compose, which is a tool for orchestrating several containers that might be interdependent. To learn more about Docker Compose see its [documentation][5]. - -### What is Podman Compose? - -[Podman Compose][6] is a project whose goal is to be used as an alternative to Docker Compose without needing any changes to be made in the docker-compose.yaml file. Since Podman Compose works using pods, it’s good to check a refresher definition of a pod. - -> A _Pod_ (as in a pod of whales or pea pod) is a group of one or more [containers][7], with shared storage/network resources, and a specification for how to run the containers. -> -> [Pods – Kubernetes Documentation][8] - -The basic idea behind Podman Compose is that it picks the services defined inside the _docker-compose.yaml_ file and creates a container for each service. A major difference between Docker Compose and Podman Compose is that Podman Compose adds the containers to a single pod for the whole project, and all the containers share the same network. It even names the containers the same way Docker Compose does, using the _‐‐add-host_ flag when creating the containers, as you will see in the example. - -### Installation - -Complete install instructions for Podman Compose are found on its [project page][6], and there are several ways to do it. To install the latest development version, use the following command: - -``` -pip3 install https://github.com/containers/podman-compose/archive/devel.tar.gz -``` - -Make sure you also have [Podman installed][9] since you’ll need it as well. On Fedora, to install Podman use the following command: - -``` -sudo dnf install podman -``` - -### Example: launching a WordPress site with Podman Compose - -Imagine your _docker-compose.yaml_ file is in a folder called _wpsite_. A typical _docker-compose.yaml_ (or _docker-compose.yml_) for a WordPress site looks like this: - -``` -version: "3.8" -services: - web: - image: wordpress - restart: always - volumes: - - wordpress:/var/www/html - ports: - - 8080:80 - environment: - WORDPRESS_DB_HOST: db - WORDPRESS_DB_USER: magazine - WORDPRESS_DB_NAME: magazine - WORDPRESS_DB_PASSWORD: 1maGazine! - WORDPRESS_TABLE_PREFIX: cz - WORDPRESS_DEBUG: 0 - depends_on: - - db - networks: - - wpnet - db: - image: mariadb:10.5 - restart: always - ports: - - 6603:3306 - - volumes: - - wpdbvol:/var/lib/mysql - - environment: - MYSQL_DATABASE: magazine - MYSQL_USER: magazine - MYSQL_PASSWORD: 1maGazine! - MYSQL_ROOT_PASSWORD: 1maGazine! - networks: - - wpnet -volumes: - wordpress: {} - wpdbvol: {} - -networks: - wpnet: {} -``` - -If you come from a Docker background, you know you can launch these services by running _docker-compose up_. Docker Compose will create two containers named _wpsite_web_1_ and _wpsite_db_1_, and attaches them to a network called _wpsite_wpnet_. - -Now, see what happens when you run _podman-compose up_ in the project directory. First, a pod is created named after the directory in which the command was issued. Next, it looks for any named volumes defined in the YAML file and creates the volumes if they do not exist. Then, one container is created per every service listed in the _services_ section of the YAML file and added to the pod. - -Naming of the containers is done similar to Docker Compose. For example, for your web service, a container named _wpsite_web_1_ is created. Podman Compose also adds localhost aliases to each named container. Then, containers can still resolve each other by name, although they are not on a bridge network as in Docker. To do this, use the option _–add-host_. For example, _–add-host web:localhost_. - -Note that _docker-compose.yaml_ includes a port forwarding from host port 8080 to container port 80 for the web service. You should now be able to access your fresh WordPress instance from the browser using the address __. - -![WordPress Dashboard][10] - -### Controlling the pod and containers - -To see your running containers, use _podman ps_, which shows the web and database containers along with the infra container in your pod. -``` - -``` - -CONTAINER ID  IMAGE                               COMMAND               CREATED      STATUS          PORTS                                         NAMES -a364a8d7cec7  docker.io/library/wordpress:latest  apache2-foregroun...  2 hours ago  Up 2 hours ago  0.0.0.0:8080-&gt;80/tcp, 0.0.0.0:6603-&gt;3306/tcp  wpsite_web_1 -c447024aa104  docker.io/library/mariadb:10.5      mysqld                2 hours ago  Up 2 hours ago  0.0.0.0:8080-&gt;80/tcp, 0.0.0.0:6603-&gt;3306/tcp  wpsite_db_1 -12b1e3418e3e  k8s.gcr.io/pause:3.2 -``` - -``` - -You can also verify that a pod has been created by Podman for this project, named after the folder in which you issued the command. -``` - -``` - -POD ID        NAME             STATUS    CREATED      INFRA ID      # OF CONTAINERS -8a08a3a7773e  wpsite           Degraded  2 hours ago  12b1e3418e3e  3 -``` - -``` - -To stop the containers, enter the following command in another command window: - -``` -podman-compose down -``` - -You can also do that by stopping and removing the pod. This essentially stops and removes all the containers and then the containing pod. So, the same thing can be achieved with these commands: - -``` -podman pod stop podname -podman pod rm podname -``` - -Note that this does not remove the volumes you defined in _docker-compose.yaml_. So, the state of your WordPress site is saved, and you can get it back by running this command: - -``` -podman-compose up -``` - -In conclusion, if you’re a Podman fan and do your container jobs with Podman, you can use Podman Compose to manage your containers in development and production. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/manage-containers-with-podman-compose/ - -作者:[Mehdi Haghgoo][a] -选题:[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/powergame/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/01/podman-compose-1-816x345.jpg -[2]: https://podman.io -[3]: https://fedoramagazine.org/podman-pods-fedora-containers/ -[4]: https://fedoramagazine.org/podman-with-capabilities-on-fedora/ -[5]: https://docs.docker.com/compose/ -[6]: https://github.com/containers/podman-compose -[7]: https://kubernetes.io/docs/concepts/containers/ -[8]: https://kubernetes.io/docs/concepts/workloads/pods/ -[9]: https://podman.io/getting-started/installation -[10]: https://fedoramagazine.org/wp-content/uploads/2021/01/Screenshot-from-2021-01-08-06-27-29-1024x767.png diff --git a/translated/tech/20210129 Manage containers with Podman Compose.md b/translated/tech/20210129 Manage containers with Podman Compose.md new file mode 100644 index 0000000000..f020ea1a23 --- /dev/null +++ b/translated/tech/20210129 Manage containers with Podman Compose.md @@ -0,0 +1,184 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage containers with Podman Compose) +[#]: via: (https://fedoramagazine.org/manage-containers-with-podman-compose/) +[#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/) + +用 Podman Compose 管理容器 +====== + +![][1] + +容器很棒,让你可以将你的应用连同其依赖项一起打包,并在任何地方运行。从 2013 年的 Docker 开始,容器已经让软件开发者的生活变得更加轻松。 + +Docker 的一个缺点是它有一个中央守护进程,它以 root 用户的身份运行,这对安全有影响。但这正是 Podman 的用武之地。Podman 是一个 [无守护进程容器引擎][2],用于开发、管理和在你的 Linux 系统上以 root 或无 root 模式运行 OCI 容器。 + +在 Fedora Magazine 上还有其他文章,你可以用来了解更多关于 Podman 的信息。下面有两个例子: + + * [在 Fedora 上使用 Podman 的 Pod][3] + * [在 Fedora 上具有 Capabilities 的Podman][4] + + + +如果你使用过 Docker,你很可能也知道 Docker Compose,它是一个用于编排多个可能相互依赖的容器的工具。要了解更多关于 Docker Compose 的信息,请看它的[文档][5]。 + +### 什么是 Podman Compose? + +[Podman Compose][6]是一个目标作为 Docker Compose 的替代品,不需要对 docker-compose.yaml 文件进行任何修改的项目。由于 Podman Compose 使用 pod 工作,所以最好看下 pod 的最新定义。 + + +> 一个_Pod_(如一群鲸鱼或豌豆荚)是由一个或多个[容器][7]组成的组,具有共享的存储/网络资源,以及如何运行容器的规范。 +> +> [Pods - Kubernetes 文档][8] + +Podman Compose 的基本思想是,它选中 _docker-compose.yaml_ 文件里面定义的服务,为每个服务创建一个容器。Docker Compose 和 Podman Compose 的一个主要区别是,Podman Compose 将整个项目的容器添加到一个单一的 pod 中,而且所有的容器共享同一个网络。它甚至用和 Docker Compose 一样的方式命名容器,在创建容器时使用 _--add-host_ 标志,你会在例子中看到。 + + +### 安装 + +Podman Compose 的完整安装说明可以在[项目页面][6]上找到,它有几种方法。要安装最新的开发版本,使用以下命令: + +``` +pip3 install https://github.com/containers/podman-compose/archive/devel.tar.gz +``` + +确保你也安装了 [Podman][9],因为你也需要它。在 Fedora 上,使用下面的命令来安装Podman: + +``` +sudo dnf install podman +``` + +### 例子:用 Podman Compose 启动一个 WordPress 网站 + +想象一下,你的 _docker-compose.yaml_ 文件在一个叫 _wpsite_ 的文件夹里。一个典型的 WordPress 网站的 _docker-compose.yaml_ (或 _docker-compose.yml_) 文件是这样的: + +``` +version: "3.8" +services: + web: + image: wordpress + restart: always + volumes: + - wordpress:/var/www/html + ports: + - 8080:80 + environment: + WORDPRESS_DB_HOST: db + WORDPRESS_DB_USER: magazine + WORDPRESS_DB_NAME: magazine + WORDPRESS_DB_PASSWORD: 1maGazine! + WORDPRESS_TABLE_PREFIX: cz + WORDPRESS_DEBUG: 0 + depends_on: + - db + networks: + - wpnet + db: + image: mariadb:10.5 + restart: always + ports: + - 6603:3306 + + volumes: + - wpdbvol:/var/lib/mysql + + environment: + MYSQL_DATABASE: magazine + MYSQL_USER: magazine + MYSQL_PASSWORD: 1maGazine! + MYSQL_ROOT_PASSWORD: 1maGazine! + networks: + - wpnet +volumes: + wordpress: {} + wpdbvol: {} + +networks: + wpnet: {} +``` + +如果你用过 Docker,你就会知道你可运行 _docker-compose up_ 来启动这些服务。Docker Compose 会创建两个名为 _wpsite_web_1_ 和 _wpsite_db_1_ 的容器,并将它们连接到一个名为 _wpsite_wpnet_ 的网络。 + + +现在,看看当你在项目目录下运行 _podman-compose up_ 时会发生什么。首先,一个以执行命令的目录命名的 pod 被创建。接下来,它寻找 YAML 文件中定义的任何名称的卷,如果它们不存在,就创建卷。然后,在 YAML 文件的 _services_ 部分列出的每个服务都会创建一个容器,并添加到 pod 中。 + +容器的命名与 Docker Compose 类似。例如,为你的 web 服务创建一个名为 _wpsite_web_1_ 的容器。Podman Compose 还为每个命名的容器添加了 localhost 别名。之后,容器仍然可以通过名字互相解析,尽管它们并不像 Docker 那样在一个桥接网络上。要做到这一点,使用选项 _-add-host_。例如,_-add-host web:localhost_。 + +请注意,_docker-compose.yaml_ 包含了一个从主机 8080 端口到容器 80 端口的 Web 服务的端口转发。现在你应该可以通过浏览器访问新 WordPress 实例,地址为 __。 + + +![WordPress Dashboard][10] + +### 控制 pod 和容器 + +要查看正在运行的容器,使用 _podman ps_,它可以显示 web 和数据库容器以及 pod 中的 infra 容器。 +``` + +``` + +CONTAINER ID  IMAGE                               COMMAND               CREATED      STATUS          PORTS                                         NAMES +a364a8d7cec7  docker.io/library/wordpress:latest  apache2-foregroun...  2 hours ago  Up 2 hours ago  0.0.0.0:8080-&gt;80/tcp, 0.0.0.0:6603-&gt;3306/tcp  wpsite_web_1 +c447024aa104  docker.io/library/mariadb:10.5      mysqld                2 hours ago  Up 2 hours ago  0.0.0.0:8080-&gt;80/tcp, 0.0.0.0:6603-&gt;3306/tcp  wpsite_db_1 +12b1e3418e3e  k8s.gcr.io/pause:3.2 +``` + +``` + +你也可以验证 Podman 已经为这个项目创建了一个 pod,以你执行命令的文件夹命名。 +``` + +``` + +POD ID        NAME             STATUS    CREATED      INFRA ID      # OF CONTAINERS +8a08a3a7773e  wpsite           Degraded  2 hours ago  12b1e3418e3e  3 +``` + +``` + +要停止容器,在另一个命令窗口中输入以下命令: + +``` +podman-compose down +``` + +你也可以通过停止和删除 pod 来实现。这实质上是停止并移除所有的容器,然后再删除包含的 pod。所以,同样的事情也可以通过这些命令来实现: + +``` +podman pod stop podname +podman pod rm podname +``` + +请注意,这不会删除你在 _docker-compose.yaml_ 中定义的卷。所以,你的 WordPress 网站的状态被保存下来了,你可以通过运行这个命令来恢复它。 + +``` +podman-compose up +``` + +总之,如果你是一个 Podman 粉丝,并且用 Podman 做容器工作,你可以使用 Podman Compose 来管理你的开发和生产中的容器。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/manage-containers-with-podman-compose/ + +作者:[Mehdi Haghgoo][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/powergame/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/01/podman-compose-1-816x345.jpg +[2]: https://podman.io +[3]: https://fedoramagazine.org/podman-pods-fedora-containers/ +[4]: https://fedoramagazine.org/podman-with-capabilities-on-fedora/ +[5]: https://docs.docker.com/compose/ +[6]: https://github.com/containers/podman-compose +[7]: https://kubernetes.io/docs/concepts/containers/ +[8]: https://kubernetes.io/docs/concepts/workloads/pods/ +[9]: https://podman.io/getting-started/installation +[10]: https://fedoramagazine.org/wp-content/uploads/2021/01/Screenshot-from-2021-01-08-06-27-29-1024x767.png From ca2cacb77a54cfd6467850ae6dfc12998b169d2e Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 10 Feb 2021 09:28:14 +0800 Subject: [PATCH 263/381] translating --- ...usible for an open source alternative to Google Analytics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md b/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md index 74252f60a8..463d9d9944 100644 --- a/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md +++ b/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 626f20cbe52e3f9edc3e811e75ff62b1580e8bcf Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 10 Feb 2021 10:16:37 +0800 Subject: [PATCH 264/381] Rename sources/tech/20210209 Understanding Linus-s Law for open source security.md to sources/talk/20210209 Understanding Linus-s Law for open source security.md --- ...20210209 Understanding Linus-s Law for open source security.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210209 Understanding Linus-s Law for open source security.md (100%) diff --git a/sources/tech/20210209 Understanding Linus-s Law for open source security.md b/sources/talk/20210209 Understanding Linus-s Law for open source security.md similarity index 100% rename from sources/tech/20210209 Understanding Linus-s Law for open source security.md rename to sources/talk/20210209 Understanding Linus-s Law for open source security.md From 0f573f885588147513252d684af41b526302b7af Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 10 Feb 2021 11:29:06 +0800 Subject: [PATCH 265/381] PRF @Chao-zhi --- ... Install and Use Than Arch Linux Itself.md | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md b/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md index d8d06a1e79..6fbcf50489 100644 --- a/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md +++ b/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md @@ -1,32 +1,32 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself) [#]: via: (https://itsfoss.com/arch-based-linux-distros/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) -最好用的几个基于 Arch 的用户友好型 Linux 发行版,它们比 Arch Linux 更容易安装和使用 +9 个易用的基于 Arch 的用户友好型 Linux 发行版 ====== 在 Linux 社区中,[Arch Linux][1] 有一群狂热的追随者。这个轻量级的发行版以 DIY 的态度提供了最前沿的更新。 但是,Arch 的目标用户是那些更有经验的用户。因此,它通常被认为是那些技术不够(或耐心不够)的人所无法触及的。 -事实上,第一步,[安装 Arch Linux 就足以把很多人吓跑 ][2]。与大多数其他发行版不同,Arch Linux 没有一个易于使用的图形安装程序。安装过程中涉及到的磁盘分区,连接到互联网,挂载驱动器和创建文件系统等只用命令行工具来操作。 +事实上,只是最开始的步骤,[安装 Arch Linux 就足以把很多人吓跑][2]。与大多数其他发行版不同,Arch Linux 没有一个易于使用的图形安装程序。安装过程中涉及到的磁盘分区,连接到互联网,挂载驱动器和创建文件系统等只用命令行工具来操作。 对于那些不想经历复杂的安装和设置的人来说,有许多用户友好的基于 Arch 的发行版。 -在本文中,我将向您展示一些 Arch 替代发行版。这些发行版附带了图形安装程序、图形包管理器和其他工具,它们比命令行工具更容易使用。 +在本文中,我将向你展示一些 Arch 替代发行版。这些发行版附带了图形安装程序、图形包管理器和其他工具,比它们的命令行版本更容易使用。 ### 更容易设置和使用的基于 Arch 的 Linux 发行版 -![][3] +![](https://img.linux.net.cn/data/attachment/album/202102/10/112812sc42txp4eexco44x.jpg) 请注意,这不是一个排名列表。这些数字只是为了计数的目的。排第二的发行版不应该被认为比排第七的发行版好。 -#### 1\。Manjaro Linux +#### 1、Manjaro Linux ![][4] @@ -34,51 +34,51 @@ Manjaro 提供了 Arch Linux 的所有优点,同时注重用户友好性和可访问性。Manjaro 既适合新手,也适合有经验的 Linux 用户。 -**对于新手**,我们提供了一个用户友好的安装程序,系统本身的设计可以完全“开箱即用”地工作在您[最喜爱的桌面环境 ][6](DE) 或窗口管理器中。 +**对于新手**,它提供了一个用户友好的安装程序,系统本身也设计成可以在你[最喜爱的桌面环境 ][6](DE)或窗口管理器中直接“开箱即用”。 -**对于更有经验的用户,** Manjaro 还提供多种功能,以满足每个个人的口味和喜好。[Manjaro Architect][7] 提供了安装各种 Manjaro 风格的选项,并为那些想要完全自由地塑造系统的人提供了各种桌面环境、文件系统([最近推出的 ZFS][8]) 和引导程序选择。 +**对于更有经验的用户**,Manjaro 还提供多种功能,以满足每个个人的口味和喜好。[Manjaro Architect][7] 提供了安装各种 Manjaro 风格的选项,并为那些想要完全自由地塑造系统的人提供了各种桌面环境、文件系统([最近推出的 ZFS][8]) 和引导程序的选择。 -Manjaro 也是一个滚动发行的前沿发行版。然而,与 Arch 不同的是,Manjaro 首先测试更新,然后将其提供给用户。稳定在这里也很重要。 +Manjaro 也是一个滚动发布的前沿发行版。然而,与 Arch 不同的是,Manjaro 首先测试更新,然后将其提供给用户。稳定在这里也很重要。 -#### 2\。ArcoLinux +#### 2、ArcoLinux ![][9] -[ArcoLinux][10]( 以前称为 ArchMerge) 是一个基于 Arch Linux 的发行版。开发团队提供了三种变体。ArcoLinux、ArcoLinuxD 和 ArcoLinuxB。 +[ArcoLinux][10](以前称为 ArchMerge)是一个基于 Arch Linux 的发行版。开发团队提供了三种变体。ArcoLinux、ArcoLinuxD 和 ArcoLinuxB。 -ArcoLinux 是一个功能齐全的发行版,附带有 [Xfce desktop][11]、[Openbox][12] 和 [i3 window managers][13]。 +ArcoLinux 是一个功能齐全的发行版,附带有 [Xfce 桌面][11]、[Openbox][12] 和 [i3 窗口管理器][13]。 -**ArcoLinuxD** 是一个最小的发行版,包含允许高级用户安装任何桌面和应用程序的脚本。 +**ArcoLinuxD** 是一个精简的发行版,它包含了一些脚本,可以让高级用户安装任何桌面和应用程序。 **ArcoLinuxB** 是一个让用户能够构建自定义发行版的项目,同时还开发了几个带有预配置桌面的社区版本,如 Awesome、bspwm、Budgie、Cinnamon、Deepin、GNOME、MATE 和 KDE Plasma。 ArcoLinux 还提供了各种视频教程,因为它非常注重学习和获取 Linux 技能。 -#### 3\。Archlabs Linux +#### 3、Archlabs Linux ![][14] -[ArchLabs Linux][15] 是一个轻量级的滚动版 Linux 发行版,基于最基础的 Arch Linux,带有 [Openbox][16] 窗口管理器。[ArchLabs][17] 在观感设计中受到 [BunsenLabs][18] 的影响和启发,主要考虑到中级到高级用户的需求。 +[ArchLabs Linux][15] 是一个轻量级的滚动版 Linux 发行版,基于最精简的 Arch Linux,带有 [Openbox][16] 窗口管理器。[ArchLabs][17] 在观感设计中受到 [BunsenLabs][18] 的影响和启发,主要考虑到中级到高级用户的需求。 -#### 4\。Archman Linux +#### 4、Archman Linux ![][19] -[Archman][20] 是一个独立的项目。Arch Linux 发行版对于没有多少 Linux 经验的用户来说通常不是理想的操作系统。大量的背景阅读是必要的事情,以尽可能减少挫折感的意义。Archman Linux 的开发人员正试图改变这种评价。 +[Archman][20] 是一个独立的项目。Arch Linux 发行版对于没有多少 Linux 经验的用户来说通常不是理想的操作系统。要想在最小的挫折感下让事情变得更有意义,必须要有相当的背景知识。Archman Linux 的开发人员正试图改变这种评价。 -Archman 的开发基于对开发的理解,包括用户反馈和体验组件。根据我们团队过去的经验,将用户的反馈和要求融合在一起,确定路线图并完成构建工作。 +Archman 的开发是基于对开发的理解,包括用户反馈和体验组件。根据团队过去的经验,将用户的反馈和要求融合在一起,确定路线图并完成构建工作。 -#### 5\。EndeavourOS +#### 5、EndeavourOS ![][21] -当流行的基于 Arch 的发行版 [Antergos 在 2019 停止 ][22] 时,它留下了一个友好且非常有用的社区。Antergos 项目结束了,因为系统对于开发人员来说太难维护了。 +当流行的基于 Arch 的发行版 [Antergos 在 2019 结束][22] 时,它留下了一个友好且非常有用的社区。Antergos 项目结束的原因是因为该系统对于开发人员来说太难维护了。 -在发布后的几天内,一些有经验的用户通过创建一个新的发行版来填补 Antergos 留下的空白,从而维护了以前的社区。这就是 [EndeavourOS][23] 的诞生。 +在宣布结束后的几天内,一些有经验的用户通过创建一个新的发行版来填补 Antergos 留下的空白,从而维护了以前的社区。这就是 [EndeavourOS][23] 的诞生。 [EndeavourOS][24] 是轻量级的,并且附带了最少数量的预装应用程序。一块近乎空白的画布,随时可以个性化。 -#### 6\。RebornOS +#### 6、RebornOS ![][25] @@ -86,45 +86,45 @@ Archman 的开发基于对开发的理解,包括用户反馈和体验组件。 RebornOS 还声称支持 [Anbox][27],它可以在桌面 Linux 上运行 Android 应用程序。它还提供了一个简单的内核管理器 GUI 工具。 -再加上 [Pacman][28],[AUR][29],以及定制版本的 Cnchi 图形安装程序,Arch Linux 终于可以让最没有经验的用户也能够使用了。 +再加上 [Pacman][28]、[AUR][29],以及定制版本的 Cnchi 图形安装程序,Arch Linux 终于可以让最没有经验的用户也能够使用了。 -#### 7\。Chakra Linux +#### 7、Chakra Linux ![][30] 一个社区开发的 GNU/Linux 发行版,它的亮点在 KDE 和 Qt 技术。[Chakra Linux][31] 不在特定日期安排发布,而是使用“半滚动发布”系统。 -这意味着 Chakra Linux 的核心包被冻结,只更新以修复任何安全问题。这些软件包是在最新版本经过彻底测试后更新的,然后再转移到永久存储库(大约每六个月更新一次)。 +这意味着 Chakra Linux 的核心包被冻结,只在修复安全问题时才会更新。这些软件包是在最新版本经过彻底测试后更新的,然后再转移到永久软件库(大约每六个月更新一次)。 -除官方存储库外,用户还可以安装 Chakra 社区存储库 (CCR) 的软件包,该库为官方存储库中未包含的软件提供用户制作的 PKGINFOs 和 [PKGBUILD][32] 脚本,这是受 Arch 用户存储库的启发而出现的。 +除官方软件库外,用户还可以安装 Chakra 社区软件库 (CCR) 的软件包,该库为官方存储库中未包含的软件提供用户制作的 PKGINFOs 和 [PKGBUILD][32] 脚本,其灵感来自于 Arch 用户软件库(AUR)。 -#### 8\。Artix Linux +#### 8、Artix Linux ![Artix Mate Edition][33] [Artix Linux][34] 也是一个基于 Arch Linux 的滚动发行版,它使用 [OpenRC][35]、[runit][36] 或 [s6][37] 作为初始化工具而不是 [systemd][38]。 -Artix Linux 有自己的软件包存储库,但作为一个基于 pacman 的发行版,它可以使用 Arch Linux 存储库或任何其他衍生发行版的软件包,甚至可以使用显式依赖于 systemd 的软件包。也可以使用 [Arch User Repository][29](AUR)。 +Artix Linux 有自己的软件库,但作为一个基于 `pacman` 的发行版,它可以使用 Arch Linux 软件库或任何其他衍生发行版的软件包,甚至可以使用明确依赖于 systemd 的软件包。也可以使用 [Arch 用户软件库][29](AUR)。 -#### 10\。BlackArch Linux +#### 9、BlackArch Linux ![][39] -BlackArch 是一个基于 Arch Linux 的[渗透测试发行版 ][40],它提供了大量的网络安全工具。它是专门为渗透测试人员和安全研究人员创建的。该存储库包含 2400 多个[黑客和渗透测试工具 ][41],可以单独安装,也可以分组安装。BlackArch Linux 兼容现有的 Arch Linux 包。 +BlackArch 是一个基于 Arch Linux 的 [渗透测试发行版][40],它提供了大量的网络安全工具。它是专门为渗透测试人员和安全研究人员创建的。该软件库包含 2400 多个[黑客和渗透测试工具 ][41],可以单独安装,也可以分组安装。BlackArch Linux 兼容现有的 Arch Linux 包。 ### 想要真正的原版 Arch Linux 吗?可以使用图形化 Arch 安装程序简化安装 -如果您想使用原版的 Arch Linux,但又被它困难的安装所难倒。幸运的是,您可以下载一个带有图形安装程序的 Arch Linux ISO。 +如果你想使用原版的 Arch Linux,但又被它困难的安装所难倒。幸运的是,你可以下载一个带有图形安装程序的 Arch Linux ISO。 -Arch 安装程序基本上是 Arch Linux ISO 的一个相对容易使用的基于文本的安装程序。它比原版的 Arch 安装容易得多。 +Arch 安装程序基本上是 Arch Linux ISO 的一个相对容易使用的基于文本的安装程序。它比裸奔的 Arch 安装容易得多。 #### Anarchy Installer ![][42] -[Anarchy installer][43] 打算为新手和有经验的 Linux 用户提供一种简单而无痛苦的方式来安装 ArchLinux。在需要的时候安装,在需要的地方安装,并且以您想要的方式安装。这就是 Anarchy 的哲学。 +[Anarchy installer][43] 打算为新手和有经验的 Linux 用户提供一种简单而无痛苦的方式来安装 ArchLinux。在需要的时候安装,在需要的地方安装,并且以你想要的方式安装。这就是 Anarchy 的哲学。 -启动安装程序后,将显示一个简单的 [TUI menu][44],列出所有可用的安装程序选项。 +启动安装程序后,将显示一个简单的 [TUI 菜单][44],列出所有可用的安装程序选项。 #### Zen Installer @@ -132,13 +132,13 @@ Arch 安装程序基本上是 Arch Linux ISO 的一个相对容易使用的基 [Zen Installer][46] 为安装 Arch Linux 提供了一个完整的图形(点击式)环境。它支持安装多个桌面环境 、AUR 以及 Arch Linux 的所有功能和灵活性,并且易于图形化安装。 -ISO 将引导实时环境,然后在您连接到 internet 后下载最新稳定版本的安装程序。因此,您将始终获得最新的安装程序和更新的功能。 +ISO 将引导一个临场环境,然后在你连接到互联网后下载最新稳定版本的安装程序。因此,你将始终获得最新的安装程序和更新的功能。 ### 总结 -对于许多用户来说,基于 Arch 的发行版会是一个很好的无障碍选择,但是像 Anarchy 这样的图形化安装程序至少离原版的 Arch Linux 更近了一步。 +对于许多用户来说,基于 Arch 的发行版会是一个很好的无忧选择,而像 Anarchy 这样的图形化安装程序至少离原版的 Arch Linux 更近了一步。 -在我看来,[Arch Linux 的真正魅力在于它的安装过程 ][2] 对于 Linux 爱好者来说,这是一个学习的机会,而不是麻烦。Arch Linux 及其衍生产品有很多东西需要你去折腾,但是在折腾的过程中你就会进入到开源软件的世界,这里是神奇的新世界。下次上课见! +在我看来,[Arch Linux 的真正魅力在于它的安装过程][2],对于 Linux 爱好者来说,这是一个学习的机会,而不是麻烦。Arch Linux 及其衍生产品有很多东西需要你去折腾,但是在折腾的过程中你就会进入到开源软件的世界,这里是神奇的新世界。下次再见! -------------------------------------------------------------------------------- @@ -147,7 +147,7 @@ via: https://itsfoss.com/arch-based-linux-distros/ 作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] 译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 733a21d02b27867bd6f29e8281ca32604c1df67e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 10 Feb 2021 11:29:40 +0800 Subject: [PATCH 266/381] PUB @Chao-zhi https://linux.cn/article-13104-1.html --- ...at are Easier to Install and Use Than Arch Linux Itself.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md (99%) diff --git a/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md b/published/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md similarity index 99% rename from translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md rename to published/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md index 6fbcf50489..11c43fd1f5 100644 --- a/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md +++ b/published/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13104-1.html) [#]: subject: (Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself) [#]: via: (https://itsfoss.com/arch-based-linux-distros/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) From 1e9ea5fa0008a45ea4b5e2cd436346c33cc68e01 Mon Sep 17 00:00:00 2001 From: Percy Date: Wed, 10 Feb 2021 20:26:19 +0800 Subject: [PATCH 267/381] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8E=9F=E6=96=87:?= =?UTF-8?q?=20How=20to=20Add=20Fingerprint=20Login=20in=20Ubuntu=20and=20O?= =?UTF-8?q?ther=20Linux=20Distributions.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Fingerprint Login in Ubuntu and Other Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md index c2cea8fdcc..dcf6c9a3ae 100644 --- a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (scvoet) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2901af2ed62207bdaca8dd0379a03a480a10778e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 10 Feb 2021 23:53:23 +0800 Subject: [PATCH 268/381] PRF @robsean --- ...nux -Essentials Explained for Beginners.md | 102 +++++++++--------- 1 file changed, 48 insertions(+), 54 deletions(-) diff --git a/translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md b/translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md index fdf97c8359..0162615f93 100644 --- a/translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md +++ b/translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md @@ -1,16 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Run a Shell Script in Linux [Essentials Explained for Beginners]) [#]: via: (https://itsfoss.com/run-shell-script-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -如何在 Linux 中运行一个 Shell 脚本 [初学者必知] +基础:如何在 Linux 中运行一个 Shell 脚本 ====== -在 linux 中有两种运行 shell 脚本的方法。你可以使用: +![](https://img.linux.net.cn/data/attachment/album/202102/10/235325tkv7h8dvlp4makkk.jpg) + +在 Linux 中有两种运行 shell 脚本的方法。你可以使用: ``` bash script.sh @@ -22,7 +24,7 @@ bash script.sh ./script.sh ``` -这可能很简单,它解释不了多少。不要担心,我将使用示例来进行必要的解释,以便你能理解为什么在运行一个 shell 脚本时要使用给定的特定语法格式。 +这可能很简单,但没太多解释。不要担心,我将使用示例来进行必要的解释,以便你能理解为什么在运行一个 shell 脚本时要使用给定的特定语法格式。 我将使用这一行 shell 脚本来使需要解释的事情变地尽可能简单: @@ -32,43 +34,37 @@ abhishek@itsfoss:~/Scripts$ cat hello.sh echo "Hello World!" ``` -### 方法 1: 通过将文件作为参数传递给 shell 以运行 shell 脚本 +### 方法 1:通过将文件作为参数传递给 shell 以运行 shell 脚本 第一种方法涉及将脚本文件的名称作为参数传递给 shell 。 -考虑到 bash 是默认脚本,你可以像这样运行一个脚本: +考虑到 bash 是默认 shell,你可以像这样运行一个脚本: ``` bash hello.sh ``` -你知道这种方法的优点码?**你的脚本没有所需要执行权限**。非常方便快速和简单的任务。 +你知道这种方法的优点吗?**你的脚本不需要执行权限**。对于简单的任务非常方便快速。 ![在 Linux 中运行一个 Shell 脚本][1] 如果你还不熟悉,我建议你 [阅读我的 Linux 文件权限详细指南][2] 。 -记住,它需要成为一个 shell 脚本,以便你能将其作为参数传递。一个 shell 脚本是由命令组成的。如果你使用一个普通的文本文件,它将会抱怨错误的命令。 +记住,将其作为参数传递的需要是一个 shell 脚本。一个 shell 脚本是由命令组成的。如果你使用一个普通的文本文件,它将会抱怨错误的命令。 ![运行一个文本文件为脚本][3] 在这种方法中,**你要明确地具体指定你想使用 bash 作为脚本的解释器** 。 -Shell 只是一个程序,并且 bash 只是 Shell 的一个实施。这里有其它的 shell 程序,像 ksh ,[zsh][4] ,等等。如果你安装有其它的 shell ,你也可以使用它们来代替 bash 。 +shell 只是一个程序,并且 bash 只是 Shell 的一种实现。还有其它的 shell 程序,像 ksh 、[zsh][4] 等等。如果你安装有其它的 shell ,你也可以使用它们来代替 bash 。 例如,我已安装了 zsh ,并使用它来运行相同的脚本: ![使用 Zsh 来执行 Shell 脚本][5] -**建议阅读:** +### 方法 2:通过具体指定 shell 脚本的路径来执行脚本 -![][6] - -#### [如何在 Linux 终端中一次运行多个 Linux 命令 [初学者必知提示]][7] - -### 方法 2: 通过具体指定 shell 脚本的路径来执行脚本 - -另外一种运行一个 shell 脚本的方法是通过提供它的路径。但是为使这变地可能,你的文件必须是可执行的。否则,当你尝试执行脚本时,你将会得到 “拒绝访问” 错误。 +另外一种运行一个 shell 脚本的方法是通过提供它的路径。但是要这样做之前,你的文件必须是可执行的。否则,当你尝试执行脚本时,你将会得到 “权限被拒绝” 的错误。 因此,你首先需要确保你的脚本有可执行权限。你可以 [使用 chmod 命令][8] 来给予你自己脚本的这种权限,像这样: @@ -76,23 +72,23 @@ Shell 只是一个程序,并且 bash 只是 Shell 的一个实施。这里有 chmod u+x script.sh ``` -在你的脚本是可执行的后,你需要的全部工作是输入文件的名称及其绝对路径或相对路径。大多数情况下,你都在同一个目录中,因此你可以像这样使用它: +使你的脚本是可执行之后,你只需输入文件的名称及其绝对路径或相对路径。大多数情况下,你都在同一个目录中,因此你可以像这样使用它: ``` ./script.sh ``` -如果你不与你的脚本在同一个目录中,你可以具体指定脚本的绝对路径或相对路径: +如果你与你的脚本不在同一个目录中,你可以具体指定脚本的绝对路径或相对路径: ![在其它的目录中运行 Shell 脚本][9] -#### 在脚本前的这个 ./ 是非常重要的。(当你与脚本在同一个目录中) +在脚本前的这个 `./` 是非常重要的(当你与脚本在同一个目录中)。 ![][10] -为什么当你在同一个目录下,却不能使用脚本名称?这是因为你的 Linux 系统会在 PATH 变量中查找具体指定的几个选定目录中的可执行的文件来运行。 +为什么当你在同一个目录下,却不能使用脚本名称?这是因为你的 Linux 系统会在 `PATH` 环境变量中指定的几个目录中查找可执行的文件来运行。 -这里是我的系统的 PATH 变量的值: +这里是我的系统的 `PATH` 环境变量的值: ``` abhishek@itsfoss:~$ echo $PATH @@ -101,48 +97,46 @@ abhishek@itsfoss:~$ echo $PATH 这意味着在下面目录中具有可执行权限的任意文件都可以在系统的任何位置运行: - * /home/abhishek/.local/bin - * /usr/local/sbin - * /usr/local/bin - * /usr/sbin - * /usr/bin - * /sbin - * /bin - * /usr/games - * /usr/local/games - * /snap/bin + * `/home/abhishek/.local/bin` + * `/usr/local/sbin` + * `/usr/local/bin` + * `/usr/sbin` + * `/usr/bin` + * `/sbin` + * `/bin` + * `/usr/games` + * `/usr/local/games` + * `/snap/bin` - - -Linux 命令(像 ls ,cat 等)的二进制文件或可执行文件都位于这些目录中的其中一个目录。这就是为什么你可以在你系统的任何位置通过使用命令的名称来运作这些命令的原因。看看,ls 命令就是位于 /usr/bin 目录中。 +Linux 命令(像 `ls`、`cat` 等)的二进制文件或可执行文件都位于这些目录中的其中一个。这就是为什么你可以在你系统的任何位置通过使用命令的名称来运作这些命令的原因。看看,`ls` 命令就是位于 `/usr/bin` 目录中。 ![][11] -当你使用脚本而不具体指定其绝对路径或相对路径时,系统将不能在 PATH 变量中找到涉及的脚本。 +当你使用脚本而不具体指定其绝对路径或相对路径时,系统将不能在 `PATH` 环境变量中找到提及的脚本。 -#### 为什么大多数 shell 脚本在其头部包含 #! /bin/bash ? - -记得我提过 shell 只是一个程序,并且有不同实现的 shell 程序。 - -当你使用 #! /bin/bash 时,你是具体指定 bash 作为解释器来运行脚本。如果你不这样做,并且以 ./script.sh 的方式运行一个脚本,它通常会在你正在运行的 shell 中运行。 - -有问题吗?可能会有。看看,大多数的 shell 语法是大多数种类的 shell 中通用的,但是有一些语法可能会有所不同。 - -例如,在 bash和 zsh 中数组的行为是不同的。在 zsh 中,数组索引是从 1 开始的,而不是从 0 开始。 - -![Bash Vs Zsh][12] - -使用 #! /bin/bash 标示该级别是 bash 脚本,并且应该使用bash 作为脚本的解释器来运行,而不受在系统上正在使用的 shell 的影响。如果你使用 zsh 的特殊语法,你可以通过在脚本的第一行添加 #! /bin/zsh 的方式来标示其是 zsh 脚本 - -在 #! 和 /bin/bash 之间的空格是没有影响的。你也可以使用 #!/bin/bash 。 +> 为什么大多数 shell 脚本在其头部包含 #! /bin/bash ? +> +> 记得我提过 shell 只是一个程序,并且有 shell 程序的不同实现。 +> +> 当你使用 `#! /bin/bash` 时,你是具体指定 bash 作为解释器来运行脚本。如果你不这样做,并且以 `./script.sh` 的方式运行一个脚本,它通常会在你正在运行的 shell 中运行。 +> +> 有问题吗?可能会有。看看,大多数的 shell 语法是大多数种类的 shell 中通用的,但是有一些语法可能会有所不同。 +> +> 例如,在 bash 和 zsh 中数组的行为是不同的。在 zsh 中,数组索引是从 1 开始的,而不是从 0 开始。 +> +>![Bash Vs Zsh][12] +> +> 使用 `#! /bin/bash` 来标识该脚本是 bash 脚本,并且应该使用 bash 作为脚本的解释器来运行,而不受在系统上正在使用的 shell 的影响。如果你使用 zsh 的特殊语法,你可以通过在脚本的第一行添加 `#! /bin/zs`h 的方式来标识其是 zsh 脚本。 +> +> 在 `#!` 和 `/bin/bash` 之间的空格是没有影响的。你也可以使用 `#!/bin/bash` 。 ### 它有帮助吗? 我希望这篇文章能够增加你的 Linux 知识。如果你还有问题或建议,请留下评论。 -专家用户可能依然会挑出我丢失的东西。但是这类初学者话题的问题不容易找到信息和避免过多或过少的细节之间的平衡。 +专家用户可能依然会挑出我遗漏的东西。但这种初级题材的问题是,要找到信息的平衡点,避免细节过多或过少,并不容易。 -如果你对学习 bash 脚本感兴趣,在我们的以系统管理为中心的网站 [Linux Handbook][14] 上,我们有一个 [完整的 Bash 初学者系列][13] 。如果你想要,你也可以 [购买附加练习题的电子书][15] ,以支持 Linux Handbook。 +如果你对学习 bash 脚本感兴趣,在我们专注于系统管理的网站 [Linux Handbook][14] 上,我们有一个 [完整的 Bash 初学者系列][13] 。如果你想要,你也可以 [购买带有附加练习的电子书][15] ,以支持 Linux Handbook。 -------------------------------------------------------------------------------- @@ -151,7 +145,7 @@ via: https://itsfoss.com/run-shell-script-linux/ 作者:[Abhishek Prakash][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 a3eec4548240439c356377593b8757069bb4ae4d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 10 Feb 2021 23:54:02 +0800 Subject: [PATCH 269/381] PUB @robsean https://linux.cn/article-13106-1.html --- ...ell Script in Linux -Essentials Explained for Beginners.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md (99%) diff --git a/translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md b/published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md similarity index 99% rename from translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md rename to published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md index 0162615f93..c9db63357d 100644 --- a/translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md +++ b/published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13106-1.html) [#]: subject: (How to Run a Shell Script in Linux [Essentials Explained for Beginners]) [#]: via: (https://itsfoss.com/run-shell-script-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From fdb03b465898a5810c2bed477de73fb439874f49 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 10 Feb 2021 23:57:54 +0800 Subject: [PATCH 270/381] PRF --- ...Shell Script in Linux -Essentials Explained for Beginners.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md b/published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md index c9db63357d..f2c5fd298c 100644 --- a/published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md +++ b/published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md @@ -126,7 +126,7 @@ Linux 命令(像 `ls`、`cat` 等)的二进制文件或可执行文件都位 > >![Bash Vs Zsh][12] > -> 使用 `#! /bin/bash` 来标识该脚本是 bash 脚本,并且应该使用 bash 作为脚本的解释器来运行,而不受在系统上正在使用的 shell 的影响。如果你使用 zsh 的特殊语法,你可以通过在脚本的第一行添加 `#! /bin/zs`h 的方式来标识其是 zsh 脚本。 +> 使用 `#! /bin/bash` 来标识该脚本是 bash 脚本,并且应该使用 bash 作为脚本的解释器来运行,而不受在系统上正在使用的 shell 的影响。如果你使用 zsh 的特殊语法,你可以通过在脚本的第一行添加 `#! /bin/zsh` 的方式来标识其是 zsh 脚本。 > > 在 `#!` 和 `/bin/bash` 之间的空格是没有影响的。你也可以使用 `#!/bin/bash` 。 From 17bba84abf7087ff354e255254e7cc56ef496b34 Mon Sep 17 00:00:00 2001 From: left Date: Thu, 11 Feb 2021 01:29:53 +0800 Subject: [PATCH 271/381] docs(tech): translate tmux --- ...es To Manage Multiple Terminal Sessions.md | 287 ++++++++++++++++++ 1 file changed, 287 insertions(+) create mode 100644 translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md diff --git a/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md new file mode 100644 index 0000000000..c86b644830 --- /dev/null +++ b/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md @@ -0,0 +1,287 @@ +[#]: collector: (lujun9972) +[#]: translator: ( chensanle ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tmux Command Examples To Manage Multiple Terminal Sessions) +[#]: via: (https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +基于 Tmux 的多会话终端管理示例 +====== + +![tmux 命令示例][1] + +我们已经了解到如何通过 [**GNU Screen**][2] 进行多会话管理。今天,我们将要领略另一个著名的命令行实用工具 **“Tmux”** 来管理会话。类似 GNU Screen,tmux 是一个帮助我们在单一终端窗口中创建多个会话,同一时间内同时运行多个应用程序或进程的终端复用工具。Tmux 免费、开源并且跨平台,支持 Linux、OpenBSD、FreeBSD、NetBSD 以及 Mac OS X。本文将讨论 Tmux 在 Linux 系统下的高频用法。 + +### Linux 下安装 Tmux + +Tmux 可以在绝大多数的 Linux 官方仓库下获取。 + +在 Arch Linux 或它的变种系统下,执行下列命令来安装: + +``` +$ sudo pacman -S tmux +``` + +Debian、Ubuntu 或 Linux Mint: + +``` +$ sudo apt-get install tmux +``` + +Fedora: +``` +$ sudo dnf install tmux +``` + +RHEL 和 CentOS: +``` +$ sudo yum install tmux +``` + +SUSE/openSUSE: +``` +$ sudo zypper install tmux +``` + +以上,我们已经完成 Tmux 的安装。之后我们继续看看其他的 Tmux 示例。 + +### Tmux 命令示例: 多会话管理 + +Tmux 默认所有命令的前置命令都是 **Ctrl+b**,使用前牢记这个快捷键即可。 +* * * + +**注意** **Screen** 的前置命令都是 **Ctrl+a**. + +* * * + +##### 创建 Tmux 会话 + +在终端中运行如下命令创建 Tmux 会话并附着进入: + +``` +tmux +``` + +抑或, + +``` +tmux new +``` + +Once you are inside the Tmux session, you will see a **green bar at the bottom** as shown in the screenshot below. +一旦进入 Tmux 会话,你将看到一个 **绿色的栏目沉在底部** 如下图所示。 + +![][3] + +创建 Tmux 会话 + +这个绿色的栏目能很容易提示,当前你是否身处 Tmux 会话当中。 + +##### 退出 Tmux 会话 + +退出当前 Tmux 会话仅需要使用 **Ctrl+b** 和 **d**。无需同时触发这两个快捷键,依次按下 “Ctrl+b” 和 “d” 即可。 + +退出当前会话后,你将能看到如下输出。 +``` +[detached (from session 0)] +``` + +##### 创建有名会话 + +如果使用多个会话,你很可能会混淆运行在多个会话中的应用程序。这种情况下,我们需要会话并赋予名称。譬如需要 web 相关服务的会话,就创建一个名称为 **“webserver”**(或任意一个其他名称) 的 Tmux 会话。 + +``` +tmux new -s webserver +``` + +这里是 Tmux 的有名会话 + +![][4] + +拥有自定义名称的 Tmux 会话 + +当你能够看到上述截图,这个 Tmux 会话的名称已经被标注为 **webserver**。如此,你可以在多个会话中,轻易的区分应用程序的所在。 + +退出会话,轻按 **Ctrl+b** 和 **d**。 + +##### 查看 Tmux 会话清单 + +查看 Tmux 会话清单,执行: + +``` +tmux ls +``` + +示例输出: + +![][5] + +如你所见,我们开启了两个 Tmux 会话。 + +##### 创建非附着会话 + +有时候,你可能想要简单创建会话,但是并不想自动切入该会话。 + +创建一个非附着会话,并赋予名称 **“ostechnix”**,运行: + +``` +tmux new -s ostechnix -d +``` + +上述命令将会创建一个名为 “ostechnix” 的会话,但是并不会附着进入。 + +你可以通过使用 “tmux ls” 命令验证: + +![][6] + +##### 进入 Tmux 会话 + +通过如下命令,你可以进入最后一个被创建的会话: + +``` +tmux attach +``` + +Or, + +``` +tmux a +``` + +如果你想进入任意一个指定的有名会话,譬如 “ostechnix”,运行: + +``` +tmux attach -t ostechnix +``` + +或者,简写为: + +``` +tmux a -t ostechnix +``` + +##### 关闭 Tmux 会话 + +当你完成或者不再需要 Tmux 会话,你可以通过如下命令关闭: + +``` +tmux kill-session -t ostechnix +``` + +当身处该会话时,使用 **Ctrl+b** 以及 **x**。点击 “y” 来关闭会话 + +可以通过 “tmux ls” 命令验证。 + +关闭所有 Tmux 服务下的所有会话,运行: + +``` +tmux kill-server +``` + +谨慎!这将终止所有 Tmux 会话,并不会产生任何警告,即便会话存在运行中的任务。 + +如果不存在活跃的 Tmux 会话,将看到如下输出: + +``` +$ tmux ls +no server running on /tmp/tmux-1000/default +``` + +##### 分离 Tmux 窗口 + +分割窗口成多个小窗口,在 Tmux 中,这个叫做 “Tmux panes”(Tmux 窗格)。每个窗格中可以同时运行多个不同的程序。每个窗格可以在不影响其他窗格的前提下可以调整大小、移动位置和控制关闭。我们可以水平、垂直或者二者混合的方式切割屏幕。 + +**水平切割窗格** + +欲水平切割窗格,使用 **Ctrl+b** 和 **“**(半个双引号)。 + +![][7] + +使用组合键进一步切割面板。 + +**垂直切割窗格** + +垂直切割面板,使用 **Ctrl+b** 和 **%** + +![][8] + +垂直切割 Tmux 窗格 + +**水平、垂直混合切割窗格** + +我们也可以同时采用水平和垂直的方案切割窗格。看看如下截图: + +![][9] + +分割 Tmux 窗格 + +受限,我通过 **Ctrl+b “** 水平分割,之后通过 **Ctrl+b** 垂直分割下方的窗格。 + +如你所见,每个窗格下我运行了不同的程序。 + +**切换窗格** + +通过 **Ctrl+b** 和 **方向键(上下左右)** 切换窗格。 + +**发送命令给所有窗格** + +之前的案例中,我们在每个窗格中运行了三个不同命令。其实,也可以发送相同的命令给所有窗格。 + +为此,使用 **Ctrl+b** 然后键入如下命令,之后按压 ENTER: + +``` +:setw synchronize-panes +``` + +现在在任意窗格中键入任何命令。你讲看到相同命令影响了所有窗格。 + +**Swap panes** +**交换窗格** + +使用 **Ctrl+b** 和 **o** 交换窗格。 + +**展示窗格数量** + +使用 **Ctrl+b** 和 **q** 展示窗格数量。 + +**终止窗格** + +要关闭窗格,直接键入 **exit** 并且使用 ENTER 键。或者,按压 **Ctrl+b** 和 **x**。你会看到确认信息。按压 **”y“** 关闭窗格。 + +![][10] + +关闭窗格。 + +这个阶段下,你已经获得了基本的 Tmux 技能来进行多会话管理,更多细节,参阅 man 页面。 + +``` +$ man tmux +``` + +GNU Screen 和 Tmux 工具都能透过 SSH 很好的管理远程服务器。学习 Screen 和 Tmux 命令,像个行家一样,彻底通过这些工具管理远程服务器。 + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/06/Tmux-720x340.png +[2]: https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/ +[3]: https://www.ostechnix.com/wp-content/uploads/2019/06/Tmux-session.png +[4]: https://www.ostechnix.com/wp-content/uploads/2019/06/Named-Tmux-session.png +[5]: https://www.ostechnix.com/wp-content/uploads/2019/06/List-Tmux-sessions.png +[6]: https://www.ostechnix.com/wp-content/uploads/2019/06/Create-detached-sessions.png +[7]: https://www.ostechnix.com/wp-content/uploads/2019/06/Horizontal-split.png +[8]: https://www.ostechnix.com/wp-content/uploads/2019/06/Vertical-split.png +[9]: https://www.ostechnix.com/wp-content/uploads/2019/06/Split-Panes.png +[10]: https://www.ostechnix.com/wp-content/uploads/2019/06/Kill-panes.png From f5c8f5b34ab1fab97731b598cc50b4549f7da4b6 Mon Sep 17 00:00:00 2001 From: left Date: Thu, 11 Feb 2021 01:32:05 +0800 Subject: [PATCH 272/381] a --- ...es To Manage Multiple Terminal Sessions.md | 296 ------------------ 1 file changed, 296 deletions(-) delete mode 100644 sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md diff --git a/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md deleted file mode 100644 index 2db2b57b40..0000000000 --- a/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md +++ /dev/null @@ -1,296 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( chensanle ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Tmux Command Examples To Manage Multiple Terminal Sessions) -[#]: via: (https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Tmux Command Examples To Manage Multiple Terminal Sessions -====== - -![tmux command examples][1] - -We’ve already learned to use [**GNU Screen**][2] to manage multiple Terminal sessions. Today, we will see yet another well-known command-line utility named **“Tmux”** to manage Terminal sessions. Similar to GNU Screen, Tmux is also a Terminal multiplexer that allows us to create number of terminal sessions and run more than one programs or processes at the same time inside a single Terminal window. Tmux is free, open source and cross-platform program that supports Linux, OpenBSD, FreeBSD, NetBSD and Mac OS X. In this guide, we will discuss most-commonly used Tmux commands in Linux. - -### Installing Tmux in Linux - -Tmux is available in the official repositories of most Linux distributions. - -On Arch Linux and its variants, run the following command to install it. - -``` -$ sudo pacman -S tmux -``` - -On Debian, Ubuntu, Linux Mint: - -``` -$ sudo apt-get install tmux -``` - -On Fedora: - -``` -$ sudo dnf install tmux -``` - -On RHEL and CentOS: - -``` -$ sudo yum install tmux -``` - -On SUSE/openSUSE: - -``` -$ sudo zypper install tmux -``` - -Well, we have just installed Tmux. Let us go ahead and see some examples to learn how to use Tmux. - -### Tmux Command Examples To Manage Multiple Terminal Sessions - -The default prefix shortcut to all commands in Tmux is **Ctrl+b**. Just remember this keyboard shortcut when using Tmux. - -* * * - -**Note:** The default prefix to all **Screen** commands is **Ctrl+a**. - -* * * - -##### Creating Tmux sessions - -To create a new Tmux session and attach to it, run the following command from the Terminal: - -``` -tmux -``` - -Or, - -``` -tmux new -``` - -Once you are inside the Tmux session, you will see a **green bar at the bottom** as shown in the screenshot below. - -![][3] - -New Tmux session - -It is very handy to verify whether you’re inside a Tmux session or not. - -##### Detaching from Tmux sessions - -To detach from a current Tmux session, just press **Ctrl+b** and **d**. You don’t need to press this both Keyboard shortcut at a time. First press “Ctrl+b” and then press “d”. - -Once you’re detached from a session, you will see an output something like below. - -``` -[detached (from session 0)] -``` - -##### Creating named sessions - -If you use multiple sessions, you might get confused which programs are running on which sessions. In such cases, you can just create named sessions. For example if you wanted to perform some activities related to web server in a session, just create the Tmux session with a custom name, for example **“webserver”** (or any name of your choice). - -``` -tmux new -s webserver -``` - -Here is the new named Tmux session. - -![][4] - -Tmux session with a custom name - -As you can see in the above screenshot, the name of the Tmux session is **webserver**. This way you can easily identify which program is running on which session. - -To detach, simply press **Ctrl+b** and **d**. - -##### List Tmux sessions - -To view the list of open Tmux sessions, run: - -``` -tmux ls -``` - -Sample output: - -![][5] - -List Tmux sessions - -As you can see, I have two open Tmux sessions. - -##### Creating detached sessions - -Sometimes, you might want to simply create a session and don’t want to attach to it automatically. - -To create a new detached session named **“ostechnix”** , run: - -``` -tmux new -s ostechnix -d -``` - -The above command will create a new Tmux session called “ostechnix”, but won’t attach to it. - -You can verify if the session is created using “tmux ls” command: - -![][6] - -Create detached Tmux sessions - -##### Attaching to Tmux sessions - -You can attach to the last created session by running this command: - -``` -tmux attach -``` - -Or, - -``` -tmux a -``` - -If you want to attach to any specific named session, for example “ostechnix”, run: - -``` -tmux attach -t ostechnix -``` - -Or, shortly: - -``` -tmux a -t ostechnix -``` - -##### Kill Tmux sessions - -When you’re done and no longer required a Tmux session, you can kill it at any time with command: - -``` -tmux kill-session -t ostechnix -``` - -To kill when attached, press **Ctrl+b** and **x**. Hit “y” to kill the session. - -You can verify if the session is closed with “tmux ls” command. - -To Kill Tmux server along with all Tmux sessions, run: - -``` -tmux kill-server -``` - -Be careful! This will terminate all Tmux sessions even if there are any running jobs inside the sessions without any warning. - -When there were no running Tmux sessions, you will see the following output: - -``` -$ tmux ls -no server running on /tmp/tmux-1000/default -``` - -##### Split Tmux Session Windows - -Tmux has an option to split a single Tmux session window into multiple smaller windows called **Tmux panes**. This way we can run different programs on each pane and interact with all of them simultaneously. Each pane can be resized, moved and closed without affecting the other panes. We can split a Tmux window either horizontally or vertically or both at once. - -**Split panes horizontally** - -To split a pane horizontally, press **Ctrl+b** and **”** (single quotation mark). - -![][7] - -Split Tmux pane horizontally - -Use the same key combination to split the panes further. - -**Split panes vertically** - -To split a pane vertically, press **Ctrl+b** and **%**. - -![][8] - -Split Tmux panes vertically - -**Split panes horizontally and vertically** - -We can also split a pane horizontally and vertically at the same time. Take a look at the following screenshot. - -![][9] - -Split Tmux panes - -First, I did a horizontal split by pressing **Ctrl+b “** and then split the lower pane vertically by pressing **Ctrl+b %**. - -As you see in the above screenshot, I am running three different programs on each pane. - -**Switch between panes** - -To switch between panes, press **Ctrl+b** and **Arrow keys (Left, Right, Up, Down)**. - -**Send commands to all panes** - -In the previous example, we run three different commands on each pane. However, it is also possible to run send the same commands to all panes at once. - -To do so, press **Ctrl+b** and type the following command and hit ENTER: - -``` -:setw synchronize-panes -``` - -Now type any command on any pane. You will see that the same command is reflected on all panes. - -**Swap panes** - -To swap panes, press **Ctrl+b** and **o**. - -**Show pane numbers** - -Press **Ctrl+b** and **q** to show pane numbers. - -**Kill panes** - -To kill a pane, simply type **exit** and ENTER key. Alternatively, press **Ctrl+b** and **x**. You will see a confirmation message. Just press **“y”** to close the pane. - -![][10] - -Kill Tmux panes - -At this stage, you will get a basic idea of Tmux and how to use it to manage multiple Terminal sessions. For more details, refer man pages. - -``` -$ man tmux -``` - -Both GNU Screen and Tmux utilities can be very helpful when managing servers remotely via SSH. Learn Screen and Tmux commands thoroughly to manage your remote servers like a pro. - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/ - -作者:[sk][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.ostechnix.com/author/sk/ -[b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/wp-content/uploads/2019/06/Tmux-720x340.png -[2]: https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/ -[3]: https://www.ostechnix.com/wp-content/uploads/2019/06/Tmux-session.png -[4]: https://www.ostechnix.com/wp-content/uploads/2019/06/Named-Tmux-session.png -[5]: https://www.ostechnix.com/wp-content/uploads/2019/06/List-Tmux-sessions.png -[6]: https://www.ostechnix.com/wp-content/uploads/2019/06/Create-detached-sessions.png -[7]: https://www.ostechnix.com/wp-content/uploads/2019/06/Horizontal-split.png -[8]: https://www.ostechnix.com/wp-content/uploads/2019/06/Vertical-split.png -[9]: https://www.ostechnix.com/wp-content/uploads/2019/06/Split-Panes.png -[10]: https://www.ostechnix.com/wp-content/uploads/2019/06/Kill-panes.png From 0eea524592b52f8bec30651d6e2a6473480cfd75 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 11 Feb 2021 05:04:35 +0800 Subject: [PATCH 273/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210210=20?= =?UTF-8?q?Manage=20your=20budget=20on=20Linux=20with=20this=20open=20sour?= =?UTF-8?q?ce=20finance=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210210 Manage your budget on Linux with this open source finance tool.md --- ...inux with this open source finance tool.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20210210 Manage your budget on Linux with this open source finance tool.md diff --git a/sources/tech/20210210 Manage your budget on Linux with this open source finance tool.md b/sources/tech/20210210 Manage your budget on Linux with this open source finance tool.md new file mode 100644 index 0000000000..d671e6cbf2 --- /dev/null +++ b/sources/tech/20210210 Manage your budget on Linux with this open source finance tool.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage your budget on Linux with this open source finance tool) +[#]: via: (https://opensource.com/article/21/2/linux-skrooge) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Manage your budget on Linux with this open source finance tool +====== +Make managing your finances easier with Skrooge, an open source +budgeting tool. +![2 cents penny money currency][1] + +In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. This article is about personal financial management. + +Personal finances can be difficult to manage. It can be frustrating and even scary when you don't have enough money to get by without financial assistance, and it can be surprisingly overwhelming when you do have the money you need but no clear notion of where it all goes each month. To make matters worse, we're often told to "make a budget" as if declaring the amount of money you can spend each month will somehow manifest the money you need. The bottom line is that making a budget is hard, and not meeting your financial goals is discouraging. But it's still important, and Linux has several tools that can help make the task manageable. + +### Money management + +As with anything else in life, we all have our own ways of keeping track of our money. I used to take a simple and direct approach: My paycheck was deposited into an account, and I'd withdraw some percentage in cash. Once the cash was gone from my wallet, I had to wait until the next payday to spend anything. It only took one day of missing out on lunch to learn that I had to take my goals seriously, and I adjusted my spending behavior accordingly. For the simple lifestyle I had at the time, it was an effective means of keeping myself honest with my income, but it didn't translate well to online business transactions, long-term utility contracts, investments, and so on. + +As I continue to refine the way I track my finances, I've learned that personal accounting is always an evolving process. We each have unique financial circumstances, which inform what kind of solution we can or should use to track our income and debt. If you're out of work, then your budgeting goal is likely to spend as little as possible. If you're working but paying off a student loan, then your goal probably favors sending money to the bank. And if you're working but planning for retirement, then you're probably trying to save as much as you can. + +The thing to remember about a budget is that it's meant to compare your financial reality with your financial _goals_. You can't avoid some expenses, but after those, you get to set your own priorities. If you don't hit your goals, you can adjust your own behavior or rewrite your goals so that they better reflect reality. Adapting your financial plan doesn't mean you've failed. It just means that your initial projection wasn't accurate. During hard times, you may not be able to hit any budget goals, but if you keep up with your budget, you'll learn a lot about what it takes financially to maintain your current lifestyle (whatever it may be). Over time, you can learn to adjust settings you may never have realized were available to you. For instance, people are moving to rural towns for the lower cost of living now that remote work is a widely accepted option. It's pretty stunning to see how such a lifestyle shift can alter your budget reports. + +The point is that budgeting is an often undervalued activity, and in no small part because it's daunting. It's important to realize that you can budget, no matter your level of expertise or interest in finances. Whether you [just use a LibreOffice spreadsheet][2], or try a dedicated financial application, you can set goals, track your own behavior, and learn a lot of valuable lessons that could eventually pay dividends. + +### Open source accounting + +There are several dedicated [personal finance applications for Linux][3], including [HomeBank][4], [Money Manager EX][5], [GNUCash][6], [KMyMoney][7], and [Skrooge][8]. All of these applications are essentially ledgers, a place you can retreat to at the end of each month (or whenever you look at your accounts), import data from your bank, and review how your expenditures align with whatever budget you've set for yourself. + +![Skrooge interface with financial data displayed][9] + +Skrooge + +I use Skrooge as my personal budget tracker. It's an easy application to set up, even with multiple bank accounts. Skrooge, as with most open source finance apps, can import multiple file formats, so my workflow goes something like this: + + 1. Log in to my banks. + 2. Export the month's bank statement as QIF files. + 3. Open Skrooge. + 4. Import the QIF files. Each gets assigned to their appropriate accounts automatically. + 5. Review my expenditures compared to the budget goals I've set for myself. If I've gone over, then I dock next month's goals (so that I'll ideally spend less to make up the difference). If I've come in under my goal, then I move the excess to December's budget (so I'll have more to spend at the end of the year). + + + +I only track a subset of the household budget in Skrooge. Skrooge makes that process easy through a dynamic database that allows me to categorize multiple transactions at once with custom tags. This makes it easy for me to extract my personal expenditures from general household and utility expenses, and I can leverage these categories when reviewing the autogenerated reports Skrooge provides. + +![Skrooge budget pie chart][10] + +Skrooge budget pie chart + +Most importantly, the popular Linux financial apps allow me to manage my budget the way that works best for me. For instance, my partner prefers to use a LibreOffice spreadsheet, but with very little effort, I can extract a CSV file from the household budget, import it into Skrooge, and use an updated set of data. There's no lock-in, no incompatibility. The system is flexible and agile, allowing us to adapt our budget and our method of tracking expenses as we learn more about effective budgeting and about what life has in store. + +### Open choice + +Money markets worldwide differ, and the way we each interact with them also defines what tools we can use. Ultimately, your choice of what to use for your finances is a decision you must make based on your own requirements. And one thing open source does particularly well is provide its users the freedom of choice. + +When setting my own financial goals, I appreciate that I can use whatever application fits in best with my style of personal computing. I get to retain control of how I process the data in my life, even when it's data I don't necessarily enjoy having to process. Linux and its amazing set of applications make it just a little less of a chore. + +Try some financial apps on Linux and see if you can inspire yourself to set some goals and save money! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-skrooge + +作者:[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/Medical%20Costs%20Transparency_1.jpg?itok=CkZ_J88m (2 cents penny money currency) +[2]: https://opensource.com/article/20/3/libreoffice-templates +[3]: https://opensource.com/life/17/10/personal-finance-tools-linux +[4]: http://homebank.free.fr/en/index.php +[5]: https://www.moneymanagerex.org/download +[6]: https://opensource.com/article/20/2/gnucash +[7]: https://kmymoney.org/download.html +[8]: https://apps.kde.org/en/skrooge +[9]: https://opensource.com/sites/default/files/skrooge.jpg +[10]: https://opensource.com/sites/default/files/skrooge-pie_0.jpg From 15b228f50116268753a0c28f5acd308a5419c389 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 11 Feb 2021 05:04:56 +0800 Subject: [PATCH 274/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210210=20?= =?UTF-8?q?Configure=20multi-tenancy=20with=20Kubernetes=20namespaces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md --- ...ulti-tenancy with Kubernetes namespaces.md | 368 ++++++++++++++++++ 1 file changed, 368 insertions(+) create mode 100644 sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md diff --git a/sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md b/sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md new file mode 100644 index 0000000000..5ced955007 --- /dev/null +++ b/sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md @@ -0,0 +1,368 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Configure multi-tenancy with Kubernetes namespaces) +[#]: via: (https://opensource.com/article/21/2/kubernetes-namespaces) +[#]: author: (Mike Calizo https://opensource.com/users/mcalizo) + +Configure multi-tenancy with Kubernetes namespaces +====== +Namespaces provide basic building blocks of access control for +applications, users, or groups of users. +![shapes of people symbols][1] + +Most enterprises want a multi-tenancy platform to run their cloud-native applications because it helps manage resources, costs, and operational efficiency and control [cloud waste][2]. + +[Kubernetes][3] is the leading open source platform for managing containerized workloads and services. It gained this reputation because of its flexibility in allowing operators and developers to establish automation with declarative configuration. But there is a catch: Because Kubernetes grows rapidly, the old problem of velocity becomes an issue. The bigger your adoption, the more issues and resource waste you discover. + +### An example of scale + +Imagine your company started small with its Kubernetes adoption by deploying a variety of internal applications. It has multiple project streams running with multiple developers dedicated to each project stream. + +In a scenario like this, you need to make sure your cluster administrator has full control over the cluster to manage its resources and implement cluster policy and security standards. In a way, the admin is herding the cluster's users to use best practices. A namespace is very useful in this instance because it enables different teams to share a single cluster where computing resources are subdivided into multiple teams. + +While namespaces are your first step to Kubernetes multi-tenancy, they are not good enough on their own. There are a number of Kubernetes primitives you need to consider so that you can administer your cluster properly and put it into a production-ready implementation. + +The Kubernetes primitives for multi-tenancy are: + + 1. **RBAC:** Role-based access control for Kubernetes + 2. **Network policies:** To isolate traffic between namespaces + 3. **Resource quotas:** To control fair access to cluster resources + + + +This article explores how to use Kubernetes namespaces and some basic RBAC configurations to partition a single Kubernetes cluster and take advantage of this built-in Kubernetes tooling. + +### What is a Kubernetes namespace? + +Before digging into how to use namespaces to prepare your Kubernetes cluster to become multi-tenant-ready, you need to know what namespaces are. + +A [namespace][4] is a Kubernetes object that partitions a Kubernetes cluster into multiple virtual clusters. This is done with the aid of [Kubernetes names and IDs][5]. Namespaces use the Kubernetes name object, which means that each object inside a namespace gets a unique name and ID across the cluster to allow virtual partitioning. + +### How namespaces help in multi-tenancy + +Namespaces are one of the Kubernetes primitives you can use to partition your cluster into multiple virtual clusters to allow multi-tenancy. Each namespace is isolated from every other user's, team's, or application's namespace. This isolation is essential in multi-tenancy so that updates and changes in applications, users, and teams are contained within the specific namespace. (Note that namespace does not provide network segmentation.) + +Before moving ahead, verify the default namespace in a working Kubernetes cluster: + + +``` +[root@master ~]# kubectl get namespace +NAME              STATUS   AGE +default           Active   3d +kube-node-lease   Active   3d +kube-public       Active   3d +kube-system       Active   3d +``` + +Then create your first namespace, called **test**: + + +``` +[root@master ~]# kubectl create namespace test +namespace/test created +``` + +Verify the newly created namespace: + + +``` +[root@master ~]# kubectl get namespace +NAME              STATUS   AGE +default           Active   3d +kube-node-lease   Active   3d +kube-public       Active   3d +kube-system       Active   3d +test              Active   10s +[root@master ~]# +``` + +Describe the newly created namespace: + + +``` +[root@master ~]# kubectl describe namespace test +Name:         test +Labels:       <none> +Annotations:  <none> +Status:       Active +No resource quota. +No LimitRange resource. +``` + +To delete a namespace: + + +``` +[root@master ~]# kubectl delete namespace test +namespace "test" deleted +``` + +Your new namespace is active, but it doesn't have any labels, annotations, or quota-limit ranges defined. However, now that you know how to create and describe and delete a namespace, I'll show how you can use a namespace to virtually partition a Kubernetes cluster. + +### Partitioning clusters using namespace and RBAC + +Deploy the following simple application to learn how to partition a cluster using namespace and isolate an application and its related objects from "other" users. + +First, verify the namespace you will use. For simplicity, use the **test** namespace you created above: + + +``` +[root@master ~]# kubectl get namespaces +NAME              STATUS   AGE +default           Active   3d +kube-node-lease   Active   3d +kube-public       Active   3d +kube-system       Active   3d +test              Active   3h +``` + +Then deploy a simple application called **test-app** inside the test namespace by using the following configuration: + + +``` +apiVersion: v1 +kind: Pod +metadata: +  name: test-app                 ⇒ name of the application +  namespace: test                ⇒ the namespace where the app runs +  labels: +     app: test-app                      ⇒ labels for the app +spec: +  containers: +  - name: test-app +    image: nginx:1.14.2         ⇒ the image we used for the app. +    ports: +    - containerPort: 80 +``` + +Deploy it: + + +``` +$ kubectl create -f test-app.yaml +    pod/test-app created +``` + +Then verify the application pod was created: + + +``` +$ kubectl get pods -n test +  NAME       READY   STATUS    RESTARTS   AGE +  test-app   1/1     Running   0          18s +``` + +Now that the running application is inside the **test** namespace, test a use case where: + + * **auth-user** can edit and view all the objects inside the test namespace + * **un-auth-user** can only view the namespace + + + +I pre-created the users for you to test. If you want to know how I created the users inside Kubernetes, view the commands [here][6]. + + +``` +$ kubectl config view -o jsonpath='{.users[*].name}' +  auth-user +  kubernetes-admin +  un-auth-user +``` + +With this set up, create a Kubernetes [Role and RoleBindings][7] to isolate the target namespace **test** to allow **auth-user** to view and edit objects inside the namespace and not allow **un-auth-user** to access or view the objects inside the **test** namespace. + +Start by creating a ClusterRole and a Role. These objects are a list of verbs (action) permitted on specific resources and namespaces. + +Create a ClusterRole: + + +``` +$ cat clusterrole.yaml +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRole +metadata: +  name: list-deployments +  namespace: test +rules: +  - apiGroups: [ apps ] +    resources: [ deployments ] +    verbs: [ get, list ] +``` + +Create a Role: + + +``` +$ cat role.yaml +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: Role +metadata: +  name: list-deployments +  namespace: test +rules: +  - apiGroups: [ apps ] +    resources: [ deployments ] +    verbs: [ get, list ] +``` + +Apply the Role: + + +``` +$ kubectl create -f role.yaml +roles.rbac.authorization.k8s.io "list-deployments" created +``` + +Use the same command to create a ClusterRole: + + +``` +$ kubectl create -f clusterrole.yaml + +$ kubectl get role -n test +  NAME               CREATED AT +  list-deployments   2021-01-18T00:54:00Z +``` + +Verify the Roles: + + +``` +$ kubectl describe roles -n test +  Name:         list-deployments +  Labels:       <none> +  Annotations:  <none> +  PolicyRule: +    Resources         Non-Resource URLs  Resource Names  Verbs +    ---------         -----------------  --------------  ----- +    deployments.apps  []                 []              [get list] +``` + +Remember that you must create RoleBindings by namespace, not by user. This means you need to create two role bindings for user **auth-user**. + +Here are the sample RoleBinding YAML files to permit **auth-user** to edit and view. + +**To edit:** + + +``` +$ cat rolebinding-auth-edit.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: +  name: auth-user-edit +  namespace: test +subjects: +\- kind: User +  name: auth-user +  apiGroup: rbac.authorization.k8s.io +roleRef: +  kind: ClusterRole +  name: edit +  apiGroup: rbac.authorization.k8s.io +``` + +**To view:** + + +``` +$ cat rolebinding-auth-view.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: +  name: auth-user-view +  namespace: test +subjects: +\- kind: User +  name: auth-user +  apiGroup: rbac.authorization.k8s.io +roleRef: +  kind: ClusterRole +  name: view +  apiGroup: rbac.authorization.k8s.io +``` + +Create these YAML files: + + +``` +$ kubectl create rolebinding-auth-view.yaml +$ kubectl create rolebinding-auth-edit.yaml +``` + +Verify if the RoleBindings were successfully created: + + +``` +$ kubectl get rolebindings -n test +NAME             ROLE               AGE +auth-user-edit   ClusterRole/edit   48m +auth-user-view   ClusterRole/view   47m +``` + +With the requirements set up, test the cluster partitioning: + + +``` +[root@master]$ sudo su un-auth-user +[un-auth-user@master ~]$ kubect get pods -n test +[un-auth-user@master ~]$ kubectl get pods -n test +Error from server (Forbidden): pods is forbidden: User "un-auth-user" cannot list resource "pods" in API group "" in the namespace "test" +``` + +Log in as **auth-user**: + + +``` +[root@master ]# sudo su auth-user +[auth-user@master auth-user]$ kubectl get pods -n test +NAME       READY   STATUS    RESTARTS   AGE +test-app   1/1     Running   0          3h8m +[auth-user@master un-auth-user]$ + +[auth-user@master auth-user]$ kubectl edit pods/test-app -n test +Edit cancelled, no changes made. +``` + +You can view and edit the objects inside the **test** namespace. How about viewing the cluster nodes? + + +``` +[auth-user@master auth-user]$ kubectl get nodes +Error from server (Forbidden): nodes is forbidden: User "auth-user" cannot list resource "nodes" in API group "" at the cluster scope +[auth-user@master auth-user]$ +``` + +You can't because the role bindings for user **auth-user** dictate they have access to view or edit objects only inside the **test** namespace. + +### Enable access control with namespaces + +Namespaces provide basic building blocks of access control using RBAC and isolation for applications, users, or groups of users. But using namespaces alone as your multi-tenancy solution is not enough in an enterprise implementation. It is recommended that you use other Kubernetes multi-tenancy primitives to attain further isolation and implement proper security. + +Namespaces can provide some basic isolation in your Kubernetes cluster; therefore, it is important to consider them upfront, especially when planning a multi-tenant cluster. Namespaces also allow you to logically segregate and assign resources to individual users, teams, or applications. + +By using namespaces, you can increase resource efficiencies by enabling a single cluster to be used for a diverse set of workloads. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/kubernetes-namespaces + +作者:[Mike Calizo][a] +选题:[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/mcalizo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Open%20Pharma.png?itok=GP7zqNZE (shapes of people symbols) +[2]: https://devops.com/the-cloud-is-booming-but-so-is-cloud-waste/ +[3]: https://opensource.com/resources/what-is-kubernetes +[4]: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ +[5]: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/ +[6]: https://www.adaltas.com/en/2019/08/07/users-rbac-kubernetes/ +[7]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ From 2435a8306c80266c1769dac28afe63fd5337d489 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 11 Feb 2021 05:05:15 +0800 Subject: [PATCH 275/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210210=20?= =?UTF-8?q?Draw=20Mandelbrot=20fractals=20with=20GIMP=20scripting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md --- ...Mandelbrot fractals with GIMP scripting.md | 370 ++++++++++++++++++ 1 file changed, 370 insertions(+) create mode 100644 sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md diff --git a/sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md b/sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md new file mode 100644 index 0000000000..d38f3fb54d --- /dev/null +++ b/sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md @@ -0,0 +1,370 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Draw Mandelbrot fractals with GIMP scripting) +[#]: via: (https://opensource.com/article/21/2/gimp-mandelbrot) +[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) + +Draw Mandelbrot fractals with GIMP scripting +====== +Create complex mathematical images with GIMP's Script-Fu language. +![Painting art on a computer screen][1] + +The GNU Image Manipulation Program ([GIMP][2]) is my go-to solution for image editing. Its toolset is very powerful and convenient, except for doing [fractals][3], which is one thing you cannot draw by hand easily. These are fascinating mathematical constructs that have the characteristic of being [self-similar][4]. In other words, if they are magnified in some areas, they will look remarkably similar to the unmagnified picture. Besides being interesting, they also make very pretty pictures! + +![Portion of a Mandelbrot fractal using GIMPs Coldfire palette][5] + +Portion of a Mandelbrot fractal using GIMP's Coldfire palette (Cristiano Fontana, [CC BY-SA 4.0][6]) + +GIMP can be automated with [Script-Fu][7] to do [batch processing of images][8] or create complicated procedures that are not practical to do by hand; drawing fractals falls in the latter category. This tutorial will show how to draw a representation of the [Mandelbrot fractal][9] using GIMP and Script-Fu. + +![Mandelbrot set drawn using GIMP's Firecode palette][10] + +Portion of a Mandelbrot fractal using GIMP's Firecode palette. (Cristiano Fontana, [CC BY-SA 4.0][6]) + +![Rotated and magnified portion of the Mandelbrot set using Firecode.][11] + +Rotated and magnified portion of the Mandelbrot set using the Firecode palette. (Cristiano Fontana, [CC BY-SA 4.0][6]) + +In this tutorial, you will write a script that creates a layer in an image and draws a representation of the Mandelbrot set with a colored environment around it. + +### What is the Mandelbrot set? + +Do not panic! I will not go into too much detail here. For the more math-savvy, the Mandelbrot set is defined as the set of [complex numbers][12] _a_ for which the succession + +_zn+1 = zn2 + a_ + +does not diverge when starting from _z₀ = 0_. + +In reality, the Mandelbrot set is the fancy-looking black blob in the pictures; the nice-looking colors are outside the set. They represent how many iterations are required for the magnitude of the succession of numbers to pass a threshold value. In other words, the color scale shows how many steps are required for the succession to pass an upper-limit value. + +### GIMP's Script-Fu + +[Script-Fu][7] is the scripting language built into GIMP. It is an implementation of the [Scheme programming language][13]. + +If you want to get more acquainted with Scheme, GIMP's documentation offers an [in-depth tutorial][14]. I also wrote an article about [batch processing images][8] using Script-Fu. Finally, the Help menu offers a Procedure Browser with very extensive documentation with all of Script-Fu's functions described in detail. + +![GIMP Procedure Browser][15] + +(Cristiano Fontana, [CC BY-SA 4.0][6]) + +Scheme is a Lisp-like language, so a major characteristic is that it uses a [prefix notation][16] and a [lot of parentheses][17]. Functions and operators are applied to a list of operands by prefixing them: + + +``` +(function-name operand operand ...) + +(+ 2 3) +↳ Returns 5 + +(list 1 2 3 5) +↳ Returns a list containing 1, 2, 3, and 5 +``` + +### Write the script + +You can write your first script and save it to the **Scripts** folder found in the preferences window under **Folders → Scripts**. Mine is at `$HOME/.config/GIMP/2.10/scripts`. Write a file called `mandelbrot.scm` with: + + +``` +; Complex numbers implementation +(define (make-rectangular x y) (cons x y)) +(define (real-part z) (car z)) +(define (imag-part z) (cdr z)) + +(define (magnitude z) +  (let ((x (real-part z)) +        (y (imag-part z))) +    (sqrt (+ (* x x) (* y y))))) + +(define (add-c a b) +  (make-rectangular (+ (real-part a) (real-part b)) +                    (+ (imag-part a) (imag-part b)))) + +(define (mul-c a b) +  (let ((ax (real-part a)) +        (ay (imag-part a)) +        (bx (real-part b)) +        (by (imag-part b))) +    (make-rectangular (- (* ax bx) (* ay by)) +                      (+ (* ax by) (* ay bx))))) + +; Definition of the function creating the layer and drawing the fractal +(define (script-fu-mandelbrot image palette-name threshold domain-width domain-height offset-x offset-y) +  (define num-colors (car (gimp-palette-get-info palette-name))) +  (define colors (cadr (gimp-palette-get-colors palette-name))) + +  (define width (car (gimp-image-width image))) +  (define height (car (gimp-image-height image))) + +  (define new-layer (car (gimp-layer-new image +                                         width height +                                         RGB-IMAGE +                                         "Mandelbrot layer" +                                         100 +                                         LAYER-MODE-NORMAL))) + +  (gimp-image-add-layer image new-layer 0) +  (define drawable new-layer) +  (define bytes-per-pixel (car (gimp-drawable-bpp drawable))) + +  ; Fractal drawing section. +  ; Code from: +  (define (iterations a z i) +    (let ((z′ (add-c (mul-c z z) a))) +       (if (or (= i num-colors) (> (magnitude z′) threshold)) +          i +          (iterations a z′ (+ i 1))))) + +  (define (iter->color i) +    (if (>= i num-colors) +        (list->vector '(0 0 0)) +        (list->vector (vector-ref colors i)))) + +  (define z0 (make-rectangular 0 0)) + +  (define (loop x end-x y end-y) +    (let* ((real-x (- (* domain-width (/ x width)) offset-x)) +           (real-y (- (* domain-height (/ y height)) offset-y)) +           (a (make-rectangular real-x real-y)) +           (i (iterations a z0 0)) +           (color (iter->color i))) +      (cond ((and (< x end-x) (< y end-y)) (gimp-drawable-set-pixel drawable x y bytes-per-pixel color) +                                           (loop (+ x 1) end-x y end-y)) +            ((and (>= x end-x) (< y end-y)) (gimp-progress-update (/ y end-y)) +                                            (loop 0 end-x (+ y 1) end-y))))) +  (loop 0 width 0 height) + +  ; These functions refresh the GIMP UI, otherwise the modified pixels would be evident +  (gimp-drawable-update drawable 0 0 width height) +  (gimp-displays-flush) +) + +(script-fu-register +  "script-fu-mandelbrot"          ; Function name +  "Create a Mandelbrot layer"     ; Menu label +                                  ; Description +  "Draws a Mandelbrot fractal on a new layer. For the coloring it uses the palette identified by the name provided as a string. The image boundaries are defined by its domain width and height, which correspond to the image width and height respectively. Finally the image is offset in order to center the desired feature." +  "Cristiano Fontana"             ; Author +  "2021, C.Fontana. GNU GPL v. 3" ; Copyright +  "27th Jan. 2021"                ; Creation date +  "RGB"                           ; Image type that the script works on +  ;Parameter    Displayed            Default +  ;type         label                values +  SF-IMAGE      "Image"              0 +  SF-STRING     "Color palette name" "Firecode" +  SF-ADJUSTMENT "Threshold value"    '(4 0 10 0.01 0.1 2 0) +  SF-ADJUSTMENT "Domain width"       '(3 0 10 0.1 1 4 0) +  SF-ADJUSTMENT "Domain height"      '(3 0 10 0.1 1 4 0) +  SF-ADJUSTMENT "X offset"           '(2.25 -20 20 0.1 1 4 0) +  SF-ADJUSTMENT "Y offset"           '(1.50 -20 20 0.1 1 4 0) +) +(script-fu-menu-register "script-fu-mandelbrot" "<Image>/Layer/") +``` + +I will go through the script to show you what it does. + +### Get ready to draw the fractal + +Since this image is all about complex numbers, I wrote a quick and dirty implementation of complex numbers in Script-Fu. I defined the complex numbers as [pairs][18] of real numbers. Then I added the few functions needed for the script. I used [Racket's documentation][19] as inspiration for function names and roles: + + +``` +(define (make-rectangular x y) (cons x y)) +(define (real-part z) (car z)) +(define (imag-part z) (cdr z)) + +(define (magnitude z) +  (let ((x (real-part z)) +        (y (imag-part z))) +    (sqrt (+ (* x x) (* y y))))) + +(define (add-c a b) +  (make-rectangular (+ (real-part a) (real-part b)) +                    (+ (imag-part a) (imag-part b)))) + +(define (mul-c a b) +  (let ((ax (real-part a)) +        (ay (imag-part a)) +        (bx (real-part b)) +        (by (imag-part b))) +    (make-rectangular (- (* ax bx) (* ay by)) +                      (+ (* ax by) (* ay bx))))) +``` + +### Draw the fractal + +The new function is called `script-fu-mandelbrot`. The best practice for writing a new function is to call it `script-fu-something` so that it can be identified in the Procedure Browser easily. The function requires a few parameters: an `image` to which it will add a layer with the fractal, the `palette-name` identifying the color palette to be used, the `threshold` value to stop the iteration, the `domain-width` and `domain-height` that identify the image boundaries, and the `offset-x` and `offset-y` to center the image to the desired feature. The script also needs some other parameters that it can deduce from the GIMP interface: + + +``` +(define (script-fu-mandelbrot image palette-name threshold domain-width domain-height offset-x offset-y) +  (define num-colors (car (gimp-palette-get-info palette-name))) +  (define colors (cadr (gimp-palette-get-colors palette-name))) + +  (define width (car (gimp-image-width image))) +  (define height (car (gimp-image-height image))) + +  ... +``` + +Then it creates a new layer and identifies it as the script's `drawable`. A "drawable" is the element you want to draw on: + + +``` +(define new-layer (car (gimp-layer-new image +                                       width height +                                       RGB-IMAGE +                                       "Mandelbrot layer" +                                       100 +                                       LAYER-MODE-NORMAL))) + +(gimp-image-add-layer image new-layer 0) +(define drawable new-layer) +(define bytes-per-pixel (car (gimp-drawable-bpp drawable))) +``` + +For the code determining the pixels' color, I used the [Racket][20] example on the [Rosetta Code][21] website. It is not the most optimized algorithm, but it is simple to understand. Even a non-mathematician like me can understand it. The `iterations` function determines how many steps the succession requires to pass the threshold value. To cap the iterations, I am using the number of colors in the palette. In other words, if the threshold is too high or the succession does not grow, the calculation stops at the `num-colors` value. The `iter->color` function transforms the number of iterations into a color using the provided palette. If the iteration number is equal to `num-colors`, it uses black because this means that the succession is probably bound and that pixel is in the Mandelbrot set: + + +``` +; Fractal drawing section. +; Code from: +(define (iterations a z i) +  (let ((z′ (add-c (mul-c z z) a))) +     (if (or (= i num-colors) (> (magnitude z′) threshold)) +        i +        (iterations a z′ (+ i 1))))) + +(define (iter->color i) +  (if (>= i num-colors) +      (list->vector '(0 0 0)) +      (list->vector (vector-ref colors i)))) +``` + +Because I have the feeling that Scheme users do not like to use loops, I implemented the function looping over the pixels as a recursive function. The `loop` function reads the starting coordinates and their upper boundaries. At each pixel, it defines some temporary variables with the `let*` function: `real-x` and `real-y` are the real coordinates of the pixel in the complex plane, according to the parameters; the `a` variable is the starting point for the succession; the `i` is the number of iterations; and finally `color` is the pixel color. Each pixel is colored with the `gimp-drawable-set-pixel` function that is an internal GIMP procedure. The peculiarity is that it is not undoable, and it does not trigger the image to refresh. Therefore, the image will not be updated during the operation. To play nice with the user, at the end of each row of pixels, it calls the `gimp-progress-update` function, which updates a progress bar in the user interface: + + +``` +(define z0 (make-rectangular 0 0)) + +(define (loop x end-x y end-y) +  (let* ((real-x (- (* domain-width (/ x width)) offset-x)) +         (real-y (- (* domain-height (/ y height)) offset-y)) +         (a (make-rectangular real-x real-y)) +         (i (iterations a z0 0)) +         (color (iter->color i))) +    (cond ((and (< x end-x) (< y end-y)) (gimp-drawable-set-pixel drawable x y bytes-per-pixel color) +                                         (loop (+ x 1) end-x y end-y)) +          ((and (>= x end-x) (< y end-y)) (gimp-progress-update (/ y end-y)) +                                          (loop 0 end-x (+ y 1) end-y))))) +(loop 0 width 0 height) +``` + +At the calculation's end, the function needs to inform GIMP that it modified the `drawable`, and it should refresh the interface because the image is not "automagically" updated during the script's execution: + + +``` +(gimp-drawable-update drawable 0 0 width height) +(gimp-displays-flush) +``` + +### Interact with the user interface + +To use the `script-fu-mandelbrot` function in the graphical user interface (GUI), the script needs to inform GIMP. The `script-fu-register` function informs GIMP about the parameters required by the script and provides some documentation: + + +``` +(script-fu-register +  "script-fu-mandelbrot"          ; Function name +  "Create a Mandelbrot layer"     ; Menu label +                                  ; Description +  "Draws a Mandelbrot fractal on a new layer. For the coloring it uses the palette identified by the name provided as a string. The image boundaries are defined by its domain width and height, which correspond to the image width and height respectively. Finally the image is offset in order to center the desired feature." +  "Cristiano Fontana"             ; Author +  "2021, C.Fontana. GNU GPL v. 3" ; Copyright +  "27th Jan. 2021"                ; Creation date +  "RGB"                           ; Image type that the script works on +  ;Parameter    Displayed            Default +  ;type         label                values +  SF-IMAGE      "Image"              0 +  SF-STRING     "Color palette name" "Firecode" +  SF-ADJUSTMENT "Threshold value"    '(4 0 10 0.01 0.1 2 0) +  SF-ADJUSTMENT "Domain width"       '(3 0 10 0.1 1 4 0) +  SF-ADJUSTMENT "Domain height"      '(3 0 10 0.1 1 4 0) +  SF-ADJUSTMENT "X offset"           '(2.25 -20 20 0.1 1 4 0) +  SF-ADJUSTMENT "Y offset"           '(1.50 -20 20 0.1 1 4 0) +) +``` + +Then the script tells GIMP to put the new function in the Layer menu with the label "Create a Mandelbrot layer": + + +``` +`(script-fu-menu-register "script-fu-mandelbrot" "/Layer/")` +``` + +Having registered the function, you can visualize it in the Procedure Browser. + +![script-fu-mandelbrot function][22] + +(Cristiano Fontana, [CC BY-SA 4.0][6]) + +### Run the script + +Now that the function is ready and registered, you can draw the Mandelbrot fractal! First, create a square image and run the script from the Layers menu. + +![script running][23] + +(Cristiano Fontana, [CC BY-SA 4.0][6]) + +The default values are a good starting set to obtain the following image. The first time you run the script, create a very small image (e.g., 60x60 pixels) because this implementation is slow! It took several hours for my computer to create the following image in full 1920x1920 pixels. As I mentioned earlier, this is not the most optimized algorithm; rather, it was the easiest for me to understand. + +![Mandelbrot set drawn using GIMP's Firecode palette][10] + +Portion of a Mandelbrot fractal using GIMP's Firecode palette. (Cristiano Fontana, [CC BY-SA 4.0][6]) + +### Learn more + +This tutorial showed how to use GIMP's built-in scripting features to draw an image created with an algorithm. These images show GIMP's powerful set of tools that can be used for artistic applications and mathematical images. + +If you want to move forward, I suggest you look at the official documentation and its [tutorial][14]. As an exercise, try modifying this script to draw a [Julia set][24], and please share the resulting image in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/gimp-mandelbrot + +作者:[Cristiano L. Fontana][a] +选题:[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/cristianofontana +[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://www.gimp.org/ +[3]: https://en.wikipedia.org/wiki/Fractal +[4]: https://en.wikipedia.org/wiki/Self-similarity +[5]: https://opensource.com/sites/default/files/uploads/mandelbrot_portion.png (Portion of a Mandelbrot fractal using GIMPs Coldfire palette) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://docs.gimp.org/en/gimp-concepts-script-fu.html +[8]: https://opensource.com/article/21/1/gimp-scripting +[9]: https://en.wikipedia.org/wiki/Mandelbrot_set +[10]: https://opensource.com/sites/default/files/uploads/mandelbrot.png (Mandelbrot set drawn using GIMP's Firecode palette) +[11]: https://opensource.com/sites/default/files/uploads/mandelbrot_portion2.png (Rotated and magnified portion of the Mandelbrot set using Firecode.) +[12]: https://en.wikipedia.org/wiki/Complex_number +[13]: https://en.wikipedia.org/wiki/Scheme_(programming_language) +[14]: https://docs.gimp.org/en/gimp-using-script-fu-tutorial.html +[15]: https://opensource.com/sites/default/files/uploads/procedure_browser_0.png (GIMP Procedure Browser) +[16]: https://en.wikipedia.org/wiki/Polish_notation +[17]: https://xkcd.com/297/ +[18]: https://www.gnu.org/software/guile/manual/html_node/Pairs.html +[19]: https://docs.racket-lang.org/reference/generic-numbers.html?q=make-rectangular#%28part._.Complex_.Numbers%29 +[20]: https://racket-lang.org/ +[21]: https://rosettacode.org/wiki/Mandelbrot_set#Racket +[22]: https://opensource.com/sites/default/files/uploads/mandelbrot_documentation.png (script-fu-mandelbrot function) +[23]: https://opensource.com/sites/default/files/uploads/script_working.png (script running) +[24]: https://en.wikipedia.org/wiki/Julia_set From 47db2eccaf7a95d8f8b421b4bf891b6cf5063a8e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 11 Feb 2021 10:11:46 +0800 Subject: [PATCH 276/381] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chensanle 感谢你,完成了第一篇翻译贡献! --- ...es To Manage Multiple Terminal Sessions.md | 148 ++++++++++-------- 1 file changed, 83 insertions(+), 65 deletions(-) diff --git a/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md index c86b644830..bafdf14ad6 100644 --- a/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md +++ b/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) -[#]: translator: ( chensanle ) -[#]: reviewer: ( ) +[#]: translator: (chensanle) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Tmux Command Examples To Manage Multiple Terminal Sessions) @@ -10,11 +10,11 @@ 基于 Tmux 的多会话终端管理示例 ====== -![tmux 命令示例][1] +![](https://img.linux.net.cn/data/attachment/album/202102/11/101058ffso6wzzw94wm2ng.jpg) -我们已经了解到如何通过 [**GNU Screen**][2] 进行多会话管理。今天,我们将要领略另一个著名的命令行实用工具 **“Tmux”** 来管理会话。类似 GNU Screen,tmux 是一个帮助我们在单一终端窗口中创建多个会话,同一时间内同时运行多个应用程序或进程的终端复用工具。Tmux 免费、开源并且跨平台,支持 Linux、OpenBSD、FreeBSD、NetBSD 以及 Mac OS X。本文将讨论 Tmux 在 Linux 系统下的高频用法。 +我们已经了解到如何通过 [GNU Screen][2] 进行多会话管理。今天,我们将要领略另一个著名的管理会话的命令行实用工具 **Tmux**。类似 GNU Screen,Tmux 是一个帮助我们在单一终端窗口中创建多个会话,同一时间内同时运行多个应用程序或进程的终端复用工具。Tmux 自由、开源并且跨平台,支持 Linux、OpenBSD、FreeBSD、NetBSD 以及 Mac OS X。本文将讨论 Tmux 在 Linux 系统下的高频用法。 -### Linux 下安装 Tmux +### Linux 下安装 tmux Tmux 可以在绝大多数的 Linux 官方仓库下获取。 @@ -24,39 +24,38 @@ Tmux 可以在绝大多数的 Linux 官方仓库下获取。 $ sudo pacman -S tmux ``` -Debian、Ubuntu 或 Linux Mint: +Debian、Ubuntu 或 Linux Mint: ``` $ sudo apt-get install tmux ``` -Fedora: +Fedora: ``` $ sudo dnf install tmux ``` -RHEL 和 CentOS: +RHEL 和 CentOS: + ``` $ sudo yum install tmux ``` SUSE/openSUSE: + ``` $ sudo zypper install tmux ``` -以上,我们已经完成 Tmux 的安装。之后我们继续看看其他的 Tmux 示例。 +以上,我们已经完成 Tmux 的安装。之后我们继续看看一些 Tmux 示例。 ### Tmux 命令示例: 多会话管理 -Tmux 默认所有命令的前置命令都是 **Ctrl+b**,使用前牢记这个快捷键即可。 -* * * +Tmux 默认所有命令的前置命令都是 `Ctrl+b`,使用前牢记这个快捷键即可。 -**注意** **Screen** 的前置命令都是 **Ctrl+a**. +> **注意**:**Screen** 的前置命令都是 `Ctrl+a`. -* * * - -##### 创建 Tmux 会话 +#### 创建 Tmux 会话 在终端中运行如下命令创建 Tmux 会话并附着进入: @@ -70,43 +69,43 @@ tmux tmux new ``` -Once you are inside the Tmux session, you will see a **green bar at the bottom** as shown in the screenshot below. -一旦进入 Tmux 会话,你将看到一个 **绿色的栏目沉在底部** 如下图所示。 +一旦进入 Tmux 会话,你将看到一个 **沉在底部的绿色的边栏**,如下图所示。 ![][3] -创建 Tmux 会话 +*创建 Tmux 会话* -这个绿色的栏目能很容易提示,当前你是否身处 Tmux 会话当中。 +这个绿色的边栏能很容易提示你当前是否身处 Tmux 会话当中。 -##### 退出 Tmux 会话 +#### 退出 Tmux 会话 -退出当前 Tmux 会话仅需要使用 **Ctrl+b** 和 **d**。无需同时触发这两个快捷键,依次按下 “Ctrl+b” 和 “d” 即可。 +退出当前 Tmux 会话仅需要使用 `Ctrl+b` 和 `d`。无需同时触发这两个快捷键,依次按下 `Ctrl+b` 和 `d` 即可。 + +退出当前会话后,你将能看到如下输出: -退出当前会话后,你将能看到如下输出。 ``` [detached (from session 0)] ``` -##### 创建有名会话 +#### 创建有名会话 -如果使用多个会话,你很可能会混淆运行在多个会话中的应用程序。这种情况下,我们需要会话并赋予名称。譬如需要 web 相关服务的会话,就创建一个名称为 **“webserver”**(或任意一个其他名称) 的 Tmux 会话。 +如果使用多个会话,你很可能会混淆运行在多个会话中的应用程序。这种情况下,我们需要会话并赋予名称。譬如需要 web 相关服务的会话,就创建一个名称为 “webserver”(或任意一个其他名称) 的 Tmux 会话。 ``` tmux new -s webserver ``` -这里是 Tmux 的有名会话 +这里是新的 Tmux 有名会话: ![][4] -拥有自定义名称的 Tmux 会话 +*拥有自定义名称的 Tmux 会话* -当你能够看到上述截图,这个 Tmux 会话的名称已经被标注为 **webserver**。如此,你可以在多个会话中,轻易的区分应用程序的所在。 +如你所见上述截图,这个 Tmux 会话的名称已经被标注为 “webserver”。如此,你可以在多个会话中,轻易的区分应用程序的所在。 -退出会话,轻按 **Ctrl+b** 和 **d**。 +退出会话,轻按 `Ctrl+b` 和 `d`。 -##### 查看 Tmux 会话清单 +#### 查看 Tmux 会话清单 查看 Tmux 会话清单,执行: @@ -118,13 +117,15 @@ tmux ls ![][5] +*列出 Tmux 会话* + 如你所见,我们开启了两个 Tmux 会话。 -##### 创建非附着会话 +#### 创建非附着会话 有时候,你可能想要简单创建会话,但是并不想自动切入该会话。 -创建一个非附着会话,并赋予名称 **“ostechnix”**,运行: +创建一个非附着会话,并赋予名称 “ostechnix”,运行: ``` tmux new -s ostechnix -d @@ -132,25 +133,27 @@ tmux new -s ostechnix -d 上述命令将会创建一个名为 “ostechnix” 的会话,但是并不会附着进入。 -你可以通过使用 “tmux ls” 命令验证: +你可以通过使用 `tmux ls` 命令验证: ![][6] -##### 进入 Tmux 会话 +*创建非附着会话* -通过如下命令,你可以进入最后一个被创建的会话: +#### 附着进入 Tmux 会话 + +通过如下命令,你可以附着进入最后一个被创建的会话: ``` tmux attach ``` -Or, +抑或, ``` tmux a ``` -如果你想进入任意一个指定的有名会话,譬如 “ostechnix”,运行: +如果你想附着进入任意一个指定的有名会话,譬如 “ostechnix”,运行: ``` tmux attach -t ostechnix @@ -162,7 +165,7 @@ tmux attach -t ostechnix tmux a -t ostechnix ``` -##### 关闭 Tmux 会话 +#### 关闭 Tmux 会话 当你完成或者不再需要 Tmux 会话,你可以通过如下命令关闭: @@ -170,9 +173,9 @@ tmux a -t ostechnix tmux kill-session -t ostechnix ``` -当身处该会话时,使用 **Ctrl+b** 以及 **x**。点击 “y” 来关闭会话 +当身处该会话时,使用 `Ctrl+b` 以及 `x`。点击 `y` 来关闭会话。 -可以通过 “tmux ls” 命令验证。 +可以通过 `tmux ls` 命令验证。 关闭所有 Tmux 服务下的所有会话,运行: @@ -189,70 +192,85 @@ $ tmux ls no server running on /tmp/tmux-1000/default ``` -##### 分离 Tmux 窗口 +#### 切割 Tmux 窗口 -分割窗口成多个小窗口,在 Tmux 中,这个叫做 “Tmux panes”(Tmux 窗格)。每个窗格中可以同时运行多个不同的程序。每个窗格可以在不影响其他窗格的前提下可以调整大小、移动位置和控制关闭。我们可以水平、垂直或者二者混合的方式切割屏幕。 +切割窗口成多个小窗口,在 Tmux 中,这个叫做 “Tmux 窗格”。每个窗格中可以同时运行不同的程序,并同时与所有的窗格进行交互。每个窗格可以在不影响其他窗格的前提下可以调整大小、移动位置和控制关闭。我们可以以水平、垂直或者二者混合的方式切割屏幕。 -**水平切割窗格** +##### 水平切割窗格 -欲水平切割窗格,使用 **Ctrl+b** 和 **“**(半个双引号)。 +欲水平切割窗格,使用 `Ctrl+b` 和 `"`(半个双引号)。 ![][7] -使用组合键进一步切割面板。 +##### 水平切割 Tmux 窗格 -**垂直切割窗格** +可以使用组合键进一步切割面板。 -垂直切割面板,使用 **Ctrl+b** 和 **%** +##### 垂直切割窗格 + +垂直切割面板,使用 `Ctrl+b` 和 `%`。 ![][8] -垂直切割 Tmux 窗格 +*垂直切割 Tmux 窗格* -**水平、垂直混合切割窗格** +##### 水平、垂直混合切割窗格 我们也可以同时采用水平和垂直的方案切割窗格。看看如下截图: ![][9] -分割 Tmux 窗格 +*切割 Tmux 窗格* -受限,我通过 **Ctrl+b “** 水平分割,之后通过 **Ctrl+b** 垂直分割下方的窗格。 +首先,我通过 `Ctrl+b` `"` 水平切割,之后通过 `Ctrl+b` `%` 垂直切割下方的窗格。 如你所见,每个窗格下我运行了不同的程序。 -**切换窗格** +##### 切换窗格 -通过 **Ctrl+b** 和 **方向键(上下左右)** 切换窗格。 +通过 `Ctrl+b` 和方向键(上下左右)切换窗格。 -**发送命令给所有窗格** +##### 发送命令给所有窗格 之前的案例中,我们在每个窗格中运行了三个不同命令。其实,也可以发送相同的命令给所有窗格。 -为此,使用 **Ctrl+b** 然后键入如下命令,之后按压 ENTER: +为此,使用 `Ctrl+b` 然后键入如下命令,之后按下回车: ``` :setw synchronize-panes ``` -现在在任意窗格中键入任何命令。你讲看到相同命令影响了所有窗格。 +现在在任意窗格中键入任何命令。你将看到相同命令影响了所有窗格。 -**Swap panes** -**交换窗格** +##### 交换窗格 -使用 **Ctrl+b** 和 **o** 交换窗格。 +使用 `Ctrl+b` 和 `o` 交换窗格。 -**展示窗格数量** +##### 展示窗格号 -使用 **Ctrl+b** 和 **q** 展示窗格数量。 +使用 `Ctrl+b` 和 `q` 展示窗格号。 -**终止窗格** +##### 终止窗格 -要关闭窗格,直接键入 **exit** 并且使用 ENTER 键。或者,按压 **Ctrl+b** 和 **x**。你会看到确认信息。按压 **”y“** 关闭窗格。 +要关闭窗格,直接键入 `exit` 并且按下回车键。或者,按下 `Ctrl+b` 和 `x`。你会看到确认信息。按下 `y` 关闭窗格。 ![][10] -关闭窗格。 +*关闭窗格* + +##### 放大和缩小 Tmux 窗格 + +我们可以将 Tmux 窗格放大到当前终端窗口的全尺寸,以获得更好的文本可视性,并查看更多的内容。当你需要更多的空间或专注于某个特定的任务时,这很有用。在完成该任务后,你可以将 Tmux 窗格缩小(取消放大)到其正常位置。更多详情请看以下链接。 + +- [如何缩放 Tmux 窗格以提高文本可见度?](https://ostechnix.com/how-to-zoom-tmux-panes-for-better-text-visibility/) + +#### 自动启动 Tmux 会话 + +当通过 SSH 与远程系统工作时,在 Tmux 会话中运行一个长期运行的进程总是一个好的做法。因为,它可以防止你在网络连接突然中断时失去对运行进程的控制。避免这个问题的一个方法是自动启动 Tmux 会话。更多详情,请参考以下链接。 + +- [通过 SSH 登录远程系统时自动启动 Tmux 会话](https://ostechnix.com/autostart-tmux-session-on-remote-system-when-logging-in-via-ssh/) + +### 总结 这个阶段下,你已经获得了基本的 Tmux 技能来进行多会话管理,更多细节,参阅 man 页面。 @@ -268,8 +286,8 @@ via: https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal 作者:[sk][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[chensanle](https://github.com/chensanle) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8b9da65f156b9924acdced819c3dcef298ac512f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 11 Feb 2021 10:13:01 +0800 Subject: [PATCH 277/381] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chensanle 本文首发:https://linux.cn/article-13107-1.html 你的 LCTT 专页:https://linux.cn/lctt/chensanle --- ...Command Examples To Manage Multiple Terminal Sessions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md (98%) diff --git a/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md similarity index 98% rename from translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md rename to published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md index bafdf14ad6..fe8b92c8f3 100644 --- a/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md +++ b/published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chensanle) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13107-1.html) [#]: subject: (Tmux Command Examples To Manage Multiple Terminal Sessions) [#]: via: (https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/) [#]: author: (sk https://www.ostechnix.com/author/sk/) @@ -14,7 +14,7 @@ 我们已经了解到如何通过 [GNU Screen][2] 进行多会话管理。今天,我们将要领略另一个著名的管理会话的命令行实用工具 **Tmux**。类似 GNU Screen,Tmux 是一个帮助我们在单一终端窗口中创建多个会话,同一时间内同时运行多个应用程序或进程的终端复用工具。Tmux 自由、开源并且跨平台,支持 Linux、OpenBSD、FreeBSD、NetBSD 以及 Mac OS X。本文将讨论 Tmux 在 Linux 系统下的高频用法。 -### Linux 下安装 tmux +### Linux 下安装 Tmux Tmux 可以在绝大多数的 Linux 官方仓库下获取。 From a7d5eed136a3d94725e3c20cab69ed0f66b3b738 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 11 Feb 2021 10:20:46 +0800 Subject: [PATCH 278/381] PRF --- ...mux Command Examples To Manage Multiple Terminal Sessions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md index fe8b92c8f3..c80af774f7 100644 --- a/published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md +++ b/published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md @@ -202,7 +202,7 @@ no server running on /tmp/tmux-1000/default ![][7] -##### 水平切割 Tmux 窗格 +*水平切割 Tmux 窗格* 可以使用组合键进一步切割面板。 From c88f23fc856b36ca89308f384fe0f66f5d735c1d Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Thu, 11 Feb 2021 16:50:54 +0800 Subject: [PATCH 279/381] Update 20190404 Add translation. --- ...s Optane for data center memory caching.md | 73 ------------------- ...s Optane for data center memory caching.md | 73 +++++++++++++++++++ 2 files changed, 73 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/20190404 Intel formally launches Optane for data center memory caching.md create mode 100644 translated/tech/20190404 Intel formally launches Optane for data center memory caching.md diff --git a/sources/tech/20190404 Intel formally launches Optane for data center memory caching.md b/sources/tech/20190404 Intel formally launches Optane for data center memory caching.md deleted file mode 100644 index c81ef9a51d..0000000000 --- a/sources/tech/20190404 Intel formally launches Optane for data center memory caching.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (ShuyRoy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Intel formally launches Optane for data center memory caching) -[#]: via: (https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Intel formally launches Optane for data center memory caching -====== - -### Intel formally launched the Optane persistent memory product line, which includes 3D Xpoint memory technology. The Intel-only solution is meant to sit between DRAM and NAND and to speed up performance. - -![Intel][1] - -As part of its [massive data center event][2] on Tuesday, Intel formally launched the Optane persistent memory product line. It had been out for a while, but the current generation of Xeon server processors could not fully utilize it. The new Xeon 8200 and 9200 lines take full advantage of it. - -And since Optane is an Intel product (co-developed with Micron), that means AMD and Arm server processors are out of luck. - -As I have [stated in the past][3], Optane DC Persistent Memory uses 3D Xpoint memory technology that Intel developed with Micron Technology. 3D Xpoint is a non-volatile memory type that is much faster than solid-state drives (SSD), almost at the speed of DRAM, but it has the persistence of NAND flash. - -**[ Read also:[Why NVMe? Users weigh benefits of NVMe-accelerated flash storage][4] and [IDC’s top 10 data center predictions][5] | Get regularly scheduled insights [Sign up for Network World newsletters][6] ]** - -The first 3D Xpoint products were SSDs called Intel’s ["ruler,"][7] because they were designed in a long, thin format similar to the shape of a ruler. They were designed that way to fit in 1u server carriages. As part of Tuesday’s announcement, Intel introduced the new Intel SSD D5-P4326 'Ruler' SSD, using four-cell or QLC 3D NAND memory, with up to 1PB of storage in a 1U design. - -Optane DC Persistent Memory will be available in DIMM capacities of 128GB on up to 512GB initially. That’s two to four times what you can get with DRAM, said Navin Shenoy, executive vice president and general manager of Intel’s Data Center Group, who keynoted the event. - -“We expect system capacity in a server system to scale to 4.5 terabytes per socket or 36 TB in an 8-socket system. That’s three times larger than what we were able to do with the first-generation of Xeon Scalable,” he said. - -## Intel Optane memory uses and speed - -Optane runs in two different modes: Memory Mode and App Direct Mode. Memory mode is what I have been describing to you, where Optane memory exists “above” the DRAM and acts as a cache. In App Direct mode, the DRAM and Optane DC Persistent Memory are pooled together to maximize the total capacity. Not every workload is ideal for this kind of configuration, so it should be used in applications that are not latency-sensitive. The primary use case for Optane, as Intel is promoting it, is Memory Mode. - -**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][8] ]** - -When 3D Xpoint was initially announced a few years back, Intel claimed it was 1,000 times faster than NAND, with 1000 times the endurance, and 10 times the density potential of DRAM. Well that was a little exaggerated, but it does have some intriguing elements. - -Optane memory, when used in 256B contiguous 4 cacheline, can achieve read speeds of 8.3GB/sec and write speeds of 3.0GB/sec. Compare that with the read/write speed of 500 or so MB/sec for a SATA SSD, and you can see the performance gain. Optane, remember, is feeding memory, so it caches frequently accessed SSD content. - -This is the key takeaware of Optane DC. It will keep very large data sets very close to memory, and hence the CPU, with low latency while at the same time minimizing the need to access the slower storage subsystem, whether it’s SSD or HDD. It now offers the possibility of putting multiple terabytes of data very close to the CPU for much faster access. - -## One challenge with Optane memory - -The only real challenge is that Optane goes into DIMM slots, which is where memory goes. Now some motherboards come with as many as 16 DIMM slots per CPU socket, but that’s still board real estate that the customer and OEM provider will need to balance out: Optane vs. memory. There are some Optane drives in PCI Express format, which alleviate the memory crowding on the motherboard. - -3D Xpoint also offers higher endurance than traditional NAND flash memory due to the way it writes data. Intel promises a five-year warranty with its Optane, while a lot of SSDs offer only three years. - -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/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[RiaXu](https://github.com/ShuyRoy) -校对:[校对者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://images.idgesg.net/images/article/2018/06/intel-optane-persistent-memory-100760427-large.jpg -[2]: https://www.networkworld.com/article/3386142/intel-unveils-an-epic-response-to-amds-server-push.html -[3]: https://www.networkworld.com/article/3279271/intel-launches-optane-the-go-between-for-memory-and-storage.html -[4]: https://www.networkworld.com/article/3290421/why-nvme-users-weigh-benefits-of-nvme-accelerated-flash-storage.html -[5]: https://www.networkworld.com/article/3242807/data-center/top-10-data-center-predictions-idc.html#nww-fsb -[6]: https://www.networkworld.com/newsletters/signup.html#nww-fsb -[7]: https://www.theregister.co.uk/2018/02/02/ruler_and_miniruler_ssd_formats_look_to_banish_diskstyle_drives/ -[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 -[9]: https://www.facebook.com/NetworkWorld/ -[10]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md b/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md new file mode 100644 index 0000000000..5d258ab61f --- /dev/null +++ b/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: (ShuyRoy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intel formally launches Optane for data center memory caching) +[#]: via: (https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +英特尔正式推出Optane:用于数据中心内存缓存 +====== + +### 英特尔正式推出包含3D Xpoint 内存技术的傲腾持久内存产品线。英特尔的这个解决方案将傲腾持久内存放置在DRAM和NAND中间,以此来提升性能。 + +![Intel][1] + +英特尔在周二(2019年4月2日)的[大数据中心活动][2]中正式推出傲腾持久内存产品线。傲腾持久内存已经问世了一段时间,但是目前的Xeon服务器处理器还不能充分利用它。而新的Xeon8200和9200可以充分利用傲腾持久内存的优势。 + +由于傲腾是英特尔的产品(与美光合作开发),所以意味着AMD和ARM的服务器处理器不能够支持它。 + +正如[我之前所说的][3],傲腾DC持久内存采用与美光合作研发的3D Xpoint内存技术。3D Xpoint是一种比SSD更快的非易失性内存,速度几乎与DRAM相近,而且它具有NAND flash的持久性。 + +**[ 小编推荐:[为什么是NVMe?用户会权衡基于NVMe加速的闪存的优点。][4] 和 [IDC的十大数据中心预测][5] | 定期更新的新闻[请注册网络世界通信][6] ]** + +第一个3D Xpoint产品是被称为英特尔“尺子”的SSD,因为它们被设计成细长的样子,很像尺子的形状。他们被设计得能够适合1u的服务器托架。在周二发布的公告中,英特尔推出了新的利用四-cell或者QLC 3D NAND 内存的英特尔SSD D5-P4325[“尺子”][7]SSD,可以在1u的服务器托架上放1PB的存储。 + +傲腾DC持久内存的可用容量最初可以通过使用128GB的DIMM达到512GB。这次活动的关键人物——英特尔数据中心集团执行副总裁及总经理Navin Shenoy说:“傲腾DC持久内存可达到的容量是DRAM的2到4倍。” + +他说:“我们希望服务器系统的容量可以扩展到每个插槽4.5TB或者8个插槽36TB,这是我们第一代Xeon可扩展芯片的3倍。” + +## 英特尔傲腾内存的使用和速度 + +傲腾有两种不同的运行模式:内存模式和APP直连模式。内存模式是将DRAM放在傲腾内存之上,将DRAM作为傲腾内存的缓存。APP直连模式是将DRAM和傲腾持久内存一起作为内存来最大化总容量。并不是每个工作负载都适合这种配置,所以应该在对延迟不敏感的应用程序中使用。正如英特尔推广的那样,傲腾的主要使用情景是内存模式。 + +**[[通过PluralSight上的7部分线上课程来获得苹果技术合作者的认证。][8] ]** + +几年前,当3D Xpoint最初发布时,英特尔宣称傲腾的速度是NAND的1000倍,忍耐力是NAND的1000倍,密度是DRAM的10倍。这虽然有点夸张,但这些因素确实很令人着迷。 + +在256B的连续4个缓存行中使用傲腾内存可以达到8.3GB/秒的读速度和3.0GB/秒的写速度。与SATA SSD的500MB/秒左右的读/写速度相比,可以看到性能有很大提升。请记住,傲腾充当内存,所以它会缓存被频繁访问的SSD中的内容。 + +这是了解傲腾DC的关键。它能将非常大的数据集存储在离内存非常近的位置,因此具有很低延迟的CPU可以最小化访问较慢的存储子系统的访问延迟,无论存储是SSD还是HDD。现在,它提供了将很多TB的数据放在离CPU很近的位置,以获得更快的访问速度。 + +## 傲腾内存的一个挑战 + +唯一真正的挑战是傲腾然后插进内存所在的DIMM插槽。现在有些主板的每个CPU有16个插槽,但是这仍然是客户和设备制造商之间需要平衡的:傲腾VS内存。有一些傲腾驱动采用了PCIe接口进行连接,可以减轻主板上内存的拥挤。 + +3D Xpoint由于它写数据的方式,提供了比传统的NAND flash更高的耐久力。英特尔承诺傲腾提供5年保修期,而很多SSD只提供3年保修期。 + +加入Facebook[Facebook][9]和LinkedIn[LinkedIn][10]上的网络世界社区,对你最关心的话题发表评论吧。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[RiaXu](https://github.com/ShuyRoy) +校对:[校对者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://images.idgesg.net/images/article/2018/06/intel-optane-persistent-memory-100760427-large.jpg +[2]: https://www.networkworld.com/article/3386142/intel-unveils-an-epic-response-to-amds-server-push.html +[3]: https://www.networkworld.com/article/3279271/intel-launches-optane-the-go-between-for-memory-and-storage.html +[4]: https://www.networkworld.com/article/3290421/why-nvme-users-weigh-benefits-of-nvme-accelerated-flash-storage.html +[5]: https://www.networkworld.com/article/3242807/data-center/top-10-data-center-predictions-idc.html#nww-fsb +[6]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[7]: https://www.theregister.co.uk/2018/02/02/ruler_and_miniruler_ssd_formats_look_to_banish_diskstyle_drives/ +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 2905ff9ff34aef7019cd6e438a79a0f21a659846 Mon Sep 17 00:00:00 2001 From: sanle <31087327+chensanle@users.noreply.github.com> Date: Thu, 11 Feb 2021 20:21:50 +0800 Subject: [PATCH 280/381] Update 20200223 The Zen of Go.md --- sources/tech/20200223 The Zen of Go.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200223 The Zen of Go.md b/sources/tech/20200223 The Zen of Go.md index c4143aed32..249c3790cd 100644 --- a/sources/tech/20200223 The Zen of Go.md +++ b/sources/tech/20200223 The Zen of Go.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( chensanle ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f46297d21f8feaf2516b9d84cce646aa0d03efa0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 12 Feb 2021 05:03:11 +0800 Subject: [PATCH 281/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210211=20?= =?UTF-8?q?Unikraft:=20Pushing=20Unikernels=20into=20the=20Mainstream?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210211 Unikraft- Pushing Unikernels into the Mainstream.md --- ... Pushing Unikernels into the Mainstream.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20210211 Unikraft- Pushing Unikernels into the Mainstream.md diff --git a/sources/tech/20210211 Unikraft- Pushing Unikernels into the Mainstream.md b/sources/tech/20210211 Unikraft- Pushing Unikernels into the Mainstream.md new file mode 100644 index 0000000000..e9eb57d18e --- /dev/null +++ b/sources/tech/20210211 Unikraft- Pushing Unikernels into the Mainstream.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Unikraft: Pushing Unikernels into the Mainstream) +[#]: via: (https://www.linux.com/featured/unikraft-pushing-unikernels-into-the-mainstream/) +[#]: author: (Linux.com Editorial Staff https://www.linux.com/author/linuxdotcom/) + +Unikraft: Pushing Unikernels into the Mainstream +====== + +![][1] + +Unikernels have been around for many years and are famous for providing excellent performance in boot times, throughput, and memory consumption, to name a few metrics [1]. Despite their apparent potential, unikernels have not yet seen a broad level of deployment due to three main drawbacks: + + * **Hard to build**: Putting a unikernel image together typically requires expert, manual work that needs redoing for each application. Also, many unikernel projects are not, and don’t aim to be, POSIX compliant, and so significant porting effort is required to have standard applications and frameworks run on them. + * **Hard to extract high performance**: Unikernel projects don’t typically expose high-performance APIs; extracting high performance often requires expert knowledge and modifications to the code. + * **Little or no tool ecosystem**: Assuming you have an image to run, deploying it and managing it is often a manual operation. There is little integration with major DevOps or orchestration frameworks. + + + +While not all unikernel projects suffer from all of these issues (e.g., some provide some level of POSIX compliance but the performance is lacking, others target a single programming language and so are relatively easy to build but their applicability is limited), we argue that no single project has been able to successfully address all of them, hindering any significant level of deployment. For the past three years, Unikraft ([www.unikraft.org][2]), a Linux Foundation project under the Xen Project’s auspices, has had the explicit aim to change this state of affairs to bring unikernels into the mainstream.  + +If you’re interested, read on, and please be sure to check out: + + * The [replay of our two FOSDEM talks][3] [2,3] and the [virtual stand ][4] + * Our website (unikraft.org) and source code (). + * Our upcoming source code release, 0.5 Tethys (more information at ) + * [unikraft.io][5], for industrial partners interested in Unikraft PoCs (or [info@unikraft.io][6]) + + + +### High Performance + +To provide developers with the ability to obtain high performance easily, Unikraft exposes a set of composable, performance-oriented APIs. The figure below shows Unikraft’s architecture: all components are libraries with their own **Makefile** and **Kconfig** configuration files, and so can be added to the unikernel build independently of each other. + +![][7] + +**Figure 1. Unikraft ‘s fully modular architecture showing high-performance APIs** + +APIs are also micro-libraries that can be easily enabled or disabled via a Kconfig menu; Unikraft unikernels can compose which APIs to choose to best cater to an application’s needs. For example, an RCP-style application might turn off the **uksched** API (➃ in the figure) to implement a high performance, run-to-completion event loop; similarly, an application developer can easily select an appropriate memory allocator (➅) to obtain maximum performance, or to use multiple different ones within the same unikernel (e.g., a simple, fast memory allocator for the boot code, and a standard one for the application itself).  + +![][8] | ![][9] +---|--- +**Figure 2. Unikraft memory consumption vs. other unikernel projects and Linux** | **Figure 3. Unikraft NGINX throughput versus other unikernels, Docker, and Linux/KVM.** + +  + +These APIs, coupled with the fact that all Unikraft’s components are fully modular, results in high performance. Figure 2, for instance, shows Unikraft having lower memory consumption than other unikernel projects (HermiTux, Rump, OSv) and Linux (Alpine); and Figure 3 shows that Unikraft outperforms them in terms of NGINX requests per second, reaching 90K on a single CPU core. + +Further, we are working on (1) a performance profiler tool to be able to quickly identify potential bottlenecks in Unikraft images and (2) a performance test tool that can automatically run a large set of performance experiments, varying different configuration options to figure out optimal configurations. + +### Ease of Use, No Porting Required + +Forcing users to port applications to a unikernel to obtain high performance is a showstopper. Arguably, a system is only as good as the applications (or programming languages, frameworks, etc.) can run. Unikraft aims to achieve good POSIX compatibility; one way of doing so is supporting a **libc** (e.g., **musl)**, along with a large set of Linux syscalls.  + +![][10] + +**Figure 4. Only a certain percentage of syscalls are needed to support a wide range of applications** + +While there are over 300 of these, many of them are not needed to run a large set of applications; as shown in Figure 1 (taken from [5]). Having in the range of 145, for instance, is enough to support 50% of all libraries and applications in a Ubuntu distribution (many of which are irrelevant to unikernels, such as desktop applications). As of this writing, Unikraft supports over 130 syscalls and a number of mainstream applications (e.g., SQLite, Nginx, Redis), programming languages and runtime environments such as C/C++, Go, Python, Ruby, Web Assembly, and Lua, not to mention several different hypervisors (KVM, Xen, and Solo5) and ARM64 bare-metal support. + +### Ecosystem and DevOps + +Another apparent downside of unikernel projects is the almost total lack of integration with existing, major DevOps and orchestration frameworks. Working towards the goal of integration, in the past year, we created the **kraft** tool, allowing users to choose an application and a target platform simply (e.g., KVM on x86_64) and take care of building the image running it. + +Beyond this, we have several sub-projects ongoing to support in the coming months: + + * **Kubernetes**: If you’re already using Kubernetes in your deployments, this work will allow you to deploy much leaner, fast Unikraft images _transparently._ + * **Cloud Foundry**: Similarly, users relying on Cloud Foundry will be able to generate Unikraft images through it, once again transparently. + * **Prometheus**: Unikernels are also notorious for having very primitive or no means for monitoring running instances. Unikraft is targeting Prometheus support to provide a wide range of monitoring capabilities.  + + + +In all, we believe Unikraft is getting closer to bridging the gap between unikernel promise and actual deployment. We are very excited about this year’s upcoming features and developments, so please feel free to drop us a line if you have any comments, questions, or suggestions at [**info@unikraft.io**][6]. + +_**About the author: [Dr. Felipe Huici][11] is Chief Researcher, Systems and Machine Learning Group, NEC Laboratories Europe GmbH**_ + +### References + +[1] Unikernels Rethinking Cloud Infrastructure. + +[2] Is the Time Ripe for Unikernels to Become Mainstream with Unikraft? FOSDEM 2021 Microkernel developer room. + +[3] Severely Debloating Cloud Images with Unikraft. FOSDEM 2021 Virtualization and IaaS developer room. + +[4] Welcome to the Unikraft Stand! + +[5] A study of modern Linux API usage and compatibility: what to support when you’re supporting. Eurosys 2016. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/featured/unikraft-pushing-unikernels-into-the-mainstream/ + +作者:[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.linux.com/wp-content/uploads/2021/02/unikraft.svg +[2]: http://www.unikraft.org +[3]: https://video.fosdem.org/2021/stands/unikraft/ +[4]: https://stands.fosdem.org/stands/unikraft/ +[5]: http://www.unikraft.io +[6]: mailto:info@unikraft.io +[7]: https://www.linux.com/wp-content/uploads/2021/02/unikraft1.png +[8]: https://www.linux.com/wp-content/uploads/2021/02/unikraft2.png +[9]: https://www.linux.com/wp-content/uploads/2021/02/unikraft3.png +[10]: https://www.linux.com/wp-content/uploads/2021/02/unikraft4.png +[11]: https://www.linkedin.com/in/felipe-huici-47a559127/ From 66aeb4daab10da951c7de35f8217aee83183ecd5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 12 Feb 2021 05:03:31 +0800 Subject: [PATCH 282/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210211=20?= =?UTF-8?q?Getting=20to=20Know=20the=20Cryptocurrency=20Open=20Patent=20Al?= =?UTF-8?q?liance=20(COPA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210211 Getting to Know the Cryptocurrency Open Patent Alliance (COPA).md --- ...ptocurrency Open Patent Alliance (COPA).md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20210211 Getting to Know the Cryptocurrency Open Patent Alliance (COPA).md diff --git a/sources/tech/20210211 Getting to Know the Cryptocurrency Open Patent Alliance (COPA).md b/sources/tech/20210211 Getting to Know the Cryptocurrency Open Patent Alliance (COPA).md new file mode 100644 index 0000000000..86df7cf688 --- /dev/null +++ b/sources/tech/20210211 Getting to Know the Cryptocurrency Open Patent Alliance (COPA).md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting to Know the Cryptocurrency Open Patent Alliance (COPA)) +[#]: via: (https://www.linux.com/news/getting-to-know-the-cryptocurrency-open-patent-alliance-copa/) +[#]: author: (Linux.com Editorial Staff https://www.linux.com/author/linuxdotcom/) + +Getting to Know the Cryptocurrency Open Patent Alliance (COPA) +====== + +### ![][1] + +### Why is there a need for a patent protection alliance for cryptocurrency technologies? + +With the recent surge in popularity of cryptocurrencies and related technologies, Square felt an industry group was needed to protect against litigation and other threats against core cryptocurrency technology and ensure the ecosystem remains vibrant and open for developers and companies. + +The same way [Open Invention Network][2] (OIN) and [LOT Network][3] add a layer of patent protection to inter-company collaboration on open source technologies, COPA aims to protect open source cryptocurrency technology. Feeling safe from the threat of lawsuits is a precursor to good collaboration. + + * Locking up foundational cryptocurrency technologies in patents stifles innovation and adoption of cryptocurrency in novel and useful applications. + * The offensive use of patents threatens the growth and free availability of cryptocurrency technologies. Many smaller companies and developers do not own patents and cannot deter or defend threats adequately. + + + +By joining COPA, a member can feel secure it can innovate in the cryptocurrency space without fear of litigation between other members.  + +### What is Square’s involvement in COPA? + +Square’s core purpose is economic empowerment, and they see cryptocurrency as a core technological pillar. Square helped start and fund COPA with the hope that by encouraging innovation in the cryptocurrency space, more useful ideas and products would get created. COPA management has now diversified to an independent board of technology and regulatory experts, and Square maintains a minority presence. + +### Do we need cryptocurrency patents to join COPA?  + +No! Anyone can join and benefit from being a member of COPA, regardless of whether they have patents or not. There is no barrier to entry – members can be individuals, start-ups, small companies, or large corporations. Here is how COPA works: + + * First, COPA members pledge never to use their crypto-technology patents against anyone, except for defensive reasons, effectively making their patents freely available for all. + * Second, members pool all of their crypto-technology patents together to form a shared patent library, which provides a forum to allow members to reasonably negotiate lending patents to one another for defensive purposes. + * The patent pledge and the shared patent library work in tandem to help drive down the incidence and threat of patent litigation, benefiting the cryptocurrency community as a whole.  + * Additionally, COPA monitors core technologies and entities that support cryptocurrency and does its best to research and help address litigation threats against community members. + + + +### What types of companies should join COPA? + + * Financial services companies and technology companies working in regulated industries that use distributed ledger or cryptocurrency technology + * Companies or individuals who are interested in collaborating on developing cryptocurrency products or who hold substantial investments in cryptocurrency + + + +### What companies have joined COPA so far? + + * Square, Inc. + * Blockchain Commons + * Carnes Validadas + * Request Network + * Foundation Devices + * ARK + * SatoshiLabs + * Transparent Systems + * Horizontal Systems + * VerifyChain + * Blockstack + * Protocol Labs + * Cloudeya Ltd. + * Mercury Cash + * Bithyve + * Coinbase + * Blockstream + * Stakenet + + + +### How to join + +Please express interest and get access to our membership agreement here: + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/getting-to-know-the-cryptocurrency-open-patent-alliance-copa/ + +作者:[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.linux.com/wp-content/uploads/2021/02/copa-linuxdotcom.jpg +[2]: https://openinventionnetwork.com/ +[3]: https://lotnet.com/ From 7d2a9a0bb989ab40e5434f41bde726c06c364ebd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 12 Feb 2021 05:03:48 +0800 Subject: [PATCH 283/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210211=20?= =?UTF-8?q?Understanding=20Open=20Governance=20Networks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210211 Understanding Open Governance Networks.md --- ... Understanding Open Governance Networks.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20210211 Understanding Open Governance Networks.md diff --git a/sources/tech/20210211 Understanding Open Governance Networks.md b/sources/tech/20210211 Understanding Open Governance Networks.md new file mode 100644 index 0000000000..771947bb39 --- /dev/null +++ b/sources/tech/20210211 Understanding Open Governance Networks.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Understanding Open Governance Networks) +[#]: via: (https://www.linux.com/news/understanding-open-governance-networks/) +[#]: author: (The Linux Foundation https://www.linuxfoundation.org/en/blog/understanding-open-governance-networks/) + +Understanding Open Governance Networks +====== + +![][1] + +Throughout the modern business era, industries and commercial operations have shifted substantially to digital processes. Whether you look at EDI as a means to exchange invoices or cloud-based billing and payment solutions today, businesses have steadily been moving towards increasing digital operations. In the last few years, we’ve seen the promises of digital transformation come alive, particularly in [industries that have shifted to software-defined models][2]. The next step of this journey will involve enabling digital transactions through decentralized networks. + +A fundamental adoption issue will be figuring out who controls and decides how a decentralized network is governed. It may seem oxymoronic at first, but decentralized networks still need governance. A future may hold autonomously self-governing decentralized networks, but this model is not accepted in industries today. The governance challenge with a decentralized network technology lies in who and how participants in a network will establish and maintain policies, network operations, on/offboarding of participants, setting fees, configurations, and software changes and are among the issues that will have to be decided to achieve a successful network. No company wants to participate or take a dependency on a network that is controlled or run by a competitor, potential competitor, or any single stakeholder at all for that matter. + +Earlier this year, [we presented a solution for Open Governance Networks][3] that enable an industry or ecosystem to govern itself in an open, inclusive, neutral, and participatory model. You may be surprised to learn that it’s based on best practices in open governance we’ve developed over decades of facilitating the world’s most successful and competitive open source projects. + +### The Challenge + +For the last few years, a running technology joke has been “describe your problem, and someone will tell you blockchain is the solution.” There have been many other concerns raised and confusion created, as overnight headlines hyped cryptocurrency schemes. Despite all this, behind the scenes, and all along, sophisticated companies understood a distributed ledger technology would be a powerful enabler for tackling complex challenges in an industry, or even a section of an industry. + +At the Linux Foundation, we focused on enabling those organizations to collaborate on open source enterprise blockchain technologies within our Hyperledger community. That community has driven collaboration on every aspect of enterprise blockchain technology, including identity, security, and transparency. Like other Linux Foundation projects, these enterprise blockchain communities are open, collaborative efforts. We have had many vertical industry participants engage, from retail, automotive, aerospace, banking, and others participate with real industry challenges they needed to solve. And in this subset of cases, enterprise blockchain is the answer. + +The technology is ready. Enterprise blockchain has been through many proof-of-concept implementations, and we’ve already seen that many organizations have shifted to production deployments. A few notable examples are: + + * [Trust Your Supplier Network][4] 25 major corporate members from Anheuser-Busch InBev to UPS In production since September 2019. + * [Foodtrust][5] Launched Aug 2017 with ten members, now being used by all major retailers. + * [Honeywell][6] 50 vendors with storefronts in the new marketplace. In its first year, GoDirect Trade processed more than $5 million in online transactions. + + + +However, just because we have the technology doesn’t mean we have the appropriate conditions to solve adoption challenges. A certain set of challenges about networks’ governance have become a “last mile” problem for industry adoption. While there are many examples of successful production deployments and multi-stakeholder engagements for commercial enterprise blockchains already, specific adoption scenarios have been halted over uncertainty, or mistrust, over who and how a blockchain network will be governed. + +To precisely state the issue, in many situations, company A does not want to be dependent on, or trust, company B to control a network. For specific solutions that require broad industry participation to succeed, you can name any industry, and there will be company A and company B. + +We think the solution to this challenge will be Open Governance Networks. + +### The Linux Foundation vision of the Open Governance Network + +An Open Governance Network is a distributed ledger service, composed of nodes, operated under the policies and directions of an inclusive set of industry stakeholders. + +Open Governance Networks will set the policies and rules for participation in a decentralized ledger network that acts as an industry utility for transactions and data sharing among participants that have permissions on the network. The Open Governance Network model allows any organization to participate. Those organizations that want to be active in sharing the operational costs will benefit from having a representative say in the policies and rules for the network itself. The software underlying the Open Governance Network will be open source software, including the configurations and build tools so that anyone can validate whether a network node complies with the appropriate policies. + +Many who have worked with the Linux Foundation will realize an open, neutral, and participatory governance model under a nonprofit structure that has already been thriving for decades in successful open source software communities. All we’re doing here is taking the same core principles of what makes open governance work for open source software, open standards, and open collaboration and applying those principles to managing a distributed ledger. This is a model that the Linux Foundation has used successfully in other communities, such as the [Let’s Encrypt][7] certificate authority. + +Our ecosystem members trust the Linux Foundation to help solve this last mile problem using open governance under a neutral nonprofit entity. This is one solution to the concerns about neutrality and distributed control. In pan-industry use cases, it is generally not acceptable for one participant in the network to have power in any way that could be used as an advantage over someone else in the industry.  The control of a ledger is a valuable asset, and competitive organizations generally have concerns in allowing one entity to control this asset. If not hosted in a neutral environment for the community’s benefit, network control can become a leverage point over network users. + +We see this neutrality of control challenge as the primary reason why some privately held networks have struggled to gain widespread adoption. In order to encourage participation, industry leaders are looking for a neutral governance structure, and the Linux Foundation has proven the open governance models accomplish that exceptionally well. + +This neutrality of control issue is very similar to the rationale for public utilities. Because the economic model mirrors a public utility, we debated calling these “industry utility networks.” In our conversations, we have learned industry participants are open to sharing the cost burden to stand up and maintain a utility. Still, they want a low-cost, not profit-maximizing model. That is why our nonprofit model makes the most sense. + +It’s also not a public utility in that each network we foresee today would be restricted in participation to those who have a stake in the network, not any random person in the world. There’s a layer of human trust that our communities have been enabling on top of distributed networks, which started with the [Trust over IP Foundation][8]. + +Unlike public cryptocurrency networks where anyone can view the ledger or submit proposed transactions, industries have a natural need to limit access to legitimate parties in their industry. With minor adjustments to address the need for policies for transactions on the network, we believe a similar governance model applied to distributed ledger ecosystems can resolve concerns about the neutrality of control. + +### Understanding LF Open Governance Networks + +Open Governance Networks can be reduced to the following building block components: + + * Business Governance: Networks need a decision-making body to establish core policies (e.g., network policies), make funding and budget decisions, contracting with a network manager, and other business matters necessary for the network’s success. The Linux Foundation establishes a governing board to manage the business governance. + * Technical Governance: Networks will require software. A technical open source community will openly maintain the software, specifications, or configuration decisions implemented by the network nodes. The Linux Foundation establishes a technical steering committee to oversee technical projects, configurations, working groups, etc. + * Transaction Entity: Networks will require a transaction entity that will a) act as counterparty to agreements with parties transacting on the network, b) collect fees from participants, and c) execute contracts for operational support (e.g., hiring a network manager). + + + +Of these building blocks, the Linux Foundation already offers its communities the Business and Technical Governance needed for Open Governance Networks. The final component is the new, LF Open Governance Networks. + +LF Open Governance Networks will enable our communities to establish their own Open Governance Network and have an entity to process agreements and collect transaction fees. This new entity is a Delaware nonprofit, a nonstock corporation that will maximize utility and not profit. Through agreements with the Linux Foundation, LF Governance Networks will be available to Open Governance Networks hosted at the Linux Foundation. + +If you’re interested in learning more about hosting an Open Governance Network at the Linux Foundation, please contact us at **[governancenetworks@linuxfoundation.org][9]** + +The post [Understanding Open Governance Networks][10] appeared first on [Linux Foundation][11]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/understanding-open-governance-networks/ + +作者:[The Linux Foundation][a] +选题:[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.linuxfoundation.org/en/blog/understanding-open-governance-networks/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2021/02/understanding-opengovnetworks.png +[2]: https://www.linuxfoundation.org/blog/2020/09/software-defined-vertical-industries-transformation-through-open-source/ +[3]: https://www.linuxfoundation.org/blog/2020/10/introducing-the-open-governance-network-model/ +[4]: https://www.hyperledger.org/learn/publications/chainyard-case-study +[5]: https://www.hyperledger.org/learn/publications/walmart-case-study +[6]: https://www.hyperledger.org/learn/publications/honeywell-case-study +[7]: https://letsencrypt.org/ +[8]: https://trustoverip.org/ +[9]: mailto:governancenetworks@linuxfoundation.org +[10]: https://www.linuxfoundation.org/en/blog/understanding-open-governance-networks/ +[11]: https://www.linuxfoundation.org/ From 459ea6c349ccab19965639e79d9bc3e7833fc3ca Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 12 Feb 2021 05:04:53 +0800 Subject: [PATCH 284/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210211=20?= =?UTF-8?q?31=20open=20source=20text=20editors=20you=20need=20to=20try?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210211 31 open source text editors you need to try.md --- ...pen source text editors you need to try.md | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 sources/tech/20210211 31 open source text editors you need to try.md diff --git a/sources/tech/20210211 31 open source text editors you need to try.md b/sources/tech/20210211 31 open source text editors you need to try.md new file mode 100644 index 0000000000..d9ca620bf4 --- /dev/null +++ b/sources/tech/20210211 31 open source text editors you need to try.md @@ -0,0 +1,182 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (31 open source text editors you need to try) +[#]: via: (https://opensource.com/article/21/2/open-source-text-editors) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +31 open source text editors you need to try +====== +Looking for a new text editor? Here are 31 options to consider. +![open source button on keyboard][1] + +Computers are text-based, so the more things you do with them, the more you find yourself needing a text-editing application. And the more time you spend in a text editor, the more likely you are to demand more from whatever you use. + +If you're looking for a good text editor, you'll find that Linux has plenty to offer. Whether you want to work in the terminal, on your desktop, or in the cloud, you can literally try a different editor every day for a month (or one a month for almost three years) in your relentless search for the perfect typing experience. + +### Vim-like editors + +![][2] + + * [Vi][3] ships with every Linux, BSD, Solaris, and macOS installation. It's the quintessential Unix text editor, with its unique combination of editing modes and super-efficient single-key shortcuts. The original Vi editor was an application written by Bill Joy, creator of the C shell. Modern incarnations of Vi, most notably Vim, have added many features, including multiple levels of undo, better navigation while in insert mode, line folding, syntax highlighting, plugin support, and much more. It takes practice (it even has its own tutor application, vimtutor.) + * [Kakoune][4] is a Vim-inspired application with a familiar, minimalistic interface, short keyboard shortcuts, and separate editing and insert modes. It looks and feels a lot like Vi at first, but with its own unique style, both in design and function. As a special bonus, it features an implementation of the Clippy interface. + + + +### emacs editors + +![][5] + + * The original free emacs, and one of the first official applications of the GNU project that started the Free Software movement, [GNU Emacs][6] is a wildly popular text editor. It's great for sysadmins, developers, and everyday users alike, with loads of features and seemingly endless extensions. Once you start using Emacs, you might find it difficult to think of a reason to close it because it's just that versatile! + * If you like Emacs but find GNU Emacs too bloated, then you might like [Jove][7]. Jove is a terminal-based emacs editor. It's easy to use, but if you're new to emacsen (the plural of emacs), Jove is also easy to learn, thanks to the teachjove command. + * Another lightweight emacs editor, [Jed][8] is a simple incarnation of a macro-based workflow. One thing that sets it apart from other editors is its use of [S-Lang][9], a C-like scripting language providing extensibility options to developers more comfortable with C than with Lisp. + + + +### Interactive editors + +![][10] + + * [GNU nano][11] takes a bold stance on terminal-based text editing: it provides a menu. Yes, this humble editor takes a cue from GUI editors by telling the user exactly which key they need to press to perform a specific function. This is a refreshing take on user experience, so it's no wonder that it's nano, not Vi, that's set as the default editor for "user-friendly" distributions. + * [JOE][12] is based on an old text-editing application called WordStar. If you're not familiar with Wordstar, JOE can also mimic Emacs or GNU nano. By default, it's a good compromise between something relatively mysterious like Emacs or Vi and the always-on verbosity of GNU Nano (for example, it tells you how to activate an onscreen help display, but it's not on by default). + * The excellent [e3][13] application is a tiny text editor with five built-in keyboard shortcut schemes to emulate Emacs, Vi, nano, NEdit, and WordStar. In other words, no matter what terminal-based editor you are used to, you're likely to feel right at home with e3. + + + +### ed and more + + * The [ed][14] line editor is part of the [POSIX][15] and Open Group's standard definition of a Unix-based operating system. You can count on it being installed on nearly every Linux or Unix system you'll ever encounter. It's tiny, terse, and tip-top. + * Building upon ed, the [Sed][16] stream editor is popular both for its functionality and its syntax. Most Linux users learn at least one sed command when searching for the easiest and fastest way to update a line in a config file, but it's worth taking a closer look. Sed is a powerful command with lots of useful subcommands. Get to know it better, and you may find yourself open text editor applications a lot less frequently. + * You don't always need a text editor to edit text. The [heredoc][17] (or Here Doc) system, available in any POSIX terminal, allows you to type text directly into your open terminal and then pipes what you type into a text file. It's not the most robust editing experience, but it is versatile and always available. + + + +### Minimalist editors + +![][18] + +If your idea of a good text editor is a word processor except without all the processing, you're probably looking for one of these classics. These editors let you write and edit text with minimal interference and minimal assistance. What features they do offer are often centered around markup, Markdown, or code. Some have names that follow a certain pattern: + + * [Gedit][19] from the GNOME team + * [medit][20] for a classic GNOME feel + * [Xedit][21] uses only the most basic X11 libraries + * [jEdit][22] for Java aficionados + + + +A similar experience is available for KDE users: + + * [Kate][23] is an unassuming editor with all the features you need. + * [KWrite][24] hides a ton of useful features in a deceptively simple, easy-to-use interface. + + + +And there are a few for other platforms: + + * [Notepad++][25] is a popular Windows application, while Notepadqq takes a similar approach for Linux. + * [Pe][26] is for Haiku OS (the reincarnation of that quirky child of the '90s, BeOS). + * [FeatherPad][27] is a basic editor for Linux but with some support for macOS and Haiku. If you're a Qt hacker looking to port code, take a look! + + + +### IDEs + +![][28] + +There's quite a crossover between text editors and integrated development environments (IDEs). The latter really is just the former with lots of code-specific features added on. If you use an IDE regularly, you might find an XML or Markdown editor lurking in your extension manager: + + * [NetBeans][29] is a handy text editor for Java users. + * [Eclipse][30] offers a robust editing suite with lots of extensions to give you the tools you need. + + + +### Cloud-based editors + +![][31] + +Working in the cloud? You can write there too, you know. + + * [Etherpad][32] is a text editor app that runs on the web. There are free and independent instances for you to use, or you can set up your own. + * [Nextcloud][33] has a thriving app scene and includes both a built-in text editor and a third-party Markdown editor with live preview. + + + +### Newer editors + +![][34] + +Everybody has an idea about what makes a text editor perfect. For that reason, new editors are released each year. Some reimplement classic old ideas in a new and exciting way, some have unique takes on the user experience, and some focus on specific needs. + + * [Atom][35] is an all-purpose modern text editor from GitHub featuring lots of extensions and Git integration. + * [Brackets][36] is an editor from Adobe for web developers. + * [Focuswriter][37] seeks to help you focus on writing with helpful features like a distraction-free fullscreen mode, optional typewriter sound effects, and beautiful configuration options. + * [Howl][38] is a progressive, dynamic editor based on Lua and Moonscript. + * [Norka][39] and [KJots][40] mimic a notebook with each document representing a "page" in your "binder." You can take individual pages out of your notebook through export functions. + + + +### DIY editor + +![][41] + +As the saying does _NOT_ go: Why use somebody else's application when you can write your own? Linux has over 30 text editors available, so probably the last thing it really needs is another one. Then again, part of the fun of open source is the ability to experiment. + +If you're looking for an excuse to learn how to program, making your own text editor is a great way to get started. You can achieve the basics in about 100 lines of code, and the more you use it, the more you'll be inspired to learn more so you can make improvements. Ready to get started? Go and [create your own text editor][42]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/open-source-text-editors + +作者:[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/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx (open source button on keyboard) +[2]: https://opensource.com/sites/default/files/kakoune-screenshot.png +[3]: https://opensource.com/article/20/12/vi-text-editor +[4]: https://opensource.com/article/20/12/kakoune +[5]: https://opensource.com/sites/default/files/jed.png +[6]: https://opensource.com/article/20/12/emacs +[7]: https://opensource.com/article/20/12/jove-emacs +[8]: https://opensource.com/article/20/12/jed +[9]: https://www.jedsoft.org/slang +[10]: https://opensource.com/sites/default/files/uploads/nano-31_days-nano-opensource.png +[11]: https://opensource.com/article/20/12/gnu-nano +[12]: https://opensource.com/article/20/12/31-days-text-editors-joe +[13]: https://opensource.com/article/20/12/e3-linux +[14]: https://opensource.com/article/20/12/gnu-ed +[15]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[16]: https://opensource.com/article/20/12/sed +[17]: https://opensource.com/article/20/12/heredoc +[18]: https://opensource.com/sites/default/files/uploads/gedit-31_days_gedit-opensource.jpg +[19]: https://opensource.com/article/20/12/gedit +[20]: https://opensource.com/article/20/12/medit +[21]: https://opensource.com/article/20/12/xedit +[22]: https://opensource.com/article/20/12/jedit +[23]: https://opensource.com/article/20/12/kate-text-editor +[24]: https://opensource.com/article/20/12/kwrite-kde-plasma +[25]: https://opensource.com/article/20/12/notepad-text-editor +[26]: https://opensource.com/article/20/12/31-days-text-editors-pe +[27]: https://opensource.com/article/20/12/featherpad +[28]: https://opensource.com/sites/default/files/uploads/eclipse-31_days-eclipse-opensource.png +[29]: https://opensource.com/article/20/12/netbeans +[30]: https://opensource.com/article/20/12/eclipse +[31]: https://opensource.com/sites/default/files/uploads/etherpad_0.jpg +[32]: https://opensource.com/article/20/12/etherpad +[33]: https://opensource.com/article/20/12/31-days-text-editors-nextcloud-markdown-editor +[34]: https://opensource.com/sites/default/files/uploads/atom-31_days-atom-opensource.png +[35]: https://opensource.com/article/20/12/atom +[36]: https://opensource.com/article/20/12/brackets +[37]: https://opensource.com/article/20/12/focuswriter +[38]: https://opensource.com/article/20/12/howl +[39]: https://opensource.com/article/20/12/norka +[40]: https://opensource.com/article/20/12/kjots +[41]: https://opensource.com/sites/default/files/uploads/this-time-its-personal-31_days_yourself-opensource.png +[42]: https://opensource.com/article/20/12/31-days-text-editors-one-you-write-yourself From 9d55422d2bff15b0f5946089289e98372bedb032 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 12 Feb 2021 05:05:08 +0800 Subject: [PATCH 285/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210211=20?= =?UTF-8?q?What's=20new=20with=20ownCloud=20in=202021=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210211 What-s new with ownCloud in 2021.md --- ...210211 What-s new with ownCloud in 2021.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 sources/tech/20210211 What-s new with ownCloud in 2021.md diff --git a/sources/tech/20210211 What-s new with ownCloud in 2021.md b/sources/tech/20210211 What-s new with ownCloud in 2021.md new file mode 100644 index 0000000000..aa6507c932 --- /dev/null +++ b/sources/tech/20210211 What-s new with ownCloud in 2021.md @@ -0,0 +1,180 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What's new with ownCloud in 2021?) +[#]: via: (https://opensource.com/article/21/2/owncloud) +[#]: author: (Martin Loschwitz https://opensource.com/users/martinloschwitzorg) + +What's new with ownCloud in 2021? +====== +The open source file sharing and syncing platform gets a total overhaul +based on Go and Vue.js and eliminates the need for a database. +![clouds in the sky with blue pattern][1] + +The newest version of ownCloud, [ownCloud Infinite Scale][2] (OCIS), is a complete rewrite of the venerable open source enterprise file sharing and syncing software stack. It features a new backend written in Go, a frontend in Vue.js, and many changes, including eliminating the need for a database. This scalable, modular approach replaces ownCloud's PHP, database, and [POSIX][3] filesystem and promises up to 10 times better performance. + +Traditionally, ownCloud was centered around the idea of having a POSIX-compatible filesystem to store data uploaded by users—different versions of the data and trash files, as well as configuration files and logs. By default, an ownCloud user's files were found in a path on their ownCloud instance, like `/var/www` or `/srv/www` (a web server's document root). + +Every admin who has maintained an ownCloud instance knows that they grow massive; today, they usually start out much larger than ownCloud was originally designed for. One of the largest ownCloud instances is Australia's Academic and Research Network (AARNet), a company that stores more than 100,000 users' data. + +### Let's 'Go' for microservices + +ownCloud's developers determined that rewriting the codebase with [Go][4] could bring many advantages over PHP. Even when computer programs appear to be one monolithic piece of code, most are split into different components internally. The web servers that are usually deployed with ownCloud (such as Apache) are an excellent example. Internally, one function handles TCP/IP connections, another function might handle SSL, and yet another piece of code executes the requested PHP files and delivers the results to the end user. All of those events must happen in a certain order. + +ownCloud's developers wanted the new version to serve multiple steps concurrently so that events can happen simultaneously. Software capable of handling requests in parallel doesn't have to wait around for one process to finish before the next can begin, so they can deliver results faster. Concurrency is one of the reasons Go is so popular in containerized micro-architecture applications. + +With OCIS, ownCloud is adapting to an architecture centered around the principle of microservices. OCIS is split into three tiers: storage, core, and frontend. I'll look at each of these tiers, but the only thing that really matters to people is overall performance. Users don't think about software in tiers; they just want the software to work well and work quickly. + +### Tier 1: Storage + +The storage available to the system is ownCloud's lowest tier. Performance also brings scalability; large ownCloud instances must be able to cope with the load of thousands of clients and add additional disk space if the existing storage fills up. + +Like so many other concepts today, object stores and scalable storage weren't available when ownCloud was designed. Administrators now are used to having more choices, so ownCloud permits outsourcing physical storage device handling to an external solution. While S3-based object storage, Samba-based storage, and POSIX-compatible filesystem options are still supported in OCIS, the preferred way to deploy it is with [Earth Observing System][5] (EOS) storage. + +#### EOS to the rescue + +EOS is optimized for very low latency when accessing files. It provides disk-based storage to clients through the [XRootD][6] framework but also permits other protocols to access files. ownCloud uses EOS's HTTP protocol extension to talk to the storage solution (using the HTTPS protocol). EOS also allows almost "infinite" scalability. For instance, [CERN's EOS setup][7] includes more than 200PB of disk storage and continues to grow. + +By choosing EOS, ownCloud eliminated several shortcomings of traditional storage solutions: + + * EOS doesn't have a typical single point of failure. + * All relevant services are run redundantly, including the ability to scale out and add instances of all existing services. + * EOS promises to never run out of actual disk space and comes with built-in redundancy for stored data. + + + +For large environments, ownCloud expects the administrator to deploy an EOS instance with OCIS. In exchange for the burden of maintaining a separate storage system, the admin gets the benefit of not having to worry about the OCIS instance's scalability and performance. + +#### What about small setups? + +This hints at ownCloud's assumed use case for OCIS: It's no longer a small business all-in-one server nor a small home server. ownCloud's strategy with OCIS targets large data centers. For small or home office setups, EOS is likely to be excessive and overly demanding for a single admin to manage. OCIS serves small setups through the [Reva][8] framework, which enables support for S3, Samba, and even POSIX-compatible filesystems. This is possible because EOS is not hardcoded into OCIS. Reva can't provide the same feature set as EOS, but it accomplishes most of the needs of end users and small installations. + +### Tier 2: Core + +OCIS's second tier is (due to Go) more of a collection of microservices than a singular core. Each one is responsible for handling a single task in the background (e.g., scanning for viruses). Basically, all of OCIS's functionality results from a specific microservice's work, like authenticating requests using OpenID Connect against an identity provider. In the end, that makes it a simple task to connect existing user directories—such as Active Directory Federation Services (ADFS), Azure AD, or Lightweight Directory Access Protocol (LDAP)—to ownCloud. For those that do not have an existing identity provider, ownCloud ships its own instance, effectively making ownCloud maintain its own user database. + +### Tier 3: Frontend + +OCIS's third tier, the frontend, is what the vendor calls ownCloud Web. It's a complete rewrite of the user interface and is based on the Vue.js JavaScript framework. Like the OCIS core, the web frontend is written based on microservices principles and hence allows better performance and scalability. The developers also used the opportunity to give the web interface a makeover; compared to previous ownCloud versions, the OCIS web interface looks smaller and slicker. + +OCIS's developers did an impressive job complying with modern software design principles. The fundamental problem in building applications according to the microservices approach is making the environment's individual components communicate with each other. APIs can come to the rescue, but that means every micro component must have its own well-defined API interface. + +Luckily, there are existing tools to take that burden off developers' shoulders, most notably [gRPC][9]. The idea behind gRPC is to have a set of predefined APIs that trigger actions in one component from within another. + +### Other notable design changes + +#### Tackling network traffic with Traefik + +This new application design brings some challenges to the underlying network. OCIS's developers chose the [Traefik][10] framework to tackle them. Traefik automatically load-balances different instances of microservices, manages automated SSL encryption, and allows additional deployments of firewall rules. + +The split between the backend and the frontend add advantages to OCIS. In fact, the user's actions triggered through ownCloud Web are completely decoupled from the ownCloud engine performing the task in the backend. If a user manually starts a virus check on files stored in ownCloud, they don't have to wait for the check to finish. Instead, the check happens in the background, and the user sees the results after the check is completed. This is the principle of concurrency at work. + +#### Extensions as microservices + +Like other web services, ownCloud supports extending its capabilities through extensions. OCIS doesn't change this, but it promises to tackle a well-known problem, especially with community apps. Apps of unknown origin can cause trouble in the server, hamper updates, and negatively impact the server's overall performance. + +OCIS's new, gRPC-based architecture makes it much easier to create extensions alongside existing microservices. Because the API is predefined by gRPC, developers merely need to create a microservice featuring the desired functionality that can be controlled by gRPC. Traefik, on a per-case basis, ensures that newly deployed add-ons are automatically added to the existing communication mesh. + +#### Goodbye, MySQL! + +ownCloud's switch to gRPC and microservices eliminates the need for a relational database. Instead, components that need to store metadata do it on their own. Due to Reva and the lack of a MySQL dependency, the complexity of running ownCloud in small environments is reduced considerably—an especially welcome bonus for maintainers of large-scale data centers, but nice for admins of any size installation. + +### Getting OCIS up and running + +ownCloud published a technical preview of OCIS 1.0 in December 2020, [shipping it][11] as a Docker container and binaries. More examples of getting it running are linked in the deployment section of its [GitHub repository][12]. + +#### Install with Docker + +Getting OCIS up and running with Docker containers is easy, although things can get complicated if you're new to EOS. Docker images for OCIS are available on [Docker Hub][13]. Look for the Latest tag for the current master branch. + +Any standard virtual machine from one of the big cloud providers or any entry-level server in a data center that uses a standard Linux distribution should be sufficient, provided the system has a container runtime installed. + +Assuming you have Docker or Podman installed, the command to start OCIS is simple: + + +``` +`$ docker run --rm -ti -p 9200:9200 owncloud/ocis` +``` + +That's it! OCIS is now waiting at your service on localhost port 9200. Open a web browser and navigate to `http://localhost:9200` to check it out. + +The demo accounts and passwords are `einstein:relativity`, `marie:radioactivity`, and `richard:superfluidity`. Admin accounts are `moss:vista` and `admin:admin`. If OCIS runs on a server with a resolvable hostname, it can request an SSL certificate from Let's Encrypt using Traefik. + +![OCIS contains no files at first login][14] + +(Martin Loschwitz, [CC BY-SA 4.0][15]) + +![OCIS user management interface][16] + +(Martin Loschwitz, [CC BY-SA 4.0][15]) + +#### Install with binary + +As an alternative to Docker, there also is a pre-compiled binary available. Thanks to Go, users can [download the latest binaries][17] from the Master branch. + +OCIS's binary edition expects `/var/tmp/ocis` as the default storage location, but you can change that in its configuration. You can start the OCIS server with: + + +``` +`$ ./ocis server` +``` + +Here are some of the subcommands available through the `ocis` binary: + + * `ocis health` runs a health check. A result greater than 0 indicates an error. + * `ocis list` prints all running OCIS extensions. + * `ocis run foo` starts a particular extension (`foo`, in this example). + * `ocis kill foo` stops a particular extension (`foo`, in this example). + * `ocis --help` prints a help message. + + + +The project's GitHub repository contains full [documentation][11]. + +### Setting up EOS (it's complicated) + +Following ownCloud's recommendations to deploy OCIS with EOS for large environments requires some additional steps. EOS not only adds required hardware and increases the whole environment's complexity, but it's also a slightly bigger task to set it up. CERN provides concise [EOS documentation][18] (linked from its [GitHub repository][19]), and ownCloud offers a [step-by-step guide][20]. + +In a nutshell, users have to get and start EOS and OCIS containers; configure LDAP support; and kill home, users', and metadata storage before starting them with the EOS configuration. Last but not least, the accounts service needs to be set up to work with EOS. All of these steps are "docker-compose" commands documented in the GitHub repository. The Storage Backends page on EOS also provides information on verification, troubleshooting, and a command reference for the built-in EOS shell. + +### Weighing risks and rewards + +ownCloud Infinite Scale is easy to install, faster than ever before, and better prepared for scalability. The modular design, with microservices and APIs (even for its extensions), looks promising. ownCloud is embracing new technology and developing for the future. If you run ownCloud, or if you've been thinking of trying it, there's never been a better time. Keep in mind that this is still a technology preview and is on a rolling release published every three weeks, so please report any bugs you find. + +Jos Poortvliet shares some of his favorite uses for the open source self-hosted storage platform. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/owncloud + +作者:[Martin Loschwitz][a] +选题:[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/martinloschwitzorg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e (clouds in the sky with blue pattern) +[2]: https://owncloud.com/infinite-scale/ +[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[4]: https://golang.org/ +[5]: https://en.wikipedia.org/wiki/Earth_Observing_System +[6]: https://xrootd.slac.stanford.edu/ +[7]: https://eos-web.web.cern.ch/eos-web/ +[8]: https://reva.link/ +[9]: https://en.wikipedia.org/wiki/GRPC +[10]: https://opensource.com/article/20/3/kubernetes-traefik +[11]: https://owncloud.github.io/ocis/getting-started/ +[12]: https://github.com/owncloud/ocis +[13]: https://hub.docker.com/r/owncloud/ocis +[14]: https://opensource.com/sites/default/files/uploads/ocis5.png (OCIS contains no files at first login) +[15]: https://creativecommons.org/licenses/by-sa/4.0/ +[16]: https://opensource.com/sites/default/files/uploads/ocis2.png (OCIS user management interface) +[17]: https://download.owncloud.com/ocis/ocis/ +[18]: https://eos-docs.web.cern.ch/ +[19]: https://github.com/cern-eos/eos +[20]: https://owncloud.github.io/ocis/storage-backends/eos/ From 64d9540a3ef5609e162e76a1763cee2d7009abae Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 12 Feb 2021 10:25:35 +0800 Subject: [PATCH 286/381] Rename sources/tech/20210211 Understanding Open Governance Networks.md to sources/talk/20210211 Understanding Open Governance Networks.md --- .../20210211 Understanding Open Governance Networks.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210211 Understanding Open Governance Networks.md (100%) diff --git a/sources/tech/20210211 Understanding Open Governance Networks.md b/sources/talk/20210211 Understanding Open Governance Networks.md similarity index 100% rename from sources/tech/20210211 Understanding Open Governance Networks.md rename to sources/talk/20210211 Understanding Open Governance Networks.md From c557d36d8114d9cd6547d96a6211c6e911a24c21 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 12 Feb 2021 11:19:07 +0800 Subject: [PATCH 287/381] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ShuyRoy 感谢你,完成了第一篇翻译贡献! (不过,这篇有点过时了 —— 所以我在措辞上有修改,建议下回可以选择更新、更有意思的文章) --- ...s Optane for data center memory caching.md | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md b/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md index 5d258ab61f..a58313ed61 100644 --- a/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md +++ b/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md @@ -1,52 +1,48 @@ [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Intel formally launches Optane for data center memory caching) [#]: via: (https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all) [#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) -英特尔正式推出Optane:用于数据中心内存缓存 +英特尔 Optane:用于数据中心内存缓存 ====== -### 英特尔正式推出包含3D Xpoint 内存技术的傲腾持久内存产品线。英特尔的这个解决方案将傲腾持久内存放置在DRAM和NAND中间,以此来提升性能。 +![](https://img.linux.net.cn/data/attachment/album/202102/12/111720yq1rvxcncjdsjb0g.jpg) + +> 英特尔推出了包含 3D Xpoint 内存技术的 Optane 持久内存产品线。英特尔的这个解决方案介乎于 DRAM 和 NAND 中间,以此来提升性能。 ![Intel][1] -英特尔在周二(2019年4月2日)的[大数据中心活动][2]中正式推出傲腾持久内存产品线。傲腾持久内存已经问世了一段时间,但是目前的Xeon服务器处理器还不能充分利用它。而新的Xeon8200和9200可以充分利用傲腾持久内存的优势。 +英特尔在 2019 年 4 月的[大规模数据中心活动][2]中正式推出 Optane 持久内存产品线。它已经问世了一段时间,但是目前的 Xeon 服务器处理器还不能充分利用它。而新的 Xeon8200 和 9200 系列可以充分利用 Optane 持久内存的优势。 -由于傲腾是英特尔的产品(与美光合作开发),所以意味着AMD和ARM的服务器处理器不能够支持它。 +由于 Optane 是英特尔的产品(与美光合作开发),所以意味着 AMD 和 ARM 的服务器处理器不能够支持它。 -正如[我之前所说的][3],傲腾DC持久内存采用与美光合作研发的3D Xpoint内存技术。3D Xpoint是一种比SSD更快的非易失性内存,速度几乎与DRAM相近,而且它具有NAND flash的持久性。 +正如[我之前所说的][3],OptaneDC 持久内存采用与美光合作研发的 3D Xpoint 内存技术。3D Xpoint 是一种比 SSD 更快的非易失性内存,速度几乎与 DRAM 相近,而且它具有 NAND 闪存的持久性。 -**[ 小编推荐:[为什么是NVMe?用户会权衡基于NVMe加速的闪存的优点。][4] 和 [IDC的十大数据中心预测][5] | 定期更新的新闻[请注册网络世界通信][6] ]** +第一个 3D Xpoint 产品是被称为英特尔“尺子”的 SSD,因为它们被设计成细长的样子,很像尺子的形状。它们被设计这样是为了适合 1u 的服务器机架。在发布的公告中,英特尔推出了新的利用四芯或者 QLC 3D NAND 内存的英特尔 SSD D5-P4325 [尺子][7] SSD,可以在 1U 的服务器机架上放 1PB 的存储。 -第一个3D Xpoint产品是被称为英特尔“尺子”的SSD,因为它们被设计成细长的样子,很像尺子的形状。他们被设计得能够适合1u的服务器托架。在周二发布的公告中,英特尔推出了新的利用四-cell或者QLC 3D NAND 内存的英特尔SSD D5-P4325[“尺子”][7]SSD,可以在1u的服务器托架上放1PB的存储。 +OptaneDC 持久内存的可用容量最初可以通过使用 128GB 的 DIMM 达到 512GB。英特尔数据中心集团执行副总裁及总经理 Navin Shenoy 说:“OptaneDC 持久内存可达到的容量是 DRAM 的 2 到 4 倍。” -傲腾DC持久内存的可用容量最初可以通过使用128GB的DIMM达到512GB。这次活动的关键人物——英特尔数据中心集团执行副总裁及总经理Navin Shenoy说:“傲腾DC持久内存可达到的容量是DRAM的2到4倍。” +他说:“我们希望服务器系统的容量可以扩展到每个插槽 4.5TB 或者 8 个插槽 36TB,这是我们第一代 Xeon 可扩展芯片的 3 倍。” -他说:“我们希望服务器系统的容量可以扩展到每个插槽4.5TB或者8个插槽36TB,这是我们第一代Xeon可扩展芯片的3倍。” +### 英特尔Optane内存的使用和速度 -## 英特尔傲腾内存的使用和速度 +Optane 有两种不同的运行模式:内存模式和应用直连模式。内存模式是将 DRAM 放在 Optane 内存之上,将 DRAM 作为 Optane 内存的缓存。应用直连模式是将 DRAM 和 OptaneDC 持久内存一起作为内存来最大化总容量。并不是每个工作负载都适合这种配置,所以应该在对延迟不敏感的应用程序中使用。正如英特尔推广的那样,Optane 的主要使用情景是内存模式。 -傲腾有两种不同的运行模式:内存模式和APP直连模式。内存模式是将DRAM放在傲腾内存之上,将DRAM作为傲腾内存的缓存。APP直连模式是将DRAM和傲腾持久内存一起作为内存来最大化总容量。并不是每个工作负载都适合这种配置,所以应该在对延迟不敏感的应用程序中使用。正如英特尔推广的那样,傲腾的主要使用情景是内存模式。 +几年前,当 3D Xpoint 最初发布时,英特尔宣称 Optane 的速度是 NAND 的 1000 倍,耐用是 NAND 的 1000 倍,密度潜力是 DRAM 的 10 倍。这虽然有点夸张,但这些因素确实很令人着迷。 -**[[通过PluralSight上的7部分线上课程来获得苹果技术合作者的认证。][8] ]** +在 256B 的连续 4 个缓存行中使用 Optane 内存可以达到 8.3GB/秒的读速度和 3.0GB/秒的写速度。与 SATA SSD 的 500MB/秒左右的读/写速度相比,可以看到性能有很大提升。请记住,Optane 充当内存,所以它会缓存被频繁访问的 SSD 中的内容。 -几年前,当3D Xpoint最初发布时,英特尔宣称傲腾的速度是NAND的1000倍,忍耐力是NAND的1000倍,密度是DRAM的10倍。这虽然有点夸张,但这些因素确实很令人着迷。 +这是了解 OptaneDC 的关键。它能将非常大的数据集存储在离内存非常近的位置,因此具有很低延迟的 CPU 可以最小化访问较慢的存储子系统的访问延迟,无论存储是 SSD 还是 HDD。现在,它提供了一种可能性,即把多个 TB 的数据放在非常接近 CPU 的地方,以实现更快的访问。 -在256B的连续4个缓存行中使用傲腾内存可以达到8.3GB/秒的读速度和3.0GB/秒的写速度。与SATA SSD的500MB/秒左右的读/写速度相比,可以看到性能有很大提升。请记住,傲腾充当内存,所以它会缓存被频繁访问的SSD中的内容。 +### Optane 内存的一个挑战 -这是了解傲腾DC的关键。它能将非常大的数据集存储在离内存非常近的位置,因此具有很低延迟的CPU可以最小化访问较慢的存储子系统的访问延迟,无论存储是SSD还是HDD。现在,它提供了将很多TB的数据放在离CPU很近的位置,以获得更快的访问速度。 +唯一真正的挑战是 Optane 插进内存所在的 DIMM 插槽。现在有些主板的每个 CPU 有多达 16 个 DIMM 插槽,但是这仍然是客户和设备制造商之间需要平衡的电路板空间:Optane 还是内存。有一些 Optane 驱动采用了 PCIe 接口进行连接,可以减轻主板上内存的拥挤。 -## 傲腾内存的一个挑战 - -唯一真正的挑战是傲腾然后插进内存所在的DIMM插槽。现在有些主板的每个CPU有16个插槽,但是这仍然是客户和设备制造商之间需要平衡的:傲腾VS内存。有一些傲腾驱动采用了PCIe接口进行连接,可以减轻主板上内存的拥挤。 - -3D Xpoint由于它写数据的方式,提供了比传统的NAND flash更高的耐久力。英特尔承诺傲腾提供5年保修期,而很多SSD只提供3年保修期。 - -加入Facebook[Facebook][9]和LinkedIn[LinkedIn][10]上的网络世界社区,对你最关心的话题发表评论吧。 +3D Xpoint 由于它写数据的方式,提供了比传统的 NAND 闪存更高的耐用性。英特尔承诺 Optane 提供 5 年保修期,而很多 SSD 只提供 3 年保修期。 -------------------------------------------------------------------------------- @@ -55,7 +51,7 @@ via: https://www.networkworld.com/article/3387117/intel-formally-launches-optane 作者:[Andy Patrizio][a] 选题:[lujun9972][b] 译者:[RiaXu](https://github.com/ShuyRoy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 793ba23ba2688862bce16322cb8cb62c85ada64e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 12 Feb 2021 11:20:08 +0800 Subject: [PATCH 288/381] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ShuyRoy 本问首发地址:https://linux.cn/article-13109-1.html 你的 LCTT 专页:https://linux.cn/lctt/ShuyRoy --- ...formally launches Optane for data center memory caching.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190404 Intel formally launches Optane for data center memory caching.md (98%) diff --git a/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md b/published/20190404 Intel formally launches Optane for data center memory caching.md similarity index 98% rename from translated/tech/20190404 Intel formally launches Optane for data center memory caching.md rename to published/20190404 Intel formally launches Optane for data center memory caching.md index a58313ed61..f07eb56caa 100644 --- a/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md +++ b/published/20190404 Intel formally launches Optane for data center memory caching.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13109-1.html) [#]: subject: (Intel formally launches Optane for data center memory caching) [#]: via: (https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all) [#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) From a595e417531e8a0a98ffc9b8680b621a9bb1ee0a Mon Sep 17 00:00:00 2001 From: MjSeven Date: Fri, 12 Feb 2021 15:28:41 +0800 Subject: [PATCH 289/381] Translating --- .../20210115 How to Create and Manage Archive Files in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210115 How to Create and Manage Archive Files in Linux.md b/sources/tech/20210115 How to Create and Manage Archive Files in Linux.md index d49695b76f..ee99ce7a6d 100644 --- a/sources/tech/20210115 How to Create and Manage Archive Files in Linux.md +++ b/sources/tech/20210115 How to Create and Manage Archive Files in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2dd5f33f3a2d3c0f9d98b5c7fbd5a65673a9e6ad Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 12 Feb 2021 16:25:25 +0800 Subject: [PATCH 290/381] PRF @Chao-zhi --- ...ver With Material Shell GNOME Extension.md | 62 +++++++++---------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md b/translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md index cefcca8080..3393a9bdbc 100644 --- a/translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md +++ b/translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension) @@ -10,91 +10,87 @@ 使用 Material Shell 扩展将你的 GNOME 桌面打造成平铺式风格 ====== -平铺式窗口的特性吸引了很多人的追捧。也许是因为他很好看,也许是因为对于 [linux 快捷键 ][1] 玩家他能提高效率。又或者是因为使用不同寻常的平铺式窗口是一种挑战。 +平铺式窗口的特性吸引了很多人的追捧。也许是因为它很好看,也许是因为它能提高 [Linux 快捷键][1] 玩家的效率。又或者是因为使用不同寻常的平铺式窗口是一种新奇的挑战。 ![Tiling Windows in Linux | Image Source][2] -从 i3 到 [Sway][3],linux 桌面拥有各种各样的平铺式窗口管理器。配置一个平铺式窗口管理器需要一个陡峭的学习曲线。 +从 i3 到 [Sway][3],Linux 桌面拥有各种各样的平铺式窗口管理器。配置一个平铺式窗口管理器需要一个陡峭的学习曲线。 -这就是为什么像 [Regolith desktop][4] 这样的项目会存在,它给你提供一个已经配置好的平铺式桌面。所以你不需要做大多的准备就可以直接开始使用。 +这就是为什么像 [Regolith 桌面][4] 这样的项目会存在,给你预先配置好的平铺桌面,让你可以更轻松地开始使用平铺窗口。 -让我给你介绍一个相似的项目 ——Material Shell。它可以让你用上平铺式桌面,甚至比 [Regolith][5] 还简单。 +让我给你介绍一个类似的项目 —— Material Shell。它可以让你用上平铺式桌面,甚至比 [Regolith][5] 还简单。 ### Material Shell 扩展:将 GNOME 桌面转变成平铺式窗口管理器 -[Material Shell][6] 是一个 GNOME 扩展,这就是它最好的点。这意味着你不需要注销并登陆其他桌面环境。你只需要启用或关闭这个扩展就可以自如的切换你的工作环境。 +[Material Shell][6] 是一个 GNOME 扩展,这就是它最好的地方。这意味着你不需要注销并登录其他桌面环境。你只需要启用或关闭这个扩展就可以自如的切换你的工作环境。 我会列出 Material Shell 的各种特性,但是也许视频更容易让你理解: -[Subscribe to our YouTube channel for more Linux videos][7] +- [video](https://youtu.be/Wc5mbuKrGDE) -这个项目叫做 Material Shell 是因为他遵循 [Material Design][8] 原则。因此这个应用拥有一个美观的界面。这就是他最重要的一个特性。 +这个项目叫做 Material Shell 是因为它遵循 [Material Design][8] 原则。因此这个应用拥有一个美观的界面。这就是它最重要的一个特性。 #### 直观的界面 -Material Shell 添加了一个左侧面板,可以快速访问。在此面板上,您可以在底部找到系统托盘,在顶部找到搜索和工作区。 +Material Shell 添加了一个左侧面板,以便快速访问。在此面板上,你可以在底部找到系统托盘,在顶部找到搜索和工作区。 -所有新打开的应用都会添加到当前工作区中。您也可以创建新的工作区并切换到该工作区,以将正在运行的应用分类。其实这就是工作区最初的意义。 +所有新打开的应用都会添加到当前工作区中。你也可以创建新的工作区并切换到该工作区,以将正在运行的应用分类。其实这就是工作区最初的意义。 在 Material Shell 中,每个工作区都可以显示为具有多个应用程序的行列,而不是包含多个应用程序的程序框。 #### 平铺式窗口 -在工作区中,你可以看到所有打开的应用程序都在顶部。默认情况下,应用程序会像在 GNOME desktop 中那样铺满整个屏幕。你可以使用右上角的布局改变器来改变布局,将其分成两半、多列或多个应用网格。 +在工作区中,你可以一直在顶部看到所有打开的应用程序。默认情况下,应用程序会像在 GNOME 桌面中那样铺满整个屏幕。你可以使用右上角的布局改变器来改变布局,将其分成两半、多列或多个应用网格。 这段视频一目了然的显示了以上所有功能: -<!-- 丢了个视频链接,我不知道怎么添加 --> +- [video](https://player.vimeo.com/video/460050750?dnt=1&app_id=122963) #### 固定布局和工作区 -Material Shell 会记住你打开的工作区和窗口,这样你就不必重新组织你的布局。这是一个很好的特性,因为如果您对应用程序的位置有要求的话,它可以节省时间。 +Material Shell 会记住你打开的工作区和窗口,这样你就不必重新组织你的布局。这是一个很好的特性,因为如果你对应用程序的位置有要求的话,它可以节省时间。 #### 热建/快捷键 -像任何平铺窗口管理器一样,您可以使用键盘快捷键在应用程序和工作区之间切换。 +像任何平铺窗口管理器一样,你可以使用键盘快捷键在应用程序和工作区之间切换。 * `Super+W` 切换到上个工作区; * `Super+S` 切换到下个工作区; * `Super+A` 切换到左边的窗口; * `Super+D` 切换到右边的窗口; - * `Super+1`,`Super+2` … `Super+0` 切换到某个指定的工作区; + * `Super+1`、`Super+2` … `Super+0` 切换到某个指定的工作区; * `Super+Q` 关闭当前窗口; - * `Super+[MouseDrag]` 移动窗口; + * `Super+[鼠标拖动]` 移动窗口; * `Super+Shift+A` 将当前窗口左移; * `Super+Shift+D` 将当前窗口右移; - * `Super+Shift+W` 将当前窗口上移; - * `Super+Shift+S` 将当前窗口下移。 - - + * `Super+Shift+W` 将当前窗口移到上个工作区; + * `Super+Shift+S` 将当前窗口移到下个工作区。 ### 安装 Material Shell -警告! +> 警告! +> +> 对于大多数用户来说,平铺式窗口可能会导致混乱。你最好先熟悉如何使用 GNOME 扩展。如果你是 Linux 新手或者你害怕你的系统发生翻天覆地的变化,你应当避免使用这个扩展。 -对于大多数用户来说,平铺式窗口可能会导致混乱。你最好先熟悉如何使用 GNOME 扩展。如果你是 Linux 新手或者你害怕你的系统发生翻天覆地的变化,你应当避免使用这个扩展。 +Material Shell 是一个 GNOME 扩展。所以,请 [检查你的桌面环境][9],确保你运行的是 GNOME 3.34 或者更高的版本。 -Material Shell 是一个 GNOME 扩展。所以,请你[检查你的桌面环境 ][9] 确保它是 _**GNOME 3.34 或者更高的版本**_。 +除此之外,我注意到在禁用 Material Shell 之后,它会导致 Firefox 的顶栏和 Ubuntu 的坞站消失。你可以在 GNOME 的“扩展”应用程序中禁用/启用 Ubuntu 的坞站扩展来使其变回原来的样子。我想这些问题也应该在系统重启后消失,虽然我没试过。 -我还想补充一点,平铺窗口可能会让许多用户感到困惑。 - -除此之外,我注意到在禁用 Material Shell 之后,它会导致 Firefox 和 Ubuntu dock 的顶栏消失。你可以在 GNOME 的扩展应用程序中禁用/启用 Ubuntu 的 dock 扩展来使其变回原来的样子。我想这些问题也应该在系统重启后消失,虽然我没试过。 - -我希望你知道[如何使用 GNOME 扩展 ][10]。最简单的办法就是[在浏览器中打开这个链接 ][11],安装 GNOME 扩展浏览器插件并且启用 Material Shell 扩展。 +我希望你知道 [如何使用 GNOME 扩展][10]。最简单的办法就是 [在浏览器中打开这个链接][11],安装 GNOME 扩展浏览器插件,然后启用 Material Shell 扩展即可。 ![][12] -如果你不喜欢这个扩展,你也可以在同样的链接中禁用它。或者在 GNOME 扩展程序中禁用它。 +如果你不喜欢这个扩展,你也可以在同样的链接中禁用它。或者在 GNOME 的“扩展”应用程序中禁用它。 ![][13] -**使不使用平铺式** +### 用不用平铺式? 我使用多个电脑屏幕,我发现 Material Shell 不适用于多个屏幕的情况。这是开发者将来可以改进的地方。 -除了这个毛病以外,Material Shell 是个让你开始使用平铺式窗口的好东西。如果你尝试了 Material Shell 并且喜欢它,请通过[给它一个星或在 GitHub 上赞助它 ][14] 来鼓励这个项目。 +除了这个毛病以外,Material Shell 是个让你开始使用平铺式窗口的好东西。如果你尝试了 Material Shell 并且喜欢它,请 [在 GitHub 上给它一个星标或赞助它][14] 来鼓励这个项目。 -由于某些原因,平铺窗户越来越受欢迎。最近发布的 [Pop OS 20.04][15] 也增加了平铺窗口的功能。 +由于某些原因,平铺窗户越来越受欢迎。最近发布的 [Pop OS 20.04][15] 也增加了平铺窗口的功能。有一个类似的项目叫 PaperWM,也是这样做的。 但正如我前面提到的,平铺布局并不适合所有人,它可能会让很多人感到困惑。 @@ -107,7 +103,7 @@ via: https://itsfoss.com/material-shell/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f7821427f927b11e8a2ba81cfc23dc0bd654410d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 12 Feb 2021 16:25:52 +0800 Subject: [PATCH 291/381] PUB @Chao-zhi https://linux.cn/article-13110-1.html --- ...p a Tiling Makeover With Material Shell GNOME Extension.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md (98%) diff --git a/translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md b/published/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md similarity index 98% rename from translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md rename to published/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md index 3393a9bdbc..a645f460fb 100644 --- a/translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md +++ b/published/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13110-1.html) [#]: subject: (Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension) [#]: via: (https://itsfoss.com/material-shell/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From e7cef5732e7dbbceddfa019bf974a09fe746fb43 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: Fri, 12 Feb 2021 16:39:39 +0800 Subject: [PATCH 292/381] Apply for translation File Name: 20210118 10 ways to get started with open source in 2021.md Translator: mengxinayan --- ...to get started with open source in 2021.md | 124 ------------------ ...to get started with open source in 2021.md | 123 +++++++++++++++++ 2 files changed, 123 insertions(+), 124 deletions(-) delete mode 100644 sources/tech/20210118 10 ways to get started with open source in 2021.md create mode 100644 translated/tech/20210118 10 ways to get started with open source in 2021.md diff --git a/sources/tech/20210118 10 ways to get started with open source in 2021.md b/sources/tech/20210118 10 ways to get started with open source in 2021.md deleted file mode 100644 index df73a60f33..0000000000 --- a/sources/tech/20210118 10 ways to get started with open source in 2021.md +++ /dev/null @@ -1,124 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (mengxinayan) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (10 ways to get started with open source in 2021) -[#]: via: (https://opensource.com/article/21/1/getting-started-open-source) -[#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeo) - -10 ways to get started with open source in 2021 -====== -If you're new to open source, 2020's top 10 articles about getting -started will help guide your path. -![Looking at a map for career journey][1] - -Opensource.com exists to educate the world about everything open source, from new tools and frameworks to scaling communities. We aim to make open source more accessible to anyone who wants to use or contribute to it. - -Getting started in open source can be hard, so we regularly share tips and advice on how you can get involved. If you want to learn Python, help fight COVID-19, or join the Kubernetes community, we've got you covered. - -To help you begin, we curated the 10 most popular articles on getting started in open source we published in 2020. We hope they'll inspire you to learn something new in 2021. - -### A beginner's guide to web scraping with Python - -Want to learn Python through doing, not reading? In this tutorial, Julia Piaskowski guides you through her first [web scraping project in Python][2]. She shows how to access webpage content with Python library requests. - -Julia walks through each step, from installing Python 3 to cleaning web scraping results with pandas. Aided by screenshots galore, she explains how to scrape with an end goal in mind. - -The section on extracting relevant content is especially helpful; she doesn't mince words when saying this can be tough. But, like the rest of the article, she guides you through each step. - -### A beginner's guide to SSH for remote connections on Linux - -If you've never opened a secure shell (SSH) before, the first time can be confusing. In this tutorial, Seth Kenlon shows how to [configure two computers for SSH connections][3] and securely connect them without a password. - -From four key phrases you should know to steps for activating SSH on each host, Seth explains every step of making SSH connections. He includes advice on finding your computer's IP address, creating an SSH key, and verifying your access to a remote machine. - -### 5 steps to learn any programming language - -If you know one programming language, you can [learn them all][4]. That's the premise of this article by Seth Kenlon, which argues that knowing some basic programming logic can scale across languages. - -Seth shares five things programmers look for when considering a new language to learn to code in. Syntax, built-ins, and parsers are among the five, and he accompanies each with steps to take action. - -The key argument uniting them all? Once you know the theory of how code works, it scales across languages. Nothing is too hard for you to learn. - -### Contribute to open source healthcare projects for COVID-19 - -Did you know that an Italian hospital saved COVID-19 patients' lives by 3D printing valves for reanimation devices? It's one of many ways open source contributors [built solutions for the pandemic][5] in 2020. - -In this article, Joshua Pearce shares several ways to volunteer with open source projects addressing COVID-19. While Project Open Air is the largest, Joshua explains how you can also work on a wiki for an open source ventilator, write open source COVID-19 medical supply requirements, test an open source oxygen concentrator prototype, and more. - -### Advice for getting started with GNOME - -GNOME is one of the most popular Linux desktops, but is it right for you? This article shares [advice from GNOME][6] users interspersed with Opensource.com's take on this topic. - -Want some inspiration for configuring your desktop? This article includes links to get started with GNOME extensions, installing Dash to Dock, using the GNOME Tweak tool, and more. - -After all that, you might decide that GNOME still isn't for you—and that's cool. You'll find links to other Linux desktops and window managers at the end. - -### 3 reasons to contribute to open source now - -As of June 2020, GitHub hosted more than 180,000 public repositories. It's never been easier to join the open source community, but does that mean you should? In this article, Opensource.com Correspondent Jason Blais [shares three reasons][7] to take the plunge. - -Contributing to open source can boost your confidence, resume, and professional network. Jason explains how to leverage your contributions in helpful detail, from sharing how to add open source contributions on your LinkedIn profile to turning these contributions into paid roles. There's even a list of great projects for first-time contributors at the end. - -### 4 ways I contribute to open source as a Linux systems administrator - -Sysadmins are the unsung heroes of open source. They do lots of work behind the code that's deeply valuable but often unseen. - -In this article, Elizabeth K. Joseph explains how she [improves open source projects][8] as a Linux sysadmin. User support, hosting project resources, and finding new website environments are just a few ways she leaves communities better than she found them. - -Perhaps the most crucial contribution of all? Documentation! Elizabeth got her start in open source rewriting a quickstart guide for a project she used. Submitting bugs and patch reports to projects you use often is an ideal way to get involved. - -### 6 ways to contribute to an open source alternative to Slack - -Mattermost is a popular platform for teams that want an open source messaging system. Its active, vibrant community is a key plus that keeps users loyal to the product, especially those with experience in Go, React, and DevOps. - -If you'd like to [contribute to Mattermost][9], Jason Blais explains how. Consider this article your Getting Started documentation: Blais shares steps to take, organized by six types of contributions you can make. - -Whether you'd like to build an integration or localize your language, this article shares how to get going. - -### How to contribute to Kubernetes - -I walked into Open Source Summit 2018 in Vancouver young and unaware of Kubernetes. After the keynotes, I walked out of the ballroom a changed-yet-confused woman. It's not hyperbole to say that Kubernetes has changed open source for good: It's tough to find a more popular, impactful project. - -If you'd like to contribute, IBM Engineer Tara Gu explains [how she got started.][10] This recap of her lightning talk at All Things Open 2019 includes a video of the talk she gave in person. At a conference. Remember those…? - -### How anyone can contribute to open source software in their job - -Necessity is the mother of invention, especially in open source. Many folks build open source solutions to their own problems. But what happens when developers miss the mark by building products without gathering feedback from their target users? - -Product and design teams often fill this gap in enterprises. What should developers do if such roles don't exist on their open source teams? - -In this article, Catherine Robson explains how open source teams [can collect feedback][11] from their target users. It's written for folks who want to share their work experiences with developers, thus contributing their feedback to open source projects. - -The steps Catherine outlines will help you share your insights with open source teams and play a key role helping teams build better products. - -### What do you want to learn? - -What would you like to know about getting started in open source? Please share your suggestions for article topics in the comments. And if you have a story to share to help others get started in open source, please consider [writing an article][12] for Opensource.com. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/getting-started-open-source - -作者:[Lauren Maffeo][a] -选题:[lujun9972][b] -译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/lmaffeo -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/career_journey_road_gps_path_map_520.png?itok=PpL6jJgY (Looking at a map for career journey) -[2]: https://opensource.com/article/20/5/web-scraping-python -[3]: https://opensource.com/article/20/9/ssh -[4]: https://opensource.com/article/20/10/learn-any-programming-language -[5]: https://opensource.com/article/20/3/volunteer-covid19 -[6]: https://opensource.com/article/20/6/gnome-users -[7]: https://opensource.com/article/20/6/why-contribute-open-source -[8]: https://opensource.com/article/20/7/open-source-sysadmin -[9]: https://opensource.com/article/20/7/mattermost -[10]: https://opensource.com/article/20/1/contributing-kubernetes-all-things-open-2019 -[11]: https://opensource.com/article/20/10/open-your-job -[12]: https://opensource.com/how-submit-article diff --git a/translated/tech/20210118 10 ways to get started with open source in 2021.md b/translated/tech/20210118 10 ways to get started with open source in 2021.md new file mode 100644 index 0000000000..b57fca86f5 --- /dev/null +++ b/translated/tech/20210118 10 ways to get started with open source in 2021.md @@ -0,0 +1,123 @@ +[#]: collector: (lujun9972) +[#]: translator: (mengxinayan) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 ways to get started with open source in 2021) +[#]: via: (https://opensource.com/article/21/1/getting-started-open-source) +[#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeo) + +2021 年开始使用开源的10钟方法 +====== +如果您刚开始接触开源,那么下面的 2020 年十大文章有助于指导您的发展之路。 +![看着职业生涯的地图][1] + +opensource.com 存在的意义是为了向世界宣传开源的一切,从新工具到框架拓展到社区。我们的目标是让想要使用开源或为开源做贡献的人更容易参与其中。 + +入门开源可能很难,所以我们定期分享如何参与其中的提示和建议。如果你想要学习 Python,帮助抗击 COVID-19,或者加入 K8s 设置,我们将为您服务。 + +为了帮助您开始,我们总结了2020年发布的 10 篇最流行的开源入门文章。希望它们能激发您在 2021 年学习一些新知识。 + +### 利用 Python 实现网络爬虫的新手指南 + +您是否想通过实践而不是阅读来学习 Python?在本教程中,Julia Piaskowski 将会指导您完成她的第一个[Python 网页爬取项目][2]。她具体展示了如何使用 Python 库请求访问网页内容。 + +Julia 详细介绍了每一步,从安装 Python3 到使用 pandas 来清洁 Web 抓取结果。她利用了大量截图解释了如何以最终目标为目的进行爬取。 + +有关爬取相关内容的部分特别有用;当遇到困难处时,她会详细解释。但是,与本文的其余部分一样,她会指导您完成每个步骤。 + +### 在 Linux 上使用 SSH 进行远程连接的初学者指南 + +如果你之前从未使用过安全 shell(SSH),那么你在第一次使用时可能会感到困惑。在本教程中,Seth Kenlon 展示了[如何为两台计算机之间配置 SSH 连接][3],以及如何不使用密码而安全地进行连接。 + +Seth 解释了建立 SSH 连接的每个步骤,从您应该了解的四个关键术语到在每个主机上激活 SSH 的步骤。他还提供了有关查找计算机 IP 地址、创建 SSH 密钥以及堆远程计算机的远程访问权限的建议。 + +### 学习任何编程语言的 5 个步骤 + +如果您已经掌握了一种编程语言,则可以[全部学习[4]。这是 Seth Kenlon 编写本文的前提,他认为了解一些基本编程逻辑便可以跨语言拓展。 + +Seth 分享了程序员在学习一种新的编程语言或编码方式时所需要的五种东西。语法、内置函数和解析器位于这五种之中,他将会陪着每个人采取行动。 + +那么团结它们的关键方式是?一旦了解了代码工作原理,您就可以跨语言拓展。没有什么太难的让您学习。 + +### 为 COVID-19 贡献开源医疗项目 + +您是否知道一家意大利医院通过 3D 打印机设备挽救了 COVID-19 患者的生命?这是开源贡献者为 2020 年 COVID-19 大流行[建立的众多解决方案之一][5]。 + +在本文中,Joshua Pearce 分享了针对 COVID-19 的开源志愿服务项目。虽然 Open Air 是最大的项目,但 Joshua 解释了如何在 wiki 上为开源呼吸机工作,编写开源 COVID-19 医疗供应要求,测试开源氧气浓缩机原型等。 + +### GNOME 入门建议 + +GNOME 是最受欢迎的 Linux 桌面之一,但是它适合您吗?本文分享了[来自 GNOME 用户的建议][6],以及 opensource.com 上有关此主题的文章。 + +想要在配置桌面上寻找一些灵感吗?本文包含了有关 GNOME 拓展入门,将 Dash 安装到 Dock,使用 GNOME Tweak 工具等的链接。 + +毕竟,您可能会认为 GNOME 仍然不适合您——不用担心,最后您将找到指向其他 Linux 桌面和窗口管理器的链接。 + +### 现在开始为开源做贡献的 3 个理由 + +截至到 2020 年 6 月,Github 托管了超过 180,000 个公共仓库。现如今加入开源社区比过去更容易,但这是意味着您应该这样做?在本文中,opensource.com 通讯员 Jason Blais [分享了三个尝试的原因][7]。 + +为开源做贡献可以增强您的信心,简历和专业网络。Jason 还解释了如何利用有用的信息,从如何在领英(LinkedIn)个人资料中添加开源信息,到如何将这些信息转变为付费角色。 最后还列出了供初学者使用的出色项目。 + +### 作为 Linux 系统管理员为开源做贡献的 4 种方法 + +系统管理员是开源的无名英雄。他们在代码背后做了大量工作,这些代码非常有价值,但通常是看不见的。 + +在本文中,Elizabeth K. Joseph 介绍了她如何以 Linux 系统管理员的身份[来改善开源项目][8]。她离开社区比发现社区更好的几种方式为用户支持、托管项目资源以及查找新的网站环境。 + +也许最重要的贡献是什么?文档!Elizabeth 开始使用开源程序,为她使用的项目重写了快速入门指南。同时向您经常使用的项目提交错误和补丁报告是参与其中的理想方法。 + +### 为 Slack 的开源替代品做出贡献的 6 种方法 + +Mattermost 是需要开源消息传递系统的团队的流行平台。其活跃、充满活力的社区是让用户保持忠诚度的关键因素,尤其是对那些具有 Go,React 和 DevOps 经验的用户。 + +如果您想[为 Mattermost 做出贡献][9],Jason Blais 具体介绍了如何参与其中。将本文视为您的入门文档:Blais 分享了您要采取的步骤,并介绍了您可以做出的六种贡献。 + +无论您是要构建集成还是本地化语言,本文都将介绍如何进行。 + +### 如何为 K8s 做贡献 + +当我走进 2018 年温哥华青年开源峰会却不了解 K8s。主题演讲结束后,我离开会场后依然是一个困惑的女人。毫不夸张地说,K8s 已经彻底改变了开源:找到一个更受欢迎、更具影响力的项目很困难。 + +如果您想做出贡献,那么 IBM 工程师 Tara Gu 介绍了[她是如何开始的][10]。本文介绍了她在 All Things Open 2019 会议上的闪电演讲的回顾以及包括她亲自演讲的视频。还记得那些吗? + +### 任何人如何在工作中为开源软件做出贡献 + +必要性是发明之母,尤其是在开源中。许多人针对自己遇到的问题构建开源解决方案。但是如果开发人员在没有收集目标用户反馈的情况下通过构建产品而错过了商标,会发生什么呢? + +产品和设计团队通常会填补企业中的这一空白。如果开源团队中不存在这样的角色,开发人员应该怎么做? + +在本文中,Catherine Robson 介绍了开源团队如何从目标用户那里[收集反馈][11]。它为希望与开发人员分享他们的工作经验,从而将他们的反馈贡献到开源项目的人们而编写。 + +Catherine 概述的步骤将帮助您与开源团队分享您的见解,并在帮助团队开发更好的产品方面发挥关键作用。 + +### 您想要学习什么? + +您想了解开源入门哪些方面的知识?请在评论中分享您堆文章主题的建议。同时如果您有一个故事可以分享,以帮助他人开始使用开源软件,请考虑为 opensource.com [编写文章][12]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/getting-started-open-source + +作者:[Lauren Maffeo][a] +选题:[lujun9972][b] +译者:[萌新阿岩](https://github.com/mengxinayan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lmaffeo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/career_journey_road_gps_path_map_520.png?itok=PpL6jJgY (Looking at a map for career journey) +[2]: https://opensource.com/article/20/5/web-scraping-python +[3]: https://opensource.com/article/20/9/ssh +[4]: https://opensource.com/article/20/10/learn-any-programming-language +[5]: https://opensource.com/article/20/3/volunteer-covid19 +[6]: https://opensource.com/article/20/6/gnome-users +[7]: https://opensource.com/article/20/6/why-contribute-open-source +[8]: https://opensource.com/article/20/7/open-source-sysadmin +[9]: https://opensource.com/article/20/7/mattermost +[10]: https://opensource.com/article/20/1/contributing-kubernetes-all-things-open-2019 +[11]: https://opensource.com/article/20/10/open-your-job +[12]: https://opensource.com/how-submit-article From 7af0784bfc10135b6f012b983022a3924edfb8fd Mon Sep 17 00:00:00 2001 From: amwps290 Date: Fri, 12 Feb 2021 17:57:32 +0800 Subject: [PATCH 293/381] translated --- ...20210204 A hands-on tutorial of SQLite3.md | 272 ------------------ 1 file changed, 272 deletions(-) delete mode 100644 sources/tech/20210204 A hands-on tutorial of SQLite3.md diff --git a/sources/tech/20210204 A hands-on tutorial of SQLite3.md b/sources/tech/20210204 A hands-on tutorial of SQLite3.md deleted file mode 100644 index b5427ff9b7..0000000000 --- a/sources/tech/20210204 A hands-on tutorial of SQLite3.md +++ /dev/null @@ -1,272 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (amwps290) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (A hands-on tutorial of SQLite3) -[#]: via: (https://opensource.com/article/21/2/sqlite3-cheat-sheet) -[#]: author: (Klaatu https://opensource.com/users/klaatu) - -A hands-on tutorial of SQLite3 -====== -Get started with this incredibly powerful and common database. Download -the SQLite cheat sheet. -![Cheat Sheet cover image][1] - -Applications very often save data. Whether your users create simple text documents, complex graphic layouts, game progress, or an intricate list of customers and order numbers, software usually implies that data is being generated. There are many ways to store data for repeated use. You can dump text to configuration formats such as INI, [YAML][2], XML, or JSON, you can write out raw binary data, or you can store data in a structured database. SQLite is a self-contained, lightweight database that makes it easy to create, parse, query, modify, and transport data. - -**[Download our [SQLite3 cheat sheet][3]]** - -SQLite has been dedicated to the [public domain][4], which [technically means it is not copyrighted and therefore requires no license][5]. Should you require a license, you can [purchase a Warranty of Title][6]. SQLite is immensely common, with an estimated 1 _trillion_ SQLite databases in active use. That's counting multiple databases on every Android and iOS device, every macOS and Windows 10 computer, most Linux systems, within every Webkit-based web browser, modern TV sets, automotive multimedia systems, and countless other software applications. - -In summary, it's a reliable and simple system to use for storing and organizing data. - -### Installing - -You probably already have SQLite libraries on your system, but you need its command-line tools installed to use it directly. On Linux, you probably already have these tools installed. The command provided by the tools is **sqlite3** (not just **sqlite**). - -If you don't have SQLite installed on Linux or BSD, you can install it from your software repository or ports tree, or [download and install it][7] from source code or as a compiled binary. - -On macOS or Windows, you can download and install SQLite tools from [sqlite.org][7]. - -### Using SQLite - -It's common to interact with a database through a programming language. For this reason, there are SQLite interfaces (or "bindings") for Java, Python, Lua, PHP, Ruby, C++, and many many others. However, before using these libraries, it helps to understand what's actually happening with the database engine and why your choice of a database is significant. This article introduces you to SQLite and the **sqlite3** command so you can get familiar with the basics of how this database handles data. - -### Interacting with SQLite - -You can interact with SQLite using the **sqlite3** command. This command provides an interactive shell so you can view and update your databases. - - -``` -$ sqlite3 -SQLite version 3.34.0 2020-12-01 16:14:00 -Enter ".help" for usage hints. -Connected to a transient in-memory database. -Use ".open FILENAME" to reopen on a persistent database. -sqlite> -``` - -The command places you in an SQLite subshell, and so your prompt is now an SQLite prompt. Your usual Bash commands don't work here. You must use SQLite commands. To see a list of SQLite commands, type **.help**: - - -``` -sqlite> .help -.archive ...             Manage SQL archives -.auth ON|OFF             SHOW authorizer callbacks -.backup ?DB? FILE        Backup DB (DEFAULT "main") TO FILE -.bail ON|off             Stop after hitting an error.  DEFAULT OFF -.binary ON|off           Turn BINARY output ON OR off.  DEFAULT OFF -.cd DIRECTORY            CHANGE the working directory TO DIRECTORY -[...] -``` - -Some of these commands are binary, while others require unique arguments (like filenames, paths, etc.). These are administrative commands for your SQLite shell and are not database queries. Databases take queries in Structured Query Language (SQL), and many SQLite queries are the same as what you may already know from the [MySQL][8] and [MariaDB][9] databases. However, data types and functions differ, so pay close attention to minor differences if you're familiar with another database. - -### Creating a database - -When launching SQLite, you can either open a prompt in memory, or you can select a database to open: - - -``` -`$ sqlite3 mydatabase.db` -``` - -If you have no database yet, you can create one at the SQLite prompt: - - -``` -`sqlite> .open mydatabase.db` -``` - -You now have an empty file on your hard drive, ready to be used as an SQLite database. The file extension **.db** is arbitrary. You can also use **.sqlite**, or whatever you want. - -### Creating a table - -Databases contain _tables_, which can be visualized as a spreadsheet. There's a series of rows (called _records_ in a database) and columns. The intersection of a row and a column is called a _field_. - -The Structured Query Language (SQL) is named after what it provides: A method to inquire about the contents of a database in a predictable and consistent syntax to receive useful results. SQL reads a lot like an ordinary English sentence, if a little robotic. Currently, your database is empty, devoid of any tables. - -You can create a table with the **CREATE** query. It's useful to combine this with the **IF NOT EXISTS** statement, which prevents SQLite from clobbering an existing table. - -You can't create an empty table in SQLite, so before trying a **CREATE** statement, you must think about what kind of data you anticipate the table will store. In this example, I'll create a table called _member_ with these columns: - - * A unique identifier - * A person's name - * The date and time of data entry - - - -#### Unique ID - -It's always good to refer to a record by a unique number, and luckily SQLite recognizes this and does it automatically for you in a column called **rowid**. - -No SQL statement is required to create this field. - -#### Data types - -For my example table, I'm creating a _name_ column to hold **TEXT** data. To prevent a record from being created without data in a specified field, you can add the **NOT NULL** directive. - -The SQL to create this field is: **name TEXT NOT NULL** - -There are five data types (actually _storage classes_) in SQLite: - - * TEXT: a text string - * INTEGER: a whole number - * REAL: a floating point (unlimited decimal places) number - * BLOB: binary data (for instance, a .jpeg or .webp image) - * NULL: a null value - - - -#### Date and time stamp - -SQLite includes a convenient date and timestamp function. It is not a data type itself but a function in SQLite that generates either a string or integer, depending on your desired format. In this example, I left it as the default. - -The SQL to create this field is: **datestamp DATETIME DEFAULT CURRENT_TIMESTAMP** - -### Table creation SQL - -The full SQL for creating this example table in SQLite: - - -``` -sqlite> CREATE TABLE -...> IF NOT EXISTS -...> member (name TEXT NOT NULL, -...> datestamp DATETIME DEFAULT CURRENT_TIMESTAMP -``` - -In this code sample, I pressed **Return** after the logical clauses of the statement to make it easier to read. SQLite won't run your command unless it terminates with a semi-colon (**;**). - -You can verify that the table has been created with the SQLite command **.tables**: - - -``` -sqlite> .tables -member -``` - -### View all columns in a table - -You can verify what columns and rows a table contains with the **PRAGMA** statement: - - -``` -sqlite> PRAGMA table_info(member); -0|name|TEXT|1||0 -1|datestamp|CURRENT_TIMESTAMP|0||0 -``` - -### Data entry - -You can populate your new table with some sample data by using the **INSERT** SQL keyword: - - -``` -> INSERT INTO member (name) VALUES ('Alice'); -> INSERT INTO member (name) VALUES ('Bob'); -> INSERT INTO member (name) VALUES ('Carol'); -> INSERT INTO member (name) VALUES ('David'); -``` - -Verify the data in the table: - - -``` -> SELECT * FROM member; -Alice|2020-12-15 22:39:00 -Bob|2020-12-15 22:39:02 -Carol|2020-12-15 22:39:05 -David|2020-12-15 22:39:07 -``` - -#### Adding multiple rows at once - -Now create a second table: - - -``` -> CREATE TABLE IF NOT EXISTS linux ( -...> distro TEXT NOT NULL) -``` - -Populate it with some sample data, this time using a little **VALUES** shortcut so you can add multiple rows in just one command. The **VALUES** keyword expects a list in parentheses but can take multiple lists separated by commas: - - -``` -> INSERT INTO linux (distro) -...> VALUES ('Slackware'), ('RHEL'), -...> ('Fedora'),('Debian'); -``` - -### Altering a table - -You now have two tables, but as yet, there's no relationship between the two. They each contain independent data, but possibly you might need to associate a member of the first table to a specific item listed in the second. - -To do that, you can create a new column for the first table that corresponds to something in the second. Because both tables were designed with unique identifiers (automatically, thanks to SQLite), the easiest way to connect them is to use the **rowid** field of one as a selector for the other. - -Create a new column in the first table to represent a value in the second table: - - -``` -`> ALTER TABLE member ADD os INT;` -``` - -Using the unique IDs of the **linux** table, assign a distribution to each member. Because the records already exist, you use the **UPDATE** SQL keyword rather than **INSERT**. Specifically, you want to select one row and then update the value of one column. Syntactically, this is expressed a little in reverse, with the update happening first and the selection matching last: - - -``` -`> UPDATE member SET os=1 WHERE name='Alice';` -``` - -Repeat this process for the other names in the **member** table, just to populate it with data. For variety, assign three different distributions across the four rows (doubling up on one). - -### Joining tables - -Now that these two tables relate to one another, you can use SQL to display the associated data. There are many kinds of _joins_ in databases, but you can try them all once you know the basics. Here's a basic join to correlate the values found in the **os** field of the **member** table to the **id** field of the **linux** table: - - -``` -> SELECT * FROM member INNER JOIN linux ON member.os=linux.rowid; -Alice|2020-12-15 22:39:00|1|Slackware -Bob|2020-12-15 22:39:02|3|Fedora -Carol|2020-12-15 22:39:05|3|Fedora -David|2020-12-15 22:39:07|4|Debian -``` - -The **os** and **id** fields form the join. - -In a graphical application, you can imagine that the **os** field might be set by a drop-down menu, the values for which are drawn from the contents of the **distro** field of the **linux** table. By using separate tables for unique but related sets of data, you ensure the consistency and validity of data, and thanks to SQL, you can associate them dynamically later. - -### Learning more - -SQLite is an infinitely useful self-contained, portable, open source database. Learning to use it interactively is a great first step toward managing it for web applications or using it through programming language libraries. - -If you enjoy SQLite, you might also try [Fossil][10] by the same author, Dr. Richard Hipp. - -As you learn and use SQLite, it may help to have a list of common commands nearby, so download our **[SQLite3 cheat sheet][3]** today! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/sqlite3-cheat-sheet - -作者:[Klaatu][a] -选题:[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/klaatu -[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://www.redhat.com/sysadmin/yaml-beginners -[3]: https://opensource.com/downloads/sqlite-cheat-sheet -[4]: https://sqlite.org/copyright.html -[5]: https://directory.fsf.org/wiki/License:PublicDomain -[6]: https://www.sqlite.org/purchase/license? -[7]: https://www.sqlite.org/download.html -[8]: https://www.mysql.com/ -[9]: https://mariadb.org/ -[10]: https://opensource.com/article/20/11/fossil From 0475c479a3422e946e0589cf801e6cca0aa13973 Mon Sep 17 00:00:00 2001 From: amwps290 Date: Fri, 12 Feb 2021 18:14:54 +0800 Subject: [PATCH 294/381] translated --- ...20210204 A hands-on tutorial of SQLite3.md | 282 ++++++++++++++++++ 1 file changed, 282 insertions(+) create mode 100644 translated/tech/20210204 A hands-on tutorial of SQLite3.md diff --git a/translated/tech/20210204 A hands-on tutorial of SQLite3.md b/translated/tech/20210204 A hands-on tutorial of SQLite3.md new file mode 100644 index 0000000000..cab669bf2e --- /dev/null +++ b/translated/tech/20210204 A hands-on tutorial of SQLite3.md @@ -0,0 +1,282 @@ +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "A hands-on tutorial of SQLite3" +[#]: via: "https://opensource.com/article/21/2/sqlite3-cheat-sheet" +[#]: author: "Klaatu https://opensource.com/users/klaatu" + + +SQLite3 实践教程 +====== + + + +开始使用这个功能强大且通用的数据库吧。你可以先下载 SQLite 备忘单。 + +![Cheat Sheet cover image][1] + +应用程序经常需要保存数据。 无论您的用户是创建简单的文本文档,复杂的图形布局,游戏进度还是错综复杂的客户和订单号列表,通常都暗示着正在生成数据。 有很多方法可以存储数据以供重复使用。 您可以将文本转储为 INI,[YAML][2],XML 或 JSON 等格式,可以输出原始的二进制数据,也可以将数据存储在结构化数据库中。 SQLite 是一个自包含的轻量级数据库,可轻松创建,解析,查询,修改和传输数据。 + +**下载 [SQLite3 备忘录][3]** + +SQLite 一直致力于[公共领域][4],[从技术上讲,它没有版权,因此不需要许可证][5]。 如果您需要许可证,则可以[购买所有权担保][6]。 SQLite 非常常见,大约有 1 万亿个 SQLite 数据库正在使用中。 在每个基于 Webkit 的 Web 浏览器,现代电视机,汽车多媒体系统以及无数其他软件应用程序中, Android 和 iOS 设备, macOS 和 Windows 10 计算机,大多数 Linux 系统上都包含多个数据库。 + + +总而言之,它是用于存储和组织数据的一个可靠而简单的系统。 + + +**安装** + +您的系统上可能已经有 SQLite 库,但是您需要安装其命令行工具才能直接使用它。 在 Linux上,您可能已经安装了这些工具。 工具提供的命令是 **sqlite3** (而不仅仅是 **sqlite**)。 + +如果没有在您的 Linux 或 BSD 上安装 SQLite,您则可以从软件仓库中或 ports tree 中安装 SQLite,也可以从源代码或已编译的二进制文件进行[下载并安装][7]。 + +在 macOS 或 Windows 上,您可以从 [sqlite.org][7] 下载并安装 SQLite 工具。 + +### 使用 SQLite + +通过编程语言与数据库进行交互是很常见的。 因此,像 Java,Python,Lua,PHP,Ruby,C ++ 以及其他编程语言都提供了 SQLite 的接口(或“绑定”)。 但是,在使用这些库之前,使用基本的命令有助于了解数据库引擎实际发生的情况以及选择数据库的重要性。 本文向您介绍 SQLite 和 **sqlite3** 命令,以便您熟悉该数据库如何处理数据的基础知识。 + +### 与 SQLite 交互 + +您可以使用 **sqlite3** 命令与 SQLite 进行交互。 该命令提供了一个交互式的 shell 程序,以便您可以查看和更新数据库。 + + +``` +$ sqlite3 +SQLite version 3.34.0 2020-12-01 16:14:00 +Enter ".help" for usage hints. +Connected to a transient in-memory database. +Use ".open FILENAME" to reopen on a persistent database. +sqlite> +``` + +该命令将您使您处于 SQLite 的子 shell 中,因此现在的提示是 SQLite 的提示。 您以前使用的 Bash 命令在这里将不再适用。 您必须使用 SQLite 命令。 要查看 SQLite 命令列表,请输入 **. help **: + + +``` +sqlite> .help +.archive ... Manage SQL archives +.auth ON|OFF SHOW authorizer callbacks +.backup ?DB? FILE Backup DB (DEFAULT "main") TO FILE +.bail ON|off Stop after hitting an error. DEFAULT OFF +.binary ON|off Turn BINARY output ON OR off. DEFAULT OFF +.cd DIRECTORY CHANGE the working directory TO DIRECTORY +[...] +``` + +这些命令中的一些是二进制的,而其他一些则需要唯一的参数(如文件名,路径等)。 这些是 SQLite Shell 的管理命令,不是用于数据库查询。 数据库以结构化查询语言(SQL)进行查询,许多 SQLite 查询与您从 [MySQL][8] 和 [MariaDB][9] 数据库中已经知道的查询相同。 但是,数据类型和功能不同,因此,如果您熟悉另一个数据库,请特别注意细微的差异。 + +### 创建数据库 + +启动 SQLite 时,可以打开内存中的提示,也可以选择要打开的数据库: + + +``` +`$ sqlite3 mydatabase.db` +``` + +如果还没有数据库,则可以在 SQLite 提示符下创建一个数据库: + + +``` +`sqlite> .open mydatabase.db` +``` +现在,您的硬盘驱动器上有一个空文件,可以用作 SQLite 数据库。 文件扩展名 **.db** 是任意的。 您也可以使用 **.sqlite** 或任何您想要的后缀。 + +### 创建一个表 + +数据库包含一些 _表_,可以将其可视化为电子表格。 有许多的行(在数据库中称为 _记录_ )和列。 行和列的交集称为 _域_。 + +结构化查询语言(SQL)以其提供的名称命名:是一种以可预测且一致的语法查询数据库内容以接收有用的结果的方法。 SQL 读起来很像普通的英语句子,即使有点像机器人一样。 当前,您的数据库是一个没有任何表的空数据库。 + +你可以使用 **CREATE** 来创建一个新表,你可以和 **IF NOT EXISTS** 结合使用。以便不会破坏现在已有的同名的表。 + +您无法在 SQLite 中创建一个没有任何字段的空表,因此在尝试 **CREATE** 语句之前,必须考虑预期表将存储的数据类型。 在此示例中,我将使用以下列创建一个名为 _member_ 的表: + + * 唯一标识符 + * 人名 + * 记录创建的时间和日期 + +#### 唯一标识符 + + +最好用唯一的编号来引用记录,幸运的是,SQLite 认识到这一点,创建一个名叫 **rowid** 的列来自动实现这一点。 + + +无需 SQL 语句即可创建此字段。 + + +#### 数据类型 + + +对于我的示例表中,我正在创建一个 _name_ 列来保存 **TEXT** 类型的数据。 为了防止在没有指定字段数据的情况下创建记录,可以添加 **NOT NULL** 指令。 + +用 **name TEXT NOT NULL** 语句来创建。 + +SQLite 中有五种数据类型(实际上是 _储存类别_): + + * TEXT: 文本字符串 + * INTEGER: 一个数字 + * REAL: 一个浮点数(小数位数无限制) + * BLOB: 二进制数据(例如,.jpeg或.webp图像) + * NULL: 空值 + + +#### 日期和时间戳 + +SQLite 有一个方便的日期和时间戳功能。 它本身不是数据类型,而是 SQLite 中的一个函数,它根据所需的格式生成字符串或整数。 在此示例中,我将其保留为默认值。 + + +创建此字段的 SQL 语句是:**datestamp DATETIME DEFAULT CURRENT_TIMESTAMP** + +### 创表语句 + + +在 SQLite 中创建此示例表的完整 SQL: + + +``` +sqlite> CREATE TABLE +...> IF NOT EXISTS +...> member (name TEXT NOT NULL, +...> datestamp DATETIME DEFAULT CURRENT_TIMESTAMP +``` + +在此代码示例中,我在语句的分句后按了回车键。以使其更易于阅读。 SQLite 除非以分号(**;**)终止,否则不会运行您的命令。 + +您可以使用 SQLite 命令 **.tables** 验证表是否已创建: + + +``` +sqlite> .tables +member +``` + +### 查看表中的所有列 + +您可以使用 **PRAGMA** 语句验证表包含哪些列和行: + + +``` +sqlite> PRAGMA table_info(member); +0|name|TEXT|1||0 +1|datestamp|CURRENT_TIMESTAMP|0||0 +``` + +### 数据输入 + +您可以使用 **INSERT** 语句将一些示例数据填充到表中: + + +``` +> INSERT INTO member (name) VALUES ('Alice'); +> INSERT INTO member (name) VALUES ('Bob'); +> INSERT INTO member (name) VALUES ('Carol'); +> INSERT INTO member (name) VALUES ('David'); +``` + +查看表中的数据 + + +``` +> SELECT * FROM member; +Alice|2020-12-15 22:39:00 +Bob|2020-12-15 22:39:02 +Carol|2020-12-15 22:39:05 +David|2020-12-15 22:39:07 +``` + +#### 添加多行数据 + +现在创建第二个表: + + +``` +> CREATE TABLE IF NOT EXISTS linux ( +...> distro TEXT NOT NULL) +``` + +填充一些示例数据,这一次使用多个 **VALUES** 的快捷方式,因此您可以在一个命令中添加多行。 关键字 **VALUES** 期望在括号中列出一个列表,但可以采用多个用逗号分隔列表: + + +``` +> INSERT INTO linux (distro) +...> VALUES ('Slackware'), ('RHEL'), +...> ('Fedora'),('Debian'); +``` + +### 修改表 + +您现在有两个表,但是到目前为止,两者之间没有任何关系。 它们每个都包含独立的数据,但是可能您可能需要将第一个表的成员与第二个表中列出的特定项相关联。 + +为此,您可以为第一个表创建一个新列,该列对应于第二个表。 由于两个表都设计有唯一标识符(这要归功于 SQLite 的自动创建),所以连接它们的最简单方法是将其中一个的 **rowid** 字段用作另一个的选择器。 + +在第一个表中创建一个新列,以存储第二个表中的值: + + +``` +`> ALTER TABLE member ADD os INT;` +``` + +使用 **linux** 表中的唯一标识符,作为 member 表中每一条记录中 os 字段的值。因为记录已经存在。因此你可以使用 **UPDATE** 语句而不是使用 **INSERT** 语句来更新数据。需要特别注意的是,你首先需要选中特定的一行来然后才能更新其中的某个字段。从句法上讲,这有点相反,更新首先发生,选择匹配最后发生: + + +``` +`> UPDATE member SET os=1 WHERE name='Alice';` +``` + + +对 **member** 表中的其他行重复相同的过程。更新 os 字段,为了数据多样性,在四行记录上分配三种不同的发行版。 + +### 联接表 + +现在,这两个表相互关联,您可以使用 SQL 显示关联的数据。 数据库中有多种 _joins_ ,但是一旦掌握了基础知识,就可以尝试全部使用。 这是一个基本联接,用于将 member 表的 os 字段中的值与 linux 表的 id 字段相关联: + + +``` +> SELECT * FROM member INNER JOIN linux ON member.os=linux.rowid; +Alice|2020-12-15 22:39:00|1|Slackware +Bob|2020-12-15 22:39:02|3|Fedora +Carol|2020-12-15 22:39:05|3|Fedora +David|2020-12-15 22:39:07|4|Debian +``` + +**os** 和 **id** 字段形成了关联 + +在一个图形应用程序中,你可以想象 os 字段是一个下拉选项按钮,其中的值是 **linux** 表中 **distro** 字段中的数据。通过将相关的数据集通过唯一的字段相关联,可以确保数据的一致性和有效性,并且借助 SQL,您可以在以后动态地关联它们。 + + +### 了解更多 + +SQLite 是一个非常有用的独立,可移植的开源数据库。 学习以交互方式使用它是迈向针对 Web 应用程序进行管理或通过编程语言库使用它的重要的第一步。 + +如果您喜欢 SQLite,也可以尝试由同一位作者 Richard Hipp 博士的 [Fossil][10]。 + +在学习和使用 SQLite 时,有一些常用命令可能会有所帮助,所以请立即下载我们的 **[SQLite3备忘单][3] **! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/sqlite3-cheat-sheet + +作者:[Klaatu][a] +选题:[lujun9972][b] +译者:[amwps290](https://github.com/amwps290) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/klaatu +[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://www.redhat.com/sysadmin/yaml-beginners +[3]: https://opensource.com/downloads/sqlite-cheat-sheet +[4]: https://sqlite.org/copyright.html +[5]: https://directory.fsf.org/wiki/License:PublicDomain +[6]: https://www.sqlite.org/purchase/license? +[7]: https://www.sqlite.org/download.html +[8]: https://www.mysql.com/ +[9]: https://mariadb.org/ +[10]: https://opensource.com/article/20/11/fossil From b225ad1664131d537df22e0d8ed53a4ff1f56bc6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 13 Feb 2021 05:03:17 +0800 Subject: [PATCH 295/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210212=20?= =?UTF-8?q?Network=20address=20translation=20part=202=20=E2=80=93=20the=20?= =?UTF-8?q?conntrack=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210212 Network address translation part 2 - the conntrack tool.md --- ...translation part 2 - the conntrack tool.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20210212 Network address translation part 2 - the conntrack tool.md diff --git a/sources/tech/20210212 Network address translation part 2 - the conntrack tool.md b/sources/tech/20210212 Network address translation part 2 - the conntrack tool.md new file mode 100644 index 0000000000..b0ab9085c3 --- /dev/null +++ b/sources/tech/20210212 Network address translation part 2 - the conntrack tool.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Network address translation part 2 – the conntrack tool) +[#]: via: (https://fedoramagazine.org/network-address-translation-part-2-the-conntrack-tool/) +[#]: author: (Florian Westphal https://fedoramagazine.org/author/strlen/) + +Network address translation part 2 – the conntrack tool +====== + +![][1] + +This is the second article in a series about network address translation (NAT). The first article introduced [how to use the iptables/nftables packet tracing feature][2] to find the source of NAT-related connectivity problems. Part 2 introduces the “conntrack” command. conntrack allows you to inspect and modify tracked connections. + +### Introduction + +NAT configured via iptables or nftables builds on top of netfilters connection tracking facility. The _conntrack_ command is used to inspect and alter the state table. It is part of the “conntrack-tools” package. + +### Conntrack state table + +The connection tracking subsystem keeps track of all packet flows that it has seen. Run “_sudo conntrack -L_” to see its content: + +``` +tcp 6 43184 ESTABLISHED src=192.168.2.5 dst=10.25.39.80 sport=5646 dport=443 src=10.25.39.80 dst=192.168.2.5 sport=443 dport=5646 [ASSURED] mark=0 use=1 +tcp 6 26 SYN_SENT src=192.168.2.5 dst=192.168.2.10 sport=35684 dport=443 [UNREPLIED] src=192.168.2.10 dst=192.168.2.5 sport=443 dport=35684 mark=0 use=1 +udp 17 29 src=192.168.8.1 dst=239.255.255.250 sport=48169 dport=1900 [UNREPLIED] src=239.255.255.250 dst=192.168.8.1 sport=1900 dport=48169 mark=0 use=1 +``` + +Each line shows one connection tracking entry. You might notice that each line shows the addresses and port numbers twice and even with inverted address and port pairs! This is because each entry is inserted into the state table twice. The first address quadruple (source and destination address and ports) are those recorded in the original direction, i.e. what the initiator sent. The second quadruple is what conntrack expects to see when a reply from the peer is received. This solves two problems: + + 1. If a NAT rule matches, such as IP address masquerading, this is recorded in the reply part of the connection tracking entry and can then be automatically applied to all future packets that are part of the same flow. + 2. A lookup in the state table will be successful even if its a reply packet to a flow that has any form of network or port address translation applied. + + + +The original (first shown) quadruple stored never changes: Its what the initiator sent. NAT manipulation only alters the reply (second) quadruple because that is what the receiver will see. Changes to the first quadruple would be pointless: netfilter has no control over the initiators state, it can only influence the packet as it is received/forwarded. When a packet does not map to an existing entry, conntrack may add a new state entry for it. In the case of UDP this happens automatically. In the case of TCP conntrack can be configured to only add the new entry if the TCP packet has the [SYN bit][3] set. By default conntrack allows mid-stream pickups to not cause problems for flows that existed prior to conntrack becoming active. + +### Conntrack state table and NAT + +As explained in the previous section, the reply tuple listed contains the NAT information. Its possible to filter the output to only show entries with source or destination nat applied. This allows to see which kind of NAT transformation is active on a given flow. _“sudo conntrack -L -p tcp –src-nat_” might show something like this: + +``` +tcp 6 114 TIME_WAIT src=10.0.0.10 dst=10.8.2.12 sport=5536 dport=80 src=10.8.2.12 dst=192.168.1.2 sport=80 dport=5536 [ASSURED] +``` + +This entry shows a connection from 10.0.0.10:5536 to 10.8.2.12:80. But unlike the previous example, the reply direction is not just the inverted original direction: the source address is changed. The destination host (10.8.2.12) sends reply packets to 192.168.1.2 instead of 10.0.0.10. Whenever 10.0.0.10 sends another packet, the router with this entry replaces the source address with 192.168.1.2. When 10.8.2.12 sends a reply, it changes the destination back to 10.0.0.10. This source NAT is due to a [nft masquerade][4] rule: + +``` +inet nat postrouting meta oifname "veth0" masquerade +``` + +Other types of NAT rules, such as “dnat to” or “redirect to” would be shown in a similar fashion, with the reply tuples destination different from the original one. + +### Conntrack extensions + +Two useful extensions are conntrack accounting and timestamping. _“sudo sysctl net.netfilter.nf_conntrack_acct=1”_ makes _“sudo conntrack -L_” track byte and packet counters for each flow. + +_“sudo sysctl net.netfilter.nf_conntrack_timestamp=1”_ records a “start timestamp” for each connection. _“sudo conntrack -L”_ then displays the seconds elapsed since the flow was first seen. Add “_–output ktimestamp_” to see the absolute start date as well. + +### Insert and change entries + +You can add entries to the state table. For example: + +``` +sudo conntrack -I -s 192.168.7.10 -d 10.1.1.1 --protonum 17 --timeout 120 --sport 12345 --dport 80 +``` + +This is used by conntrackd for state replication. Entries of an active firewall are replicated to a standby system. The standby system can then take over without breaking connectivity even on established flows. Conntrack can also store metadata not related to the packet data sent on the wire, for example the conntrack mark and connection tracking labels. Change them with the “update” (-U) option: + +``` +sudo conntrack -U -m 42 -p tcp +``` + +This changes the connmark of all tcp flows to 42. + +### **Delete entries** + +In some cases, you want to delete enries from the state table. For example, changes to NAT rules have no effect on packets belonging to flows that are already in the table. For long-lived UDP sessions, such as tunneling protocols like VXLAN, it might make sense to delete the entry so the new NAT transformation can take effect. Delete entries via _“sudo conntrack -D_” followed by an optional list of address and port information. The following example removes the given entry from the table: + +``` +sudo conntrack -D -p udp --src 10.0.12.4 --dst 10.0.0.1 --sport 1234 --dport 53 +``` + +### Conntrack error counters + +Conntrack also exports statistics: + +``` +# sudo conntrack -S +cpu=0 found=0 invalid=130 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=10 +cpu=1 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=0 +cpu=2 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=1 +cpu=3 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=0 +``` + +Most counters will be 0. “Found” and “insert” will always be 0, they only exist for backwards compatibility. Other errors accounted for are: + + * invalid: packet does not match an existing connection and doesn’t create a new connection. + * insert_failed: packet starts a new connection, but insertion into the state table failed. This can happen for example when NAT engine happened to pick identical source address and port when Masquerading. + * drop: packet starts a new connection, but no memory is available to allocate a new state entry for it. + * early_drop: conntrack table is full. In order to accept the new connection existing connections that did not see two-way communication were dropped. + * error: icmp(v6) received icmp error packet that did not match a known connection + * search_restart: lookup interrupted by an insertion or deletion on another CPU. + * clash_resolve: Several CPUs tried to insert identical conntrack entry. + + + +These error conditions are harmless unless they occur frequently. Some can be mitigated by tuning the conntrack sysctls for the expected workload. _net.netfilter.nf_conntrack_buckets_ and _net.netfilter.nf_conntrack_max_ are typical candidates. See the [nf_conntrack-sysctl documentation][5] for a full list. + +Use “_sudo sysctl_ _net.netfilter.nf_conntrack_log_invalid=255″_ to get more information when a packet is invalid. For example, when conntrack logs the following when it encounters a packet with all tcp flags cleared: + +``` +nf_ct_proto_6: invalid tcp flag combination SRC=10.0.2.1 DST=10.0.96.7 LEN=1040 TOS=0x00 PREC=0x00 TTL=255 ID=0 PROTO=TCP SPT=5723 DPT=443 SEQ=1 ACK=0 +``` + +### Summary + +This article gave an introduction on how to inspect the connection tracking table and the NAT information stored in tracked flows. The next part in the series will expand on the conntrack tool and the connection tracking event framework. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/network-address-translation-part-2-the-conntrack-tool/ + +作者:[Florian Westphal][a] +选题:[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/strlen/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/02/network-address-translation-part-2-816x345.jpg +[2]: https://fedoramagazine.org/network-address-translation-part-1-packet-tracing/ +[3]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_segment_structure +[4]: https://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT)#Masquerading +[5]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/nf_conntrack-sysctl.rst From 56675d8c1159d0d6676ed19d0018d60d4c8fe87e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 13 Feb 2021 05:03:50 +0800 Subject: [PATCH 296/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210212=20?= =?UTF-8?q?4=20reasons=20to=20choose=20Linux=20for=20art=20and=20design?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210212 4 reasons to choose Linux for art and design.md --- ...sons to choose Linux for art and design.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20210212 4 reasons to choose Linux for art and design.md diff --git a/sources/tech/20210212 4 reasons to choose Linux for art and design.md b/sources/tech/20210212 4 reasons to choose Linux for art and design.md new file mode 100644 index 0000000000..6acb0ec2d8 --- /dev/null +++ b/sources/tech/20210212 4 reasons to choose Linux for art and design.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 reasons to choose Linux for art and design) +[#]: via: (https://opensource.com/article/21/2/linux-art-design) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +4 reasons to choose Linux for art and design +====== +Open source enhances creativity by breaking you out of a proprietary +mindset and opening your mind to possibilities. Explore several open +source creative programs. +![Painting art on a computer screen][1] + +In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Today I'll explain why Linux is an excellent choice for creative work. + +Linux gets a lot of press for its amazing server and cloud computing software. It comes as a surprise to some that Linux happens to have a great set of creative tools, too, and that they easily rival popular creative apps in user experience and quality. When I first started using open source creative software, it wasn't because I didn't have access to the other software. Quite the contrary, I started using open source tools when I had the greatest access to the proprietary tools offered by several leading companies. I chose to switch to open source because open source made more sense and produced better results. Those are some big claims, so allow me to explain. + +### High availability means high productivity + +The term _productivity_ means different things to different people. When I think of productivity, it's that when you sit down to do something, it's rewarding when you're able to meet whatever goal you've set for yourself. If you get interrupted or stopped by something outside your control, then your productivity goes down. + +Computers can seem unpredictable, and there are admittedly a lot of things that can go wrong. There are lots of hardware parts to a computer, and any one of them can break at any time. Software has bugs and updates to fix bugs, and then new bugs introduced by those updates. If you're not comfortable with computers, it can feel a little like a timebomb just waiting to ensnare you. With so much potentially working _against_ you in the digital world, it doesn't make sense to me to embrace software that guarantees not to work when certain requirements (like a valid license, or more often, an up-to-date subscription) aren't met. + +![Inkscape application][2] + +Inkscape + +Open source creative apps have no required subscription fee and no licensing requirements. They're available when you need them and usually on any platform. That means when you sit down at a working computer, you know you have access to your must-have software. And if you're having a rough day and you find yourself sitting in front of a computer that isn't working, the fix is to find one that does work, install your creative suite, and get to work. + +It's far harder to find a computer that _can't_ run Inkscape, for instance, than it is to find a computer that _is_ running a similar proprietary application. That's called high availability, and it's a game-changer. I've never found myself wasting hours of my day for lack of the software I want to run to get things done. + +### Open access is better for diversity + +When I was working in the creative industry, it sometimes surprised me how many of my colleagues were self-taught both in their artistic and technical disciplines. Some taught themselves on expensive rigs with all the latest "professional" applications, but there was always a large group of people who perfected their digital trade on free and open source software because, as kids or as poor college students, that was what they could afford and obtain easily. + +That's a different kind of high availability, but it's one that's important to me and many other users who wouldn't be in the creative industry but for open source. Even open source projects that do offer a paid subscription, like [Ardour][3], ensure that users have access to the software regardless of an ability to pay. + +![Ardour interface][4] + +Ardour + +When you don't restrict who gets to use your software, you're implicitly inviting more users. And when you do that, you enable a greater diversity of creative voices. Art loves influence, and the greater the variety of experiences and ideas you have to draw from, the better. That's what's possible with open source creative software. + +### Resolute format support is more inclusive + +We all acknowledge the value of inclusivity in basically every industry. Inviting _more people_ to the party results in a greater spectacle, in nearly every sense. Knowing this, it's painful when I see a project or initiative that invites people to collaborate, only to limit what kind of file formats are acceptable. It feels archaic, like a vestige of elitism out of the far past, and yet it's a real problem even today. + +In a surprise and unfortunate twist, it's not because of technical limitations. Proprietary software has access to open file formats because they're open source and free to integrate into any application. Integrating these formats requires no reciprocation. By stark contrast, proprietary file formats are often shrouded in secrecy, locked away for use by the select few who pay to play. It's so bad, in fact, that quite often, you can't open some files to get to your data without the proprietary software available. Amazingly, open source creative applications nevertheless include support for as many proprietary formats as they possibly can. Here's just a sample of Inkscape's staggering support list: + +![Available Inkscape file formats][5] + +Inkscape file formats + +And that's largely without contribution from the companies owning the file formats. + +Supporting open file formats is more inclusive, and it's better for everyone. + +### No restrictions for fresh ideas + +One of the things I've come to love about open source is the sheer diversity of how any given task is interpreted. When you're around proprietary software, you tend to start to see the world based on what's available to you. For instance, if you're thinking of manipulating some photos, then you generally frame your intent based on what you know to be possible. You choose from the three of four or ten applications on the shelf because they're the only options presented. + +You generally have several obligatory "obvious" solutions in open source, but you also get an additional _dozen_ contenders hanging out on the fringe. These options are sometimes only half-complete, or they're hyper-focused on a specific task, or they're challenging to learn, but most importantly, they're unique and innovative. Sometimes they've been developed by someone who's never seen the way a task is "supposed to be done," and so the approach is wildly different than anything else on the market. Other times, they're developed by someone familiar with the "right way" of doing something but is trying a different tactic anyway. It's a big, dynamic brainstorm of possibility. + +These kinds of everyday innovations can lead to flashes of inspiration, moments of brilliance, or widespread common improvements. For instance, the famous GIMP filter that removes items from photographs and automatically replaces the background was so popular that it later got "borrowed" by proprietary photo editing software. That's one metric of success, but it's the personal impact that matters most for an artist. I marvel at the creativity of new Linux users when I've shown them just one simple audio or video filter or paint application at a tech demo. Without any instruction or context, the ideas that spring out of a simple interaction with a new tool can be exciting and inspiring, and a whole new series of artwork can easily emerge from experimentation with just a few simple tools. + +There are also ways of working more efficiently, provided the right set of tools are available. While proprietary software usually isn't opposed to the idea of smarter work habits, there's rarely a direct benefit from concentrating on making it easy for users to automate tasks. Linux and open source are largely built exactly for [automation and orchestration][6], and not just for servers. Tools like [ImageMagick][7] and [GIMP scripts][8] have changed the way I work with images, both for bulk processing and idle experimentation. + +You never know what you might create, given tools that you've never imagined existed. + +### Linux artists + +There's a whole [community of artists using open source][9], from [photography][10] to [makers][11] to [musicians][12], and much much more. If you want to get creative, give Linux a go. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-art-design + +作者:[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/painting_computer_screen_art_design_creative.png?itok=LVAeQx3_ (Painting art on a computer screen) +[2]: https://opensource.com/sites/default/files/inkscape_0.jpg +[3]: https://community.ardour.org/subscribe +[4]: https://opensource.com/sites/default/files/ardour.jpg +[5]: https://opensource.com/sites/default/files/formats.jpg +[6]: https://opensource.com/article/20/11/orchestration-vs-automation +[7]: https://opensource.com/life/16/6/fun-and-semi-useless-toys-linux#imagemagick +[8]: https://opensource.com/article/21/1/gimp-scripting +[9]: https://librearts.org +[10]: https://pixls.us +[11]: https://www.redhat.com/en/blog/channel/red-hat-open-studio +[12]: https://linuxmusicians.com From 2a39d89afa4b2a74f13865aac5e79daee447a0a4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 13 Feb 2021 05:04:17 +0800 Subject: [PATCH 297/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210212=20?= =?UTF-8?q?18=20ways=20to=20differentiate=20open=20source=20products=20fro?= =?UTF-8?q?m=20upstream=20suppliers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210212 18 ways to differentiate open source products from upstream suppliers.md --- ...source products from upstream suppliers.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sources/tech/20210212 18 ways to differentiate open source products from upstream suppliers.md diff --git a/sources/tech/20210212 18 ways to differentiate open source products from upstream suppliers.md b/sources/tech/20210212 18 ways to differentiate open source products from upstream suppliers.md new file mode 100644 index 0000000000..045a31836a --- /dev/null +++ b/sources/tech/20210212 18 ways to differentiate open source products from upstream suppliers.md @@ -0,0 +1,124 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (18 ways to differentiate open source products from upstream suppliers) +[#]: via: (https://opensource.com/article/21/2/differentiating-products-upstream-suppliers) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux) + +18 ways to differentiate open source products from upstream suppliers +====== +Open source products must create enough differentiated value that +customers will voluntarily pay for them versus another (or free) +product. +![Tips and gears turning][1] + +In the first three parts of this series, I explored [open source as a supply chain][2], [what a product is][3], and [what product managers do][4]. In this fourth article, I'll look at a plethora of methods to differentiate open source software products from their upstream open source projects. + +Since open source projects are essentially information products, these methods are likely to apply to many information-related products (think YouTube creators) that have a component of value given away for free. Product managers have to get creative when the information and material to build your product is freely available to users. + +### Creating and capturing value + +Product managers are responsible for creating solutions that attract and retain customers. To create a customer, they must provide value in exchange for money. Like a good salesperson, a product manager should never feel guilty about charging for their product (see [_How to sell an open source product_][5] by John Mark Walker). + +Products built on open source are fundamentally no different than any other products or service. They must create value for customers. In fact, they must create enough value that customers will voluntarily pay a price that is sufficient to pay for the development costs and return a profit. These products must also be differentiated from competing products and services, as well as upstream projects. + +![Inputs for creating value][6] + +(Scott McCarty, [CC BY-SA 4.0][7]) + +While products built on open source software are not fundamentally different from other products and services, there are some differences. First, some of the development costs are defrayed among all open source contributors. These costs can include code, testing, documentation, hardware, project hosting costs, etc. But even when development costs are defrayed in open source, costs are incurred by the vendor that productizes the code. These can include employee costs for research, analysis, security, performance testing, certification processes (e.g., collaborating with hardware vendors, cloud providers, etc.), and of course, sales and marketing. + +![Inputs for solving market problems][8] + +(Scott McCarty, [CC BY-SA 4.0][7]) + +Successful open source products must be able to charge a cost that is sufficient to pay for the defrayed upstream open source contributions (development costs) and the downstream productization costs (vendor costs). Stated another way, products can only charge a sufficient price if they create value that can only be captured by customers paying for them. That might sound harsh, but it's a reality for all products. There's a saying in product management: Pray to pay doesn't work. With that said, don't be too worried. There are ethical ways to capture value. + +### Types of value + +Fundamentally, there are two types of value: proprietary and non-proprietary. Proprietary is a bad word in open source software, but an attractive word in manufacturing, finance, and other industries. Many financial companies will highlight their proprietary algorithms and the same with drug companies and manufacturing processes. In software, proprietary value is often thought to be completely incongruous with free and open source software. People often assume proprietary value is a binary decision. It’s difficult for people to imagine proprietary value in the context of open source software without being artificially constrained by a license. However, as we’ll attempt to demonstrate, it’s not so clear cut. + +From an open source product management perspective, you can define proprietary value as anything that would be very difficult or nearly impossible for the customer to recreate themselves—or something the potential customer doesn't believe they can recreate. Commodity value is the opposite of proprietary. Commodity value is value the customer believes they could construct (or reconstruct) given enough time and money. + +Reconstructing commodity value instead of purchasing it makes sense only if it's cheaper or easier than buying a product. Stated another way, a good product should save a customer money compared to building the solution themselves. It's in this cost gap that open source products exist and thrive. + +With products built, or mostly built, on an open source supply chain, customers retain the "build versus buy" decision and can stop paying at any time. This is often true with open core products as well. As long as the majority of the supply chain is open source, the customer likely could rebuild a few components to get what they need. The open source product manager's job is the same as for any other product or service: to create and retain customers by providing value worth paying for. + +### Differentiators for open source product managers + +Like any artist, a product manager traffics in value as their medium. They must price and package their product. They must constantly strive to differentiate their product against competitors in the marketplace and the upstream projects that are suppliers to that product. However, the supply chain is but one tool a product manager can use to differentiate and create a customer. + +This is a less-than-exhaustive list that should give you some ideas about how product managers can differentiate their products and create value. As you read through the list, think deeply about whether a customer could recreate the value of each given enough time, money, and willpower. + + * **Supply chain:** Selecting the upstream suppliers is important. The upstream community's health is a selling point over products based on competing upstream projects. A perfect example of this kind of differentiation is with products such as OpenShift, Docker EE, and Mesosphere, which respectively rely on Kubernetes, Swarm, and Apache Mesos as upstream suppliers. Similar to how electric cars are replacing gasoline engines, the choice of technology and its supplier provide differentiation. + + * **Quality engineering:** Upstream continuous integration and continuous delivery (CI/CD) and user testing are wonderful bases for building a product. However, it's critical to ensure that the downstream product, often made up of multiple upstream projects, works well together with specific versions of all the components. Testing the entire solution together applies as much to differentiating from upstream suppliers as it does from competitive products. Customers want products that just work. + + * **Industry certifications:** Specific classes of customers, such as government, financial services, transportation, manufacturing, and telecom, often have certification requirements. Typically, these are related to security or auditing and are often quite expensive. Certifications are great because they differentiate the product from competitors and upstream. + + * **Hardware or cloud provider certifications:** The dirty secret of cheap hardware is that it changes all the time. Often this hardware has new capabilities with varying levels of maturity. Hardware certifications provide a level of confidence that the software will run well on a specific piece of hardware or cloud virtual machine. They also provide a level of assurance that the product company and the platform on which it is certified to run are committing to make it work well together. A potential customer could always vet hardware themselves, but they often don't have deep relationships with hardware vendors and cloud providers, making it difficult to demand fixes and patches. + + * **Ecosystem:** This represents access to a plethora of add-on solutions from third-party vendors. Again, the ecosystem provides some assurance that all the entities work together to make things work well. Small companies would likely find it difficult or impossible to demand that individual software vendors certify their privately built platforms. Integrations like these are usually quite expensive for an individual user and are best defrayed across a product's customers. + + * **Lifecycle:** Upstream projects are great because they move quickly and innovate. But many different versions of many different upstream projects can go into a single product's supply chain. Ensuring that all the versions of the different upstream projects work together over a given lifecycle is a lot of work. A longer lifecycle gives customers time to get a return on investment. Stated another way, users spend a lot of time and money planning and rolling out software. A product's lifecycle commitment ensures that customers can use the software and receive value from their investment for a reasonable amount of time. + + * **Packaging and distribution:** Once a vendor commits to supporting a product for a given lifecycle (e.g., five years), they must also commit to providing packaging and distribution during that time. Both products and cloud services need to provide customers the ability to plan a roadmap, execute a rollout, and expand over the desired lifecycle, so packages or services need to remain available for customer use. + + * **Documentation:** This is often overlooked by both open source projects and vendors. Aligning product documentation to the product lifecycle, versus the upstream supplier documentation, is extremely important. It's also important to document the entire solution working together, whether that's installation or use cases for end users. It's beneficial for customers to have documentation that applies to the specific combination of components they are using. + + * **Security:** Closely related to the product lifecycle, vendors must commit to providing security during the time the product is supported. This includes analyzing code, scoring vulnerabilities, patching those vulnerabilities, and verifying that they are patched. This is a particularly opportune area for products to differentiate themselves from upstream suppliers. It really is value creation through data. + + * **Performance:** Also closely related to product lifecycle, vendors must commit to providing performance testing, tuning recommendations, and sometimes even backporting performance improvements during the product's lifecycle. This is another opportune area for products. + + * **Indemnification:** This is essentially insurance in case the company using the software is sued by a patent troll. Often, the corporate legal team just won't have the skill set needed to defend themselves. While potential customers could pay a third party for legal services, would they know the software as well? + + * **Compute resources:** You simply can't get access to compute resources without paying for them. There are free trials, but sustained usage always requires paying, either through a cloud provider or by buying hardware. In fact, this is one of the main differentiated values provided by infrastructure as a service (IaaS) and software as a service (SaaS) cloud providers. This is quite differentiated from upstream suppliers because they will never have the budget to provide free compute, storage, and network. + + * **Consulting:** Access to operational knowledge to set up and use the software may be a differentiator. Clearly, a company can hire the talent, given enough budget and willpower, but talent can be difficult to find. In fact, one might argue that software vendors have a much better chance of attracting the top talent, essentially creating a talent vacuum for users trying to reconstruct the value themselves. + + * **Training:** Similar to consulting, the company that wrote, configured, released, and operated the software at scale often knows how to use it best. Again, a customer could hire the talent given enough budget and willpower. + + * **Operational knowledge:** IaaS and SaaS solutions often provide this kind of value. Similarly, knowledge bases and connected experiences that analyze an installed environment's configuration to provide the user with insights (e.g., OpenShift, Red Hat Insights) can provide this value. Operational knowledge is similar to training and consulting. + + * **Support:** This includes the ability to call for help or file support tickets and is similar to training, consulting, and operational knowledge. Support is often a crutch for open source product managers; again, customers can often recreate their own support organizations, depending on where they want to strategically invest budget and people, especially for level one and level two support. Level three support (e.g., kernel programmers) might be harder to hire. + + * **Proprietary code:** This is code that's not released under an open source license. A customer could always build a software development team and augment the open core code with the missing features they need. For the vendor, proprietary code has the downside of creating an unnatural competition between the upstream open source supplier and the downstream product. Furthermore, this unnatural split between open source and proprietary code does not provide the customer more value. It always feels like value is being unnaturally held back. I would argue that this is a very suboptimal form of value capture. + + * **Brand:** Brand equity is not easily measurable. It really comes down to a general level of trust. The customer needs to believe that the solution provider can and will help them when they need it. It's slow to build a brand and easy to lose it. Careful thought might reveal that the same is true with internal support organizations in a company. Users will quickly lose trust in internal support organizations, and it can take years to build it back up. + + + + +Reading through the list, do you think a potential customer could recreate the value of almost any of these items? The answer is almost assuredly yes. This is true with almost any product feature or capability, whether it's open source or even proprietary. Cloud providers build their own CPUs and hardware, and delivery companies (e.g., UPS, Amazon, etc.) sometimes build their own vehicles. Whether it makes sense to build or buy all depends on the business and its specific needs. + +### Add value in the right places + +The open source licensing model led to an explosion in the availability of components that can be assembled into a software product. Stated another way, it formed a huge supply chain of software. Product managers can create products from a completely open source supply chain (e.g., Red Hat, Chef, SUSE, etc.), or mix and match open source and proprietary technology (e.g., open core like Sourcefire or SugarCRM). Choosing a fully open source versus open core methodology should not be confused with solving a business problem. Customers only buy products that solve their problems. + +Enterprise open source products are solutions to problems, much like a vehicle sold by an auto manufacturer. The product manager for an open source product determines the requirements, things like the lifecycle (number of years), security (important certifications), performance (important workloads), and ecosystem (partners). Some of these requirements can be met by upstream suppliers (open source projects); some cannot. + +An open source product is a composition of value consumed through a supply chain of upstream vendors and new value added by the company creating it. This new value combined with the consumed value is often worth more together and sold at a premium. It's the responsibility of product teams (including engineering, quality, performance, security, legal, etc.) to add new value in the right places, at the right times, to make their open source products worth the price customers pay versus building out the infrastructure necessary to assemble, maintain, and support the upstream components themselves. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/differentiating-products-upstream-suppliers + +作者:[Scott McCarty][a] +选题:[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/fatherlinux +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) +[2]: https://opensource.com/article/20/10/open-source-supply-chain +[3]: https://opensource.com/article/20/10/defining-product-open-source +[4]: https://opensource.com/article/20/11/open-source-product-teams +[5]: https://opensource.com/article/20/6/sell-open-source-software +[6]: https://opensource.com/sites/default/files/uploads/creatingvalue1.png (Inputs for creating value) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/uploads/creatingvalue2.png (Inputs for solving market problems) From 4168f21c60e14917b450bfcee4ac0ea25fef98fe Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 13 Feb 2021 05:04:31 +0800 Subject: [PATCH 298/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210212=20?= =?UTF-8?q?How=20to=20adopt=20DevSecOps=20successfully?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210212 How to adopt DevSecOps successfully.md --- ...212 How to adopt DevSecOps successfully.md | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 sources/tech/20210212 How to adopt DevSecOps successfully.md diff --git a/sources/tech/20210212 How to adopt DevSecOps successfully.md b/sources/tech/20210212 How to adopt DevSecOps successfully.md new file mode 100644 index 0000000000..27d6b9c41e --- /dev/null +++ b/sources/tech/20210212 How to adopt DevSecOps successfully.md @@ -0,0 +1,128 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to adopt DevSecOps successfully) +[#]: via: (https://opensource.com/article/21/2/devsecops) +[#]: author: (Mike Calizo https://opensource.com/users/mcalizo) + +How to adopt DevSecOps successfully +====== +Integrating security throughout the software development lifecycle is +important, but it's not always easy. +![Target practice][1] + +Adopting [DevOps][2] can help an organization transform and speed how its software is delivered, tested, and deployed to production. This is the well-known "DevOps promise" that has led to such a large surge in adoption. + +We've all heard about the many successful DevOps implementations that changed how an organization approaches software innovation, making it fast and secure through agile delivery to get [ahead of competitors][3]. This is where we see DevOps' promises achieved and delivered. + +But on the flipside, some DevOps adoptions cause more issues than benefits. This is the DevOps dilemma where DevOps fails to deliver on its promises. + +There are many factors involved in an unsuccessful DevOps implementation, and a major one is security. A poor security culture usually happens when security is left to the end of the DevOps adoption process. Applying existing security processes to DevOps can delay projects, cause frustrations within the team, and create financial impacts that can derail a project. + +[DevSecOps][4] was designed to avoid this very situation. Its purpose "is to build on the mindset that 'everyone is responsible for security…'" It also makes security a consideration at all levels of DevOps adoption. + +### The DevSecOps process + +Before DevOps and DevSecOps, the app security process looked something like the image below. Security came late in the software delivery process, after the software was accepted for production. + +![Old software development process with security at the end][5] + +(Michael Calizo, [CC BY-SA 4.0][6]) + +Depending on the organization's security profile and risk appetite, the application might even bypass security reviews and processes during acceptance. At that point, the security review becomes an audit exercise to avoid unnecessary project delays. + +![Security as audit in software development][7] + +(Michael Calizo, [CC BY-SA 4.0][6]) + +The DevSecOps [manifesto][8] says that the reason to integrate security into dev and ops at all levels is to implement security with less friction, foster innovation, and make sure security and data privacy are not left behind. + +Therefore, DevSecOps encourages security practitioners to adapt and change their old, existing security processes and procedures. This may be sound easy, but changing processes, behavior, and culture is always difficult, especially in large environments. + +The DevSecOps principle's basic requirement is to introduce a security culture and mindset across the entire application development and deployment process. This means old security practices must be replaced by more agile and flexible methods so that security can iterate and adapt to the fast-changing environment. According to the DevSecOps manifesto, security needs to "operate like developers to make security and compliance available to be consumed as services." + +DevSecOps should look like the figure below, where security is embedded across the delivery cycle and can iterate every time there is a need for change or adjustment. + +![DevSecOps considers security throughout development][9] + +(Michael Calizo, [CC BY-SA 4.0][6]) + +### Common DevSecOps obstacles + +Any time changes are introduced, people find faults or issues with the new process. This is natural human behavior. The fear and inconvenience associated with learning new things are always met with adverse reactions; after all, humans are creatures of habit. + +Some common obstacles in DevSecOps adoption include: + + * **Vendor-defined DevOps/DevSecOps:** This means principles and processes are focused on product offerings, and the organization won't be able to build the approach. Instead, they will be limited to what the vendor provides. + * **Nervous people managers:** The fear of losing control is a real problem when change happens. Often, anxiety affects people managers' decision-making. + * **If ain't broke, don't fix it:** This is a common mindset, and you really can't blame people for thinking this way. But the idea that the old way will survive despite new ways of delivering software and solutions must be challenged. To adapt to the agile application lifecycle, you need to change the processes to support the speed and agility it requires. + * **The Netflix and Uber effect:** Everybody knows that Netflix and Uber have successfully implemented DevSecOps; therefore, many organizations want to emulate them. Because they have a different culture than your organization, simply emulating them won't work. + * **Lack of measurement:** DevOps and DevSecOps transformation must be measured against set goals. Metrics might include software delivery performance or overall organization performance over time. + * **Checklist-driven security:** By using a checklist, the security team follows the same old, static, and inflexible processes that are neither useful nor applicable to modern technologies that developers use to make software delivery lean and agile. The introduction of the "[as code][10]" approach requires security people to learn how to code. + * **Security as a special team:** This is especially true in organizations transitioning from the old ways of delivering software, where security is a separate entity, to DevOps. Because of the separations, trust is questionable among devs, ops, and security. This will cause the security team to spend unnecessary time reviewing and governing DevOps processes and building pipelines instead of working closely with developers and ops teams to improve the software delivery flow. + + + +### How to adopt DevSecOps successfully + +Adopting DevSecOps is not easy, but being aware of common obstacles and challenges is key to your success. + +Clearly, the biggest and most important change an organization needs to make is its culture. Cultural change usually requires executive buy-in, as a top-down approach is necessary to convince people to make a successful turnaround. You might hope that executive buy-in makes cultural change follow naturally, but don't expect smooth sailing—executive buy-in alone is not enough. + +To help accelerate cultural change, the organization needs leaders and enthusiasts that will become agents of change. Embed these people in the dev, ops, and security teams to serve as advocates and champions for culture change. This will also establish a cross-functional team that will share successes and learnings with other teams to encourage wider adoption. + +Once that is underway, the organization needs a DevSecOps use-case to start with, something small with a high potential for success. This enables the team to learn, fail, and succeed without affecting the organization's core business. + +The next step is to identify and agree on the definition of success. The DevSecOps adoption needs to be measurable; to do that, you need a dashboard that shows metrics such as: + + * Lead time for a change + * Deployment frequency + * Mean time to restore + * Change failure + + + +These metrics are a critical requirement to be able to identify processes and other things that require improvement. It's also a tool to declare if an adoption is a win or a bust. This methodology is called [event-driven transformation][11]. + +### Conclusion + +When implemented properly, DevOps enables an organization to deliver software to production quickly and gain advantages over competitors. DevOps allows it to fail small and recover faster by enabling flexibility and efficiency to go to market early. + +In summary, DevOps and DevSecOps adoption needs: + + * Cultural change + * Executive buy-in + * Leaders and enthusiasts to act as evangelists + * Cross-functional teams + * Measurable indicators + + + +Ultimately, the solution to the DevSecOps dilemma relies on cultural change to make the organization better. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/devsecops + +作者:[Mike Calizo][a] +选题:[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/mcalizo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/target-security.png?itok=Ca5-F6GW (Target practice) +[2]: https://opensource.com/resources/devops +[3]: https://www.imd.org/research-knowledge/articles/the-battle-for-digital-disruption-startups-vs-incumbents/ +[4]: http://www.devsecops.org/blog/2015/2/15/what-is-devsecops +[5]: https://opensource.com/sites/default/files/uploads/devsecops_old-process.png (Old software development process with security at the end) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://opensource.com/sites/default/files/uploads/devsecops_security-as-audit.png (Security as audit in software development) +[8]: https://www.devsecops.org/ +[9]: https://opensource.com/sites/default/files/uploads/devsecops_process.png (DevSecOps considers security throughout development) +[10]: https://www.oreilly.com/library/view/devopssec/9781491971413/ch04.html +[11]: https://www.openshift.com/blog/exploring-a-metrics-driven-approach-to-transformation From 96d8390c2bf55b18e2ae7422c4ae1db0871dcc6e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 13 Feb 2021 08:49:46 +0800 Subject: [PATCH 299/381] Rename sources/tech/20210212 18 ways to differentiate open source products from upstream suppliers.md to sources/talk/20210212 18 ways to differentiate open source products from upstream suppliers.md --- ... differentiate open source products from upstream suppliers.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210212 18 ways to differentiate open source products from upstream suppliers.md (100%) diff --git a/sources/tech/20210212 18 ways to differentiate open source products from upstream suppliers.md b/sources/talk/20210212 18 ways to differentiate open source products from upstream suppliers.md similarity index 100% rename from sources/tech/20210212 18 ways to differentiate open source products from upstream suppliers.md rename to sources/talk/20210212 18 ways to differentiate open source products from upstream suppliers.md From a5d4760fe94a1a9c103b93ef696bf26466e9f901 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 13 Feb 2021 08:52:50 +0800 Subject: [PATCH 300/381] Rename sources/tech/20210212 How to adopt DevSecOps successfully.md to sources/talk/20210212 How to adopt DevSecOps successfully.md --- .../20210212 How to adopt DevSecOps successfully.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210212 How to adopt DevSecOps successfully.md (100%) diff --git a/sources/tech/20210212 How to adopt DevSecOps successfully.md b/sources/talk/20210212 How to adopt DevSecOps successfully.md similarity index 100% rename from sources/tech/20210212 How to adopt DevSecOps successfully.md rename to sources/talk/20210212 How to adopt DevSecOps successfully.md From 57b625b283697fc156d40d4d0cae0cf474bc1807 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 13 Feb 2021 09:40:53 +0800 Subject: [PATCH 301/381] PRF @rakino --- ...0615 LaTeX Typesetting - Part 1 (Lists).md | 52 +++++++++---------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/translated/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md b/translated/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md index 450c83807e..66782c531b 100644 --- a/translated/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md +++ b/translated/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md @@ -1,34 +1,30 @@ [#]: collector: "lujun9972" [#]: translator: "rakino" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "LaTeX Typesetting – Part 1 (Lists)" [#]: via: "https://fedoramagazine.org/latex-typesetting-part-1/" [#]: author: "Earl Ramirez https://fedoramagazine.org/author/earlramirez/" -LaTeX 排版——第 1 部分:列表 +LaTeX 排版(1):列表 ====== ![][1] -本系列基于前文 [Typeset your docs with LaTex and TeXstudio on Fedora][2] 和 [LaTeX 101 for beginners][3],本文即系列的第一部分是关于 LaTeX 列表的。 - - +本系列基于前文《[在 Fedora 上用 LaTex 和 TeXstudio 排版你的文档][2]》和《[LaTeX 基础][3]》,本文即系列的第一部分,是关于 LaTeX 列表的。 ### 列表类型 LaTeX 中的列表是封闭的环境,列表中的每个项目可以取一行文字到一个完整的段落。在 LaTeX 中有三种列表类型: - * **itemize**: 无序列表unordered list/项目符号列表bullet list - * **enumerate**: 有序列表ordered list - * **description**: 描述列表descriptive list - - + * `itemize`:无序列表unordered list/项目符号列表bullet list + * `enumerate`:有序列表ordered list + * `description`:描述列表descriptive list ### 创建列表 -要创建一个列表,需要在每个项目前加上控制序列 \\_item_,并在项目清单前后分别加上控制序列 \\_begin_{<类型>} 和 \\_end_{<类型>}(将其中的 <类型> 替换为将要使用的列表类型),如下例: +要创建一个列表,需要在每个项目前加上控制序列 `\item`,并在项目清单前后分别加上控制序列 `\begin{<类型>}` 和 `\end`{<类型>}`(将其中的 `<类型>` 替换为将要使用的列表类型),如下例: #### itemize(无序列表) @@ -67,11 +63,11 @@ LaTeX 中的列表是封闭的环境,列表中的每个项目可以取一行 ### 列表项目间距 -可以通过在导言区加入 \\_usepackage{enumitem}_ 来自定义默认的间距,宏包 _enumitem_ 启用了选项 _noitemsep_ 和控制序列 \\_itemsep_ ,可以在列表中使用他们,如下例所示: +可以通过在导言区加入 `\usepackage{enumitem}` 来自定义默认的间距,宏包 `enumitem` 启用了选项 `noitemsep` 和控制序列 `\itemsep`,可以在列表中使用它们,如下例所示: #### 使用选项 noitemsep -将选项 _noitemsep_ 封闭在方括号内,并同下文所示放在控制序列 \\_begin_ 之后,该选项将移除默认的间距。 +将选项 `noitemsep` 封闭在方括号内,并同下文所示放在控制序列 `\begin` 之后,该选项将移除默认的间距。 ``` \begin{itemize}[noitemsep] @@ -85,7 +81,7 @@ LaTeX 中的列表是封闭的环境,列表中的每个项目可以取一行 #### 使用控制序列 \itemsep -控制序列 \\_itemsep_ 必须以一个数字作为后缀,用以表示列表项目之间应该有多少空间。 +控制序列 `\itemsep` 必须以一个数字作为后缀,用以表示列表项目之间应该有多少空间。 ``` \begin{itemize} \itemsep0.75pt @@ -152,21 +148,21 @@ LaTeX 最多最多支持四层嵌套列表,如下例: **enumerate(有序列表)** | **itemize(无序列表)** ---|--- -\alph* (小写字母) | $\bullet$ (Bullet) -\Alph* (大写字母) | $\cdot$ (Period) -\arabic* (阿拉伯数字) | $\diamond$ (Diamond) -\roman* (小写罗马数字) | $\ast$ (Asterisk) -\Roman* (大写罗马数字) | $\circ$ (Circle) -| $-$ (Dash) +`\alph*` (小写字母) | `$\bullet$` (●) +`\Alph*` (大写字母) | `$\cdot$` (•) +`\arabic*` (阿拉伯数字) | `$\diamond$` (◇) +`\roman*` (小写罗马数字) | `$\ast$` (✲) +`\Roman*` (大写罗马数字) | `$\circ$` (○) +  | `$-$` (-) ### 按嵌套深度划分的默认样式 **嵌套深度** | **enumerate(有序列表)** | **itemize(无序列表)** ---|---|--- -1 | 阿拉伯数字 | Bullet -2 | 小写字母 | Dash -3 | 小写罗马数字 | Asterisk -4 | 大写字母 | Period +1 | 阿拉伯数字 | (●) +2 | 小写字母 | (-) +3 | 小写罗马数字 | (✲) +4 | 大写字母 | (•) ### 设置列表样式 @@ -191,7 +187,7 @@ LaTeX 最多最多支持四层嵌套列表,如下例: #### 方式一:为各项目单独设置 -将需要的样式名称封闭在方括号内,并放在控制序列 \\_item_ 之后,如下例: +将需要的样式名称封闭在方括号内,并放在控制序列 `\item` 之后,如下例: ``` % 方式一 @@ -208,7 +204,7 @@ LaTeX 最多最多支持四层嵌套列表,如下例: #### 方式二:为整个列表设置 -将需要的样式名称以 _label=_ 前缀并封闭在方括号内,放在控制序列 _\begin_ 之后,如下例: +将需要的样式名称以 `label=` 前缀并封闭在方括号内,放在控制序列 `\begin` 之后,如下例: ``` % 方式二 @@ -221,7 +217,7 @@ LaTeX 最多最多支持四层嵌套列表,如下例: #### 方式三:为整个文档设置 -该方式将改变整个文档的默认样式。使用 \\_renewcommand_ 来设置项目标签的值,下例分别为四个嵌套深度的项目标签设置了不同的样式。 +该方式将改变整个文档的默认样式。使用 `\renewcommand` 来设置项目标签的值,下例分别为四个嵌套深度的项目标签设置了不同的样式。 ``` % 方式三 @@ -244,7 +240,7 @@ via: https://fedoramagazine.org/latex-typesetting-part-1/ 作者:[Earl Ramirez][a] 选题:[lujun9972][b] 译者:[rakino](https://github.com/rakino) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 992f0a99b0d8f73bb13071f56f701d881ba6972b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 13 Feb 2021 09:41:30 +0800 Subject: [PATCH 302/381] PUB @rakino https://linux.cn/article-13112-1.html --- .../20200615 LaTeX Typesetting - Part 1 (Lists).md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200615 LaTeX Typesetting - Part 1 (Lists).md (99%) diff --git a/translated/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md b/published/20200615 LaTeX Typesetting - Part 1 (Lists).md similarity index 99% rename from translated/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md rename to published/20200615 LaTeX Typesetting - Part 1 (Lists).md index 66782c531b..b69d418b64 100644 --- a/translated/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md +++ b/published/20200615 LaTeX Typesetting - Part 1 (Lists).md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "rakino" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13112-1.html" [#]: subject: "LaTeX Typesetting – Part 1 (Lists)" [#]: via: "https://fedoramagazine.org/latex-typesetting-part-1/" [#]: author: "Earl Ramirez https://fedoramagazine.org/author/earlramirez/" From 31ae7bd826b66aaa10c56848843d4d2cfd1a00e2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 13 Feb 2021 10:35:00 +0800 Subject: [PATCH 303/381] PUB @geekpi https://linux.cn/article-13113-1.html --- ...es for open source productivity in 2021.md | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) rename {translated/tech => published}/20210131 3 wishes for open source productivity in 2021.md (60%) diff --git a/translated/tech/20210131 3 wishes for open source productivity in 2021.md b/published/20210131 3 wishes for open source productivity in 2021.md similarity index 60% rename from translated/tech/20210131 3 wishes for open source productivity in 2021.md rename to published/20210131 3 wishes for open source productivity in 2021.md index 105ab3f1a1..4517bae151 100644 --- a/translated/tech/20210131 3 wishes for open source productivity in 2021.md +++ b/published/20210131 3 wishes for open source productivity in 2021.md @@ -1,45 +1,46 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13113-1.html) [#]: subject: (3 wishes for open source productivity in 2021) [#]: via: (https://opensource.com/article/21/1/productivity-wishlist) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) 2021 年开源生产力的 3 个愿望 ====== -2021年,开源世界可以拓展的有很多。这是我特别感兴趣的三个领域。 + +> 2021年,开源世界可以拓展的有很多。这是我特别感兴趣的三个领域。 + ![Looking at a map for career journey][1] 在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的最后一天。 -我们已经到了另外一个系列的结尾处。因此,让我们谈谈我希望在 2021 年看到的更多事情。 +我们已经到了又一个系列的结尾处。因此,让我们谈谈我希望在 2021 年看到的更多事情。 ### 断网 ![Large Lego set built by the author][2] -我是在假期期间制作的(Kevin Sonney, [CC BY-SA 4.0][3]) +*我在假期期间制作的(Kevin Sonney, [CC BY-SA 4.0][3])* -对_许多_人来说,2020 年是非常困难的一年。疫情大流行、各种政治事件、24 小时新闻报道等等,都对我们的精神健康造成了伤害。虽然我谈到了[抽出时间进行自我护理][4],但我只提到了断网:也就是关闭提醒、手机、平板等,暂时无视这个世界。我公司的一位经理居然告诉我们,如果放假或休息一天,就把所有与工作有关的东西都关掉(除非我们在值班)。我最喜欢的“断网”活动之一就是听音乐和搭建大而复杂的乐高。 +对*许多、许多的*人来说,2020 年是非常困难的一年。疫情大流行、各种政治事件、24 小时的新闻轰炸等等,都对我们的精神健康造成了伤害。虽然我确实谈到了 [抽出时间进行自我护理][4],但我只是想断网:也就是关闭提醒、手机、平板等,暂时无视这个世界。我公司的一位经理实际上告诉我们,如果放假或休息一天,就把所有与工作有关的东西都关掉(除非我们在值班)。我最喜欢的“断网”活动之一就是听音乐和搭建大而复杂的乐高。 ### 可访问性 -尽管我谈论的许多技术都是任何人都可以做的,但是软件方面的可访问性都有一定难度。自迁移之初以来,Linux 和开源世界在辅助技术方面已经走了很长一段路。但是,仍然有太多的应用和系统不会考虑有些用户没有与设计者相同的能力。我一直在关注这一领域的发展,因为每个人都应该能够访问事物。 +尽管我谈论的许多技术都是任何人都可以做的,但是软件方面的可访问性都有一定难度。相对于自由软件运动之初,Linux 和开源世界在辅助技术方面已经有了长足发展。但是,仍然有太多的应用和系统不会考虑有些用户没有与设计者相同的能力。我一直在关注这一领域的发展,因为每个人都应该能够访问事物。 ### 更多的一体化选择 ![JPilot all in one organizer software interface][5] -JPilot(Kevin Sonney, [CC BY-SA 4.0][3]) +*JPilot(Kevin Sonney, [CC BY-SA 4.0][3])* 在 FOSS 世界中,一体化的个人信息管理解决方案远没有商业软件世界中那么多。总体趋势是使用单独的应用,它们必须通过配置来相互通信或通过中介服务(如 CalDAV 服务器)。移动市场在很大程度上推动了这一趋势,但我仍然向往像 [JPilot][6] 这样无需额外插件或服务就能完成几乎所有我需要的事情的日子。 - 非常感谢大家阅读这个年度系列。如果你认为我错过了什么,或者明年需要注意什么,请在下方评论。 -就像我在[生产力炼金术][7]上说的那样,尽最大努力保持生产力! +就像我在 [生产力炼金术][7] 上说的那样,尽最大努力保持生产力! -------------------------------------------------------------------------------- @@ -48,7 +49,7 @@ via: https://opensource.com/article/21/1/productivity-wishlist 作者:[Kevin Sonney][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 a27c9f4314117a18aed1c5fc0ae986f96ac7f77b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 14 Feb 2021 05:03:46 +0800 Subject: [PATCH 304/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210213=20?= =?UTF-8?q?5=20reasons=20why=20I=20love=20coding=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210213 5 reasons why I love coding on Linux.md --- ...13 5 reasons why I love coding on Linux.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/tech/20210213 5 reasons why I love coding on Linux.md diff --git a/sources/tech/20210213 5 reasons why I love coding on Linux.md b/sources/tech/20210213 5 reasons why I love coding on Linux.md new file mode 100644 index 0000000000..64c968d669 --- /dev/null +++ b/sources/tech/20210213 5 reasons why I love coding on Linux.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 reasons why I love coding on Linux) +[#]: via: (https://opensource.com/article/21/2/linux-programming) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +5 reasons why I love coding on Linux +====== +Linux is a great platform for programming—it's logical, easy to see the +source code, and very efficient. +![Terminal command prompt on orange background][1] + +In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different ways to use Linux. Here I'll explain why so many programmers choose Linux. + +When I first started using Linux, it was for its excellent multimedia support because I worked in film production. We found that the typical proprietary video editing applications couldn't handle most of the footage we were pulling from pretty much any device that could record an image. At the time, I wasn't aware that Linux had a reputation as an operating system for servers and programmers. The more I did on Linux, the more I wanted to control every aspect of it. And in the end, I discovered that a computer was at its most powerful when its user could "speak" its language. Within a few years of switching to Linux, I was scripting unattended video edits, stringing together audio files, bulk editing photos, and anything else I could imagine and then invent a solution for. It didn't take long for me to understand why programmers loved Linux, but it was Linux that taught me to love programming. + +It turns out that Linux is an excellent platform for programmers, both new and experienced. It's not that you _need_ Linux to program. There are successful developers on all different kinds of platforms. However, Linux has much to offer developers. Here are a few things I've found useful. + +### Foundations of logic + +Linux is built around [automation][2]. It's very intentional that staple applications on Linux can at the very least launch from a terminal with additional options, and often they can even be used entirely from the terminal. This idea is sometimes mistaken as a primitive computing model because people mistakenly believe that writing software that operates from a terminal is just doing the bare minimum to get a working application. This is an unfortunate misunderstanding of how code works, but it's something many of us are guilty of from time to time. We think _more_ is always better, so an application containing 1,000 lines of code must be 100 times better than one with ten lines of code, right? The truth is that all things being equal, the application with greater flexibility is preferable, regardless of how that translates to lines of code. + +On Linux, a process that might take you an hour when done manually can literally be reduced to one minute with the right terminal command, and possibly less when parsed out to [GNU Parallel][3]. This phenomenon requires a shift in how you think about what a computer does. For instance, if your task is to add a cover image to 30 PDF files, you might think this is a sensible workflow: + + 1. Open a PDF in a PDF editor + 2. Open the front cover + 3. Append a PDF to the end of the cover file + 4. Save the file as a new PDF + 5. Repeat this process for each old PDF (but do not duplicate this process for each new PDF) + + + +It's mostly common sense stuff, and while it's painfully repetitive, it does get the job done. On Linux, however, you're able to work smarter than that. The thought process is similar: First, you devise the steps required for a successful result. After some research, you'd find out about the `pdftk-java` command, and you'd discover a simple solution: + + +``` +$ pdftk A=cover.pdf B=document_1.pdf \ + cat A B \ + output doc+cover_1.pdf +``` + +Once you've proven to yourself that the command works on one document, you take time to learn about looping options, and you settle on a parallel operation: + + +``` +$ find ~/docs/ -name "*.pdf" | \ + parallel pdftk A=cover.pdf B={} \ + cat A B \ + output {.}.cover.pdf +``` + +It's a slightly different way of thinking because the "code" you write processes data differently than the enforced linearity you're used to. However, getting out of your old linear way of thinking is important for writing actual code later, and it has the side benefit of empowering you to compute smarter. + +### Code connections + +No matter what platform you're programming for when you write code, you're weaving an intricate latticework of invisible connections between many different files. In all but the rarest cases, code draws from headers and relies on external libraries to become a complete program. This happens on any platform, but Linux tends to encourage you to understand this for yourself, rather than blindly trusting the platform's development kit to take care of it for you. + +Now, there's nothing wrong with trusting a development kit to resolve _library_ and _include_ paths. On the contrary, that kind of abstraction is a luxury you should enjoy. However, if you never understand what's happening, then it's a lot harder to override the process when you need to do something that a dev kit doesn't know about or to troubleshoot problems when they arise. + +This translates across platforms, too. You can develop code on Linux that you intend to run on Linux as well as other operating systems, and your understanding of how code compiles helps you hit your targets. + +Admittedly, you don't learn these lessons just by using Linux. It's entirely possible to blissfully code in a good IDE and never give a thought to what version of a library you have installed or where the development headers are located. However, Linux doesn't hide anything from you. It's easy to dig down into the system, locate the important parts, and read the code they contain. + +### Existing code + +Knowing where headers and libraries are located is useful, but having them to reference is yet another added bonus to programming on Linux. On Linux, you get to see the source code of basically anything you want (excluding applications that aren't open source but that run on Linux). The benefit here cannot be overstated. As you learn more about programming in general or about programming something new to you, you can learn a lot by referring to existing code on your Linux system. Many programmers have learned how to code by reading other people's open source code. + +On proprietary systems, you might find developer documentation with code samples in it. That's great because documentation is important, but it pales in comparison to locating the exact functionality you want to implement and then finding the source code demonstrating how it was done in an application you use every day. + +### Direct access to peripherals + +Something I often took for granted after developing code for media companies using Linux is access to peripherals. For instance, when connecting a video camera to Linux, you can pull incoming data from **/dev/video0** or similar. Everything's in **/dev**, and it's always the shortest path between two points to get there. + +That's not the case on other platforms. Connecting to systems outside of the operating system is often a maze of SDKs, restricted libraries, and sometimes NDAs. This, of course, varies depending on what you're programming for, but it's hard to beat Linux's simple and predictable interface. + +### Abstraction layers + +Conversely, Linux also provides a healthy set of abstraction layers for when direct access or manual coding ends up creating more work than you want to do. There are conveniences found in Qt and Java, and there are whole stacks like Pulse Audio, Pipewire, and gstreamer. Linux _wants_ you to be able to code, and it shows. + +### Add to this list + +There are more reasons that make coding on Linux a pleasure. Some are broad concepts and others are overly-specific details that have saved me hours of frustration. Linux is a great place to be, no matter what platform you're targeting. Whether you're just learning about programming or you're a coder looking for a new digital home, there's no better workspace for programming than Linux. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-programming + +作者:[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/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) +[2]: https://opensource.com/article/20/11/orchestration-vs-automation +[3]: https://opensource.com/article/18/5/gnu-parallel From a45cc578c3d03eb7940621ea3caf025c28d2b6f6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 14 Feb 2021 05:03:59 +0800 Subject: [PATCH 305/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210213=20?= =?UTF-8?q?How=20open=20source=20provides=20students=20with=20real-world?= =?UTF-8?q?=20experience?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210213 How open source provides students with real-world experience.md --- ...des students with real-world experience.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20210213 How open source provides students with real-world experience.md diff --git a/sources/tech/20210213 How open source provides students with real-world experience.md b/sources/tech/20210213 How open source provides students with real-world experience.md new file mode 100644 index 0000000000..ae5db3c45e --- /dev/null +++ b/sources/tech/20210213 How open source provides students with real-world experience.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How open source provides students with real-world experience) +[#]: via: (https://opensource.com/article/21/2/open-source-student) +[#]: author: (Laura Novich https://opensource.com/users/laura-novich) + +How open source provides students with real-world experience +====== +Contributing to open source gives students the real-world experience +required to land a good job. +![Woman sitting in front of her computer][1] + +In the movie _The Secret of My Success_, Brantley Foster (played by Michael J. Fox) expresses the exact thought that goes through every new graduate's mind: "How can I get any experience until I get a job that _gives_ me experience?" + +The hardest thing to do when starting a new career is to get experience. Often this creates a paradox. How do you get work with no experience, and how do you get experience with no work? + +In the open source software world, this conundrum is a bit less daunting because your experience is what you make of it. By working with open source projects sponsored by open source software (OSS) companies, you gain experience working on projects you like for companies that make you feel important, and then you use that experience to help find employment. + +Most companies would never allow newbies to touch their intellectual property and collateral without signing a non-disclosure agreement (NDA) or going through some kind of training or security check. However, when your source code is open and anyone in the world can contribute to it (in addition to copy it and use it), this is no longer an issue. In fact, open source companies embrace their contributors and create communities where students can easily get their feet wet and find their way in coding, testing, and documentation. Most open source companies depend on the contributions of others to get work done. This means the contributors work for free simply because they want to. For students, it translates into an unpaid internship and getting some real-world experience. + +At [Our Best Words][2], we decided to run a pilot project to see if our students could work in an open source documentation project and find the experience beneficial to jumpstarting their new careers in technical communication. + +![GitLab screenshot][3] + +(Laura Novich, [CC BY-SA 4.0][4]) + +I was the initiator and point of contact for the project, and I approached several companies. The company that gave us the most positive response was [GitLab][5]. GitLab is a company that creates software for Git repository management, issue tracking, and continuous integration/continuous delivery (CI/CD) pipeline management. Its software is used by hundreds of thousands of organizations worldwide, and in 2019, it announced it achieved $100 million in annual recurring revenue. + +GitLab's [Mike Jang][6] connected me with [Marcin Sedlak-Jakubowski][7] and [Marcia Dias Ramos][8], who are located closer to OBW's offices in Israel. We met to hammer out the details, and everyone had their tasks to launch the pilot in mid-September. Mike, Marcia, and Marcin hand-picked 19 issues for the students to solve. Each issue was tagged _Tich-Tov-only_ for OBW students, and any contributor who was not an OBW student was not allowed to work on the issue. + +To prepare the students, I held several demonstrations with GitLab. The students had never used the software before, and some were quite nervous. As the backbone of GitLab is Git, a software tool the students were already familiar with, it wasn't too hard to learn. Following the demonstrations, I sent the students a link to a Google Drive folder with tutorials, a FAQ, and other valuable resources. + +The issues the students were assigned came from GitLab's documentation. The documentation is written in Markdown and is checked with a linter (a static code analysis tool) called Vale. The students' assignments were to fix issues that the Vale linter found. The changes included fixing spelling, grammar, usage, and voice. In some cases, entire pages had to be rewritten. + +As I wanted this project to run smoothly and successfully, we decided to limit the pilot to seven of our 14 students. This allowed me to manage the project more closely and to make sure each student had only two to three issues to handle during the two-month time period of the project. + +![GitLab repo][9] + +(Laura Novich, [CC BY-SA 4.0][4]) + +The OBW students who were part of this project (with links to their GitLab profiles) were: + + * [Aaron Gorsuch][10] + * [Anna Lester][11] + * [Avi Chazen][12] + * [Ela Greenberg][13] + * [Rachel Gottesman][14] + * [Stefanie Saffern][15] + * [Talia Novich][16] + + + +We worked mostly during September and October and wrapped up the project in November. Every issue the students had was put on a Kanban board. We had regular standup meetings, where we discussed what we were doing and any issues causing difficulty. There were many teachable moments where I would help with repository issues, troubleshooting merge requests, and helping the students understand technical writing theories in practice. + +![Kanban board][17] + +(Laura Novich, [CC BY-SA 4.0][4]) + +November came faster than we expected and looking back, the project ended way too quickly. About midway in, I collected feedback from Marcin, Marcia, and Mike, and they told me their experience was positive. They told us that once we were done, we could take on more issues than the original allotment assigned to the group, if we wanted. + +One student, Rachel Gottesman, did just that. She completed 33 merge requests and helped rewrite pages of GitLab's documentation. She was so instrumental for the 13.7 release that [GitLab announced][18] that Rachel is the MVP for the release! We at OBW couldn't be more thrilled! _Congratulations, Rachel!_ + +![Rachel Gottesman's GitLab MVP award][19] + +(Laura Novich, [CC BY-SA 4.0][4]) + +Rachel's name appears [on GitLab's MVP page][20]. + +We are gearing up for our new year and a new course. We plan to run this project again as part of our [Software Documentation for Technical Communication Professionals][21] course. + +* * * + +_This article originally appeared on [Our Best Words Blog][22] and is republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/open-source-student + +作者:[Laura Novich][a] +选题:[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/laura-novich +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_2.png?itok=JPlR5aCA (Woman sitting in front of her computer) +[2]: https://ourbestwords.com/ +[3]: https://opensource.com/sites/default/files/uploads/gitlab.png (GitLab screenshot) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://about.gitlab.com/ +[6]: https://www.linkedin.com/in/mijang/ +[7]: https://www.linkedin.com/in/marcin-sedlak-jakubowski-91143a124/ +[8]: https://www.linkedin.com/in/marciadiasramos/ +[9]: https://opensource.com/sites/default/files/uploads/gitlab_obw_repo.png (GitLab repo) +[10]: https://gitlab.com/aarongor +[11]: https://gitlab.com/Anna-Lester +[12]: https://gitlab.com/avichazen +[13]: https://gitlab.com/elagreenberg +[14]: https://gitlab.com/gottesman.rachelg +[15]: https://gitlab.com/stefaniesaffern +[16]: https://gitlab.com/TaliaNovich +[17]: https://opensource.com/sites/default/files/uploads/kanban.png (Kanban board) +[18]: https://release-13-7.about.gitlab-review.app/releases/2020/12/22/gitlab-13-7-released/ +[19]: https://opensource.com/sites/default/files/uploads/rachelgottesmanmvp.png (Rachel Gottesman's GitLab MVP award) +[20]: https://about.gitlab.com/community/mvp/ +[21]: https://ourbestwords.com/training-courses/skills-courses/ +[22]: https://ourbestwords.com/topic/blog/ From 35311b10c94da3fc89cef992cd53be6b974b8dca Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 14 Feb 2021 09:04:56 +0800 Subject: [PATCH 306/381] Rename sources/tech/20210213 5 reasons why I love coding on Linux.md to sources/talk/20210213 5 reasons why I love coding on Linux.md --- .../20210213 5 reasons why I love coding on Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210213 5 reasons why I love coding on Linux.md (100%) diff --git a/sources/tech/20210213 5 reasons why I love coding on Linux.md b/sources/talk/20210213 5 reasons why I love coding on Linux.md similarity index 100% rename from sources/tech/20210213 5 reasons why I love coding on Linux.md rename to sources/talk/20210213 5 reasons why I love coding on Linux.md From e18e1995069ba5134fb4f0ea80183892c4091d70 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 14 Feb 2021 09:11:57 +0800 Subject: [PATCH 307/381] Rename sources/tech/20210213 How open source provides students with real-world experience.md to sources/talk/20210213 How open source provides students with real-world experience.md --- ...ow open source provides students with real-world experience.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210213 How open source provides students with real-world experience.md (100%) diff --git a/sources/tech/20210213 How open source provides students with real-world experience.md b/sources/talk/20210213 How open source provides students with real-world experience.md similarity index 100% rename from sources/tech/20210213 How open source provides students with real-world experience.md rename to sources/talk/20210213 How open source provides students with real-world experience.md From eb895889675cff736f112aef243c0631abe1763e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 14 Feb 2021 10:30:05 +0800 Subject: [PATCH 308/381] PRF&PUB @scvoet --- ... all the IoT experts going to come from.md | 46 ++++++++----------- 1 file changed, 20 insertions(+), 26 deletions(-) rename {translated/talk => published}/20190626 Where are all the IoT experts going to come from.md (55%) diff --git a/translated/talk/20190626 Where are all the IoT experts going to come from.md b/published/20190626 Where are all the IoT experts going to come from.md similarity index 55% rename from translated/talk/20190626 Where are all the IoT experts going to come from.md rename to published/20190626 Where are all the IoT experts going to come from.md index 8e50195bd8..5b10af4a11 100644 --- a/translated/talk/20190626 Where are all the IoT experts going to come from.md +++ b/published/20190626 Where are all the IoT experts going to come from.md @@ -1,56 +1,50 @@ [#]: collector: (lujun9972) [#]: translator: (scvoet) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13115-1.html) [#]: subject: (Where are all the IoT experts going to come from?) [#]: via: (https://www.networkworld.com/article/3404489/where-are-all-the-iot-experts-going-to-come-from.html) [#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) 物联网专家都从何而来? ====== -物联网 (IoT) 的快速发展催生了对跨职能专家进行培养的需求,这些专家可以将传统的网络和基础设施专业知识与数据库和报告技能相结合。 + +> 物联网(IoT)的快速发展催生了对跨职能专家进行培养的需求,这些专家可以将传统的网络和基础设施专业知识与数据库和报告技能相结合。 + ![Kevin \(CC0\)][1] -如果物联网 (IoT) 要实现其宏伟的诺言,它将需要大量聪明、熟练、**训练有素**的工人军团来实现这一切。而现在,这些人将从何而来尚不清楚。 +如果物联网(IoT)要实现其宏伟的诺言,它将需要大量聪明、熟练、**训练有素**的工人军团来实现这一切。而现在,这些人将从何而来尚不清楚。 -这就是我为什么有兴趣同资产优化软件公司 [AspenTech][2] 的产品管理、R&D 研发高级总监基思·弗林 (Keith Flynn) 通邮件,他说,当处理大量属于物联网范畴的新技术时,你需要能够理解如何配置技术和解释数据的人。弗林认为,现有的教育机构对物联网特定课程的需求越来越大,这同时也给了以物联网为重点,提供了完善课程的新私立学院机会。 +这就是我为什么有兴趣同资产优化软件公司 [AspenTech][2] 的产品管理、研发高级总监 Keith Flynn 通邮件的原因,他说,当处理大量属于物联网范畴的新技术时,你需要能够理解如何配置技术和解释数据的人。Flynn 认为,现有的教育机构对物联网特定课程的需求越来越大,这同时也给了以物联网为重点,提供了完善课程的新私立学院机会。 -弗林跟我说,“在未来物联网项目将与如今普遍的数据管理和自动化项目有着巨大的不同......未来需要更全面的技能和交叉交易能力,这样我们才会说同一种语言。” +Flynn 跟我说,“在未来,物联网项目将与如今普遍的数据管理和自动化项目有着巨大的不同……未来需要更全面的技能和交叉交易能力,这样我们才会说同一种语言。” -**【参见: [有雄心壮志的I T 专业人才应该争取的 20 个热门职位][3]】** - -弗林补充说,随着物联网每年增长 30%,将不再依赖于几个特定的技能,“从传统的部署技能(如网络和基础设施)到数据库和报告技能,坦白说,甚至是基础数据科学,都将需要一起理解和使用。” +Flynn 补充说,随着物联网每年增长 30%,将不再依赖于几个特定的技能,“从传统的部署技能(如网络和基础设施)到数据库和报告技能,坦白说,甚至是基础数据科学,都将需要一起理解和使用。” ### 召集所有物联网顾问 -弗林预测,“受过物联网教育的人的第一个大机会将会是在咨询领域,随着咨询公司对行业趋势的适应或淘汰......有受过物联网培训的员工将有助于他们在物联网项目中的定位,并在新的业务线中提出要求——物联网咨询。” +Flynn 预测,“受过物联网教育的人的第一个大机会将会是在咨询领域,随着咨询公司对行业趋势的适应或淘汰……有受过物联网培训的员工将有助于他们在物联网项目中的定位,并在新的业务线中提出要求——物联网咨询。” -对初创企业和小型公司而言,这个问题尤为严重。“组织越大,他们越有可能雇佣到不同技术类别的人”弗林这样说到,“但对于较小的组织和较小的物联网项目来说,你则需要一个能同时兼顾的人。” +对初创企业和小型公司而言,这个问题尤为严重。“组织越大,他们越有可能雇佣到不同技术类别的人”Flynn 这样说到,“但对于较小的组织和较小的物联网项目来说,你则需要一个能同时兼顾的人。” -两者兼而有之?还是**一应俱全?**物联网“需要将所有知识和技能组合在一起”,弗林说到,“并不是所有技能都是全新的,只是在此之前从来没有被归纳在一起或放在一起教授过。” - -**【[想在技术领域提升自己的事业?这个全面的在线课程会教您该怎么做。][4]】** +两者兼而有之?还是**一应俱全?**物联网“需要将所有知识和技能组合在一起”,Flynn 说到,“并不是所有技能都是全新的,只是在此之前从来没有被归纳在一起或放在一起教授过。” ### 未来的物联网专家 -弗林表示,真正的物联网专业技术是从基础的仪器仪表和电气技能开始的,这能帮助工人发明新的无线发射器或提升技术,以提高电池寿命和功耗。 +Flynn 表示,真正的物联网专业技术是从基础的仪器仪表和电气技能开始的,这能帮助工人发明新的无线发射器或提升技术,以提高电池寿命和功耗。 -“IT 技能,如网络、IP 寻址、子网掩码、蜂窝和卫星也是物联网的关键需求”,弗林说。他还认为物联网需要数据库管理技能和云管理和安全专业知识,“特别是当高级过程控制 (APC) 将传感器数据直接发送到数据库和数据湖等事情成为常态时。” +“IT 技能,如网络、IP 寻址、子网掩码、蜂窝和卫星也是物联网的关键需求”,Flynn 说。他还认为物联网需要数据库管理技能和云管理和安全专业知识,“特别是当高级过程控制(APC)将传感器数据直接发送到数据库和数据湖等事情成为常态时。” ### 物联网专家又从何而来? -弗林说,标准化的正规教育课程将是确保毕业生或证书持有者掌握一套正确技能的最佳途径。他甚至还列出了一个样本课程。“按时间顺序开始,从基础知识开始,比如[电气&仪表]E&I和测量。然后讲授网络知识,数据库管理和云计算课程都应在此之后开展。这个学位甚至可以循序渐进至现有的工程课程中,这可能需要两年时间......来完成物联网部分的学业。” +Flynn 说,标准化的正规教育课程将是确保毕业生或证书持有者掌握一套正确技能的最佳途径。他甚至还列出了一个样本课程。“按时间顺序开始,从基础知识开始,比如 [电气仪表] 和测量。然后讲授网络知识,数据库管理和云计算课程都应在此之后开展。这个学位甚至可以循序渐进至现有的工程课程中,这可能需要两年时间……来完成物联网部分的学业。” -虽然企业培训也能发挥作用,但实际上却是“说起来容易做起来难”,弗林这样警告,“这些培训需要针对组织的具体努力而推动。” +虽然企业培训也能发挥作用,但实际上却是“说起来容易做起来难”,Flynn 这样警告,“这些培训需要针对组织的具体努力而推动。” -当然,现在市面上已经有了[大量的在线物联网培训课程和证书课程][5]。但追根到底,这一工作全都依赖于工人自身的推断。 +当然,现在市面上已经有了 [大量的在线物联网培训课程和证书课程][5]。但追根到底,这一工作全都依赖于工人自身的推断。 -“在这个世界上,随着科技不断改变行业,提升技能是非常重要的”,弗林说,“如果这种提升技能的推动力并不是来源于你的雇主,那么在线课程和认证将会是提升你自己很好的一个方式。我们只需要创建这些课程......我甚至可以预见组织将与提供这些课程的高等教育机构合作,让他们的员工更好地开始。当然,物联网课程的挑战在于它需要不断发展以跟上科技的发展。” - -**【有关物联网的更多信息,请参阅[在网络上确保物联网安全的提醒][6],我们的[最强大的物联网公司][7]列表,并了解[工业物联网][8]。 | 通过[注册网络世界新闻通讯][9]定期获取见解。】** - -参与[脸书][10]和[领英][11]上的网络世界社区,对最重要的话题进行评论。 +“在这个世界上,随着科技不断改变行业,提升技能是非常重要的”,Flynn 说,“如果这种提升技能的推动力并不是来源于你的雇主,那么在线课程和认证将会是提升你自己很好的一个方式。我们只需要创建这些课程……我甚至可以预见组织将与提供这些课程的高等教育机构合作,让他们的员工更好地开始。当然,物联网课程的挑战在于它需要不断发展以跟上科技的发展。” -------------------------------------------------------------------------------- @@ -59,7 +53,7 @@ via: https://www.networkworld.com/article/3404489/where-are-all-the-iot-experts- 作者:[Fredric Paul][a] 选题:[lujun9972][b] 译者:[Percy (@scvoet)](https://github.com/scvoet) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b1cbbedd5a3148a84efe71dafe20f3b7d7dbcc1f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 14 Feb 2021 12:05:40 +0800 Subject: [PATCH 309/381] PRF --- ...ell if implementing your Python code is a good idea.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/translated/tech/20191229 How to tell if implementing your Python code is a good idea.md b/translated/tech/20191229 How to tell if implementing your Python code is a good idea.md index e468233c23..6a40f0df90 100644 --- a/translated/tech/20191229 How to tell if implementing your Python code is a good idea.md +++ b/translated/tech/20191229 How to tell if implementing your Python code is a good idea.md @@ -7,12 +7,12 @@ [#]: via: (https://opensource.com/article/19/12/zen-python-implementation) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) -如何判断实现你的 Python 代码是否是个好主意? +如何判断你的 Python 代码实现是否合适? ====== > 这是 Python 之禅特别系列的一部分,重点介绍第十七和十八条原则:困难和容易。 -!["开发人员和运营经理两个人之间的砖墙"][1] +![](https://img.linux.net.cn/data/attachment/album/202102/14/120518rjkwvjs76p9d1911.jpg) 一门语言并不是抽象存在的。每一个语言功能都必须用代码来实现。承诺一些功能是很容易的,但实现起来就会很麻烦。复杂的实现意味着更多潜在的 bug,甚至更糟糕的是,会带来日复一日的维护负担。 @@ -20,9 +20,9 @@ ### 如果一个实现难以解释,那就是个坏思路If the implementation is hard to explain, it's a bad idea -编程语言最重要的是可预测性。有时我们用抽象的编程模型来解释某个结构的语义,而这些模型与实现并不完全对应。然而,最好的解释只是*解释实现*。 +编程语言最重要的是可预测性。有时我们用抽象的编程模型来解释某个结构的语义,而这些模型与实现并不完全对应。然而,最好的释义就是*解释该实现*。 -如果该实现很难解释,那就意味着这个途径是不可能的。 +如果该实现很难解释,那就意味着这条路行不通。 ### 如果一个实现易于解释,那它可能是一个好思路If the implementation is easy to explain, it may be a good idea From 7082c70d9ac4d820217ac73ea0b0aed95ab5897f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 14 Feb 2021 12:06:17 +0800 Subject: [PATCH 310/381] PUB @wxy https://linux.cn/article-13116-1.html --- ...to tell if implementing your Python code is a good idea.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191229 How to tell if implementing your Python code is a good idea.md (97%) diff --git a/translated/tech/20191229 How to tell if implementing your Python code is a good idea.md b/published/20191229 How to tell if implementing your Python code is a good idea.md similarity index 97% rename from translated/tech/20191229 How to tell if implementing your Python code is a good idea.md rename to published/20191229 How to tell if implementing your Python code is a good idea.md index 6a40f0df90..1a2358a77c 100644 --- a/translated/tech/20191229 How to tell if implementing your Python code is a good idea.md +++ b/published/20191229 How to tell if implementing your Python code is a good idea.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13116-1.html) [#]: subject: (How to tell if implementing your Python code is a good idea) [#]: via: (https://opensource.com/article/19/12/zen-python-implementation) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From 29626cbd2e43441c1ee021c39ad98ab5012ddb0f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 14 Feb 2021 13:12:41 +0800 Subject: [PATCH 311/381] PRF @amwps290 --- ...20210204 A hands-on tutorial of SQLite3.md | 179 ++++++++---------- 1 file changed, 76 insertions(+), 103 deletions(-) diff --git a/translated/tech/20210204 A hands-on tutorial of SQLite3.md b/translated/tech/20210204 A hands-on tutorial of SQLite3.md index cab669bf2e..0e242be683 100644 --- a/translated/tech/20210204 A hands-on tutorial of SQLite3.md +++ b/translated/tech/20210204 A hands-on tutorial of SQLite3.md @@ -1,48 +1,42 @@ [#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " +[#]: translator: "amwps290" +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "A hands-on tutorial of SQLite3" [#]: via: "https://opensource.com/article/21/2/sqlite3-cheat-sheet" [#]: author: "Klaatu https://opensource.com/users/klaatu" - SQLite3 实践教程 ====== +> 开始使用这个功能强大且通用的数据库吧。 +![](https://img.linux.net.cn/data/attachment/album/202102/14/131146jsx2kvyobwxwswct.jpg) -开始使用这个功能强大且通用的数据库吧。你可以先下载 SQLite 备忘单。 +应用程序经常需要保存数据。无论你的用户是创建简单的文本文档、复杂的图形布局、游戏进度还是错综复杂的客户和订单号列表,软件通常都意味着生成数据。有很多方法可以存储数据以供重复使用。你可以将文本转储为 INI、[YAML][2]、XML 或 JSON 等配置格式,可以输出原始的二进制数据,也可以将数据存储在结构化数据库中。SQLite 是一个自包含的、轻量级数据库,可轻松创建、解析、查询、修改和传输数据。 -![Cheat Sheet cover image][1] - -应用程序经常需要保存数据。 无论您的用户是创建简单的文本文档,复杂的图形布局,游戏进度还是错综复杂的客户和订单号列表,通常都暗示着正在生成数据。 有很多方法可以存储数据以供重复使用。 您可以将文本转储为 INI,[YAML][2],XML 或 JSON 等格式,可以输出原始的二进制数据,也可以将数据存储在结构化数据库中。 SQLite 是一个自包含的轻量级数据库,可轻松创建,解析,查询,修改和传输数据。 - -**下载 [SQLite3 备忘录][3]** - -SQLite 一直致力于[公共领域][4],[从技术上讲,它没有版权,因此不需要许可证][5]。 如果您需要许可证,则可以[购买所有权担保][6]。 SQLite 非常常见,大约有 1 万亿个 SQLite 数据库正在使用中。 在每个基于 Webkit 的 Web 浏览器,现代电视机,汽车多媒体系统以及无数其他软件应用程序中, Android 和 iOS 设备, macOS 和 Windows 10 计算机,大多数 Linux 系统上都包含多个数据库。 +- 下载 [SQLite3 备忘录][3] +SQLite 专用于 [公共领域][4],[从技术上讲,这意味着它没有版权,因此不需要许可证][5]。如果你需要许可证,则可以 [购买所有权担保][6]。SQLite 非常常见,大约有 1 万亿个 SQLite 数据库正在使用中。在每个基于 Webkit 的 Web 浏览器,现代电视机,汽车多媒体系统以及无数其他软件应用程序中,Android 和 iOS 设备, macOS 和 Windows 10 计算机,大多数 Linux 系统上都包含多个这种数据库。 总而言之,它是用于存储和组织数据的一个可靠而简单的系统。 +### 安装 -**安装** +你的系统上可能已经有 SQLite 库,但是你需要安装其命令行工具才能直接使用它。在 Linux上,你可能已经安装了这些工具。该工具提供的命令是 `sqlite3` (而不仅仅是 sqlite)。 -您的系统上可能已经有 SQLite 库,但是您需要安装其命令行工具才能直接使用它。 在 Linux上,您可能已经安装了这些工具。 工具提供的命令是 **sqlite3** (而不仅仅是 **sqlite**)。 +如果没有在你的 Linux 或 BSD 上安装 SQLite,你则可以从软件仓库中或 ports 树中安装 SQLite,也可以从源代码或已编译的二进制文件进行[下载并安装][7]。 -如果没有在您的 Linux 或 BSD 上安装 SQLite,您则可以从软件仓库中或 ports tree 中安装 SQLite,也可以从源代码或已编译的二进制文件进行[下载并安装][7]。 - -在 macOS 或 Windows 上,您可以从 [sqlite.org][7] 下载并安装 SQLite 工具。 +在 macOS 或 Windows 上,你可以从 [sqlite.org][7] 下载并安装 SQLite 工具。 ### 使用 SQLite -通过编程语言与数据库进行交互是很常见的。 因此,像 Java,Python,Lua,PHP,Ruby,C ++ 以及其他编程语言都提供了 SQLite 的接口(或“绑定”)。 但是,在使用这些库之前,使用基本的命令有助于了解数据库引擎实际发生的情况以及选择数据库的重要性。 本文向您介绍 SQLite 和 **sqlite3** 命令,以便您熟悉该数据库如何处理数据的基础知识。 +通过编程语言与数据库进行交互是很常见的。因此,像 Java、Python、Lua、PHP、Ruby、C++ 以及其他编程语言都提供了 SQLite 的接口(或“绑定”)。但是,在使用这些库之前,了解数据库引擎的实际情况以及为什么你对数据库的选择很重要是有帮助的。本文向你介绍 SQLite 和 `sqlite3` 命令,以便你熟悉该数据库如何处理数据的基础知识。 ### 与 SQLite 交互 -您可以使用 **sqlite3** 命令与 SQLite 进行交互。 该命令提供了一个交互式的 shell 程序,以便您可以查看和更新数据库。 - +你可以使用 `sqlite3` 命令与 SQLite 进行交互。 该命令提供了一个交互式的 shell 程序,以便你可以查看和更新数据库。 ``` $ sqlite3 @@ -50,14 +44,13 @@ SQLite version 3.34.0 2020-12-01 16:14:00 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. -sqlite> +sqlite> ``` -该命令将您使您处于 SQLite 的子 shell 中,因此现在的提示是 SQLite 的提示。 您以前使用的 Bash 命令在这里将不再适用。 您必须使用 SQLite 命令。 要查看 SQLite 命令列表,请输入 **. help **: - +该命令将你使你处于 SQLite 的子 shell 中,因此现在的提示符是 SQLite 的提示符。你以前使用的 Bash 命令在这里将不再适用。你必须使用 SQLite 命令。要查看 SQLite 命令列表,请输入 `.help`: ``` -sqlite> .help +sqlite> .help .archive ... Manage SQL archives .auth ON|OFF SHOW authorizer callbacks .backup ?DB? FILE Backup DB (DEFAULT "main") TO FILE @@ -67,34 +60,33 @@ sqlite> .help [...] ``` -这些命令中的一些是二进制的,而其他一些则需要唯一的参数(如文件名,路径等)。 这些是 SQLite Shell 的管理命令,不是用于数据库查询。 数据库以结构化查询语言(SQL)进行查询,许多 SQLite 查询与您从 [MySQL][8] 和 [MariaDB][9] 数据库中已经知道的查询相同。 但是,数据类型和功能不同,因此,如果您熟悉另一个数据库,请特别注意细微的差异。 +这些命令中的其中一些是二进制的,而其他一些则需要唯一的参数(如文件名、路径等)。这些是 SQLite Shell 的管理命令,不是用于数据库查询。数据库以结构化查询语言(SQL)进行查询,许多 SQLite 查询与你从 [MySQL][8] 和 [MariaDB][9] 数据库中已经知道的查询相同。但是,数据类型和函数有所不同,因此,如果你熟悉另一个数据库,请特别注意细微的差异。 ### 创建数据库 -启动 SQLite 时,可以打开内存中的提示,也可以选择要打开的数据库: - +启动 SQLite 时,可以打开内存数据库,也可以选择要打开的数据库: ``` -`$ sqlite3 mydatabase.db` +$ sqlite3 mydatabase.db ``` 如果还没有数据库,则可以在 SQLite 提示符下创建一个数据库: +``` +sqlite> .open mydatabase.db +``` -``` -`sqlite> .open mydatabase.db` -``` -现在,您的硬盘驱动器上有一个空文件,可以用作 SQLite 数据库。 文件扩展名 **.db** 是任意的。 您也可以使用 **.sqlite** 或任何您想要的后缀。 +现在,你的硬盘驱动器上有一个空文件,可以用作 SQLite 数据库。 文件扩展名 `.db` 是任意的。你也可以使用 `.sqlite` 或任何你想要的后缀。 ### 创建一个表 -数据库包含一些 _表_,可以将其可视化为电子表格。 有许多的行(在数据库中称为 _记录_ )和列。 行和列的交集称为 _域_。 +数据库包含一些table,可以将其可视化为电子表格。有许多的行(在数据库中称为记录record)和列。行和列的交集称为字段field。 -结构化查询语言(SQL)以其提供的名称命名:是一种以可预测且一致的语法查询数据库内容以接收有用的结果的方法。 SQL 读起来很像普通的英语句子,即使有点像机器人一样。 当前,您的数据库是一个没有任何表的空数据库。 +结构化查询语言(SQL)以其提供的内容而命名:一种以可预测且一致的语法查询数据库内容以接收有用的结果的方法。SQL 读起来很像普通的英语句子,即使有点机械化。当前,你的数据库是一个没有任何表的空数据库。 -你可以使用 **CREATE** 来创建一个新表,你可以和 **IF NOT EXISTS** 结合使用。以便不会破坏现在已有的同名的表。 +你可以使用 `CREATE` 来创建一个新表,你可以和 `IF NOT EXISTS` 结合使用。以便不会破坏现在已有的同名的表。 -您无法在 SQLite 中创建一个没有任何字段的空表,因此在尝试 **CREATE** 语句之前,必须考虑预期表将存储的数据类型。 在此示例中,我将使用以下列创建一个名为 _member_ 的表: +你无法在 SQLite 中创建一个没有任何字段的空表,因此在尝试 `CREATE` 语句之前,必须考虑预期表将存储的数据类型。在此示例中,我将使用以下列创建一个名为 `member` 的表: * 唯一标识符 * 人名 @@ -102,87 +94,75 @@ sqlite> .help #### 唯一标识符 - -最好用唯一的编号来引用记录,幸运的是,SQLite 认识到这一点,创建一个名叫 **rowid** 的列来自动实现这一点。 - +最好用唯一的编号来引用记录,幸运的是,SQLite 认识到这一点,创建一个名叫 `rowid` 的列来为你自动实现这一点。 无需 SQL 语句即可创建此字段。 - #### 数据类型 +对于我的示例表中,我正在创建一个 `name` 列来保存 `TEXT` 类型的数据。为了防止在没有指定字段数据的情况下创建记录,可以添加 `NOT NULL` 指令。 -对于我的示例表中,我正在创建一个 _name_ 列来保存 **TEXT** 类型的数据。 为了防止在没有指定字段数据的情况下创建记录,可以添加 **NOT NULL** 指令。 - -用 **name TEXT NOT NULL** 语句来创建。 +用 `name TEXT NOT NULL` 语句来创建。 SQLite 中有五种数据类型(实际上是 _储存类别_): - * TEXT: 文本字符串 - * INTEGER: 一个数字 - * REAL: 一个浮点数(小数位数无限制) - * BLOB: 二进制数据(例如,.jpeg或.webp图像) - * NULL: 空值 - + * `TEXT`:文本字符串 + * `INTEGER`:一个数字 + * `REAL`:一个浮点数(小数位数无限制) + * `BLOB`:二进制数据(例如,.jpeg 或 .webp 图像) + * `NULL`:空值 #### 日期和时间戳 -SQLite 有一个方便的日期和时间戳功能。 它本身不是数据类型,而是 SQLite 中的一个函数,它根据所需的格式生成字符串或整数。 在此示例中,我将其保留为默认值。 +SQLite 有一个方便的日期和时间戳功能。它本身不是数据类型,而是 SQLite 中的一个函数,它根据所需的格式生成字符串或整数。 在此示例中,我将其保留为默认值。 +创建此字段的 SQL 语句是:`datestamp DATETIME DEFAULT CURRENT_TIMESTAMP`。 -创建此字段的 SQL 语句是:**datestamp DATETIME DEFAULT CURRENT_TIMESTAMP** - -### 创表语句 - +### 创建表的语句 在 SQLite 中创建此示例表的完整 SQL: - ``` -sqlite> CREATE TABLE -...> IF NOT EXISTS -...> member (name TEXT NOT NULL, -...> datestamp DATETIME DEFAULT CURRENT_TIMESTAMP +sqlite> CREATE TABLE +...> IF NOT EXISTS +...> member (name TEXT NOT NULL, +...> datestamp DATETIME DEFAULT CURRENT_TIMESTAMP); ``` -在此代码示例中,我在语句的分句后按了回车键。以使其更易于阅读。 SQLite 除非以分号(**;**)终止,否则不会运行您的命令。 - -您可以使用 SQLite 命令 **.tables** 验证表是否已创建: +在此代码示例中,我在语句的分句后按了回车键。以使其更易于阅读。除非以分号(`;`)终止,否则 SQLite 不会运行你的 SQL 语句。 +你可以使用 SQLite 命令 `.tables` 验证表是否已创建: ``` -sqlite> .tables +sqlite> .tables member ``` ### 查看表中的所有列 -您可以使用 **PRAGMA** 语句验证表包含哪些列和行: - +你可以使用 `PRAGMA` 语句验证表包含哪些列和行: ``` -sqlite> PRAGMA table_info(member); +sqlite> PRAGMA table_info(member); 0|name|TEXT|1||0 -1|datestamp|CURRENT_TIMESTAMP|0||0 +1|datestamp|DATETIME|0|CURRENT_TIMESTAMP|0 ``` ### 数据输入 -您可以使用 **INSERT** 语句将一些示例数据填充到表中: - +你可以使用 `INSERT` 语句将一些示例数据填充到表中: ``` -> INSERT INTO member (name) VALUES ('Alice'); -> INSERT INTO member (name) VALUES ('Bob'); -> INSERT INTO member (name) VALUES ('Carol'); -> INSERT INTO member (name) VALUES ('David'); +> INSERT INTO member (name) VALUES ('Alice'); +> INSERT INTO member (name) VALUES ('Bob'); +> INSERT INTO member (name) VALUES ('Carol'); +> INSERT INTO member (name) VALUES ('David'); ``` -查看表中的数据 - +查看表中的数据: ``` -> SELECT * FROM member; +> SELECT * FROM member; Alice|2020-12-15 22:39:00 Bob|2020-12-15 22:39:02 Carol|2020-12-15 22:39:05 @@ -193,69 +173,62 @@ David|2020-12-15 22:39:07 现在创建第二个表: - ``` -> CREATE TABLE IF NOT EXISTS linux ( -...> distro TEXT NOT NULL) +> CREATE TABLE IF NOT EXISTS linux ( +...> distro TEXT NOT NULL); ``` -填充一些示例数据,这一次使用多个 **VALUES** 的快捷方式,因此您可以在一个命令中添加多行。 关键字 **VALUES** 期望在括号中列出一个列表,但可以采用多个用逗号分隔列表: - +填充一些示例数据,这一次使用小的 `VALUES` 快捷方式,因此你可以在一个命令中添加多行。关键字 `VALUES` 期望以括号形式列出列表,而用多个逗号分隔多个列表: ``` -> INSERT INTO linux (distro) -...> VALUES ('Slackware'), ('RHEL'), -...> ('Fedora'),('Debian'); +> INSERT INTO linux (distro) +...> VALUES ('Slackware'), ('RHEL'), +...> ('Fedora'),('Debian'); ``` -### 修改表 +### 修改表结构 -您现在有两个表,但是到目前为止,两者之间没有任何关系。 它们每个都包含独立的数据,但是可能您可能需要将第一个表的成员与第二个表中列出的特定项相关联。 +你现在有两个表,但是到目前为止,两者之间没有任何关系。它们每个都包含独立的数据,但是可能你可能需要将第一个表的成员与第二个表中列出的特定项相关联。 -为此,您可以为第一个表创建一个新列,该列对应于第二个表。 由于两个表都设计有唯一标识符(这要归功于 SQLite 的自动创建),所以连接它们的最简单方法是将其中一个的 **rowid** 字段用作另一个的选择器。 +为此,你可以为第一个表创建一个新列,该列对应于第二个表。由于两个表都设计有唯一标识符(这要归功于 SQLite 的自动创建),所以连接它们的最简单方法是将其中一个的 `rowid` 字段用作另一个的选择器。 在第一个表中创建一个新列,以存储第二个表中的值: - ``` -`> ALTER TABLE member ADD os INT;` +> ALTER TABLE member ADD os INT; ``` -使用 **linux** 表中的唯一标识符,作为 member 表中每一条记录中 os 字段的值。因为记录已经存在。因此你可以使用 **UPDATE** 语句而不是使用 **INSERT** 语句来更新数据。需要特别注意的是,你首先需要选中特定的一行来然后才能更新其中的某个字段。从句法上讲,这有点相反,更新首先发生,选择匹配最后发生: - +使用 `linux` 表中的唯一标识符作为 `member` 表中每一条记录中 `os` 字段的值。因为记录已经存在。因此你可以使用 `UPDATE` 语句而不是使用 `INSERT` 语句来更新数据。需要特别注意的是,你首先需要选中特定的一行来然后才能更新其中的某个字段。从句法上讲,这有点相反,更新首先发生,选择匹配最后发生: ``` -`> UPDATE member SET os=1 WHERE name='Alice';` +> UPDATE member SET os=1 WHERE name='Alice'; ``` - -对 **member** 表中的其他行重复相同的过程。更新 os 字段,为了数据多样性,在四行记录上分配三种不同的发行版。 +对 `member` 表中的其他行重复相同的过程。更新 `os` 字段,为了数据多样性,在四行记录上分配三种不同的发行版(其中一种加倍)。 ### 联接表 -现在,这两个表相互关联,您可以使用 SQL 显示关联的数据。 数据库中有多种 _joins_ ,但是一旦掌握了基础知识,就可以尝试全部使用。 这是一个基本联接,用于将 member 表的 os 字段中的值与 linux 表的 id 字段相关联: - +现在,这两个表相互关联,你可以使用 SQL 显示关联的数据。数据库中有多种 _联接方式_,但是一旦掌握了基础知识,就可以尝试所有的联接形式。这是一个基本联接,用于将 `member` 表的 `os` 字段中的值与 linux 表的 `rowid` 字段相关联: ``` -> SELECT * FROM member INNER JOIN linux ON member.os=linux.rowid; +> SELECT * FROM member INNER JOIN linux ON member.os=linux.rowid; Alice|2020-12-15 22:39:00|1|Slackware Bob|2020-12-15 22:39:02|3|Fedora Carol|2020-12-15 22:39:05|3|Fedora David|2020-12-15 22:39:07|4|Debian ``` -**os** 和 **id** 字段形成了关联 - -在一个图形应用程序中,你可以想象 os 字段是一个下拉选项按钮,其中的值是 **linux** 表中 **distro** 字段中的数据。通过将相关的数据集通过唯一的字段相关联,可以确保数据的一致性和有效性,并且借助 SQL,您可以在以后动态地关联它们。 +`os` 和 `rowid` 字段形成了关联。 +在一个图形应用程序中,你可以想象 `os` 字段是一个下拉选项菜单,其中的值是 `linux` 表中 `distro` 字段中的数据。将相关的数据集通过唯一的字段相关联,可以确保数据的一致性和有效性,并且借助 SQL,你可以在以后动态地关联它们。 ### 了解更多 -SQLite 是一个非常有用的独立,可移植的开源数据库。 学习以交互方式使用它是迈向针对 Web 应用程序进行管理或通过编程语言库使用它的重要的第一步。 +SQLite 是一个非常有用的自包含的、可移植的开源数据库。学习以交互方式使用它是迈向针对 Web 应用程序进行管理或通过编程语言库使用它的重要的第一步。 -如果您喜欢 SQLite,也可以尝试由同一位作者 Richard Hipp 博士的 [Fossil][10]。 +如果你喜欢 SQLite,也可以尝试由同一位作者 Richard Hipp 博士的 [Fossil][10]。 -在学习和使用 SQLite 时,有一些常用命令可能会有所帮助,所以请立即下载我们的 **[SQLite3备忘单][3] **! +在学习和使用 SQLite 时,有一些常用命令可能会有所帮助,所以请立即下载我们的 [SQLite3 备忘单][3]! -------------------------------------------------------------------------------- @@ -264,7 +237,7 @@ via: https://opensource.com/article/21/2/sqlite3-cheat-sheet 作者:[Klaatu][a] 选题:[lujun9972][b] 译者:[amwps290](https://github.com/amwps290) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8086250d9586dd2d01381f87ed63abbe4c302990 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 14 Feb 2021 13:13:12 +0800 Subject: [PATCH 312/381] PUB @amwps290 https://linux.cn/article-13117-1.html --- .../20210204 A hands-on tutorial of SQLite3.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210204 A hands-on tutorial of SQLite3.md (99%) diff --git a/translated/tech/20210204 A hands-on tutorial of SQLite3.md b/published/20210204 A hands-on tutorial of SQLite3.md similarity index 99% rename from translated/tech/20210204 A hands-on tutorial of SQLite3.md rename to published/20210204 A hands-on tutorial of SQLite3.md index 0e242be683..ce67ba10e4 100644 --- a/translated/tech/20210204 A hands-on tutorial of SQLite3.md +++ b/published/20210204 A hands-on tutorial of SQLite3.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "amwps290" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13117-1.html" [#]: subject: "A hands-on tutorial of SQLite3" [#]: via: "https://opensource.com/article/21/2/sqlite3-cheat-sheet" [#]: author: "Klaatu https://opensource.com/users/klaatu" From 95db1720597625c1b5cf36639ac20884df5cdb74 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 14 Feb 2021 13:16:12 +0800 Subject: [PATCH 313/381] PRF --- published/20210204 A hands-on tutorial of SQLite3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210204 A hands-on tutorial of SQLite3.md b/published/20210204 A hands-on tutorial of SQLite3.md index ce67ba10e4..057e0ce98e 100644 --- a/published/20210204 A hands-on tutorial of SQLite3.md +++ b/published/20210204 A hands-on tutorial of SQLite3.md @@ -47,7 +47,7 @@ Use ".open FILENAME" to reopen on a persistent database. sqlite> ``` -该命令将你使你处于 SQLite 的子 shell 中,因此现在的提示符是 SQLite 的提示符。你以前使用的 Bash 命令在这里将不再适用。你必须使用 SQLite 命令。要查看 SQLite 命令列表,请输入 `.help`: +该命令将使你处于 SQLite 的子 shell 中,因此现在的提示符是 SQLite 的提示符。你以前使用的 Bash 命令在这里将不再适用。你必须使用 SQLite 命令。要查看 SQLite 命令列表,请输入 `.help`: ``` sqlite> .help From f6c88a7f9bbdcd12627d94381387d5f5c04133a3 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 14 Feb 2021 14:09:59 +0800 Subject: [PATCH 314/381] =?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 --- ...reate and Manage Archive Files in Linux.md | 214 ------------------ ...reate and Manage Archive Files in Linux.md | 202 +++++++++++++++++ 2 files changed, 202 insertions(+), 214 deletions(-) delete mode 100644 sources/tech/20210115 How to Create and Manage Archive Files in Linux.md create mode 100644 translated/tech/20210115 How to Create and Manage Archive Files in Linux.md diff --git a/sources/tech/20210115 How to Create and Manage Archive Files in Linux.md b/sources/tech/20210115 How to Create and Manage Archive Files in Linux.md deleted file mode 100644 index ee99ce7a6d..0000000000 --- a/sources/tech/20210115 How to Create and Manage Archive Files in Linux.md +++ /dev/null @@ -1,214 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Create and Manage Archive Files in Linux) -[#]: via: (https://www.linux.com/news/how-to-create-and-manage-archive-files-in-linux-2/) -[#]: author: (LF Training https://training.linuxfoundation.org/announcements/how-to-create-and-manage-archive-files-in-linux/) - -How to Create and Manage Archive Files in Linux -====== - -_By Matt Zand and Kevin Downs_ - -In a nutshell, an archive is a single file that contains a collection of other files and/or directories. Archive files are typically used for a transfer (locally or over the internet) or make a backup copy of a collection of files and directories which allow you to work with only one file (if compressed, it has a lower size than the sum of all files within it) instead of many. Likewise, archives are used for software application packaging. This single file can be easily compressed for ease of transfer while the files in the archive retain the structure and permissions of the original files. - -We can use the tar tool to create, list, and extract files from archives. Archives made with tar are normally called “tar files,” “tar archives,” or—since all the archived files are rolled into one—“tarballs.” - -This tutorial shows how to use tar to create an archive, list the contents of an archive, and extract the files from an archive. Two common options used with all three of these operations are ‘-f’ and ‘-v’: to specify the name of the archive file, use ‘-f’ followed by the file name; use the ‘-v’ (“verbose”) option to have tar output the names of files as they are processed. While the ‘-v’ option is not necessary, it lets you observe the progress of your tar operation. - -For the remainder of this tutorial, we cover 3 topics: 1- Create an archive file, 2- List contents of an archive file, and 3- Extract contents from an archive file. We conclude this tutorial by surveying 6 practical questions related to archive file management. What you take away from this tutorial is essential for performing tasks related to [cybersecurity][1] and [cloud technology][2]. - -### 1- Creating an Archive File - -To create an archive with tar, use the ‘-c’ (“create”) option, and specify the name of the archive file to create with the ‘-f’ option. It’s common practice to use a name with a ‘.tar’ extension, such as ‘my-backup.tar’. Note that unless specifically mentioned otherwise, all commands and command parameters used in the remainder of this article are used in lowercase. Keep in mind that while typing commands in this article on your terminal, you need not type the $ prompt sign that comes at the beginning of each command line. - -Give as arguments the names of the files to be archived; to create an archive of a directory and all of the files and subdirectories it contains, give the directory’s name as an argument. - -* *To create an archive called ‘project.tar’ from the contents of the ‘project’ directory, type: - -$ _tar -cvf project.tar project_ - -This command creates an archive file called ‘project.tar’ containing the ‘project’ directory and all of its contents. The original ‘project’ directory remains unchanged. - -Use the ‘-z’ option to compress the archive as it is being written. This yields the same output as creating an uncompressed archive and then using gzip to compress it, but it eliminates the extra step. - -* *To create a compressed archive called ‘project.tar.gz’ from the contents of the ‘project’ directory, type: - -$ _tar -zcvf project.tar.gz project_ - -This command creates a compressed archive file, ‘project.tar.gz’, containing the ‘project’ directory and all of its contents. The original ‘project’ directory remains unchanged. - -**NOTE:** While using the ‘-z’ option, you should specify the archive name with a ‘.tar.gz’ extension and not a ‘.tar’ extension, so the file name shows that the archive is compressed. Although not required, it is a good practice to follow. - -Gzip is not the only form of compression. There is also bzip2 and and xz. When we see a file with an extension of xz we know it has been compressed using xz. When we see a file with the extension of .bz2 we can infer it was compressed using bzip2. We are going to steer away from bzip2 as it is becoming unmaintained and focus on xz. When compressing using xz it is going to take longer for the files to compressed. However, it is typically worth the wait as the compression is much more effective, meaning the resulting file will usually be smaller than other compression methods used. Even better is the fact that decompression, or expanding the file, is not much different between the different methods of compression. Below we see an example of how to utilize xz when compressing a file using tar - -  $ _tar -Jcvf project.tar.xz project_ - -We simply switch -z for gzip to uppercase -J for xz. Here are some outputs to display the differences between the forms of compression: - -![][3] - -![][4] - -As you can see xz does take the longest to compress. However it does the best job of reducing files size, so it’s worth the wait. The larger the file is the better the compression becomes too! - -### 2- Listing Contents of an Archive File - -To list the contents of a tar archive without extracting them, use tar with the ‘-t’ option. - -* *To list the contents of an archive called ‘project.tar’, type: - -$ _tar -tvf project.tar_ * * - -This command lists the contents of the ‘project.tar’ archive. Using the ‘-v’ option along with the ‘-t’ option causes tar to output the permissions and modification time of each file, along with its file name—the same format used by the ls command with the ‘-l’ option. - -* *To list the contents of a compressed archive called ‘project.tar.gz’, type: - -$ _tar -tvf project.tar_ - -* *3- Extracting contents from an Archive File - -To extract (or _unpack_) the contents of a tar archive, use tar with the ‘-x’ (“extract”) option. - -* *To extract the contents of an archive called ‘project.tar’, type: - -$ _tar -xvf project.tar_ - -This command extracts the contents of the ‘project.tar’ archive into the current directory. - -If an archive is compressed, which usually means it will have a ‘.tar.gz’ or ‘.tgz’ extension, include the ‘-z’ option. - -* *To extract the contents of a compressed archive called ‘project.tar.gz’, type: - -$ _tar -zxvf project.tar.gz_ - -**NOTE:** If there are files or subdirectories in the current directory with the same name as any of those in the archive, those files will be overwritten when the archive is extracted. If you don’t know what files are included in an archive, consider listing the contents of the archive first. - -Another reason to list the contents of an archive before extracting them is to determine whether the files in the archive are contained in a directory. If not, and the current directory contains many unrelated files, you might confuse them with the files extracted from the archive. - -To extract the files into a directory of their own, make a new directory, move the archive to that directory, and change to that directory, where you can then extract the files from the archive. - -Now that we have learned how to create an Archive file and list/extract its contents, we can move on to discuss the following 9 practical questions that are frequently asked by Linux professionals. - - * Can we add content to an archive file without unpacking it? - - - -Unfortunately, once a file has been compressed there is no way to add content to it. You would have to “unpack” it or extract the contents, edit or add content, and then compress the file again. If it’s a small file this process will not take long. If it’s a larger file then be prepared for it to take a while. - - * Can we delete content from an archive file without unpacking it? - - - -This depends on the version of tar being used. Newer versions of tar will support a –delete. - -For example, let’s say we have files file1 and file2 . They can be removed from file.tar with the following: - -_$ tar -vf file.tar –delete file1 file2_ - -To remove a directory dir1: - -_$ tar -f file.tar –delete dir1/*_ - - * What are the differences between compressing a folder and archiving it? - - - -The simplest way to look at the difference between archiving and compressing is to look at the end result. When you archive files you are combining multiple files into one. So if we archive 10 100kb files you will end up with one 1000kb file. On the other hand if we compress those files we could end up with a file that is only a few kb or close to 100kb. - - * How to compress archive files? - - - -As we saw above you can create and archive files using the tar command with the cvf options. To compress the archive file we made there are two options; run the archive file through compression such as gzip. Or use a compression flag when using the tar command. The most common compression flags are- z for gzip, -j for bzip and -J for xz. We can see the first method below: - -_$ gzip file.tar_ - -Or we can just use a compression flag when using the tar command, here we’ll see the gzip flag “z”: - -_$ tar -cvzf file.tar /some/directory_ - - * How to create archives of multiple directories and/or files at one time? - - - -It is not uncommon to be in situations where we want to archive multiple files or directories at once. And it’s not as difficult as you think to tar multiple files and directories at one time. You simply supply which files or directories you want to tar as arguments to the tar command: - -_$ tar -cvzf file.tar file1 file2 file3_ - -or - -_$ tar -cvzf file.tar /some/directory1 /some/directory2_ - - * How to skip directories and/or files when creating an archive? - - - -You may run into a situation where you want to archive a directory or file but you don’t need certain files to be archived. To avoid archiving those files or “exclude” them you would use the –exclude option with tar: - -_$ tar –exclude ‘/some/directory’ -cvf file.tar /home/user_ - -So in this example /home/user would be archived but it would exclude the /some/directory if it was under /home/user. It’s important that you put the –exclude option before the source and destination as well as to encapsulate the file or directory being excluded with single quotation marks. - -### Summary - -The tar command is useful for creating backups or compressing files you no longer need. It’s good practice to back up files before changing them. If something doesn’t work how it’s intended to after the change you will always be able to revert back to the old file. Compressing files no longer in use helps keep systems clean and lowers the disk space usage. There are other utilities available but tar has reigned supreme for its versatility, ease of use and popularity. - -### Resources - -If you like to learn more about Linux, reading the following articles and tutorials are highly recommended: - - * [Comprehensive Review of Linux File System Architecture and Management][5] - * [Comprehensive Review of How Linux File and Directory System Works][6] - * [Comprehensive list of all Linux OS distributions][7] - * [Comprehensive list of all special purpose Linux distributions][8] - * [Linux System Admin Guide- Best Practices for Making and Managing Backup Operations][9] - * [Linux System Admin Guide- Overview of Linux Virtual Memory and Disk Buffer Cache][10] - * [Linux System Admin Guide- Best Practices for Monitoring Linux Systems][11] - * [Linux System Admin Guide- Best Practices for Performing Linux Boots and Shutdowns][12] - - - -### About the Authors - -**Matt Zand** is a serial entrepreneur and the founder of 3 tech startups: [DC Web Makers][13], [Coding Bootcamps][14] and [High School Technology Services][15]. He is a leading author of [Hands-on Smart Contract Development with Hyperledger Fabric][16] book by O’Reilly Media. He has written more than 100 technical articles and tutorials on blockchain development for Hyperledger, Ethereum and Corda R3 platforms. At DC Web Makers, he leads a team of blockchain experts for consulting and deploying enterprise decentralized applications. As chief architect, he has designed and developed blockchain courses and training programs for Coding Bootcamps. He has a master’s degree in business management from the University of Maryland. Prior to blockchain development and consulting, he worked as senior web and mobile App developer and consultant, angel investor, business advisor for a few startup companies. You can connect with him on LI: - -**Kevin Downs** is Red Hat Certified System Administrator or RHCSA. At his current job at IBM as Sys Admin, he is in charge of administering hundreds of servers running on different Linux distributions. He is a Lead Linux Instructor at [Coding Bootcamps][17] where he has authored [5 self-paced Courses][18]. - -The post [How to Create and Manage Archive Files in Linux][19] appeared first on [Linux Foundation – Training][20]. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/news/how-to-create-and-manage-archive-files-in-linux-2/ - -作者:[LF Training][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://training.linuxfoundation.org/announcements/how-to-create-and-manage-archive-files-in-linux/ -[b]: https://github.com/lujun9972 -[1]: https://learn.coding-bootcamps.com/p/essential-practical-guide-to-cybersecurity-for-system-admin-and-developers -[2]: https://learn.coding-bootcamps.com/p/introduction-to-cloud-technology -[3]: https://training.linuxfoundation.org/wp-content/uploads/2020/12/Linux1-300x94.png -[4]: https://training.linuxfoundation.org/wp-content/uploads/2020/12/Linux2-300x110.png -[5]: https://blockchain.dcwebmakers.com/blog/linux-os-file-system-architecture-and-management.html -[6]: https://coding-bootcamps.com/linux/filesystem/index.html -[7]: https://myhsts.org/tutorial-list-of-all-linux-operating-system-distributions.php -[8]: https://coding-bootcamps.com/list-of-all-special-purpose-linux-distributions.html -[9]: https://myhsts.org/tutorial-system-admin-best-practices-for-managing-backup-operations.php -[10]: https://myhsts.org/tutorial-how-linux-virtual-memory-and-disk-buffer-cache-work.php -[11]: https://myhsts.org/tutorial-system-admin-best-practices-for-monitoring-linux-systems.php -[12]: https://myhsts.org/tutorial-best-practices-for-performing-linux-boots-and-shutdowns.php -[13]: https://blockchain.dcwebmakers.com/ -[14]: http://coding-bootcamps.com/ -[15]: https://myhsts.org/ -[16]: https://www.oreilly.com/library/view/hands-on-smart-contract/9781492086116/ -[17]: https://coding-bootcamps.com/ -[18]: https://learn.coding-bootcamps.com/courses/author/758905 -[19]: https://training.linuxfoundation.org/announcements/how-to-create-and-manage-archive-files-in-linux/ -[20]: https://training.linuxfoundation.org/ diff --git a/translated/tech/20210115 How to Create and Manage Archive Files in Linux.md b/translated/tech/20210115 How to Create and Manage Archive Files in Linux.md new file mode 100644 index 0000000000..56f30af5a1 --- /dev/null +++ b/translated/tech/20210115 How to Create and Manage Archive Files in Linux.md @@ -0,0 +1,202 @@ +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "How to Create and Manage Archive Files in Linux" +[#]: via: "https://www.linux.com/news/how-to-create-and-manage-archive-files-in-linux-2/" +[#]: author: "LF Training https://training.linuxfoundation.org/announcements/how-to-create-and-manage-archive-files-in-linux/" + +如何在 Linux 中创建和管理归档文件 +====== + +_由 Matt Zand 和 Kevin Downs 联合写作_ + +简而言之,归档是一个包含一系列文件和(或)目录的单一文件。归档文件通常用于在本地或互联网上传输,或成为一个一系列文件和目录的备份副本,从而允许你使用一个文件来工作(如果压缩,则其大小会小于所有文件的总和)。同样的,归档也用于软件应用程序打包。为了方便传输,可以很容易地压缩这个单一文件,而存档中的文件会保留原始结构和权限。 + +我们可以使用 tar 工具来创建、列出和提取归档中的文件。用 tar 生成的归档通常称为“tar 文件”、“tar 归档”或者“压缩包”(因为所有已归档的文件被合成了一个文件)。 + +本教程会展示如何使用 tar 创建、列出和提取归档中的内容。这三个操作都会使用两个公共选项 "-f" 和 "-v":使用 "-f" 指定归档文件的名称,使用 "-v"("verbose") 选项使 tar 在处理文件时输出文件名。虽然 "-v" 选项不是必需的,但是它可以让你观察 tar 操作的过程。 + +在本教程的剩余部分中,会涵盖 3 个主题:1、创建一个归档文件;2、列出归档文件内容;3、提取归档文件内容。另外我们会回答通过调查与归档文件管理的 6 个实际问题来结束本教程。你从本教程学到的内容对于执行与[网络安全][1]和[云技术][2]相关的任务至关重要。 + +### 1- 创建一个归档文件 + +要使用 tar 创建一个归档文件,使用 "-c"("create") 选项,然后用 "-f" 选项指定要创建的归档文件名。通常的做法是使用带有 ".tar" 扩展名的名称,例如 "my-backup.tar"。注意,除非另有特别说明,否则本文其余部分中使用的所有命令和参数都以小写形式使用。记住,在你的终端上输入本文的命令时,无需输入每个命令行开头的 $ 提示符。 + +输入要归档的文件名作为参数;如果要创建一个包含所有文件及其子目录的归档文件,提供目录名称作为参数。 + +要归档 "project" 目录内容,输入 + +$ _tar -cvf project.tar project_ + +这个命令将创建一个名为 "project.tar" 的归档文件,包含 "project" 目录的所有内容,而原目录 "project" 将保持不变。 + +使用 "-z" 选项可以对归档文件进行压缩,这样产生的输出与创建未压缩的存档然后用 gzip 压缩是一样的,但它省去了额外的步骤。 + +要从 "project" 目录创建一个 "project.tar.gz" 的压缩包,输入: + +$ _tar -zcvf project.tar.gz project_ + +这个命令将创建一个 "project.tar.gz" 的压缩包,包含 "project" 目录的所有内容,而原目录 "project" 将保持不变。 + +**注意:**在使用 "-z" 选项时,你应该使用 ".tar.gz" 扩展名而不是 ".tar" 扩展名,这样表示已压缩。虽然不是必须的,但这是一个很好的实践。 + +Gzip 不是唯一的压缩形式,还有 bzip2 和 xz。当我们看到扩展名为 xz 的文件时,我们知道该文件是使用 xz 压缩的,扩展名为 .bz2 的文件是用 bzip2 压缩的。随着 bzip2 不再维护,我们将远离它而关注 xz。使用 xz 压缩时,需要花费更长的时间。然而,等待通常是值得的,因为压缩效果要好的多,这意味着压缩包通常比使用其它压缩形式要小。更好的是,不同压缩形式之间的解压缩或提取文件并没有太大区别。下面我们将看到一个使用 tar 压缩文件时如何使用 xz 的示例: + +  $ _tar -Jcvf project.tar.xz project_ + +我们只需将 gzip 的 -z 选项转换为 xz 的大写 -J 即可。以下是一些输出,显示压缩形式之间的差异: + +![][3] + +![][4] + +如你所见,zx 的压缩时间最长。但是,它在减小文件大小方面做的最好,所以值得等待。文件越大,压缩效果也越好。 + +### 2- 列出归档文件的内容 + +要列出 tar 归档文件的内容但不提取,使用 "-t" 选项。 + +要列出 "project.tar" 的内容,输入: + +$ _tar -tvf project.tar_ * * + +这个命令列出了 "project.tar" 归档的内容。"-v" 和 "-t" 选项一起使用会输出每个文件的权限和修改时间,以及文件名。这与 ls 命令使用 "-l" 选项时使用的格式相同。 + +要列出 "project.tar.gz" 压缩包的内容,输入: + +$ _tar -tvf project.tar_ + +### 3- 从归档中提取内容 + +要提取(解压)tar 归档文件中的内容,使用 "-x"("extract") 选项。 + +要提取 "project.tar" 归档的内容,输入: + +$ _tar -xvf project.tar_ + +这个命令会将 "project.tar" 归档的内容提取到当前目录。 + +如果一个归档文件被压缩,通常来说它的扩展名为 ".tar.gz" 或 ".tgz",包括 "-z" 选项。 + +要提取 "project.tar.gz" 压缩包的内容,输入: + +$ _tar -zxvf project.tar.gz_ + +**注意**:如果当前目录中有文件或子目录与归档文件中的内容同名,那么在提取归档文件时,这些文件或子目录将被覆盖。如果你不知道归档中包含哪些文件,请考虑先查看归档文件的内容。 + +在提取归档内容之前列出其内容的另一个原因是,确定归档中的内容是否包含在目录中。如果没有,而当前目录中包含许多不相关的文件,那么你可能将它们与归档中提取的文件混淆。 + +要将文件提取到它们自己的目录中,新建一个目录,将归档文件移到该目录,然后你就可以在新目录中提取文件。 + +现在我们已经学习了如何创建归档文件并列出和提取其内容,接下来我们可以继续讨论 Linux 专业人员经常被问到的 9 个实用问题。 + + * 可以在不解压缩的情况下添加内容到压缩包中吗? + +很不幸,一旦文件将被压缩,就无法向其添加内容。你需要解压缩或提取其内容,然后编辑或添加内容,最后再次压缩文件。如果文件很小,这个过程不会花费很长时间,否则请等待一会。 + + * 可以在不解压缩的情况下删除归档文件中的内容吗? + +这取决压缩时使用的 tar 版本。较新版本的 tar 支持 -delete 选项。 + +例如,假设归档文件中有 file1 和 file2,可以使用以下命令将它们从 file.tar 中删除: + +_$ tar -vf file.tar –delete file1 file2_ + +删除目录 dir1: + +_$ tar -f file.tar –delete dir1/*_ + + * 压缩和归档之间有什么区别? + +查看归档和压缩之间差异最简单的方法是查看其解压大小。归档文件时,会将多个文件合并为一个。所以,如果我们归档 10 个 100kb 文件,则最终会得到一个 100kb 大小的文件。而如果压缩这些文件,则最终可能得到一个只有几 kb 或接近 100kb 的文件。 + + * 如何压缩归档文件? + +如上所说,你可以使用带有 cvf 选项的 tar 目录来创建和归档文件。要压缩归档文件,有两个选择:通过压缩程序(例如 gzip)运行归档文件,或在使用 tar 命令时使用压缩选项。最常见的压缩标志 -z 表示 gzip,-j 表示 bzip,-J 表示 xz。例如: + +_$ gzip file.tar_ + +或者,我们可以在使用 tar 命令时使用压缩标志,以下命令使用 gzip 标志 "z": + +_$ tar -cvzf file.tar /some/directory_ + + * 如何一次创建多个目录和/或文件的归档? + +一次要归档多个文件,这种情况并不少见。一次归档多个文件和目录并不像你想的那么难,你只需要提供多个文件或目录作为 tar 的参数即可: + +_$ tar -cvzf file.tar file1 file2 file3_ + +或者 + +_$ tar -cvzf file.tar /some/directory1 /some/directory2_ + + * 创建归档时如何跳过目录和/或文件? + +你可能会遇到这样的情况:要归档一个目录或文件,但不是所有文件,这种情况下可以使用 --exclude 选项: + +_$ tar –exclude ‘/some/directory’ -cvf file.tar /home/user_ + +在示例中,/home/user 目录中除了 /some/directory 之外都将被归档。将 -exclude 选项放在源和目标之前,并用单引号将要排除的文件或目录引起来,这一点很重要。 + +### 总结 + +tar 命令对展示不需要的文件创建备份或压缩文件很有用。在更改文件之前备份它们是一个很好的做法。如果某些东西在更改后没有按预期正常工作,你始终可以还原到旧文件。压缩不再使用的文件有助于保持系统干净,并降低磁盘空间使用率。还有其它实用程序可以归档或压缩,但是 tar 因其多功能、易用性和受欢迎程度而独占鳌头。 + +### 资源 + +如果你想了解有关 Linux 的更多信息,强烈建议阅读以下文章和教程: + + * [Linux 文件系统架构和管理综述][5] + * [Linux 文件和目录系统工作原理的全面回顾][6] + * [所有 Linux 系统发行版的综合列表][7] + * [特殊用途 Linux 发行版的综合列表][8] + * [Linux 系统管理指南 - 制作和管理备份操作的最佳实践][9] + * [Linux 系统管理指南 - Linux 虚拟内存和磁盘缓冲区缓存概述][10] + * [Linux 系统管理指南 - 监控 Linux 的最佳实践][11] + * [Linux 系统管理指南 - Linux 启动和关闭的最佳实践][12] + + + +### 关于作者 + +**Matt Zand** 是一位创业者,也是 3 家科技创业公司的创始人: [DC Web Makers][13]、[Coding Bootcamps][14] 和 [High School Technology Services][15]。他也是 [使用 Hyperledger Fabric 进行智能合约开发][16] 一书的主要作者。他为 Hyperledger、以太坊和 Corda R3 平台编写了 100 多篇关于区块链开发的技术文章和教程。在 DC Web Makers,他领导了一个区块链专家团队,负责咨询和部署企业去中心化应用程序。作为首席架构师,他为编码训练营设计和开发了区块链课程和培训项目。他拥有马里兰大学(University of Maryland)工商管理硕士学位。在区块链开发和咨询之前,他曾担任一些初创公司的高级网页和移动应用程序开发和顾问、天使投资人和业务顾问。你可以通过以下这个网址和他取得联系: 。 + +**Kevin Downs** 是 Red Hat 认证的系统管理员和 RHCSA。他目前在 IBM 担任系统管理员,负责管理数百台运行在不同 Linux 发行版上的服务器。他是[编码训练营][17]的首席 Linux 讲师,并且他会讲授 [5 个自己的课程][18]. + +本文首发在 [Linux 基础培训][20]上。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/how-to-create-and-manage-archive-files-in-linux-2/ + +作者:[LF Training][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://training.linuxfoundation.org/announcements/how-to-create-and-manage-archive-files-in-linux/ +[b]: https://github.com/lujun9972 +[1]: https://learn.coding-bootcamps.com/p/essential-practical-guide-to-cybersecurity-for-system-admin-and-developers +[2]: https://learn.coding-bootcamps.com/p/introduction-to-cloud-technology +[3]: https://training.linuxfoundation.org/wp-content/uploads/2020/12/Linux1-300x94.png +[4]: https://training.linuxfoundation.org/wp-content/uploads/2020/12/Linux2-300x110.png +[5]: https://blockchain.dcwebmakers.com/blog/linux-os-file-system-architecture-and-management.html +[6]: https://coding-bootcamps.com/linux/filesystem/index.html +[7]: https://myhsts.org/tutorial-list-of-all-linux-operating-system-distributions.php +[8]: https://coding-bootcamps.com/list-of-all-special-purpose-linux-distributions.html +[9]: https://myhsts.org/tutorial-system-admin-best-practices-for-managing-backup-operations.php +[10]: https://myhsts.org/tutorial-how-linux-virtual-memory-and-disk-buffer-cache-work.php +[11]: https://myhsts.org/tutorial-system-admin-best-practices-for-monitoring-linux-systems.php +[12]: https://myhsts.org/tutorial-best-practices-for-performing-linux-boots-and-shutdowns.php +[13]: https://blockchain.dcwebmakers.com/ +[14]: http://coding-bootcamps.com/ +[15]: https://myhsts.org/ +[16]: https://www.oreilly.com/library/view/hands-on-smart-contract/9781492086116/ +[17]: https://coding-bootcamps.com/ +[18]: https://learn.coding-bootcamps.com/courses/author/758905 +[19]: https://training.linuxfoundation.org/announcements/how-to-create-and-manage-archive-files-in-linux/ +[20]: https://training.linuxfoundation.org/ From fd25fa26d0a89ca9a5f404773dd544d827848259 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 14 Feb 2021 21:24:24 +0800 Subject: [PATCH 315/381] APL --- ...Namespaces are the shamash candle of the Zen of Python.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md b/sources/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md index c984f9e299..04ef473b9b 100644 --- a/sources/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md +++ b/sources/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -9,8 +9,7 @@ Namespaces are the shamash candle of the Zen of Python ====== -This is part of a special series about the Zen of Python focusing on one -bonus principle: namespaces. +This is part of a special series about the Zen of Python focusing on one bonus principle: namespaces. ![Person programming on a laptop on a building][1] Hanukkah famously has eight nights of celebration. The Hanukkah menorah, however, has nine candles: eight regular candles and a ninth that is always offset. It is called the **shamash** or **shamos**, which loosely translates to meaning "servant" or "janitor." From e5a2bc64d1a07abba49afb49d50988990e37c31e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 14 Feb 2021 22:00:17 +0800 Subject: [PATCH 316/381] TSL&PRF --- ...the shamash candle of the Zen of Python.md | 54 ----------------- ...the shamash candle of the Zen of Python.md | 58 +++++++++++++++++++ 2 files changed, 58 insertions(+), 54 deletions(-) delete mode 100644 sources/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md create mode 100644 translated/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md diff --git a/sources/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md b/sources/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md deleted file mode 100644 index 04ef473b9b..0000000000 --- a/sources/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md +++ /dev/null @@ -1,54 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Namespaces are the shamash candle of the Zen of Python) -[#]: via: (https://opensource.com/article/19/12/zen-python-namespaces) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -Namespaces are the shamash candle of the Zen of Python -====== -This is part of a special series about the Zen of Python focusing on one bonus principle: namespaces. -![Person programming on a laptop on a building][1] - -Hanukkah famously has eight nights of celebration. The Hanukkah menorah, however, has nine candles: eight regular candles and a ninth that is always offset. It is called the **shamash** or **shamos**, which loosely translates to meaning "servant" or "janitor." - -The shamos is the candle that lights all the others: it is the only candle whose fire can be used, not just watched. As we wrap up our series on the Zen of Python, I see how namespaces provide a similar service. - -### Namespaces in Python - -Python uses namespaces for everything. Though simple, they are sparse data structures—which is often the best way to achieve a goal. - -> A _namespace_ is a mapping from names to objects. -> -> — [Python.org][2] - -Modules are namespaces. This means that correctly predicting module semantics often just requires familiarity with how Python namespaces work. Classes are namespaces. Objects are namespaces. Functions have access to their local namespace, their parent namespace, and the global namespace. - -The simple model, where the **.** operator accesses an object, which in turn will usually, but not always, do some sort of dictionary lookup, makes Python hard to optimize, but easy to explain. - -Indeed, some third-party modules take this guideline and run with it. For example, the** [variants][3]** package turns functions into namespaces of "related functionality." It is a good example of how the [Zen of Python][4] can inspire new abstractions. - -### In conclusion - -Thank you for joining me on this Hanukkah-inspired exploration of [my favorite language][5]. Go forth and meditate on the Zen until you reach enlightenment. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/zen-python-namespaces - -作者:[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/computer_code_programming_laptop.jpg?itok=ormv35tV (Person programming on a laptop on a building) -[2]: https://docs.python.org/3/tutorial/classes.html -[3]: https://pypi.org/project/variants/ -[4]: https://www.python.org/dev/peps/pep-0020/ -[5]: https://opensource.com/article/19/10/why-love-python diff --git a/translated/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md b/translated/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md new file mode 100644 index 0000000000..6aa0d3ee85 --- /dev/null +++ b/translated/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Namespaces are the shamash candle of the Zen of Python) +[#]: via: (https://opensource.com/article/19/12/zen-python-namespaces) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +命名空间是 Python 之禅的精髓 +====== + +> 这是 Python 之禅特别系列的一部分,重点是一个额外的原则:命名空间。 + +![在建筑物上的笔记本电脑上编程的人][1] + +著名的光明节Hanukkah有八个晚上的庆祝活动。然而,光明节的灯台有九根蜡烛:八根普通蜡烛和总是偏移的第九根蜡烛。它被称为 “shamash” 或 “shamos”,大致可以翻译为“仆人”或“看门人”的意思。 + +shamos 是点燃所有其它蜡烛的蜡烛:它是唯一一支可以用火的蜡烛,而不仅仅是观看。当我们结束关于 Python 之禅系列时,我看到命名空间提供了类似的作用。 + +### Python 中的命名空间 + +Python 使用命名空间来处理一切。虽然简单,但它们是稀疏的数据结构 —— 这通常是实现目标的最佳方式。 + +> *命名空间* 是一个从名字到对象的映射。 +> +> —— [Python.org][2] + +模块是命名空间。这意味着正确地预测模块语义通常只需要熟悉 Python 命名空间的工作方式。类是命名空间,对象是命名空间。函数可以访问它们的本地命名空间、父命名空间和全局命名空间。 + +这个简单的模型,即用 `.` 操作符访问一个对象,而这个对象又通常(但并不总是)会进行某种字典查找,这使得 Python 很难优化,但很容易解释。 + +事实上,一些第三方模块也采取了这个准则,并以此来运行。例如,[variants][3] 包把函数变成了“相关功能”的命名空间。这是一个很好的例子,说明 [Python 之禅][4] 是如何激发新的抽象的。 + +### 结语 + +感谢你和我一起参加这次以光明节为灵感的 [我最喜欢的语言][5] 的探索。 + +静心参禅,直至悟道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/zen-python-namespaces + +作者:[Moshe Zadka][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV (Person programming on a laptop on a building) +[2]: https://docs.python.org/3/tutorial/classes.html +[3]: https://pypi.org/project/variants/ +[4]: https://www.python.org/dev/peps/pep-0020/ +[5]: https://opensource.com/article/19/10/why-love-python From e30f6c0d6684a645584e9c510d66f81ad6bb5b6c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 15 Feb 2021 05:03:57 +0800 Subject: [PATCH 317/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210214=20?= =?UTF-8?q?Give=20something=20from=20the=20heart=20to=20the=20public=20dom?= =?UTF-8?q?ain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210214 Give something from the heart to the public domain.md --- ...ing from the heart to the public domain.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20210214 Give something from the heart to the public domain.md diff --git a/sources/tech/20210214 Give something from the heart to the public domain.md b/sources/tech/20210214 Give something from the heart to the public domain.md new file mode 100644 index 0000000000..07ea72f223 --- /dev/null +++ b/sources/tech/20210214 Give something from the heart to the public domain.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Give something from the heart to the public domain) +[#]: via: (https://opensource.com/article/21/2/public-domain) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike) + +Give something from the heart to the public domain +====== +The team at Creative Commons wants you to share a creation to the Public +Domain as a show of support for openly sharing content. +![Red Lego Heart][1] + +Did you know that most of the articles published on Opensource.com are licensed under Creative Commons [BY-SA 4.0][2]? + +One of the biggest reasons our editorial team decided on this license over 10 years ago is because we support the idea that the best content is _shared_ content. As we strive to be open, our goal is for any many people as possible to have access to the information we're putting out there to support our mission to help others learn and grow and to explore new open source worlds. + +So, what does this have to do with Valentine's Day (or Friend's Day in Finland)? + +The team at Creative Commons wants you to [share a creation][3] to the [Public Domain][4] as a show of support for openly sharing content. It could be an image, song, artwork, poem, GIF, research paper... the list goes on! But "why?" I hear you asking. What's so special about the Public Domain? Well, did you hear about Nathan Evans's rendition of the sea shanty song "The Wellerman" that went viral? Here's what Creative Commons CEO Catherine Stihler [had to say about it][5]: + +"It is important to note that this flourishing creative scene is only possible because sea shanties are in the public domain—not under restrictive copyright rules. Therefore, they can be played, reused, dueted, remixed, and transformed. This, combined with the internet, means a postal worker in Airdrie can reach a global audience within seconds. Thanks to emerging technologies and social platforms, the public domain can both enable creativity and benefit from it with the invention of new works that are also free of copyright restrictions. (The hope is that these new works are put back into the public domain!) This expressiveness in new works and collaborations is bringing joy and uplifting our spirits as we continue to face daunting challenges." + +So, I'll add a twist on their Valentine's Day challenge: If you want to share something you've created but aren't sure about going totally Public Domain, check out the other [options for licensing][6] from CC BY to CC0. And to lower the bar even more to entice you to join in: You don't have to create something new, right now. Search through your archives for something you created last year or five years ago, and give it new life today with a new license. + + 1. Find the thing you want to share + 2. If it's not already, prepare it in digital format + 3. [Select the place][6] you want to share it to, like the Internet Archive, Flickr, etc. + 4. Upload and append attribution including "Public Domain" or [other Creative Commons open license][7] + + + +I'm a plant person, so [here's mine][8]! + +![Neon-colored herbal bundles][9] + +“[Neon-colored herbal bundles][8]” by Jen Wike Huger is licensed under Public Domain. + +If you aren't in the creating mood but want to find some great CC-licensed content, use the [search.creativecommons.org][10] tool. Then, take a peek at the best way to [give credit back][11] when you use what you find. + +Virtual high-fives and sweet treats from our team to you and yours! + +You don't need to be a master coder to contribute to open source. Jade Wang shares 8 ways you can... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/public-domain + +作者:[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/heart_lego_ccby20.jpg?itok=VRpHf4iU (Red Lego Heart) +[2]: https://creativecommons.org/licenses/by-sa/4.0/ +[3]: https://creativecommons.org/2021/02/10/open-sharing-is-caring/ +[4]: https://creativecommons.org/share-your-work/public-domain/ +[5]: https://creativecommons.org/2021/02/03/the-postal-worker-a-sea-shanty-and-the-public-domain/ +[6]: https://creativecommons.org/share-your-work/ +[7]: https://creativecommons.org/choose/ +[8]: https://archive.org/details/neon_inverted_herbal_bundle +[9]: https://opensource.com/sites/default/files/uploads/neon_inverted_herbal_bundle.jpg (Neon-colored herbal bundles) +[10]: https://search.creativecommons.org/ +[11]: https://creativecommons.org/use-remix/attribution/ From 14bb75a253be14a998e5cf3b017879741e1fd43b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 15 Feb 2021 05:04:15 +0800 Subject: [PATCH 318/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210214=20?= =?UTF-8?q?Why=20programmers=20love=20Linux=20packaging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210214 Why programmers love Linux packaging.md --- ...14 Why programmers love Linux packaging.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20210214 Why programmers love Linux packaging.md diff --git a/sources/tech/20210214 Why programmers love Linux packaging.md b/sources/tech/20210214 Why programmers love Linux packaging.md new file mode 100644 index 0000000000..837b4a2aed --- /dev/null +++ b/sources/tech/20210214 Why programmers love Linux packaging.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why programmers love Linux packaging) +[#]: via: (https://opensource.com/article/21/2/linux-packaging) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Why programmers love Linux packaging +====== +Programmers can distribute their software easily and consistently via +Flatpaks, letting them focus on their passion: Programming. +![Package wrapped with brown paper and red bow][1] + +In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Today, I'll talk about what makes packaging for Linux ideal for programmers. + +Programmers love to program. That probably seems like an obvious statement, but it's important to understand that developing software involves a lot more than just writing code. It includes compiling, documentation, source code management, install scripts, configuration defaults, support files, delivery format, and more. Getting from a blank screen to a deliverable software installer requires much more than just programming, but most programmers would rather program than package. + +### What is packaging? + +When food is sent to stores to be purchased, it is packaged. When buying directly from a farmer or from an eco-friendly bulk or bin store, the packaging is whatever container you've brought with you. When buying from a grocery store, packaging may be a cardboard box, plastic bag, a tin can, and so on. + +When software is made available to computer users at large, it also must be packaged. Like food, there are several ways software can be packaged. Open source software can be left unpackaged because users, having access to the raw code, can compile and package it themselves. However, there are advantages to packages, so applications are commonly delivered in some format specific to the user's platform. And that's where the problems begin, because there's not just one format for software packages. + +For the user, packages make it easy to install software because all the work is done by the system's installer. The software is extracted from its package and distributed to the appropriate places within the operating system. There's little opportunity for anything to go wrong. + +For the software developer, however, packaging means that you have to learn how to create a package—and not just one package, but a unique package for every operating system you want your software to be installable on. To complicate matters, there are multiple packaging formats and options for each operating system, and sometimes even for the programming language being used. + +### Packaging on Linux + +Packaging options for Linux have traditionally seemed pretty overwhelming. Linux distributions derived from Fedora, such as Red Hat and CentOS, default to `.rpm` packages. Debian and Ubuntu (and similar) default to `.deb` packages. Other distributions may use one or the other, or neither, opting for a custom format. When asked, many Linux users say that ideally, a programmer won't package their software for Linux at all but instead rely on the package maintainers of each distribution to create the package. All software installed onto any Linux system ought to come from that distribution's official repository. However, it remains unclear how to get your software reliably packaged and included by one distribution, let alone all distributions. + +### Flatpak for Linux + +The Flatpak packaging system was introduced to unify and decentralize Linux as a delivery target for developers. With Flatpak, either a developer or anyone (a member of a Linux community, a different developer, a Flatpak team member, or anyone else) is free to package software. They can then submit the package to Flathub or choose to self-host the package and offer it to basically any Linux distribution. The Flatpak system is available to all Linux distributions, so targeting one is the same as targeting them all. + +### How Flatpak technology works + +The secret to Flatpak's universal appeal is a standard base. The Flatpak system allows developers to reference a common set of Software Developer Kit (SDK) modules. These are packaged and managed by the maintainers of the Flatpak system. The SDKs get pulled in as needed whenever you install a Flatpak, ensuring compatibility with your system. Any given SDK is only required once because the libraries it contains can be shared across any Flatpak calling for it. + +If a developer requires a library not already included in an existing SDK, the developer can add that library in the Flatpak. + +The results speak for themselves. Users may install hundreds of packages on any Linux distribution from one central repository, called [Flathub][2]. + +### How developers use Flatpaks + +Flatpaks are designed to be reproducible, so the build process is easily integrated into a CI/CD workflow. A Flatpak is defined in a [YAML][3] or JSON manifest file. You can create your first Flatpak by following my [introductory article][4], and you can read the full documentation at [docs.flatpak.org][5]. + +### Linux makes it easy + +Creating software on Linux is easy, and packaging it up for Linux is simple and automatable. If you're a programmer, Linux makes it easy for you to forget about packaging by targeting one system and integrating that into your build process. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-packaging + +作者:[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/brown-package-red-bow.jpg?itok=oxZYQzH- (Package wrapped with brown paper and red bow) +[2]: https://flatpak.org/setup/ +[3]: https://www.redhat.com/sysadmin/yaml-beginners +[4]: https://opensource.com/article/19/10/how-build-flatpak-packaging +[5]: https://docs.flatpak.org/en/latest/index.html From 6bd1b6eb9d062e63eaf3ecf0acc27ca6f5567a23 Mon Sep 17 00:00:00 2001 From: amwps290 Date: Mon, 15 Feb 2021 08:47:42 +0800 Subject: [PATCH 319/381] Update 20210104 Network address translation part 1 - packet tracing.md --- ...10104 Network address translation part 1 - packet tracing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210104 Network address translation part 1 - packet tracing.md b/sources/tech/20210104 Network address translation part 1 - packet tracing.md index 850b4f9e1c..a1cfd4de2c 100644 --- a/sources/tech/20210104 Network address translation part 1 - packet tracing.md +++ b/sources/tech/20210104 Network address translation part 1 - packet tracing.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (amwps290) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0897f200ad42e0ba1b9ad539bb9bd7ed507da62a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 15 Feb 2021 09:47:45 +0800 Subject: [PATCH 320/381] Rename sources/tech/20210214 Give something from the heart to the public domain.md to sources/talk/20210214 Give something from the heart to the public domain.md --- ...20210214 Give something from the heart to the public domain.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210214 Give something from the heart to the public domain.md (100%) diff --git a/sources/tech/20210214 Give something from the heart to the public domain.md b/sources/talk/20210214 Give something from the heart to the public domain.md similarity index 100% rename from sources/tech/20210214 Give something from the heart to the public domain.md rename to sources/talk/20210214 Give something from the heart to the public domain.md From 233ca4a10d2ce998012132372ad37b166eb7ee14 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: Mon, 15 Feb 2021 10:04:24 +0800 Subject: [PATCH 321/381] Apply for translation(mengxinayan) --- ... A guide to understanding Linux software libraries in C.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210204 A guide to understanding Linux software libraries in C.md b/sources/tech/20210204 A guide to understanding Linux software libraries in C.md index 68e8c4a4d3..fe977cd22f 100644 --- a/sources/tech/20210204 A guide to understanding Linux software libraries in C.md +++ b/sources/tech/20210204 A guide to understanding Linux software libraries in C.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mengxinayan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -492,7 +492,7 @@ via: https://opensource.com/article/21/2/linux-software-libraries 作者:[Marty Kalin][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[萌新阿岩](https://github.com/mengxinayan) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b66944abcc00be1ea8f8ea753f165d39be9836b7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 15 Feb 2021 10:06:53 +0800 Subject: [PATCH 322/381] PRF @geekpi --- ...rce, Raw Image Editor for Linux Desktop.md | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md b/translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md index 6eb5f0f6e4..8313606f91 100644 --- a/translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md +++ b/translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md @@ -1,22 +1,24 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop) [#]: via: (https://itsfoss.com/filmulator/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -Filmulator 是一个简单的、开源的用于 Linux 桌面的 Raw 图像编辑器 +Filmulator:一个简单的、开源的 Raw 图像编辑器 ====== -_**简介:Filmulator 是一个开源的具有库管理功能的 Raw 照片编辑应用,侧重于简单、易用和简化的工作流程。**_ +![](https://img.linux.net.cn/data/attachment/album/202102/15/100616o54wb5h4aqgmq4qe.jpg) -### Filmulator:适用于 Linux(和 Windows)的 Raw 图像编辑器 +> Filmulator 是一个开源的具有库管理功能的 raw 照片编辑应用,侧重于简单、易用和简化的工作流程。 -[Linux 中有一堆 raw 照片编辑器][1]。[Filmulator][2] 就是其中之一。Filmulator 的目标是仅提供基本要素,从而使原始图像编辑变得简单。它还增加了库处理的功能,如果你正在为你的相机图像寻找一个不错的应用,这是一个加分项。 +### Filmulator:适用于 Linux(和 Windows)的 raw 图像编辑器 -对于那些不知道 raw 的人来说,[raw 图像文件][3]是一个最小化处理,未压缩的文件。换句话说,它是未经压缩的数字文件,且有最小化的处理。专业摄影师更喜欢用 raw 文件拍摄照片,并自行处理。普通人从智能手机拍摄照片,它通常被压缩为 JPEG 格式或被过滤。 +[Linux 中有一堆 raw 照片编辑器][1],[Filmulator][2] 就是其中之一。Filmulator 的目标是仅提供基本要素,从而使 raw 图像编辑变得简单。它还增加了库处理的功能,如果你正在为你的相机图像寻找一个不错的应用,这是一个加分项。 + +对于那些不知道 raw 的人来说,[raw 图像文件][3]是一个最低限度处理、未压缩的文件。换句话说,它是未经压缩的数字文件,并且只经过了最低限度的处理。专业摄影师更喜欢用 raw 文件拍摄照片,并自行处理。普通人从智能手机拍摄照片,它通常被压缩为 JPEG 格式或被过滤。 让我们来看看在 Filmulator 编辑器中会有什么功能。 @@ -24,7 +26,7 @@ _**简介:Filmulator 是一个开源的具有库管理功能的 Raw 照片编 ![Filmulator interface][4] -Filmulator 宣称,它不是典型的“胶片效果滤镜”,这只是复制了胶片的外在特征。相反,Filmulator 从根本上解决了胶片的魅力所在:显影过程。 +Filmulator 宣称,它不是典型的“胶片效果滤镜” —— 这只是复制了胶片的外在特征。相反,Filmulator 从根本上解决了胶片的魅力所在:显影过程。 它模拟了胶片的显影过程:从胶片的“曝光”,到每个像素内“银晶”的生长,再到“显影剂”在相邻像素之间与储槽中大量显影剂的扩散。 @@ -35,17 +37,17 @@ Fimulator 开发者表示,这种模拟带来了以下好处: * 在明亮区域,饱和度得到增强,有助于保留蓝天、明亮肤色和日落的色彩。 * 在极度饱和的区域,亮度会被减弱,有助于保留细节,例如花朵。 - - 以下是经 Filmulator 处理后的 raw 图像的对比,以自然的方式增强色彩,而不会引起色彩剪切。 -![][5] +![原图][5] + +![处理后][10] ### 在 Ubuntu/Linux 上安装 Filmulator Filmulator 有一个 AppImage 可用,这样你就可以在 Linux 上轻松使用它。使用 [AppImage 文件][6]真的很简单。下载后,使它可执行,然后双击运行。 -[Download Filmulator for Linux][7] +- [下载 Filmulator for Linux][7] 对 Windows 用户也有一个 Windows 版本。除此之外,你还可以随时前往[它的 GitHub 仓库][8]查看它的源代码。 @@ -55,7 +57,7 @@ Filmulator 有一个 AppImage 可用,这样你就可以在 Linux 上轻松使 Fimulator 的设计理念是为任何工作提供最好的工具,而且只有这一个工具。这意味着牺牲了灵活性,但获得了一个大大简化和精简的用户界面。 -我甚至不是一个业余的摄影师,更别说是一个专业的摄影师了。我没有单反或其他高端摄影设备。因此,我无法测试和分享我对 Filmulator 的实用性的经验。 +我连业余摄影师都不是,更别说是专业摄影师了。我没有单反或其他高端摄影设备。因此,我无法测试和分享我对 Filmulator 的实用性的经验。 如果你有更多处理 raw 图像的经验,请尝试下 Filmulator,并分享你的意见。有一个 AppImage 可以让你快速测试它,看看它是否适合你的需求。 @@ -66,7 +68,7 @@ via: https://itsfoss.com/filmulator/ 作者:[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/) 荣誉推出 @@ -80,4 +82,5 @@ via: https://itsfoss.com/filmulator/ [6]: https://itsfoss.com/use-appimage-linux/ [7]: https://filmulator.org/download/ [8]: https://github.com/CarVac/filmulator-gui -[9]: https://github.com/CarVac/filmulator-gui/wiki \ No newline at end of file +[9]: https://github.com/CarVac/filmulator-gui/wiki +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/image-with-filmulator.jpeg?ssl=1 \ No newline at end of file From 45d4ae96099686add99a967f0982183aa4a958b1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 15 Feb 2021 10:07:32 +0800 Subject: [PATCH 323/381] PUB @geekpi https://linux.cn/article-13119-1.html --- ...Simple, Open Source, Raw Image Editor for Linux Desktop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md (98%) diff --git a/translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md b/published/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md similarity index 98% rename from translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md rename to published/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md index 8313606f91..12f6aa8801 100644 --- a/translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md +++ b/published/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13119-1.html) [#]: subject: (Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop) [#]: via: (https://itsfoss.com/filmulator/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From b9a9f8efafa2091d2205a25bb74c3c14c68ad253 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 15 Feb 2021 11:06:56 +0800 Subject: [PATCH 324/381] PRF @scvoet --- ...ccess of open source depends on empathy.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/translated/talk/20210207 Why the success of open source depends on empathy.md b/translated/talk/20210207 Why the success of open source depends on empathy.md index db24502474..21576bde27 100644 --- a/translated/talk/20210207 Why the success of open source depends on empathy.md +++ b/translated/talk/20210207 Why the success of open source depends on empathy.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (scvoet) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Why the success of open source depends on empathy) @@ -9,34 +9,34 @@ 为何开源的成功取决于同理心? ====== -随着人们对同理心认识的提高和传播的启发。 -它——开源的生产力会增长,合作者们会靠拢。 -而且,可以充分利用开源软件开发的力量。 -![践行共情][1] -开源开发的协调创新精神和社区精神改变了世界。吉姆·怀特赫斯特(Jim Whitehurst)在[《开放式组织》][2]中解释说,开源的成功源于“将人们视为社区的一份子,从交易思维转变为基于承诺基础的思维方式”。 但是,开源开发模型的核心仍然存在障碍:它经常性地缺乏人们的同理心。 +> 随着对同理心认识的提高和传播同理心的激励,开源生产力将得到提升,协作者将会聚拢,可以充分激发开源软件开发的活力。 -同理心是理解或感受他人感受的能力。在开源社区中,面对面的人际互动和协作是否罕见。任何在 GitHub 提交过请求 (Pull request) 或问题 (Issues) 的开发者都曾收到过可能来自他们可能从未见过的人的评论,这些人往往身处地球的另一端,而他们的交流也可能同样遥远。现代开源开发就是建立在这种异步、事务性的沟通基础之上。因此,人们在社交媒体平台上所经历的同类型的网络欺凌和其他虐待行为在开源社区中也不足为奇。 +![](https://img.linux.net.cn/data/attachment/album/202102/15/110606rc48qf05904m9n7p.jpg) -当然,并非所有开源交流都会事与愿违。许多人在工作中发展出了尊重并秉持着良好的行为标准。但是很多时候,人们的沟通也常常缺失了常识性的礼节,他们将人们像机器而非人类一般对待。这种行为是激发开源创新模型全部潜力的障碍,因为它让许多潜在的贡献者望而却步,并扼杀了灵感。 +开源开发的协调创新精神和社区精神改变了世界。Jim Whitehurst 在[《开放式组织》][2]中解释说,开源的成功源于“将人们视为社区的一份子,从交易思维转变为基于承诺基础的思维方式”。 但是,开源开发模型的核心仍然存在障碍:它经常性地缺乏人类的同理心empathy。 + +同理心是理解或感受他人感受的能力。在开源社区中,面对面的人际互动和协作是很少的。任何经历过 GitHub 拉取请求Pull request议题Issue的开发者都曾收到过来自他们可能从未见过的人的评论,这些人往往身处地球的另一端,而他们的交流也可能同样遥远。现代开源开发就是建立在这种异步、事务性的沟通基础之上。因此,人们在社交媒体平台上所经历的同类型的网络欺凌和其他虐待行为,在开源社区中也不足为奇。 + +当然,并非所有开源交流都会事与愿违。许多人在工作中发展出了尊重并秉持着良好的行为标准。但是很多时候,人们的沟通也常常缺乏常识性的礼仪,他们将人们像机器而非人类一般对待。这种行为是激发开源创新模型全部潜力的障碍,因为它让许多潜在的贡献者望而却步,并扼杀了灵感。 ### 恶意交流的历史 -代码审查中存在的敌意言论对开源社区来说并不新鲜,它多年来一直被社区所容忍。开源教父莱纳斯·托瓦尔兹 (Linus Torvalds) 经常在代码不符合他的标准时[抨击][3] Linux 社区,并将贡献者赶走。埃隆大学计算机科学教授梅根·斯奎尔(Megan Squire)借助[机器学习][4]分析了托瓦尔兹的侮辱行为,发现它们在四年内的数量高达数千次。2018 年,莱纳斯因自己的不良行为而将自己搁置,责成自己学习同理心,道歉并为 Linux 社区制定了行为准则。 +代码审查中存在的敌意言论对开源社区来说并不新鲜,它多年来一直被社区所容忍。开源教父莱纳斯·托瓦尔兹Linus Torvalds经常在代码不符合他的标准时[抨击][3] Linux 社区,并将贡献者赶走。埃隆大学计算机科学教授 Megan Squire 借助[机器学习][4]分析了托瓦尔兹的侮辱行为,发现它们在四年内的数量高达数千次。2018 年,莱纳斯因自己的不良行为而自我放逐,责成自己学习同理心,道歉并为 Linux 社区制定了行为准则。 -2015 年,[赛格·夏普][5]虽然在技术上受人尊重,但因其缺乏对个人的尊重,被辞去了 FOSS 女性外展计划中的 Linux 内核协调员一职。 +2015 年,[Sage Sharp][5] 虽然在技术上受人尊重,但因其缺乏对个人的尊重,被辞去了 FOSS 女性外展计划中的 Linux 内核协调员一职。 PR 审核中存在的贬低性评论对开发者会造成深远的影响。它导致开发者在提交 PR 时产生畏惧感,让他们对预期中的反馈感到恐惧。这吞噬了开发者对自己能力的信心。它逼迫工程师每次都只能追求完美,从而减缓了开发速度,这与许多社区采用的敏捷方法论背道而驰。 -### 如何拉近开源中的共情缺口? +### 如何缩小开源中的同理心差距? -通常情况下,冒犯的评论常是无意间的,而通过一些指导,作者则可以学会如何在不带负面情绪的情况下表达意见。GitHub 不会监控问题和 PR 的评论是否有滥用内容,相反,它提供了一些工具,使得社区能够对其内容进行审查。所有者可以删除评论和锁定对话,所有贡献者可以报告滥用和阻止用户。 +通常情况下,冒犯的评论常是无意间的,而通过一些指导,作者则可以学会如何在不带负面情绪的情况下表达意见。GitHub 不会监控议题和 PR 的评论是否有滥用内容,相反,它提供了一些工具,使得社区能够对其内容进行审查。仓库的所有者可以删除评论和锁定对话,所有贡献者可以报告滥用和阻止用户。 制定社区行为准则可为所有级别的贡献者提供一个安全且包容的环境,并且能让所有级别的贡献者参与并定义降低协作者之间冲突的过程。 -我们能够克服开源中存在的共情问题。面对面的辩论比文字更有利于产生共鸣,所以尽可能选择视频通话。通过共情分享反馈来树立榜样。如果你目睹了一个尖锐的评论,请做一个指导员而非旁观者。如果你是受害者,请大声说出来。在面试候选人时,评估共情能力,并将共情能力与绩效评估和奖励挂钩。界定并执行社区行为准则,并管理好你的社区。 +我们能够克服开源中存在的同理心问题。面对面的辩论比文字更有利于产生共鸣,所以尽可能选择视频通话。以同理心的方式分享反馈,树立榜样。如果你目睹了一个尖锐的评论,请做一个指导者而非旁观者。如果你是受害者,请大声说出来。在面试候选人时,评估同理心能力,并将同理心能力与绩效评估和奖励挂钩。界定并执行社区行为准则,并管理好你的社区。 -随着人们对移情意识的了解的加深和灵感的传播,开源生产力将得到提升,协作者将有所作为,并且可以充分激发开源软件开发的活力。 +随着对同理心认识的提高和传播同理心的激励,开源生产力将得到提升,协作者将会聚拢,可以充分激发开源软件开发的活力。 -------------------------------------------------------------------------------- @@ -44,8 +44,8 @@ via: https://opensource.com/article/21/2/open-source-empathy 作者:[Bronagh Sorota][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[scvoet](https://github.com/scvoet) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a3fea96c71a61d74bd1daac30b6a19dce3c49e6d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 15 Feb 2021 11:07:32 +0800 Subject: [PATCH 325/381] PUB @scvoet https://linux.cn/article-13120-1.html --- ...10207 Why the success of open source depends on empathy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210207 Why the success of open source depends on empathy.md (98%) diff --git a/translated/talk/20210207 Why the success of open source depends on empathy.md b/published/20210207 Why the success of open source depends on empathy.md similarity index 98% rename from translated/talk/20210207 Why the success of open source depends on empathy.md rename to published/20210207 Why the success of open source depends on empathy.md index 21576bde27..6905d890a1 100644 --- a/translated/talk/20210207 Why the success of open source depends on empathy.md +++ b/published/20210207 Why the success of open source depends on empathy.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (scvoet) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13120-1.html) [#]: subject: (Why the success of open source depends on empathy) [#]: via: (https://opensource.com/article/21/2/open-source-empathy) [#]: author: (Bronagh Sorota https://opensource.com/users/bsorota) From 82f68233e83f3be422a9a72d4f35c7b1c6809395 Mon Sep 17 00:00:00 2001 From: XYenChi <466530436@qq.com> Date: Mon, 15 Feb 2021 17:36:48 +0800 Subject: [PATCH 326/381] Update 20190312 When the web grew up- A browser story.md --- ...2 When the web grew up- A browser story.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sources/talk/20190312 When the web grew up- A browser story.md b/sources/talk/20190312 When the web grew up- A browser story.md index 602ffff4e1..002e14c692 100644 --- a/sources/talk/20190312 When the web grew up- A browser story.md +++ b/sources/talk/20190312 When the web grew up- A browser story.md @@ -7,47 +7,47 @@ [#]: via: (https://opensource.com/article/19/3/when-web-grew) [#]: author: (Mike Bursell https://opensource.com/users/mikecamel) -web 的诞生:浏览器的故事grew up: A browser story +web 的诞生:浏览器的故事 ====== -互联网诞生之处的个人故事。A personal story of when the internet came of age. +互联网诞生之处的个人故事。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_Internet_Sign.png?itok=5MFGKs14) -最近,我Recently, I [分享了shared how][1] 获得英文文学和神学学位离开大学,在一个大家都还不知道 web 服务器是什么的地方,设法找到一份运行 web 服务器的工作。upon leaving university in 1994 with a degree in English literature and theology, I somehow managed to land a job running a web server in a world where people didn't really know what a web server was yet. 那“地方”,我不仅仅指的是我工作的组织,而是泛指所有地方。And by "in a world," I don't just mean within the organisation in which I worked, but the world in general. Web 那时当真是全新的——人们还正尝试理出头绪。The web was new—really new—and people were still trying to get their heads around it. +最近,我[分享了][1] 1994年获得英文文学和神学学位离开大学,在一个人们还不知道 web 服务器是什么的地方,成功找到一份运维 web 服务器的工作。但那“地方”,并不仅仅指的是我工作的组织,而是泛指所有地方。Web 那时当真是全新的——人们还正尝试理出头绪。 -That's not to suggest that the place where I was working—an academic publisher—particularly "got it" either. 这是个大部分人还在用 28k8 猫访问网页的地方。我记得我拿到 33k6 猫时有多激动。This was a world in which a large percentage of the people visiting their website were still running 28k8 modems. I remember my excitement in getting a 33k6 modem. 至少上下行速率不对称的日子过去了,以前带宽显示 1200/300 特别常见。t least we were past the days of asymmetric upload/download speeds,1 where 1200/300 seemed like an eminently sensible bandwidth description. 这意味着This meant that the high-design设计复杂, high-colour色彩缤纷, high-resolution纤毫毕现 documents created by the print people (端同一家饭碗) were completely impossible on the web. 我不可能让大于 40k 的GIF 出现在网站的首页推送给访问的人。I wouldn't allow anything bigger than a 40k GIF on the front page of the website, and that was pushing it for many of our visitors. 大于大约 60k 的会作为独立的图片,缩略图链接到参照页。Anything larger than 60k or so would be explicitly linked as a standalone image from a thumbnail on the referring page. +那并不是在暗示我在什么地方工作——学术出版社,也不是强调得到工作。这是个大部分人还在用 28k8 猫访问网页的世界。我记得我拿到 33k6 猫时有多激动。至少上下行速率不对称的日子过去了,以前带宽显示 1200/300 特别常见。这意味着(端同一家饭碗的)列印人员创作的设计复杂,色彩缤纷,纤毫毕现的档是完全不可能出现在 Web 上的。我不可能让大于 40k 的GIF 出现在网站的首页推送给访问的人。大于大约 60k 的会作为独立的图片,缩略图链接到参照页。 -To say that the marketing department didn't like this was an understatement. 更糟的是布局问题。Even worse was the question of layout. "Browsers decide how to lay out documents," I explained, time after time, "你可以使用眉头词或者段落,但是文档在页面上如何显示并不取决于文档,而是you can use headers or paragraphs, but how documents appear on the page isn't defined by the document, but by the renderer!" They wanted control. They wanted different coloured backgrounds. After a while, they got that. I went to what I believe was the first W3C meeting at which the idea of Cascading Style Sheets 层叠样式表(CSS) was discussed. And argued vehemently against them. The suggestion that document writers should control layout was anathema.2 It took some while for CSS to be adopted, and in the meantime, those who cared about such issues adopted the security trainwreck that was Portable Document Format (PDF). +且不说商城部分不像现在这样。更糟的是布局问题。“如何布局文档取决于浏览器,”我一遍又一遍地解释,“你可以使用眉头词或者段落,但是文档在页面上如何显示并不取决于文档,而是取决于渲染器!”他们想控制,想要不同颜色的背景。后来明白了那些不能实现。我参与了我觉得层叠样式表(CSS)的想法第一次被讨论的 W3C 会议,并进行了激烈地争论。写文档的人控制布局的建议令人讨厌。后来 CSS 被采用了,与此同时,在意安全问题的人采用了可移植文件格式(PDF)。 -How documents were rendered wasn't the only issue. Being a publisher of actual physical books, the whole point of having a web presence, as far as the marketing department was concerned, was to allow customers—or potential customers—to know not only what a book was about, but also how much it was going to cost them to buy. This, however, presented a problem. You see, the internet—in which I include the rapidly growing World Wide Web—was an open, free-for-all libertarian sort of place where nobody was interested in money; in fact, where talk of money was to be shunned and avoided. +如何渲染文档不是唯一的问题。作为一个实体书出版社,网页展示和商城部分的所有点都要关注,让消费者,或者潜在消费者知道一本书是关于什么的和预计需要花费多少钱。但这有一个问题,你看,互联网——包括快速发展的万维网——是开放的,所有都免费的自由之地没有人会在意钱;事实上,谈钱曾是被禁止的。 -I took the mainstream "Netizen网民" view that there was no place for pricing information online. 我老板,加上组织里相当多的人都持有相反的看法My boss—and, indeed, pretty much everybody else in the organisation—took a contrary view. They felt that customers should be able to see how much books would cost them. They also felt that my bank manager would like to see how much money was coming into my bank account on a monthly basis, which might be significantly reduced if I didn't come round to their view. +我和主流“网民”的看法一致,认为没必要放价格信息在线上。我老板,加上组织里相当多的人都持有相反的看法。他们觉得消费者应该能够看到书要花多少钱。他们也觉得我管理银行资产会想看账户里每个月进了多少钱,如果我不认同他们的观点的话,资金可能会急剧减少的账户。 -Luckily, by the time I'd climbed down from my high horse and got over myself a bit—probably only a few weeks after I'd started digging my heels in—the web had changed, and there were other people putting pricing information up about their products. 新来的人渐渐瞧不起先前运行 web 服务器的老学究们,但风向很清晰。These newcomers were generally looked down upon by the old schoolers who'd been running web servers since the early days,3 but it was clear which way the wind was blowing. This didn't mean that the battle was won for our website, however. As an academic publisher, we shared an academic IP name ("ac.uk") with the University. The University was less than convinced that publishing pricing information was appropriate until some senior folks at the publisher pointed out that Princeton University Press was doing it, and wouldn't we look a bit silly if…? +幸运的是,在我从高高的马儿身上摔下来之前,我已经自己认清了一些——可能是我开始迈入的几星期之后——Web 早已变了,有其他人公布他们产品的价格信息。新来的人渐渐瞧不起先前运行 web 服务器的老学究们,但风向很清晰。但是这并不意味着网站的战争结束了。作为一个学术出版社,我们和大学共享一个域名(“ac.uk“)。大学不确信公布价格信息合不合适直到普林斯顿大学出版社做了,我们会不会看起来有点傻如果······? -The fun didn't stop there, either. A few months into my tenure as webmaster ("webmaster@…"), we started to see a worrying trend, as did lots of other websites. Certain visitors were single-handedly bringing our webserver to its knees. These visitors were running a new web browser: Netscape. Netscape was badly behaved. Netscape was multi-threaded. +有趣的事情也没有停。站点管理员(“webmaster@…”)任职的短短几个月内,我们和其他很多网站一样开始看到了一种焦虑的趋势。某些访问者可以轻而易举地访问我们的网站服务器。这些访问者使用新的网页浏览器:网景。网景干坏事,它是多线程的。 -Why was this an issue? Well, before Netscape, all web browsers had been single-threaded. They would open one connection at a time, so even if you had, say five GIFs on a page,4 they would request the HTML base file, parse that, then download the first GIF, complete that, then the second, complete that, and so on. In fact, they often did the GIFs in the wrong order, which made for very odd page loading, but still, that was the general idea. The rude people at Netscape decided that they could open multiple connections to the webserver at a time to request all the GIFs at the same time, for example! And why was this a problem? Well, the problem was that most webservers were single-threaded. They weren't designed to have multiple connections open at any one time. Certainly, the HTTP server that we ran (MacHTTP) was single-threaded. Even though we had paid for it (it was originally shareware), the version we had couldn't cope with multiple requests at a time. +这为什么是个问题呢?在网景之前,所有的浏览器都是单线程。他们一次只进行一个连接,所以即使一个页面有五张动图,也会先请求 HTML 基本文件进行解析,然后下载第一张动图,完成,接着第二张,完成,如此类推。事实上,动图顺序经常出错,使得页面加载得非常奇怪,但这也是常规思路。粗暴的网景人决定他们与网站服务器一次性进行多个连接来请求所有的动图,举个例子!为什么这是个问题呢?好吧,问题就是大多数网站服务器都是单线程的。他们不是设计来一次性进行多个连接的。确实,我们运行的 HTTP 服务的软件(MacHTTP)是单线程的。即使我们已经买了(原本是共享软件),我们用的这版一次不能处理多个请求。 -The debate raged across the internet. Who did these Netscape people think they were, changing how the world worked? How it was supposed to work? The world settled into different camps, and as with all technical arguments, heated words were exchanged on both sides. The problem was that not only was Netscape multi-threaded, it was also just better than the alternatives. Lots of web server code maintainers, MacHTTP author Chuck Shotton among them, sat down and did some serious coding to produce multi-threaded beta versions of their existing code. Everyone moved almost immediately to the beta versions, they got stable, and in the end, single-threaded browsers either adapted and became multi-threaded themselves, or just went the way of all outmoded products and died a quiet death.6 +互联网上爆发了大量讨论。做网景的人觉得他们正在改变世界的工作方式?它如何支持工作?大家分成了不同阵营,双方不断交流着技术层面的热词。问题是网景不仅多线程,而且优于其他。非常多 web 服务器代码维护者,包括 MacHTTP 作者查克·肖顿在内,坐下来认真在原有代码基础上更新多线程测试版。所有人几乎立马转向测试版,他们变得稳定,最终浏览器也舍弃了单线程,变成多线程,或者只是像所有过时产品一样销声匿迹。 -This, for me, is when the web really grew up. It wasn't prices on webpages nor designers being able to define what you'd see on a page,8 but rather when browsers became easier to use and when the network effect of thousands of viewers moving to many millions tipped the balance in favour of the consumer, not the producer. There were more steps in my journey—which I'll save for another time—but from around this point, my employers started looking at our monthly, then weekly, then daily logs, and realising that this was actually going to be something big and that they'd better start paying some real attention. +对我来说,这就是 web 真正成长。那既不是网页展示的价格也不是设计者能有定义你能在网页上看到什么,而是浏览器变得更易用,几千浏览者变成几百万并且用户喜好而不是制作者变得更为重要。我的路还很长——有机会再谈——有关这点,我老板开始开始查看我们的每月,然后每周,然后每天的日志,并意识到这确实变成了大事而且真的需要我们关注。 -1\. How did they come back, again? +1\. 他们如何再次回来? -2\. It may not surprise you to discover that I'm still happiest at the command line. +2\. 毫不意外我还是使用命令行里最开心的人。 -3\. About six months before. +3\. 大约六个月前。 -4\. Reckless, true, but it was beginning to happen.5 +4\. 不计后果,真的,发生了 -5\. Oh, and no—it was GIFs or BMP. JPEG was still a bright idea that hadn't yet taken off. +5\. 噢,不——GIF,BMP或者JPEG还是好主意没被取缔。 -6\. It's never actually quiet: there are always a few diehard enthusiasts who insist that their preferred solution is technically superior and bemoan the fact that the rest of the internet has gone to the devil.7 +6\. 从未沉寂:永远都会有少数坚信他们更偏爱的解决方案更优越并哀叹互联网的其他人已经变成了恶魔的难以退却的狂热者。 -7\. I'm not one to talk: I still use Lynx from time to time. +7\. 我不是唯一一个说:我还在用 Lynx。 -8\. Creating major and ongoing problems for those with different accessibility needs, I would point out. +8\. 我指出,不同访问需求的人创造主要和正在发生的问题。 -------------------------------------------------------------------------------- @@ -55,7 +55,7 @@ via: https://opensource.com/article/19/3/when-web-grew 作者:[Mike Bursell][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[XYenChi](https://github.com/XYenChi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 031ffe8bac91bd6ba59838d2f5d70e044dc8acbd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 16 Feb 2021 05:03:40 +0800 Subject: [PATCH 327/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210215=20?= =?UTF-8?q?Installing=20Nextcloud=2020=20on=20Fedora=20Linux=20with=20Podm?= =?UTF-8?q?an?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210215 Installing Nextcloud 20 on Fedora Linux with Podman.md --- ...extcloud 20 on Fedora Linux with Podman.md | 222 ++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 sources/tech/20210215 Installing Nextcloud 20 on Fedora Linux with Podman.md diff --git a/sources/tech/20210215 Installing Nextcloud 20 on Fedora Linux with Podman.md b/sources/tech/20210215 Installing Nextcloud 20 on Fedora Linux with Podman.md new file mode 100644 index 0000000000..ae9edc77ea --- /dev/null +++ b/sources/tech/20210215 Installing Nextcloud 20 on Fedora Linux with Podman.md @@ -0,0 +1,222 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Installing Nextcloud 20 on Fedora Linux with Podman) +[#]: via: (https://fedoramagazine.org/nextcloud-20-on-fedora-linux-with-podman/) +[#]: author: (dschier https://fedoramagazine.org/author/danielwtd/) + +Installing Nextcloud 20 on Fedora Linux with Podman +====== + +![][1] + +Nowadays, many open source projects offer container images for easy deployment. This is very handy when running a home server or lab environment. A previous Fedora Magazine article covered [installing Nextcloud from the source package][2]. This article explains how you can run Nextcloud on Fedora 33 as a container deployment with Podman. + +### What is Nextcloud? + +[Nextcloud][3] started in 2016 as a fork of Owncloud. Since then, it evolved into a full-fledged collaboration software offering file-, calendar-, and contact-syncing, plus much more. You can run a simple Kanban Board in it or write documents collaboratively. Nextcloud is fully open source under the AGPLv3 License and can be used for private or commercial use alike. + +### What is Podman? + +Podman is a container engine for developing, managing, and running OCI Containers on your Linux System. It offers a wide variety of features like rootless mode, cgroupv2 support, pod management, and it can run daemonless. Furthermore, you are getting a Docker compatible API for further development. It is available by default on Fedora Workstation and ready to be used. + +In case you need to install podman, run: + +``` +sudo dnf install podman +``` + +### Designing the Deployment + +Every deployment needs a bit of preparation. Sure, you can simply start a container and start using it, but that wouldn’t be so much fun. A well-thought and designed deployment should be easy to understand and offer some kind of flexibility. + +#### Container / Images + +First, you need to choose the proper container images for the deployment. This is quite easy for Nextcloud, since it offers already a pretty good documentation for container deployments. Nextcloud supports two variations: Nextcloud Apache httpd (which is fully self-contained) and Nextcloud php-fpm (which needs an additional nginx container). + +In both cases, you also need to provide a database, which can be MariaDB (recommended) or PostgreSQL (also supported). This article uses the Apache httpd + MariaDB installation. + +#### Volumes + +Running a container does not persist data you create during the runtime. You perform updates by recreating the container. Therefore, you will need some volumes for the database and the Nextcloud files. Nextcloud also recommends you put the “data” folder in a separate volume. So you will end up with three volumes: + + * nextcloud-app + * nextcloud-data + * nextcloud-db + + + +#### Network + +Lastly, you need to consider networking. One of the benefits of containers is that you can re-create your deployment as it may look like in production. [Network segmentation][4] is a very common practice and should be considered for a container deployment, too. This tutorial will not add advanced features like network load balancing or security segmentation. You will need only one network which you will use to publish the ports for Nextcloud. Creating a network also provides the dnsname plugin, which will allow container communication based on container names. + +#### The picture + +Now that every single element is prepared, you can put these together and get a really nice understanding of how the development will look. + +![][5] + +### Run, Nextcloud, Run + +Now you have prepared all of the ingredients and you can start running the commands to deploy Nextcloud. All commands can be used for root-privileged or rootless deployments. This article will stick to rootless deployments. + +Sart with the network: + +``` +# Creating a new network +$ podman network create nextcloud-net + +# Listing all networks +$ podman network ls + +# Inspecting a network +$ podman network inspect nextcloud-net +``` + +As you can see in the last command, you created a DNS zone with the name “dns.podman”. All containers created in this network are reachable via “CONTAINER_NAME.dns.podman”. + +Next, optionally prepare your volumes. This step can be skipped, since Podman will create named volumes on demand, if they do not exist. Podman supports named volumes, which it creates in special locations, so you don’t need to take care of SELinux or alike. + +``` +# Creating the volumes +$ podman volume create nextcloud-app +$ podman volume create nextcloud-data +$ podman volume create nextcloud-db + +# Listing volumes +$ podman volume ls + +# Inspecting volumes (this also provides the full path) +$ podman volume inspect nextcloud-app +``` + +Network and volumes are done. Now provide the containers. + +First, you need the database. According to the MariaDB image documentation, you need to provide some additional environment variables,. Additionally, you need to attach the created volume, connect the network, and provide a name for the container. Most of the values will be needed in the next commands again. (Note that you should replace DB_USER_PASSWORD and DB_ROOT_PASSWORD with unique passwords.) + +``` +# Deploy Mariadb +$ podman run --detach + --env MYSQL_DATABASE=nextcloud + --env MYSQL_USER=nextcloud + --env MYSQL_PASSWORD=DB_USER_PASSWORD + --env MYSQL_ROOT_PASSWORD=DB_ROOT_PASSWORD + --volume nextcloud-db:/var/lib/mysql + --network nextcloud-net + --restart on-failure + --name nextcloud-db + docker.io/library/mariadb:10 + +# Check running containers +$ podman container ls +``` + +After the successful start of your new MariaDB container, you can deploy Nextcloud itself. (Note that you should replace DB_USER_PASSWORD with the password you used in the previous step. Replace NC_ADMIN and NC_PASSWORD with the username and password you want to use for the Nextcloud administrator account.) + +``` +# Deploy Nextcloud +$ podman run --detach + --env MYSQL_HOST=nextcloud-db.dns.podman + --env MYSQL_DATABASE=nextcloud + --env MYSQL_USER=nextcloud + --env MYSQL_PASSWORD=DB_USER_PASSWORD + --env NEXTCLOUD_ADMIN_USER=NC_ADMIN + --env NEXTCLOUD_ADMIN_PASSWORD=NC_PASSWORD + --volume nextcloud-app:/var/www/html + --volume nextcloud-data:/var/www/html/data + --network nextcloud-net + --restart on-failure + --name nextcloud + --publish 8080:80 + docker.io/library/nextcloud:20 + +# Check running containers +$ podman container ls +``` + +Now that the two containers are running, you can configure your containers. Open your browser and point to “localhost:8080” (or another host name or IP address if it is running on a different server). + +The first load may take some time (30 seconds) or even report “unable to load”. This is coming from Nextcloud, which is preparing the first run. In that case, wait a minute or two. Nextcloud will prompt for a username and password. + +![][6] + +Enter the user name and password you used previously. + +![][7] + +Now you are ready to go and experience Nextcloud for testing, development ,or your home server. + +### Update + +If you want to update one of the containers, you need to pull the new image and re-create the containers. + +``` +# Update mariadb +$ podman pull mariadb:10 +$ podman stop nextcloud-db +$ podman rm nextcloud-db +$ podman run --detach + --env MYSQL_DATABASE=nextcloud + --env MYSQL_USER=nextcloud + --env MYSQL_PASSWORD=DB_USER_PASSWORD + --env MYSQL_ROOT_PASSWORD=DB_ROOT_PASSWORD + --volume nextcloud-db:/var/lib/mysql + --network nextcloud-net + --restart on-failure + --name nextcloud-db + docker.io/library/mariadb:10 +``` + +Updating the Nextcloud container works exactly the same. + +``` +# Update Nextcloud + +$ podman pull nextcloud:20 +$ podman stop nextcloud +$ podman rm nextcloud +$ podman run --detach + --env MYSQL_HOST=nextcloud-db.dns.podman + --env MYSQL_DATABASE=nextcloud + --env MYSQL_USER=nextcloud + --env MYSQL_PASSWORD=DB_USER_PASSWORD + --env NEXTCLOUD_ADMIN_USER=NC_ADMIN + --env NEXTCLOUD_ADMIN_PASSWORD=NC_PASSWORD + --volume nextcloud-app:/var/www/html + --volume nextcloud-data:/var/www/html/data + --network nextcloud-net + --restart on-failure + --name nextcloud + --publish 8080:80 + docker.io/library/nextcloud:20 +``` + +That’s it; your Nextcloud installation is up-to-date again. + +### Conclusion + +Deploying Nextcloud with Podman is quite easy. After just a couple of minutes, you will have a very handy collaboration software, offering filesync, calendar, contacts, and much more. Check out [apps.nextcloud.com][8], which will extend the features even further. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/nextcloud-20-on-fedora-linux-with-podman/ + +作者:[dschier][a] +选题:[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/danielwtd/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/02/nextcloud-podman-816x345.jpg +[2]: https://fedoramagazine.org/build-your-own-cloud-with-fedora-31-and-nextcloud-server/ +[3]: https://nextcloud.com/ +[4]: https://en.wikipedia.org/wiki/Network_segmentation +[5]: https://fedoramagazine.org/wp-content/uploads/2021/01/nextcloud-podman-arch.png +[6]: https://fedoramagazine.org/wp-content/uploads/2021/02/Screenshot-from-2021-02-12-08-38-37-1024x211.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/02/Screenshot-from-2021-02-12-08-38-28-1024x377.png +[8]: https://apps.nextcloud.com From 4b4113089c4254281cf934c56263a109d44a672c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 16 Feb 2021 05:04:11 +0800 Subject: [PATCH 328/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210216=20?= =?UTF-8?q?Meet=20Plots:=20A=20Mathematical=20Graph=20Plotting=20App=20for?= =?UTF-8?q?=20Linux=20Desktop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md --- ...al Graph Plotting App for Linux Desktop.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md diff --git a/sources/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md b/sources/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md new file mode 100644 index 0000000000..b48cbde1e6 --- /dev/null +++ b/sources/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Meet Plots: A Mathematical Graph Plotting App for Linux Desktop) +[#]: via: (https://itsfoss.com/plots-graph-app/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Meet Plots: A Mathematical Graph Plotting App for Linux Desktop +====== + +Plots is a graph plotting application that makes it easy to visualize mathematical formulae. You can use it for trigonometric, hyperbolic, exponential and logarithmic functions along with arbitrary sums and products. + +### Plot mathematical graphs with Plots on Linux + +[Plots][1] is a simple application inspired by graph plotting web apps like [Desmos][2]. It allows you to plot graphs of different math functions, which you can enter interactively, as well as customizing the color of your plots. + +Written in Python, Plots takes advantage of modern hardware using [OpenGL][3]. It uses GTK 3 and thus integrates well with the GNOME desktop. + +![][4] + +Using plots is straightforward. To add a new equation, click the plus sign. Clicking the trash icon deletes the equation. There is also the option to undo and redo. You can also zoom in and zoom out. + +![][5] + +The text box where you type is equation friendly. The hamburger menu has a ‘help’ option to access the documentation. You’ll find useful tips on how to write various mathematical notations here. You can also copy-paste the equations. + +![][6] + +In dark mode, the sidebar equation area turns dark but the main plotting area remains white. I believe that’s by design perhaps. + +You can use multiple functions and plot them all in one graph: + +![][7] + +I found it crashing while trying to paste some equations it could not understand. If you write something that it cannot understand or conflicts with existing equations, all plots disappear, Removing the incorrect equation brings back the plot. + +No option to export the plots or copy them to clipboard unfortunately. You can always [take screenshots in Linux][8] and use the image in your document where you have to add the graphs. + +**Recommended Read:** + +![][9] + +#### [KeenWrite: An Open Source Text Editor for Data Scientists and Mathematicians][10] + +### Installing Plots on Linux + +Plots has different installation options available for various kinds of distributions. + +Ubuntu 20.04 and 20.10 users can [take advantage of the PPA][11]: + +``` +sudo add-apt-repository ppa:apandada1/plots +sudo apt update +sudo apt install plots +``` + +For other Debian based distributions, you can [install it from the deb file][12] available [here][13]. + +I didn’t find it in AUR package list but as an Arch Linux user, you can either use the Flatpak package or install it using Python. + +[Plots Flatpak Package][14] + +If interested, you may check out the source code on its GitHub repository. If you like the application, please consider giving it a star on GitHub. + +[Plots Source Code on GitHub][1] + +**Conclusion** + +The primary use case for Plots is for students learning math or related subjects, but it can be useful in many other scenarios. I know not everyone would need that but surely helpful for the people in the academics and schools. + +I would have liked the option to export the images though. Perhaps the developers can add this feature in the future releases. + +Do you know any similar applications for plotting graphs? How does Plots stack up against them? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/plots-graph-app/ + +作者:[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://github.com/alexhuntley/Plots/ +[2]: https://www.desmos.com/ +[3]: https://www.opengl.org/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/fourier-graph-plots.png?resize=800%2C492&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/plots-app-linux-1.png?resize=800%2C518&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/plots-app-linux.png?resize=800%2C527&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/multiple-equations-plots.png?resize=800%2C492&ssl=1 +[8]: https://itsfoss.com/take-screenshot-linux/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/keenwrite.png?fit=800%2C450&ssl=1 +[10]: https://itsfoss.com/keenwrite/ +[11]: https://itsfoss.com/ppa-guide/ +[12]: https://itsfoss.com/install-deb-files-ubuntu/ +[13]: https://launchpad.net/~apandada1/+archive/ubuntu/plots/+packages +[14]: https://flathub.org/apps/details/com.github.alexhuntley.Plots From e5f48e87d3678450c8ebc26b566e1533a55be5dc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 16 Feb 2021 05:04:32 +0800 Subject: [PATCH 329/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210215=20?= =?UTF-8?q?Why=20everyone=20should=20try=20using=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210215 Why everyone should try using Linux.md --- ...215 Why everyone should try using Linux.md | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 sources/tech/20210215 Why everyone should try using Linux.md diff --git a/sources/tech/20210215 Why everyone should try using Linux.md b/sources/tech/20210215 Why everyone should try using Linux.md new file mode 100644 index 0000000000..d32154a80b --- /dev/null +++ b/sources/tech/20210215 Why everyone should try using Linux.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why everyone should try using Linux) +[#]: via: (https://opensource.com/article/21/2/try-linux) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Why everyone should try using Linux +====== +If you're curious about Linux, the open source community makes sure it's +easy to try. +![Woman sitting in front of her computer][1] + +In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Let's explore why anyone can try Linux. + +Linux can seem mysterious to the uninitiated. People talk about Linux like it's something only meant for computer programmers or sysadmins, yet people also talk about running Linux on laptops or mobile devices. Tech sites list the [top 10 Linux commands][2] you [need to know][3], and yet there's just as much talk about [how exciting the Linux desktops (plural!) are][4]. + +So what's Linux all about, really? + +Well, one of the many important things about Linux is its dedication to availability. If you're curious about Linux, the open source community makes sure it's easy to try. + +### Try Linux without trying Linux + +It doesn't matter whether you're switching from Windows to Linux, Windows to Mac (or Mac to Windows), or from Mac to Linux: Changing your computing style is hard. It's not often discussed, but modern computing is a strangely personal thing. Everyone gets comfortable with their own computer, and they tend to dislike big changes. Just shifting back and forth between my work computer and my personal computer (both of which run the same OS) requires mental and muscle adjustment for me, simply because the two are "optimized" for different kinds of activities. Even though I inevitably end up being referred to just as "the guy who knows computers" in my local communities (and I do like to think that I do), were I forced to change the OS I use, my sense of productivity and enjoyment would plummet for a week or two. The thing is, it's mostly superficial. I know how to use other operating systems, but I'd need time to establish new instincts and habits. I'd need a chance to remember where some of the small configuration options are located in a new OS, and I'd have to discover new features to capitalize upon. + +For this reason, I often tell people who are curious about Linux that the first step is to use Linux _applications_. There aren't actually that many applications exclusive to Linux, largely because most apps on Linux are open source and are therefore eagerly ported between all platforms. But there are lots of applications commonly found on Linux that you can also try on your current non-Linux platform. Make it a goal to replace the applications you default to, either by force of habit or convenience, with open source equivalents. + +### Replacing apps + +The end goal of this exercise is to make a soft transition to Linux by way of the applications you'll eventually be running. Once you're used to a new set of applications, there's not much left to get used to on Linux, aside from system settings and file management. + +If you're not sure what applications you use the most, just take a look at your **Recent Applications** menu (if your OS doesn't have a Recent Applications menu, then it might be time to switch to Linux). Once you've identified your must-have applications, take a look at our [Application Alternatives][5] page to learn about many of the common open source apps considered equivalents to popular proprietary ones. + +### Getting Linux + +Not all open source applications get ported to all platforms, and many ultimately benefit from running on Linux. Eventually, if you're keen to switch to Linux, it pays to complete the transition. Luckily, getting Linux is as easy as downloading it, almost as if it were just another open source app. + +Usually, a Linux installation image features a Live mode and an Installation mode. That means you can boot from a Linux drive and use it in Live mode without actually installing it to your computer. This is a great way to get a hint of what the OS is like, but it's only a temporary experience because data isn't retained between boots. However, there are distributions, like [Porteus Linux][6], specially designed for running exclusively off of a USB thumb drive so that your personal data is retained. I keep a Porteus drive on my keychain, so no matter where I am, I have a bootable Linux image with me. + +![Porteus Live Linux distribution][7] + +The Porteus Live Linux distribution desktop. + +### The best Linux + +Once you've decided to install Linux, you'll find plenty of distributions available for the low cost of $0. If you're used to having only one or two choices in an operating system (for instance, a Home Edition and a Business Edition), then you probably find the idea of several different _distributions_ of Linux confusing. It seems more complicated than it actually is, though. Linux is Linux, and it rarely makes much of a difference whose "flavor" you download and install. The big names, like [Fedora][8], [Debian][9], [Linux Mint][10], and [Elementary][11], all deliver the same experience with a slightly unique emphasis. + + * Fedora is famous for being first to update its software + * Linux Mint provides easy options to install missing drivers + * Debian is well known for its long-term support, so updates are slow, but reliability is high + * Elementary provides a beautiful desktop experience and several special, custom-built applications + + + +Ultimately, the "best" Linux is the Linux that works best for you. I mean that literally: The best Linux for you is the Linux you try and find that all your computer features still work as expected. + +### Getting drivers + +Most drivers are already bundled in the Linux kernel (or as a kernel module). This is especially true when you're dealing with parts and peripherals a year or two old. With equipment that's been on the market for a while, Linux programmers have had the chance to develop drivers or integrate drivers from companies into the system. I've surprised more than just a few people by just attaching a Wacom graphics tablet, or a game controller, or a printer or scanner, to my Linux computer and immediately start using it, with no driver download, no installation, and little to no configuration. + +Proprietary operating systems have two strategies for dealing with device drivers. They either restrict what devices you're supposed to use with the OS, or they pay companies to write and ship drivers along with the devices. The first method is uncomfortably restrictive, but most people are (sadly) acclimated to the idea that some devices only work on some platforms. The latter method is considered a luxury, but in practice, it also has the disadvantage of being dependent upon the driver programmer. There are plenty of computer peripherals in thrift stores in perfect condition but essentially dead because the manufacturer no longer maintains the drivers the devices require to function with modern systems. + +For Linux, drivers are developed either by the manufacturer or by Linux programmers. This can cause some driver integration to be delayed (for instance, a new device might not work on Linux until six months after release), but it has the distinct advantage of long-term support. + +Should you find that there's a driver that hasn't made its way into a distribution yet. You can wait a few months and try again in hopes that a driver has been integrated into the installer image, or you can just try a different distribution to see whether the driver is there. + +### Paying for Linux + +You can avoid all the choices and any concern about compatibility by buying a PC already loaded with Linux or a PC certified for Linux. Several vendors are offering Linux pre-installed, including all [System76][12] computers, and select [Lenovo][13] models. Additionally, all Lenovo models are [Certified for Linux][14] compatibility. + +This is by far the easiest way to try Linux. + +### Working toward Linux + +Here's a challenge for you. Go through each application you have installed, and find a potential open source replacement. Select an application you use frequently, but not daily, and the next time you're about to use it, launch the open source one instead. Take the time you need to learn the new application until you're either able to adopt it as your new default or until you determine that you need to try a different option. + +The more open source products you use, the more you'll be ready to launch into the exciting world of Linux. And eventually, you'll be running the Linux desktop, along with your favorite open source apps. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/try-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/OSDC_women_computing_3.png?itok=qw2A18BM (Woman sitting in front of her computer) +[2]: https://opensource.com/article/19/12/linux-commands +[3]: https://opensource.com/article/18/4/10-commands-new-linux-users +[4]: https://opensource.com/article/20/5/linux-desktops +[5]: https://opensource.com/alternatives +[6]: http://porteus.org +[7]: https://opensource.com/sites/default/files/porteus5.png +[8]: http://getfedora.org +[9]: http://debian.org +[10]: http://linuxmint.com +[11]: http://elementary.io +[12]: http://system76.com +[13]: http://lenovo.com +[14]: https://forums.lenovo.com/t5/Linux-Operating-Systems/ct-p/lx_en From 578437a55277fe1ec3579112f40fa0dba581037d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 16 Feb 2021 05:04:45 +0800 Subject: [PATCH 330/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210215=20?= =?UTF-8?q?Protect=20your=20Home=20Assistant=20with=20these=20backups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210215 Protect your Home Assistant with these backups.md --- ... your Home Assistant with these backups.md | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 sources/tech/20210215 Protect your Home Assistant with these backups.md diff --git a/sources/tech/20210215 Protect your Home Assistant with these backups.md b/sources/tech/20210215 Protect your Home Assistant with these backups.md new file mode 100644 index 0000000000..5761273b64 --- /dev/null +++ b/sources/tech/20210215 Protect your Home Assistant with these backups.md @@ -0,0 +1,160 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Protect your Home Assistant with these backups) +[#]: via: (https://opensource.com/article/21/2/home-assistant-backups) +[#]: author: (Steve Ovens https://opensource.com/users/stratusss) + +Protect your Home Assistant with these backups +====== +Make sure you can recover quickly from a home automation failure with a +solid backup and hardware plan in the seventh article in this series. +![A rack of servers, blue background][1] + +In the last two articles in this series on home automation with Home Assistant (HA), I walked through setting up a few [integrations][2] with a Zigbee Bridge and some [custom ESP8266][3] devices that I use for automation. The first four articles in the series discussed [what Home Assistant is][4], why you may want [local control][5], some of the [communication protocols][6] for smart home components, and how to [install Home Assistant][7] in a virtual machine (VM) using libvirt. + +Now that you have a basic home automation setup, it is a good time to take a baseline of your system. In this seventh article, I will talk about snapshots, backups, and backup strategies. Let's get right into it. + +### Backups vs. copies + +I'll start by clearing up some ambiguity: A copy of something is not the same as a backup. Here is a brief overview of the difference between a copy and a backup. Bear in mind that this comes from the lens of an IT professional. I work with client data day in and day out. I have seen many ways that backups can go sideways, so the following descriptions may be overkill for home use. You'll have to decide just how important your Home Assistant data really is. + + * **Copies:** A copy is just what it sounds. It is when you highlight something on your computer and hit **Ctrl**+**C** and paste it somewhere else with **Ctrl**+**V**. Many people may view this as backing up the source, and to some extent, that is true. However, a copy is merely a representation of a point in time. If it's taken incorrectly, the newly created file can be corrupt, leading to a false sense of security. In addition, the source may have a problem—meaning the copy will also have a problem. If you have just a single copy of a file, it's often the same as having nothing at all. When it comes to backup, the saying "one is none" is absolutely true. If you do not have files going back over time, you won't have a good idea of whether the system creating the backups has a problem. + * **Backups and snapshots:** In Home Assistant, it is a bit tricky to differentiate between a copy and a backup. First, Home Assistant uses the term "snapshot" to refer to what we traditionally think of backups. In this context, a backup is very similar to a copy because you don't use any type of backup software, at least not in the traditional sense. Normally, backup software is designed specifically to get all the files that are hidden or otherwise protected. For example, backup software for a computer (such as CloneZilla) makes an exact replica (in some cases) of the hard drive to ensure no files are missed. Home Assistant knows how to create snapshots and does it for you. You just need to worry about storing the files somewhere. + + + +### Set a good backup strategy + +Before I get into how to deal with snapshots in Home Assistant, I want to share a brief story from a recent client. Remember when I mentioned that simply having a single copy of your files doesn't give you any indication that a problem has occurred? My client was doing all of the right things when it came to backups. The team was using the proper methodology for backups, kept multiple files going back a certain period of time, ensured there were more than two copies of each backup, and was especially careful that backups were not being stored locally on the machine being backed up. Sounds great, doesn't it? They were doing everything right. Well, almost. The one thing they neglected was testing the backups. Most people put this off or disregard it entirely. I admit I am guilty of not testing my backups frequently. I do it when I remember, which is usually once every few months or so. + +In my client's case, a software upgrade created a new requirement from the backup program. This was missed. The backups continued to hum along, and the automated checks passed. There were files after every backup run, they were larger than a certain amount, and the [magic file checks][8] reported the correct file type. The problem was that the file sizes shrunk significantly due to the software change. This meant the client was not backing up the data it thought. + +This story has a happy ending, which brings me to my point: Because the client was doing everything else right, we could go through the backups and identify the precise moment when something changed. From this, we linked this to the date of an upgrade some weeks back. Fortunately, there was no emergency that precipitated the investigation. I happened to be doing a standard audit when I discovered the discrepancy. + +The moral of the story? Without proper backup strategies, we would have had a much harder time tracking down this problem. Also, in the event of a failure, we would have had no recovery point. + +A good backup strategy usually entails daily, weekly, and monthly backups. For example, you may decide to keep all your daily backups for two weeks, four weekly backups, and perhaps four monthly backups. This, in my opinion, is overkill for Home Assistant after you have a stable setup. You'll have to choose the level of precision you need. I take a backup before I make any change to the system. This gives me a known-good situation to revert to. + +### Create snapshots + +Great, so how do you create a snapshot in Home Assistant? The **Snapshots** menu resides inside the **Supervisor** tab on the left-size panel. + +![Home Assistant snapshots][9] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +You have two options for creating a snapshot: _Full snapshot_ or _Partial snapshot_. A Full snapshot is self-explanatory. You have some options with a Partial snapshot. + +![Home Assistant partial snapshots][11] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Any component you install in Home Assistant will populate in this menu. Choose a name for your backup and click **Create**. This will take some time, depending on the speed of the disk and the size of the backup. I recommend keeping at least four backups on your machine if you can afford the space. + +![Home Assistant snapshots][12] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +You can retrieve these files from Home Assistant with File Browser if you set up the **Samba share** extension. + +![Samba share][13] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Save these files somewhere safe. The name you give the backup is contained in the metadata inside Home Assistant, and the file names are randomly generated. After I copy them to a different location, I usually rename them because when I test the restoration process on a different machine, the new file name does not matter. + +### My homelab strategy + +I run my Home Assistant instance on top of KVM on a Linux host. I have had a few requests to go into a little more detail on this, so feel free to skip past this section as it's not directly related to HA. + +Due to the nature of my job, I have a fairly large variety of hardware, which I use for a [homelab][14]. Sometimes this is because physical hosts are easier to work with than VMs for certain clustering software. Other times, this is because I keep workloads isolated to specific hardware. Either way, this means I already have a certain amount of knowledge built up around managing and dealing with KVM. Not to mention the fact that I run _almost exclusively_ open source software (with a few exceptions). Here is a basic layout of my homelab: + +![KVM homelab architecture][15] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +The network-attached storage (NAS) has dual 10GB network cards that feed into uplink ports. Two of the KVM hosts have 10GB network interface cards (NICs), while the hosts on the right have regular 1GB network cards. + +For Home Assistant, this is well into overkill territory. However, this infrastructure was not designed for HA. HA runs just fine on a Raspberry Pi 4 (4GB version) at my parents' house. + +The VM that hosts Home Assistant has three vCPU cores of a Broadwell Core I5 CPU (circa 2015) with 8GB of RAM. The CPU tends to remain around 25% usage, and I rarely use more than 2.2GB of RAM. This is with 11 add-ons, including InfluxDB and Grafana, which are heavier applications. + +While I do have shared storage, I do not use it for live migration or anything similar. Instead, I use this for backend storage for specific mount points in a VM. For example, I store the `data` directory from Nextcloud on the NAS, divorcing the data from the service. + +At any rate, I have a few approaches to backups with this setup. Naturally, I use the Home Assistant snapshotting function to provide the first layer of protection. I tend to store only four weeks' worth of data on the VM. What do I do with the files themselves? Here is a diagram of how I try to keep my backups safe: + +![Home Assistant backup architecture][16] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Using the Samba add-on, I pull a copy of the snapshot onto my GNOME desktop. I configure Nextcloud using GNOME's **Online Accounts** settings. + +![GNOME Online Accounts settings][17] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Nextcloud takes a copy and puts it on my NAS. Both my desktop and the NAS use [SpiderOak One Backup][18] clients to ensure the backups are linked to more than one host. In the unlikely event that I delete a device from my SpiderOak account, the file is still linked to another device. I chose SpiderOak because it supports a Linux client, and it is privacy-focused and has no insight into what files it stores. The files are encrypted before being uploaded, and only the owner has the ability to decrypt them. The downside is that if you lose or forget your password, you lose your backups. + +Finally, I keep a cold copy on an external hard drive. I have a 14TB external drive that remains off and disconnected from the NAS except when backups are running. It's not on the diagram, but I also occasionally replicate to a computer at my in-laws' house. + +I can also take snapshots of the VM during critical operations (such as Home Assistant's recent upgrade from using a numbered point release to a month-based numbering system). + +I use a similar pipeline for most things that I back up, although I recognize it is a bit overkill. Also, this whole process has the flaw that it relies on me. Aside from SpiderOak and Nextcloud, I have not automated this process. I have scripts that I run, but I do not run them in a cron or anything like that. In hindsight, perhaps I should work on that. + +This setup may be considered extreme, but the built-in versioning in Nextcloud and SpiderOak, along with making copies in multiple locations, means that I am unlikely to suffer a failure that I can't recover from. At the very least, I should be able to dig up a close reference. + +As a final precaution, I make sure to keep the important information about _how_ I set things up on my private wiki on [Wiki.js][19]. I keep a section just for home automation. + +![Home automation overview][20] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +When you get into creating Node-RED automations (in the next article), I suggest you keep your own notes. I take a screenshot of the flow, write a brief description, so I know what I was attempting to achieve, and dump the flow to JSON (for brevity, I omitted the JSON from this screenshot): + +![Node-RED routine][21] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +### Wrapping up + +Backups are essential when you're using Home Assistant, as it is a critical component of your infrastructure that always needs to be functioning. Small downtime is acceptable, but the ability to recover from a failure quickly is crucial. Granted, I have found Home Assistant to be rock solid. It has never failed on its own; any problems I have had were external to HA. Still, if you are going to make HA a central part of your house, I strongly recommend putting a good backup strategy in place. + +In the next article, I'll take a look at setting up some simple automations with Node-RED. As always, leave a comment below if you have questions, ideas, or suggestions for topics you'd like to see covered. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/home-assistant-backups + +作者:[Steve Ovens][a] +选题:[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/stratusss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rack_server_sysadmin_cloud_520.png?itok=fGmwhf8I (A rack of servers, blue background) +[2]: https://opensource.com/article/21/1/home-automation-5-homeassistant-addons +[3]: https://opensource.com/article/21/1/home-assistant-6-custom-sensors +[4]: https://opensource.com/article/20/11/home-assistant +[5]: https://opensource.com/article/20/11/cloud-vs-local-home-automation +[6]: https://opensource.com/article/20/11/home-automation-part-3 +[7]: https://opensource.com/article/20/12/home-assistant +[8]: https://linux.die.net/man/5/magic +[9]: https://opensource.com/sites/default/files/uploads/ha-setup33-snapshot1_0.png (Home Assistant snapshots) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ +[11]: https://opensource.com/sites/default/files/uploads/ha-setup34-snapshot2.png (Home Assistant partial snapshots) +[12]: https://opensource.com/sites/default/files/uploads/ha-setup35-snapshot3.png (Home Assistant snapshots) +[13]: https://opensource.com/sites/default/files/uploads/ha-setup36-backup-samba.png (Samba share) +[14]: https://opensource.com/article/19/3/home-lab +[15]: https://opensource.com/sites/default/files/uploads/kvm_lab.png (KVM homelab architecture) +[16]: https://opensource.com/sites/default/files/uploads/home_assistant_backups.png (Home Assistant backup architecture) +[17]: https://opensource.com/sites/default/files/uploads/gnome-online-account.png (GNOME Online Accounts settings) +[18]: https://spideroak.com/ +[19]: https://wiki.js.org/ +[20]: https://opensource.com/sites/default/files/uploads/confluence_home_automation_overview.png (Home automation overview) +[21]: https://opensource.com/sites/default/files/uploads/node_red_bedtime.png (Node-RED routine) From a52bf3a3ed120d6217bc571b1b4f4531bd31a15c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 16 Feb 2021 05:04:59 +0800 Subject: [PATCH 331/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210215=20?= =?UTF-8?q?A=20practical=20guide=20to=20JavaScript=20closures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210215 A practical guide to JavaScript closures.md --- ... practical guide to JavaScript closures.md | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 sources/tech/20210215 A practical guide to JavaScript closures.md diff --git a/sources/tech/20210215 A practical guide to JavaScript closures.md b/sources/tech/20210215 A practical guide to JavaScript closures.md new file mode 100644 index 0000000000..46f5d19c0f --- /dev/null +++ b/sources/tech/20210215 A practical guide to JavaScript closures.md @@ -0,0 +1,144 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A practical guide to JavaScript closures) +[#]: via: (https://opensource.com/article/21/2/javascript-closures) +[#]: author: (Nimisha Mukherjee https://opensource.com/users/nimisha) + +A practical guide to JavaScript closures +====== +Get a better understanding of how JavaScript code works and executes by +diving into one of the advanced concept: closures. +![Woman programming][1] + +In [_4 reasons why JavaScript is so popular_][2], I touched on a few advanced JavaScript concepts. In this article, I will dive into one of them: closures. + +According to [Mozilla Developer Network][3] (MDN), "A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment)." Simplified, this means that a function inside another function can access the variables from the outer (parent) function. + +To better understand closures, take a look at scopes and their execution context. + +Here is a simple code snippet: + + +``` +var hello = "Hello"; + +function sayHelloWorld() { +var world = "World"; +        function wish() { +                var year = "2021"; +                console.log(hello + " " + world + " "+ year); +} +wish(); +} +sayHelloWorld(); +``` + +Here's the execution context for this code:  + +![Execution context for JS code][4] + +(Nimisha Mukherjee, [CC BY-SA 4.0][5]) + +Closures are created every time a function is created (at function-creation time). Every closure has three scopes: + + * Local scope (own scope) + * Outer functions scope + * Global scope + + + +I'll modify the above code slightly to demonstrate closure: + + +``` +var hello = "Hello"; + +var sayHelloWorld = function() { +var world = "World"; +        function wish() { +                var year = "2021"; +                console.log(hello + " " + world + " "+ year); +} +return wish; +} +var callFunc = sayHelloWorld(); +callFunc(); +``` + +The inner function `wish()` is returned from the outer function before it's executed. This happens because functions in JavaScript form **closures**. + + * `callFunc` holds a reference to the function `wish` when `sayHelloWorld` runs + * `wish` maintains a reference to its surrounding (lexical) environment where the variable `world` exists. + + + +### Private variables and methods + +Natively, JavaScript does not support the creation of private variables and methods. A common and practical use of closure is to emulate private variables and methods and allow data privacy. Methods defined within the closure scope are privileged. + +This code snippet captures how closures are commonly written and used in JavaScript: + + +``` +var resourceRecord = function(myName, myAddress) { + var resourceName = myName; + var resourceAddress = myAddress; + var accessRight = "HR"; + return { +   changeName: function(updateName, privilege) { +     //only HR can change the name +     if(privilege === accessRight ) { +       resourceName = updateName; +       return true; +     } else { +       return false; +     } +   },   +   changeAddress: function(newAddress) { +     //any associate can change the address +     resourceAddress = newAddress;           +   },   +   showResourceDetail: function() { +     console.log ("Name:" + resourceName + " ; Address:" + resourceAddress); +   } + } +} +//Create first record +var resourceRecord1 = resourceRecord("Perry","Office"); +//Create second record +var resourceRecord2 = resourceRecord("Emma","Office"); +//Change the address on the first record +resourceRecord1.changeAddress("Home"); +resourceRecord1.changeName("Perry Berry", "Associate"); //Output is false as only an HR can change the name +resourceRecord2.changeName("Emma Freeman", "HR"); //Output is true as HR changes the name +resourceRecord1.showResourceDetail(); //Output - Name:Perry ; Address:Home +resourceRecord2.showResourceDetail(); //Output - Name:Emma Freeman ; Address:Office +``` + +The resource records (`resourceRecord1` and `resourceRecord2`) are independent of one another. Each closure references a different version of the `resourceName` and `resourceAddress` variable through its own closure. You can also apply specific rules to how private variables need to be handled—I added a check on who can modify `resourceName`. + +### Use closures + +Understanding closure is important, as it enables deeper knowledge of how variables and functions relate to one another and how JavaScript code works and executes. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/javascript-closures + +作者:[Nimisha Mukherjee][a] +选题:[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/nimisha +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) +[2]: https://opensource.com/article/20/11/javascript-popular +[3]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures +[4]: https://opensource.com/sites/default/files/uploads/execution-context.png (Execution context for JS code) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ From 87ae8e6374cc4500798b9c7ff1aded68dfe88ccb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 16 Feb 2021 09:36:51 +0800 Subject: [PATCH 332/381] Rename sources/tech/20210215 Why everyone should try using Linux.md to sources/talk/20210215 Why everyone should try using Linux.md --- .../20210215 Why everyone should try using Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210215 Why everyone should try using Linux.md (100%) diff --git a/sources/tech/20210215 Why everyone should try using Linux.md b/sources/talk/20210215 Why everyone should try using Linux.md similarity index 100% rename from sources/tech/20210215 Why everyone should try using Linux.md rename to sources/talk/20210215 Why everyone should try using Linux.md From cc401b8934982a77bb43b5a24c44052e41ae9ff1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 16 Feb 2021 10:14:05 +0800 Subject: [PATCH 333/381] PRF @geekpi --- ... Helper and Pacman Wrapper Based on Yay.md | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md b/translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md index 5ad643b667..216ef1fd0b 100644 --- a/translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md +++ b/translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md @@ -1,28 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Paru – A New AUR Helper and Pacman Wrapper Based on Yay) [#]: via: (https://itsfoss.com/paru-aur-helper/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) -Paru – 基于 Yay 的新 AUR 助手及 Pacman 包装器 +Paru:基于 Yay 的新 AUR 助手 ====== +![](https://img.linux.net.cn/data/attachment/album/202102/16/101301ldekk9kkpqlplke6.jpg) + [用户选择 Arch Linux][1] 或 [基于 Arch 的 Linux 发行版][2]的主要原因之一就是 [Arch 用户仓库(AUR)][3]。 遗憾的是,[pacman][4],也就是 Arch 的包管理器,不能以类似官方仓库的方式访问 AUR。AUR 中的包是以 [PKGBUILD][5] 的形式存在的,需要手动过程来构建。 AUR 助手可以自动完成这个过程。毫无疑问,[yay][6] 是最受欢迎和备受青睐的 AUR 助手之一。 -最近,yay 的两位开发者之一的 [Morganamilo][7] [宣布][8]将退出 yay 的维护工作,以开始自己的 AUR 助手 [paru][9]。Paru 是用 [Rust][10] 编写的,而 yay 是用 [Go][11] 编写的,它的设计是基于 yay 的。 +最近,`yay` 的两位开发者之一的 [Morganamilo][7][宣布][8]将退出 `yay` 的维护工作,以开始自己的 AUR 助手 [paru][9]。`paru` 是用 [Rust][10] 编写的,而 `yay` 是用 [Go][11] 编写的,它的设计是基于 yay 的。 -请注意,yay 还没有结束支持,它仍然由 [Jguer][12] 积极维护。他还[评论][13]说,paru 可能适合那些寻找丰富功能的 AUR 助手的用户。因此我推荐大家尝试一下。 +请注意,`yay` 还没有结束支持,它仍然由 [Jguer][12] 积极维护。他还[评论][13]说,`paru` 可能适合那些寻找丰富功能的 AUR 助手的用户。因此我推荐大家尝试一下。 ### 安装 Paru AUR 助手 -要安装 paru,打开你的终端,逐一输入以下命令。 +要安装 `paru`,打开你的终端,逐一输入以下命令: ``` sudo pacman -S --needed base-devel @@ -35,43 +37,41 @@ makepkg -si ### 使用 Paru AUR 助手的基本命令 -在我看来,这些都是 paru 最基本的命令。你可以在 [GitHub][9] 的官方仓库中探索更多。 - - * **paru <用户输入>**:搜索并安装<用户输入> - * **paru -**:paru -Syu 的别名 - * **paru -Sua** :仅升级 AUR 包。 - * **paru -Qua**:打印可用的 AUR 更新 - * **paru -Gc <用户输入>**:打印<用户输入>的 AUR 评论 - +在我看来,这些都是 `paru` 最基本的命令。你可以在 [GitHub][9] 的官方仓库中探索更多。 + * `paru <用户输入>`:搜索并安装“用户输入” + * `paru -`:`paru -Syu` 的别名 + * `paru -Sua`:仅升级 AUR 包。 + * `paru -Qua`:打印可用的 AUR 更新 + * `paru -Gc <用户输入>`:显示“用户输入”的 AUR 评论 ### 充分使用 Paru AUR 助手 -你可以在 GitHub 上访问 paru 的[更新日志][14]来查看完整的变更日志历史,或者你可以在[首次发布][15]中查看来自 yay 的更改。 +你可以在 GitHub 上访问 `paru` 的[更新日志][14]来查看完整的变更日志历史,或者你可以在[首次发布][15]中查看对 `yay` 的变化。 #### 在 Paru 中启用颜色 -要在 paru 中启用颜色,你必须先在 pacman 中启用它。所有的[配置文件][16]都在 /etc 目录下。在此例中,我[使用 Nano 文本编辑器][17],但是,你可以选择使用任何[基于终端的文本编辑器][18]。 +要在 `paru` 中启用颜色,你必须先在 `pacman` 中启用它。所有的[配置文件][16]都在 `/etc` 目录下。在此例中,我[使用 Nano 文本编辑器][17],但是,你可以选择使用任何[基于终端的文本编辑器][18]。 ``` sudo nano /etc/pacman.conf ``` -打开 pacman 配置文件后,取消 “Color” 的注释,即可启用此功能。 +打开 `pacman` 配置文件后,取消 `Color` 的注释,即可启用此功能。 ![][19] -#### **反转搜索顺序** +#### 反转搜索顺序 -根据你的搜索条件,最相关的包通常会显示在搜索结果的顶部。在 paru 中,你可以反转搜索顺序,使你的搜索更容易。 +根据你的搜索条件,最相关的包通常会显示在搜索结果的顶部。在 `paru` 中,你可以反转搜索顺序,使你的搜索更容易。 -与前面的例子类似,打开 paru 配置文件: +与前面的例子类似,打开 `paru` 配置文件: ``` sudo nano /etc/paru.conf ``` -取消注释 “BottomUp” 项,然后保存文件。 +取消注释 `BottomUp` 项,然后保存文件。 ![][20] @@ -79,9 +79,9 @@ sudo nano /etc/paru.conf ![][21] -#### **编辑 PKGBUILD** (对于高级用户) +#### 编辑 PKGBUILD (对于高级用户) -如果你是一个有经验的 Linux 用户,你可以通过 paru 编辑 AUR 包。要做到这一点,你需要在 paru 配置文件中启用该功能,并设置你所选择的文件管理器。 +如果你是一个有经验的 Linux 用户,你可以通过 `paru` 编辑 AUR 包。要做到这一点,你需要在 `paru` 配置文件中启用该功能,并设置你所选择的文件管理器。 在此例中,我将使用配置文件中的默认值,即 vifm 文件管理器。如果你还没有使用过它,你可能需要安装它。 @@ -94,7 +94,7 @@ sudo nano /etc/paru.conf ![][22] -让我们回到 [Google Calendar][23] 的 AUR 包,并尝试安装它。系统会提示你审查该软件包。输入 Y 并按下回车。 +让我们回到 [Google Calendar][23] 的 AUR 包,并尝试安装它。系统会提示你审查该软件包。输入 `Y` 并按下回车。 ![][24] @@ -108,9 +108,7 @@ sudo nano /etc/paru.conf ### 总结 -Paru 是 [AUR 助手家族][27]的又一个有趣的新成员,前途光明。此时,我不建议更换 yay,因为它还在维护,但一定要试试 paru。你可以把它们两个都安装到你的系统中,然后得出自己的结论。 - -要获得最新的 [Linux 新闻][28],请订阅我们的社交媒体,以便在第一时间获取新闻! +`paru` 是 [AUR 助手家族][27]的又一个有趣的新成员,前途光明。此时,我不建议更换 `yay`,因为它还在维护,但一定要试试 `paru`。你可以把它们两个都安装到你的系统中,然后得出自己的结论。 -------------------------------------------------------------------------------- @@ -119,7 +117,7 @@ via: https://itsfoss.com/paru-aur-helper/ 作者:[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 980a67cd79f8f8704bda2fd8c1d1c208ccf14224 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 16 Feb 2021 10:14:34 +0800 Subject: [PATCH 334/381] PUB @geekpi https://linux.cn/article-13122-1.html --- ...Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md (98%) diff --git a/translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md b/published/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md similarity index 98% rename from translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md rename to published/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md index 216ef1fd0b..c30c45aaab 100644 --- a/translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md +++ b/published/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13122-1.html) [#]: subject: (Paru – A New AUR Helper and Pacman Wrapper Based on Yay) [#]: via: (https://itsfoss.com/paru-aur-helper/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) From 4764b42293c68e64c4a99c057ac7529077c5d538 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 16 Feb 2021 11:00:34 +0800 Subject: [PATCH 335/381] PUB @geekpi https://linux.cn/article-13123-1.html --- ...aces are the shamash candle of the Zen of Python.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {translated/tech => published}/20191230 Namespaces are the shamash candle of the Zen of Python.md (84%) diff --git a/translated/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md b/published/20191230 Namespaces are the shamash candle of the Zen of Python.md similarity index 84% rename from translated/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md rename to published/20191230 Namespaces are the shamash candle of the Zen of Python.md index 6aa0d3ee85..dc98e7afc0 100644 --- a/translated/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md +++ b/published/20191230 Namespaces are the shamash candle of the Zen of Python.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13123-1.html) [#]: subject: (Namespaces are the shamash candle of the Zen of Python) [#]: via: (https://opensource.com/article/19/12/zen-python-namespaces) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) @@ -12,11 +12,11 @@ > 这是 Python 之禅特别系列的一部分,重点是一个额外的原则:命名空间。 -![在建筑物上的笔记本电脑上编程的人][1] +![](https://img.linux.net.cn/data/attachment/album/202102/16/105800d64ceaeertt4u4ee.jpg) -著名的光明节Hanukkah有八个晚上的庆祝活动。然而,光明节的灯台有九根蜡烛:八根普通蜡烛和总是偏移的第九根蜡烛。它被称为 “shamash” 或 “shamos”,大致可以翻译为“仆人”或“看门人”的意思。 +著名的光明节Hanukkah有八个晚上的庆祝活动。然而,光明节的灯台有九根蜡烛:八根普通的蜡烛和总是偏移的第九根蜡烛。它被称为 “shamash” 或 “shamos”,大致可以翻译为“仆人”或“看门人”的意思。 -shamos 是点燃所有其它蜡烛的蜡烛:它是唯一一支可以用火的蜡烛,而不仅仅是观看。当我们结束关于 Python 之禅系列时,我看到命名空间提供了类似的作用。 +shamos 是点燃所有其它蜡烛的蜡烛:它是唯一一支可以用火的蜡烛,而不仅仅是观看。当我们结束 Python 之禅系列时,我看到命名空间提供了类似的作用。 ### Python 中的命名空间 From bb89e0c62a0a7c8fa0486ca471ff4d6781f0a1c2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 16 Feb 2021 11:02:49 +0800 Subject: [PATCH 336/381] Revert "PUB" This reverts commit 4764b42293c68e64c4a99c057ac7529077c5d538. --- ...aces are the shamash candle of the Zen of Python.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {published => translated/tech}/20191230 Namespaces are the shamash candle of the Zen of Python.md (84%) diff --git a/published/20191230 Namespaces are the shamash candle of the Zen of Python.md b/translated/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md similarity index 84% rename from published/20191230 Namespaces are the shamash candle of the Zen of Python.md rename to translated/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md index dc98e7afc0..6aa0d3ee85 100644 --- a/published/20191230 Namespaces are the shamash candle of the Zen of Python.md +++ b/translated/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: (wxy) -[#]: url: (https://linux.cn/article-13123-1.html) +[#]: publisher: ( ) +[#]: url: ( ) [#]: subject: (Namespaces are the shamash candle of the Zen of Python) [#]: via: (https://opensource.com/article/19/12/zen-python-namespaces) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) @@ -12,11 +12,11 @@ > 这是 Python 之禅特别系列的一部分,重点是一个额外的原则:命名空间。 -![](https://img.linux.net.cn/data/attachment/album/202102/16/105800d64ceaeertt4u4ee.jpg) +![在建筑物上的笔记本电脑上编程的人][1] -著名的光明节Hanukkah有八个晚上的庆祝活动。然而,光明节的灯台有九根蜡烛:八根普通的蜡烛和总是偏移的第九根蜡烛。它被称为 “shamash” 或 “shamos”,大致可以翻译为“仆人”或“看门人”的意思。 +著名的光明节Hanukkah有八个晚上的庆祝活动。然而,光明节的灯台有九根蜡烛:八根普通蜡烛和总是偏移的第九根蜡烛。它被称为 “shamash” 或 “shamos”,大致可以翻译为“仆人”或“看门人”的意思。 -shamos 是点燃所有其它蜡烛的蜡烛:它是唯一一支可以用火的蜡烛,而不仅仅是观看。当我们结束 Python 之禅系列时,我看到命名空间提供了类似的作用。 +shamos 是点燃所有其它蜡烛的蜡烛:它是唯一一支可以用火的蜡烛,而不仅仅是观看。当我们结束关于 Python 之禅系列时,我看到命名空间提供了类似的作用。 ### Python 中的命名空间 From 1a127512ff0c1fc32aa135358902243c6e146f0e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 16 Feb 2021 11:04:54 +0800 Subject: [PATCH 337/381] PUB @wxy https://linux.cn/article-13123-1.html --- ...aces are the shamash candle of the Zen of Python.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {translated/tech => published}/20191230 Namespaces are the shamash candle of the Zen of Python.md (84%) diff --git a/translated/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md b/published/20191230 Namespaces are the shamash candle of the Zen of Python.md similarity index 84% rename from translated/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md rename to published/20191230 Namespaces are the shamash candle of the Zen of Python.md index 6aa0d3ee85..dc98e7afc0 100644 --- a/translated/tech/20191230 Namespaces are the shamash candle of the Zen of Python.md +++ b/published/20191230 Namespaces are the shamash candle of the Zen of Python.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13123-1.html) [#]: subject: (Namespaces are the shamash candle of the Zen of Python) [#]: via: (https://opensource.com/article/19/12/zen-python-namespaces) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) @@ -12,11 +12,11 @@ > 这是 Python 之禅特别系列的一部分,重点是一个额外的原则:命名空间。 -![在建筑物上的笔记本电脑上编程的人][1] +![](https://img.linux.net.cn/data/attachment/album/202102/16/105800d64ceaeertt4u4ee.jpg) -著名的光明节Hanukkah有八个晚上的庆祝活动。然而,光明节的灯台有九根蜡烛:八根普通蜡烛和总是偏移的第九根蜡烛。它被称为 “shamash” 或 “shamos”,大致可以翻译为“仆人”或“看门人”的意思。 +著名的光明节Hanukkah有八个晚上的庆祝活动。然而,光明节的灯台有九根蜡烛:八根普通的蜡烛和总是偏移的第九根蜡烛。它被称为 “shamash” 或 “shamos”,大致可以翻译为“仆人”或“看门人”的意思。 -shamos 是点燃所有其它蜡烛的蜡烛:它是唯一一支可以用火的蜡烛,而不仅仅是观看。当我们结束关于 Python 之禅系列时,我看到命名空间提供了类似的作用。 +shamos 是点燃所有其它蜡烛的蜡烛:它是唯一一支可以用火的蜡烛,而不仅仅是观看。当我们结束 Python 之禅系列时,我看到命名空间提供了类似的作用。 ### Python 中的命名空间 From 64d00748e7bc2720b7eab2388825722b9bb2e1e2 Mon Sep 17 00:00:00 2001 From: XYenChi <466530436@qq.com> Date: Tue, 16 Feb 2021 18:07:57 +0800 Subject: [PATCH 338/381] Rename sources/talk/20190312 When the web grew up- A browser story.md to translated/talk/20190312 When the web grew up- A browser story.md --- .../talk/20190312 When the web grew up- A browser story.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20190312 When the web grew up- A browser story.md (100%) diff --git a/sources/talk/20190312 When the web grew up- A browser story.md b/translated/talk/20190312 When the web grew up- A browser story.md similarity index 100% rename from sources/talk/20190312 When the web grew up- A browser story.md rename to translated/talk/20190312 When the web grew up- A browser story.md From baa21b2ca8cbcae297e8d4235e92c117b215bea3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 16 Feb 2021 22:21:44 +0800 Subject: [PATCH 339/381] PRF @geekpi --- ...9 Manage containers with Podman Compose.md | 50 ++++++++----------- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/translated/tech/20210129 Manage containers with Podman Compose.md b/translated/tech/20210129 Manage containers with Podman Compose.md index f020ea1a23..86884809f8 100644 --- a/translated/tech/20210129 Manage containers with Podman Compose.md +++ b/translated/tech/20210129 Manage containers with Podman Compose.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Manage containers with Podman Compose) @@ -16,26 +16,25 @@ Docker 的一个缺点是它有一个中央守护进程,它以 root 用户的身份运行,这对安全有影响。但这正是 Podman 的用武之地。Podman 是一个 [无守护进程容器引擎][2],用于开发、管理和在你的 Linux 系统上以 root 或无 root 模式运行 OCI 容器。 -在 Fedora Magazine 上还有其他文章,你可以用来了解更多关于 Podman 的信息。下面有两个例子: +下面这些文章可以用来了解更多关于 Podman 的信息: + * [使用 Podman 以非 root 用户身份运行 Linux 容器][11] * [在 Fedora 上使用 Podman 的 Pod][3] - * [在 Fedora 上具有 Capabilities 的Podman][4] - - + * [在 Fedora 中结合权能使用 Podman][4] 如果你使用过 Docker,你很可能也知道 Docker Compose,它是一个用于编排多个可能相互依赖的容器的工具。要了解更多关于 Docker Compose 的信息,请看它的[文档][5]。 ### 什么是 Podman Compose? -[Podman Compose][6]是一个目标作为 Docker Compose 的替代品,不需要对 docker-compose.yaml 文件进行任何修改的项目。由于 Podman Compose 使用 pod 工作,所以最好看下 pod 的最新定义。 +[Podman Compose][6] 项目的目标是作为 Docker Compose 的替代品,而不需要对 docker-compose.yaml 文件进行任何修改。由于 Podman Compose 使用吊舱pod 工作,所以最好看下“吊舱”的最新定义。 - -> 一个_Pod_(如一群鲸鱼或豌豆荚)是由一个或多个[容器][7]组成的组,具有共享的存储/网络资源,以及如何运行容器的规范。 +> 一个“吊舱pod ”(如一群鲸鱼或豌豆荚)是由一个或多个[容器][7]组成的组,具有共享的存储/网络资源,以及如何运行容器的规范。 > > [Pods - Kubernetes 文档][8] -Podman Compose 的基本思想是,它选中 _docker-compose.yaml_ 文件里面定义的服务,为每个服务创建一个容器。Docker Compose 和 Podman Compose 的一个主要区别是,Podman Compose 将整个项目的容器添加到一个单一的 pod 中,而且所有的容器共享同一个网络。它甚至用和 Docker Compose 一样的方式命名容器,在创建容器时使用 _--add-host_ 标志,你会在例子中看到。 +(LCTT 译注:容器技术领域大量使用了航海比喻,pod 一词,意为“豆荚”,在航海领域指“吊舱” —— 均指盛装多个物品的容器。常不翻译,考虑前后文,可译做“吊舱”。) +Podman Compose 的基本思想是,它选中 `docker-compose.yaml` 文件里面定义的服务,为每个服务创建一个容器。Docker Compose 和 Podman Compose 的一个主要区别是,Podman Compose 将整个项目的容器添加到一个单一的吊舱中,而且所有的容器共享同一个网络。如你在例子中看到的,在创建容器时使用 `--add-host` 标志,它甚至用和 Docker Compose 一样的方式命名容器。 ### 安装 @@ -53,7 +52,7 @@ sudo dnf install podman ### 例子:用 Podman Compose 启动一个 WordPress 网站 -想象一下,你的 _docker-compose.yaml_ 文件在一个叫 _wpsite_ 的文件夹里。一个典型的 WordPress 网站的 _docker-compose.yaml_ (或 _docker-compose.yml_) 文件是这样的: +想象一下,你的 `docker-compose.yaml` 文件在一个叫 `wpsite` 的文件夹里。一个典型的 WordPress 网站的 `docker-compose.yaml` (或 `docker-compose.yml`) 文件是这样的: ``` version: "3.8" @@ -100,58 +99,48 @@ networks: wpnet: {} ``` -如果你用过 Docker,你就会知道你可运行 _docker-compose up_ 来启动这些服务。Docker Compose 会创建两个名为 _wpsite_web_1_ 和 _wpsite_db_1_ 的容器,并将它们连接到一个名为 _wpsite_wpnet_ 的网络。 +如果你用过 Docker,你就会知道你可运行 `docker-compose up` 来启动这些服务。Docker Compose 会创建两个名为 `wpsite_web_1` 和 `wpsite_db_1` 的容器,并将它们连接到一个名为 `wpsite_wpnet` 的网络。 +现在,看看当你在项目目录下运行 `podman-compose up` 时会发生什么。首先,一个以执行命令的目录命名的吊舱被创建。接下来,它寻找 YAML 文件中定义的任何名称的卷,如果它们不存在,就创建卷。然后,在 YAML 文件的 `services` 部分列出的每个服务都会创建一个容器,并添加到吊舱中。 -现在,看看当你在项目目录下运行 _podman-compose up_ 时会发生什么。首先,一个以执行命令的目录命名的 pod 被创建。接下来,它寻找 YAML 文件中定义的任何名称的卷,如果它们不存在,就创建卷。然后,在 YAML 文件的 _services_ 部分列出的每个服务都会创建一个容器,并添加到 pod 中。 - -容器的命名与 Docker Compose 类似。例如,为你的 web 服务创建一个名为 _wpsite_web_1_ 的容器。Podman Compose 还为每个命名的容器添加了 localhost 别名。之后,容器仍然可以通过名字互相解析,尽管它们并不像 Docker 那样在一个桥接网络上。要做到这一点,使用选项 _-add-host_。例如,_-add-host web:localhost_。 - -请注意,_docker-compose.yaml_ 包含了一个从主机 8080 端口到容器 80 端口的 Web 服务的端口转发。现在你应该可以通过浏览器访问新 WordPress 实例,地址为 __。 +容器的命名与 Docker Compose 类似。例如,为你的 web 服务创建一个名为 `wpsite_web_1` 的容器。Podman Compose 还为每个命名的容器添加了 `localhost` 别名。之后,容器仍然可以通过名字互相解析,尽管它们并不像 Docker 那样在一个桥接网络上。要做到这一点,使用选项 `-add-host`。例如,`-add-host web:localhost`。 +请注意,`docker-compose.yaml` 包含了一个从主机 8080 端口到容器 80 端口的 Web 服务的端口转发。现在你应该可以通过浏览器访问新 WordPress 实例,地址为 `http://localhost:8080`。 ![WordPress Dashboard][10] ### 控制 pod 和容器 -要查看正在运行的容器,使用 _podman ps_,它可以显示 web 和数据库容器以及 pod 中的 infra 容器。 -``` +要查看正在运行的容器,使用 `podman ps`,它可以显示 web 和数据库容器以及吊舱中的基础设施容器。 ``` - CONTAINER ID  IMAGE                               COMMAND               CREATED      STATUS          PORTS                                         NAMES a364a8d7cec7  docker.io/library/wordpress:latest  apache2-foregroun...  2 hours ago  Up 2 hours ago  0.0.0.0:8080-&gt;80/tcp, 0.0.0.0:6603-&gt;3306/tcp  wpsite_web_1 c447024aa104  docker.io/library/mariadb:10.5      mysqld                2 hours ago  Up 2 hours ago  0.0.0.0:8080-&gt;80/tcp, 0.0.0.0:6603-&gt;3306/tcp  wpsite_db_1 12b1e3418e3e  k8s.gcr.io/pause:3.2 ``` -``` - -你也可以验证 Podman 已经为这个项目创建了一个 pod,以你执行命令的文件夹命名。 -``` +你也可以验证 Podman 已经为这个项目创建了一个吊舱,以你执行命令的文件夹命名。 ``` - POD ID        NAME             STATUS    CREATED      INFRA ID      # OF CONTAINERS 8a08a3a7773e  wpsite           Degraded  2 hours ago  12b1e3418e3e  3 ``` -``` - 要停止容器,在另一个命令窗口中输入以下命令: ``` podman-compose down ``` -你也可以通过停止和删除 pod 来实现。这实质上是停止并移除所有的容器,然后再删除包含的 pod。所以,同样的事情也可以通过这些命令来实现: +你也可以通过停止和删除吊舱来实现。这实质上是停止并移除所有的容器,然后再删除包含的吊舱。所以,同样的事情也可以通过这些命令来实现: ``` podman pod stop podname podman pod rm podname ``` -请注意,这不会删除你在 _docker-compose.yaml_ 中定义的卷。所以,你的 WordPress 网站的状态被保存下来了,你可以通过运行这个命令来恢复它。 +请注意,这不会删除你在 `docker-compose.yaml` 中定义的卷。所以,你的 WordPress 网站的状态被保存下来了,你可以通过运行这个命令来恢复它。 ``` podman-compose up @@ -166,7 +155,7 @@ via: https://fedoramagazine.org/manage-containers-with-podman-compose/ 作者:[Mehdi Haghgoo][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/) 荣誉推出 @@ -175,10 +164,11 @@ via: https://fedoramagazine.org/manage-containers-with-podman-compose/ [1]: https://fedoramagazine.org/wp-content/uploads/2021/01/podman-compose-1-816x345.jpg [2]: https://podman.io [3]: https://fedoramagazine.org/podman-pods-fedora-containers/ -[4]: https://fedoramagazine.org/podman-with-capabilities-on-fedora/ +[4]: https://linux.cn/article-12859-1.html [5]: https://docs.docker.com/compose/ [6]: https://github.com/containers/podman-compose [7]: https://kubernetes.io/docs/concepts/containers/ [8]: https://kubernetes.io/docs/concepts/workloads/pods/ [9]: https://podman.io/getting-started/installation [10]: https://fedoramagazine.org/wp-content/uploads/2021/01/Screenshot-from-2021-01-08-06-27-29-1024x767.png +[11]: https://linux.cn/article-10156-1.html \ No newline at end of file From 24b9bd808a3c111a10d68dbc170c564155197312 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 16 Feb 2021 22:22:41 +0800 Subject: [PATCH 340/381] PUB @geekpi https://linux.cn/article-13125-1.html --- .../20210129 Manage containers with Podman Compose.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210129 Manage containers with Podman Compose.md (99%) diff --git a/translated/tech/20210129 Manage containers with Podman Compose.md b/published/20210129 Manage containers with Podman Compose.md similarity index 99% rename from translated/tech/20210129 Manage containers with Podman Compose.md rename to published/20210129 Manage containers with Podman Compose.md index 86884809f8..d1d3ce6286 100644 --- a/translated/tech/20210129 Manage containers with Podman Compose.md +++ b/published/20210129 Manage containers with Podman Compose.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13125-1.html) [#]: subject: (Manage containers with Podman Compose) [#]: via: (https://fedoramagazine.org/manage-containers-with-podman-compose/) [#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/) From 7789511a76561696938f3fcacaf79a15fff7018d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 16 Feb 2021 22:35:51 +0800 Subject: [PATCH 341/381] APL --- ...3 open source tools that make Linux the ideal workstation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md b/sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md index 2fb770fa83..e30c8e0465 100644 --- a/sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md +++ b/sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c43259ec71f4a8f7a40c0dcbeec82f6f66bcdf2c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 16 Feb 2021 23:39:01 +0800 Subject: [PATCH 342/381] TSL --- ...s that make Linux the ideal workstation.md | 76 ------------------ ...s that make Linux the ideal workstation.md | 77 +++++++++++++++++++ 2 files changed, 77 insertions(+), 76 deletions(-) delete mode 100644 sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md create mode 100644 translated/tech/20210208 3 open source tools that make Linux the ideal workstation.md diff --git a/sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md b/sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md deleted file mode 100644 index e30c8e0465..0000000000 --- a/sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md +++ /dev/null @@ -1,76 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 open source tools that make Linux the ideal workstation) -[#]: via: (https://opensource.com/article/21/2/linux-workday) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -3 open source tools that make Linux the ideal workstation -====== -Linux has everything you think you need and more for you to have a -productive workday. -![Person using a laptop][1] - -In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Today, I'll share with you why Linux is a great choice for your workday. - -Everyone wants to be productive during the workday. If your workday generally involves working on documents, presentations, and spreadsheets, then you might be accustomed to a specific routine. The problem is that _usual routine_ is usually dictated by one or two specific applications, whether it's a certain office suite or a desktop OS. Of course, just because something's a habit doesn't mean it's ideal, and yet it tends to persist unquestioned, even to the point of influencing the very structure of how a business is run. - -### Working smarter - -Many office applications these days run in the cloud, so you can work with the same constraints on Linux if you really want to. However, because many of the typical big-name office applications aren't cultural expectations on Linux, you might find yourself inspired to explore other options. As anyone eager to get out of their "comfort zone" knows, this kind of subtle disruption can be surprisingly useful. All too often, you don't know what you're doing inefficiently because you haven't actually tried doing things differently. Force yourself to explore other options, and you never know what you'll find. You don't even have to know exactly what you're looking for. - -### LibreOffice - -One of the most obvious open source office stalwarts on Linux (or any other platform) is [LibreOffice][2]. It features several components, including a word processor, presentation software, a spreadsheet, relational database interface, vector drawing, and more. It can import many document formats from other popular office applications, so transitioning to LibreOffice from another tool is usually easy. - -There's more to LibreOffice than just being a great office suite, however. LibreOffice has macro support, so resourceful users can automate repetitive tasks. It also features terminal commands so you can perform many tasks without ever launching the LibreOffice interface. - -Imagine, for instance, opening 21 documents, navigating to the **File** menu, to the **Export** or **Print** menu item, and exporting the file to PDF or EPUB. That's over 84 clicks, at the very least, and probably an hour of work. Compare that to opening a folder of documents and converting all of them to PDF or EPUB with just one swift command or menu action. The conversion would run in the background while you work on other things. You'd be finished in a quarter of the time, possibly less. - - -``` -`$ libreoffice --headless --convert-to epub *.docx` -``` - -It's the little improvements that Linux encourages, not explicitly but implicitly, through its toolset and the ease with which you can customize your environment and workflow. - -### Abiword and Gnumeric - -Sometimes, a big office suite is exactly what you _don't_ need. If you prefer to keep your office work simple, you might do better with a lightweight and task-specific application. For instance, I mostly write articles in a text editor because I know all styles are discarded during conversion to HTML. But there are times when a word processor is useful, either to open a document someone has sent to me or because I want a quick and easy way to generate some nicely styled text. - -[Abiword][3] is a simple word processor with basic support for popular document formats and all the essential features you'd expect from a word processor. It isn't meant as a full office suite, and that's its best feature. While there's no such a thing as too many options, there definitely is such a thing as information overload, and that's exactly what a full office suite or word processor is sometimes guilty of. If you're looking to avoid that, then use something simple instead. - -Similarly, the [Gnumeric][4] project provides a simple spreadsheet application. Gnumeric avoids any features that aren't strictly necessary for a spreadsheet, so you still get a robust formula syntax, plenty of functions, and all the options you need for styling and manipulating cells. I don't do much with spreadsheets, so I find myself quite happy with Gnumeric on the rare occasions I need to review or process data in a ledger. - -### Pandoc - -It's possible to get even more minimal with specialized commands and document processors. The `pandoc` command specializes in document conversion. It's like the `libreoffice --headless` command, except with ten times the number of document formats to work with. You can even generate presentations with it! If part of your work is taking source text from one document and formatting it for several modes of delivery, then Pandoc is a necessity, and so you should [download our cheat sheet][5]. - -Broadly, Pandoc is representative of a completely different way of working. It gets you away from the confines of office applications. It separates you from trying to get your thoughts down into typed words and deciding what font those words ought to use, all at the same time. Working in plain text and then converting to all of your delivery targets afterward lets you work with any application you want, whether it's a notepad on your mobile device, a simple text editor on whatever computer you happen to be sitting in front of, or a text editor in the cloud. - -### Look for the alternatives - -There are lots of unexpected alternatives available for Linux. You can find them by taking a step back from what you're doing, analyzing your work process, assessing your required results, and investigating new applications that claim to do just the things you rely upon. - -Changing the tools you use, your workflow, and your daily routine can be disorienting, especially when you don't know exactly where it is you're looking to go. But the advantage to Linux is that you're afforded the opportunity to re-evaluate the assumptions you've subconsciously developed over years of computer usage. If you look hard enough for an answer, you'll eventually realize what the question was in the first place. And oftentimes, you'll end up appreciating what you learn. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/linux-workday - -作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) -[2]: http://libreoffice.org -[3]: https://www.abisource.com -[4]: http://www.gnumeric.org -[5]: https://opensource.com/article/20/5/pandoc-cheat-sheet diff --git a/translated/tech/20210208 3 open source tools that make Linux the ideal workstation.md b/translated/tech/20210208 3 open source tools that make Linux the ideal workstation.md new file mode 100644 index 0000000000..0669873c8b --- /dev/null +++ b/translated/tech/20210208 3 open source tools that make Linux the ideal workstation.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 open source tools that make Linux the ideal workstation) +[#]: via: (https://opensource.com/article/21/2/linux-workday) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +让 Linux 成为理想的工作站的 3 个开源工具 +====== + +> Linux 不但拥有你认为所需的一切,还有可以让你高效工作的更多工具。 + +![使用笔记本电脑的人][1] + +在 2021 年,人们喜欢 Linux 的理由比以往任何时候都多。在这个系列中,我将分享 21 个使用 Linux 的不同理由。今天,我将与你分享为什么 Linux 是你工作的最佳选择。 + +每个人都希望在工作期间提高工作效率。如果你的工作通常涉及到文档、演示文稿和电子表格的工作,那么你可能已经习惯了一种特定的例行工作。问题是,这个*惯常的例行工作*通常是由一两个特定的应用程序决定的,无论是某个办公套件还是桌面操作系统。当然,一种习惯并不意味着它是理想的,然而它往往会毫无疑义地坚持下去,甚至影响到企业的运行结构。 + +### 更聪明地工作 + +如今,许多办公应用程序都在云端运行,因此如果你确实愿意,你可以在 Linux 上使用相同的方式。然而,由于许多典型的大名鼎鼎的办公应用程序并不符合 Linux 上的文化预期,因此你可能会发现自己受到启发,想去探索其他的选择。正如任何渴望走出“舒适区”的人所知道的那样,这种微妙的打破可能会出奇的有用。很多时候,你不知道自己效率低下,因为你实际上并没有尝试过以不同的方式做事。强迫自己去探索其他方式,而你永远不知道会发现什么。你甚至不必完全知道要寻找的内容。 + +### LibreOffice + +Linux(或任何其他平台)上最明显的开源办公主力之一是 [LibreOffice][2]。它具有多个组件,包括文字处理器、演示软件、电子表格、关系型数据库接口、矢量绘图等。它可以从其他流行的办公应用程序中导入许多文档格式,因此从其他工具过渡到 LibreOffice 通常很容易。 + +然而,LibreOffice 不仅仅是一个伟大的办公套件。LibreOffice 支持宏,所以机智的用户可以自动完成重复性任务。它还具有终端命令的功能,因此你可以在不启动 LibreOffice 界面的情况下执行许多任务。 + +想象一下,例如,打开 21 个文档,导航到**文件**菜单,到**导出**或**打印**菜单项,并将文件导出为 PDF 或 EPUB。这至少需要 84 次以上的点击,可能要花费一个小时的时间。比较一下,打开一个文档文件夹,并转换所有文件为 PDF 或 EPUB,只需要执行一个迅速的命令或菜单操作。转换将在后台运行,而你可以处理其他事情。只需要四分之一的时间,可能更少。 + +``` +$ libreoffice --headless --convert-to epub *.docx +``` + +这是一个小改进,是由 Linux 工具集和你可以自定义环境和工作流程的便利性所潜在带来的鼓励。 + +### Abiword 和 Gnumeric + +有时,你并不需要一个大而全的办公套件。如果你喜欢让办公室工作保持简单,你可能会更好地使用一个轻量级和针对特定任务的应用程序。例如,我大部分时间都是用文本编辑器写文章,因为我知道在转换为 HTML 的过程中,所有的样式都会被丢弃。但有些时候,文字处理器是很有用的,无论是打开别人发给我的文档,还是因为我想用一种快速简单的方法来生成一些样式漂亮的文本。 + +[Abiword][3] 是一款简单的文字处理器,它基本支持流行的文档格式,并具备你所期望的文字处理器的所有基本功能。它并不意味着是一个完整的办公套件,这是它最大的特点。虽然没有太多的选择,但绝对有信息过载这样的事情,而这正是一个完整的办公套件或文字处理器有时会犯的错误。如果你想避免这种情况,那就用一些简单的东西来代替。 + +同样,[Gnumeric][4] 项目提供了一个简单的电子表格应用程序。Gnumeric 避免了任何严格意义上的电子表格所不需要的功能,所以你仍然可以得到一个强大的公式语法、大量的函数,以及所有你需要的样式和操作单元格的选项。我不怎么使用电子表格,所以我发现自己在极少数需要查看或处理分类账中的数据时,对 Gnumeric 相当满意。 + +### Pandoc + +通过专门的命令和文件处理程序,可以得到更多的最小化。`pandoc` 命令专门用于文件转换。它就像 `libreoffice --headless` 命令一样,只是要处理的文档格式数量是它的十倍。你甚至可以用它来生成演示文稿! 如果你的部分工作是从一个文档中提取源文本,并将其格式化以用于多种传输模式,那么 Pandoc 是必要的,所以你应该[下载我们的攻略][5]看看。 + +广义上讲,Pandoc 代表的是一种完全不同的工作方式。它让你脱离了办公应用的束缚。它将你从试图将你的想法写成文字,并决定这些文字应该使用什么字体的工作中分离出来,同时。在纯文本中工作,然后转换为所有的交付目标,让你可以使用任何你想要的应用程序,无论是移动设备上的记事本,还是你碰巧坐在电脑前的简单文本编辑器,或者是云端的文本编辑器。 + +### 寻找替代品 + +Linux 有很多意想不到的替代品。你可以通过从你正在做的事情中退后一步,分析你的工作流程,评估你所需的结果,并调查那些声称可以做你所依赖的事情的新应用程序来找到它们。 + +改变你所使用的工具、你的工作流程和你的日常工作可能会让你迷失方向,特别是当你不知道你要找的到底是什么的时候。但 Linux 的优势在于,你有机会重新评估你在多年的计算机使用过程中潜意识里形成的假设。如果你足够努力地寻找答案,你最终会意识到问题的初衷是什么。而且很多时候,你最终会欣赏你学到的东西。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-workday + +作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: http://libreoffice.org +[3]: https://www.abisource.com +[4]: http://www.gnumeric.org +[5]: https://opensource.com/article/20/5/pandoc-cheat-sheet From 327f5f9bd5bd04f66cb30d42280e3a33d86c8126 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 17 Feb 2021 05:03:45 +0800 Subject: [PATCH 343/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210215=20?= =?UTF-8?q?Review=20of=20Five=20popular=20Hyperledger=20DLTs-=20Fabric,=20?= =?UTF-8?q?Besu,=20Sawtooth,=20Iroha=20and=20Indy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210215 Review of Five popular Hyperledger DLTs- Fabric, Besu, Sawtooth, Iroha and Indy.md --- ... Fabric, Besu, Sawtooth, Iroha and Indy.md | 224 ++++++++++++++++++ 1 file changed, 224 insertions(+) create mode 100644 sources/tech/20210215 Review of Five popular Hyperledger DLTs- Fabric, Besu, Sawtooth, Iroha and Indy.md diff --git a/sources/tech/20210215 Review of Five popular Hyperledger DLTs- Fabric, Besu, Sawtooth, Iroha and Indy.md b/sources/tech/20210215 Review of Five popular Hyperledger DLTs- Fabric, Besu, Sawtooth, Iroha and Indy.md new file mode 100644 index 0000000000..88c4fc7c51 --- /dev/null +++ b/sources/tech/20210215 Review of Five popular Hyperledger DLTs- Fabric, Besu, Sawtooth, Iroha and Indy.md @@ -0,0 +1,224 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Review of Five popular Hyperledger DLTs- Fabric, Besu, Sawtooth, Iroha and Indy) +[#]: via: (https://www.linux.com/news/review-of-five-popular-hyperledger-dlts-fabric-besu-sawtooth-iroha-and-indy/) +[#]: author: (Dan Brown https://training.linuxfoundation.org/announcements/review-of-five-popular-hyperledger-dlts-fabric-besu-sawtooth-iroha-and-indy/) + +Review of Five popular Hyperledger DLTs- Fabric, Besu, Sawtooth, Iroha and Indy +====== + +_by Matt Zand_ + +As companies are catching up in adopting blockchain technology, the choice of a private blockchain platform becomes very vital. Hyperledger, whose open source projects support/power more [enterprise blockchain use cases][1] than others, is currently leading the race of private Distributed Ledger Technology (DLT) implementation. Working from the assumption that you know how blockchain works and what is the design philosophy behind [Hyperledger’s ecosystem][2], in this article we will briefly review five active Hyperledger DLTs. In addition to DLTs discussed in this article, Hyperledger ecosystem has more supporting tools and libraries that I will cover in more detail in my future articles. + +This article mainly targets those who are relatively new to Hyperledger. This article would be a great resource for those interested in providing blockchain solution architect services and doing blockchain enterprise consulting and development. The materials included in this article will help you understand Hyperledger DLTs as a whole and use its high-level overview as a guideline for making the best of each Hyperledger project. + +Since Hyperledger is supported by a robust open source community, new projects are being added to the Hyperledger ecosystem regularly. At the time of this writing, Feb 2021, it consists of six active projects and 10 others which are at the incubation stage. Each project has unique features and advantages. + +**1- Hyperledger Fabric** + +[Hyperledger Fabric][3] is the most popular Hyperledger framework. Smart contracts (also known as **chaincode**) are written in [Golang][4] or JavaScript, and run in Docker containers. Fabric is known for its extensibility and allows enterprises to build distributed ledger networks on top of an established and successful architecture. A permissioned blockchain, initially contributed by IBM and Digital Asset,  Fabric is designed to be a foundation for developing applications or solutions with a modular architecture. It takes plugin components for providing functionalities such as consensus and membership services. Like Ethereum, Hyperledger Fabric can host and execute smart contracts, which are named chaincode. A Fabric network consists of peer nodes, which execute smart contracts (chaincode), query ledger data, validate transactions, and interact with applications. User-entered transactions are channeled to an ordering service component, which initially serves to be a consensus mechanism for Hyperledger Fabric. Special nodes called Orderer nodes validate the transactions, ensure the consistency of the blockchain, and send the validated transactions to the peers of the network as well as to membership service provider (MSP) services. + +Two major highlights of Hyperledger Fabric versus Ethereum are: + + * **Multi-ledger**: Each node on Ethereum has a replica of a single ledger in the network. However, Fabric nodes can carry multiple ledgers on each node, which is a great feature for enterprise applications. + * **Private Data**: In addition to a private channel feature, unlike with Ethereum, Fabric members within a consortium can exchange private data among themselves without disseminating them through Fabric channel, which is very useful for enterprise applications. + + + +[Here][5] is a good article for reviewing all Hyperledger Fabric components like peer, channel and, chaincode that are essential for building blockchain applications. In short, thorough understanding of all Hyperledger Fabric components is highly recommended for building, deploying and managing enterprise-level Hyperledger Fabric applications. + +**2- Hyperledger Besu** + +Hyperledger Besu is an open source Ethereum client developed under the Apache 2.0 license and written in Java. It can be run on the Ethereum public network or on private permissioned networks, as well as test networks such as Rinkeby, Ropsten, and Gorli. Hyperledger Besu supports several consensus algorithms including PoW, PoA, and IBFT, and has comprehensive permissioning schemes designed specifically for uses in a consortium environment. + +Hyperledger Besu implements the Enterprise Ethereum Alliance (EEA) specification. The EEA specification was established to create common interfaces amongst the various open and closed source projects within Ethereum, to ensure users do not have vendor lock-in, and to create standard interfaces for teams building applications. Besu implements enterprise features in alignment with the EEA client specification. + +As a basic Ethereum Client, Besu has the following features: + + * It connects to the blockchain network to synchronize blockchain transaction data or emit events to the network. + * It processes transactions through smart contracts in an Ethereum Virtual Machine (EVM) environment. + * It uses a data storage of networks (blocks). + * It publishes client API interfaces for developers to interact with the blockchain network. + + + +Besu implements [Proof of Work][6] and [Proof of Authority][7] (PoA) consensus mechanisms. Further, Hyperledger Besu implements several PoA protocols, including Clique and IBFT 2.0. + +Clique is a proof-of-authority blockchain consensus protocol. The blockchain runs Clique protocol maintaining the list of authorized signers. These approved signers directly mine and seal all blocks without mining. Therefore, the transaction task is computationally light. When creating a block, a miner collects and executes transactions, updates the network state with the calculated hash of the block and signs the block using his private key. By using a defined period of time to create a block, Clique can limit the number of processed transactions. + +IBFT 2.0 (Istanbul BFT 2.0) is a PoA **Byzantine-Fault-Tolerant** (**BFT**) blockchain consensus protocol. Transactions and blocks in the network are validated by authorized accounts, known as validators. Validators collect, validate and execute transactions and create the next block. Existing validators can propose and vote to add or remove validators and maintain a dynamic validator set. The consensus can ensure immediate finality. As the name suggests, IBFT 2.0 builds upon the IBFT blockchain consensus protocol with improved safety and liveness. In IBFT 2.0 blockchain, all valid blocks are directly added in the main chain and there are no forks. + +**3- Hyperledger Sawtooth** + +Sawtooth is the second Hyperledger project to reach 1.0 release maturity. Sawtooth-core is written in Python, while Sawtooth Raft and Sawtooth Sabre are written in Rust. It also has JavaScript and Golang components. Sawtooth supports both permissioned and permissionless deployments. It supports the EVM through a collaboration with the Hyperledger Burrow. By design, Hyperledger Sawtooth is created to address issues of performance. As such, one of its distinct features compared to other Hyperledger DLTs is that each node in Sawtooth can act as an orderer by validating and approving a transaction. Other notable features are: + + * **Parallel Transaction Execution**: While many blockchains use serial transaction execution to ensure consistent ordering at every node on the network, Sawtooth follows an advanced parallel scheduler that classifies transactions into parallel flows that eventually leads to the boost in transaction processing performance. + * **Separation of Application from Core**: Sawtooth simplifies the development and deployment of an application by separating the application level from the core system level. It offers smart contract abstraction to allow developers to create contract logic in the programming language of their choice. + * **Custom Transaction Processors**: In Sawtooth, each application can define the custom transaction processors to meet its unique requirements. It provides transaction families to serve as an approach for low-level functions, like storing on-chain permissions, managing chain-wide settings and for particular applications such as saving block information and performance analysis. + + + +**4- Hyperledger Iroha** + +Hyperledger Iroha is designed to target the creation and management of complex digital assets and identities. It is written in C++ and is user friendly. Iroha has a powerful role-based model for access control and supports complex analytics. While using Iroha for identity management, querying and performing commands are only limited to the participants who have access to the Iroha network. A robust permissions system ensures that all transactions are secure and controlled. Some of its highlights are: + + * **Ease of use:** You can easily create and manage simple, as well as complex, digital assets (e.g., cryptocurrency or personal medical data). + * **Built-in Smart Contracts:** You can easily integrate blockchain into a business process using built-in smart-contracts called “commands.” As such, developers need not to write complicated smart-contracts because they are available in the form of commands. + * **BFT:** Iroha uses BFT consensus algorithm which makes it suitable for businesses that require verifiable data consistency at a low cost. + + + +**5- Hyperledger Indy** + +As a self-sovereign identity management platform, Hyperledger Indy is built explicitly for decentralized identity management. The server portion, Indy node, is built in Python, while the Indy SDK is written in Rust. It offers tools and reusable components to manage digital identities on blockchains or other distributed ledgers. Hyperledger Indy architecture is well-suited for every application that requires heavy work on identity management since Indy is easily interpretable across multiple domains, organization silos and applications. As such, identities are securely stored and shared with all parties involved. Some notable highlights of Hyperledger Indy are: + +●        Identity Correlation-resistant: According to the Hyperledger Indy documentation, Indy is completely identity correlation-resistant. So, you do not need to worry about connecting or mixing one Id with another. That means, you can not connect two Ids or find two similar Ids in the ledger. + +●        Decentralized Identifiers (DIDs): According to the Hyperledger Indy documentation, all the decentralized identifiers are globally resolvable and unique without needing any central party in the mix. That means, every decentralized identity on the Indy platform will have a unique identifier that will solely belong to you. As a result, no one can claim or even use your identity on your behalf. So, it would eliminate the chances of identity theft. + +●        Zero-Knowledge Proofs: With help from Zero-Knowledge Proof, you can disclose only the information necessary without anything else. So, when you have to prove your credentials, you can only choose to release the information that you need depending on the party that is requesting it. For instance, you may choose to share your data of birth only with one party whereas to release your driver license and financial docs to another. In short, Indy gives users great flexibility in sharing their private data whenever and wherever needed. + +**Summary** + +In this article, we briefly reviewed five popular Hyperledger DLTs. We started off by going over Hyperledger Fabric and its main components and some of its highlights compared to public blockchain platforms like Ethereum. Even though Fabric is currently used heavily for supply chain management, if you are doing lots of specific works in supply chain domain, you should explore Hyperledger Grid too. Then, we moved on to learning how to use Hyperledger Besu for building public consortium blockchain applications that support multiple consensus algorithms and how to manage Besu from EVM. Next, we covered some highlights of Hyperledger Sawtooth such as how it is designed for high performance. For instance, we learned how a single node in Sawtooth can act as an orderer by approving and validating transactions in the network. The last two DLTs (Hyperledger Iroha and Indy) are specifically geared toward digital asset management and identity . So if you are working on a project that heavily uses identity management, you should explore and use either Iroha or Indy instead of Fabric. + +I have included reference and resource links for those interested in exploring topics discussed in this article in depth. + +For more references on all Hyperledger projects, libraries and tools, visit the below documentation links: + + 1. [Hyperledger Indy Project][8] + 2. [Hyperledger Fabric Project][9] + 3. [Hyperledger Aries Library][10] + 4. [Hyperledger Iroha Project][11] + 5. [Hyperledger Sawtooth Project][12] + 6. [Hyperledger Besu Project][13] + 7. [Hyperledger Quilt Library][14] + 8. [Hyperledger Ursa Library][15] + 9. [Hyperledger Transact Library][16] + 10. [Hyperledger Cactus Project][17] + 11. [Hyperledger Caliper Tool][18] + 12. [Hyperledger Cello Tool][19] + 13. [Hyperledger Explorer Tool][20] + 14. [Hyperledger Grid (Domain Specific)][21] + 15. [Hyperledger Burrow Project][22] + 16. [Hyperledger Avalon Tool][23] + + + +**Resources** + + * Free Training Courses from The Linux Foundation & Hyperledger + * [Blockchain: Understanding Its Uses and Implications (LFS170)][24] + * [Introduction to Hyperledger Blockchain Technologies (LFS171)][25] + * [Introduction to Hyperledger Sovereign Identity Blockchain Solutions: Indy, Aries & Ursa (LFS172)][26] + * [Becoming a Hyperledger Aries Developer (LFS173)][27] + * [Hyperledger Sawtooth for Application Developers (LFS174)][28] + * eLearning Courses from The Linux Foundation & Hyperledger + * [Hyperledger Fabric Administration (LFS272)][29] + * [Hyperledger Fabric for Developers (LFD272)][30] + * Certification Exams from The Linux Foundation & Hyperledger + * [Certified Hyperledger Fabric Administrator (CHFA)][31] + * [Certified Hyperledger Fabric Developer (CHFD)][32] + * [Hands-On Smart Contract Development with Hyperledger Fabric V2][33] Book by Matt Zand and others. + * [Essential Hyperledger Sawtooth Features for Enterprise Blockchain Developers][34] + * [Blockchain Developer Guide- How to Install Hyperledger Fabric on AWS][35] + * [Blockchain Developer Guide- How to Install and work with Hyperledger Sawtooth][36] + * [Intro to Blockchain Cybersecurity (Coding Bootcamps)][37] + * [Intro to Hyperledger Sawtooth for System Admins (Coding Bootcamps)][38] + * [Blockchain Developer Guide- How to Install Hyperledger Iroha on AWS][39] + * [Blockchain Developer Guide- How to Install Hyperledger Indy and Indy CLI on AWS][40] + * [Blockchain Developer Guide- How to Configure Hyperledger Sawtooth Validator and REST API on AWS][41] + * [Intro blockchain development with Hyperledger Fabric (Coding Bootcamps)][42] + * [How to build DApps with Hyperledger Fabric][43] + * [Blockchain Developer Guide- How to Build Transaction Processor as a Service and Python Egg for Hyperledger Sawtooth][44] + * [Blockchain Developer Guide- How to Create Cryptocurrency Using Hyperledger Iroha CLI][45] + * [Blockchain Developer Guide- How to Explore Hyperledger Indy Command Line Interface][46] + * [Blockchain Developer Guide- Comprehensive Blockchain Hyperledger Developer Guide from Beginner to Advance Level][47] + * [Blockchain Management in Hyperledger for System Admins][48] + * [Hyperledger Fabric for Developers (Coding Bootcamps)][49] + * [Free White Papers from Hyperledger][50] + * [Free Webinars from Hyperledger][51] + * [Hyperledger Wiki][52] + + + +**About the Author** + +**Matt Zand** is a serial entrepreneur and the founder of 3 tech startups: [DC Web Makers][53], [Coding Bootcamps][54] and [High School Technology Services][55]. He is a leading author of [Hands-on Smart Contract Development with Hyperledger Fabric][33] book by O’Reilly Media. He has written more than 100 technical articles and tutorials on blockchain development for Hyperledger, Ethereum and Corda R3 platforms. At DC Web Makers, he leads a team of blockchain experts for consulting and deploying enterprise decentralized applications. As chief architect, he has designed and developed blockchain courses and training programs for Coding Bootcamps. He has a master’s degree in business management from the University of Maryland. Prior to blockchain development and consulting, he worked as senior web and mobile App developer and consultant, angel investor, business advisor for a few startup companies. You can connect with him on LI: + +The post [Review of Five popular Hyperledger DLTs- Fabric, Besu, Sawtooth, Iroha and Indy][56] appeared first on [Linux Foundation – Training][57]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/review-of-five-popular-hyperledger-dlts-fabric-besu-sawtooth-iroha-and-indy/ + +作者:[Dan 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://training.linuxfoundation.org/announcements/review-of-five-popular-hyperledger-dlts-fabric-besu-sawtooth-iroha-and-indy/ +[b]: https://github.com/lujun9972 +[1]: https://blockchain.dcwebmakers.com/blog/comprehensive-overview-and-analysis-of-blockchain-use-cases-in-many-industries.html +[2]: https://weg2g.com/application/touchstonewords/article-intro-to-hyperledger-family-and-hyperledger-blockchain-ecosystem.php +[3]: https://learn.coding-bootcamps.com/blog/202224/why-build-blockchain-applications-with-hyperledger-fabric +[4]: https://learn.coding-bootcamps.com/p/learn-go-programming-language-by-examples +[5]: https://coding-bootcamps.com/blog/review-of-hyperledger-fabric-architecture-and-components.html +[6]: https://coding-bootcamps.com/blog/how-proof-of-work-consensus-works-in-blockchain.html +[7]: https://coding-bootcamps.com/blog/how-proof-of-stake-consensus-works-in-blockchain.html +[8]: https://www.hyperledger.org/use/hyperledger-indy +[9]: https://www.hyperledger.org/use/fabric +[10]: https://www.hyperledger.org/projects/aries +[11]: https://www.hyperledger.org/projects/iroha +[12]: https://www.hyperledger.org/projects/sawtooth +[13]: https://www.hyperledger.org/projects/besu +[14]: https://www.hyperledger.org/projects/quilt +[15]: https://www.hyperledger.org/projects/ursa +[16]: https://www.hyperledger.org/projects/transact +[17]: https://www.hyperledger.org/projects/cactus +[18]: https://www.hyperledger.org/projects/caliper +[19]: https://www.hyperledger.org/projects/cello +[20]: https://www.hyperledger.org/projects/explorer +[21]: https://www.hyperledger.org/projects/grid +[22]: https://www.hyperledger.org/projects/hyperledger-burrow +[23]: https://www.hyperledger.org/projects/avalon +[24]: https://training.linuxfoundation.org/training/blockchain-understanding-its-uses-and-implications/ +[25]: https://training.linuxfoundation.org/training/blockchain-for-business-an-introduction-to-hyperledger-technologies/ +[26]: https://training.linuxfoundation.org/training/introduction-to-hyperledger-sovereign-identity-blockchain-solutions-indy-aries-and-ursa/ +[27]: https://training.linuxfoundation.org/training/becoming-a-hyperledger-aries-developer-lfs173/ +[28]: https://training.linuxfoundation.org/training/hyperledger-sawtooth-application-developers-lfs174/ +[29]: https://training.linuxfoundation.org/training/hyperledger-fabric-administration-lfs272/ +[30]: https://training.linuxfoundation.org/training/hyperledger-fabric-for-developers-lfd272/ +[31]: https://training.linuxfoundation.org/certification/certified-hyperledger-fabric-administrator-chfa/ +[32]: https://training.linuxfoundation.org/certification/certified-hyperledger-fabric-developer/ +[33]: https://www.oreilly.com/library/view/hands-on-smart-contract/9781492086116/ +[34]: https://weg2g.com/application/touchstonewords/article-essential-hyperledger-sawtooth-features-for-enterprise-blockchain-developers.php +[35]: https://myhsts.org/tutorial-learn-how-to-install-blockchain-hyperledger-fabric-on-amazon-web-services.php +[36]: https://myhsts.org/tutorial-learn-how-to-install-and-work-with-blockchain-hyperledger-sawtooth.php +[37]: https://learn.coding-bootcamps.com/p/learn-how-to-secure-blockchain-applications-by-examples +[38]: https://learn.coding-bootcamps.com/p/introduction-to-hyperledger-sawtooth-for-system-admins +[39]: https://myhsts.org/tutorial-learn-how-to-install-blockchain-hyperledger-iroha-on-amazon-web-services.php +[40]: https://myhsts.org/tutorial-learn-how-to-install-blockchain-hyperledger-indy-on-amazon-web-services.php +[41]: https://myhsts.org/tutorial-learn-how-to-configure-hyperledger-sawtooth-validator-and-rest-api-on-aws.php +[42]: https://learn.coding-bootcamps.com/p/live-and-self-paced-blockchain-development-with-hyperledger-fabric +[43]: https://learn.coding-bootcamps.com/p/live-crash-course-for-building-dapps-with-hyperledger-fabric +[44]: https://myhsts.org/tutorial-learn-how-to-build-transaction-processor-as-a-service-and-python-egg-for-hyperledger-sawtooth.php +[45]: https://myhsts.org/tutorial-learn-how-to-work-with-hyperledger-iroha-cli-to-create-cryptocurrency.php +[46]: https://myhsts.org/tutorial-learn-how-to-work-with-hyperledger-indy-command-line-interface.php +[47]: https://myhsts.org/tutorial-comprehensive-blockchain-hyperledger-developer-guide-for-all-professional-programmers.php +[48]: https://learn.coding-bootcamps.com/p/learn-blockchain-development-with-hyperledger-by-examples +[49]: https://learn.coding-bootcamps.com/p/hyperledger-blockchain-development-for-developers +[50]: https://www.hyperledger.org/learn/white-papers +[51]: https://www.hyperledger.org/learn/webinars +[52]: https://wiki.hyperledger.org/ +[53]: https://blockchain.dcwebmakers.com/ +[54]: http://coding-bootcamps.com/ +[55]: https://myhsts.org/ +[56]: https://training.linuxfoundation.org/announcements/review-of-five-popular-hyperledger-dlts-fabric-besu-sawtooth-iroha-and-indy/ +[57]: https://training.linuxfoundation.org/ From 34f1cba8596b52874d0d8a583572cac400b34488 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 17 Feb 2021 09:13:30 +0800 Subject: [PATCH 344/381] APL --- .../tech/20210215 A practical guide to JavaScript closures.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210215 A practical guide to JavaScript closures.md b/sources/tech/20210215 A practical guide to JavaScript closures.md index 46f5d19c0f..58e2ff2e3c 100644 --- a/sources/tech/20210215 A practical guide to JavaScript closures.md +++ b/sources/tech/20210215 A practical guide to JavaScript closures.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 92da32c65840f2f51c816281a811e7f8e0e9c2a2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 17 Feb 2021 10:23:15 +0800 Subject: [PATCH 345/381] TSL --- ... practical guide to JavaScript closures.md | 144 ------------------ ... practical guide to JavaScript closures.md | 136 +++++++++++++++++ 2 files changed, 136 insertions(+), 144 deletions(-) delete mode 100644 sources/tech/20210215 A practical guide to JavaScript closures.md create mode 100644 translated/tech/20210215 A practical guide to JavaScript closures.md diff --git a/sources/tech/20210215 A practical guide to JavaScript closures.md b/sources/tech/20210215 A practical guide to JavaScript closures.md deleted file mode 100644 index 58e2ff2e3c..0000000000 --- a/sources/tech/20210215 A practical guide to JavaScript closures.md +++ /dev/null @@ -1,144 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (A practical guide to JavaScript closures) -[#]: via: (https://opensource.com/article/21/2/javascript-closures) -[#]: author: (Nimisha Mukherjee https://opensource.com/users/nimisha) - -A practical guide to JavaScript closures -====== -Get a better understanding of how JavaScript code works and executes by -diving into one of the advanced concept: closures. -![Woman programming][1] - -In [_4 reasons why JavaScript is so popular_][2], I touched on a few advanced JavaScript concepts. In this article, I will dive into one of them: closures. - -According to [Mozilla Developer Network][3] (MDN), "A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment)." Simplified, this means that a function inside another function can access the variables from the outer (parent) function. - -To better understand closures, take a look at scopes and their execution context. - -Here is a simple code snippet: - - -``` -var hello = "Hello"; - -function sayHelloWorld() { -var world = "World"; -        function wish() { -                var year = "2021"; -                console.log(hello + " " + world + " "+ year); -} -wish(); -} -sayHelloWorld(); -``` - -Here's the execution context for this code:  - -![Execution context for JS code][4] - -(Nimisha Mukherjee, [CC BY-SA 4.0][5]) - -Closures are created every time a function is created (at function-creation time). Every closure has three scopes: - - * Local scope (own scope) - * Outer functions scope - * Global scope - - - -I'll modify the above code slightly to demonstrate closure: - - -``` -var hello = "Hello"; - -var sayHelloWorld = function() { -var world = "World"; -        function wish() { -                var year = "2021"; -                console.log(hello + " " + world + " "+ year); -} -return wish; -} -var callFunc = sayHelloWorld(); -callFunc(); -``` - -The inner function `wish()` is returned from the outer function before it's executed. This happens because functions in JavaScript form **closures**. - - * `callFunc` holds a reference to the function `wish` when `sayHelloWorld` runs - * `wish` maintains a reference to its surrounding (lexical) environment where the variable `world` exists. - - - -### Private variables and methods - -Natively, JavaScript does not support the creation of private variables and methods. A common and practical use of closure is to emulate private variables and methods and allow data privacy. Methods defined within the closure scope are privileged. - -This code snippet captures how closures are commonly written and used in JavaScript: - - -``` -var resourceRecord = function(myName, myAddress) { - var resourceName = myName; - var resourceAddress = myAddress; - var accessRight = "HR"; - return { -   changeName: function(updateName, privilege) { -     //only HR can change the name -     if(privilege === accessRight ) { -       resourceName = updateName; -       return true; -     } else { -       return false; -     } -   },   -   changeAddress: function(newAddress) { -     //any associate can change the address -     resourceAddress = newAddress;           -   },   -   showResourceDetail: function() { -     console.log ("Name:" + resourceName + " ; Address:" + resourceAddress); -   } - } -} -//Create first record -var resourceRecord1 = resourceRecord("Perry","Office"); -//Create second record -var resourceRecord2 = resourceRecord("Emma","Office"); -//Change the address on the first record -resourceRecord1.changeAddress("Home"); -resourceRecord1.changeName("Perry Berry", "Associate"); //Output is false as only an HR can change the name -resourceRecord2.changeName("Emma Freeman", "HR"); //Output is true as HR changes the name -resourceRecord1.showResourceDetail(); //Output - Name:Perry ; Address:Home -resourceRecord2.showResourceDetail(); //Output - Name:Emma Freeman ; Address:Office -``` - -The resource records (`resourceRecord1` and `resourceRecord2`) are independent of one another. Each closure references a different version of the `resourceName` and `resourceAddress` variable through its own closure. You can also apply specific rules to how private variables need to be handled—I added a check on who can modify `resourceName`. - -### Use closures - -Understanding closure is important, as it enables deeper knowledge of how variables and functions relate to one another and how JavaScript code works and executes. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/javascript-closures - -作者:[Nimisha Mukherjee][a] -选题:[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/nimisha -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) -[2]: https://opensource.com/article/20/11/javascript-popular -[3]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures -[4]: https://opensource.com/sites/default/files/uploads/execution-context.png (Execution context for JS code) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/translated/tech/20210215 A practical guide to JavaScript closures.md b/translated/tech/20210215 A practical guide to JavaScript closures.md new file mode 100644 index 0000000000..094da3e089 --- /dev/null +++ b/translated/tech/20210215 A practical guide to JavaScript closures.md @@ -0,0 +1,136 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A practical guide to JavaScript closures) +[#]: via: (https://opensource.com/article/21/2/javascript-closures) +[#]: author: (Nimisha Mukherjee https://opensource.com/users/nimisha) + +JavaScript 闭包实践 +====== + +> 通过深入了解 JavaScript 的高级概念之一:闭包,更好地理解 JavaScript 代码的工作和执行方式。 + +![女性编程][1] + +在《[JavaScript 如此受欢迎的 4 个原因][2]》中,我提到了一些高级 JavaScript 概念。在本文中,我将深入探讨其中的一个概念:闭包closure。 + +根据 [Mozilla 开发者网络][3](MDN),“闭包是将一个函数和对其周围的状态(词法环境)的引用捆绑在一起(封闭)的组合。”简而言之,这意味着在一个函数内部的函数可以访问其外部(父)函数的变量。 + +为了更好地理解闭包,可以看看作用域及其执行上下文。 + +下面是一个简单的代码片段: + +``` +var hello = "Hello"; + +function sayHelloWorld() { + var world = "World"; +    function wish() { +        var year = "2021"; +        console.log(hello + " " + world + " "+ year); + } + wish(); +} +sayHelloWorld(); +``` + +下面是这段代码的执行上下文: + +![JS 代码的执行上下文][4] + +每次创建函数时(在函数创建阶段)都会创建闭包。每个闭包有三个作用域。 + + * 本地作用域(自己的作用域) + * 外部函数范围 + * 全局范围 + +我稍微修改一下上面的代码来演示一下闭包: + +``` +var hello = "Hello"; + +var sayHelloWorld = function() { + var world = "World"; +    function wish() { +        var year = "2021"; +        console.log(hello + " " + world + " "+ year); + } + return wish; +} +var callFunc = sayHelloWorld(); +callFunc(); +``` + +内部函数 `wish()` 在执行之前就从外部函数返回。这是因为 JavaScript 中的函数形成了**闭包**。 + + * 当 `sayHelloWorld` 运行时,`callFunc` 持有对函数 `wish` 的引用。 + * `wish` 保持对其周围(词法)环境的引用,其中存在变量 `world`。 + +### 私有变量和方法 + +本身,JavaScript 不支持创建私有变量和方法。闭包的一个常见和实用的用途是模拟私有变量和方法,并允许数据隐私。在闭包范围内定义的方法是有特权的。 + +这个代码片段捕捉了 JavaScript 中闭包的常用编写和使用方式: + +``` +var resourceRecord = function(myName, myAddress) { +  var resourceName = myName; +  var resourceAddress = myAddress; +  var accessRight = "HR"; +  return { +    changeName: function(updateName, privilege) { +      // only HR can change the name +      if (privilege === accessRight ) { +        resourceName = updateName; +        return true; +      } else { +        return false; +      } +    },   +    changeAddress: function(newAddress) { +      // any associate can change the address +      resourceAddress = newAddress;           +    },   +    showResourceDetail: function() { +      console.log ("Name:" + resourceName + " ; Address:" + resourceAddress); +    } +  } +} +// Create first record +var resourceRecord1 = resourceRecord("Perry","Office"); +// Create second record +var resourceRecord2 = resourceRecord("Emma","Office"); +// Change the address on the first record +resourceRecord1.changeAddress("Home"); +resourceRecord1.changeName("Perry Berry", "Associate"); // Output is false as only an HR can change the name +resourceRecord2.changeName("Emma Freeman", "HR"); // Output is true as HR changes the name +resourceRecord1.showResourceDetail(); // Output - Name:Perry ; Address:Home +resourceRecord2.showResourceDetail(); // Output - Name:Emma Freeman ; Address:Office +``` + +资源记录(`resourceRecord1` 和 `resourceRecord2`)相互独立。每个闭包通过自己的闭包引用不同版本的 `resourceName` 和 `resourceAddress` 变量。你也可以应用特定的规则来处理私有变量,我添加了一个谁可以修改 `resourceName` 的检查。 + +### 使用闭包 + +理解闭包是很重要的,因为它可以更深入地了解变量和函数之间的关系,以及 JavaScript 代码如何工作和执行。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/javascript-closures + +作者:[Nimisha Mukherjee][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/nimisha +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) +[2]: https://linux.cn/article-12830-1.html +[3]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures +[4]: https://opensource.com/sites/default/files/uploads/execution-context.png (Execution context for JS code) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ From 0d3ab2cd0de7a84111b8f2099dc0c2e5e26250f4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 17 Feb 2021 12:22:13 +0800 Subject: [PATCH 346/381] PRF @MjSeven --- ...reate and Manage Archive Files in Linux.md | 159 ++++++++++-------- 1 file changed, 93 insertions(+), 66 deletions(-) diff --git a/translated/tech/20210115 How to Create and Manage Archive Files in Linux.md b/translated/tech/20210115 How to Create and Manage Archive Files in Linux.md index 56f30af5a1..5f1f1e72a0 100644 --- a/translated/tech/20210115 How to Create and Manage Archive Files in Linux.md +++ b/translated/tech/20210115 How to Create and Manage Archive Files in Linux.md @@ -1,148 +1,179 @@ [#]: collector: "lujun9972" [#]: translator: "MjSeven" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "How to Create and Manage Archive Files in Linux" -[#]: via: "https://www.linux.com/news/how-to-create-and-manage-archive-files-in-linux-2/" -[#]: author: "LF Training https://training.linuxfoundation.org/announcements/how-to-create-and-manage-archive-files-in-linux/" +[#]: via: "https://training.linuxfoundation.org/announcements/how-to-create-and-manage-archive-files-in-linux/" +[#]: author: "Matt Zand,Kevin Downs https://training.linuxfoundation.org/announcements/how-to-create-and-manage-archive-files-in-linux/" 如何在 Linux 中创建和管理归档文件 ====== -_由 Matt Zand 和 Kevin Downs 联合写作_ +![](https://img.linux.net.cn/data/attachment/album/202102/17/121000c7282pf7mv2sc78m.jpg) -简而言之,归档是一个包含一系列文件和(或)目录的单一文件。归档文件通常用于在本地或互联网上传输,或成为一个一系列文件和目录的备份副本,从而允许你使用一个文件来工作(如果压缩,则其大小会小于所有文件的总和)。同样的,归档也用于软件应用程序打包。为了方便传输,可以很容易地压缩这个单一文件,而存档中的文件会保留原始结构和权限。 +简而言之,归档是一个包含一系列文件和(或)目录的单一文件。归档文件通常用于在本地或互联网上传输,或作为一个一系列文件和目录的备份副本,从而允许你使用一个文件来工作(如果压缩,则其大小会小于所有文件的总和)。同样的,归档也用于软件应用程序打包。为了方便传输,可以很容易地压缩这个单一文件,而存档中的文件会保留原始结构和权限。 -我们可以使用 tar 工具来创建、列出和提取归档中的文件。用 tar 生成的归档通常称为“tar 文件”、“tar 归档”或者“压缩包”(因为所有已归档的文件被合成了一个文件)。 +我们可以使用 `tar` 工具来创建、列出和提取归档中的文件。用 `tar` 生成的归档通常称为“tar 文件”、“tar 归档”或者“压缩包”(因为所有已归档的文件被合成了一个文件)。 -本教程会展示如何使用 tar 创建、列出和提取归档中的内容。这三个操作都会使用两个公共选项 "-f" 和 "-v":使用 "-f" 指定归档文件的名称,使用 "-v"("verbose") 选项使 tar 在处理文件时输出文件名。虽然 "-v" 选项不是必需的,但是它可以让你观察 tar 操作的过程。 +本教程会展示如何使用 `tar` 创建、列出和提取归档中的内容。这三个操作都会使用两个公共选项 `-f` 和 `-v`:使用 `-f` 指定归档文件的名称,使用 `-v`(“冗余”)选项使 `tar` 在处理文件时输出文件名。虽然 `-v` 选项不是必需的,但是它可以让你观察 `tar` 操作的过程。 -在本教程的剩余部分中,会涵盖 3 个主题:1、创建一个归档文件;2、列出归档文件内容;3、提取归档文件内容。另外我们会回答通过调查与归档文件管理的 6 个实际问题来结束本教程。你从本教程学到的内容对于执行与[网络安全][1]和[云技术][2]相关的任务至关重要。 +在本教程的下面部分中,会涵盖 3 个主题:1、创建一个归档文件;2、列出归档文件内容;3、提取归档文件内容。另外我们会回答归档文件管理的 6 个实际问题来结束本教程。你从本教程学到的内容对于执行与[网络安全][1]和[云技术][2]相关的任务至关重要。 -### 1- 创建一个归档文件 +### 1、创建一个归档文件 -要使用 tar 创建一个归档文件,使用 "-c"("create") 选项,然后用 "-f" 选项指定要创建的归档文件名。通常的做法是使用带有 ".tar" 扩展名的名称,例如 "my-backup.tar"。注意,除非另有特别说明,否则本文其余部分中使用的所有命令和参数都以小写形式使用。记住,在你的终端上输入本文的命令时,无需输入每个命令行开头的 $ 提示符。 +要使用 `tar` 创建一个归档文件,使用 `-c`(“创建”)选项,然后用 `-f` 选项指定要创建的归档文件名。通常的做法是使用带有 `.tar` 扩展名的名称,例如 `my-backup.tar`。注意,除非另有特别说明,否则本文其余部分中使用的所有命令和参数都以小写形式使用。记住,在你的终端上输入本文的命令时,无需输入每个命令行开头的 `$` 提示符。 输入要归档的文件名作为参数;如果要创建一个包含所有文件及其子目录的归档文件,提供目录名称作为参数。 -要归档 "project" 目录内容,输入 +要归档 `project` 目录内容,输入: -$ _tar -cvf project.tar project_ +``` +$ tar -cvf project.tar project +``` -这个命令将创建一个名为 "project.tar" 的归档文件,包含 "project" 目录的所有内容,而原目录 "project" 将保持不变。 +这个命令将创建一个名为 `project.tar` 的归档文件,包含 `project` 目录的所有内容,而原目录 `project` 将保持不变。 -使用 "-z" 选项可以对归档文件进行压缩,这样产生的输出与创建未压缩的存档然后用 gzip 压缩是一样的,但它省去了额外的步骤。 +使用 `-z` 选项可以对归档文件进行压缩,这样产生的输出与创建未压缩的存档然后用 `gzip` 压缩是一样的,但它省去了额外的步骤。 -要从 "project" 目录创建一个 "project.tar.gz" 的压缩包,输入: +要从 `project` 目录创建一个 `project.tar.gz` 的压缩包,输入: -$ _tar -zcvf project.tar.gz project_ +``` +$ tar -zcvf project.tar.gz project +``` -这个命令将创建一个 "project.tar.gz" 的压缩包,包含 "project" 目录的所有内容,而原目录 "project" 将保持不变。 +这个命令将创建一个 `project.tar.gz` 的压缩包,包含 `project` 目录的所有内容,而原目录 `project` 将保持不变。 -**注意:**在使用 "-z" 选项时,你应该使用 ".tar.gz" 扩展名而不是 ".tar" 扩展名,这样表示已压缩。虽然不是必须的,但这是一个很好的实践。 +**注意:** 在使用 `-z` 选项时,你应该使用 `.tar.gz` 扩展名而不是 `.tar` 扩展名,这样表示已压缩。虽然不是必须的,但这是一个很好的实践。 -Gzip 不是唯一的压缩形式,还有 bzip2 和 xz。当我们看到扩展名为 xz 的文件时,我们知道该文件是使用 xz 压缩的,扩展名为 .bz2 的文件是用 bzip2 压缩的。随着 bzip2 不再维护,我们将远离它而关注 xz。使用 xz 压缩时,需要花费更长的时间。然而,等待通常是值得的,因为压缩效果要好的多,这意味着压缩包通常比使用其它压缩形式要小。更好的是,不同压缩形式之间的解压缩或提取文件并没有太大区别。下面我们将看到一个使用 tar 压缩文件时如何使用 xz 的示例: +gzip 不是唯一的压缩形式,还有 bzip2 和 xz。当我们看到扩展名为 `.xz` 的文件时,我们知道该文件是使用 `xz` 压缩的,扩展名为 `.bz2` 的文件是用 `bzip2` 压缩的。随着 bzip2 不再维护,我们将远离它而关注 xz。使用 `xz` 压缩时,需要花费更长的时间。然而,等待通常是值得的,因为压缩效果要好的多,这意味着压缩包通常比使用其它压缩形式要小。更好的是,不同压缩形式之间的解压缩或提取文件并没有太大区别。下面我们将看到一个使用 `tar` 压缩文件时如何使用 xz 的示例: -  $ _tar -Jcvf project.tar.xz project_ +``` +$ tar -Jcvf project.tar.xz project +``` -我们只需将 gzip 的 -z 选项转换为 xz 的大写 -J 即可。以下是一些输出,显示压缩形式之间的差异: +我们只需将 `gzip` 的 `-z` 选项转换为 `xz` 的大写 `-J` 即可。以下是一些输出,显示压缩形式之间的差异: ![][3] ![][4] -如你所见,zx 的压缩时间最长。但是,它在减小文件大小方面做的最好,所以值得等待。文件越大,压缩效果也越好。 +如你所见,`xz` 的压缩时间最长。但是,它在减小文件大小方面做的最好,所以值得等待。文件越大,压缩效果也越好。 -### 2- 列出归档文件的内容 +### 2、列出归档文件的内容 -要列出 tar 归档文件的内容但不提取,使用 "-t" 选项。 +要列出 tar 归档文件的内容但不提取,使用 `-t` 选项。 -要列出 "project.tar" 的内容,输入: +要列出 `project.tar` 的内容,输入: -$ _tar -tvf project.tar_ * * +``` +$ tar -tvf project.tar +``` -这个命令列出了 "project.tar" 归档的内容。"-v" 和 "-t" 选项一起使用会输出每个文件的权限和修改时间,以及文件名。这与 ls 命令使用 "-l" 选项时使用的格式相同。 +这个命令列出了 `project.tar` 归档的内容。`-v` 和 `-t` 选项一起使用会输出每个文件的权限和修改时间,以及文件名。这与 `ls` 命令使用 `-l` 选项时使用的格式相同。 -要列出 "project.tar.gz" 压缩包的内容,输入: +要列出 `project.tar.gz` 压缩包的内容,输入: -$ _tar -tvf project.tar_ +``` +$ tar -tzvf project.tar.gz +``` -### 3- 从归档中提取内容 +### 3、从归档中提取内容 -要提取(解压)tar 归档文件中的内容,使用 "-x"("extract") 选项。 +要提取(解压)tar 归档文件中的内容,使用 `-x`(“提取”)选项。 -要提取 "project.tar" 归档的内容,输入: +要提取 `project.tar` 归档的内容,输入: -$ _tar -xvf project.tar_ +``` +$ tar -xvf project.tar +``` -这个命令会将 "project.tar" 归档的内容提取到当前目录。 +这个命令会将 `project.tar` 归档的内容提取到当前目录。 -如果一个归档文件被压缩,通常来说它的扩展名为 ".tar.gz" 或 ".tgz",包括 "-z" 选项。 +如果一个归档文件被压缩,通常来说它的扩展名为 `.tar.gz` 或 `.tgz`,请包括 "-z" 选项。 -要提取 "project.tar.gz" 压缩包的内容,输入: +要提取 `project.tar.gz` 压缩包的内容,输入: -$ _tar -zxvf project.tar.gz_ +``` +$ tar -zxvf project.tar.gz +``` -**注意**:如果当前目录中有文件或子目录与归档文件中的内容同名,那么在提取归档文件时,这些文件或子目录将被覆盖。如果你不知道归档中包含哪些文件,请考虑先查看归档文件的内容。 +**注意**: 如果当前目录中有文件或子目录与归档文件中的内容同名,那么在提取归档文件时,这些文件或子目录将被覆盖。如果你不知道归档中包含哪些文件,请考虑先查看归档文件的内容。 在提取归档内容之前列出其内容的另一个原因是,确定归档中的内容是否包含在目录中。如果没有,而当前目录中包含许多不相关的文件,那么你可能将它们与归档中提取的文件混淆。 要将文件提取到它们自己的目录中,新建一个目录,将归档文件移到该目录,然后你就可以在新目录中提取文件。 +### FAQ + 现在我们已经学习了如何创建归档文件并列出和提取其内容,接下来我们可以继续讨论 Linux 专业人员经常被问到的 9 个实用问题。 - * 可以在不解压缩的情况下添加内容到压缩包中吗? +#### 可以在不解压缩的情况下添加内容到压缩包中吗? 很不幸,一旦文件将被压缩,就无法向其添加内容。你需要解压缩或提取其内容,然后编辑或添加内容,最后再次压缩文件。如果文件很小,这个过程不会花费很长时间,否则请等待一会。 - * 可以在不解压缩的情况下删除归档文件中的内容吗? +#### 可以在不解压缩的情况下删除归档文件中的内容吗? -这取决压缩时使用的 tar 版本。较新版本的 tar 支持 -delete 选项。 +这取决压缩时使用的 tar 版本。较新版本的 `tar` 支持 `-delete` 选项。 -例如,假设归档文件中有 file1 和 file2,可以使用以下命令将它们从 file.tar 中删除: +例如,假设归档文件中有 `file1` 和 `file2`,可以使用以下命令将它们从 `file.tar` 中删除: -_$ tar -vf file.tar –delete file1 file2_ -删除目录 dir1: +``` +$ tar -vf file.tar –delete file1 file2 +``` -_$ tar -f file.tar –delete dir1/*_ +删除目录 `dir1`: - * 压缩和归档之间有什么区别? +``` +$ tar -f file.tar –delete dir1/* +``` + +#### 压缩和归档之间有什么区别? 查看归档和压缩之间差异最简单的方法是查看其解压大小。归档文件时,会将多个文件合并为一个。所以,如果我们归档 10 个 100kb 文件,则最终会得到一个 100kb 大小的文件。而如果压缩这些文件,则最终可能得到一个只有几 kb 或接近 100kb 的文件。 - * 如何压缩归档文件? +#### 如何压缩归档文件? -如上所说,你可以使用带有 cvf 选项的 tar 目录来创建和归档文件。要压缩归档文件,有两个选择:通过压缩程序(例如 gzip)运行归档文件,或在使用 tar 命令时使用压缩选项。最常见的压缩标志 -z 表示 gzip,-j 表示 bzip,-J 表示 xz。例如: +如上所说,你可以使用带有 `cvf` 选项的 `tar` 命令来创建和归档文件。要压缩归档文件,有两个选择:通过压缩程序(例如 `gzip`)运行归档文件,或在使用 `tar` 命令时使用压缩选项。最常见的压缩标志 `-z` 表示 `gzip`,`-j` 表示 `bzip`,`-J` 表示 `xz`。例如: -_$ gzip file.tar_ +``` +$ gzip file.tar +``` -或者,我们可以在使用 tar 命令时使用压缩标志,以下命令使用 gzip 标志 "z": +或者,我们可以在使用 `tar` 命令时使用压缩标志,以下命令使用 `gzip` 标志 `z`: -_$ tar -cvzf file.tar /some/directory_ +``` +$ tar -cvzf file.tar /some/directory +``` - * 如何一次创建多个目录和/或文件的归档? +#### 如何一次创建多个目录和/或文件的归档? 一次要归档多个文件,这种情况并不少见。一次归档多个文件和目录并不像你想的那么难,你只需要提供多个文件或目录作为 tar 的参数即可: -_$ tar -cvzf file.tar file1 file2 file3_ +``` +$ tar -cvzf file.tar file1 file2 file3 +``` 或者 -_$ tar -cvzf file.tar /some/directory1 /some/directory2_ +``` +$ tar -cvzf file.tar /some/directory1 /some/directory2 +``` - * 创建归档时如何跳过目录和/或文件? +#### 创建归档时如何跳过目录和/或文件? -你可能会遇到这样的情况:要归档一个目录或文件,但不是所有文件,这种情况下可以使用 --exclude 选项: +你可能会遇到这样的情况:要归档一个目录或文件,但不是所有文件,这种情况下可以使用 `--exclude` 选项: -_$ tar –exclude ‘/some/directory’ -cvf file.tar /home/user_ +``` +$ tar –exclude ‘/some/directory’ -cvf file.tar /home/user +``` -在示例中,/home/user 目录中除了 /some/directory 之外都将被归档。将 -exclude 选项放在源和目标之前,并用单引号将要排除的文件或目录引起来,这一点很重要。 +在示例中,`/home/user` 目录中除了 `/some/directory` 之外都将被归档。将 `--exclude` 选项放在源和目标之前,并用单引号将要排除的文件或目录引起来,这一点很重要。 ### 总结 -tar 命令对展示不需要的文件创建备份或压缩文件很有用。在更改文件之前备份它们是一个很好的做法。如果某些东西在更改后没有按预期正常工作,你始终可以还原到旧文件。压缩不再使用的文件有助于保持系统干净,并降低磁盘空间使用率。还有其它实用程序可以归档或压缩,但是 tar 因其多功能、易用性和受欢迎程度而独占鳌头。 +`tar` 命令对展示不需要的文件创建备份或压缩文件很有用。在更改文件之前备份它们是一个很好的做法。如果某些东西在更改后没有按预期正常工作,你始终可以还原到旧文件。压缩不再使用的文件有助于保持系统干净,并降低磁盘空间使用率。还有其它实用程序可以归档或压缩,但是 `tar` 因其多功能、易用性和受欢迎程度而独占鳌头。 ### 资源 @@ -157,15 +188,11 @@ tar 命令对展示不需要的文件创建备份或压缩文件很有用。在 * [Linux 系统管理指南 - 监控 Linux 的最佳实践][11] * [Linux 系统管理指南 - Linux 启动和关闭的最佳实践][12] - - ### 关于作者 -**Matt Zand** 是一位创业者,也是 3 家科技创业公司的创始人: [DC Web Makers][13]、[Coding Bootcamps][14] 和 [High School Technology Services][15]。他也是 [使用 Hyperledger Fabric 进行智能合约开发][16] 一书的主要作者。他为 Hyperledger、以太坊和 Corda R3 平台编写了 100 多篇关于区块链开发的技术文章和教程。在 DC Web Makers,他领导了一个区块链专家团队,负责咨询和部署企业去中心化应用程序。作为首席架构师,他为编码训练营设计和开发了区块链课程和培训项目。他拥有马里兰大学(University of Maryland)工商管理硕士学位。在区块链开发和咨询之前,他曾担任一些初创公司的高级网页和移动应用程序开发和顾问、天使投资人和业务顾问。你可以通过以下这个网址和他取得联系: 。 +**Matt Zand** 是一位创业者,也是 3 家科技创业公司的创始人: [DC Web Makers][13]、[Coding Bootcamps][14] 和 [High School Technology Services][15]。他也是 [使用 Hyperledger Fabric 进行智能合约开发][16] 一书的主要作者。他为 Hyperledger、以太坊和 Corda R3 平台编写了 100 多篇关于区块链开发的技术文章和教程。在 DC Web Makers,他领导了一个区块链专家团队,负责咨询和部署企业去中心化应用程序。作为首席架构师,他为编码训练营设计和开发了区块链课程和培训项目。他拥有马里兰大学工商管理硕士学位。在区块链开发和咨询之前,他曾担任一些初创公司的高级网页和移动应用程序开发和顾问、天使投资人和业务顾问。你可以通过以下这个网址和他取得联系: 。 -**Kevin Downs** 是 Red Hat 认证的系统管理员和 RHCSA。他目前在 IBM 担任系统管理员,负责管理数百台运行在不同 Linux 发行版上的服务器。他是[编码训练营][17]的首席 Linux 讲师,并且他会讲授 [5 个自己的课程][18]. - -本文首发在 [Linux 基础培训][20]上。 +**Kevin Downs** 是 Red Hat 认证的系统管理员和 RHCSA。他目前在 IBM 担任系统管理员,负责管理数百台运行在不同 Linux 发行版上的服务器。他是[编码训练营][17]的首席 Linux 讲师,并且他会讲授 [5 个自己的课程][18]。 -------------------------------------------------------------------------------- @@ -174,7 +201,7 @@ via: https://www.linux.com/news/how-to-create-and-manage-archive-files-in-linux- 作者:[LF Training][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 65f8a86a45e4058c42a50fc89a16d6c0ec8c39d0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 17 Feb 2021 12:22:46 +0800 Subject: [PATCH 347/381] PUB @MjSeven https://linux.cn/article-13126-1.html --- ...0210115 How to Create and Manage Archive Files in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210115 How to Create and Manage Archive Files in Linux.md (97%) diff --git a/translated/tech/20210115 How to Create and Manage Archive Files in Linux.md b/published/20210115 How to Create and Manage Archive Files in Linux.md similarity index 97% rename from translated/tech/20210115 How to Create and Manage Archive Files in Linux.md rename to published/20210115 How to Create and Manage Archive Files in Linux.md index 5f1f1e72a0..71118c25da 100644 --- a/translated/tech/20210115 How to Create and Manage Archive Files in Linux.md +++ b/published/20210115 How to Create and Manage Archive Files in Linux.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "MjSeven" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13126-1.html" [#]: subject: "How to Create and Manage Archive Files in Linux" [#]: via: "https://training.linuxfoundation.org/announcements/how-to-create-and-manage-archive-files-in-linux/" [#]: author: "Matt Zand,Kevin Downs https://training.linuxfoundation.org/announcements/how-to-create-and-manage-archive-files-in-linux/" From 1d73aada050649ea64a779a5df3c830774bf1fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Wed, 17 Feb 2021 21:00:56 +0800 Subject: [PATCH 348/381] translating by Chao-zhi --- ...w way to build cross-platform UIs for Linux ARM devices.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md b/sources/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md index 248d3a4dbc..32934b5831 100644 --- a/sources/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md +++ b/sources/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -152,7 +152,7 @@ via: https://opensource.com/article/20/5/linux-arm-ui 作者:[Bruno Muniz][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9b6c06250d6c20d690f9f36a306fe90ca041f413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Wed, 17 Feb 2021 21:46:26 +0800 Subject: [PATCH 349/381] translate done: 20200529 A new way to build cross-platform UIs for Linux ARM devices.md --- ...ross-platform UIs for Linux ARM devices.md | 182 ------------------ ...ross-platform UIs for Linux ARM devices.md | 178 +++++++++++++++++ 2 files changed, 178 insertions(+), 182 deletions(-) delete mode 100644 sources/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md create mode 100644 translated/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md diff --git a/sources/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md b/sources/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md deleted file mode 100644 index 32934b5831..0000000000 --- a/sources/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md +++ /dev/null @@ -1,182 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Chao-zhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (A new way to build cross-platform UIs for Linux ARM devices) -[#]: via: (https://opensource.com/article/20/5/linux-arm-ui) -[#]: author: (Bruno Muniz https://opensource.com/users/brunoamuniz) - -A new way to build cross-platform UIs for Linux ARM devices -====== -A proof of concept using AndroidXML and TotalCross provides an easier -way of creating UIs for Raspberry Pi and other devices. -![Digital images of a computer desktop][1] - -Creating a great user experience (UX) for your applications is a tough job, especially if you are developing embedded applications. Today, there are two types of graphical user interface (GUI) tools generally available for developing embedded software: either they involve complex technologies, or they are extremely expensive. - -However, we have created a proof of concept (PoC) for a new way to use existing, well-established tools to build user interfaces (UIs) for applications that run on desktop, mobile, embedded devices, and low-power Linux ARM devices. Our method uses Android Studio to draw the UI; [TotalCross][2] to render the Android XML on the device; a new [TotalCross API][3] called [KnowCode][4]; and a [Raspberry Pi 4][5] to execute the application. - -### Choosing Android Studio - -It's possible to build a responsive and beautiful UX for an application using the TotalCross API, but creating the UI in Android Studio shortens the time between prototyping and the real application. - -There are a lot of tools available to build UIs for applications, but [Android Studio][6] is the one developers worldwide use most often. In addition to its massive adoption, this tool is also super-intuitive to use, and it's really powerful for creating both simple and complex applications. The only drawback, in my opinion, is the computing power required to use the tool, which is way heavier than other integrated development environments (IDEs) like VSCode or its open source alternative, [VSCodium][7]. - -By thinking through these issues, we created a proof of concept using Android Studio to draw the UI and TotalCross to run the Android XML directly on the device. - -### Building the UI - -For our PoC, we wanted to create a home-appliance application to control temperature and other things and that would run on a Linux ARM device. - -![Home appliance application to control thermostat][8] - -(Bruno Muniz, [CC BY-SA 4.0][9]) - -We wanted to develop our application for a Raspberry Pi, so we used Android's [ConstraintLayout][10] to build a fixed-screen-size UI of 848x480 (the Raspberry Pi's resolution), but you can build responsive UIs with other layouts. - -Android XML adds a lot of flexibility for UI creation, making it easy to build rich user experiences for applications. In the XML below, we used two main components: [ImageView][11] and [TextView][12]. - - -``` -<ImageView -android:id="@+id/imageView6" -android:layout_width="273dp" -android:layout_height="291dp" -android:background="@drawable/Casa" -tools:layout_editor_absoluteX="109dp" -tools:layout_editor_absoluteY="95dp" /> -<TextView -android:id="@+id/insideTempEdit" -android:layout_width="94dp" -android:layout_height="92dp" -android:background="#F5F5F5" -android:text="20" -android:textAlignment="center" -android:gravity="center" -android:textColor="#000000" -android:textSize="67dp" -android:textStyle="bold" -tools:layout_editor_absoluteX="196dp" -tools:layout_editor_absoluteY="246dp" /> -``` - -The TextView elements are used to show some data to the user, like the temperature inside a building. Most ImageViews are used as buttons for user interaction with the UI, but they're also needed to implement the Events provided by the components on the screen. - -### Integrating with TotalCross - -The second technology in this PoC is TotalCross. We don't want to use anything from Android on the device because: - - 1. Our goal is to provide a great UI for Linux ARM. - 2. We want to achieve a low footprint on the device. - 3. We want the application to run on low-end hardware devices with low computing power (e.g., no GPU, low RAM, etc.). - - - -To begin, we created an empty TotalCross project using our [VSCode plugin][13]. Next, we saved a copy of the images inside the **drawable** folder and a copy of the Android XML file inside the **XML** folder—both are located inside the **Resources** folder: - -![Home Appliance file structure][14] - -(Bruno Muniz, [CC BY-SA 4.0][9]) - -To run the XML file using the TotalCross Simulator, we added a new TotalCross API called KnowCode and a MainWindow to load the XML. The code below uses the API to load and render the XML: - - -``` -public void initUI() { -    XmlScreenAbstractLayout xmlCont = XmlScreenFactory.create(“xml / homeApplianceXML.xml”); -    swap(xmlCont); -} -``` - -That's it! With only two commands, we can run an Android XML file using TotalCross. Here is how the XML performs on TotalCross' simulator: - -![TotalCross simulator running temperature application][15] - -(Bruno Muniz, [CC BY-SA 4.0][9]) - -There are two things remaining to finish this PoC: adding some events to provide user interaction and running it on a Raspberry Pi. - -### Adding events - -The KnowCode API provides a way to get an XML element by its ID (getControlByID) and change its behavior to do things like adding events, changing visibility, and more. - -For example, to enable users to change the temperature in their home or other building, we put plus and minus buttons on the bottom of the UI and a "click" event that increases or decreases the temperature one degree every time the buttons are clicked: - - -``` -[Button][16] plus = ([Button][16]) xmlCont.getControlByID("@+id/plus"); -[Label][17] insideTempLabel = ([Label][17]) xmlCont.getControlByID("@+id/insideTempLabel"); -plus.addPressListener(new PressListener() { -    @Override -    public void controlPressed(ControlEvent e) { -        try { -            [String][18] tempString = insideTempLabel.getText(); -            int temp; -            temp = Convert.toInt(tempString); -            insideTempLabel.setText(Convert.toString(++temp)); -        } catch (InvalidNumberException e1) { -            e1.printStackTrace(); -        } -    } -}); -``` - -### Testing on a Raspberry Pi 4 - -Finally, the last step! We ran the application on a device and checked the results. We just needed to package the application and deploy and run it on the target device. A [VNC][19] can also be used to check the application on the device. - -The entire application, including assets (images, etc.), Android XML, TotalCross, and the KnowCode API, is about 8MB on Linux ARM. - -Here's a demo of the application: - -![Application demo][20] - -(Bruno Muniz, [CC BY-SA 4.0][9]) - -In this example, the application was packaged only for Linux ARM, but the same app will run as a Linux desktop app, Android devices, Windows, Windows CE, and even iOS. - -All of the sample source code and the project are available in the [HomeApplianceXML GitHub][21] repository. - -### New possibilities with existing tools - -Creating GUIs for embedded applications doesn't need to be as hard as it is today. This proof of concept brings a new perspective on how to do this task easily—not only for embedded systems but for all major operating systems, all using the same code base. - -We are not aiming to create a new tool for designers or developers to build UI applications; our goal is to provide new possibilities for using the best tools that are already available. - -What's your opinion of this new way to build apps? Share your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/5/linux-arm-ui - -作者:[Bruno Muniz][a] -选题:[lujun9972][b] -译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/brunoamuniz -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_desk_home_laptop_browser.png?itok=Y3UVpY0l (Digital images of a computer desktop) -[2]: https://totalcross.com/ -[3]: https://yourapp.totalcross.com/knowcode-app -[4]: https://github.com/TotalCross/KnowCodeXML -[5]: https://www.raspberrypi.org/ -[6]: https://developer.android.com/studio -[7]: https://vscodium.com/ -[8]: https://opensource.com/sites/default/files/uploads/homeapplianceapp.png (Home appliance application to control thermostat) -[9]: https://creativecommons.org/licenses/by-sa/4.0/ -[10]: https://codelabs.developers.google.com/codelabs/constraint-layout/index.html#0 -[11]: https://developer.android.com/reference/android/widget/ImageView -[12]: https://developer.android.com/reference/android/widget/TextView -[13]: https://medium.com/totalcross-community/totalcross-plugin-for-vscode-4f45da146a0a -[14]: https://opensource.com/sites/default/files/uploads/homeappliancexml.png (Home Appliance file structure) -[15]: https://opensource.com/sites/default/files/uploads/totalcross-simulator_0.png (TotalCross simulator running temperature application) -[16]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+button -[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+label -[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string -[19]: https://tigervnc.org/ -[20]: https://opensource.com/sites/default/files/uploads/application.gif (Application demo) -[21]: https://github.com/TotalCross/HomeApplianceXML diff --git a/translated/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md b/translated/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md new file mode 100644 index 0000000000..c3ea802e4d --- /dev/null +++ b/translated/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md @@ -0,0 +1,178 @@ +[#]: collector: (lujun9972) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A new way to build cross-platform UIs for Linux ARM devices) +[#]: via: (https://opensource.com/article/20/5/linux-arm-ui) +[#]: author: (Bruno Muniz https://opensource.com/users/brunoamuniz) + +一种为 Linux ARM 设备构建跨平台 UI 的新方法 +====== +AndroidXML 和 TotalCross 的运用为 Raspberry Pi 和其他设备创建 UI 提供了更简单的方法。 +![Digital images of a computer desktop][1] + +为应用程序创建良好的用户体验 (user experience,UX) 是一项艰巨的任务,尤其是在开发嵌入式应用程序时。今天,有两种图形用户界面 (graphical user interface,GUI) 工具通常用于开发嵌入式软件:它们要么涉及复杂的技术,要么非常昂贵。 + +然而,我们已经创建了一个概念验证 (proof-of-concept,PoC),它提供了一种新的方法来使用现有的、成熟的工具为运行在桌面、移动、嵌入式设备和低功耗 ARM 设备上的应用程序构建用户界面 (UI)。我们的方法是使用 Android Studio 绘制 UI; 使用 [TotalCross][2] 在设备上呈现 Android XML; 采用被称为 [KnowCode][4] 的新 [TotalCross API][3]; 以及使用 [Raspberry Pi 4][5] 来执行应用程序。 + +### 选择 Android Studio + +可以使用 TotalCross API 为应用程序构建一个响应迅速且美观的用户体验,但是在 Android Studio 中创建 UI 缩短了原型制作和实际应用程序之间的时间。 + +有很多工具可以用来为应用程序构建 UI,但是 [Android Studio][6] 是全世界开发者最常使用的工具。除了它被大量采用以外,这个工具的使用也非常直观,而且它对于创建简单和复杂的应用程序都非常强大。在我看来,唯一的缺点是使用该工具所需的计算能力,它比其他集成开发环境 (IDE) 如 VSCode 或其开源替代方案 [VSCodium][7] 要庞大得多。 + +通过思考这些问题,我们创建了一个概念验证,使用 Android Studio 绘制 UI,并使用 TotalCross 直接在设备上运行 AndroidXML。 + +### 构建 UI + +对于我们的 PoC,我们想创建一个家用电器应用程序来控制温度和其他东西,并在 Linux ARM 设备上运行。 + +![Home appliance application to control thermostat][8] + +(Bruno Muniz,[CC BY-SA 4.0][9]) + +我们想为 Raspberry Pi 开发我们的应用程序,所以我们使用 Android 的 [ConstraintLayout][10] 来构建 848x480 (Raspberry Pi 的分辨率)的固定屏幕大小的 UI,不过您可以用其他布局构建响应性 UI。 + +Android XML 为 UI 创建增加了很多灵活性,使得为应用程序构建丰富的用户体验变得容易。在下面的 XML 中,我们使用了两个主要组件:[ImageView][11] 和 [TextView][12]。 + +``` +<ImageView +android:id="@+id/imageView6" +android:layout_width="273dp" +android:layout_height="291dp" +android:background="@drawable/Casa" +tools:layout_editor_absoluteX="109dp" +tools:layout_editor_absoluteY="95dp" /> +<TextView +android:id="@+id/insideTempEdit" +android:layout_width="94dp" +android:layout_height="92dp" +android:background="#F5F5F5" +android:text="20" +android:textAlignment="center" +android:gravity="center" +android:textColor="#000000" +android:textSize="67dp" +android:textStyle="bold" +tools:layout_editor_absoluteX="196dp" +tools:layout_editor_absoluteY="246dp" /> +``` + +TextView 元素用于向用户显示一些数据,比如建筑物内的温度。大多数 imageview 都用作用户与 UI 交互的按钮,但它们也需要实现屏幕上组件提供的事件。 + +### 用 TotalCross 整合 + +这个 PoC 中的第二项技术是 TotalCross。我们不想在设备上使用 Android 的任何东西,因为: + + 1。我们的目标是为 Linux ARM 提供一个出色的 UI。 + 2。我们希望在设备上实现低占地面积。 + 3。我们希望应用程序在低计算能力的低端硬件设备上运行(例如,没有 GPU、 低 RAM 等)。 + +首先,我们使用 [VSCode plugin][13] 创建了一个空的 TotalCross 项目。接下来,我们保存了 **drawable** 文件夹中的图像副本和 **XML** 文件夹中的 Android XML 文件副本,这两个文件夹都位于 **Resources** 文件夹中: + +![Home Appliance file structure][14] + +(Bruno Muniz,[CC BY-SA 4.0][9]) + +为了使用 TotalCross 模拟器运行 XML 文件,我们添加了一个名为 KnowCode 的新 TotalCross API 和一个主窗口来加载 XML。下面的代码使用 API 加载和呈现 XML: + + +``` +public void initUI() { +    XmlScreenAbstractLayout xmlCont = XmlScreenFactory.create(“xml / homeApplianceXML.xml”); +    swap(xmlCont); +} +``` + +就这样!只需两个命令,我们就可以使用 TotalCross 运行 Android XML 文件。以下是 XML 如何在 TotalCross 的模拟器上执行: + +![TotalCross simulator running temperature application][15] + +(Bruno Muniz,[CC BY-SA 4.0][9]) + +完成这个 PoC 还有两件事要做:添加一些事件来提供用户交互和在 Raspberry Pi 上运行它。 + +### 添加事件 + +KnowCode API 提供了一种通过 ID(getControlByID) 获取 XML 元素并更改其行为的方法,如添加事件、更改可见性等。 + +例如,为了使用户能够改变家中或其他建筑物的温度,我们在 UI 底部放置了加号和减号按钮,并在每次单击按钮时都会出现“单击”事件,使温度升高或降低一度: + + +``` +[Button][16] plus = ([Button][16]) xmlCont.getControlByID("@+id/plus"); +[Label][17] insideTempLabel = ([Label][17]) xmlCont.getControlByID("@+id/insideTempLabel"); +plus.addPressListener(new PressListener() { +    @Override +    public void controlPressed(ControlEvent e) { +        try { +            [String][18] tempString = insideTempLabel.getText(); +            int temp; +            temp = Convert.toInt(tempString); +            insideTempLabel.setText(Convert.toString(++temp)); +        } catch (InvalidNumberException e1) { +            e1.printStackTrace(); +        } +    } +}); +``` + +### 在树莓皮 4 上测试 + +最后一步!我们在一台设备上运行了应用程序并检查了结果。我们只需要打包应用程序并在目标设备上部署和运行它。[VNC][19] 也可用于检查设备上的应用程序。 + +整个应用程序,包括资源(图像等 )、AndroidXML、TotalCross 和 Knowcode API,在 Linux ARM 上大约是 8MB。 + +下面是应用程序的演示: + +![Application demo][20] + +(Bruno Muniz,[CC BY-SA 4.0][9]) + +在本例中,该应用程序仅为 Linux ARM 打包,但同一应用程序将作为 Linux 桌面应用程序 、Android 设备 、Windows、windows CE 甚至 IOS 运行。 + +所有示例源代码和项目都可以在 [HomeApplianceXML GitHub][21] 存储库中找到。 + +### 现有工具的新玩法 + +为嵌入式应用程序创建 GUI 并不需要像现在这样困难。这种概念证明为如何轻松地完成这项任务提供了新的视角,不仅适用于嵌入式系统,而且适用于所有主要的操作系统,所有这些系统都使用相同的代码库。 + +我们的目标不是为设计人员或开发人员创建一个新的工具来构建 UI 应用程序;我们的目标是为使用现有的最佳工具提供新的玩法。 + +你对这种新的应用程序开发方式有何看法?在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/linux-arm-ui + +作者:[Bruno Muniz][a] +选题:[lujun9972][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/brunoamuniz +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_desk_home_laptop_browser.png?itok=Y3UVpY0l (Digital images of a computer desktop) +[2]: https://totalcross.com/ +[3]: https://yourapp.totalcross.com/knowcode-app +[4]: https://github.com/TotalCross/KnowCodeXML +[5]: https://www.raspberrypi.org/ +[6]: https://developer.android.com/studio +[7]: https://vscodium.com/ +[8]: https://opensource.com/sites/default/files/uploads/homeapplianceapp.png (Home appliance application to control thermostat) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://codelabs.developers.google.com/codelabs/constraint-layout/index.html#0 +[11]: https://developer.android.com/reference/android/widget/ImageView +[12]: https://developer.android.com/reference/android/widget/TextView +[13]: https://medium.com/totalcross-community/totalcross-plugin-for-vscode-4f45da146a0a +[14]: https://opensource.com/sites/default/files/uploads/homeappliancexml.png (Home Appliance file structure) +[15]: https://opensource.com/sites/default/files/uploads/totalcross-simulator_0.png (TotalCross simulator running temperature application) +[16]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+button +[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+label +[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[19]: https://tigervnc.org/ +[20]: https://opensource.com/sites/default/files/uploads/application.gif (Application demo) +[21]: https://github.com/TotalCross/HomeApplianceXML From 9c635cca0eda5f15e02e1b83409d91abbdd3a496 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 18 Feb 2021 05:04:24 +0800 Subject: [PATCH 350/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210218=20?= =?UTF-8?q?What=20is=20PPA=20Purge=3F=20How=20to=20Use=20it=20in=20Ubuntu?= =?UTF-8?q?=20and=20other=20Debian-based=20Distributions=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210218 What is PPA Purge- How to Use it in Ubuntu and other Debian-based Distributions.md --- ...tu and other Debian-based Distributions.md | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 sources/tech/20210218 What is PPA Purge- How to Use it in Ubuntu and other Debian-based Distributions.md diff --git a/sources/tech/20210218 What is PPA Purge- How to Use it in Ubuntu and other Debian-based Distributions.md b/sources/tech/20210218 What is PPA Purge- How to Use it in Ubuntu and other Debian-based Distributions.md new file mode 100644 index 0000000000..2be48a8b15 --- /dev/null +++ b/sources/tech/20210218 What is PPA Purge- How to Use it in Ubuntu and other Debian-based Distributions.md @@ -0,0 +1,182 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is PPA Purge? How to Use it in Ubuntu and other Debian-based Distributions?) +[#]: via: (https://itsfoss.com/ppa-purge/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +What is PPA Purge? How to Use it in Ubuntu and other Debian-based Distributions? +====== + +PPA is a popular method of installing additional applications or newer versions of a software in Ubuntu. + +I have written a [detailed guide on PPA][1] so I will just quickly recall it here. PPA is a mechanism developed by Ubuntu to enable developers to provide their own repositories. When you add a PPA, you add additional repository to your system and thus you can download applications from this additional repository. + +``` +sudo add-apt-repository ppa:ppa-address +sudo apt update +sudo apt install package_from_ppa +``` + +I have also written about [deleting PPAs from your system][2]. I briefly mentioned the PPA Purge tool in that article. In this tutorial, you’ll get more detailed information about this handy utility. + +### What is PPA Purge? + +PPA Purge is a command line tool that disables a PPA repository from your software sources list. Apart from that, it reverts the system back to official Ubuntu packages. This is a different behavior than simply deleting the PPA repository. + +Suppose application ABC has version x available from Ubuntu repositories. You add a PPA that provides a higher version y of the same application/package ABC. When your Linux system finds that the same package is available from multiple sources, it uses the source that provides a newer version. + +In this example, you’ll have version y of application ABC installed thanks to the PPA you added. + +Normally, you would remove the application and then remove the PPA from sources list. But if you use ppa-purge to disable the said PPA, your application ABC will automatically revert to the older version x provided by Ubuntu repositories. + +Do you see the difference? Probably not. Let me explain it to you with real examples. + +#### Reverting applications to the official version provided by Ubuntu + +I heard that the [upcoming VLC 4.0 version has major UI overhaul][3]. I wanted to try it before it is officially released and so I used the [daily build PPA of VLC][4] to get the under-development version 4. + +Take a look at the screenshot below. I have added the VLC PPA (videolan/master-daily) and this PPA provides VLC version 4.0 release candidate (RC) version. Ubuntu repositories provide VLC version 3.0.11. + +![][5] + +If I use the ppa-purge command with the VLC daily build PPA, it disables the PPA and reverts the installed VLC version to 3.0.11 which is available from Ubuntu’s universal repository. + +![][6] + +You can see that it informs you that some packages are going to be downgraded. + +![][7] + +When the daily build VLC PPA is purged, the installed version reverts to what Ubuntu provides from its official repositories. + +![][8] + +You might think that VLC was downgraded because it was upgraded from version 3.0.11 to VLC 4.0 with the PPA. But here is a funny thing. Even if I had used the PPA to install VLC 4.0 RC version afresh (instead of upgrading it), it would still be downgraded instead of being removed from the system. + +Does it mean ppa-purge command cannot remove applications along with disabling the PPA? Not quite so. Let me show another example. + +#### PPA Purge impact on application only available from a PPA + +I recently stumbled across Plots, a [nifty tool for plotting mathematical graphs][9]. Since it is a new application, it is not available in Ubuntu repositories yet. I used [its PPA][10] to install it. + +If I use ppa-purge command on this PPA, it disables the PPA first and then looks to revert it to the original version. But there is no ‘original version’ in Ubuntu’s repositories. So, it proceeds to [uninstall the application from Ubuntu][11]. + +The entire process is depicted in the single picture below. Pointer 1 is for adding PPA, pointer 2 is for installing the application named plots. I have discarded the input for these two commands with [redirection in Linux][12]. + +You can see that when PPA Purge is used (pointer 3), it disables the PPA (pointer 4) and then proceeds to inform that the application plots will be removed (pointer 5). + +![][13] + +#### Deleting a PPA vs disabling it + +I have repeatedly used the term ‘disabling PPA’ with PPA Purge. There is a difference between disabling PPA and deleting it. + +When you add a PPA, it adds a new file in the /etc/apt/sources.list.d directory. This file has the URL of the repository. + +Disabling the PPA keeps this file but it is commented out the repository in the PPA’s file. Now this repository is not considered while updating or installing software. + +![][14] + +You can see disabled PPA repository in Software & Updates tool: + +![][15] + +When you delete a PPA, it means deleting the PPA’s file from etc/apt/sources.list.d directory. You won’t see it anywhere on the system. + +![PPA deleted][16] + +Why disable a PPA instead of deleting it? Because it is easier to re-enable it. You can do just check the box in Software & Updates tool or edit the PPA file and remove the leading # to uncomment the repository. + +#### Recap of what PPA Purge does + +If it was too much information, let me summarize the main points of what the ppa-purge script/tool does: + + * PPA Purge disables a given PPA but doesn’t delete it. + * If there was a new application (which is not available from any sources other than only the PPA) installed with the given PPA, it is uninstalled. + * If the PPA upgraded an already installed application, that application will be reverted to the version provided by the official Ubuntu repositories. + * If you used the PPA to install (not upgrade) a newer version of an application (which is also available from the official Ubuntu repository), using PPA Purge will downgrade the application version to the one available from Ubuntu repositories. + + + +### Using PPA Purge + +Alright! Enough explanation. You might be wondering how to use PPA Purge. + +You need to install ppa-purge tool first. Ensure that you have [universe repository enabled][17] already. + +``` +sudo apt install ppa-purge +``` + +As far using PPA Purge, you should provide the PPA name in a format similar to what you use for adding it: + +``` +sudo ppa-purge ppa:ppa-name +``` + +Here’s a real example: + +![][18] + +If you are not sure of the PPA name, [use the apt show command][19] to display the source repository of the package in question. + +``` +apt show vlc +``` + +![Finding PPA source URL][20] + +For example, the source for VLC PPA shows groovy/main. Out of this the terms after ppa.launchpad.net and before Ubuntu are part of PPA name. So here, you get the PPA name as videolan/master-daily. + +If you have to use to purge the PPA ‘videolan/master-daily’, you use it like this by adding `ppa:` before PPA name: + +``` +sudo ppa-purge ppa:videolan/master-daily +``` + +### Do you purge your PPAs? + +I wanted to keep this article short and crisp but it seems I went in a little bit of more detail.As long as you learn something new, you won’t mind the additional details, will you? + +PPA Purge is a nifty utility that allows you to test newer or beta versions of applications and then easily revert to the original version provided by the distribution. If a PPA has more than one application, it works on all of them. + +Of course, you can do all these stuff manually which is to disable the PPA, remove the application and install it again to get the version provided by the distribution. PPA Purge makes the job easier. + +Do you use ppa-purge already or will you start using it from now onwards? Did I miss some crucial information or do you still have some doubts on this topic? Please feel free to use the comment sections. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ppa-purge/ + +作者:[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/ppa-guide/ +[2]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/ +[3]: https://news.itsfoss.com/vlc-4-features/ +[4]: https://launchpad.net/~videolan/+archive/ubuntu/master-daily +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/vlc-ppa.png?resize=800%2C400&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/using-ppap-purge.png?resize=800%2C506&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/downgrade-packages-with-ppa-purge.png?resize=800%2C506&ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/package-reverted-ppa-purge.png?resize=800%2C405&ssl=1 +[9]: https://itsfoss.com/plots-graph-app/ +[10]: https://launchpad.net/~apandada1/+archive/ubuntu/plots/ +[11]: https://itsfoss.com/uninstall-programs-ubuntu/ +[12]: https://linuxhandbook.com/redirection-linux/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/ppa-purge-deleting-apps.png?resize=800%2C625&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/disabled-ppa.png?resize=800%2C295&ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/disabled-ppa-ubuntu.png?resize=800%2C398&ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/ppa-deleted.png?resize=800%2C271&ssl=1 +[17]: https://itsfoss.com/ubuntu-repositories/ +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/ppa-purge-example-800x379.png?resize=800%2C379&ssl=1 +[19]: https://itsfoss.com/apt-search-command/ +[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/apt-show-find-ppa-source.png?resize=800%2C341&ssl=1 From 460e96e4a37b13eeb58f8e452f5475d73a6a7c93 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 18 Feb 2021 05:04:42 +0800 Subject: [PATCH 351/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210217=20?= =?UTF-8?q?5=20reasons=20to=20use=20Linux=20package=20managers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210217 5 reasons to use Linux package managers.md --- ...5 reasons to use Linux package managers.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20210217 5 reasons to use Linux package managers.md diff --git a/sources/tech/20210217 5 reasons to use Linux package managers.md b/sources/tech/20210217 5 reasons to use Linux package managers.md new file mode 100644 index 0000000000..8f5a65c511 --- /dev/null +++ b/sources/tech/20210217 5 reasons to use Linux package managers.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 reasons to use Linux package managers) +[#]: via: (https://opensource.com/article/21/2/linux-package-management) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +5 reasons to use Linux package managers +====== +Package managers track all components of the software you install, +making updates, reinstalls, and troubleshooting much easier. +![Gift box opens with colors coming out][1] + +In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Today, I'll talk about software repositories + +Before I used Linux, I took the applications I had installed on my computer for granted. I would install applications as needed, and if I didn't end up using them, I'd forget about them, letting them languish as they took up space on my hard drive. Eventually, space on my drive would become scarce, and I'd end up frantically removing applications to make room for more important data. Inevitably, though, the applications would only free up so much space, and so I'd turn my attention to all of the other bits and pieces that got installed along with those apps, whether it was media assets or configuration files and documentation. It wasn't a great way to manage my computer. I knew that, but it didn't occur to me to imagine an alternative, because as they say, you don't know what you don't know. + +When I switched to Linux, I found that installing applications worked a little differently. On Linux, you were encouraged not to go out to websites for an application installer. Instead, you ran a command, and the application was installed on the system, with every individual file, library, configuration file, documentation, and asset recorded. + +### What is a software repository? + +The default method of installing applications on Linux is from a distribution software repository. That might sound like an app store, and that's because modern app stores have borrowed much from the concept of software repositories. [Linux has app stores, too][2], but software repositories are unique. You get an application from a software repository through a _package manager_, which enables your Linux system to record and track every component of what you've installed. + +Here are five reasons that knowing exactly what's on your system can be surprisingly useful. + +#### 1\. Removing old applications + +When your computer knows every file that was installed with any given application, it's really easy to uninstall files you no longer need. On Linux, there's no problem with installing [31 different text editors][3] only to later uninstall the 30 you don't love. When you uninstall on Linux, you really uninstall. + +#### 2\. Reinstall like you mean it + +Not only is an uninstall thorough, a _reinstall_ is meaningful. On many platforms, should something go wrong with an application, you're sometimes advised to reinstall it. Usually, nobody can say why you should reinstall an application. Still, there's often the vague suspicion that some file somewhere has become corrupt (in other words, data got written incorrectly), and so the hope is that a reinstall might overwrite the bad files and make things work again. It's not bad advice, but it's frustrating for any technician not to know what's gone wrong. Worse still, there's no guarantee, without careful tracking, that all files will be refreshed during a reinstall because there's often no way of knowing that all the files installed with an application were removed in the first place. With a package manager, you can force a complete removal of old files to ensure a fresh installation of new files. Just as significantly, you can account for every file and probably find out which one is causing problems, but that's a feature of open source and Linux rather than package management. + +#### 3\. Keep your applications updated + +Don't let anybody tell you that Linux is "more secure" than other operating systems. Computers are made of code, and we humans find ways to exploit that code in new and interesting ways every day. Because the vast majority of applications on Linux are open source, many exploits are filed publically as Common Vulnerability and Exposures (CVE). A flood of incoming security bug reports may seem like a bad thing, but this is definitely a case when _knowing_ is far better than _not knowing_. After all, just because nobody's told you that there's a problem doesn't mean that there's not a problem. Bug reports are good. They benefit everyone. And when developers fix security bugs, it's important for you to be able to get those fixes promptly, and preferably without having to remember to do it yourself. + +A package manager is designed to do exactly that. When applications receive updates, whether it's to patch a potential security problem or introduce an exciting new feature, your package manager application alerts you of the available update. + +#### 4\. Keep it light + +Say you have application A and application B, both of which require library C. On some operating systems, by getting A and B, you get two copies of C. That's obviously redundant, so imagine it happening several times per application. Redundant libraries add up quickly, and by having no single source of "truth" for a given library, it's nearly impossible to ensure you're using the most up-to-date or even just a consistent version of it. + +I admit I don't tend to sit around pondering software libraries all day, but I do remember the days when I did, even though I didn't know that's what was troubling me. Before I had switched to Linux, it wasn't uncommon for me to encounter errors when dealing with media files for work, or glitches when playing different video games, or quirks when reading a PDF, and so on. I spent a lot of time investigating these errors back then. I still remember learning that two major applications on my system each had bundled the same (but different) graphic backend technologies. The mismatch was causing errors when the output of one was imported into the other. It was meant to work, but because of a bug in an older version of the same collection of library files, a hotfix for one application didn't benefit the other. + +A package manager knows what backends (referred to as a _dependency_) are needed for each application and refrains from reinstalling software that's already on your system. + +#### 5\. Keep it simple + +As a Linux user, I appreciate a good package manager because it helps make my life simple. I don't have to think about the software I install, what I need to update, or whether something's really been uninstalled when I'm finished with it. I audition software without hesitation. And when I'm setting up a new computer, I run [a simple Ansible script][4] to automate the installation of the latest versions of all the software I rely upon. It's simple, smart, and uniquely liberating. + +### Better package management + +Linux takes a holistic view of applications and the operating system. After all, open source is built upon the work of other open source, so distribution maintainers understand the concept of a dependency _stack_. Package management on Linux has an awareness of your whole system, the libraries and support files on it, and the applications you install. These disparate parts work together to provide you with an efficient, optimized, and robust set of applications. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-package-management + +作者:[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_gift_giveaway_box_520x292.png?itok=w1YQhNH1 (Gift box opens with colors coming out) +[2]: http://flathub.org +[3]: https://opensource.com/article/21/1/text-editor-roundup +[4]: https://opensource.com/article/20/9/install-packages-ansible From 85aa092a5f6d6e3dd5f6b9c4a28b888d6de97579 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 18 Feb 2021 05:04:57 +0800 Subject: [PATCH 352/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210217=20?= =?UTF-8?q?Use=20this=20bootable=20USB=20drive=20on=20Linux=20to=20rescue?= =?UTF-8?q?=20Windows=20users?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210217 Use this bootable USB drive on Linux to rescue Windows users.md --- ... drive on Linux to rescue Windows users.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20210217 Use this bootable USB drive on Linux to rescue Windows users.md diff --git a/sources/tech/20210217 Use this bootable USB drive on Linux to rescue Windows users.md b/sources/tech/20210217 Use this bootable USB drive on Linux to rescue Windows users.md new file mode 100644 index 0000000000..22ddf703d9 --- /dev/null +++ b/sources/tech/20210217 Use this bootable USB drive on Linux to rescue Windows users.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use this bootable USB drive on Linux to rescue Windows users) +[#]: via: (https://opensource.com/article/21/2/linux-woeusb) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +Use this bootable USB drive on Linux to rescue Windows users +====== +WoeUSB makes Windows boot disks from Linux and help your friends unlock +their out-of-commission machines. +![Puzzle pieces coming together to form a computer screen][1] + +People regularly ask me to help them rescue Windows computers that have become locked or damaged. Sometimes, I can use a Linux USB boot drive to mount Windows partitions and then transfer and back up files from the damaged systems. + +Other times, clients lose their passwords or otherwise lock their login account credentials. One way to unlock an account is to create a Windows boot disk to repair the computer. Microsoft allows you to download copies of Windows from its website and offers tools to create a USB boot device. But to use them, you need a Windows computer, which means, as a Linux user, I need another way to create a boot DVD or USB drive. I have found it difficult to create Windows USBs on Linux. My reliable tools, like [Etcher.io][2], [Popsicle][3] (for Pop!_OS), and [UNetbootin][4], or using `dd` from the command line to create bootable media, have not been very successful. + +That is until I discovered [WoeUSB-ng][5], a [GPL 3.0][6] Linux tool that creates a bootable USB drive for Windows Vista, 7, 8, and 10. The open source software has two programs: a command-line utility and a graphical user interface (GUI) version. + +### Install WoeUSB-ng + +The GitHub repository contains instructions for [installing][7] WoeUSB-ng on Arch, Ubuntu, Fedora, or with pip3. + +If you're on a supported Linux operating system, you can install WoeUSB-ng using your package manager. Alternatively, you can use Python's package manager, [pip][8], to install the application. This is universal across any Linux distribution. There's no functional difference between these methods, so use whichever's familiar to you. + +I'm running Pop!_OS, which is an Ubuntu derivative, but being comfortable with Python, I chose the pip3 install: + + +``` +`$ sudo pip3 install WoeUSB-ng` +``` + +### Create a boot disk + +You can use WoeUSB-ng from the command line or the GUI version. + +To create a boot disk from the command line, the syntax requires the command, a path to your Windows ISO file (`/dev/sdX` in this example; use the `lsblk` command to determine your drive), and a device:  + + +``` +`$ sudo woeusb --device Windows.iso /dev/sdX` +``` + +You can also launch the program for an easy-to-use interface. In the WoeUSB-ng application window, find the Windows.iso file and select it. Choose your USB target device—the drive you want to make into a Windows boot drive. This will ERASE all information on this drive, so choose carefully—and then double-check (and triple-check) your choice! + +Once you're sure you have the right destination drive selected, click the **Install** button. + +![WoeUSB-ng UI][9] + +(Don Watkins, [CC BY-SA 4.0][10]) + +Creating media takes five to 10 minutes, depending on your Linux computer's processor, memory, USB port speed, etc. Be patient. + +Once the process is finished and verified, you have a functional Windows USB boot device to help someone repair their Windows computer. + +### Help others + +Open source is all about helping other people. Very often, you can help Windows users by using the Linux-based [System Rescue CD][11]. But sometimes, the only way to help is directly from Windows, and WoeUSB-ng is a great open source tool to make that possible. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-woeusb + +作者:[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/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) +[2]: https://etcher.io/ +[3]: https://github.com/pop-os/popsicle +[4]: https://github.com/unetbootin/unetbootin +[5]: https://github.com/WoeUSB/WoeUSB-ng +[6]: https://github.com/WoeUSB/WoeUSB-ng/blob/master/COPYING +[7]: https://github.com/WoeUSB/WoeUSB-ng#installation +[8]: https://opensource.com/downloads/pip-cheat-sheet +[9]: https://opensource.com/sites/default/files/uploads/woeusb-ng-gui.png (WoeUSB-ng UI) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ +[11]: https://www.system-rescue.org/ From 12b894266a3bf11ca56318246060050cac75b9c4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 18 Feb 2021 05:05:12 +0800 Subject: [PATCH 353/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210217=20?= =?UTF-8?q?4=20tech=20jobs=20for=20people=20who=20don't=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210217 4 tech jobs for people who don-t code.md --- ...7 4 tech jobs for people who don-t code.md | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 sources/tech/20210217 4 tech jobs for people who don-t code.md diff --git a/sources/tech/20210217 4 tech jobs for people who don-t code.md b/sources/tech/20210217 4 tech jobs for people who don-t code.md new file mode 100644 index 0000000000..63af4450e1 --- /dev/null +++ b/sources/tech/20210217 4 tech jobs for people who don-t code.md @@ -0,0 +1,144 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 tech jobs for people who don't code) +[#]: via: (https://opensource.com/article/21/2/non-engineering-jobs-tech) +[#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych) + +4 tech jobs for people who don't code +====== +There are many roles in tech for people who aren't engineers. Explore +some of them in part 2 of this series. +![Looking at a map][1] + +In the [first article in this series][2], I explained how the tech industry divides people and roles into "technical" or "non-technical" categories and the problems associated with this. The tech industry makes it difficult for people interested in tech—but not coding—to figure out where they fit in and what they can do. + +If you're interested in technology or open source but aren't interested in coding, there are roles available for you. Any of these positions at a tech company likely require somebody who is tech-savvy but does not necessarily write code. You do, however, need to know the terminology and understand the product. + +I've recently noticed the addition of the word "technical" onto job titles such as technical account manager, technical product manager, technical community manager, etc. This mirrors the trend a few years ago where the word "engineer" was tacked onto titles to indicate the role's technical needs. After a while, everybody has the word "engineer" in their title, and the classification loses some of its allure. + +As I sat down to write these articles, this tweet from Tim Banks appeared in my timeline: + +> Women who've made career changes into tech, but aren't developers (think like infosec, data science/analysts, infra engineers, etc), what are some things you'd wished you'd known, resources that were valuable, or advice you'd have for someone looking to make a similar change? +> +> — Tim Banks is a buttery biscuit (@elchefe) [December 15, 2020][3] + +This follows the advice in my first article: Tim does not simply ask about "non-technical roles"; he provides more significant context. On a medium like Twitter, where every character counts, those extra characters make a difference. These are _technical_ roles. Calling them non-technical to save characters in a tweet would have changed the impact and meaning. + +Here's a sampling of non-engineering roles in tech that require technical knowledge. + +### Technical writer + +A [technical writer's job][4] is to transfer factual information between two or more parties. Traditionally, a technical writer provides instructions or documentation on how to use a technology product. Recently, I've seen the term "technical writer" refer to people who write other forms of content. Tech companies want a person to write blog posts for their developer audience, and this skill is different from copywriting or content marketing. + +**Technical skills required:** + + * Writing + * User knowledge or experience with a specific technology + * The ability to quickly come up to speed on a new product or feature + * Skill in various authoring environments + + + +**Good for people who:** + + * Can plainly provide step-by-step instructions + * Enjoy collaborating + * Have a passion for the active voice and Oxford comma + * Enjoy describing the what and how + + + +### Product manager + +A [product manager][5] is responsible for leading a product's strategy. Responsibilities may include gathering and prioritizing customers' requirements, writing business cases, and training the sales force. Product managers work cross-functionally to successfully launch a product using a combination of creative and technical skills. Product managers require deep product expertise. + +**Technical skills required:** + + * Hands-on product knowledge and the ability to configure or run a demo + * Knowledge of the technological ecosystem related to the product + * Analytical and research skills + + + +**Good for people who:** + + * Enjoy strategizing and planning what comes next + * Can see a common thread in different people's needs + * Can articulate the business needs and requirements + * Enjoy describing the why + + + +### Data analyst + +Data analysts are responsible for collecting and interpreting data to help drive business decisions such as whether to enter a new market, what customers to target, or where to invest. The role requires knowing how to use all of the potential data available to make decisions. We tend to oversimplify things, and data analysis is often over-simplified. Getting the right information isn't as simple as writing a query to "select all limit 10" to get the top 10 rows. You need to know what tables to join. You need to know how to sort. You need to know whether the data needs to be cleaned up in some way before or after running the query. + +**Technical skills required:** + + * Knowledge of SQL, Python, and R + * Ability to see and extract patterns in data + * Understanding how things function end to end + * Critical thinking + * Machine learning + + + +**Good for people who:** + + * Enjoy problem-solving + * Desire to learn and ask questions + + + +### Developer relations + +[Developer relations][6] is a relatively new discipline in technology. It encompasses the roles of [developer advocate][7], developer evangelist, and developer marketing, among others. These roles require you to communicate with developers, build relationships with them, and help them be more productive. You advocate for the developers' needs to the company and represent the company to the developer. Developer relations can include writing articles, creating tutorials, recording podcasts, speaking at conferences, and creating integrations and demos. Some say you need to have worked as a developer to move into developer relations. I did not take that path, and I know many others who haven't. + +**Technical skills required:** + +These will be highly dependent on the company and the role. You will need some (not all) depending on your focus. + + * Understanding technical concepts related to the product + * Writing + * Video and audio editing for tutorials and podcasts + * Speaking + + + +**Good for people who:** + + * Have empathy and want to teach and empower others + * Can advocate for others + * Are creative + + + +### Endless possibilities + +This is not a comprehensive list of all the non-engineering roles available in tech, but a sampling of some of the roles available for people who don't enjoy writing code daily. If you're interested in a tech career, look at your skills and what roles would be a good fit. The possibilities are endless. To help you in your journey, in the final article in this series, I'll share some advice from people who are in these roles. + +There are lots of non-code ways to contribute to open source: Here are three alternatives. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/non-engineering-jobs-tech + +作者:[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/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) +[2]: https://opensource.com/article/21/2/what-does-it-mean-be-technical +[3]: https://twitter.com/elchefe/status/1338933320147750915?ref_src=twsrc%5Etfw +[4]: https://opensource.com/article/17/5/technical-writing-job-interview-tips +[5]: https://opensource.com/article/20/2/product-management-open-source-company +[6]: https://www.marythengvall.com/blog/2019/5/22/what-is-developer-relations-and-why-should-you-care +[7]: https://opensource.com/article/20/10/open-source-developer-advocates From 8f8ac66c6a6adf1adb86e6181c30dc82a76bf9ae Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 18 Feb 2021 05:05:26 +0800 Subject: [PATCH 354/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210216=20?= =?UTF-8?q?How=20to=20install=20Linux=20in=203=20steps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210216 How to install Linux in 3 steps.md --- ...0210216 How to install Linux in 3 steps.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 sources/tech/20210216 How to install Linux in 3 steps.md diff --git a/sources/tech/20210216 How to install Linux in 3 steps.md b/sources/tech/20210216 How to install Linux in 3 steps.md new file mode 100644 index 0000000000..fd860505c8 --- /dev/null +++ b/sources/tech/20210216 How to install Linux in 3 steps.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to install Linux in 3 steps) +[#]: via: (https://opensource.com/article/21/2/linux-installation) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +How to install Linux in 3 steps +====== +Operating system installations may seem mysterious, but they are +actually pretty straight forward. Here are the steps for a successful +Linux installation. +![bash logo on green background][1] + +In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Here's how to install Linux.  + +Installing an operating system (OS) is always daunting. It's something of a puzzle to most people: Installing an OS can't happen from inside the OS because it either hasn't been installed, or it's about to be replaced by a different one, so how does it happen? And worse yet, it usually involves confusing questions about hard drive formats, install destinations, time zones, user names, passwords, and a bunch of other stuff that you just don't normally think about. Linux distributions know this, and so they've worked diligently over the years to reduce the time you spend in the OS installer down to the absolute minimum. + +### What happens when you install + +Whether you're installing just an application or a whole operating system, the process of _installation_ is just a fancy way to copy files from one medium to another. Regardless of any user interface or animations used to disguise the procedure as something highly specialized, it all amounts to the same thing in the end: Files that were once stored on a disc or drive are copied to specific locations on your hard drive. + +When it's an application being installed, the valid locations for those files are highly restricted to your _file system_ or the part of your hard drive that your operating system knows it can use. This is significant because it's possible to partition a hard drive into separate spaces (Apple used this trick back in the early '00s for what they called "Bootcamp", allowing users to install both macOS and Windows onto a drive, but as separate entities). When you install an operating system, some special files are installed into places on your drive that are normally off-limits. More importantly, all existing data on your drive is, at least by default, erased to make room for the new system, so creating a backup is _essential_. + +### Installers + +Technically speaking, you don't actually _need_ an installer to install applications or even operating systems. Believe it or not, some people install Linux manually, by mounting a blank hard drive, compiling code, and copying files. This is accomplished with the help of a project called [Linux From Scratch (LFS)][2]. This project aims to help enthusiasts, students, and future OS designers to learn more about how computers work and what function each component performs. This isn't the recommended method of installing Linux, but you'll find that in open source, it's usually true that _if_ something can be done, then somebody's doing it. And it's a good thing, too, because these niche interests very often lead to surprisingly useful innovations. + +Assuming you're not trying to reverse engineer Linux, though, the normal way to install it is with an install disc or install image. + +### 3 easy steps to install Linux + +When you boot from a Linux install DVD or thumb drive, you're placed into a minimal operating environment designed to run one or more useful applications. The installer is the primary application, but because Linux is such a flexible system, you can usually also run standard desktop applications to get a feel for what the OS is like before you commit to installing it. + +Different Linux distributions have different installer interfaces. Here are two examples: + +Fedora Linux has a flexible installer (called **Anaconda**) capable of complex system configuration. + +![Anaconda installer screen on Fedora][3] + +The Anaconda installer on Fedora + +Elementary OS has a simple installer designed primarily for an install on a personal computer: + +![Elementary OS installer][4] + +Elementary OS installer + +#### 1\. Get an installer + +The first step toward installing Linux is to download an installer. You obtain a Linux install image from the distribution you've chosen to try. + + * [Fedora][5] is famous for being the first to update its software + * [Linux Mint][6] provides easy options to install missing drivers + * [Elementary][7] provides a beautiful desktop experience and several special, custom-built applications + + + +Linux installers are `.iso` files, which are "blueprints" for DVD media. You can burn the `.iso` file to a DVD-R if you still use optical media, or you can _flash_ it to a USB drive (make sure it's an empty USB drive, as all of its contents are erased when the image is flashed onto it). To flash an image to a USB drive, you can [use the open source Etcher application][8]. + +![Etcher used to flash a USB thumb drive][9] + +Etcher application can flash a USB thumb drive + +You're now ready to install Linux. + +#### 2\. Boot order + +To install an OS onto a computer, you must boot to the OS installer. This is not common behavior for a computer because it's so rarely done. In theory, you install an OS once, and then you update it. When you opt to install a different operating system onto a computer, you're interrupting that normal lifecycle. That's not a bad thing. It's your computer, so you have the authority to do re-image it. However, it's different from the default behavior of a computer, which is to boot to whatever operating system it finds on the hard drive immediately after being powered on. + +Before installing Linux, you must back up any data you have on your target computer because it will all be erased upon installation. + +Assuming you've saved your data to an external hard drive, which you've then secreted away to somewhere safe (and not attached to your computer), then you're ready to proceed. + +First, attach the USB drive containing your Linux installer to your computer. Power on the computer and watch the screen for some indication of how to interrupt its default boot sequence. This is usually a key like **F2**, **F8**, **Esc**, or even **Del**, but it varies depending on your motherboard manufacturer. If you miss your window of opportunity, just wait for the default OS to load, and then reboot and try again. + +When you interrupt the boot sequence, your computer prompts you for boot instructions. Specifically, the firmware embedded into the motherboard needs to know what drive to look to for an operating system it can load. In this case, you want the computer to boot from the USB drive containing the Linux image. How you're prompted for this information varies, depending on the motherboard manufacturer. Sometimes, it's a very direct question complete with a menu: + +![Boot device menu][10] + +The boot device selection menu + +Other times, you're taken into a rudimentary interface you can use to set the boot order. Computers are usually set by default to look to the internal hard drive first. Failing that, it moves on to a USB drive, a network drive, or an optical drive. You need to tell your computer to look for a USB drive _first_ so that it bypasses its own internal hard drive and instead boots the Linux image on your USB drive. + +![BIOS selection screen][11] + +BIOS selection screen + +This may seem daunting at first, but once you get familiar with the interface, it's a quick and easy task. You won't have to do this once Linux is installed because, after that, you'll want your computer to boot off the internal hard drive again. This is a great trick to get comfortable with, though, because it's the key to using Linux off of a thumb drive, testing a computer for Linux compatibility before installing, and general troubleshooting regardless of what OS is involved. + +Once you've selected your USB drive as the boot device, save your settings, let the computer reset, and boot to the Linux image. + +#### 3\. Install Linux + +Once you've booted into the Linux installer, it's just a matter of stepping through prompts. + +The Fedora installer, Anaconda, presents you a "menu" of all the things you can customize prior to installation. Most are set to sensible defaults and probably require no interaction from you, but others are marked with alert symbols to indicate that your configurations can't safely be guessed and so need to be set. These include the location of the hard drive you want the OS installed onto and the user name you want to use for your account. Until you resolve these issues, you can't proceed with the installation. + +For the hard drive location, you must know which drive you want to erase and re-image with your Linux distribution of choice. This might be an obvious choice on a laptop that has only one drive, to begin with: + +![Screen to select the installation drive][12] + +Select the drive to install the OS to (there's only one drive in this example) + +If you've got more than one drive in your computer, and you only want Linux on one of them, or else you want to treat both drives as one, then you must help the installer understand your goal. It's easiest to assign just one drive to Linux, letting the installer perform automatic partitioning and formatting, but there are plenty of other options for advanced users. + +Your computer must have at least one user, so create a user account for yourself. Once that's done, you can click the **Done** button at last and install Linux. + +![Anaconda options complete and ready for installation][13] + +Anaconda options are complete and you're ready to install + +Other installers can be even simpler, believe it or not, so your experience may differ from the images in this article. No matter what, the install process is one of the easiest operating system installations available outside of getting something pre-installed for you, so don't let the idea of installing an OS intimidate you. This is your computer. You can and should install an OS in which you have ownership. + +### Own your computer + +Ultimately, Linux is your OS. It's an operating system developed by people from all over the world, with one interest at heart: Create a computing culture of participation, mutual ownership, and co-operative stewardship. If you're interested in getting to know open source better, then take the step to know one of its shining examples and install Linux. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-installation + +作者:[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/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: http://www.linuxfromscratch.org +[3]: https://opensource.com/sites/default/files/anaconda-installer.png +[4]: https://opensource.com/sites/default/files/elementary-installer.png +[5]: http://getfedora.org +[6]: http://linuxmint.com +[7]: http://elementary.io +[8]: https://opensource.com/article/18/7/getting-started-etcherio +[9]: https://opensource.com/sites/default/files/etcher_0.png +[10]: https://opensource.com/sites/default/files/boot-menu.jpg +[11]: https://opensource.com/sites/default/files/bios_1.jpg +[12]: https://opensource.com/sites/default/files/install-harddrive-chooser.png +[13]: https://opensource.com/sites/default/files/anaconda-done.png From 48a86a51e7b0f7e6813c61b398c7a4af71961311 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 18 Feb 2021 05:05:40 +0800 Subject: [PATCH 355/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210216=20?= =?UTF-8?q?How=20Ansible=20got=20started=20and=20grew?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210216 How Ansible got started and grew.md --- ...210216 How Ansible got started and grew.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20210216 How Ansible got started and grew.md diff --git a/sources/tech/20210216 How Ansible got started and grew.md b/sources/tech/20210216 How Ansible got started and grew.md new file mode 100644 index 0000000000..baa71d6ea1 --- /dev/null +++ b/sources/tech/20210216 How Ansible got started and grew.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Ansible got started and grew) +[#]: via: (https://opensource.com/article/21/2/ansible-origin-story) +[#]: author: (Ben Rometsch https://opensource.com/users/flagsmith) + +How Ansible got started and grew +====== +Ansible's founder Michael DeHaan shares how his background led him to +develop the IT automation software. +![gears and lightbulb to represent innovation][1] + +Recently, Flagsmith founder Ben Rometsch [spoke to Michael DeHaan][2], founder of open source IT automation software Ansible (now part of IBM/Red Hat), on [The Craft of Open Source podcast][3] about how he developed Ansible and what he's been doing since. + +> "If people aren't successful trying (your app/tool) out in about 30 minutes, they're going to move on. You have to make somebody successful within their lunch hour. I spent a lot of time thinking about the documentation." +> —Michael DeHaan + +His remarks were fascinating and enlightening, especially for anyone interested in open source software as a developer, creator, or community member. Read on for a summary of the conversation. + +### How Michael started in open source + +When Michael joined Red Hat's emerging technologies team in 2005, it was the beginning of his journey with open source projects. The team gave him carte blanche to work on any projects he wanted, as long as they helped customers. + +At the time, Xen and KVM were becoming available, and the team wanted to create a good solution to automate a PXE bare-metal infrastructure. Michael created his first open source project, [Cobbler][4], to automate those installs, and it became fairly widely used. + +Func was Michael's next open source project. It came from filling in the gaps between software that enabled bare-metal provisioning and configuration management tools. Func became fairly well deployed, with Fedora using it in some of its infrastructure. Some of Func's concepts and ideas later influenced Ansible. + +### The birth of Ansible + +Ansible came after Michael spent a short spell working for Puppet. Afterward, he worked for another company that was trying to create an integration, but the job wasn't a good fit, and he wanted to return to working on a project in the open source community. + +Frustrated that it still took several days (or longer) to get a setup working due to [DNS][5] and [NTP][6] problems, Michael decided to create an open source solution to automate installations. The idea was to build something SSH- and push-based, without a load of management agents. + +[Ansible][7] was the result of this design goal. It provided an easy, quick solution, rather than spending hours or days using tools like Chef and Puppet. At the time, companies were employing full-time teams of people to manage cloud installations and configurations. Ansible provided a solution that one person could employ in less than one day. + +### Ansible: The right tool for the right time + +Part of Ansible's success was due to timing, Michael says. There was a demand for greater cloud integration and a quick, convenient way to upload content and install apps on cloud systems. + +It would be difficult for a full-time developer to have the time to create something like Ansible in today's world, as things are much more highly scheduled. He says people expect a complete product, not a work in progress with a supportive user community that has the time to experiment and play with a new coding language. Times have changed. + +Also, Ansible was released in 2012, when the demand for [automation was growing][8] more rapidly than now. While some companies have mastered the art of automation and are focusing more on Kubernetes and other things, others continue to discover it. Most companies do their own programming now, with teams of developers creating fully polished solutions. These days, people are using React and Kubernetes, which build on dependencies, rather than starting from scratch on an open source project. + +With Ansible, most of the open source work was in the libraries and the packaging. Michael remembers that they were learning as they went along, initially unsure of how to run a systems-management project in a way that gets lots of feedback from people and can evolve. Puppet and Chef provided a template for how to accomplish this, mostly through trial and error. Michael set up a large number of IRC channel conversations, which allowed direct communication with various use cases. + +Ansible's documentation was key for developers taking it to the next level. It was simple, to the point, used short and persuasive sentences, and included free trial offers. The documentation made it clear to users that Ansible could be run on their own infrastructure without security concerns. + +### Marketing and promotion + +The buzz around Ansible was generated mainly through blog posts, articles, tutorials, and opinions shared on social media. Occasionally, it would break through onto the pages of Hacker News, or a Reddit thread would become popular.  + +Michael focused on creating shareworthy content that people could link to. He also made sure that he read every comment and tweet to gain as much feedback as possible to take the project in the right direction. + +As momentum grew, Michael hired some employees to help him scale up, but he retained creative control and overall project management. When Michael left the Ansible team in 2015, there were around 400 modules, which made management pretty tricky. + +### Life after Ansible + +Michael now works mainly on Django and Python software development, with some apps and projects on the side, including the [WARP][9] music sequencer. + +To discover more about Ansible and Michael's views on today's open source landscape, burnout, GitHub, Google Reader, and much more, [check out the full podcast][2]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/ansible-origin-story + +作者:[Ben Rometsch][a] +选题:[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/flagsmith +[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://www.flagsmith.com/podcast/03-ansible +[3]: https://www.flagsmith.com/podcast +[4]: https://en.wikipedia.org/wiki/Cobbler_(software) +[5]: https://en.wikipedia.org/wiki/Domain_Name_System +[6]: https://en.wikipedia.org/wiki/Network_Time_Protocol +[7]: https://www.ansible.com/ +[8]: https://www.redhat.com/en/blog/new-report-finds-automation-paves-way-business-and-technical-benefits-alike +[9]: https://warpseq.com/ From 8f4fc16ed72cffdea6abc1264f954ca198f01bcb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 18 Feb 2021 05:05:54 +0800 Subject: [PATCH 356/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210216=20?= =?UTF-8?q?What=20does=20being=20'technical'=20mean=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210216 What does being -technical- mean.md --- ...210216 What does being -technical- mean.md | 177 ++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 sources/tech/20210216 What does being -technical- mean.md diff --git a/sources/tech/20210216 What does being -technical- mean.md b/sources/tech/20210216 What does being -technical- mean.md new file mode 100644 index 0000000000..c6ef69f293 --- /dev/null +++ b/sources/tech/20210216 What does being -technical- mean.md @@ -0,0 +1,177 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What does being 'technical' mean?) +[#]: via: (https://opensource.com/article/21/2/what-technical) +[#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych) + +What does being 'technical' mean? +====== +Dividing people into "technical" and "non-technical" labels harms people +and organizations. Learn why in part 1 of this series. +![question mark in chalk][1] + +The word "technical" describes many subjects and disciplines: _technical_ knock-out, _technical_ foul, _technical_ courses for rock-climbing competitions, and _technical_ scores for figure skating in sports. The popular cooking show _The Great British Bake-Off_ includes a _technical_ baking challenge. Anybody who has participated in the theatre may be familiar with _technical_ week, the week before the opening night of play or musical. + +As you can see, the word _technical_ does not apply strictly to software engineering and operations, so when we call a person or a role "technical," what do we mean, and why do we use the term? + +Over my 20-year career in tech, these questions have intrigued me, so I decided to explore this through a series of interviews. I am not an engineer, and I don't write code, yet this does not make me non-technical. But I'm regularly labeled such. I consider myself technical, and through this series, I hope you will come to understand why. + +I know I'm not alone in this. It is important to discuss because how a person or role is defined and viewed affects their confidence and ability to do their job well. If they feel crushed or disrespected, it will bring down their work quality and squash innovation and new ideas. It all trickles down, you see, so how can we improve this situation? + +I started by interviewing seven people across a variety of roles. + +In this series, I'll explore the meaning behind the word "technical," the technical continuum, the unintended side effects of categorizing people as technical or non-technical, and technical roles that are often considered non-technical. + +### Defining technical and non-technical + +To start, we need definitions. According to Dictionary.com, "technical" is an adjective with multiple meanings, including: + + * Belonging or pertaining to an art, science, or the like + * Skilled in or familiar in a practical way with a particular art or trade + * Technically demanding or difficult (typically used in sports or arts) + + + +The term "non-technical" is often used in tech companies to describe people in non-engineering roles. The definition of "non-technical" is "not relating to, characteristic of, or skilled in a particular field of activity and its terminology." + +As somebody who writes and speaks about technology, I consider myself technical. It is impossible to write or speak about a technical subject if you aren't familiar with the field and the terminology. With this understanding, everyone who works in tech is technical. + +### Why we assign labels + +So why does technical vs. non-technical matter in the technology field? What are we trying to achieve by assigning these labels? Is there a good reason, was there a good reason, and have we gotten away from those reasons and need to re-evaluate? Let's discuss. + +When I hear people talk about technical vs. non-technical people, I can't help but think of the Dr. Seuss story [_The Sneetches_][2]. Having a star (or not) was seen as something to aspire to. The Sneetches got into an infinite loop trying to achieve the right status. + +Labels can serve a purpose, but when they force a hierarchy of one group being viewed as better than another, they can become dangerous. Think about your organization or your department: Which group—sales, support, marketing, QA, engineering, etc.—is above or below another in importance? + +Even if it's not spoken directly or written somewhere, there is likely an understood hierarchy. These hierarchies often exist within disciplines, as well. Liz Harris, a technical content manager, says there are degrees of "technicalness" within the technical writing community. "Within technical writers, there's a hierarchy where the more technical you are, the more you get paid, and often the more you get listened to in the technical writing community." + +The term "technical" is often used to refer to the level of depth or expertise a person has on a subject. A salesperson may ask for a technical resource to help a customer. By working in tech, they are technical, but they need somebody with deeper expertise and knowledge about a subject than they have. So requesting a technical resource may be vague. Do you need a person with in-depth knowledge of the product? Do you need a person with knowledge of the infrastructure stack? Or somebody to write down steps on how to configure the API? + +Instead of viewing people as either technical or not, we need to start viewing technical ability as a continuum. What does this mean? Mary Thengvall, a director of developer relations, describes how she categorizes the varying depths of technical knowledge needed for a particular role. For instance, projects can require a developer, someone with a developer background, or someone tech-savvy. It's the people who fall into the tech-savvy category who often get labeled as non-technical. + +According to Mary, you're tech-savvy if "you can explain [a technical] topic, you know your way around the product, you know the basics of what to say and what not to say. You don't have to have a technical background, but you need to know the high-level technical information and then also who to point people to for more information." + +### The problem with labels + +When we're using labels to get specific about what we need to get a job done, they can be helpful, like "developer," "developer background," and "tech-savvy." But when we use labels too broadly, putting people into one of two groups can lead to a sense of "less than" and "better than." + +When a label becomes a reality, whether intended or not, we must look at ourselves and reassess our words, labels, and intentions. + +Senior product manager Leon Stigter offers his perspective: "As a collective industry, we are building more technology to make it easier for everyone to participate. If we say to everyone, 'you're not technical, or 'you are technical' and divide them into groups, people that are labeled as non-technical may never think, 'I can do this myself.' We actually need all those people to really think about where we are going as an industry, as a community, and I would almost say as human beings." + +#### Identity + +If we attach our identities to a label, what happens when we think that label no longer applies? When Adam Gordon Bell moved from being a developer to a manager, he struggled because he always identified as technical, and as a manager, those technical skills weren't being used. He felt he was no longer contributing value. Writing code does not provide more value than helping team members grow their careers or making sure a project is delivered on time. There is value in all roles because they are all needed to ensure the creation, execution, and delivery of goods and services. + +"I think that the reason I became a manager was that we had a very smart team and a lot of really skilled people on it, and we weren't always getting the most amazing work done. So the technical skills were not the limiting factor, right? And I think that often they're not," says Adam. + +Leon Stigter says that the ability to get people to work together and get amazing work done is a highly valued skill and should not be less valued than a technical role. + +#### Confidence + +[Impostor syndrome][3] is the inability to recognize your competence and knowledge, leading to reduced confidence and the ability to get your work done and done well. Impostor syndrome can kick in when you apply to speak at a conference, submit an article to a tech publication, or apply for a job. Impostor syndrome is the tiny voice that says: + + * "I'm not technical enough for this role." + * "I know more technical people that would do a better job delivering this talk." + * "I can't write for a technical publication like Opensource.com. I work in marketing." + + + +These voices can get louder the more often you label somebody or yourself as non-technical. This can easily result in not hearing new voices at conferences or losing talented people on your team. + +#### Stereotypes + +What image do you see when you think of somebody as technical? What are they wearing? What other characteristics do they have? Are they outgoing and talkative, or are they shy and quiet? + +Shailvi Wakhlu, a senior director of data, started her career as a software engineer and transitioned to data and analytics. "When I was working as a software engineer, a lot of people made assumptions about me not being very technical because I was very talkative, and apparently that automatically means you're not technical. They're like, 'Wait. You're not isolating in a corner. That means you're not technical,'" she reports. + +Our stereotypes of who is technical vs. non-technical can influence hiring decisions or whether our community is inclusive. You may also offend somebody—even a person you need help from. Years ago, I was working at the booth at a conference and asked somebody if I could help them. "I'm looking for the most technical person here," he responded. He then went off in search of an answer to his question. A few minutes later, the sales rep in the booth walked over to me with the gentleman and said, "Dawn, you're the best person to answer this man's question." + +#### Stigma + +Over time, we've inflated the importance of "technical" skills, which has led to the label "non-technical" being used in a derogatory way. As technology boomed, the value placed on people who code increased because that skill brought new products and ways of doing business to market and directly helped the bottom line. However, now we see people intentionally place technical roles above non-technical roles in ways that hinder their companies' growth and success. + +Interpersonal skills are often referred to as non-technical skills. Yet, there are highly technical aspects to them, like providing step-by-step instructions on how to complete a task or determining the most appropriate words to convey a message or a point. These skills also are often more important in determining your ability to be successful at work. + +**[Read next: [Goodbye soft skills, hello core skills: Why IT must rebrand this critical competency][4]]** + +Reading through articles and definitions on Urban Dictionary, it's no wonder people feel justified in their labeling and others develop impostor syndrome or feel like they've lost their identity. When performing a search online, Urban Dictionary definitions often appear in the top search results. The website started about 20 years ago as a crowdsourced dictionary defining slang, cultural expressions, and other terms, and it has turned into a site filled with hostile and negative definitions. + +Here are a few examples: Urban Dictionary defines a non-technical manager as "a person that does not know what the people they manage are meant to do." + +Articles that provide tips for how to talk to "non-technical" people include phrases like: + + * "If I struggled, how on earth did the non-technical people cope?" + * "Among today's career professionals, developers and engineers have some of the most impressive skill sets around, honed by years of tech training and real-world experience." + + + +These sentences imply that non-engineers are inferior, that their years of training and real-world experiences are somehow not as impressive. One person I spoke to for this project was Therese Eberhard. Her job is what many consider non-technical. She's a scenic painter. She paints props and scenery for film and theatre. Her job is to make sure props like Gandalf's cane appear lifelike rather than like a plastic toy. There's a lot of problem-solving and experimenting with chemical reactions required to be successful in this role. Therese honed these skills over years of real-world experience, and, to me, that's quite impressive. + +#### Gatekeeping + +Using labels erects barriers and can lead to gatekeeping to decide who can be let into our organization, our teams, our communities. + +According to Eddie Jaoude, an open source developer, "The titles 'technical,' 'developer,' or 'tester' create barriers or authority where it shouldn't be. And I've really come to the point of view where it's about adding value to the team or for the project—the title is irrelevant." + +If we view each person as a team member who should contribute value in one way or another, not on whether they write documentation or test cases or code, we will be placing importance based on what really matters and creating a team that gets amazing work done. If a test engineer wants to learn to write code or a coder wants to learn how to talk to people at events, why put up barriers to prevent that growth? Embrace team members' eagerness to learn and change and evolve in any direction that serves the team and the company's mission. + +If somebody is failing in a role, instead of writing them off as "not technical enough," examine what the problem really is. Did you need somebody skilled at JavaScript, and the person is an expert in a different programming language? It's not that they're not technical. There is a mismatch in skills and knowledge. You need the right people doing the right role. If you force somebody skilled at business analysis and writing acceptance criteria into a position where they have to write automated test cases, they'll fail. + +### How to retire the labels + +If you're ready to shift the way you think about the labels technical and non-technical, here are a few tips to get started. + +#### Find alternative words + +I asked everyone I interviewed what words we could use instead of technical and non-technical. No one had an answer! I think the challenge here is that we can't boil it down to a single word. To replace the terms, you need to use more words. As I wrote earlier, what we need to do is get more specific. + +How many times have you said or heard a phrase like: + + * "I'm looking for a technical resource for this project." + * "That candidate isn't technical enough." + * "Our software is designed for non-technical users." + + + +These uses of the words technical and non-technical are vague and don't convey their full meaning. A truer and more detailed look at what you need may result in: + + * "I'm looking for a person with in-depth knowledge of how to configure Kubernetes." + * "That candidate didn't have deep enough knowledge of Go." + * "Our software is designed for sales and marketing teams." + + + +#### Embrace a growth mindset + +Knowledge and skills are not innate. They are developed over hours or years of practice and experience. Thinking, "I'm just not technical enough" or "I can't learn how to do marketing" reflects a fixed mindset. You can learn technical abilities in any direction you want to grow. Make a list of your skills—ones you think of as technical and some as non-technical—but make them specific (like in the list above). + +#### Recognize everyone's contributions + +If you work in the tech industry, you're technical. Everyone has a part to play in a project's or company's success. Share the accolades with everyone who contributes, not only a select few. Recognize the product manager who suggested a new feature, not only the engineers who built it. Recognize the writer whose article went viral and generated new leads for your company. Recognize the data analyst who found new patterns in the data. + +### Next steps + +In the next article in this series, I'll explore non-engineering roles in tech that are often labeled "non-technical." + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/what-technical + +作者:[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/question-mark_chalkboard.jpg?itok=DaG4tje9 (question mark in chalk) +[2]: https://en.wikipedia.org/wiki/The_Sneetches_and_Other_Stories +[3]: https://opensource.com/business/15/9/tips-avoiding-impostor-syndrome +[4]: https://enterprisersproject.com/article/2019/8/why-soft-skills-core-to-IT From 572283f9013b86765da14a5ce44f548738db825e Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 18 Feb 2021 09:10:50 +0800 Subject: [PATCH 357/381] translated --- ... With A Focus on Privacy and Minimalism.md | 108 ------------------ ... With A Focus on Privacy and Minimalism.md | 108 ++++++++++++++++++ 2 files changed, 108 insertions(+), 108 deletions(-) delete mode 100644 sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md create mode 100644 translated/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md diff --git a/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md b/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md deleted file mode 100644 index 9fbc97ed85..0000000000 --- a/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md +++ /dev/null @@ -1,108 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Viper Browser: A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism) -[#]: via: (https://itsfoss.com/viper-browser/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Viper Browser: A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism -====== - -_**Brief: Viper Browser is a Qt-based browser that offers a simple user experience keeping privacy in mind.**_ - -While the majority of the popular browsers run on top of Chromium, unique alternatives like [Firefox][1], [Beaker Browser][2], and some other [chrome alternatives][3] should not cease to exist. - -Especially, considering Google’s recent potential thought of stripping [Google Chrome-specific features from Chromium][4] giving an excuse of abuse. - -In the look-out for more Chrome alternatives, I came across an interesting project “[Viper Browser][5]” as per our reader’s suggestion on [Mastodon][6]. - -### Viper Browser: An Open-Source Qt5-based Browser - -_**Note**: Viper Browser is fairly a new project with a couple of contributors. It lacks certain features which I’ll be mentioning as you read on._ - -![][7] - -Viper is an interesting web browser that focuses on being a powerful yet lightweight option while utilizing [QtWebEngine][8]. - -QtWebEngine borrows the code from Chromium but it does not include the binaries and services that connect to the Google platform. - -I spent some time using it and performing some daily browsing activities and I must say that I’m quite interested. Not just because it is something simple to use (how complicated a browser can be), but it also focuses on enhancing your privacy by giving you the option to add different Ad blocking options along with some useful options. - -![][9] - -Even though I think it is not meant for everyone, it is still worth taking a look. Let me highlight the features briefly before you can proceed trying it out. - -### Features of Viper Browser - -![][10] - -I’ll list some of the key features that you can find useful: - - * Ability to manage cookies - * Multiple preset options to choose different Adblocker networks - * Simple and easy to use - * Privacy-friendly default search engine – [Startpage][11] (you can change this) - * Ability to add user scripts - * Ability to add new user agents - * Option to disable JavaScript - * Ability to prevent images from loading up - - - -In addition to all these highlights, you can easily tweak the privacy settings to remove your history, clean cookies when existing, and some more options. - -![][12] - -### Installing Viper Browser on Linux - -It just offers an AppImage file on its [releases section][13] that you can utilize to test on any Linux distribution. - -In case you need help, you may refer to our guide on [using AppImage file on Linux][14] as well. If you’re curious, you can explore more about it on [GitHub][5]. - -[Viper Browser][5] - -### My Thoughts on Using Viper Browser - -I don’t think it is something that could replace your current browser immediately but if you are interested to test out new projects that are trying to offer Chrome alternatives, this is surely one of them. - -When I tried logging in my Google account, it prevented me by mentioning that it is potentially an insecure browser or unsupported browser. So, if you rely on your Google account, it is a disappointing news. - -However, other social media platforms work just fine along with YouTube (without signing in). Netflix is not something supported but overall the browsing experience is quite fast and usable. - -You can install user scripts, but Chrome extensions aren’t supported yet. Of course, it is either intentional or something to be looked after as the development progresses considering it as a privacy-friendly web browser. - -### Wrapping Up - -Considering that this is a less-known yet something interesting for some, do you have any suggestions for us to take a look at? An open-source project that deserves coverage? - -Let me know in the comments down below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/viper-browser/ - -作者:[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.mozilla.org/en-US/firefox/new/ -[2]: https://itsfoss.com/beaker-browser-1-release/ -[3]: https://itsfoss.com/open-source-browsers-linux/ -[4]: https://www.bleepingcomputer.com/news/google/google-to-kill-chrome-sync-feature-in-third-party-browsers/ -[5]: https://github.com/LeFroid/Viper-Browser -[6]: https://mastodon.social/web/accounts/199851 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-browser.png?resize=800%2C583&ssl=1 -[8]: https://wiki.qt.io/QtWebEngine -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-browser-setup.jpg?resize=793%2C600&ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-preferences.jpg?resize=800%2C660&ssl=1 -[11]: https://www.startpage.com -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-browser-tools.jpg?resize=800%2C262&ssl=1 -[13]: https://github.com/LeFroid/Viper-Browser/releases -[14]: https://itsfoss.com/use-appimage-linux/ diff --git a/translated/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md b/translated/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md new file mode 100644 index 0000000000..eda14eb676 --- /dev/null +++ b/translated/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Viper Browser: A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism) +[#]: via: (https://itsfoss.com/viper-browser/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Viper 浏览器:一款基于 Qt5 的轻量级浏览器,注重隐私和简约 +====== + +**简介:Viper 浏览器是一个基于 Qt 的浏览器,它提供了简单的用户体验,同时考虑到隐私问题。**_ + +虽然大多数流行的浏览器都运行在 Chromium 之上,但像 [Firefox][1]、[Beaker 浏览器][2]以及其他一些 [chrome 替代品][3]这样独特的替代品不应该停止存在。 + +尤其是考虑到谷歌最近可能想到从 Chromium 中剥离[谷歌浏览器特有的功能][4],并给出了滥用的借口。 + +在寻找更多的 Chrome 替代品时,我在 [Mastodon][6] 上看到了一个有趣的项目 “[Viper 浏览器][5]”。 + +### Viper 浏览器:一个基于 Qt5 的开源浏览器 + +_**注意**:Viper 浏览器是一个只有几个贡献者的相当新的项目。它缺乏某些功能,我将在下文提及。_ + +![][7] + +Viper 是一款有趣的网络浏览器,在利用 [QtWebEngine][8] 的同时,它专注于成为一个强大而又轻巧的选择。 + +QtWebEngine 借用了 Chromium 的代码,但它不包括连接到 Google 平台的二进制文件和服务。 + +我花了一些时间使用它并进行一些日常浏览活动,我必须说,我对它相当感兴趣。不仅仅是因为它是一个简单易用的东西(浏览器可以那么复杂),而且它还专注于增强你的隐私,为你提供添加不同的广告阻止选项以及一些有用的选项。 + +![][9] + +虽然我认为它并不是为所有人准备的,但还是值得一看的。在你继续尝试之前,让我简单介绍一下它的功能。 + +### Viper 浏览器的功能 + +![][10] + +我将列出一些你会发现有用的关键功能: + +* 管理 cookies 的能力 +* 多个预设选项以选择不同的广告屏蔽器网络。 +* 简单且易于使用 +* 隐私友好的默认搜索引擎 - [Startpage][11] (你可以更改) +* 能够添加用户脚本 +* 能够添加新的 user-agent +* 禁用 JavaScript 的选项 +* 能够阻止图像加载 + + + +除了这些亮点之外,你还可以轻松地调整隐私设置,以删除你的历史记录、清理已有 cookies,以及一些更多的选项。 + +![][12] + +### 在 Linux 上安装 Viper 浏览器 + +它只是在[发布页][13]提供了一个 AppImage 文件,你可以利用它在任何 Linux 发行版上进行测试。 + +如果你需要帮助,你也可以参考我们的[在 Linux 上使用 AppImage 文件][14]指南。如果你好奇,你可以在 [GitHub][5] 上探索更多关于它的内容。 + +[Viper 浏览器][5] + +### 我对使用 Viper 浏览器的看法 + +我不认为这是一个可以立即取代你当前浏览器的东西,但如果你有兴趣测试尝试提供 Chrome 替代品的新项目,这肯定是其中之一。 + +当我试图登录我的谷歌账户时,它阻止了我,说它可能是一个不安全的浏览器或不支持的浏览器。因此,如果你依赖你的谷歌帐户,这是一个令人失望的消息。 + +但是,其他社交媒体平台也可以与 YouTube 一起正常运行(无需登录)。不支持 Netflix,但总体上浏览体验是相当快速和可用的。 + +你可以安装用户脚本,但 Chrome 扩展还不支持。当然,这要么是有意为之,要么是在开发过程中特别考虑到它是一款隐私友好型的网络浏览器。 + +### 总结 + +考虑到这是一个鲜为人知但对某些人来说很有趣的东西,你对我们有什么建议吗? 是一个值得关注的开源项目么? + +请在下面的评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/viper-browser/ + +作者:[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.mozilla.org/en-US/firefox/new/ +[2]: https://itsfoss.com/beaker-browser-1-release/ +[3]: https://itsfoss.com/open-source-browsers-linux/ +[4]: https://www.bleepingcomputer.com/news/google/google-to-kill-chrome-sync-feature-in-third-party-browsers/ +[5]: https://github.com/LeFroid/Viper-Browser +[6]: https://mastodon.social/web/accounts/199851 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-browser.png?resize=800%2C583&ssl=1 +[8]: https://wiki.qt.io/QtWebEngine +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-browser-setup.jpg?resize=793%2C600&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-preferences.jpg?resize=800%2C660&ssl=1 +[11]: https://www.startpage.com +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-browser-tools.jpg?resize=800%2C262&ssl=1 +[13]: https://github.com/LeFroid/Viper-Browser/releases +[14]: https://itsfoss.com/use-appimage-linux/ From 7c38015bead9083f34f80d9e5ff0f2007bb2598e Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 18 Feb 2021 09:24:24 +0800 Subject: [PATCH 358/381] translating --- ...lots- A Mathematical Graph Plotting App for Linux Desktop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md b/sources/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md index b48cbde1e6..deb84d80ea 100644 --- a/sources/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md +++ b/sources/tech/20210216 Meet Plots- A Mathematical Graph Plotting App for Linux Desktop.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 47b9cc38dd5613520344ce16c92d2382f0607bec Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 18 Feb 2021 10:37:26 +0800 Subject: [PATCH 359/381] Rename sources/tech/20210216 What does being -technical- mean.md to sources/talk/20210216 What does being -technical- mean.md --- .../{tech => talk}/20210216 What does being -technical- mean.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210216 What does being -technical- mean.md (100%) diff --git a/sources/tech/20210216 What does being -technical- mean.md b/sources/talk/20210216 What does being -technical- mean.md similarity index 100% rename from sources/tech/20210216 What does being -technical- mean.md rename to sources/talk/20210216 What does being -technical- mean.md From 7c5f7626b80ae74c4953aa840797de91977fdb3e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 18 Feb 2021 10:42:20 +0800 Subject: [PATCH 360/381] Rename sources/tech/20210217 4 tech jobs for people who don-t code.md to sources/talk/20210217 4 tech jobs for people who don-t code.md --- .../20210217 4 tech jobs for people who don-t code.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210217 4 tech jobs for people who don-t code.md (100%) diff --git a/sources/tech/20210217 4 tech jobs for people who don-t code.md b/sources/talk/20210217 4 tech jobs for people who don-t code.md similarity index 100% rename from sources/tech/20210217 4 tech jobs for people who don-t code.md rename to sources/talk/20210217 4 tech jobs for people who don-t code.md From 44953c67f5e9b906195083378f367a180d2392ff Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 18 Feb 2021 11:35:27 +0800 Subject: [PATCH 361/381] Rename sources/tech/20210216 How Ansible got started and grew.md to sources/talk/20210216 How Ansible got started and grew.md --- .../{tech => talk}/20210216 How Ansible got started and grew.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210216 How Ansible got started and grew.md (100%) diff --git a/sources/tech/20210216 How Ansible got started and grew.md b/sources/talk/20210216 How Ansible got started and grew.md similarity index 100% rename from sources/tech/20210216 How Ansible got started and grew.md rename to sources/talk/20210216 How Ansible got started and grew.md From f43828596a30a890c3c1ca09e4814a418fe54812 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 18 Feb 2021 12:38:43 +0800 Subject: [PATCH 362/381] PRF @Chao-zhi --- ...ross-platform UIs for Linux ARM devices.md | 82 +++++++++---------- 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/translated/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md b/translated/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md index c3ea802e4d..6d6ad1db92 100644 --- a/translated/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md +++ b/translated/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (A new way to build cross-platform UIs for Linux ARM devices) @@ -9,18 +9,20 @@ 一种为 Linux ARM 设备构建跨平台 UI 的新方法 ====== -AndroidXML 和 TotalCross 的运用为 Raspberry Pi 和其他设备创建 UI 提供了更简单的方法。 -![Digital images of a computer desktop][1] -为应用程序创建良好的用户体验 (user experience,UX) 是一项艰巨的任务,尤其是在开发嵌入式应用程序时。今天,有两种图形用户界面 (graphical user interface,GUI) 工具通常用于开发嵌入式软件:它们要么涉及复杂的技术,要么非常昂贵。 +> AndroidXML 和 TotalCross 的运用为树莓派和其他设备创建 UI 提供了更简单的方法。 -然而,我们已经创建了一个概念验证 (proof-of-concept,PoC),它提供了一种新的方法来使用现有的、成熟的工具为运行在桌面、移动、嵌入式设备和低功耗 ARM 设备上的应用程序构建用户界面 (UI)。我们的方法是使用 Android Studio 绘制 UI; 使用 [TotalCross][2] 在设备上呈现 Android XML; 采用被称为 [KnowCode][4] 的新 [TotalCross API][3]; 以及使用 [Raspberry Pi 4][5] 来执行应用程序。 +![](https://img.linux.net.cn/data/attachment/album/202102/18/123715oomfuuz94ioi41ii.jpg) + +为应用程序创建良好的用户体验(UX)是一项艰巨的任务,尤其是在开发嵌入式应用程序时。今天,有两种图形用户界面(GUI)工具通常用于开发嵌入式软件:它们要么涉及复杂的技术,要么非常昂贵。 + +然而,我们已经创建了一个概念验证(PoC),它提供了一种新的方法来使用现有的、成熟的工具为运行在桌面、移动、嵌入式设备和低功耗 ARM 设备上的应用程序构建用户界面(UI)。我们的方法是使用 Android Studio 绘制 UI;使用 [TotalCross][2] 在设备上呈现 Android XML;采用被称为 [KnowCode][4] 的新 [TotalCross API][3];以及使用 [树莓派 4][5] 来执行应用程序。 ### 选择 Android Studio -可以使用 TotalCross API 为应用程序构建一个响应迅速且美观的用户体验,但是在 Android Studio 中创建 UI 缩短了原型制作和实际应用程序之间的时间。 +可以使用 TotalCross API 为应用程序构建一个美观的响应式用户体验,但是在 Android Studio 中创建 UI 缩短了制作原型和实际应用程序之间的时间。 -有很多工具可以用来为应用程序构建 UI,但是 [Android Studio][6] 是全世界开发者最常使用的工具。除了它被大量采用以外,这个工具的使用也非常直观,而且它对于创建简单和复杂的应用程序都非常强大。在我看来,唯一的缺点是使用该工具所需的计算能力,它比其他集成开发环境 (IDE) 如 VSCode 或其开源替代方案 [VSCodium][7] 要庞大得多。 +有很多工具可以用来为应用程序构建 UI,但是 [Android Studio][6] 是全世界开发者最常使用的工具。除了它被大量采用以外,这个工具的使用也非常直观,而且它对于创建简单和复杂的应用程序都非常强大。在我看来,唯一的缺点是使用该工具所需的计算机性能,它比其他集成开发环境 (IDE) 如 VSCode 或其开源替代方案 [VSCodium][7] 要庞大得多。 通过思考这些问题,我们创建了一个概念验证,使用 Android Studio 绘制 UI,并使用 TotalCross 直接在设备上运行 AndroidXML。 @@ -30,21 +32,19 @@ AndroidXML 和 TotalCross 的运用为 Raspberry Pi 和其他设备创建 UI 提 ![Home appliance application to control thermostat][8] -(Bruno Muniz,[CC BY-SA 4.0][9]) - -我们想为 Raspberry Pi 开发我们的应用程序,所以我们使用 Android 的 [ConstraintLayout][10] 来构建 848x480 (Raspberry Pi 的分辨率)的固定屏幕大小的 UI,不过您可以用其他布局构建响应性 UI。 +我们想为树莓派开发我们的应用程序,所以我们使用 Android 的 [ConstraintLayout][10] 来构建 848x480(树莓派的分辨率)的固定屏幕大小的 UI,不过你可以用其他布局构建响应性 UI。 Android XML 为 UI 创建增加了很多灵活性,使得为应用程序构建丰富的用户体验变得容易。在下面的 XML 中,我们使用了两个主要组件:[ImageView][11] 和 [TextView][12]。 ``` -<ImageView + + ``` -TextView 元素用于向用户显示一些数据,比如建筑物内的温度。大多数 imageview 都用作用户与 UI 交互的按钮,但它们也需要实现屏幕上组件提供的事件。 +TextView 元素用于向用户显示一些数据,比如建筑物内的温度。大多数 ImageView 都用作用户与 UI 交互的按钮,但它们也需要实现屏幕上组件提供的事件。 ### 用 TotalCross 整合 这个 PoC 中的第二项技术是 TotalCross。我们不想在设备上使用 Android 的任何东西,因为: 1。我们的目标是为 Linux ARM 提供一个出色的 UI。 - 2。我们希望在设备上实现低占地面积。 + 2。我们希望在设备上实现低占用。 3。我们希望应用程序在低计算能力的低端硬件设备上运行(例如,没有 GPU、 低 RAM 等)。 -首先,我们使用 [VSCode plugin][13] 创建了一个空的 TotalCross 项目。接下来,我们保存了 **drawable** 文件夹中的图像副本和 **XML** 文件夹中的 Android XML 文件副本,这两个文件夹都位于 **Resources** 文件夹中: +首先,我们使用 [VSCode 插件][13] 创建了一个空的 TotalCross 项目。接下来,我们保存了 `drawable` 文件夹中的图像副本和 `xml` 文件夹中的 Android XML 文件副本,这两个文件夹都位于 `resources` 文件夹中: ![Home Appliance file structure][14] -(Bruno Muniz,[CC BY-SA 4.0][9]) - 为了使用 TotalCross 模拟器运行 XML 文件,我们添加了一个名为 KnowCode 的新 TotalCross API 和一个主窗口来加载 XML。下面的代码使用 API 加载和呈现 XML: - ``` public void initUI() { -    XmlScreenAbstractLayout xmlCont = XmlScreenFactory.create(“xml / homeApplianceXML.xml”); +    XmlScreenAbstractLayout xmlCont = XmlScreenFactory.create("xml / homeApplianceXML.xml");     swap(xmlCont); } ``` @@ -89,48 +86,43 @@ public void initUI() { ![TotalCross simulator running temperature application][15] -(Bruno Muniz,[CC BY-SA 4.0][9]) - -完成这个 PoC 还有两件事要做:添加一些事件来提供用户交互和在 Raspberry Pi 上运行它。 +完成这个 PoC 还有两件事要做:添加一些事件来提供用户交互,并在树莓派上运行它。 ### 添加事件 -KnowCode API 提供了一种通过 ID(getControlByID) 获取 XML 元素并更改其行为的方法,如添加事件、更改可见性等。 +KnowCode API 提供了一种通过 ID(`getControlByID`) 获取 XML 元素并更改其行为的方法,如添加事件、更改可见性等。 例如,为了使用户能够改变家中或其他建筑物的温度,我们在 UI 底部放置了加号和减号按钮,并在每次单击按钮时都会出现“单击”事件,使温度升高或降低一度: - ``` -[Button][16] plus = ([Button][16]) xmlCont.getControlByID("@+id/plus"); -[Label][17] insideTempLabel = ([Label][17]) xmlCont.getControlByID("@+id/insideTempLabel"); +Button plus = (Button) xmlCont.getControlByID("@+id/plus"); +Label insideTempLabel = (Label) xmlCont.getControlByID("@+id/insideTempLabel"); plus.addPressListener(new PressListener() { -    @Override -    public void controlPressed(ControlEvent e) { -        try { -            [String][18] tempString = insideTempLabel.getText(); -            int temp; -            temp = Convert.toInt(tempString); -            insideTempLabel.setText(Convert.toString(++temp)); -        } catch (InvalidNumberException e1) { -            e1.printStackTrace(); -        } -    } + @Override + public void controlPressed(ControlEvent e) { + try { + String tempString = insideTempLabel.getText(); + int temp; + temp = Convert.toInt(tempString); + insideTempLabel.setText(Convert.toString(++temp)); + } catch (InvalidNumberException e1) { + e1.printStackTrace(); + } + } }); ``` -### 在树莓皮 4 上测试 +### 在树莓派 4 上测试 最后一步!我们在一台设备上运行了应用程序并检查了结果。我们只需要打包应用程序并在目标设备上部署和运行它。[VNC][19] 也可用于检查设备上的应用程序。 -整个应用程序,包括资源(图像等 )、AndroidXML、TotalCross 和 Knowcode API,在 Linux ARM 上大约是 8MB。 +整个应用程序,包括资源(图像等)、Android XML、TotalCross 和 Knowcode API,在 Linux ARM 上大约是 8MB。 下面是应用程序的演示: ![Application demo][20] -(Bruno Muniz,[CC BY-SA 4.0][9]) - -在本例中,该应用程序仅为 Linux ARM 打包,但同一应用程序将作为 Linux 桌面应用程序 、Android 设备 、Windows、windows CE 甚至 IOS 运行。 +在本例中,该应用程序仅为 Linux ARM 打包,但同一应用程序可以作为 Linux 桌面应用程序运行,在Android 设备 、Windows、windows CE 甚至 iOS 上运行。 所有示例源代码和项目都可以在 [HomeApplianceXML GitHub][21] 存储库中找到。 @@ -149,7 +141,7 @@ via: https://opensource.com/article/20/5/linux-arm-ui 作者:[Bruno Muniz][a] 选题:[lujun9972][b] 译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 76faa8eeb8d1c1b4e31e6b607cb0c8f4d6bccae4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 18 Feb 2021 12:39:17 +0800 Subject: [PATCH 363/381] PUB @Chao-zhi https://linux.cn/article-13129-1.html --- ...w way to build cross-platform UIs for Linux ARM devices.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200529 A new way to build cross-platform UIs for Linux ARM devices.md (99%) diff --git a/translated/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md b/published/20200529 A new way to build cross-platform UIs for Linux ARM devices.md similarity index 99% rename from translated/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md rename to published/20200529 A new way to build cross-platform UIs for Linux ARM devices.md index 6d6ad1db92..9a742f2eb2 100644 --- a/translated/tech/20200529 A new way to build cross-platform UIs for Linux ARM devices.md +++ b/published/20200529 A new way to build cross-platform UIs for Linux ARM devices.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13129-1.html) [#]: subject: (A new way to build cross-platform UIs for Linux ARM devices) [#]: via: (https://opensource.com/article/20/5/linux-arm-ui) [#]: author: (Bruno Muniz https://opensource.com/users/brunoamuniz) From acf01f6230a5b232d8bbd8175eb5ee5d6205d1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Thu, 18 Feb 2021 15:38:35 +0800 Subject: [PATCH 364/381] translating by Chao-zhi --- sources/tech/20200629 LaTeX typesetting part 2 (tables).md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200629 LaTeX typesetting part 2 (tables).md b/sources/tech/20200629 LaTeX typesetting part 2 (tables).md index 030f3be01a..e7e53604cb 100644 --- a/sources/tech/20200629 LaTeX typesetting part 2 (tables).md +++ b/sources/tech/20200629 LaTeX typesetting part 2 (tables).md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -390,7 +390,7 @@ via: https://fedoramagazine.org/latex-typesetting-part-2-tables/ 作者:[Earl Ramirez][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cc70863a39f9661bb4baf0a20fc0a174e4d46aef Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 18 Feb 2021 16:18:27 +0800 Subject: [PATCH 365/381] PRF @XYenChi --- ...2 When the web grew up- A browser story.md | 54 +++++++++---------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/translated/talk/20190312 When the web grew up- A browser story.md b/translated/talk/20190312 When the web grew up- A browser story.md index 002e14c692..4d63bd68bb 100644 --- a/translated/talk/20190312 When the web grew up- A browser story.md +++ b/translated/talk/20190312 When the web grew up- A browser story.md @@ -1,53 +1,47 @@ [#]: collector: (lujun9972) -[#]: translator: (XYenChi ) -[#]: reviewer: ( ) +[#]: translator: (XYenChi) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (When the web grew up: A browser story) [#]: via: (https://opensource.com/article/19/3/when-web-grew) [#]: author: (Mike Bursell https://opensource.com/users/mikecamel) -web 的诞生:浏览器的故事 +Web 的成长,就是一篇浏览器的故事 ====== -互联网诞生之处的个人故事。 -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_Internet_Sign.png?itok=5MFGKs14) +> 互联网诞生之时我的个人故事。 -最近,我[分享了][1] 1994年获得英文文学和神学学位离开大学,在一个人们还不知道 web 服务器是什么的地方,成功找到一份运维 web 服务器的工作。但那“地方”,并不仅仅指的是我工作的组织,而是泛指所有地方。Web 那时当真是全新的——人们还正尝试理出头绪。 +![](https://img.linux.net.cn/data/attachment/album/202102/18/161753qb8tytkc6bnxbavn.jpg) -那并不是在暗示我在什么地方工作——学术出版社,也不是强调得到工作。这是个大部分人还在用 28k8 猫访问网页的世界。我记得我拿到 33k6 猫时有多激动。至少上下行速率不对称的日子过去了,以前带宽显示 1200/300 特别常见。这意味着(端同一家饭碗的)列印人员创作的设计复杂,色彩缤纷,纤毫毕现的档是完全不可能出现在 Web 上的。我不可能让大于 40k 的GIF 出现在网站的首页推送给访问的人。大于大约 60k 的会作为独立的图片,缩略图链接到参照页。 +最近,我和大家 [分享了][1] 我在 1994 年获得英国文学和神学学位离开大学后,如何在一个人们还不知道 Web 服务器是什么的世界里成功找到一份运维 Web 服务器的工作。我说的“世界”,并不仅仅指的是我工作的机构,而是泛指所有地方。Web 那时当真是全新的 —— 人们还正尝试理出头绪。 -且不说商城部分不像现在这样。更糟的是布局问题。“如何布局文档取决于浏览器,”我一遍又一遍地解释,“你可以使用眉头词或者段落,但是文档在页面上如何显示并不取决于文档,而是取决于渲染器!”他们想控制,想要不同颜色的背景。后来明白了那些不能实现。我参与了我觉得层叠样式表(CSS)的想法第一次被讨论的 W3C 会议,并进行了激烈地争论。写文档的人控制布局的建议令人讨厌。后来 CSS 被采用了,与此同时,在意安全问题的人采用了可移植文件格式(PDF)。 +那并不是说我工作的地方(一家学术出版社)特别“懂” Web。这是个大部分人还在用 28.8K 猫(调制解调器,俗称“猫”)访问网页的世界。我还记得我拿到 33.6K 猫时有多激动。至少上下行速率不对称的日子已经过去了,[^1] 以前 1200/300 的带宽描述特别常见。这意味着(在同一家机构的)印刷人员制作的设计复杂、色彩缤纷、纤毫毕现的文档是完全不可能放在 Web 上的。我不能允许在网站的首页出现大于 40k 的 GIF 图片,这对我们的许多访问者来说是很难接受的。大于大约 60k 图片的会作为独立的图片,以缩略图链接过去。 -如何渲染文档不是唯一的问题。作为一个实体书出版社,网页展示和商城部分的所有点都要关注,让消费者,或者潜在消费者知道一本书是关于什么的和预计需要花费多少钱。但这有一个问题,你看,互联网——包括快速发展的万维网——是开放的,所有都免费的自由之地没有人会在意钱;事实上,谈钱曾是被禁止的。 +如果说市场部只有这一点不喜欢,那是绝对是轻描淡写了。更糟的是布局问题。“浏览器决定如何布局文档,”我一遍又一遍地解释,“你可以使用标题或者段落,但是文档在页面上如何呈现并不取决于文档,而是取决于渲染器!”他们想控制这些,想要不同颜色的背景。后来明白了那些不能实现。我觉得我就像是参加了第一次讨论层叠样式表(CSS)的 W3C 会议,并进行了激烈地争论。关于文档编写者应控制布局的建议真令人厌恶。[^2] CSS 花了一些时间才被人们采用,与此同时,关心这些问题的人搭上了 PDF 这种到处都是安全问题的列车。 -我和主流“网民”的看法一致,认为没必要放价格信息在线上。我老板,加上组织里相当多的人都持有相反的看法。他们觉得消费者应该能够看到书要花多少钱。他们也觉得我管理银行资产会想看账户里每个月进了多少钱,如果我不认同他们的观点的话,资金可能会急剧减少的账户。 +如何呈现文档不是唯一的问题。作为一个实体书出版社,对于市场部来说,拥有一个网站的全部意义在于,让客户(或者说潜在的客户)不仅知道一本书的内容,而且知道买这本书需要花多少钱。但这有一个问题,你看,互联网,包括快速发展的万维网,是开放的,是所有都免费的自由之地,没有人会在意钱;事实上,在那里谈钱是要回避和避免的。 -幸运的是,在我从高高的马儿身上摔下来之前,我已经自己认清了一些——可能是我开始迈入的几星期之后——Web 早已变了,有其他人公布他们产品的价格信息。新来的人渐渐瞧不起先前运行 web 服务器的老学究们,但风向很清晰。但是这并不意味着网站的战争结束了。作为一个学术出版社,我们和大学共享一个域名(“ac.uk“)。大学不确信公布价格信息合不合适直到普林斯顿大学出版社做了,我们会不会看起来有点傻如果······? +我和主流“网民”的看法一致,认为没必要把价格信息放在线上。我老板,以及机构里相当多的人都持相反的意见。他们觉得消费者应该能够看到书要花多少钱。他们也觉得我的银行经理也会想看到我的账户里每个月进了多少钱,如果我不认同他们的观点的话,那我的收入就可能堪忧。 -有趣的事情也没有停。站点管理员(“webmaster@…”)任职的短短几个月内,我们和其他很多网站一样开始看到了一种焦虑的趋势。某些访问者可以轻而易举地访问我们的网站服务器。这些访问者使用新的网页浏览器:网景。网景干坏事,它是多线程的。 +幸运的是,在我被炒鱿鱼之前,我已经自己认清了一些 —— 可能是在我开始迈入 Web 的几星期之后,Web 已经发生变化,有其他人公布他们的产品价格信息。这些新来者通常被那些从早期就开始运行 Web 服务器的老派人士所看不起,[^3] 但很明显,风向是往那边吹的。然而,这并不意味着我们的网站就赢得了战争。作为一个学术出版社,我们和大学共享一个域名(在 “ac.uk” 下)。大学不太相信发布价格信息是合适的,直到出版社的一些资深人士指出,普林斯顿大学出版社正在这样做,如果我们不做……看起来是不是有点傻? -这为什么是个问题呢?在网景之前,所有的浏览器都是单线程。他们一次只进行一个连接,所以即使一个页面有五张动图,也会先请求 HTML 基本文件进行解析,然后下载第一张动图,完成,接着第二张,完成,如此类推。事实上,动图顺序经常出错,使得页面加载得非常奇怪,但这也是常规思路。粗暴的网景人决定他们与网站服务器一次性进行多个连接来请求所有的动图,举个例子!为什么这是个问题呢?好吧,问题就是大多数网站服务器都是单线程的。他们不是设计来一次性进行多个连接的。确实,我们运行的 HTTP 服务的软件(MacHTTP)是单线程的。即使我们已经买了(原本是共享软件),我们用的这版一次不能处理多个请求。 +有趣的事情还没完。在我担任站点管理员(“webmaster@…”)的短短几个月后,我们和其他很多网站一样开始看到了一种令人担忧的趋势。某些访问者可以轻而易举地让我们的 Web 服务器跪了。这些访问者使用了新的网页浏览器:网景浏览器(Netscape)。网景浏览器实在太恶劣了,它居然是多线程的。 -互联网上爆发了大量讨论。做网景的人觉得他们正在改变世界的工作方式?它如何支持工作?大家分成了不同阵营,双方不断交流着技术层面的热词。问题是网景不仅多线程,而且优于其他。非常多 web 服务器代码维护者,包括 MacHTTP 作者查克·肖顿在内,坐下来认真在原有代码基础上更新多线程测试版。所有人几乎立马转向测试版,他们变得稳定,最终浏览器也舍弃了单线程,变成多线程,或者只是像所有过时产品一样销声匿迹。 +这为什么是个问题呢?在网景浏览器之前,所有的浏览器都是单线程。它们一次只进行一个连接,所以即使一个页面有五张 GIF 图,[^4] 也会先请求 HTML 基本文件进行解析,然后下载第一张 GIF,完成,接着第二张,完成,如此类推。事实上,GIF 的顺序经常出错,使得页面加载得非常奇怪,但这也是常规思路。而粗暴的网景公司的人决定,它们可以同时打开多个连接到 Web 服务器,比如说,可以同时请求所有的 GIF!为什么这是个问题呢?好吧,问题就在于大多数 Web 服务器都是单线程的。它们不是设计来一次进行多个连接的。确实,我们运行的 HTTP 服务的软件(MacHTTP)是单线程的。尽管我们花钱购买了它(最初是共享软件),但我们用的这版无法同时处理多个请求。 -对我来说,这就是 web 真正成长。那既不是网页展示的价格也不是设计者能有定义你能在网页上看到什么,而是浏览器变得更易用,几千浏览者变成几百万并且用户喜好而不是制作者变得更为重要。我的路还很长——有机会再谈——有关这点,我老板开始开始查看我们的每月,然后每周,然后每天的日志,并意识到这确实变成了大事而且真的需要我们关注。 +互联网上爆发了大量讨论。这些网景公司的人以为他们是谁,能改变世界的运作方式?它应该如何工作?大家分成了不同阵营,就像所有的技术争论一样,双方都用各种技术热词互丢。问题是,网景浏览器不仅是多线程的,它也比其他的浏览器更好。非常多 Web 服务器代码维护者,包括 MacHTTP 作者 Chuck Shotton 在内,开始坐下来认真地在原有代码基础上更新了多线程测试版。几乎所有人立马转向测试版,它们变得稳定了,最终,浏览器要么采用了这种技术,变成多线程,要么就像所有过时产品一样销声匿迹了。[^6] -1\. 他们如何再次回来? +对我来说,这才是 Web 真正成长起来的时候。既不是网页展示的价格,也不是设计者能定义你能在网页上看到什么,[^8] 而是浏览器变得更易用,以及成千上万的浏览者向数百万浏览者转变的网络效应,使天平向消费者而不是生产者倾斜。在我的旅程中,还有更多故事,我将留待下次再谈。但从这时起,我的雇主开始看我们的月报,然后是周报、日报,并意识到这将是一件大事,真的需要关注。 -2\. 毫不意外我还是使用命令行里最开心的人。 - -3\. 大约六个月前。 - -4\. 不计后果,真的,发生了 - -5\. 噢,不——GIF,BMP或者JPEG还是好主意没被取缔。 - -6\. 从未沉寂:永远都会有少数坚信他们更偏爱的解决方案更优越并哀叹互联网的其他人已经变成了恶魔的难以退却的狂热者。 - -7\. 我不是唯一一个说:我还在用 Lynx。 - -8\. 我指出,不同访问需求的人创造主要和正在发生的问题。 +[^1]: 它们又是怎么回来的? +[^2]: 你可能不会惊讶,我还是在命令行里最开心。 +[^3]: 大约六个月前。 +[^4]: 莽撞,没错,但它确实发生了 [^5] +[^5]: 噢,不,是 GIF 或 BMP,JPEG 还是个好主意,但还没有用上。 +[^6]: 没有真正的沉寂:总有一些坚持他们的首选解决方案具有技术上的优势,并哀叹互联网的其他人都是邪恶的死硬爱好者。 [^7] +[^7]: 我不是唯一一个说“我还在用 Lynx”的人。 +[^8]: 我会指出,为那些有各种无障碍需求的人制造严重而持续的问题。 -------------------------------------------------------------------------------- @@ -56,7 +50,7 @@ via: https://opensource.com/article/19/3/when-web-grew 作者:[Mike Bursell][a] 选题:[lujun9972][b] 译者:[XYenChi](https://github.com/XYenChi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 611d183b9da6486b898896c1c72d75bd0f73f592 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 18 Feb 2021 16:19:07 +0800 Subject: [PATCH 366/381] PUB @XYenChi https://linux.cn/article-13130-1.html --- .../20190312 When the web grew up- A browser story.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190312 When the web grew up- A browser story.md (99%) diff --git a/translated/talk/20190312 When the web grew up- A browser story.md b/published/20190312 When the web grew up- A browser story.md similarity index 99% rename from translated/talk/20190312 When the web grew up- A browser story.md rename to published/20190312 When the web grew up- A browser story.md index 4d63bd68bb..a53a5babfb 100644 --- a/translated/talk/20190312 When the web grew up- A browser story.md +++ b/published/20190312 When the web grew up- A browser story.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (XYenChi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13130-1.html) [#]: subject: (When the web grew up: A browser story) [#]: via: (https://opensource.com/article/19/3/when-web-grew) [#]: author: (Mike Bursell https://opensource.com/users/mikecamel) From 4f42b0ae3f74d3f86fa50b20cf2b3d637225b7fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Thu, 18 Feb 2021 16:44:07 +0800 Subject: [PATCH 367/381] The translation completes a part --- ...00629 LaTeX typesetting part 2 (tables).md | 203 +++++++----------- 1 file changed, 82 insertions(+), 121 deletions(-) diff --git a/sources/tech/20200629 LaTeX typesetting part 2 (tables).md b/sources/tech/20200629 LaTeX typesetting part 2 (tables).md index e7e53604cb..266929ed4c 100644 --- a/sources/tech/20200629 LaTeX typesetting part 2 (tables).md +++ b/sources/tech/20200629 LaTeX typesetting part 2 (tables).md @@ -7,239 +7,200 @@ [#]: via: (https://fedoramagazine.org/latex-typesetting-part-2-tables/) [#]: author: (Earl Ramirez https://fedoramagazine.org/author/earlramirez/) -LaTeX typesetting part 2 (tables) +LaTex 排版(2):表格 ====== ![][1] -LaTeX offers a number of tools to create and customise tables, in this series we will be using the tabular and tabularx environment to create and customise tables. +LaTeX 提供了许多工具来创建和定制表格,在本系列中,我们将使用 tabular 和 tabularx 环境来创建和定制表。 -### Basic table +### 基础表格 -To create a table you simply specify the environment \begin{tabular}{columns} -``` +要创建表,只需指定环境 `\begin{tabular}{列选项}` ``` - \begin{tabular}{c|c} -    Release &amp;amp;Codename \\\ \hline -    Fedora  Core 1 &amp;amp;Yarrow \\\ -    Fedora Core 2 &amp;amp;Tettnang \\\ -    Fedora Core 3 &amp;amp;Heidelberg \\\ -    Fedora Core 4 &amp;amp;Stentz \\\ + Release &Codename \\ \hline + Fedora Core 1 &Yarrow \\ + Fedora Core 2 &Tettnang \\ + Fedora Core 3 &Heidelberg \\ + Fedora Core 4 &Stentz \\ \end{tabular} ``` -``` - ![Basic Table][2] -In the above example "{c|c}" in the curly bracket refers to the position of the text in the column. The below table summarises the positional argument together with the description. +在上面的示例中,花括号中的”{c|c}”表示文本在列中的位置。下表总结了位置参数及其说明。 -Position | Argument ----|--- -c | Position text in the centre -l | Position text left-justified -r | Position text right-justified -p{width} | Align the text at the top of the cell -m{width} | Align the text in the middle of the cell -b{width} | Align the text at the bottom of the cell +参数 | 位置 +|:---:|:--- +c | 将文本置于中间 +l | 将文本左对齐 +r | 将文本右对齐 +p{width} | 文本对齐单元格顶部 +m{width} | 文本对齐单元格中间 +b{width} | 文本对齐单元格底部 ->Both m{width} and b{width} requires the array package to be specified in the preamble. +> m{width} 和 b{width} 都要求在最前面指定数组包。 -Using the example above, let us breakdown the important points used and describe a few more options that you will see in this series +使用上面的例子,让我们来详细讲解使用的要点,并描述您将在本系列中看到的更多选项 -Option | Description ----|--- -& | Defines each cell, the ampersand is only used from the second column -\ | This terminates the row and start a new row -| -\hline | Specifies the horizontal line (optional) -*{num}{form} | This is handy when you have many columns and is an efficient way of limiting the repetition -| +选项 | 意义 +|:-:|:-| +& | 定义每个单元格,这个符号仅用于第二列 +\ | 这将终止该行并开始一个新行 +\| | 指定表格中的垂直线(可选) +\hline | 指定表格中水平线(可选) +*{num}{form} | 当您有许多列时,可以使用这个,并且是限制重复的有效方法 +\|\| | 指定表格中垂直双线 -### Customising our table +### 定制表格 -Now that some of the options available let create a table using the options described in the previous section. -``` +学会了这些选项,让我们使用这些选项创建一个表。 ``` - \begin{tabular}{*{3}{|l|}} \hline -    \textbf{Version} &amp;amp;\textbf{Code name} &amp;amp;\textbf{Year released} \\\ + \textbf{Version} &\textbf{Code name} &\textbf{Year released} \\ \hline -    Fedora 6 &amp;amp;Zod &amp;amp;2006 \\\ \hline -    Fedora 7 &amp;amp;Moonshine &amp;amp;2007 \\\ \hline -    Fedora 8 &amp;amp;Werewolf &amp;amp;2007 \\\ + Fedora 6 &Zod &2006 \\ \hline + Fedora 7 &Moonshine &2007 \\ \hline + Fedora 8 &Werewolf &2007 \\ \hline \end{tabular} ``` -``` - ![Customise Table][3] -### Managing long text +### 管理长文本 -With LaTeX if there are many texts in a column it will not be formatted well and does not look presentable. +如果列中有很多文本,那么它的格式就不好处理,看起来也不好看。 -The below example shows how long text is formatted, we will use "blindtext" in the preamble so that we can produce sample text. -``` +下面的示例显示了文本的格式长度,我们将在导言区中使用 “blindtext”,以便生成示例文本。 ``` - \begin{tabular}{|l|l|}\hline -    Summary &amp;amp;Description \\\ \hline -    Test &amp;amp;\blindtext \\\ + Summary &Description \\ \hline + Test &\blindtext \\ \end{tabular} ``` -``` - ![Default Formatting][4] -As you can see the text exceed the page width; however, there are a couple of options to overcome this challenge. +正如您所看到的,文本超出了页面宽度;但是,有几个选项可以克服这个问题。 - * Specify the column width, for example, m{5cm} - * Utilise the tabularx environment, this requires tabularx package in the preamble. + * 指定列宽,例如 m{5cm} + * 利用 TABLARX 环境,这需要在导言区中引用 TABLARX 宏包。 +#### 使用列宽管理长文本 -### Managing long text with column width - -By specifying the column width the text will be wrapped into the width as shown in the example below. -``` +通过指定列宽,文本将被包装为如下示例所示的宽度。 ``` - \begin{tabular}{|l|m{14cm}|} \hline -    Summary &amp;amp;Description \\\ \hline -    Test &amp;amp;\blindtext \\\ \hline + Summary &Description \\ \hline + Test &\blindtext \\ \hline \end{tabular}\vspace{3mm} ``` -``` - ![Column width][5] -### Managing long text with tabularx +#### 使用 tabularx 管理长文本 -Before we can leverage tabularx we need to add it in the preamble. Tabularx takes the following example +在我们利用表格之前,我们需要在导言区中加上它。TABLARX 方法见以下示例 + +`\begin{tabularx}{宽度}{列选项}` -**\begin{tabularx}{width}{columns}** -``` ``` - \begin{tabularx}{\textwidth}{|l|X|} \hline -Summary &amp;amp; Tabularx Description\\\ \hline -Text &amp;amp;\blindtext \\\ \hline +Summary & Tabularx Description\\ \hline +Text &\blindtext \\ \hline \end{tabularx} ``` -``` ![Tabularx][6] -Notice that the column that we want the long text to be wrapped has a capital "X" specified. +请注意,我们需要处理长文本的列在花括号中指定了大写“X”。 -### Multirow and multicolumn +### 合并行合并列 -There are times when you will need to merge rows and/or column. This section describes how it is accomplished. To use multirow and multicolumn add multirow to the preamble. +有时需要合并行或列。本节描述了如何完成。要使用 multirow 和 multicolumn,请将 multirow 添加到导言区。 -### Multirow +#### 合并行 -Multirow takes the following argument _\multirow{number_of_rows}{width}{text}_, let us look at the below example. -``` +Multirow 采用以下参数`\multirow{行的数量}{宽度}{文本}`,让我们看看下面的示例。 ``` - \begin{tabular}{|l|l|}\hline -    Release &amp;amp;Codename \\\ \hline -    Fedora Core 4 &amp;amp;Stentz \\\ \hline -    \multirow{2}{*}{MultiRow} &amp;amp;Fedora 8 \\\ -    &amp;amp;Werewolf \\\ \hline + Release &Codename \\ \hline + Fedora Core 4 &Stentz \\ \hline + \multirow{2}{*}{MultiRow} &Fedora 8 \\ + &Werewolf \\ \hline \end{tabular} ``` -``` - ![MultiRow][7] -In the above example, two rows were specified, the ‘*’ tells LaTeX to automatically manage the size of the cell. +在上面的示例中,指定了两行,'*'告诉LaTeX自动管理单元格的大小。 -### Multicolumn +#### 合并列 -Multicolumn argument is _\multicolumn{number_of_columns}{cell_position}{text}_, below example demonstrates multicolumn. -``` +Multicolumn 参数是 `{Multicolumn{列的数量}{单元格选项}{位置}{文本}`,下面的示例演示 Multicolumn。 ``` - \begin{tabular}{|l|l|l|}\hline -    Release &amp;amp;Codename &amp;amp;Date \\\ \hline -    Fedora Core 4 &amp;amp;Stentz &amp;amp;2005 \\\ \hline -    \multicolumn{3}{|c|}{Mulit-Column} \\\ \hline + Release &Codename &Date \\ \hline + Fedora Core 4 &Stentz &2005 \\ \hline + \multicolumn{3}{|c|}{Mulit-Column} \\ \hline \end{tabular} ``` -``` - ![Multi-Column][8] -### Working with colours +### 使用颜色 -Colours can be assigned to the text, an individual cell or the entire row. Additionally, we can configure alternating colours for each row. +可以为文本、单个单元格或整行指定颜色。此外,我们可以为每一行配置交替的颜色。 -Before we can add colour to our tables we need to include _\usepackage[table]{xcolor}_ into the preamble. We can also define colours using the following colour reference [LaTeX Colour][9] or by adding an exclamation after the colour prefixed by the shade from 0 to 100. For example, _gray!30_ -``` +在给表添加颜色之前,我们需要在导言区引用 `\usepackage[table]{xcolor}`。我们还可以使用以下颜色参考 [LaTeX Color][9] 或在颜色前缀后面添加感叹号(从0到100的阴影)来定义颜色。例如,`gray!30` ``` - \definecolor{darkblue}{rgb}{0.0, 0.0, 0.55} \definecolor{darkgray}{rgb}{0.66, 0.66, 0.66} ``` -``` - -Below example demonstrate this a table with alternate colours, \rowcolors take the following options _\rowcolors{row_start_colour}{even_row_colour}{odd_row_colour}_. -``` +下面的示例演示了一个具有各种颜色的表,`\rowcolors` 采用以下选项`\rowcolors{起始行颜色}{偶数行颜色}{奇数行颜色}`。 ``` - \rowcolors{2}{darkgray}{gray!20} \begin{tabular}{c|c} -    Release &amp;amp;Codename \\\ \hline -    Fedora  Core 1 &amp;amp;Yarrow \\\ -    Fedora Core 2 &amp;amp;Tettnang \\\ -    Fedora Core 3 &amp;amp;Heidelberg \\\ -    Fedora Core 4 &amp;amp;Stentz \\\ + Release &Codename \\ \hline + Fedora Core 1 &Yarrow \\ + Fedora Core 2 &Tettnang \\ + Fedora Core 3 &Heidelberg \\ + Fedora Core 4 &Stentz \\ \end{tabular} ``` -``` - ![Alt colour table][10] -In addition to the above example, \rowcolor can be used to specify the colour of each row, this method works best when there are multi-rows. The following examples show the impact of using the \rowcolours with multi-row and how to work around it. +除了上面的例子,`\rowcolor` 可以用来指定每一行的颜色,这个方法在有合并行时效果最好。以下示例显示将 `\rowColors` 与合并行一起使用的影响以及如何解决此问题。 ![Impact on multi-row][11] -As you can see the _multi-row_ is visible in the first row, to fix this we have to do the following. -``` +你可以看到,在合并行中,只有第一行能显示颜色。想要解决这个问题,需要这样做: ``` - \begin{tabular}{|l|l|}\hline -    \rowcolor{darkblue}\textsc{\color{white}Release}  &amp;amp;\textsc{\color{white}Codename} \\\ \hline -    \rowcolor{gray!10}Fedora Core 4 &amp;amp;Stentz \\\ \hline -    \rowcolor{gray!40}&amp;amp;Fedora 8 \\\ -    \rowcolor{gray!40}\multirow{-2}{*}{Multi-Row} &amp;amp;Werewolf \\\ \hline + \rowcolor{darkblue}\textsc{\color{white}Release} &\textsc{\color{white}Codename} \\ \hline + \rowcolor{gray!10}Fedora Core 4 &Stentz \\ \hline + \rowcolor{gray!40}&Fedora 8 \\ + \rowcolor{gray!40}\multirow{-2}{*}{Multi-Row} &Werewolf \\ \hline \end{tabular} ``` -``` - ![Multi-row][12] Let us discuss the changes that were implemented to resolve the multi-row with the alternate colour issue. From 894bd7ce8c3d658033f7760c1a2ecda8fc9953b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Thu, 18 Feb 2021 17:19:16 +0800 Subject: [PATCH 368/381] translate done: 20200629 LaTeX typesetting part 2 (tables).md --- ...00629 LaTeX typesetting part 2 (tables).md | 138 +++++++----------- 1 file changed, 55 insertions(+), 83 deletions(-) rename {sources => translated}/tech/20200629 LaTeX typesetting part 2 (tables).md (66%) diff --git a/sources/tech/20200629 LaTeX typesetting part 2 (tables).md b/translated/tech/20200629 LaTeX typesetting part 2 (tables).md similarity index 66% rename from sources/tech/20200629 LaTeX typesetting part 2 (tables).md rename to translated/tech/20200629 LaTeX typesetting part 2 (tables).md index 266929ed4c..4b91e8cc0d 100644 --- a/sources/tech/20200629 LaTeX typesetting part 2 (tables).md +++ b/translated/tech/20200629 LaTeX typesetting part 2 (tables).md @@ -7,7 +7,8 @@ [#]: via: (https://fedoramagazine.org/latex-typesetting-part-2-tables/) [#]: author: (Earl Ramirez https://fedoramagazine.org/author/earlramirez/) -LaTex 排版(2):表格 + +LaTex 排版 (2):表格 ====== ![][1] @@ -16,7 +17,7 @@ LaTeX 提供了许多工具来创建和定制表格,在本系列中,我们 ### 基础表格 -要创建表,只需指定环境 `\begin{tabular}{列选项}` +要创建表,只需指定环境 `\begin{tabular}{ 列选项}` ``` \begin{tabular}{c|c} @@ -30,7 +31,7 @@ LaTeX 提供了许多工具来创建和定制表格,在本系列中,我们 ![Basic Table][2] -在上面的示例中,花括号中的”{c|c}”表示文本在列中的位置。下表总结了位置参数及其说明。 +在上面的示例中,花括号中的 ”{c|c}” 表示文本在列中的位置。下表总结了位置参数及其说明。 参数 | 位置 |:---:|:--- @@ -90,7 +91,7 @@ b{width} | 文本对齐单元格底部 正如您所看到的,文本超出了页面宽度;但是,有几个选项可以克服这个问题。 * 指定列宽,例如 m{5cm} - * 利用 TABLARX 环境,这需要在导言区中引用 TABLARX 宏包。 + * 利用 tablarx 环境,这需要在导言区中引用 tablarx 宏包。 #### 使用列宽管理长文本 @@ -110,7 +111,7 @@ b{width} | 文本对齐单元格底部 在我们利用表格之前,我们需要在导言区中加上它。TABLARX 方法见以下示例 -`\begin{tabularx}{宽度}{列选项}` +`\begin{tabularx}{ 宽度}{列选项}` ``` @@ -123,7 +124,7 @@ Text &\blindtext \\ \hline ![Tabularx][6] -请注意,我们需要处理长文本的列在花括号中指定了大写“X”。 +请注意,我们需要处理长文本的列在花括号中指定了大写 “X”。 ### 合并行合并列 @@ -131,7 +132,7 @@ Text &\blindtext \\ \hline #### 合并行 -Multirow 采用以下参数`\multirow{行的数量}{宽度}{文本}`,让我们看看下面的示例。 +Multirow 采用以下参数 `\multirow{ 行的数量}{宽度}{文本}`,让我们看看下面的示例。 ``` \begin{tabular}{|l|l|}\hline @@ -144,11 +145,11 @@ Multirow 采用以下参数`\multirow{行的数量}{宽度}{文本}`,让我们 ![MultiRow][7] -在上面的示例中,指定了两行,'*'告诉LaTeX自动管理单元格的大小。 +在上面的示例中,指定了两行,'*'告诉 LaTeX 自动管理单元格的大小。 #### 合并列 -Multicolumn 参数是 `{Multicolumn{列的数量}{单元格选项}{位置}{文本}`,下面的示例演示 Multicolumn。 +Multicolumn 参数是 `{Multicolumn{ 列的数量}{单元格选项}{位置}{文本}`,下面的示例演示 Multicolumn。 ``` \begin{tabular}{|l|l|l|}\hline @@ -164,14 +165,14 @@ Multicolumn 参数是 `{Multicolumn{列的数量}{单元格选项}{位置}{文 可以为文本、单个单元格或整行指定颜色。此外,我们可以为每一行配置交替的颜色。 -在给表添加颜色之前,我们需要在导言区引用 `\usepackage[table]{xcolor}`。我们还可以使用以下颜色参考 [LaTeX Color][9] 或在颜色前缀后面添加感叹号(从0到100的阴影)来定义颜色。例如,`gray!30` +在给表添加颜色之前,我们需要在导言区引用 `\usepackage[table]{xcolor}`。我们还可以使用以下颜色参考 [LaTeX Color][9] 或在颜色前缀后面添加感叹号(从 0 到 100 的阴影)来定义颜色。例如,`gray!30` ``` \definecolor{darkblue}{rgb}{0.0, 0.0, 0.55} \definecolor{darkgray}{rgb}{0.66, 0.66, 0.66} ``` -下面的示例演示了一个具有各种颜色的表,`\rowcolors` 采用以下选项`\rowcolors{起始行颜色}{偶数行颜色}{奇数行颜色}`。 +下面的示例演示了一个具有各种颜色的表,`\rowcolors` 采用以下选项 `\rowcolors{ 起始行颜色}{偶数行颜色}{奇数行颜色}`。 ``` \rowcolors{2}{darkgray}{gray!20} @@ -203,106 +204,83 @@ Multicolumn 参数是 `{Multicolumn{列的数量}{单元格选项}{位置}{文 ![Multi-row][12] -Let us discuss the changes that were implemented to resolve the multi-row with the alternate colour issue. +让我们讲解一下为解决合并行替换颜色问题而实施的更改。 - * The first row started above the multi-row - * The number of rows was changed from 2 to -2, which means to read from the line above - * \rowcolor was specified for each row, more importantly, the multi-rows must have the same colour so that you can have the desired results. + * 第一行从合并行上方开始 + * 行数从 2 更改为 -2,这意味着从上面的行开始读取 + * `\rowcolor` 是为每一行指定的,更重要的是,多行必须具有相同的颜色,这样才能获得所需的结果。 - - -One last note on colour, to change the colour of a column you need to create a new column type and define the colour. The example below illustrates how to define the new column colour. -``` +关于颜色的最后一个注意事项是,要更改列的颜色,需要创建新的列类型并定义颜色。下面的示例说明了如何定义新的列颜色。 ``` - -\newcolumntype{g}{&amp;gt;{\columncolor{darkblue}}l} +\newcolumntype{g}{>{\columncolor{darkblue}}l} ``` -``` - -Let’s break it down - - * \newcolumntype{g}: defines the letter _g_ as the new column - * {>{\columncolor{darkblue}}l}: here we select our desired colour, and _l_ tells the column to be left-justified, this can be subsitued with _c_ or _r_ +我们把它分解一下 + * `\newcolumntype{g}`:将字母 _g_ 定义为新列 + * `{>{\columncolor{darkblue}}l}`:在这里我们选择我们想要的颜色,并且 `l` 告诉列左对齐,这可以用 `c` 或 `r` 代替 ``` - -``` - -\begin{tabular}{g|l} -    \textsc{Release}  &amp;amp;\textsc{Codename} \\\ \hline -    Fedora Core 4 &amp;amp;Stentz \\\ -    &amp;amp;Fedora 8 \\\ -    \multirow{-2}{*}{Multi-Row} &amp;amp;Werewolf \\\ +\begin{tabular}{g|l} + \textsc{Release} &\textsc{Codename} \\ \hline + Fedora Core 4 &Stentz \\ + &Fedora 8 \\ + \multirow{-2}{*}{Multi-Row} &Werewolf \\ \end{tabular}\ ``` -``` - ![Column Colour][13] -### Landscape table +### 横向表 -There may be times when your table has many columns and will not fit elegantly in portrait. With the _rotating_ package in preamble you will be able to create a sideways table. The below example demonstrates this. +有时,您的表可能有许多列,纵向排列会很不好看。在导言区加入 “rotating” 包,您将能够创建一个横向表。下面的例子说明了这一点。 -For the landscape table, we will use the _sidewaystable_ environment and add the tabular environment within it, we also specified additional options. - - * \centering to position the table in the centre of the page - * \caption{} to give our table a name - * \label{} this enables us to reference the table in our document +对于横向表,我们将使用 `sidewaystable` 环境并在其中添加表格环境,我们还指定了其他选项。 + * `\centering` 可以将表格放置在页面中心 + * `\caption{}` 为表命名 + * `\label{}` 这使我们能够引用文档中的表 ``` - -``` - \begin{sidewaystable} \centering \caption{Sideways Table} \label{sidetable} \begin{tabular}{ll} -    \rowcolor{darkblue}\textsc{\color{white}Release}  &amp;amp;\textsc{\color{white}Codename} \\\ -    \rowcolor{gray!10}Fedora Core 4 &amp;amp;Stentz \\\ -    \rowcolor{gray!40} &amp;amp;Fedora 8 \\\ -    \rowcolor{gray!40}\multirow{-2}{*}{Multi-Row} &amp;amp;Werewolf \\\ + \rowcolor{darkblue}\textsc{\color{white}Release} &\textsc{\color{white}Codename} \\ + \rowcolor{gray!10}Fedora Core 4 &Stentz \\ + \rowcolor{gray!40} &Fedora 8 \\ + \rowcolor{gray!40}\multirow{-2}{*}{Multi-Row} &Werewolf \\ \end{tabular}\vspace{3mm} \end{sidewaystable} ``` -``` - ![Sideways Table][14] -### List and tables +### 列表和表格 -To include a list into a table you can use tabularx and include the list in the column where the _X_ is specified. Another option will be to use tabular but you must specify the column width. +要将列表包含到表中,可以使用 tabularx,并将列表包含在指定的列中。另一个办法是使用表格格式,但必须指定列宽。 -### List in tabularx -``` +#### 用 tabularx 处理列表 ``` - \begin{tabularx}{\textwidth}{|l|X|} \hline -    Fedora Version &amp;amp;Editions \\\ \hline -    Fedora 32 &amp;amp;\begin{itemize}[noitemsep] -        \item CoreOS -        \item Silverblue -        \item IoT -    \end{itemize} \\\ \hline + Fedora Version &Editions \\ \hline + Fedora 32 &\begin{itemize}[noitemsep] + \item CoreOS + \item Silverblue + \item IoT + \end{itemize} \\ \hline \end{tabularx}\vspace{3mm} ``` -``` - ![List in tabularx][15] -### List in tabular -``` +#### 用 tabular 处理列表 + ``` - \begin{tabular}{|l|m{6cm}|}\hline         Fedora Version &amp;amp;Editions \\\ \hline     Fedora 32 &amp;amp;\begin{itemize}[noitemsep] @@ -313,35 +291,29 @@ To include a list into a table you can use tabularx and include the list in the \end{tabular} ``` -``` - ![List in tabular][16] -### Conclusion +### 结论 -LaTeX offers many ways to customise your table with tabular and tabularx, you can also add both tabular and tabularx within the table environment (\begin\table) to add the table name and to position the table. +LaTeX 提供了许多使用 tablar 和 tablarx 自定义表的方法,您还可以在表环境 (\begin\table) 中添加 tablar 和 tablarx 来添加表的名称和定位表。 -### LaTeX packages +### LaTeX 宏包 -The packages used in this series are. -``` +所需的宏包有如下这些: ``` - \usepackage{fullpage} -\usepackage{blindtext}  % add demo text +\usepackage{blindtext} % add demo text \usepackage{array} % used for column positions \usepackage{tabularx} % adds tabularx which is used for text wrapping \usepackage{multirow} % multi-row and multi-colour support -\usepackage[table]{xcolor} % add colour to the columns +\usepackage[table]{xcolor} % add colour to the columns \usepackage{rotating} % for landscape/sideways tables ``` -``` +### 额外的知识 -### Additional Reading - -This was an intermediate lesson on tables; for more advanced information about tables and LaTex in general, you can go to [LaTeX Wiki][17] +这是一堂关于表的小课,有关表和 LaTex 的更多高级信息,请访问 [LaTex Wiki][17] ![][13] From c5e93b9da6b3358582ed7ab8af2b9204b58b070c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 19 Feb 2021 03:50:44 +0800 Subject: [PATCH 369/381] =?UTF-8?q?Revert=20"=E7=94=B3=E8=AF=B7=E8=AF=91?= =?UTF-8?q?=E6=96=87"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 751d7cf942ecebe8f9625509ab9f0eed7e5fba0b. --- sources/talk/20190313 Why is no one signing their emails.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20190313 Why is no one signing their emails.md b/sources/talk/20190313 Why is no one signing their emails.md index 2df66cf18d..b2b862951a 100644 --- a/sources/talk/20190313 Why is no one signing their emails.md +++ b/sources/talk/20190313 Why is no one signing their emails.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (sthwhl) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -92,7 +92,7 @@ via: https://arp242.net/weblog/signing-emails.html 作者:[Martin Tournoij][a] 选题:[lujun9972][b] -译者:[sthwhl](https://github.com/sthwhl) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 422e366003b5b7b9683fcd7bcfadca7a55dfd426 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 19 Feb 2021 05:05:36 +0800 Subject: [PATCH 370/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210219=20?= =?UTF-8?q?7=20Ways=20to=20Customize=20Cinnamon=20Desktop=20in=20Linux=20[?= =?UTF-8?q?Beginner=E2=80=99s=20Guide]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210219 7 Ways to Customize Cinnamon Desktop in Linux -Beginner-s Guide.md --- ...amon Desktop in Linux -Beginner-s Guide.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/tech/20210219 7 Ways to Customize Cinnamon Desktop in Linux -Beginner-s Guide.md diff --git a/sources/tech/20210219 7 Ways to Customize Cinnamon Desktop in Linux -Beginner-s Guide.md b/sources/tech/20210219 7 Ways to Customize Cinnamon Desktop in Linux -Beginner-s Guide.md new file mode 100644 index 0000000000..c6e7195bf8 --- /dev/null +++ b/sources/tech/20210219 7 Ways to Customize Cinnamon Desktop in Linux -Beginner-s Guide.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (7 Ways to Customize Cinnamon Desktop in Linux [Beginner’s Guide]) +[#]: via: (https://itsfoss.com/customize-cinnamon-desktop/) +[#]: author: (Dimitrios https://itsfoss.com/author/dimitrios/) + +7 Ways to Customize Cinnamon Desktop in Linux [Beginner’s Guide] +====== + +Linux Mint is one the best [Linux distributions for beginners][1]. Especially Windows users that want to [switch to Linux][2], will find its flagship Cinnamon desktop environment very familiar. + +Cinnamon gives a traditional desktop experience and many users like it as it is. It doesn’t mean you have to content with what it provides. Cinnamon provides several ways for customizing the desktop. + +Reading about [MATE][3] and [KDE customization][4] guides, many readers requested similar tutorial for Linux Mint Cinnamon as well. Hence, I created this basic guide on tweaking the looks and feel of Cinnamon desktop. + +### 7 Different Ways for Customizing Cinnamon Desktop + +For this tutorial, I’m using [Linux Mint Debian Edition][5] (LMDE 4). You can use this on any Linux distribution that is running Cinnamon. If you are unsure, here’s [how to check which desktop environment][6] you are using. + +When it comes to changing the cinnamon desktop appearance, I find it very easy to do so as it is just 2 clicks away. Click on the menu icon and then on settings as shown below. + +![][7] + +All the appearance settings are placed on the top of the window. Everything on “System Settings” window looks neat and tidy. + +![][8] + +#### 1\. Effects + +The effects options are simple, self-explanatory and straightforward. You can turn on and off the effects for different elements of the desktop or change the window transitioning by changing the effects style. If you want to change the speed of the effects, you can do it through the customise tab. + +![][9] + +#### 2\. Font Selection + +In this section, you can differentiate the fonts you use throughout the system in size and type, and through the font settings you can fine-tune the appearance. + +![][10] + +#### 3\. Themes and icons + +A reason that I used to be a Linux Mint user for a few years, is that you don’t need to go all over the place to change what you want. Window manager, icon and panel customization all in one place! + +You can change your panel to a dark or light colour and the window borders to suit your changes. The default Cinnamon appearance settings look the best in my eyes, and I even applied the exact same when I was testing the [Ubuntu Cinnamon Remix][11] but in orange colour. + +![][12] + +#### 4\. Cinnamon Applets + +Cinnamon applets are all the elements included at your bottom panel like the calendar or the keyboard layout switcher. At the manage tab, you can add/remove the already installed applets. + +You should definitely explore the applets you can download, the weather and [CPU temperature][13] Indicator applets were my choices from the extras. + +![][14] + +#### 5\. Cinnamon Desklets + +Cinnamon Desklets are applications that can be placed directly to your desktop. Like all the other customization option, Desklets can be accessed from the settings menu and the wide variety of choices can attract anyone’s interest. Google calendar is a handy app to keep track of your schedule directly on your desktop. + +![][15] + +#### 6\. Desktop wallpaper + +To change the desktop background on Cinnamon desktop, simply right click on the desktop and choose “Change Desktop Background. It will open an easy to use window, where on the left side the available background system folders are listed and on the ride pane there is a preview of the images within each folder. + +![][16] + +You can add your own folders by clicking the plus (+) symbol by navigating to its path. At the Settings tab you can choose if you background will be static or slideshow and how the background is being positioned on the screen. + +![][17] + +#### 7\. Customize what’s on your desktop screen + +The background is not the only desktop element that you can change. You can find more options if you right click on the desktop and click on “Customise”. + +![][18] + +You can change the icon size, change the placement from vertical to horizontal and the spacing among them on both axis. If you don’t like what you did, click in reset grid spacing to go back to the default. + +![][19] + +Additionally, if you click on “Desktop Settings”, more options will be revealed. You can disable the icons on the desktop, place them on the primary or secondary monitor, or even both. As you can see, you can select some of the icons to appear on your desktop. + +![][20] + +### Conclusion + +Cinnamon desktop is one of the best to choose, especially if you are [switching from windows to Linux][21], but also for someone who is looking to a simple yet elegant desktop. + +Cinnamon desktop is very stable and never crashed on my hands, and it is one of the main reasons why it served me for so long on a variety of Linux distributions. + +I didn’t go in much details but gave you enough pointers to explore the settings on your own. Your feed to improve Cinnamon cuztomization is welcome. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/customize-cinnamon-desktop/ + +作者:[Dimitrios][a] +选题:[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/best-linux-beginners/ +[2]: https://itsfoss.com/reasons-switch-linux-windows-xp/ +[3]: https://itsfoss.com/ubuntu-mate-customization/ +[4]: https://itsfoss.com/kde-customization/ +[5]: https://itsfoss.com/lmde-4-release/ +[6]: https://itsfoss.com/find-desktop-environment/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/6-Cinnamon-settings.png?resize=800%2C680&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/7-Cinnamon-Settings.png?resize=800%2C630&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/8-cinnamon-effects.png?resize=800%2C630&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/11-font-selection.png?resize=800%2C650&ssl=1 +[11]: https://itsfoss.com/ubuntu-cinnamon-remix-review/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/10-cinnamon-themes-and-icons.png?resize=800%2C630&ssl=1 +[13]: https://itsfoss.com/check-laptop-cpu-temperature-ubuntu/ +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/12-cinnamon-applets.png?resize=800%2C630&ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/13-cinnamon-desklets.png?resize=800%2C630&ssl=1 +[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/1.-Cinnamon-change-desktop-background.png?resize=800%2C400&ssl=1 +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/2-Cinnamon-change-desktop-background.png?resize=800%2C630&ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/1.-desktop-additional-customization.png?resize=800%2C400&ssl=1 +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/4-desktop-additional-customization.png?resize=800%2C480&ssl=1 +[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/5-desktop-additional-customization.png?resize=800%2C630&ssl=1 +[21]: https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/ From c7f9f8f31eabbad9d1cffabd3ed83afcaab63c69 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 19 Feb 2021 05:05:58 +0800 Subject: [PATCH 371/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210218=20?= =?UTF-8?q?5=20must-have=20Linux=20media=20players?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210218 5 must-have Linux media players.md --- ...0210218 5 must-have Linux media players.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20210218 5 must-have Linux media players.md diff --git a/sources/tech/20210218 5 must-have Linux media players.md b/sources/tech/20210218 5 must-have Linux media players.md new file mode 100644 index 0000000000..50d962c292 --- /dev/null +++ b/sources/tech/20210218 5 must-have Linux media players.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 must-have Linux media players) +[#]: via: (https://opensource.com/article/21/2/linux-media-players) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +5 must-have Linux media players +====== +Whether its movies or music, Linux has you covered with some great media +players. +![An old-fashioned video camera][1] + +In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Playing media is one of my favorite reasons to use Linux. + +You may prefer vinyl and cassette tapes or VHS and Laserdisc, but it's still most likely that you consume the majority of the media you enjoy on a digital device. There's a convenience to media on a computer that can't be matched, largely because most of us are near a computer for most of the day. Many modern computer users don't give much thought to what applications are available for listening to music and watching movies because most operating systems provide a media player by default or because they subscribe to a streaming service and don't keep media files around themselves. But if your tastes go beyond the usual hit list of popular music and shows, or if you work with media for fun or profit, then you have local files you want to play. You probably also have opinions about the available user interfaces. On Linux, _choice_ is a mandate, and so your options for media playback are endless. + +Here are five of my must-have media players on Linux. + +### 1\. mpv + +![mpv interface][2] + +The mpv interface License: Creative Commons Attribution-ShareAlike + +A modern, clean, and minimal media player. Thanks to its Mplayer, [ffmpeg][3], and `libmpv` backends, it can play any kind of media you're likely to throw at it. And I do mean "throw at it" because the quickest and easiest way to start a file playing is just to drag the file onto the mpv window. Should you drag more than one file, mpv creates a playlist for you. + +While it provides intuitive overlay controls when you mouse over it, the interface is best when operated through the keyboard. For instance, **Alt+1** causes your mpv window to become full-size, and **Alt+0** reduces it to half-size. You can use the **,** and **.** keys to step through the video frame by frame, the **[** and **]** keys to adjust playback speed, **/** and ***** to adjust volume, **m** to mute, and so on. These master controls make for quick adjustments, and once you learn them, you can adjust playback almost as quickly as the thought occurs to you to do so. For both work and entertainment, mpv is my top choice for media playback. + +### 2\. Kaffeine and Rhythmbox + +![Kaffeine interface][4] + +The Kaffeine interface License: Creative Commons Attribution-ShareAlike + +Both the KDE Plasma and GNOME desktops provide music applications that can act as frontends to your personal music library. They invite you to establish a standard location for your music files and then scan through your music collection so you can browse according to album, artist, and so on. Both are great for those times when you just can't quite decide what you want to listen to and want an easy way to rummage through what's available. + +[Kaffeine][5] is actually much more than just a music player. It can play video files, DVDs, CDs, and even digital TV (assuming you have an incoming signal). I've gone whole days without closing Kaffeine, because no matter whether I'm in the mood for music or movies, Kaffeine makes it easy to start something playing. + +### 3\. Audacious + +![Audacious interface][6] + +The Audacious interface License: Creative Commons Attribution-ShareAlike + +The [Audacious][7] media player is a lightweight application that can play your music files (even MIDI files) or stream music from the Internet. Its main appeal, for me, is its modular architecture, which encourages the development of plugins. These plugins enable playback of nearly every audio media format you can think of, adjust the sound with a graphic equalizer, apply effects, and even reskin the entire application to change its interface. + +It's hard to think of Audacious as just one application because it's so easy to make it into the application you want it to be. Whether you're a fan of XMMS on Linux, WinAmp on Windows, or any number of alternatives, you can probably approximate them with Audacious. Audacious also provides a terminal command, `audtool`, so you can control a running instance of Audacious from the command line, so it even approximates a terminal media player! + +### 4\. VLC + +![vlc interface][8] + +The VLC interface License: Creative Commons Attribution-ShareAlike + +The [VLC][9] player is probably at the top of the list of applications responsible for introducing users to open source. A tried and true player of all things multimedia, VLC can play music, video, optical discs. It can also stream and record from a webcam or microphone, making it an easy way to capture a quick video or voice message. Like mpv, it can be controlled mostly through single-letter keyboard presses, but it also has a helpful right-click menu. It can convert media from one format to another, create playlists, track your media library, and much more. VLC is the best of the best, and most players don't even attempt to match its capabilities. It's a must-have application no matter what platform you're on. + +### 5\. Music player daemon + +![mpd with the ncmpc interface][10] + +mpd and ncmpc License: Creative Commons Attribution-ShareAlike + +The [music player daemon (mpd)][11] is an especially useful player, because it runs on a server. That means you can fire it up on a [Raspberry Pi][12] and leave it idling so you can tap into it whenever you want to play a tune. There are many clients for mpd, but I use [ncmpc][13]. With ncmpc or a web client like [netjukebox][14], I can contact mpd from the local host or a remote machine, select an album, and play it from anywhere. + +### Media on Linux + +Playing media on Linux is easy, thanks to its excellent codec support and an amazing selection of players. I've only mentioned five of my favorites, but there are many, many more for you to explore. Try them all, find the best, and then sit back and relax. + +We see how four music players, VLC, QMMP, Clementine, Amarok, compare. The author also recommends... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-media-players + +作者:[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]: https://opensource.com/sites/default/files/mpv_0.png +[3]: https://opensource.com/article/17/6/ffmpeg-convert-media-file-formats +[4]: https://opensource.com/sites/default/files/kaffeine.png +[5]: https://apps.kde.org/en/kaffeine +[6]: https://opensource.com/sites/default/files/audacious.png +[7]: https://audacious-media-player.org/ +[8]: https://opensource.com/sites/default/files/vlc_0.png +[9]: http://videolan.org +[10]: https://opensource.com/sites/default/files/mpd-ncmpc.png +[11]: https://www.musicpd.org/ +[12]: https://opensource.com/article/21/1/raspberry-pi-hifi +[13]: https://www.musicpd.org/clients/ncmpc/ +[14]: http://www.netjukebox.nl/ From d3d82ff7244a61a7a1bebd6ce927a4cbd5f658c0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 19 Feb 2021 05:06:28 +0800 Subject: [PATCH 372/381] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210218=20?= =?UTF-8?q?Not=20an=20engineer=3F=20Find=20out=20where=20you=20belong?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210218 Not an engineer- Find out where you belong.md --- ... an engineer- Find out where you belong.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20210218 Not an engineer- Find out where you belong.md diff --git a/sources/tech/20210218 Not an engineer- Find out where you belong.md b/sources/tech/20210218 Not an engineer- Find out where you belong.md new file mode 100644 index 0000000000..0a6589a01b --- /dev/null +++ b/sources/tech/20210218 Not an engineer- Find out where you belong.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Not an engineer? Find out where you belong) +[#]: via: (https://opensource.com/article/21/2/advice-non-technical) +[#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych) + +Not an engineer? Find out where you belong +====== +Whether you've been working for decades or are just starting in +non-engineering tech role, this advice can help you figure out where you +belong. +![Looking at a map for career journey][1] + +In the [first article in this series][2], I explained the problems with dividing people and roles into "technical" or "non-technical" categories. In the [second article][3], I shared some of the tech roles for people who don't code. Here, I'll wrap up this exploration into what it means to be technical or non-technical with some recommendations to help you on your journey. + +Whether you've been working in tech for decades, are just starting, or are looking to change careers, consider the advice in this article from people who have been labeled as non-technical but are succeeding in tech roles. + +> "Don't tie up what you do and your identity. Get them separate." +> —Adam Gordon Bell, Developer Relations, Earthly Technologies + +Switching roles doesn't mean your skills will disappear and you no longer have value. If you take on a new role, you need to focus on that role's critical skills. It takes time to develop skills. Take your time, and figure out the important skills for the new position. + +If you manage engineers, encourage them to develop their non-engineering skills and their technical skills. These skills often make a more significant difference in career growth and success than coding and technical skills. + +### Be yourself + +> "Don't let other people define whether you are technical or not-technical. "What's technical and what's not, and whether that's important or not is something the people have to figure out for themselves." +> —Adam Gordon Bell + +> "Don't ever start a conversation with, 'I'm not technical.' It can come across as, 'I need to warn you about this thing,' which is never a good impression to make for an interview, but it also has the potential to come across as a lack of confidence in your skills." +> —Mary Thengvall, Director of Developer Relations, Camunda + +Avoid the stereotypes; not all engineers like Star Wars or Star Trek. Not all engineers wear hoodies. Engineers can speak to people. + +> "People have a lot of perceptions about the technical, non-technical piece, in terms of how you present. When I was working in the office, I would wear a dress because that's how I feel comfortable." +> —Shailvi Wakhlu, Senior Director of Data, Strava + +### Know your worth + +As I discussed in the first article, being labeled non-technical can lead to [impostor syndrome][4]. Recognize your value, and don't apply the non-technical label to yourself because it can limit earning potential and career growth. + +> "People kept reboxing me into something else because they thought I was different from the normal stereotype that they had for an engineer. I'm so glad that I didn't listen to any of those people because inherently they were also telling me to go for a lesser-paying job on the basis of something that was in addition to the skills that I had." +> —Shailvi Wakhlu + +> "It is more likely the younger and … the woman in tech, especially new to tech, who's going to have imposter syndrome, who's going to consider themselves not technical enough. Like, 'oh, I only do front-end.' What do you mean you _only_ do front-end? Front-end is incredibly hard." +> —Liz Harris + +### Find where you can add value and help people + +You don't need to create a pull request to participate in open source. + +> "I always say to people when they try to contribute to open source projects, 'don't think, it's got to be a commit, it's got to be a pull request.' It's like, 'No. How can you add value to that project?' If you haven't got time to do the pull request, are you raising an issue and putting the points down?" +> —Eddie Jaoude, Open Source Developer, Jaoude Studios + +### Diversity of thought leads to success + +See the value and contributions of all roles and people. Don't pigeonhole them into a set of abilities based on their title. + +> "Realize how important everybody is, including yourself at all times, and the overall picture of things. Being creative shouldn't be ego-driven. Realize that you can always be better. You can also be worse at what you do. Don't be afraid to ask for help, and realize that we're in there together." +> —Therese Eberhard, scenic painter for film, commercials, and video + +> "The hackathons that I have attended where we've all been technical, we've built a great team of four or five hardcore coders, we've lost. I kid you not, we've lost. And before COVID, I won six previous hackathons, and half the team was focused on other areas. In the hackathons we won, half the team would be considered non-technical by most people, although I do not like this term, as it is about adding value to the team/project. We won because we had so many different perspectives on what we were building." +> —Eddie Jaoude + +> "The more we can move away from those labels of technical/not technical, developer/not developer, and understand that there's a continuum, the better off we're all going to be as far as hiring the right people for the job, instead of letting ourselves get hung up by the presumption that you need a technical team." +> —Mary Thengvall + +The more diverse our communities and teams are, the more inclusive they are. + +> "I honestly think the most important thing, whether it's from a community perspective or whether it's from a product perspective, just in general, we have to make sure that we built an inclusive community, not just for our products, not just for the technology that we're working on, but as a human society in general. And I'm going to guess… I'm going to wager that if we do that, as a human species, we will actually be better than what we were yesterday." +> —Leon Stigter, Senior Product Manager, Lightbend + +If you work in a non-coding tech role, what advice would you give people who consider themselves "non-technical" (or are considered by others to be so)? Share your insights in the comments. + +There are lots of non-code ways to contribute to open source: Here are three alternatives. + +This year's keynote speaker at the annual All Things Open conference is Red Hat's DeLisa Alexander... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/advice-non-technical + +作者:[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/career_journey_road_gps_path_map_520.png?itok=PpL6jJgY (Looking at a map for career journey) +[2]: https://opensource.com/article/21/2/what-does-it-mean-be-technical +[3]: https://opensource.com/article/21/2/non-engineering-jobs-tech +[4]: https://opensource.com/business/15/9/tips-avoiding-impostor-syndrome From 12a7ece7a358780bfab4a120ac3dc82ff09a1151 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 19 Feb 2021 08:47:48 +0800 Subject: [PATCH 373/381] translated --- ... source alternative to Google Analytics.md | 83 ------------------- ... source alternative to Google Analytics.md | 83 +++++++++++++++++++ 2 files changed, 83 insertions(+), 83 deletions(-) delete mode 100644 sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md create mode 100644 translated/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md diff --git a/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md b/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md deleted file mode 100644 index 463d9d9944..0000000000 --- a/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md +++ /dev/null @@ -1,83 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why choose Plausible for an open source alternative to Google Analytics) -[#]: via: (https://opensource.com/article/21/2/plausible) -[#]: author: (Ben Rometsch https://opensource.com/users/flagsmith) - -Why choose Plausible for an open source alternative to Google Analytics -====== -Plausible is gaining attention and users as a viable, effective -alternative to Google Analytics. -![Analytics: Charts and Graphs][1] - -Taking on the might of Google Analytics may seem like a big challenge. In fact, you could say it doesn't sound plausible… But that's exactly what [Plausible.io][2] has done with great success, signing up thousands of new users since 2018. - -Plausible's co-founders Uku Taht and Marko Saric recently appeared on [The Craft of Open Source][3] podcast to talk about the project and how they: - - * Created a viable alternative to Google Analytics - * Gained so much momentum in less than two years - * Achieved their goals by open sourcing the project - - - -Read on for a summary of their conversation with podcast host and Flagsmith founder Ben Rometsch. - -### How Plausible got started - -In winter 2018, Uku started coding a project that he thought was desperately needed—a viable, effective alternative to Google Analytics—after becoming disillusioned with the direction Google products were heading and the fact that all other data solutions seemed to use Google as a "data-handling middleman." - -Uku's first instinct was to focus on the analytics side of things using existing database solutions. Right away, he faced some challenges. The first attempt, using PostgreSQL, was technically naïve, as it became overwhelmed and inefficient pretty quickly. Therefore, his goal morphed into making an analytics product that can handle large quantities of data points with no discernable decline in performance. To cut a long story short, Uku succeeded, and Plausible can now ingest more than 80 million records per month. - -The first version of Plausible was released in summer 2019. In March 2020, Marko came on board to head up the project's communications and marketing side. Since then, its popularity has grown with considerable momentum. - -### Why open source? - -Uku was keen to follow the "indie hacker" route of software development: create a product, put it out there, and see how it grows. Open source makes sense in this respect because you can quickly grow a community and gain popularity. - -But Plausible didn't start out as open source. Uku was initially concerned about the software's sensitive code, such as billing codes, but he soon released that this was of no use to people without the API token. - -Now, Plausible is fully open source under [AGPL][4], which they chose instead of the MIT License. Uku explains that under an MIT License, anyone can do anything to the code without restriction. Under AGPL, if someone changes the code, they must open source their changes and contribute the code back to the community. This means that large corporations cannot take the original code, build from it, then reap all the rewards. They must share it, making for a more level playing field. For instance, if a company wanted to plug in their billing or login system, they would be legally obliged to publish the code. - -During the podcast, Uku asked me about Flagsmith's license which is currently under a BSD 3-Clause license, which is highly permissive, but I am about to move some features behind a more restrictive license. So far, the Flagsmith community has been understanding of the change as they realize this will lead to more and better features. - -### Plausible vs. Google Analytics - -Uku says, in his opinion, the spirit of open source is that the code should be open for commercial use by anyone and shared with the community, but you can keep back a closed-source API module as a proprietary add-on. In this way, Plausible and other companies can cater to different use-cases by creating and selling bespoke API add-on licenses. - -Marko is a developer by trade, but from the marketing side of things, he worked to get the project covered on sites such as Hacker News and Lobster and build a Twitter presence to help generate momentum. The buzz created by this publicity also meant that the project took off on GitHub, going from 500 to 4,300 stars. As traffic grew, Plausible appeared on GitHub's trending list, which helped its popularity snowball. - -Marko also focused heavily on publishing and promoting blog posts. This strategy paid off, as four or five posts went viral within the first six months, and he used those spikes to amplify the marketing message and accelerate growth. - -The biggest challenge in Plausible's growth was getting people to switch from Google Analytics. The project's main goal was to create a web analytics product that is useful, efficient, and accurate. It also needed to be compliant with regulations and offer a high degree of privacy for both the business and website visitors. - -Plausible is now running on more than 8,000 websites. From talking to customers, Uku estimates that around 90% of them would have run Google Analytics. - -Plausible runs on a standard software-as-a-service (SaaS) subscription model. To make things fairer, it charges per page view on a monthly basis, rather than charging per website. This can prove tricky with seasonal websites, say e-commerce sites that spike at the holidays or US election sites that spike once every four years. These can cause pricing problems under the monthly subscription model, but it generally works well for most sites. - -### Check out the podcast - -To discover more about how Uku and Marko grew the open source Plausible project at a phenomenal rate and made it into a commercial success, [listen to the podcast][3] and check out [other episodes][5] to learn more about "the ins-and-outs of the open source software community." - -Sandstorm's Jade Wang shares some of her favorite open source web apps that are self-hosted... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/plausible - -作者:[Ben Rometsch][a] -选题:[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/flagsmith -[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://plausible.io/ -[3]: https://www.flagsmith.com/podcast/02-plausible -[4]: https://www.gnu.org/licenses/agpl-3.0.en.html -[5]: https://www.flagsmith.com/podcast diff --git a/translated/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md b/translated/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md new file mode 100644 index 0000000000..989e43db08 --- /dev/null +++ b/translated/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why choose Plausible for an open source alternative to Google Analytics) +[#]: via: (https://opensource.com/article/21/2/plausible) +[#]: author: (Ben Rometsch https://opensource.com/users/flagsmith) + +为什么选择 Plausible 作为 Google Analytics 的开源替代品? +====== +Plausible作为Google Analytics 的可行,有效的替代方案正在引起用户的关注。 +![Analytics: Charts and Graphs][1] + +发挥 Google Analytics 的威力似乎是一个巨大的挑战。实际上,你可以说这听起来似乎不合理。但这正是 [Plausible.io][2]取得巨大成功的原因,自 2018 年以来已注册了数千名新用户。 + +Plausible 的联合创始人 Uku Taht 和 Marko Saric 最近出现在 [The Craft of Open Source][3] 播客上,谈论了这个项目以及他们如何: + +* 创建了一个可行的替代 Google Analytics 的方案 +* 在不到两年的时间里获得了如此大的发展势头 +* 通过开源项目外包实现其目标 + + + +请继续阅读他们与播客主持人和 Flagsmith 创始人 Ben Rometsch 的对话摘要。 + +### Plausible 是如何开始的 + +2018年 冬天,Uku 开始编写一个他认为急需的项目:一个可行的、有效的 Google Analytics 替代方案。因为他对 Google 产品的发展方向感到失望,而且所有其他数据解决方案似乎都把 Google 当作“数据处理中间人”。 + +Uku 的第一直觉是利用现有的数据库解决方案专注于分析方面的工作。马上,他就遇到了一些挑战。第一次尝试使用了 PostgreSQL,这在技术上很幼稚,因为它很快就变得不堪重负,效率很低。因此,他的目标蜕变成了做一个分析产品,可以处理大量的数据点,而且性能不会有明显的下降。长话短说,Uku 成功了,Plausible 现在每月可以摄取超过 8000 万条记录。 + +Plausible 的第一个版本于 2019 年夏天发布。2020 年 3 月,Marko 加入,负责项目的传播和营销方面的工作。从那时起,它的受欢迎程度以相当大的势头增长。 + +### 为什么要开源? + +Uku 热衷于遵循“独立黑客”的软件开发路线:创建一个产品,把它放在那里,然后看看它如何成长。开源在这方面是有意义的,因为你可以迅速发展一个社区并获得人气。 + +但 Plausible 一开始并不是开源的。Uku 最初担心软件的敏感代码,比如计费代码,但他很快就发布了,因为这对没有 API 令牌的人来说是没有用的。 + + +现在,Plausible 是在 [AGPL][4] 下完全开源的,他们选择了 AGPL 而不是 MIT 许可。Uku 解释说,在 MIT 许可下,任何人都可以不受限制地对代码做任何事情。在 AGPL 下,如果有人修改代码,他们必须将他们的修改开源,并将代码回馈给社区。这意味着,大公司不能拿着原始代码,在此基础上进行构建,然后获得所有的回报。他们必须共享,使得竞争环境更加公平。例如,如果一家公司想插入他们的计费或登录系统,他们将有法律义务发布代码。 + + +在播客中,Uku 问我关于 Flagsmith 的授权,目前Flagsmith的授权采用 BSD 3-Clause 许可,该许可证是高度允许的,但我即将把一些功能移到更严格的许可后面。到目前为止,Flagsmith 社区已经理解了这一变化,因为他们意识到这将带来更多更好的功能。 + +### Plausible vs. Google Analytics + +Uku说,在他看来,开源的精神是,代码应该是开放的,任何人都可以进行商业使用,并与社区共享,但你可以把一个闭源的 API 模块作为专有附加组件保留下来。这样一来,Plausible 和其他公司就可以通过创建和销售定制的 API 附加许可来满足不同的使用场景。 + +Marko 职位上是一名开发者,但从营销方面来说,他努力让这个项目在 Hacker News 和 Lobster 等网站上得到报道,并建立了 Twitter 帐户以帮助产生动力。这种宣传带来的热潮也意味着该项目在 GitHub 上起飞,从 500 颗星到 4300 颗星。随着流量的增长,Plausible 出现在 GitHub 的趋势列表中,这帮助它的人气滚起了雪球。 + +Marko 还非常注重发布和推广博客文章。这一策略得到了回报,在最初的 6 个月里,有四五篇文章进入了病毒式传播,他利用这些峰值来放大营销信息,加速了增长。 + +Plausible 成长过程中最大的挑战是让人们从 Google Analytics 上转换过来。这个项目的主要目标是创建一个有用、高效、准确的网络分析产品。它还需要符合法规,并为企业和网站访问者提供高度的隐私。 + +Plausible 现在已经在 8000 多个网站上运行。通过与客户的交谈,Uku 估计其中约 90% 的客户会已经用过 Google Analytics。 + +Plausible 以标准的软件即服务 (SaaS) 订阅模式运行。为了让事情更公平,它按月页面浏览量收费,而不是按网站收费。对于季节性网站来说,这可能会有麻烦,比如说电子商务网站在节假日会激增,或者美国大选网站每四年激增一次。这些可能会导致月度订阅模式下的定价问题,但它通常对大多数网站很好。 + + +### 查看播客 + +想要了解更多关于 Uku 和 Marko 如何以惊人的速度发展开源 Plausible 项目,并使其获得商业上的成功,请[收听播客][3],并查看[其他集锦][5],了解更多关于“开源软件社区的来龙去脉”。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/plausible + +作者:[Ben Rometsch][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/flagsmith +[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://plausible.io/ +[3]: https://www.flagsmith.com/podcast/02-plausible +[4]: https://www.gnu.org/licenses/agpl-3.0.en.html +[5]: https://www.flagsmith.com/podcast \ No newline at end of file From 2187dba603d426a855993a308ff50df16bb47770 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 19 Feb 2021 08:51:58 +0800 Subject: [PATCH 374/381] translating --- ... this bootable USB drive on Linux to rescue Windows users.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210217 Use this bootable USB drive on Linux to rescue Windows users.md b/sources/tech/20210217 Use this bootable USB drive on Linux to rescue Windows users.md index 22ddf703d9..9a8c541d12 100644 --- a/sources/tech/20210217 Use this bootable USB drive on Linux to rescue Windows users.md +++ b/sources/tech/20210217 Use this bootable USB drive on Linux to rescue Windows users.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5df061104db6df2146740ed96d1cc0fc83704508 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 19 Feb 2021 09:25:54 +0800 Subject: [PATCH 375/381] Rename sources/tech/20210218 Not an engineer- Find out where you belong.md to sources/talk/20210218 Not an engineer- Find out where you belong.md --- .../20210218 Not an engineer- Find out where you belong.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210218 Not an engineer- Find out where you belong.md (100%) diff --git a/sources/tech/20210218 Not an engineer- Find out where you belong.md b/sources/talk/20210218 Not an engineer- Find out where you belong.md similarity index 100% rename from sources/tech/20210218 Not an engineer- Find out where you belong.md rename to sources/talk/20210218 Not an engineer- Find out where you belong.md From cd3905f6df24c49632fb91bee2319923ec249958 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 19 Feb 2021 11:10:16 +0800 Subject: [PATCH 376/381] PRF @mengxinayan --- ...to get started with open source in 2021.md | 94 ++++++++++--------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/translated/tech/20210118 10 ways to get started with open source in 2021.md b/translated/tech/20210118 10 ways to get started with open source in 2021.md index b57fca86f5..c9c6e31bc0 100644 --- a/translated/tech/20210118 10 ways to get started with open source in 2021.md +++ b/translated/tech/20210118 10 ways to get started with open source in 2021.md @@ -1,100 +1,102 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (10 ways to get started with open source in 2021) [#]: via: (https://opensource.com/article/21/1/getting-started-open-source) [#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeo) -2021 年开始使用开源的10钟方法 +2021 年开始使用开源的 10 种方式 ====== -如果您刚开始接触开源,那么下面的 2020 年十大文章有助于指导您的发展之路。 -![看着职业生涯的地图][1] -opensource.com 存在的意义是为了向世界宣传开源的一切,从新工具到框架拓展到社区。我们的目标是让想要使用开源或为开源做贡献的人更容易参与其中。 +> 如果你刚开始接触开源,那么下面的 2020 年十篇好文章有助于指导你的发展之路。 -入门开源可能很难,所以我们定期分享如何参与其中的提示和建议。如果你想要学习 Python,帮助抗击 COVID-19,或者加入 K8s 设置,我们将为您服务。 +![](https://img.linux.net.cn/data/attachment/album/202102/19/110943di1i609a9spys1i1.jpg) -为了帮助您开始,我们总结了2020年发布的 10 篇最流行的开源入门文章。希望它们能激发您在 2021 年学习一些新知识。 +我们存在的意义是为了向世界宣传开源的一切,从新工具到框架拓展到社区。我们的目标是让想要使用开源或为开源做贡献的人更容易参与其中。 -### 利用 Python 实现网络爬虫的新手指南 +入门开源可能很难,所以我们定期分享如何参与其中的提示和建议。如果你想要学习 Python,帮助抗击 COVID-19,或者加入 K8s 设置,我们将为你服务。 -您是否想通过实践而不是阅读来学习 Python?在本教程中,Julia Piaskowski 将会指导您完成她的第一个[Python 网页爬取项目][2]。她具体展示了如何使用 Python 库请求访问网页内容。 +为了帮助你开始,我们总结了 2020 年发布的 10 篇最流行的开源入门文章。希望它们能激发你在 2021 年学习一些新知识。 -Julia 详细介绍了每一步,从安装 Python3 到使用 pandas 来清洁 Web 抓取结果。她利用了大量截图解释了如何以最终目标为目的进行爬取。 +### 《利用 Python 爬取网站的新手指南》 -有关爬取相关内容的部分特别有用;当遇到困难处时,她会详细解释。但是,与本文的其余部分一样,她会指导您完成每个步骤。 +你是否想通过实践而不是阅读来学习 Python?在本教程中,Julia Piaskowski 将会指导你完成她的第一个[Python 网页爬取项目][2]。她具体展示了如何使用 Python 的 `requests` 库访问网页内容。 -### 在 Linux 上使用 SSH 进行远程连接的初学者指南 +Julia 详细介绍了每一步,从安装 Python3 到使用 Pandas 来清理 Web 抓取结果。她利用了大量截图解释了如何以最终目标为目的进行爬取。 + +有关爬取相关内容的部分特别有用;当遇到困难处时,她会详细解释。但是,与本文的其余部分一样,她会指导你完成每个步骤。 + +### 《在 Linux 上使用 SSH 进行远程连接的初学者指南》 如果你之前从未使用过安全 shell(SSH),那么你在第一次使用时可能会感到困惑。在本教程中,Seth Kenlon 展示了[如何为两台计算机之间配置 SSH 连接][3],以及如何不使用密码而安全地进行连接。 -Seth 解释了建立 SSH 连接的每个步骤,从您应该了解的四个关键术语到在每个主机上激活 SSH 的步骤。他还提供了有关查找计算机 IP 地址、创建 SSH 密钥以及堆远程计算机的远程访问权限的建议。 +Seth 解释了建立 SSH 连接的每个步骤,从你应该了解的四个关键术语到在每个主机上激活 SSH 的步骤。他还提供了有关查找计算机 IP 地址、创建 SSH 密钥以及对远程计算机的远程访问权限的建议。 -### 学习任何编程语言的 5 个步骤 +### 《五步学会任何编程语言》 -如果您已经掌握了一种编程语言,则可以[全部学习[4]。这是 Seth Kenlon 编写本文的前提,他认为了解一些基本编程逻辑便可以跨语言拓展。 +如果你已经掌握了一种编程语言,你就能[学习所有的语言][4]。这是 Seth Kenlon 编写本文的前提,他认为了解一些基本编程逻辑便可以跨语言拓展。 -Seth 分享了程序员在学习一种新的编程语言或编码方式时所需要的五种东西。语法、内置函数和解析器位于这五种之中,他将会陪着每个人采取行动。 +Seth 分享了程序员在学习一种新的编程语言或编码方式时所需要的五种东西。语法、内置函数和解析器是这五种之一,他对每一种都附上了行动步骤。 -那么团结它们的关键方式是?一旦了解了代码工作原理,您就可以跨语言拓展。没有什么太难的让您学习。 +那么将它们统一起来的关键方式是?一旦了解了代码工作原理,你就可以跨语言拓展。对你来说,没有什么是太难学的。 -### 为 COVID-19 贡献开源医疗项目 +### 《为 COVID-19 贡献开源医疗项目》 -您是否知道一家意大利医院通过 3D 打印机设备挽救了 COVID-19 患者的生命?这是开源贡献者为 2020 年 COVID-19 大流行[建立的众多解决方案之一][5]。 +你是否知道一家意大利医院通过 3D 打印机设备挽救了 COVID-19 患者的生命?这是开源贡献者为 2020 年 COVID-19 大流行[建立的众多解决方案之一][5]。 -在本文中,Joshua Pearce 分享了针对 COVID-19 的开源志愿服务项目。虽然 Open Air 是最大的项目,但 Joshua 解释了如何在 wiki 上为开源呼吸机工作,编写开源 COVID-19 医疗供应要求,测试开源氧气浓缩机原型等。 +在本文中,Joshua Pearce 分享了针对 COVID-19 的开源志愿服务项目。虽然 Open Air 是最大的项目,但 Joshua 解释了如何为开源呼吸机的维基工作,编写开源 COVID-19 医疗供应要求,测试开源氧气浓缩机原型等。 -### GNOME 入门建议 +### 《GNOME 入门建议》 -GNOME 是最受欢迎的 Linux 桌面之一,但是它适合您吗?本文分享了[来自 GNOME 用户的建议][6],以及 opensource.com 上有关此主题的文章。 +GNOME 是最受欢迎的 Linux 桌面之一,但是它适合你吗?本文分享了[来自 GNOME 用户的建议][6],以及有关此主题的文章。 -想要在配置桌面上寻找一些灵感吗?本文包含了有关 GNOME 拓展入门,将 Dash 安装到 Dock,使用 GNOME Tweak 工具等的链接。 +想要在配置桌面上寻找一些灵感吗?本文包含了有关 GNOME 扩展入门,将 Dash 安装到 Dock,使用 GNOME Tweak 工具等的链接。 -毕竟,您可能会认为 GNOME 仍然不适合您——不用担心,最后您将找到指向其他 Linux 桌面和窗口管理器的链接。 +不过,你仍然可能会认为 GNOME 不适合你——不用担心,最后你将找到指向其他 Linux 桌面和窗口管理器的链接。 -### 现在开始为开源做贡献的 3 个理由 +### 《现在开始为开源做贡献的 3 个理由》 -截至到 2020 年 6 月,Github 托管了超过 180,000 个公共仓库。现如今加入开源社区比过去更容易,但这是意味着您应该这样做?在本文中,opensource.com 通讯员 Jason Blais [分享了三个尝试的原因][7]。 +截至到 2020 年 6 月,Github 托管了超过 180,000 个公共仓库。现如今加入开源社区比过去更容易,但这是否意味着你应该加入开源?在本文中,Jason Blais [分享了三个投身开源的原因][7]。 -为开源做贡献可以增强您的信心,简历和专业网络。Jason 还解释了如何利用有用的信息,从如何在领英(LinkedIn)个人资料中添加开源信息,到如何将这些信息转变为付费角色。 最后还列出了供初学者使用的出色项目。 +为开源做贡献可以增强你的信心、简历和专业网络。Jason 还解释了如何利用有用的信息,从如何在领英个人资料中添加开源信息,到如何将这些贡献转变为付费角色。最后还列出了供初学者参与的出色项目。 -### 作为 Linux 系统管理员为开源做贡献的 4 种方法 +### 《作为 Linux 系统管理员为开源做贡献的 4 种方法》 系统管理员是开源的无名英雄。他们在代码背后做了大量工作,这些代码非常有价值,但通常是看不见的。 -在本文中,Elizabeth K. Joseph 介绍了她如何以 Linux 系统管理员的身份[来改善开源项目][8]。她离开社区比发现社区更好的几种方式为用户支持、托管项目资源以及查找新的网站环境。 +在本文中,Elizabeth K. Joseph 介绍了她如何以 Linux 系统管理员的身份[来改善开源项目][8]。用户支持、托管项目资源、寻找新的网站环境是让社区比她发现时变得更好的几种方式。 -也许最重要的贡献是什么?文档!Elizabeth 开始使用开源程序,为她使用的项目重写了快速入门指南。同时向您经常使用的项目提交错误和补丁报告是参与其中的理想方法。 +也许最重要的贡献是什么?文档!Elizabeth 在开源领域的起步是她为使用的项目重写了快速入门指南。向你经常使用的项目提交错误和补丁报告是参与其中的理想方法。 -### 为 Slack 的开源替代品做出贡献的 6 种方法 +### 《为 Slack 的开源替代品做出贡献的 6 种方法》 -Mattermost 是需要开源消息传递系统的团队的流行平台。其活跃、充满活力的社区是让用户保持忠诚度的关键因素,尤其是对那些具有 Go,React 和 DevOps 经验的用户。 +Mattermost 是一个很受欢迎的平台,适合那些想要一个开源消息传递系统的团队的平台。其活跃、充满活力的社区是让用户保持忠诚度的关键因素,尤其是对那些具有 Go、React 和 DevOps 经验的用户。 -如果您想[为 Mattermost 做出贡献][9],Jason Blais 具体介绍了如何参与其中。将本文视为您的入门文档:Blais 分享了您要采取的步骤,并介绍了您可以做出的六种贡献。 +如果你想[为 Mattermost 做出贡献][9],Jason Blais 具体介绍了如何参与其中。将本文视为你的入门文档:Blais 分享了你要采取的步骤,并介绍了你可以做出的六种贡献。 -无论您是要构建集成还是本地化语言,本文都将介绍如何进行。 +无论你是要构建一个集成还是本地化你的语言,本文都将介绍如何进行。 -### 如何为 K8s 做贡献 +### 《如何为 Kubernetes 做贡献》 -当我走进 2018 年温哥华青年开源峰会却不了解 K8s。主题演讲结束后,我离开会场后依然是一个困惑的女人。毫不夸张地说,K8s 已经彻底改变了开源:找到一个更受欢迎、更具影响力的项目很困难。 +当我走进 2018 年温哥华青年开源峰会时,还很年轻,对 Kubernetes 一无所知。主题演讲结束后,我离开会场后依然是一个有所改变而依然困惑的女人。毫不夸张地说,Kubernetes 已经彻底改变了开源,这并不夸张:很难找到一个更受欢迎、更有影响力的项目。 -如果您想做出贡献,那么 IBM 工程师 Tara Gu 介绍了[她是如何开始的][10]。本文介绍了她在 All Things Open 2019 会议上的闪电演讲的回顾以及包括她亲自演讲的视频。还记得那些吗? +如果你想做出贡献,那么 IBM 工程师 Tara Gu 介绍了[她是如何开始的][10]。本文介绍了她在 All Things Open 2019 会议上的闪电演讲的回顾以及包括她亲自演讲的视频。还记得吗? -### 任何人如何在工作中为开源软件做出贡献 +### 《任何人如何在工作中为开源软件做出贡献》 -必要性是发明之母,尤其是在开源中。许多人针对自己遇到的问题构建开源解决方案。但是如果开发人员在没有收集目标用户反馈的情况下通过构建产品而错过了商标,会发生什么呢? +需求是发明之母,尤其是在开源领域。许多人针对自己遇到的问题构建开源解决方案。但是如果开发人员在没有收集目标用户反馈的情况下通过构建产品而错过了目标,会发生什么呢? -产品和设计团队通常会填补企业中的这一空白。如果开源团队中不存在这样的角色,开发人员应该怎么做? +在企业中,产品和设计团队通常会填补这一空白。如果开源团队中不存在这样的角色,开发人员应该怎么做? 在本文中,Catherine Robson 介绍了开源团队如何从目标用户那里[收集反馈][11]。它为希望与开发人员分享他们的工作经验,从而将他们的反馈贡献到开源项目的人们而编写。 -Catherine 概述的步骤将帮助您与开源团队分享您的见解,并在帮助团队开发更好的产品方面发挥关键作用。 +Catherine 概述的步骤将帮助你与开源团队分享你的见解,并在帮助团队开发更好的产品方面发挥关键作用。 -### 您想要学习什么? +### 你想要学习什么? -您想了解开源入门哪些方面的知识?请在评论中分享您堆文章主题的建议。同时如果您有一个故事可以分享,以帮助他人开始使用开源软件,请考虑为 opensource.com [编写文章][12]。 +你想了解开源入门哪些方面的知识?请在评论中分享你对文章主题的建议。同时如果你有故事可以分享,以帮助他人开始使用开源软件,请考虑[撰写文章][12]。 -------------------------------------------------------------------------------- @@ -103,16 +105,16 @@ via: https://opensource.com/article/21/1/getting-started-open-source 作者:[Lauren Maffeo][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/) 荣誉推出 [a]: https://opensource.com/users/lmaffeo [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/career_journey_road_gps_path_map_520.png?itok=PpL6jJgY (Looking at a map for career journey) -[2]: https://opensource.com/article/20/5/web-scraping-python +[2]: https://linux.cn/article-13047-1.html [3]: https://opensource.com/article/20/9/ssh -[4]: https://opensource.com/article/20/10/learn-any-programming-language +[4]: https://linux.cn/article-12842-1.html [5]: https://opensource.com/article/20/3/volunteer-covid19 [6]: https://opensource.com/article/20/6/gnome-users [7]: https://opensource.com/article/20/6/why-contribute-open-source From 07671ed0f26af986ba7d319f05fa61b83c705949 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 19 Feb 2021 11:11:08 +0800 Subject: [PATCH 377/381] PUB @mengxinayan https://linux.cn/article-13132-1.html --- ...0210118 10 ways to get started with open source in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210118 10 ways to get started with open source in 2021.md (99%) diff --git a/translated/tech/20210118 10 ways to get started with open source in 2021.md b/published/20210118 10 ways to get started with open source in 2021.md similarity index 99% rename from translated/tech/20210118 10 ways to get started with open source in 2021.md rename to published/20210118 10 ways to get started with open source in 2021.md index c9c6e31bc0..0918235499 100644 --- a/translated/tech/20210118 10 ways to get started with open source in 2021.md +++ b/published/20210118 10 ways to get started with open source in 2021.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13132-1.html) [#]: subject: (10 ways to get started with open source in 2021) [#]: via: (https://opensource.com/article/21/1/getting-started-open-source) [#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeo) From 8651af28ee49711aa70e10750429785f270dde1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Fri, 19 Feb 2021 12:04:01 +0800 Subject: [PATCH 378/381] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020171025=20Typese?= =?UTF-8?q?t=20your=20docs=20with=20LaTeX=20and=20TeXstudio=20on=20Fedora?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md --- ...docs with LaTeX and TeXstudio on Fedora.md | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 sources/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md diff --git a/sources/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md b/sources/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md new file mode 100644 index 0000000000..7f812b776b --- /dev/null +++ b/sources/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md @@ -0,0 +1,154 @@ +[#]: collector: (Chao-zhi) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Typeset your docs with LaTeX and TeXstudio on Fedora) +[#]: via: (https://fedoramagazine.org/typeset-latex-texstudio-fedora/) +[#]: author: (Julita Inca Chiroque ) + +Typeset your docs with LaTeX and TeXstudio on Fedora +====== +![](https://fedoramagazine.org/wp-content/uploads/2017/07/latex-texstudio-945x400.jpg) + +LaTeX is [a document preparation system][1] for high-quality typesetting. It’s often used for larger technical or scientific documents. However, you can use LaTeX for almost any form of publishing. Teachers can edit their exams and syllabi, and students can present their thesis and reports for classes. This article gets you started with the TeXstudio app. TeXstudio makes it easy to edit LaTeX documents. + +### Launching TeXstudio + +If you’re using Fedora Workstation, launch Software, and type TeXstudio to search for the app. Then select Install to add TeXstudio to your system. You can also launch the app from Software, or go to the shell overview as usual. + +Alternately, if you use a terminal, type texstudio. If the package isn’t installed, the system prompts you to install it. Type y to start the installation. + +``` +$ texstudio +bash: texstudio: command not found... +Install package 'texstudio' to provide command 'texstudio'? [N/y] y +``` + +LaTeX commands typically start with a backslash (), and command parameters are enclosed in curly braces { }. Start by declaring the type of the documentclass. This example shows you the document class is an article. + +Then, once you declare the documentclass, mark the beginning and the end of the document with begin and end. In between these commands, write a paragraph similar to the following: + +``` +\documentclass{article} +\begin{document} +The Fedora Project is a project sponsored by Red Hat primarily to co-ordinate the development of the Linux-based Fedora operating system, operating with the vision that the project "creates a world where free culture is welcoming and widespread, collaboration is commonplace, and people control their content and devices". The Fedora Project was founded on 22 September 2003 when Red Hat decided to split Red Hat Linux into Red Hat Enterprise Linux (RHEL) and a community-based operating system, Fedora. +\end{document} +``` + +![](https://fedoramagazine.org/wp-content/uploads/2017/07/Screenshot-from-2017-10-05-20-19-15.png) + +### Working with spacing + +To create a paragraph break, leave one or more blank spaces between text.  Here’s an example with four paragraphs: + +![](https://fedoramagazine.org/wp-content/uploads/2017/07/Screenshot-from-2017-10-18-14-24-42.png) + +You can see from the example that more than one line break doesn’t create additional blank space between paragraphs. However, if you do need to leave additional space, use the commands hspace and vspace. These add horizontal and vertical space, respectively. Here is some example code that shows additional spacing around paragraphs: + +``` +\documentclass{article} +\begin{document} + +\hspace{2.5cm} The four essential freedoms + +\vspace{0.6cm} +A program is free software if the program's users have the 4 essential freedoms: + +The freedom to run the program as you wish, for any purpose (freedom 0).\vspace{0.2cm} +The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.\vspace{0.2cm} + +The freedom to redistribute copies so you can help your neighbour (freedom 2).\vspace{0.2cm} + +The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this. + +\end{document} +``` + +![](https://fedoramagazine.org/wp-content/uploads/2017/07/Screenshot-from-2017-10-18-17-24-53.png) + +### Using Lists and Formats + +This example would look better if it presented the four essential freedoms of free software as a list. Set the list structure by using \begin{itemize} at the beginning of the list, and \end{itemize} at the end. Precede each item with the command \item. + +Additional format also helps make the text more readable. Useful commands for formatting include bold, italic, underline, huge, large, tiny and textsc to help emphasize text: + +``` +\documentclass{article} +\begin{document} + +\hspace{2cm} {\huge The four essential freedoms} + +\vspace{0.6cm} +\noindent {\large A program is free software if the program's users have the 4 essential freedoms}: +\begin{itemize} +\item \vspace{0.2cm} +\noindent \textbf{The freedom to run} the program as you wish, for any purpose \textit{(freedom 0)}. \vspace{0.2cm} +\item \noindent \textbf{The freedom to study} how the program works, and change it so it does your computing as you wish \textit{(freedom 1)}. Access to the source code is a precondition for this.\vspace{0.2cm} + +\item \noindent \textbf{The freedom to redistribute} copies so you can help your neighbour \textit{(freedom 2)}.\vspace{0.2cm} + +\item \noindent \textbf{The freedom to distribute copies of your modified versions} to others \textit{(freedom 3)}. \tiny{By doing this you can give the whole community a chance to benefit from your changes.\underline{\textsc{ Access to the source code is a precondition for this.}}} +\end{itemize} +\end{document} +``` + +### Adding columns, images and links + +Columns, images and links help add further information to your text. LaTeX includes functions for some advanced features as packages. The \usepackage command loads the package so you can make use of these features. + +For example, to make an image visible, you might use the command \usepackage{graphicx}. Or, to set up columns and links, use \usepackage{multicol} and \usepackage{hyperref}, respectively. + +The \includegraphics command places an image inline in your document. (For simplicity, include the graphics file in the same directory as your LaTeX source file.) + +Here’s an example that uses all these concepts. It also uses two PNG graphics files that were downloaded. Try your own graphics to see how they work. + +``` +\documentclass{article} +\usepackage{graphicx} +\usepackage{multicol} +\usepackage{hyperref} +\begin{document} + \textbf{GNU} + \vspace{1cm} + + GNU is a recursive acronym for "GNU's Not Unix!", chosen because GNU's design is Unix-like, but differs from Unix by being free software and containing no Unix code. + + Richard Stallman, the founder of the project, views GNU as a "technical means to a social end". Stallman has written about "the social aspects of software and how Free Software can create community and social justice." in his "Free Society" book. + \vspace{1cm} + + \textbf{Some Projects} + + \begin{multicols}{2} + Fedora + \url{https://getfedora.org} + \includegraphics[width=1cm]{fedora.png} + + GNOME + \url{https://getfedora.org} + \includegraphics[width=1cm]{gnome.png} + \end{multicols} + +\end{document} +``` + +[][2] + +The features here only scratch the surface of LaTeX capabilities. You can learn more about them at the project [help and documentation site][3]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/typeset-latex-texstudio-fedora/ + +作者:[Julita Inca Chiroque][a] +选题:[Chao-zhi][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/yulytas/ +[b]: https://github.com/Chao-zhi +[1]:http://www.latex-project.org/about/ +[2]:https://fedoramagazine.org/fedora-aarch64-on-the-solidrun-honeycomb-lx2k/ +[3]:https://www.latex-project.org/help/ From 6bca10569cfbfb98855ef1fe02a31001ace91c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Fri, 19 Feb 2021 12:08:32 +0800 Subject: [PATCH 379/381] translating by Chao-zhi --- ...25 Typeset your docs with LaTeX and TeXstudio on Fedora.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md b/sources/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md index 7f812b776b..4a64e58971 100644 --- a/sources/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md +++ b/sources/tech/20171025 Typeset your docs with LaTeX and TeXstudio on Fedora.md @@ -1,5 +1,5 @@ [#]: collector: (Chao-zhi) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -142,7 +142,7 @@ via: https://fedoramagazine.org/typeset-latex-texstudio-fedora/ 作者:[Julita Inca Chiroque][a] 选题:[Chao-zhi][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi][b] 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 99cb7bc83176bc033242f8d8ca67cad57e9b8139 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 19 Feb 2021 13:50:02 +0800 Subject: [PATCH 380/381] PRF @wxy --- ...s that make Linux the ideal workstation.md | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/translated/tech/20210208 3 open source tools that make Linux the ideal workstation.md b/translated/tech/20210208 3 open source tools that make Linux the ideal workstation.md index 0669873c8b..50b5f80f3d 100644 --- a/translated/tech/20210208 3 open source tools that make Linux the ideal workstation.md +++ b/translated/tech/20210208 3 open source tools that make Linux the ideal workstation.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (3 open source tools that make Linux the ideal workstation) @@ -10,25 +10,25 @@ 让 Linux 成为理想的工作站的 3 个开源工具 ====== -> Linux 不但拥有你认为所需的一切,还有可以让你高效工作的更多工具。 +> Linux 不但拥有你认为所需的一切,还有更多可以让你高效工作的工具。 -![使用笔记本电脑的人][1] +![](https://img.linux.net.cn/data/attachment/album/202102/19/134935qhe252ifbvbpnzxk.jpg) -在 2021 年,人们喜欢 Linux 的理由比以往任何时候都多。在这个系列中,我将分享 21 个使用 Linux 的不同理由。今天,我将与你分享为什么 Linux 是你工作的最佳选择。 +在 2021 年,有更多让人们喜欢 Linux 的理由。在这个系列中,我将分享 21 种使用 Linux 的不同理由。今天,我将与你分享为什么 Linux 是你工作的最佳选择。 -每个人都希望在工作期间提高工作效率。如果你的工作通常涉及到文档、演示文稿和电子表格的工作,那么你可能已经习惯了一种特定的例行工作。问题是,这个*惯常的例行工作*通常是由一两个特定的应用程序决定的,无论是某个办公套件还是桌面操作系统。当然,一种习惯并不意味着它是理想的,然而它往往会毫无疑义地坚持下去,甚至影响到企业的运行结构。 +每个人都希望在工作期间提高工作效率。如果你的工作通常涉及到文档、演示文稿和电子表格的工作,那么你可能已经习惯了特定的例行工作。问题在于,这个*惯常的例行工作*通常是由一两个特定的应用程序决定的,无论是某个办公套件还是桌面操作系统。当然,习惯并不意味着它是理想的,但是它往往会毫无疑义地持续存在,甚至影响到企业的运作架构。 ### 更聪明地工作 -如今,许多办公应用程序都在云端运行,因此如果你确实愿意,你可以在 Linux 上使用相同的方式。然而,由于许多典型的大名鼎鼎的办公应用程序并不符合 Linux 上的文化预期,因此你可能会发现自己受到启发,想去探索其他的选择。正如任何渴望走出“舒适区”的人所知道的那样,这种微妙的打破可能会出奇的有用。很多时候,你不知道自己效率低下,因为你实际上并没有尝试过以不同的方式做事。强迫自己去探索其他方式,而你永远不知道会发现什么。你甚至不必完全知道要寻找的内容。 +如今,许多办公应用程序都在云端运行,因此如果你愿意的话,你可以在 Linux 上使用相同的方式。然而,由于许多典型的知名办公应用程序并不符合 Linux 上的文化预期,因此你可能会发现自己受到启发,想去探索其他的选择。正如任何渴望走出“舒适区”的人所知道的那样,这种微妙的打破可能会出奇的有用。很多时候,你不知道自己效率低下,因为你实际上并没有尝试过以不同的方式做事。强迫自己去探索其他方式,你永远不知道会发现什么。你甚至不必完全知道要寻找的内容。 ### LibreOffice -Linux(或任何其他平台)上最明显的开源办公主力之一是 [LibreOffice][2]。它具有多个组件,包括文字处理器、演示软件、电子表格、关系型数据库接口、矢量绘图等。它可以从其他流行的办公应用程序中导入许多文档格式,因此从其他工具过渡到 LibreOffice 通常很容易。 +Linux(或任何其他平台)上显而易见的开源办公主力之一是 [LibreOffice][2]。它具有多个组件,包括文字处理器、演示软件、电子表格、关系型数据库界面、矢量绘图等。它可以从其他流行的办公应用程序中导入许多文档格式,因此从其他工具过渡到 LibreOffice 通常很容易。 -然而,LibreOffice 不仅仅是一个伟大的办公套件。LibreOffice 支持宏,所以机智的用户可以自动完成重复性任务。它还具有终端命令的功能,因此你可以在不启动 LibreOffice 界面的情况下执行许多任务。 +然而,LibreOffice 不仅仅是一个出色的办公套件。LibreOffice 支持宏,所以机智的用户可以自动完成重复性任务。它还具有终端命令的功能,因此你可以在不启动 LibreOffice 界面的情况下执行许多任务。 -想象一下,例如,打开 21 个文档,导航到**文件**菜单,到**导出**或**打印**菜单项,并将文件导出为 PDF 或 EPUB。这至少需要 84 次以上的点击,可能要花费一个小时的时间。比较一下,打开一个文档文件夹,并转换所有文件为 PDF 或 EPUB,只需要执行一个迅速的命令或菜单操作。转换将在后台运行,而你可以处理其他事情。只需要四分之一的时间,可能更少。 +想象一下,比如要打开 21 个文档,导航到**文件**菜单,到**导出**或**打印**菜单项,并将文件导出为 PDF 或 EPUB。这至少需要 84 次以上的点击,可能要花费一个小时的时间。相比之下,打开一个文档文件夹,并转换所有文件为 PDF 或 EPUB,只需要执行一个迅速的命令或菜单操作。转换将在后台运行,而你可以处理其他事情。只需要四分之一的时间,可能更少。 ``` $ libreoffice --headless --convert-to epub *.docx @@ -38,24 +38,23 @@ $ libreoffice --headless --convert-to epub *.docx ### Abiword 和 Gnumeric -有时,你并不需要一个大而全的办公套件。如果你喜欢让办公室工作保持简单,你可能会更好地使用一个轻量级和针对特定任务的应用程序。例如,我大部分时间都是用文本编辑器写文章,因为我知道在转换为 HTML 的过程中,所有的样式都会被丢弃。但有些时候,文字处理器是很有用的,无论是打开别人发给我的文档,还是因为我想用一种快速简单的方法来生成一些样式漂亮的文本。 +有时,你并不需要一个大而全的办公套件。如果你喜欢简化你的办公室工作,那么使用一个轻量级和针对特定任务的应用程序可能更好。例如,我大部分时间都是用文本编辑器写文章,因为我知道在转换为 HTML 的过程中,所有的样式都会被丢弃。但有些时候,文字处理器是很有用的,无论是打开别人发给我的文档,还是因为我想用一种快速简单的方法来生成一些样式漂亮的文本。 -[Abiword][3] 是一款简单的文字处理器,它基本支持流行的文档格式,并具备你所期望的文字处理器的所有基本功能。它并不意味着是一个完整的办公套件,这是它最大的特点。虽然没有太多的选择,但绝对有信息过载这样的事情,而这正是一个完整的办公套件或文字处理器有时会犯的错误。如果你想避免这种情况,那就用一些简单的东西来代替。 +[Abiword][3] 是一款简单的文字处理器,它基本支持流行的文档格式,并具备你所期望的文字处理器的所有基本功能。它并不意味着是一个完整的办公套件,这是它最大的特点。虽然没有太多的选择,但我们仍然处于信息过载的时代,这正是一个完整的办公套件或文字处理器有时会犯的错误。如果你想避免这种情况,那就用一些简单的东西来代替。 -同样,[Gnumeric][4] 项目提供了一个简单的电子表格应用程序。Gnumeric 避免了任何严格意义上的电子表格所不需要的功能,所以你仍然可以得到一个强大的公式语法、大量的函数,以及所有你需要的样式和操作单元格的选项。我不怎么使用电子表格,所以我发现自己在极少数需要查看或处理分类账中的数据时,对 Gnumeric 相当满意。 +同样,[Gnumeric][4] 项目提供了一个简单的电子表格应用程序。Gnumeric 避免了任何严格意义上的电子表格所不需要的功能,所以你仍然可以获得强大的公式语法、大量的函数,以及样式和操作单元格的所有选项。我不怎么使用电子表格,所以我发现自己在极少数需要查看或处理分类账中的数据时,对 Gnumeric 相当满意。 ### Pandoc -通过专门的命令和文件处理程序,可以得到更多的最小化。`pandoc` 命令专门用于文件转换。它就像 `libreoffice --headless` 命令一样,只是要处理的文档格式数量是它的十倍。你甚至可以用它来生成演示文稿! 如果你的部分工作是从一个文档中提取源文本,并将其格式化以用于多种传输模式,那么 Pandoc 是必要的,所以你应该[下载我们的攻略][5]看看。 +通过专门的命令和文件处理程序,可以最小化。`pandoc` 命令专门用于文件转换。它就像 `libreoffice --headless` 命令一样,只是要处理的文档格式数量是它的十倍。你甚至可以用它来生成演示文稿! 如果你的工作之一是从一个文档中提取源文本,并以多种格式交付它,那么 Pandoc 是必要的,所以你应该[下载我们的攻略][5]看看。 -广义上讲,Pandoc 代表的是一种完全不同的工作方式。它让你脱离了办公应用的束缚。它将你从试图将你的想法写成文字,并决定这些文字应该使用什么字体的工作中分离出来,同时。在纯文本中工作,然后转换为所有的交付目标,让你可以使用任何你想要的应用程序,无论是移动设备上的记事本,还是你碰巧坐在电脑前的简单文本编辑器,或者是云端的文本编辑器。 +广义上讲,Pandoc 代表的是一种完全不同的工作方式。它让你脱离了办公应用的束缚。它将你从试图将你的想法写成文字,并同时决定这些文字应该使用什么字体的工作中分离出来。在纯文本中工作,然后转换为各种交付格式,让你可以使用任何你想要的应用程序,无论是移动设备上的记事本,还是你碰巧坐在电脑前的简单文本编辑器,或者是云端的文本编辑器。 ### 寻找替代品 -Linux 有很多意想不到的替代品。你可以通过从你正在做的事情中退后一步,分析你的工作流程,评估你所需的结果,并调查那些声称可以做你所依赖的事情的新应用程序来找到它们。 +Linux 有很多意想不到的替代品。你可以从你正在做的事情中退后一步,分析你的工作流程,评估你所需的结果,并调查那些声称可以完全你的需求的新应用程序来找到它们。 -改变你所使用的工具、你的工作流程和你的日常工作可能会让你迷失方向,特别是当你不知道你要找的到底是什么的时候。但 Linux 的优势在于,你有机会重新评估你在多年的计算机使用过程中潜意识里形成的假设。如果你足够努力地寻找答案,你最终会意识到问题的初衷是什么。而且很多时候,你最终会欣赏你学到的东西。 - +改变你所使用的工具、工作流程和日常工作可能会让你迷失方向,特别是当你不知道你要找的到底是什么的时候。但 Linux 的优势在于,你有机会重新评估你在多年的计算机使用过程中潜意识里形成的假设。如果你足够努力地寻找答案,你最终会意识到问题所在。通常,你最终会欣赏你学到的东西。 -------------------------------------------------------------------------------- @@ -64,7 +63,7 @@ via: https://opensource.com/article/21/2/linux-workday 作者:[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 3d8c082830f00f42be5d0a4d0635c8fa901e0cb6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 19 Feb 2021 13:50:54 +0800 Subject: [PATCH 381/381] PUB @wxy https://linux.cn/article-13133-1.html --- ...open source tools that make Linux the ideal workstation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210208 3 open source tools that make Linux the ideal workstation.md (98%) diff --git a/translated/tech/20210208 3 open source tools that make Linux the ideal workstation.md b/published/20210208 3 open source tools that make Linux the ideal workstation.md similarity index 98% rename from translated/tech/20210208 3 open source tools that make Linux the ideal workstation.md rename to published/20210208 3 open source tools that make Linux the ideal workstation.md index 50b5f80f3d..82a71b31f7 100644 --- a/translated/tech/20210208 3 open source tools that make Linux the ideal workstation.md +++ b/published/20210208 3 open source tools that make Linux the ideal workstation.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13133-1.html) [#]: subject: (3 open source tools that make Linux the ideal workstation) [#]: via: (https://opensource.com/article/21/2/linux-workday) [#]: author: (Seth Kenlon https://opensource.com/users/seth)